Skip to content

KVM: arm64: Fix CPU resume/on with pKVM

Quentin Perret kvmarm linux-arm-kernel lkml 1 version Applied

Status from this message: Applied to kvmarm/next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4KVM: arm64: Provide sanitized SYS_ID_AA64SMFR0_EL1 to nVHEarch/arm64/include/asm/kvm_hyp.h arch/arm64/kvm/arm.c arch/arm64/kvm/hyp/nvhe/sys_regs.c+3 -01 reply
2/4KVM: arm64: Introduce finalise_el2_state macroarch/arm64/include/asm/el2_setup.h arch/arm64/kernel/hyp-stub.S+80 -771 reply
3/4KVM: arm64: Use sanitized values in __check_override in nVHEarch/arm64/include/asm/el2_setup.h+14 -00 replies
4/4KVM: arm64: Finalise EL2 state from pKVM PSCI relayarch/arm64/kvm/hyp/nvhe/hyp-init.S+1 -00 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMark BrownMarc Zyngier
SeriesR-b
1/4A-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: arm64: Fix CPU resume/on with pKVM

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(-)
Signature · 1 line
2.39.1.456.gfc5497dd1b-goog