All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/7] KVM: arm64: Normalize cache configuration
@ 2022-12-30  9:54 ` Akihiko Odaki
  0 siblings, 0 replies; 45+ messages in thread
From: Akihiko Odaki @ 2022-12-30  9:54 UTC (permalink / raw)
  Cc: Mark Brown, Marc Zyngier, linux-kernel, kvmarm, kvmarm,
	linux-arm-kernel, Mathieu Poirier, Oliver Upton,
	Suzuki K Poulose, Alexandru Elisei, James Morse, Will Deacon,
	Catalin Marinas, asahi, Alyssa Rosenzweig, Sven Peter,
	Hector Martin, Akihiko Odaki

Before this change, the cache configuration of the physical CPU was
exposed to vcpus. This is problematic because the cache configuration a
vcpu sees varies when it migrates between vcpus with different cache
configurations.

Fabricate cache configuration from the sanitized value, which holds the
CTR_EL0 value the userspace sees regardless of which physical CPU it
resides on.

V4 -> V5:
- Noted why cache level existence check is unnecessary when fabricating
  CCSIDR_EL1 value.
- Removed FWB check. It is necessary as CLIDR_EL1.{LoUU, LoIUS} on the
  host are {0, 0} if FWB is enabled, and such a CLIDR_EL1 value sets
  the IDC bit of the sanitized CTR_EL0 value, which is already checked.
- Removed UNDEF injection when reading CCSIDR_EL1 with an invalid
  CSSELR_EL1 value.
- Added a check for CLIDR_EL1.{LoUU,LoC,LoUIS} values set from the
  userspace.

V3 -> V4:
- Implemented UNKNOWN system register definition for CCSIDR_EL1
- Added a comment about the relation between CCSIDR_EL1 and FEAT_CCIDX
- Squashed "Normalize cache configuration" and "Allow user to set
  CCSIDR_EL1"
  The intermediate state between them did not make much sense.
- Introduced FIELD_GET to extract CCSIDR_EL1_LineSize.

V2 -> V3:
- Corrected message for patch "Normalize cache configuration"
- Split patch "Normalize cache configuration"
- Added handling for CSSELR_EL1.TnD
- Added code to ignore RES0 in CSSELR_EL1
- Replaced arm64_ftr_reg_ctrel0.sys_val with
  read_sanitised_ftr_reg(SYS_CTR_EL0)
- Fixed vcpu->arch.ccsidr initialziation
- Added CCSIDR_EL1 sanitization
- Added FWB check
- Added a comment for CACHE_TYPE_SEPARATE
- Added MTE tag cache creation code for CLIDR_EL1 fabrication
- Removed CLIDR_EL1 reset code for reset caused by guest
- Added a comment for CCSIDR2

V2: https://lore.kernel.org/lkml/20221211051700.275761-2-akihiko.odaki@daynix.com/
V1: https://lore.kernel.org/lkml/525ff263-90b3-5b12-da31-171b09f9ad1b@daynix.com/

Akihiko Odaki (6):
  arm64/sysreg: Convert CCSIDR_EL1 to automatic generation
  arm64/sysreg: Add CCSIDR2_EL1
  arm64/cache: Move CLIDR macro definitions
  KVM: arm64: Always set HCR_TID2
  KVM: arm64: Mask FEAT_CCIDX
  KVM: arm64: Normalize cache configuration

Marc Zyngier (1):
  arm64: Allow the definition of UNKNOWN system register fields

 arch/arm64/include/asm/cache.h             |   9 +
 arch/arm64/include/asm/kvm_arm.h           |   3 +-
 arch/arm64/include/asm/kvm_emulate.h       |   4 -
 arch/arm64/include/asm/kvm_host.h          |   6 +-
 arch/arm64/include/asm/sysreg.h            |   1 -
 arch/arm64/kernel/cacheinfo.c              |   5 -
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h |   2 -
 arch/arm64/kvm/reset.c                     |   1 +
 arch/arm64/kvm/sys_regs.c                  | 256 +++++++++++++--------
 arch/arm64/tools/gen-sysreg.awk            |  20 +-
 arch/arm64/tools/sysreg                    |  17 ++
 11 files changed, 212 insertions(+), 112 deletions(-)

-- 
2.38.1


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

end of thread, other threads:[~2023-01-08 18:56 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-30  9:54 [PATCH v5 0/7] KVM: arm64: Normalize cache configuration Akihiko Odaki
2022-12-30  9:54 ` Akihiko Odaki
2022-12-30  9:54 ` Akihiko Odaki
2022-12-30  9:54 ` Akihiko Odaki
2022-12-30  9:54 ` [PATCH v5 1/7] arm64: Allow the definition of UNKNOWN system register fields Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54 ` [PATCH v5 2/7] arm64/sysreg: Convert CCSIDR_EL1 to automatic generation Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54 ` [PATCH v5 3/7] arm64/sysreg: Add CCSIDR2_EL1 Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54 ` [PATCH v5 4/7] arm64/cache: Move CLIDR macro definitions Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54 ` [PATCH v5 5/7] KVM: arm64: Always set HCR_TID2 Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2023-01-06  4:29   ` Reiji Watanabe
2023-01-06  4:29     ` Reiji Watanabe
2022-12-30  9:54 ` [PATCH v5 6/7] KVM: arm64: Mask FEAT_CCIDX Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2023-01-05 22:22   ` Oliver Upton
2023-01-05 22:22     ` Oliver Upton
2023-01-07  9:53     ` Akihiko Odaki
2023-01-07  9:53       ` Akihiko Odaki
2023-01-08 18:54       ` Oliver Upton
2023-01-08 18:54         ` Oliver Upton
2022-12-30  9:54 ` [PATCH v5 7/7] KVM: arm64: Normalize cache configuration Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2022-12-30  9:54   ` Akihiko Odaki
2023-01-05 20:45   ` Oliver Upton
2023-01-05 20:45     ` Oliver Upton
2023-01-05 20:45     ` Oliver Upton
2023-01-07 10:04     ` Akihiko Odaki
2023-01-07 10:04       ` Akihiko Odaki

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.