Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp1148198pxr; Mon, 11 Apr 2022 16:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy4swAXyiiClvLRWBMXhCh14tRAPAiXQP8Tf7LYMdrEyf8mYViwD3+QFjJJvrs8PMWFHPW X-Received: by 2002:a05:6a02:197:b0:382:a4b0:b9a8 with SMTP id bj23-20020a056a02019700b00382a4b0b9a8mr28237415pgb.325.1649720544213; Mon, 11 Apr 2022 16:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649720544; cv=none; d=google.com; s=arc-20160816; b=L9t4IWwQ/1+dXhtXRgCJl7bfu067/I7gylsuFAf8V3HzQ9K0v7+aD1DdhKI4GEZJE4 5CNjgvIyVEJS0m09tE1BdzINPX5k5k36lyjX4decTFTAwuebcoXslZs/QLYtynMDswd0 apVXSYimLUNbbZ8vDuoapNF5qgV3lL9g5xusJpB/u8r0vpwgK63N//9GI1Ui8gLJqD+L OgaLR9r1o4fKMvq6ZvU+FYxmoJ6CQxGOs6HcEaeUwVyw28IMKtEq5kfwaFPCqwQchY/W G+wF9Ca9A8FZW3yGptPVBLOptvGuY6IoudwAZxJiyCYMdp+2PyWZln5VdFZHpO0rP3Ve Pgzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=9j2HHrOY6RvVo6ZD5dUudPRIVFtv+lK6+CLkvO6JIP4=; b=l3bAuIqrf6jmQNqW01IzbkmMyUje9ac+PBHP/df2fBR2lUWzcsn62qkG4TzSeG20Ya 5FEceT9jdY1Xl7KBKZ2b0DE8P4cB/Ra6tez3afivWi5mQRJwkNt+itKLAfKA9DC/YkyD J1ZxUW0faIZq3Uhr6eYTVtqeEX1Plbo7Y2Foj+cUewwRAo7hbP+plv3Aye2BHj/bS3xx i0nC/S6vQEChnc84UD8BXphA1T0fgIwDc3vJzt5n6W+YpgEctZqegMSayzM1gpkCuKID ryoIQCLLm9HwuqrvSdF3XRhyOt0eeg2u4I8+GVKFuksHbAPj9A+LWnfrNmT5zw+5LHig 35Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h189-20020a6383c6000000b0039d0cf8fed8si1057426pge.759.2022.04.11.16.42.09; Mon, 11 Apr 2022 16:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345554AbiDKKdp (ORCPT + 99 others); Mon, 11 Apr 2022 06:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245598AbiDKKdn (ORCPT ); Mon, 11 Apr 2022 06:33:43 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76D00434B1; Mon, 11 Apr 2022 03:31:29 -0700 (PDT) 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 3E230169C; Mon, 11 Apr 2022 03:31:29 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.9.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 974393F5A1; Mon, 11 Apr 2022 03:31:26 -0700 (PDT) Date: Mon, 11 Apr 2022 11:31:24 +0100 From: Mark Rutland To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jeremy Linton Cc: 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 , Peter Zijlstra , x86@kernel.org, andrew.cooper3@citrix.com 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Jan Hubicka fixed this in GCC commit: aabb9a261ef060cf ("Propagate nondeterministic and side_effects flags in modref summary after inlining") ... and all my local tests look good with that applied. Compiler explorer's trunk build now has that fix, so the examples from before now look good: aarch64: https://godbolt.org/z/vMczqjYvs x86_64: https://godbolt.org/z/cveff9hq5 Jeremy, now that the real issue has been identified and fixed, I assume you'll send a revert for commit: 8d3ea3d402db94b6 ("net: bcmgenet: Use stronger register read/writes to assure ordering") ... ? Thanks, Mark.