linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] KVM: arm64: Fix CPU resume/on with pKVM
@ 2023-02-01 10:37 Quentin Perret
  2023-02-01 10:37 ` [PATCH 1/4] KVM: arm64: Provide sanitized SYS_ID_AA64SMFR0_EL1 to nVHE Quentin Perret
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Quentin Perret @ 2023-02-01 10:37 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Marc Zyngier, James Morse,
	Suzuki K Poulose, Oliver Upton, Zenghui Yu, Mark Brown
  Cc: linux-arm-kernel, linux-kernel, kvmarm, kvmarm, kernel-team,
	Quentin Perret

When using pKVM, we do not reset the EL2 exception vectors back to the
stubs for e.g. Power Management or CPU hotplug as we normally do in KVM.
As consequence, the initialisation perfomed by __finalise_el2 is missing
on e.g. the CPU_RESUME path with pKVM, hence leaving certain registers
in an incorrect state.

One such example is ZCR_EL2 which remains configured with SVE traps
enabled. And so using SVE on a CPU that has gone through a hotplug
off/on cycle leads to a hyp panic. Not good.

This series fixes this by macroizing the first half of __finalise_el2
(that is, the part that is not specific to VHE) to allow its re-use
from pKVM's PSCI relay.

Quentin Perret (4):
  KVM: arm64: Provide sanitized SYS_ID_AA64SMFR0_EL1 to nVHE
  KVM: arm64: Introduce finalise_el2_state macro
  KVM: arm64: Use sanitized values in __check_override in nVHE
  KVM: arm64: Finalise EL2 state from pKVM PSCI relay

 arch/arm64/include/asm/el2_setup.h | 92 ++++++++++++++++++++++++++++++
 arch/arm64/include/asm/kvm_hyp.h   |  1 +
 arch/arm64/kernel/hyp-stub.S       | 79 +------------------------
 arch/arm64/kvm/arm.c               |  1 +
 arch/arm64/kvm/hyp/nvhe/hyp-init.S |  1 +
 arch/arm64/kvm/hyp/nvhe/sys_regs.c |  1 +
 6 files changed, 98 insertions(+), 77 deletions(-)

-- 
2.39.1.456.gfc5497dd1b-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-02-06 17:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 10:37 [PATCH 0/4] KVM: arm64: Fix CPU resume/on with pKVM Quentin Perret
2023-02-01 10:37 ` [PATCH 1/4] KVM: arm64: Provide sanitized SYS_ID_AA64SMFR0_EL1 to nVHE Quentin Perret
2023-02-01 14:15   ` Mark Brown
2023-02-01 10:37 ` [PATCH 2/4] KVM: arm64: Introduce finalise_el2_state macro Quentin Perret
2023-02-01 14:17   ` Mark Brown
2023-02-01 10:37 ` [PATCH 3/4] KVM: arm64: Use sanitized values in __check_override in nVHE Quentin Perret
2023-02-01 10:37 ` [PATCH 4/4] KVM: arm64: Finalise EL2 state from pKVM PSCI relay Quentin Perret
2023-02-01 14:48 ` [PATCH 0/4] KVM: arm64: Fix CPU resume/on with pKVM Marc Zyngier
2023-02-01 16:57   ` Quentin Perret
2023-02-02 21:43     ` Oliver Upton
2023-02-06 17:12 ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).