Skip to content

Commit f66857b

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
KVM: arm64: Hide S1POE from guests when not supported by the host
When CONFIG_ARM64_POE is disabled, KVM does not save/restore POR_EL1. However, ID_AA64MMFR3_EL1 sanitisation currently exposes the feature to guests whenever the hardware supports it, ignoring the host kernel configuration. If a guest detects this feature and attempts to use it, the host will fail to context-switch POR_EL1, potentially leading to state corruption. Fix this by masking ID_AA64MMFR3_EL1.S1POE in the sanitised system registers, preventing KVM from advertising the feature when the host does not support it (i.e. system_supports_poe() is false). Fixes: 70ed723 ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1") Signed-off-by: Fuad Tabba <tabba@google.com> Link: https://patch.msgid.link/20260213143815.1732675-2-tabba@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 6316366 commit f66857b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/arm64/kvm/sys_regs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,9 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
18161816
ID_AA64MMFR3_EL1_SCTLRX |
18171817
ID_AA64MMFR3_EL1_S1POE |
18181818
ID_AA64MMFR3_EL1_S1PIE;
1819+
1820+
if (!system_supports_poe())
1821+
val &= ~ID_AA64MMFR3_EL1_S1POE;
18191822
break;
18201823
case SYS_ID_MMFR4_EL1:
18211824
val &= ~ID_MMFR4_EL1_CCIDX;

0 commit comments

Comments
 (0)