From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8996C433EF for ; Mon, 11 Apr 2022 10:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=axgI2ZVuv0AgZlIFXXGINAwKctWavRtDs7oeDbLup2A=; b=qHD5juGQsUrw6O MIu/GzRL+HGRE3veNij7yD7NOArPq6goIodjq5ctXKszi/64WOTIm65hk2ycCZsd8lSY5o3sKcxTz rWT/OVZGIjBAOY5b8zqRR8HfhcnpnKcRM/DH+vnoTQCCocmE9iHmhf4xsr+/bbP6y/avhPwKMrOi7 F6ldN3ZIlAAOcq9Ls2x35zB9GgMlbVxhAHhI+jHOl9tsiYW5APhheUMgmGuz4vcvYbcn5CHrziaAq zgtUrUkJJLLcEnI5/Vo8m9szNnfSBzdl6QAKpgrwzLlQVkPvfilUDWSGUE+jVL/mHP+tBPU4JazUv NOMYsKRXUS1f5vVoz90w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndrON-008O8L-3a; Mon, 11 Apr 2022 10:35:32 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndrCF-008HxW-1d for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2022 10:23:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CDBF7169C; Mon, 11 Apr 2022 03:22:57 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.9.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 407723F5A1; Mon, 11 Apr 2022 03:22:55 -0700 (PDT) Date: Mon, 11 Apr 2022 11:22:51 +0100 From: Mark Rutland To: Peter Zijlstra Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, gcc@gcc.gnu.org, catalin.marinas@arm.com, will@kernel.org, marcan@marcan.st, maz@kernel.org, szabolcs.nagy@arm.com, f.fainelli@gmail.com, opendmb@gmail.com, Andrew Pinski , Ard Biesheuvel , x86@kernel.org, andrew.cooper3@citrix.com, Jeremy Linton Subject: Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect) Message-ID: References: <20220401164406.61583-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_032259_218883_A1AF30B8 X-CRM114-Status: GOOD ( 19.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 05, 2022 at 04:05:22PM +0200, Peter Zijlstra wrote: > On Tue, Apr 05, 2022 at 01:51:30PM +0100, Mark Rutland wrote: > > Hi all, > > > > [adding kernel folk who work on asm stuff] > > > > As a heads-up, GCC 12 (not yet released) appears to erroneously optimize away > > calls to functions with volatile asm. Szabolcs has raised an issue on the GCC > > bugzilla: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160 > > > > ... which is a P1 release blocker, and is currently being investigated. > > > > Jemery originally reported this as an issue with {readl,writel}_relaxed(), but > > the underlying problem doesn't have anything to do with those specifically. > > > > I'm dumping a bunch of info here largely for posterity / archival, and to find > > out who (from the kernel side) is willing and able to test proposed compiler > > fixes, once those are available. > > > > I'm happy to do so for aarch64; Peter, I assume you'd be happy to look at the > > x86 side? > > Sure.. FWIW, compiler explorer now have a trunk build with the fix, and my x86-64 example now gets compiled to something which looks correct: https://godbolt.org/z/cveff9hq5 Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel