All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] KVM: arm64: emulation for CTR_EL0
@ 2024-05-14  7:22 ` Sebastian Ott
  0 siblings, 0 replies; 48+ messages in thread
From: Sebastian Ott @ 2024-05-14  7:22 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, linux-kernel
  Cc: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
	Catalin Marinas, Will Deacon

Hej folks,

I'm looking into supporting migration between 2 Ampere Altra (Max)
machines (using Neoverse-N1). They are almost identical regarding
their feature id register state except for CTR_EL0.DIC which is set
on one machine but not the other.

CTR_EL0 is currently marked as invariant and migrating a VM between
those 2 machines using qemu fails.

Changes RFC [0] -> V1 [1]:
 * store the emulated value per VM and not per VCPU
 * allow to change more values than just the DIC bit
 * only trap guest access to that reg when needed
 * make sure to not present the guest with an inconsistent register set
Changes V1 -> V2 [2]:
 * implemented Marc's suggestion for keeping registers consistent while
   not breaking userspace ABI / expectations (I hope correctly this time)
 * keep the shadowed value valid at all time
 * unify the code to setup traps
Changes V2 -> V3:
 * rebased to kvm-arm-next (to include Olivers idreg fixes)
 * fixed VM ops trapping for non-FWB CPUs
 * fixed writable mask for CLIDR_EL1
 * re-added manual ctr validation (using arm64_check_features() had a
   side effect with the way .reset is working for these registers)
 * added a testcase

Thanks,
Sebastian

[0]: https://lore.kernel.org/all/20240318111636.10613-1-sebott@redhat.com/T/
[1]: https://lore.kernel.org/lkml/20240405120108.11844-1-sebott@redhat.com/T/
[2]: https://lore.kernel.org/lkml/20240426104950.7382-1-sebott@redhat.com/T/

Sebastian Ott (6):
  KVM: arm64: unify code to prepare traps
  KVM: arm64: maintain per VM value for CTR_EL0
  KVM: arm64: add emulation for CTR_EL0 register
  KVM: arm64: show writable masks for feature registers
  KVM: arm64: rename functions for invariant sys regs
  KVM: selftests: arm64: Test writes to CTR_EL0

 arch/arm64/include/asm/kvm_emulate.h          |  40 +---
 arch/arm64/include/asm/kvm_host.h             |   4 +-
 arch/arm64/kvm/arm.c                          |   2 +-
 arch/arm64/kvm/sys_regs.c                     | 210 ++++++++++++++----
 .../selftests/kvm/aarch64/set_id_regs.c       |  16 ++
 5 files changed, 197 insertions(+), 75 deletions(-)

-- 
2.42.0


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

end of thread, other threads:[~2024-05-30 17:21 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14  7:22 [PATCH v3 0/6] KVM: arm64: emulation for CTR_EL0 Sebastian Ott
2024-05-14  7:22 ` Sebastian Ott
2024-05-14  7:22 ` [PATCH v3 1/6] KVM: arm64: unify code to prepare traps Sebastian Ott
2024-05-14  7:22   ` Sebastian Ott
2024-05-27  8:01   ` Shaoqin Huang
2024-05-27  8:01     ` Shaoqin Huang
2024-05-27 14:23     ` Sebastian Ott
2024-05-27 14:23       ` Sebastian Ott
2024-05-30 16:54   ` Eric Auger
2024-05-30 16:54     ` Eric Auger
2024-05-14  7:22 ` [PATCH v3 2/6] KVM: arm64: maintain per VM value for CTR_EL0 Sebastian Ott
2024-05-14  7:22   ` Sebastian Ott
2024-05-27  8:37   ` Shaoqin Huang
2024-05-27  8:37     ` Shaoqin Huang
2024-05-29 10:37   ` Eric Auger
2024-05-29 10:37     ` Eric Auger
2024-05-29 15:51     ` Sebastian Ott
2024-05-29 15:51       ` Sebastian Ott
2024-05-29 17:35       ` Eric Auger
2024-05-29 17:35         ` Eric Auger
2024-05-30 11:24         ` Sebastian Ott
2024-05-30 11:24           ` Sebastian Ott
2024-05-30 12:17           ` Eric Auger
2024-05-30 12:17             ` Eric Auger
2024-05-14  7:22 ` [PATCH v3 3/6] KVM: arm64: add emulation for CTR_EL0 register Sebastian Ott
2024-05-14  7:22   ` Sebastian Ott
2024-05-29 10:37   ` Eric Auger
2024-05-29 10:37     ` Eric Auger
2024-05-30 12:56     ` Sebastian Ott
2024-05-30 12:56       ` Sebastian Ott
2024-05-30 17:20       ` Eric Auger
2024-05-30 17:20         ` Eric Auger
2024-05-14  7:22 ` [PATCH v3 4/6] KVM: arm64: show writable masks for feature registers Sebastian Ott
2024-05-14  7:22   ` Sebastian Ott
2024-05-29 13:49   ` Eric Auger
2024-05-29 13:49     ` Eric Auger
2024-05-14  7:22 ` [PATCH v3 5/6] KVM: arm64: rename functions for invariant sys regs Sebastian Ott
2024-05-14  7:22   ` Sebastian Ott
2024-05-29 13:58   ` Eric Auger
2024-05-29 13:58     ` Eric Auger
2024-05-29 15:29     ` Sebastian Ott
2024-05-29 15:29       ` Sebastian Ott
2024-05-29 17:17       ` Eric Auger
2024-05-29 17:17         ` Eric Auger
2024-05-14  7:22 ` [PATCH v3 6/6] KVM: selftests: arm64: Test writes to CTR_EL0 Sebastian Ott
2024-05-14  7:22   ` Sebastian Ott
2024-05-29 17:07   ` Eric Auger
2024-05-29 17:07     ` Eric Auger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.