[PATCH v3 3/3] KVM: arm64: pkvm: Reset GICv3 LRs in the hypervisor
Vincent Donnefort
vdonnefort at google.com
Mon Oct 26 09:39:37 PDT 2026
After the host is deprivileged, pKVM can't trust the host for resetting
the vGIC LRs whose value is architecturally UNKNOWN when the CPU boots
or resumes. Add a blanket cover in the CPU_ON/CPU_SUSPEND path.
Fixes: 1025c8c0c6ac ("KVM: arm64: Wrap the host with a stage 2")
Tested-by: Fuad Tabba <fuad.tabba at linux.dev>
Reviewed-by: Fuad Tabba <fuad.tabba at linux.dev>
Signed-off-by: Vincent Donnefort <vdonnefort at google.com>
---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kvm/hyp/nvhe/psci-relay.c b/arch/arm64/kvm/hyp/nvhe/psci-relay.c
index e20db999e328..2863b4b90ea8 100644
--- a/arch/arm64/kvm/hyp/nvhe/psci-relay.c
+++ b/arch/arm64/kvm/hyp/nvhe/psci-relay.c
@@ -213,6 +213,10 @@ static void __noreturn __kvm_host_psci_cpu_entry(unsigned long pc, unsigned long
write_sysreg_el1(INIT_SCTLR_EL1_MMU_OFF, SYS_SCTLR);
write_sysreg(INIT_PSTATE_EL1, SPSR_EL2);
+ /* We can't trust the host to reset the LRs */
+ if (hyp_gicv3_nr_lr)
+ __vgic_v3_init_lrs();
+
trace_hyp_exit(host_ctxt, HYP_REASON_PSCI);
__host_enter(host_ctxt);
}
--
2.56.0.257.gf7497c7d27-goog
More information about the linux-arm-kernel
mailing list