All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tso: aarch64: Expose TSO for virtualized linux on Apple Silicon
@ 2024-04-10 21:16 ` Zayd Qumsieh
  0 siblings, 0 replies; 14+ messages in thread
From: Zayd Qumsieh @ 2024-04-10 21:16 UTC (permalink / raw)
  To: zayd_qumsieh
  Cc: Catalin Marinas, Will Deacon, Mark Brown, Ard Biesheuvel,
	Mark Rutland, Mateusz Guzik, Anshuman Khandual, Marc Zyngier,
	Oliver Upton, Miguel Luis, Joey Gouly, Christoph Paasch,
	Kees Cook, Sami Tolvanen, Baoquan He, Lecopzer Chen,
	Joel Granados, Dawei Li, Andrew Morton, Florent Revest,
	David Hildenbrand, Stefan Roesch, Andy Chiu, Josh Triplett,
	Oleg Nesterov, Helge Deller, Zev Weiss, Ondrej Mosnacek,
	Miguel Ojeda, linux-arm-kernel, linux-kernel

x86 CPUs use a TSO memory model. Apple Silicon CPUs have the ability to
selectively use a TSO memory model. This can be done by setting the
ACTLR.TSOEN bit to 1. This feature is useful for x86 emulators, since it
removes the need for emulators to insert memory barriers in order to abide
by the TSO memory model. This patch series will add ACTLR.TSOEN support to
virtualized linux on Apple Silicon machines. Userspace will be able to use
a prctl to change the memory model of the CPU from the default ARM64 memory
model to a TSO memory model.

A simple test can be used to determine if the TSO memory model is in use.
This must be done on Apple Silicon MacOS Sonoma version 14.4 or later,
since earlier versions do not support modification of the TSOEN bit.
https://github.com/saagarjha/TSOEnabler/blob/master/testtso/main.c

This program will hang indefinitely if TSO is in use, and will crash almost
immediately if it is not in use.

Zayd Qumsieh (3):
  tso: aarch64: allow linux kernel to read/write ACTLR.TSOEN
  tso: aarch64: context-switch tso bit on thread switch
  tso: aarch64: allow userspace to set tso bit using prctl

 arch/arm64/Kconfig                 | 19 +++++++++
 arch/arm64/include/asm/processor.h |  4 ++
 arch/arm64/include/asm/sysreg.h    |  7 ++++
 arch/arm64/include/asm/tso.h       | 19 +++++++++
 arch/arm64/kernel/Makefile         |  2 +-
 arch/arm64/kernel/process.c        | 61 +++++++++++++++++++++++++++++
 arch/arm64/kernel/tso.c            | 62 ++++++++++++++++++++++++++++++
 include/uapi/linux/prctl.h         |  9 +++++
 kernel/sys.c                       | 11 ++++++
 9 files changed, 193 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/include/asm/tso.h
 create mode 100644 arch/arm64/kernel/tso.c

-- 
2.39.3 (Apple Git-146)


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

end of thread, other threads:[~2024-04-11 14:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-10 21:16 [PATCH 0/3] tso: aarch64: Expose TSO for virtualized linux on Apple Silicon Zayd Qumsieh
2024-04-10 21:16 ` Zayd Qumsieh
2024-04-10 21:16 ` [PATCH 1/3] tso: aarch64: allow linux kernel to read/write ACTLR.TSOEN Zayd Qumsieh
2024-04-10 21:16   ` Zayd Qumsieh
2024-04-10 21:16 ` [PATCH 2/3] tso: aarch64: context-switch tso bit on thread switch Zayd Qumsieh
2024-04-10 21:16   ` Zayd Qumsieh
2024-04-10 21:16 ` [PATCH 3/3] tso: aarch64: allow userspace to set tso bit using prctl Zayd Qumsieh
2024-04-10 21:16   ` Zayd Qumsieh
2024-04-11 13:13   ` kernel test robot
2024-04-11 13:25   ` kernel test robot
2024-04-10 23:23 ` [PATCH 0/3] tso: aarch64: Expose TSO for virtualized linux on Apple Silicon Hector Martin
2024-04-10 23:23   ` Hector Martin
2024-04-11 13:37 ` Will Deacon
2024-04-11 13:37   ` Will Deacon

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.