[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZtYJ4SUDLxrjDDBX@arm.com>
Date: Mon, 2 Sep 2024 19:54:25 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Mark Brown <broonie@...nel.org>
Cc: Will Deacon <will@...nel.org>, Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>,
James Morse <james.morse@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Arnd Bergmann <arnd@...db.de>, Oleg Nesterov <oleg@...hat.com>,
Eric Biederman <ebiederm@...ssion.com>,
Shuah Khan <shuah@...nel.org>,
"Rick P. Edgecombe" <rick.p.edgecombe@...el.com>,
Deepak Gupta <debug@...osinc.com>, Ard Biesheuvel <ardb@...nel.org>,
Szabolcs Nagy <Szabolcs.Nagy@....com>, Kees Cook <kees@...nel.org>,
"H.J. Lu" <hjl.tools@...il.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Florian Weimer <fweimer@...hat.com>,
Christian Brauner <brauner@...nel.org>,
Thiago Jung Bauermann <thiago.bauermann@...aro.org>,
Ross Burton <ross.burton@....com>,
Yury Khrustalev <yury.khrustalev@....com>,
Wilco Dijkstra <wilco.dijkstra@....com>,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
kvmarm@...ts.linux.dev, linux-fsdevel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v12 19/39] arm64/mm: Handle GCS data aborts
On Thu, Aug 29, 2024 at 12:27:35AM +0100, Mark Brown wrote:
> All GCS operations at EL0 must happen on a page which is marked as
> having UnprivGCS access, including read operations. If a GCS operation
> attempts to access a page without this then it will generate a data
> abort with the GCS bit set in ESR_EL1.ISS2.
>
> EL0 may validly generate such faults, for example due to copy on write
> which will cause the GCS data to be stored in a read only page with no
> GCS permissions until the actual copy happens. Since UnprivGCS allows
> both reads and writes to the GCS (though only through GCS operations) we
> need to ensure that the memory management subsystem handles GCS accesses
> as writes at all times. Do this by adding FAULT_FLAG_WRITE to any GCS
> page faults, adding handling to ensure that invalid cases are identfied
> as such early so the memory management core does not think they will
> succeed. The core cannot distinguish between VMAs which are generally
> writeable and VMAs which are only writeable through GCS operations.
>
> EL1 may validly write to EL0 GCS for management purposes (eg, while
> initialising with cap tokens).
>
> We also report any GCS faults in VMAs not marked as part of a GCS as
> access violations, causing a fault to be delivered to userspace if it
> attempts to do GCS operations outside a GCS.
>
> Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@...aro.org>
> Signed-off-by: Mark Brown <broonie@...nel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@....com>
Powered by blists - more mailing lists