Skip to content

KVM: arm64: Fix HCRX_EL2.GCSEn handling

Marc Zyngier kvmarm linux-arm-kernel 1 version Applied

Status from this message: Applied to fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: Properly save/restore HCRX_EL2arch/arm64/kvm/hyp/include/hyp/switch.h+6 -70 replies
2/2KVM: arm64: Kill HCRX_HOST_FLAGSarch/arm64/include/asm/el2_setup.h arch/arm64/include/asm/kvm_arm.h+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: arm64: Fix HCRX_EL2.GCSEn handling

Will points out[1] that GCS is completely busted on the host if we ever run a guest, as HCRX_EL2 gets set to a fixed value on vcpu exit, value that doesn't include the GCSEn bit. This is likely to kaboom on a nVHE/hVHE setup.

Obviously, nobody ever tested this.

This series moves the handling of HCRX_EL2 to being correctly saved/restored, which should address the problem. I say "should", as in keeping with the tradition, I haven't tested it either. Or at least not with GCS, as I don't have the correct SW setup (I don't even know what you need to enable GCS).

I'd very much appreciate some help in testing this.

Marc Zyngier (2):
KVM: arm64: Properly save/restore HCRX_EL2
KVM: arm64: Kill HCRX_HOST_FLAGS

 arch/arm64/include/asm/el2_setup.h      |  2 +-
 arch/arm64/include/asm/kvm_arm.h        |  1 -
 arch/arm64/kvm/hyp/include/hyp/switch.h | 13 ++++++-------
 3 files changed, 7 insertions(+), 9 deletions(-)
Signature · 1 line
2.39.2