Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1141298pxa; Thu, 20 Aug 2020 03:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwexllezDcYpRgsG36Ybmnr/rz8GcirhlLV44Eojgp+AeBshL3Z1/348Y5056W75OpfJ39Z X-Received: by 2002:aa7:da04:: with SMTP id r4mr2264649eds.265.1597920458235; Thu, 20 Aug 2020 03:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920458; cv=none; d=google.com; s=arc-20160816; b=sro99P2cfgAieqGvj8REHEjcOR8+WZiOecAGDBm5j6kentCOYGJwZI5h66ez+c5FOg C1HoBYp7Q3Er23LpKbNmUgnZ7mcaJrXiLLNXAaArZxDnuziW74gRyHpURSWLpt79EFOQ /0/kecL5ZkTj275awQxYdkjzCPyETxO0nx+naq4alipxXT4qhOJxoVSu+q1Pt/SHjm8/ Q5XfMnMHWBre3mljRy6FEiuhMC4AdBpRD2d45oGftdVMnSmS9O1G0UQPCU01tr8d4QQI rHEoKa+FS6wVUjGyisEXmJAbCFFYrq2NGT7bwvE204oVAnHf2CFNN7RZTZiBX/cWIOxL bk0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=iLWA2FzepFQDF+V/YhX0IJ79bp9VAkXafLwZ2xRN6/g=; b=QaHuXI1BRl4G4fZw44OFJqG6AhM3/e5H5p7KoZ/QNdU6+BBPlzpCUTBi7ZaCbsN7tv VezR1VAOID03AaPVYI9Rc4NzuTMdrH5CuBBBT/k5DOzXyzPDFPd6V+rlYBvNTgIYBNII Zb6nM5a40IQYQNQU1TqaEON1ALq7qPpxwDvlaK8heWe0R6j1fgrbuCZhnh2xeU2EtyzM QMemJSXeHo9PHdRUKg4crhP1IkgcBUTTgzzyusP/Pax/iA2UzAAbNQNdu5sid0nBmoVA rmSa+LXYbE95SwGFYUOvLzP95qvzsdJQLGRcqqHpgf/YeiNLUsbpriUgcVkxrOiZBJgI pvbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fJFa3FKK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=sqQzoAgc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si1210553edb.401.2020.08.20.03.47.14; Thu, 20 Aug 2020 03:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fJFa3FKK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=sqQzoAgc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731403AbgHTKoe (ORCPT + 99 others); Thu, 20 Aug 2020 06:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731871AbgHTKoJ (ORCPT ); Thu, 20 Aug 2020 06:44:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3393BC061385 for ; Thu, 20 Aug 2020 03:44:09 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1597920247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iLWA2FzepFQDF+V/YhX0IJ79bp9VAkXafLwZ2xRN6/g=; b=fJFa3FKKIQeRv4J0N16FZqeUYlTc7OC303z+nw+wglNo4fQdRztgWeGlDcjv0itTFBDyCd dLt8Gq+u1jHvN46pTQOXL9TnwenMeVnCZsARor2Pn8fNvn9f9PVpvIivlDNRNx7Q5tyF/8 QOrZH/pfBhBXdHSU8IIyr3QxMXTZoCNcXXG1mnVhFgovyZi3rbgNhR/mshB2GaqoV3u8m8 3+qNbniIc51dJerNfGbsMYHF6TufaKhqZVuVvMSrcNHwwQS0ScnsRMj+zLD1F7DpXv/XMB UjNY6TBkBn08C20P9V8no0IWei9dirR8uvN40zZBXvcIJaTtN3UnkbqgVH67pQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1597920247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iLWA2FzepFQDF+V/YhX0IJ79bp9VAkXafLwZ2xRN6/g=; b=sqQzoAgci1OIfkv+FS0qV2QXi1IUvtydMYUSAT7segZbbQiSm21J1JciDWunW6LatF7Wb8 2dYYDRqNN1x90cDQ== To: Arvind Sankar , "Paul E. McKenney" Cc: Nick Desaulniers , Ingo Molnar , Arnd Bergmann , Borislav Petkov , "maintainer\:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , "H. Peter Anvin" , "Kirill A. Shutemov" , Zhenzhong Duan , Kees Cook , Peter Zijlstra , Juergen Gross , Andy Lutomirski , Andrew Cooper , LKML , clang-built-linux , Will Deacon , Linus Torvalds Subject: Re: [PATCH] x86: work around clang IAS bug referencing __force_order In-Reply-To: <20200813180933.GA532283@rani.riverdale.lan> References: <20200527135329.1172644-1-arnd@arndb.de> <878serh1b9.fsf@nanos.tec.linutronix.de> <87h7t6tpye.fsf@nanos.tec.linutronix.de> <20200813173701.GC4295@paulmck-ThinkPad-P72> <20200813180933.GA532283@rani.riverdale.lan> Date: Thu, 20 Aug 2020 12:44:06 +0200 Message-ID: <875z9dioll.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13 2020 at 14:09, Arvind Sankar wrote: > On Thu, Aug 13, 2020 at 10:37:01AM -0700, Paul E. McKenney wrote: >> > Let me ask (hopefully) useful questions this time: >> > >> > Is a compiler allowed to reorder two 'asm volatile()'? >> > >> > Are there compilers (gcc >= 4.9 or other supported ones) which do that? >> >> I would hope that the answer to both of these questions is "no"! >> >> But I freely confess that I have been disappointed before on this sort >> of thing. :-/ >> >> Thanx, Paul > > Ok, I found this, so gcc developers consider re-ordering volatile asm > wrt each other a bug at least. > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82602 Yes. It prevents reordering of volatiles, but it does not necessarily prevent reorder of something like this: asm volatile(...); foo(); asm volatile(...); it might turn that into foo(); asm volatile(...); asm volatile(...); if I understood their discussion correctly. So removing this magic is not really straight forward. Thanks, tglx