Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1569815pxa; Thu, 13 Aug 2020 11:22:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDybNqxO5gBb+Qbh/yl31w99tDftp44saGiMNqUvg+bo2wxoCFH/xZyRWh2Zh8v08B0zDs X-Received: by 2002:a50:da44:: with SMTP id a4mr6119849edk.36.1597342967726; Thu, 13 Aug 2020 11:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597342967; cv=none; d=google.com; s=arc-20160816; b=HAvRuFdWeagRrJVOnOdnjubgJUIovYTPJhQIfdh29psrllZM9DG2B+toxQ9iaMZ5U1 sy68Xo7qrdtAQJo5GvYyuXOJBfDkP2U/2QYDAjvh52TKulRdX5hOHKUPJSg5r4C7qFS/ CpWL1WS+nE4Ebz9oqRPfqMhUQW/bkLCTZ9fO+8gFlO8P6G37aSsI3x3sMNYrlWAGjXGA nAok7pcXXQJoz4utzLVdOVqpfw1K/loskkDQMz1iy286+r94OtrcZkk+VVD1S2yoiVgI M0oIBDHt4fPs7prOvkNkL4+DAk5bnrTfiALN38PVMc0Yemz8RcGAaDMnNPG7ES4xWScg iXaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=E5iqdULjt/DcVsvuwsfZp3hpC/Hs1IuMjRMJ6HhZPHA=; b=GaLp/ZJiianWLJ7TAfVNNaz63uzwu8aKCggswUWFbP4NAHwO8ZFd7Najy6Gva/Lbat gDcaOATsF67HmkEm1Rz/eTURc4b6+9qpx5hqBcj24J27i+4b/SS+ftw2H0RHiIdoVYuF 3H08p/4Y4boc/Aq2s0c78zvQhLuldbfQ0Iabwv+gH6tSEDrEVxxbimO45qNJSVw7Bv09 dUdobWpWXdMYJANDe/oLSKQR1AyFGXTzIhgrP2xb4vQfcl4uahjFWkxGvfhDtnl2nDJD XtTGm7Lrrk94LOEhIDzOoVqbpoHt8ptdT8Br8VlAHRW52tdugGf2NK3rt8MAqjgmlVs9 kZXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bdlYiV/y"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si4147172ejt.549.2020.08.13.11.22.25; Thu, 13 Aug 2020 11:22:47 -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=@kernel.org header.s=default header.b="bdlYiV/y"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbgHMSUy (ORCPT + 99 others); Thu, 13 Aug 2020 14:20:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:35154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbgHMSUx (ORCPT ); Thu, 13 Aug 2020 14:20:53 -0400 Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40289204EC; Thu, 13 Aug 2020 18:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597342853; bh=eYRnVCx+kGvQN0sevfFUKsl7sCBkYj27WjTIGLH4d2Q=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=bdlYiV/yFOIIKX253p9IMBsP3O+Pnsq967Fq4PfKBpmYS5PIvAkD6XZsXdQPXZIZn wrGClttuHSP4nRfL9fAAZ30uAUR8ceA7sHm2scQ95k6tEGQxIlJUuqi61vT6mmrYuP arFkJNcB24d8XND/6aLrfqVgcDrux4vh+c5CutzE= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id D9880352279C; Thu, 13 Aug 2020 11:20:52 -0700 (PDT) Date: Thu, 13 Aug 2020 11:20:52 -0700 From: "Paul E. McKenney" To: Arvind Sankar 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: <20200813182052.GE4295@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200813180933.GA532283@rani.riverdale.lan> User-Agent: Mutt/1.9.4 (2018-02-28) 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 02:09:33PM -0400, Arvind Sankar wrote: > 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 Whew!!! ;-) Thanx, Paul