Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1540548pxa; Thu, 13 Aug 2020 10:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwBW77XMqGXhCmcT7zgWHwxQGmde1IuUYK5CEoYEgXXkptdeV6ILxKTXXD401W8E/kDXbf X-Received: by 2002:a17:906:7e57:: with SMTP id z23mr593909ejr.294.1597340282204; Thu, 13 Aug 2020 10:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597340282; cv=none; d=google.com; s=arc-20160816; b=u9qlxYNJ9vtO/z/a6RUx5Y1OJ/t0hb7d5FrPv/k8yi3SDJE6Gz8F9yEF50eVPYBanI xngUZQHoHHy2S4yVhd+qZLy9OJzEaVEeP8hl9+6Oac7tnowTF8YMXCqyeYtg1w2ZrO8c HczhdxhK1J+wgp5uLIcrqYRmbMrHVCRMUtrJAB+42cOC241DBr0fpmqz2oQuD+Jep+aa xtpNAJ1Jrwue3F8Zb21M9jy5/iaZXxAfVnMssQ5yRa1KaHPetNAuG/oY9qJYvA1+m35H v+x81iAz9gPZpKp7I2tcWQA7dv7EinrHxfae2M0e7lChdsnkC2rd0a09ycUdPXZXXQcg SaUQ== 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=g7CAj1faMuMSydXDWmXyfl1v1wqnXwikcXB3JaocUD0=; b=gguDre4p3fqWdo+fnz9OEnUo/dav9U1VvVkFiVr7ueAmQm6Ocr7vw2LDZ0fRvW4aEn aKvCpY7bE2ScooAsCKCJDyOsCKCWgo5ILrd8OG5FbFftnyRaCR45hpQ5MCCgzmQ81P0P WV7tVpiC9nFdBPDp6w7DJrxSV8PI6gZymEIxpSqvsKE95CaFeARn2v0metca5jRbX6Ez mFOHJ358KbyR5iL2rswd13txXoB977tPQLtYub4aU3G2YP5VC3i6DZ2sN7/AqT6f6I8c m5nxwebGuhGz549XqHx4l+34lF2+aThSIZOYPi6r6QTs8PsRQ0tPgLE46B8qlKstkIuP xqFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YaIq9Hkx; 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 n8si3663163ejj.649.2020.08.13.10.37.38; Thu, 13 Aug 2020 10:38:02 -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=YaIq9Hkx; 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 S1726568AbgHMRhC (ORCPT + 99 others); Thu, 13 Aug 2020 13:37:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:50216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbgHMRhC (ORCPT ); Thu, 13 Aug 2020 13:37:02 -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 67A4F2078D; Thu, 13 Aug 2020 17:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597340221; bh=sgRlp7dCUrfOBC/9uX9nn5O+stnmV3MDjAHKYBmKnFk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=YaIq9HkxNQBD6ZFFhRQEhkyXCaKX/Fe/zWNt6WXuCmUiFxNpF1qWgtEvSfCJtW7pI sftR4/wMzkqUTo73pjFjJj9yU4NPiTyyz7b+SngYLm0fN7j7IogMQhIVpl7zKYTP4v 1KXLqIipuHYLWTkgzvPqd+8ZCZztiBWKvDLjkep4= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 12287352279C; Thu, 13 Aug 2020 10:37:01 -0700 (PDT) Date: Thu, 13 Aug 2020 10:37:01 -0700 From: "Paul E. McKenney" To: Thomas Gleixner 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 Message-ID: <20200813173701.GC4295@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h7t6tpye.fsf@nanos.tec.linutronix.de> 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 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