kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: arm64: Support for per-guest fine grained traps configuration
@ 2023-03-23 15:48 Mark Brown
  2023-03-23 15:48 ` [PATCH v2 1/2] arm64: Add feature detection for fine grained traps Mark Brown
  2023-03-23 15:48 ` [PATCH v2 2/2] KVM: arm64: Move FGT value configuration to vCPU state Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2023-03-23 15:48 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
	Zenghui Yu, Catalin Marinas, Will Deacon
  Cc: Joey Gouly, linux-arm-kernel, kvmarm, Mark Brown

A number of upcoming features will require per guest configuration of
the fine grained traps enabled in the guest.  At present the only
management we do is for SME where we don't yet have guest support so we
unconditionally enable the traps while guests are running but this will
change going forward and at present the code isn't particularly
scalable.  This series aims to make it easier to configure which traps
are enabled for the guest by making the value set for the guest into
configuration in the vCPU data which we can set up based on the chosen
features rather than requiring conditional code in the trap enable and
disable paths.

This will have no benefit until one of the features that requires
configuration of these traps is merged but since there's a number of
such features it seems useful to decide on an approach to handling traps
for them which can be shared.

Changes in v2:
- List all the traps enabled by setting the registers to 0 by default.
- Save the HWFGxTR_EL2 valus in the vCPU/host sysreg structures.
- Link to v1: https://lore.kernel.org/r/20230301-kvm-arm64-fgt-v1-0-cfdf71ac67dc@kernel.org

---
Mark Brown (2):
      arm64: Add feature detection for fine grained traps
      KVM: arm64: Move FGT value configuration to vCPU state

 arch/arm64/include/asm/kvm_emulate.h       | 16 ++++++++++++++
 arch/arm64/include/asm/kvm_host.h          |  2 ++
 arch/arm64/kernel/cpufeature.c             | 11 ++++++++++
 arch/arm64/kvm/arm.c                       |  1 +
 arch/arm64/kvm/hyp/include/hyp/switch.h    | 35 ++++++++++++++++--------------
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h |  9 ++++++++
 arch/arm64/tools/cpucaps                   |  1 +
 7 files changed, 59 insertions(+), 16 deletions(-)
---
base-commit: e8d018dd0257f744ca50a729e3d042cf2ec9da65
change-id: 20230301-kvm-arm64-fgt-e5dd12746f67

Best regards,
-- 
Mark Brown <broonie@kernel.org>


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

end of thread, other threads:[~2023-03-28 15:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 15:48 [PATCH v2 0/2] KVM: arm64: Support for per-guest fine grained traps configuration Mark Brown
2023-03-23 15:48 ` [PATCH v2 1/2] arm64: Add feature detection for fine grained traps Mark Brown
2023-03-23 15:48 ` [PATCH v2 2/2] KVM: arm64: Move FGT value configuration to vCPU state Mark Brown
2023-03-23 19:34   ` Marc Zyngier
2023-03-23 22:08     ` Mark Brown
2023-03-28 15:27   ` Will Deacon
2023-03-28 15:44     ` Mark Brown

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).