| Message ID | alpine.DEB.2.21.2501050246590.49841@angie.orcam.me.uk |
|---|---|
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83E3E385828E for <patchwork@sourceware.org>; Mon, 6 Jan 2025 13:04:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83E3E385828E X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 357003858D29; Mon, 6 Jan 2025 13:03:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 357003858D29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 357003858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4190:8020::34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736168599; cv=none; b=BpctgmJtmyJVp6uAPbPHVE6O1RZYVGKYrEOzM4fVmnj6RG2humKRezGlOhSD1AHHOrf+0vaa8uXikeWRHbM5rwqxLE7HkSBbLzezSeoVi8ClIbURwODN7ISQ7k81TlNU2JDMc9pXF1ENPBzeaoV9Huf0XJmMwJyUF0a5bZm6NzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736168599; c=relaxed/simple; bh=hKHe+1HvuDJZH1kI9DeW26eSnvOTFF+BrEs/mowZUxs=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=fyxmmNIt0r6wqj5k3+sk2B5Pbb881RK4o+cb2JmXd98BFk/k0ofyg8FxeN/yxmLrUNo78sN2tn0Us1TDF7c22AlqEW035r69mlD9GJm1wO1sKlCBh/zP6ozTpLY/mN/VT0JhKeSx89jbo/KxcGog39K6i6WY6105/KjdpD1x4k8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by angie.orcam.me.uk (Postfix, from userid 500) id C257E92009C; Mon, 6 Jan 2025 14:03:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B8D0C92009B; Mon, 6 Jan 2025 13:03:17 +0000 (GMT) Date: Mon, 6 Jan 2025 13:03:17 +0000 (GMT) From: "Maciej W. Rozycki" <macro@orcam.me.uk> To: Richard Henderson <rth@gcc.gnu.org>, gcc-patches@gcc.gnu.org cc: Arnd Bergmann <arnd@arndb.de>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, Richard Henderson <richard.henderson@linaro.org>, "Paul E. McKenney" <paulmck@kernel.org>, Linus Torvalds <torvalds@linux-foundation.org> Subject: [PATCH v2 0/7] Fix data races with sub-longword accesses on Alpha Message-ID: <alpine.DEB.2.21.2501050246590.49841@angie.orcam.me.uk> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3487.8 required=5.0 tests=BAYES_00, HDRS_LCASE, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
Fix data races with sub-longword accesses on Alpha
|
|
Message
Maciej W. Rozycki
Jan. 6, 2025, 1:03 p.m. UTC
Hi,
This is v2 of the series updated according to the outcome from testing
with a BWX system. Only test cases have been updated and no changes have
been made to actual code and obviously only the patches still outstanding
have been included.
Additionally 1/7 has been folded into this series from a patch previously
submitted on its own to address a functional regression in the option
handling, as it's been discovered that it's required for correct execution
of several test cases added with the series, with target configurations
that default to EV56 or a newer CPU architecture variant.
This series has come out of a discussion[1] around the removal of non-BWX
Alpha support from the Linux kernel due to data races affecting RCU
algorithms.
As it happens these data races also apply to BWX Alpha systems, as I have
discovered in the course of this effort, although owing to how the Alpha
backend of GCC has implemented block copy and clear operations rather than
actual hardware limitations, for example GCC will happily produce code
such as:
ldbu $1,0($3)
stw $31,8($3)
stq $1,0($3)
to zero a 9-byte member at the byte offset of 1 of a quadword-aligned
struct, happily clobbering a 1-byte member at the beginning of said struct
if there is a concurrent or parallel write to that member in the middle of
the unprotected RMW sequence.
This patch series addresses these issues in the last two changes, with
suitable preparations made ahead of them. The intent for these changes is
to eventually bring Linux kernel support back for non-BWX systems still in
people's possession.
This has been verified with the `alpha-linux-gnu' (EV4) target using a
POWER9 system as the host and an AlphaServer 300 (EV45) system as the
target, with no regressions except where expected due to LDx_L (as always
the first in a sequence) executed with an unaligned address, exceedingly
rarely though (4 test cases across all the GCC frontends and libraries
covered). This will be addressed via emulation on the Linux kernel side,
now in the works.
This v2 has also been verified with the `alphaev56-linux-gnu' (EV56)
target using the same POWER9 system and EV68 hardware kindly shared for
this purpose by Magnus Lindholm <linmag7@gmail.com>.
No Rust frontend or libgrust library verification has been run due to a
recent version requirement increase for the `cargo' helper tool, which my
development system cannot currently satisfy and I figured out that getting
that sorted right now would be the best use of my time.
More details on testing have been included with the respective changes.
With changes to non-Alpha code committed and 5/7 already approved the
relevant maintainers have now been dropped from the list of recipients for
this patchset.
Previous iterations:
- v1 at: <https://inbox.sourceware.org/gcc-patches/alpine.DEB.2.21.2411141652300.9262@angie.orcam.me.uk/>.
- 1/7 at: <https://inbox.sourceware.org/gcc-patches/alpine.DEB.2.21.2412300410050.20821@angie.orcam.me.uk/>
References:
[1] "alpha: cleanups for 6.10",
<https://lore.kernel.org/r/20240503081125.67990-1-arnd@kernel.org/>
Maciej