Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Optimise away S1POE handling when not supported by host

Although ID register sanitisation prevents guests from seeing the
feature, adding this check to the helper allows the compiler to entirely
eliminate S1POE-specific code paths (such as context switching POR_EL1)
when the host kernel is compiled without support (CONFIG_ARM64_POE is
disabled).

This aligns with the pattern used for other optional features like SVE
(kvm_has_sve()) and FPMR (kvm_has_fpmr()), ensuring no POE logic if the
host lacks support, regardless of the guest configuration state.

Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260213143815.1732675-3-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Fuad Tabba and committed by
Marc Zyngier
9cb0468d f66857ba

+2 -1
+2 -1
arch/arm64/include/asm/kvm_host.h
··· 1616 1616 (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1PIE, IMP)) 1617 1617 1618 1618 #define kvm_has_s1poe(k) \ 1619 - (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP)) 1619 + (system_supports_poe() && \ 1620 + kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP)) 1620 1621 1621 1622 #define kvm_has_ras(k) \ 1622 1623 (kvm_has_feat((k), ID_AA64PFR0_EL1, RAS, IMP))