linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: arm64: Move host-specific data out of kvm_vcpu_arch
@ 2024-03-02 11:19 Marc Zyngier
  2024-03-02 11:19 ` [PATCH 1/5] KVM: arm64: Add accessor for per-CPU state Marc Zyngier
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Marc Zyngier @ 2024-03-02 11:19 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel, kvm
  Cc: James Morse, Suzuki K Poulose, Oliver Upton, Zenghui Yu,
	James Clark, Anshuman Khandual, Mark Brown

It appears that over the years, we have accumulated a lot of cruft in
the kvm_vcpu_arch structure. Part of the gunk is data that is strictly
host CPU specific, and this result in two main problems:

- the structure itself is stupidly large, over 8kB. With the
  arch-agnostic kvm_vcpu, we're above 10kB, which is insane. This has
  some ripple effects, as we need physically contiguous allocation to
  be able to map it at EL2 for !VHE. There is more to it though, as
  some data structures, although per-vcpu, could be allocated
  separately.

- We lose track of the life-cycle of this data, because we're
  guaranteed that it will be around forever and we start relying on
  wrong assumptions. This is becoming a maintenance burden.

This series rectifies some of these things, starting with the two main
offenders: debug and FP, a lot of which gets pushed out to the per-CPU
host structure. Indeed, their lifetime really isn't that of the vcpu,
but tied to the physical CPU the vpcu runs on.

This results in a small reduction of the vcpu size, but mainly a much
clearer understanding of the life-cycle of these structures.

Patches against v6.8-rc6.

Marc Zyngier (5):
  KVM: arm64: Add accessor for per-CPU state
  KVM: arm64: Exclude host_debug_data from vcpu_arch
  KVM: arm64: Exclude mdcr_el2_host from kvm_vcpu_arch
  KVM: arm64: Exclude host_fpsimd_state pointer from kvm_vcpu_arch
  KVM: arm64: Exclude FP ownership from kvm_vcpu_arch

 arch/arm64/include/asm/kvm_emulate.h      |  4 +-
 arch/arm64/include/asm/kvm_host.h         | 65 ++++++++++++++---------
 arch/arm64/kvm/arm.c                      |  8 +--
 arch/arm64/kvm/fpsimd.c                   | 13 +++--
 arch/arm64/kvm/hyp/include/hyp/debug-sr.h |  8 +--
 arch/arm64/kvm/hyp/include/hyp/switch.h   | 23 ++++----
 arch/arm64/kvm/hyp/nvhe/debug-sr.c        |  8 +--
 arch/arm64/kvm/hyp/nvhe/hyp-main.c        |  3 --
 arch/arm64/kvm/hyp/nvhe/psci-relay.c      |  2 +-
 arch/arm64/kvm/hyp/nvhe/setup.c           |  3 +-
 arch/arm64/kvm/hyp/nvhe/switch.c          |  6 +--
 arch/arm64/kvm/hyp/vhe/switch.c           |  6 +--
 arch/arm64/kvm/hyp/vhe/sysreg-sr.c        |  4 +-
 arch/arm64/kvm/pmu.c                      |  2 +-
 14 files changed, 79 insertions(+), 76 deletions(-)

-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-03-11 18:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-02 11:19 [PATCH 0/5] KVM: arm64: Move host-specific data out of kvm_vcpu_arch Marc Zyngier
2024-03-02 11:19 ` [PATCH 1/5] KVM: arm64: Add accessor for per-CPU state Marc Zyngier
2024-03-04 12:05   ` Suzuki K Poulose
2024-03-09 13:00     ` Marc Zyngier
2024-03-11  4:50   ` Dongli Zhang
2024-03-11 17:13     ` Marc Zyngier
2024-03-02 11:19 ` [PATCH 2/5] KVM: arm64: Exclude host_debug_data from vcpu_arch Marc Zyngier
2024-03-02 11:19 ` [PATCH 3/5] KVM: arm64: Exclude mdcr_el2_host from kvm_vcpu_arch Marc Zyngier
2024-03-02 11:19 ` [PATCH 4/5] KVM: arm64: Exclude host_fpsimd_state pointer " Marc Zyngier
2024-03-04 20:45   ` Mark Brown
2024-03-02 11:19 ` [PATCH 5/5] KVM: arm64: Exclude FP ownership " Marc Zyngier
2024-03-04 19:10   ` Mark Brown
2024-03-06  9:43     ` Marc Zyngier
2024-03-06 22:19       ` Mark Brown
2024-03-07 11:10         ` Marc Zyngier
2024-03-07 14:26           ` Mark Brown
2024-03-09 11:01             ` Marc Zyngier
2024-03-11 18:42               ` 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).