linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: arm64: Normalize cache configuration
@ 2022-12-11  5:16 Akihiko Odaki
  2022-12-11  5:16 ` [PATCH 1/3] arm64/sysreg: Add CCSIDR2_EL1 Akihiko Odaki
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Akihiko Odaki @ 2022-12-11  5:16 UTC (permalink / raw)
  Cc: 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 arm64_ftr_reg_ctrel0.sys_val, which
holds the CTR_EL0 value the userspace sees regardless of which physical
CPU it resides on.

HCR_TID2 is now always set as it is troublesome to detect the difference
of cache configurations among physical CPUs.

CSSELR_EL1 is now held in the memory instead of the corresponding
phyisccal register as the fabricated cache configuration may have a
cache level which does not exist in the physical CPU, and setting the
physical CSSELR_EL1 for the level results in an UNKNOWN behavior.

CLIDR_EL1 and CCSIDR_EL1 are now writable from the userspace so that
the VMM can restore the values saved with the old kernel.

Akihiko Odaki (3):
  arm64/sysreg: Add CCSIDR2_EL1
  arm64/cache: Move CLIDR macro definitions
  KVM: arm64: Normalize cache configuration

 arch/arm64/include/asm/cache.h             |   6 +
 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/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                  | 232 ++++++++++++---------
 arch/arm64/tools/sysreg                    |   5 +
 9 files changed, 153 insertions(+), 111 deletions(-)

-- 
2.38.1


_______________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2022-12-19 16:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-11  5:16 [PATCH 0/3] KVM: arm64: Normalize cache configuration Akihiko Odaki
2022-12-11  5:16 ` [PATCH 1/3] arm64/sysreg: Add CCSIDR2_EL1 Akihiko Odaki
2022-12-19 13:12   ` Mark Brown
2022-12-19 14:47     ` Marc Zyngier
2022-12-19 14:50       ` Mark Brown
2022-12-19 15:04         ` Marc Zyngier
2022-12-11  5:16 ` [PATCH 2/3] arm64/cache: Move CLIDR macro definitions Akihiko Odaki
2022-12-11  5:17 ` [PATCH 3/3] KVM: arm64: Normalize cache configuration Akihiko Odaki
2022-12-14 14:58   ` Marc Zyngier
2022-12-14  0:59 ` [PATCH 0/3] " Oliver Upton

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