mbox series

[0/5] KVM: arm64: Fix handling of TCR2_EL1

Message ID 20240625130042.259175-1-maz@kernel.org (mailing list archive)
Headers show
Series KVM: arm64: Fix handling of TCR2_EL1 | expand

Message

Marc Zyngier June 25, 2024, 1 p.m. UTC
As I'm inching towards supporting FEAT_S1PIE in a NV guest (oh, the
fun I'm having!), it has become obvious that we're missing the basics
when it comes to:

- VM configuration: HCRX_EL2.TCR2En is forced to 1, and we blindly
  save/restore stuff.

- trap bit description and routing: none, obviously, since we make a
  point in not trapping.

Given that these are prerequisites for the NV work and that we should
have had that from the beginning, I would like to plug them before
piling more patches on top.


Marc Zyngier (5):
  KVM: arm64: Correctly honor the presence of FEAT_TCRX
  KVM: arm64: Get rid of HCRX_GUEST_FLAGS
  KVM: arm64: Make TCR2_EL1 save/restore dependent on the VM features
  KVM: arm64: Make PIR{,E0}_EL1 save/restore conditional on FEAT_TCRX
  KVM: arm64: Honor trap routing for TCR2_EL1

 arch/arm64/include/asm/kvm_arm.h           |  1 -
 arch/arm64/kvm/emulate-nested.c            | 13 ++++++++
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 35 +++++++++++++++-------
 arch/arm64/kvm/sys_regs.c                  | 17 ++++++++++-
 4 files changed, 54 insertions(+), 12 deletions(-)

Comments

Oliver Upton June 28, 2024, 7:13 p.m. UTC | #1
On Tue, 25 Jun 2024 14:00:36 +0100, Marc Zyngier wrote:
> As I'm inching towards supporting FEAT_S1PIE in a NV guest (oh, the
> fun I'm having!), it has become obvious that we're missing the basics
> when it comes to:
> 
> - VM configuration: HCRX_EL2.TCR2En is forced to 1, and we blindly
>   save/restore stuff.
> 
> [...]

Applied to kvmarm/next, thanks!

[1/5] KVM: arm64: Correctly honor the presence of FEAT_TCRX
      https://git.kernel.org/kvmarm/kvmarm/c/9b58e665d6b2
[2/5] KVM: arm64: Get rid of HCRX_GUEST_FLAGS
      https://git.kernel.org/kvmarm/kvmarm/c/a3ee9ce88ba3
[3/5] KVM: arm64: Make TCR2_EL1 save/restore dependent on the VM features
      https://git.kernel.org/kvmarm/kvmarm/c/1b04fd40275e
[4/5] KVM: arm64: Make PIR{,E0}_EL1 save/restore conditional on FEAT_TCRX
      https://git.kernel.org/kvmarm/kvmarm/c/663abf04ee4d
[5/5] KVM: arm64: Honor trap routing for TCR2_EL1
      https://git.kernel.org/kvmarm/kvmarm/c/91e9cc70b775

--
Best,
Oliver