]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm64: Remove dead code resetting HCR_EL2 for pKVM
authorFuad Tabba <tabba@google.com>
Thu, 22 Jan 2026 11:22:15 +0000 (11:22 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 23 Jan 2026 11:28:48 +0000 (11:28 +0000)
The pKVM lifecycle does not support tearing down the hypervisor and
returning to the hyp stub once initialized. The transition to protected
mode is one-way.

Consequently, the code path in hyp-init.S responsible for resetting
EL2 registers (triggered by kexec or hibernation) is unreachable in
protected mode.

Remove the dead code handling HCR_EL2 reset for
ARM64_KVM_PROTECTED_MODE.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260122112218.531948-2-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/hyp-init.S

index aada42522e7be36371a1a48cc5eaff8972c02436..0d42eedc7167c7390a2b6c4ca89cf9c4db74c15b 100644 (file)
@@ -260,11 +260,6 @@ reset:
        msr     sctlr_el2, x5
        isb
 
-alternative_if ARM64_KVM_PROTECTED_MODE
-       mov_q   x5, HCR_HOST_NVHE_FLAGS
-       msr_hcr_el2 x5
-alternative_else_nop_endif
-
        /* Install stub vectors */
        adr_l   x5, __hyp_stub_vectors
        msr     vbar_el2, x5