public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/2] arm: cpu: Add optional CMOs by VA
@ 2023-02-07 16:20 Ying-Chun Liu (PaulLiu)
  2023-02-07 16:20 ` [PATCH 1/2] " Ying-Chun Liu (PaulLiu)
  2023-02-07 16:20 ` [PATCH 2/2] arm64: Initialize TLB memory if CMO_BY_VA_ONLY Ying-Chun Liu (PaulLiu)
  0 siblings, 2 replies; 9+ messages in thread
From: Ying-Chun Liu (PaulLiu) @ 2023-02-07 16:20 UTC (permalink / raw)
  To: u-boot; +Cc: Ying-Chun Liu (PaulLiu)

Exposing set/way cache maintenance to a virtual machine is unsafe, not
least because the instructions are not permission-checked but also
because they are not broadcast between CPUs. Consequently, KVM traps and
emulates such maintenance in the host kernel using by-VA operations and
looping over the stage-2 page-tables. However, when running under
protected KVM, these instructions are not able to be emulated and will
instead result in an exception being delivered to the guest.

Introduce CONFIG_CMO_BY_VA_ONLY so that virtual platforms can select
this option and perform by-VA cache maintenance instead of using the
set/way instructions.

Ying-Chun Liu (PaulLiu) (2):
  arm: cpu: Add optional CMOs by VA
  arm64: Initialize TLB memory if CMO_BY_VA_ONLY

 arch/arm/cpu/armv8/Kconfig    |  4 ++
 arch/arm/cpu/armv8/cache.S    | 50 +++++++++++++-----
 arch/arm/cpu/armv8/cache_v8.c | 97 ++++++++++++++++++++++++++++++++++-
 arch/arm/cpu/armv8/cpu.c      | 30 +++++++----
 arch/arm/lib/cache.c          |  9 ++++
 5 files changed, 164 insertions(+), 26 deletions(-)

-- 
2.39.1


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

end of thread, other threads:[~2023-02-08  8:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 16:20 [PATCH 0/2] arm: cpu: Add optional CMOs by VA Ying-Chun Liu (PaulLiu)
2023-02-07 16:20 ` [PATCH 1/2] " Ying-Chun Liu (PaulLiu)
2023-02-07 16:35   ` Marc Zyngier
2023-02-07 16:40     ` Tom Rini
2023-02-07 17:06       ` Marc Zyngier
2023-02-07 17:12         ` Tom Rini
2023-02-07 17:18     ` Paul Liu
2023-02-08  8:20       ` Marc Zyngier
2023-02-07 16:20 ` [PATCH 2/2] arm64: Initialize TLB memory if CMO_BY_VA_ONLY Ying-Chun Liu (PaulLiu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox