Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1563884pxa; Thu, 13 Aug 2020 11:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Oo7bM/0vCpkhfEpLJRhk6vC909izsyDnnqdc6laLWjYxB2hjqZI9y121KDJX6VToqYiv X-Received: by 2002:a17:906:86c9:: with SMTP id j9mr5882008ejy.5.1597342405730; Thu, 13 Aug 2020 11:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597342405; cv=none; d=google.com; s=arc-20160816; b=0WqfES8f6OJBJw1Ur+MM6/Tyxo9zNxixI28DfUFXioi2j8aD2KYDAM5Blau/2UGBr4 bG3dZTCQSCjAYWR1B+k0V3cXUOVXQ+Z8vf+RzEdAI4AFSKPlu6Hy6rzZvgcQ0cp3rzsn zytd8ADMoTVIMoiVOtuYPWPqyYMDI1f49Tvz3l2+/rib5XWC6KrwzN4UH934Hc1pDutF EV7uxE4Xk2W11R9Of9eksBubRcTDjNh5iJKImHBM7djbpxtoJc4Ea6fTUEhYW0JdrrL7 Casy23JGF3XXosPKkeP7nPvSNRxU5EaeXaDJ/YrAv96UtcIOlyovfHas77210xD3DnB3 qHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=CQ17aXKfX9jTOeTDi07zI7TGLiegJG5JHkGJpsdYnbM=; b=S0VAqJ1eGvR8HcReW1T0mgGmC2Z5OVOcF7ssDALCDX1UtgFF2CHeRbGw6hDbSD7j85 Y7Q6V0RPyBrgreAiAY8awmmn6aNdE6SYl6gDQnwHf8Kt8+Xc/U8Vj1z/uNLZIwYFptMT 8TgON1tLcIOHCo66R7mw//DM3mwU0pgmxR6/Bodsfkm/+el29+5sO+nVzYDWAPx0C/RF wYERacKh9bob265AL43UJyz1IR05MciJIPJ1iOTqa9+3a+SBhIkOt93NB7vSp1jWcZDN fo6MR7IxYK1BBRTR6iiGnkrN1JTTuvSPCgX00Mk1YBQyRu2LvtnfdvNIh6CRIvw0sQBj KflQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="OMl3Qj9/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si3228238ejx.93.2020.08.13.11.12.59; Thu, 13 Aug 2020 11:13:25 -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=fail header.i=@gmail.com header.s=20161025 header.b="OMl3Qj9/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbgHMSJi (ORCPT + 99 others); Thu, 13 Aug 2020 14:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbgHMSJh (ORCPT ); Thu, 13 Aug 2020 14:09:37 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24B86C061757 for ; Thu, 13 Aug 2020 11:09:37 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id s16so5053322qtn.7 for ; Thu, 13 Aug 2020 11:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CQ17aXKfX9jTOeTDi07zI7TGLiegJG5JHkGJpsdYnbM=; b=OMl3Qj9/cRzAh+5sk6WnNF6DTQiVtYnzVpue5VKKGT4pXaF572DS1AwIfDYqqDy8O1 HYqF1Wg6HZ8HqmI48tOkP5J6JGMT5LUNdmGXG4OXcgGB+LYjM8ujpTmhC2EXMiOuTNkR t+fQ54hy2lyi0Gvm6hVZxiUVq90W3N/iDWKje0WWdIqYpE39eLdNR9O5LO9kN5np/VWT TxtNh99gwDg5FkCt9gZIgMaocRPTAJTIrOg+0VA1jW8K9tTMX86XesA1GWjhqjTNzELQ KjZ9+N7MFCG2YxG/DGlfi4/PVc4Oee8RIf/OpfZ/xot1uTJ0w6JrRvXYIRAMwkmQXAZh Vd4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=CQ17aXKfX9jTOeTDi07zI7TGLiegJG5JHkGJpsdYnbM=; b=VdVOC+x1AOqlvy1iilh8o5Yl0KNPMjarfBTRDR+zs/75jsiqFWqR8yjppN6rbsWNlH IlzpPz29DUdWXR4hwFgc6pgK36yJ+bsTwq4LxRh4GT76wMSXl6djjsI0l7BKEtlzYyEj RhrTH61/jwAj+iwuun7TO/V3kQziuVicDJBy2gF3UJnTrMXl1vV8lAGIj2Qe1vhYkYDB GlB048rPJCfqrLN1j/8hU9p7KELViREP/2xmbIV6+ccqr0/GvUwT/J/9nHjiGYG+HZ5F XVYRzC35Sv3M95987jM1U7asd8/qeTChSxVq9iIS7d8rdxBiwNWjCji0/XIUWV/UmGNW pBsw== X-Gm-Message-State: AOAM531IUkctImmqH8EN7UbxzwOrK3XjwlJTZh3uWMcCFsY88EuK43ws QkbZZ2Rj+c07BQRFd2DY1Xg= X-Received: by 2002:ac8:6c6:: with SMTP id j6mr6836667qth.129.1597342176242; Thu, 13 Aug 2020 11:09:36 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id i30sm7832477qte.30.2020.08.13.11.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 11:09:35 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Thu, 13 Aug 2020 14:09:33 -0400 To: "Paul E. McKenney" Cc: Thomas Gleixner , 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 Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200813173701.GC4295@paulmck-ThinkPad-P72> 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 10:37:01AM -0700, Paul E. McKenney wrote: > On Thu, Aug 13, 2020 at 07:28:57PM +0200, Thomas Gleixner wrote: > > Nick Desaulniers writes: > > > On Thu, Aug 6, 2020 at 3:11 PM Thomas Gleixner wrote: > > >> > + * > > >> > + * Clang sometimes fails to kill the reference to the dummy variable, so > > >> > + * provide an actual copy. > > >> > > >> Can that compiler be fixed instead? > > > > > > I don't think so. The logic in the compiler whether to emit an > > > > Forget that I asked. Heat induced brain damaged. > > > > > I'd much rather remove all of __force_order. > > > > Right. > > > > > Not sure about the comment in arch/x86/include/asm/special_insns.h > > > either; smells fishy like a bug with a compiler from a long time ago. > > > It looks like it was introduced in: > > > commit d3ca901f94b32 ("x86: unify paravirt parts of system.h") > > > Lore has this thread: > > > https://lore.kernel.org/lkml/4755A809.4050305@qumranet.com/ > > > Patch 4: https://lore.kernel.org/lkml/11967844071346-git-send-email-gcosta@redhat.com/ > > > It seems like there was a discussion about %cr8, but no one asked > > > "what's going on here with __force_order, is that right?" > > > > Correct and the changelog is uselss in this regard. > > > > > Quick boot test of the below works for me, though I should probably > > > test hosting a virtualized guest since d3ca901f94b32 refers to > > > paravirt. Thoughts? > > > > 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