Skip to content

KVM: arm64: Host EL2 entry improvements

Marc Zyngier kvm kvmarm linux-arm-kernel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesIn review
  2. v18 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: arm64: Add kimg_hyp_va() helperarch/arm64/include/asm/kvm_mmu.h arch/arm64/kvm/va_layout.c+68 -00 replies
2/5KVM: arm64: Turn host HVC handling into a dispatch tablearch/arm64/kernel/image-vars.h arch/arm64/kvm/hyp/nvhe/hyp-main.c+135 -940 replies
3/5KVM: arm64: Patch kimage_voffset instead of loading the EL1 valuearch/arm64/include/asm/kvm_mmu.h arch/arm64/kernel/image-vars.h arch/arm64/kvm/hyp/nvhe/host.S +1 more+30 -72 replies
4/5KVM: arm64: Simplify __kvm_enable_ssbs()arch/arm64/include/asm/kvm_asm.h arch/arm64/include/asm/sysreg.h arch/arm64/kvm/hyp/nvhe/hyp-main.c +1 more+6 -140 replies
5/5KVM: arm64: Avoid repetitive stack access on host EL1 to EL2 exceptionarch/arm64/kvm/hyp/nvhe/host.S+3 -30 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchAlexandru Elisei
1/5
2/5R-b
3/5
4/5R-b
5/5R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/5] KVM: arm64: Host EL2 entry improvements

This small series reworks various bits of the host EL2 entry after Andrew's extensive rework to move from direct function calls to a SMCCC implementation.

The first 2 patches allow the use of direct function pointers at EL2, something that we can't do at the moment (other than PC-relative addressing). This requires a helper to translate pointers at runtime, but the result is neat enough. This allows the rewrite of the host HVC handling in a more maintainable way.

Note that this version now includes the result of a discussion with Nick, providing some funky pointer mangling in order to make the use of these pointers vaguely safer (no, they are not safe at all).

Another patch removes the direct use of kimage_voffset, which we won't be able to trust for much longer.

The last two patches are just cleanups and optimisations.

* From v1 [1]:
- Merged the 3 first patches as fixes
- Added pointer mangling for function calls
- Moved EL2 entry ldp a couple of instructions later (as suggested by Alex)
- Rebased on top of -rc3

[1] https://lore.kernel.org/r/[email protected]

Marc Zyngier (5):
KVM: arm64: Add kimg_hyp_va() helper
KVM: arm64: Turn host HVC handling into a dispatch table
KVM: arm64: Patch kimage_voffset instead of loading the EL1 value
KVM: arm64: Simplify __kvm_enable_ssbs()
KVM: arm64: Avoid repetitive stack access on host EL1 to EL2 exception

 arch/arm64/include/asm/kvm_asm.h    |   2 -
 arch/arm64/include/asm/kvm_mmu.h    |  40 +++++
 arch/arm64/include/asm/sysreg.h     |   1 +
 arch/arm64/kernel/image-vars.h      |   5 +-
 arch/arm64/kvm/hyp/nvhe/host.S      |  11 +-
 arch/arm64/kvm/hyp/nvhe/hyp-main.c  | 232 +++++++++++++++++-----------
 arch/arm64/kvm/hyp/nvhe/sysreg-sr.c |  11 --
 arch/arm64/kvm/va_layout.c          |  56 +++++++
 8 files changed, 241 insertions(+), 117 deletions(-)
Signature · 1 line
2.28.0