lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4f53335-eba9-4c71-b64d-ca2c65c29a74@marcan.st>
Date: Thu, 11 Apr 2024 08:23:23 +0900
From: Hector Martin <marcan@...can.st>
To: Zayd Qumsieh <zayd_qumsieh@...le.com>
Cc: Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
 Mark Brown <broonie@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
 Mark Rutland <mark.rutland@....com>, Mateusz Guzik <mjguzik@...il.com>,
 Anshuman Khandual <anshuman.khandual@....com>, Marc Zyngier
 <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
 Miguel Luis <miguel.luis@...cle.com>, Joey Gouly <joey.gouly@....com>,
 Christoph Paasch <cpaasch@...le.com>, Kees Cook <keescook@...omium.org>,
 Sami Tolvanen <samitolvanen@...gle.com>, Baoquan He <bhe@...hat.com>,
 Lecopzer Chen <lecopzer.chen@...iatek.com>,
 Joel Granados <j.granados@...sung.com>, Dawei Li <dawei.li@...ngroup.cn>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Florent Revest <revest@...omium.org>, David Hildenbrand <david@...hat.com>,
 Stefan Roesch <shr@...kernel.io>, Andy Chiu <andy.chiu@...ive.com>,
 Josh Triplett <josh@...htriplett.org>, Oleg Nesterov <oleg@...hat.com>,
 Helge Deller <deller@....de>, Zev Weiss <zev@...ilderbeest.net>,
 Ondrej Mosnacek <omosnace@...hat.com>, Miguel Ojeda <ojeda@...nel.org>,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 Justin Lu <ih_justin@...le.com>, Asahi Linux <asahi@...ts.linux.dev>
Subject: Re: [PATCH 0/3] tso: aarch64: Expose TSO for virtualized linux on
 Apple Silicon

On 2024/04/11 6:16, Zayd Qumsieh wrote:
> 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.

Well this is unexpected, given I talked to Justin Lu at Apple back in
December and I thought our plan was to work together on the series I've
had cooking in the Asahi tree [1] for a while now, which is actually
shipping in thousands of Asahi Linux systems in production and actually
already supported by the FEX-Emu project with our ABI. You CCed 30+
people, but not me nor the asahi@...ts.linux.dev mailing list...

[1] https://github.com/AsahiLinux/linux/tree/bits/220-tso

Given that we're here now, I'll send out my series for review and see
what people think about that one.

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

- Hector

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ