Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1534943pxa; Thu, 13 Aug 2020 10:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws2w/CTxggAXBSW6BdJ0oWwnxawemMTFTvJBIzEZ7LEsYqYPpNVmsemBeYY5C99YjXAWGA X-Received: by 2002:a50:935a:: with SMTP id n26mr5737412eda.107.1597339851808; Thu, 13 Aug 2020 10:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597339851; cv=none; d=google.com; s=arc-20160816; b=a95atqAQJhf1H8RnNrq9vFh0RGG/mp51AffHQT/9mXddvM0AGRqr4NKKL5rAh6/WtZ N+L8xRaqxv0KSTrFwer+AQ6qixYLWhYQ+yu0yF75umsDmgakGnQoibQb782lOCDKlerv ivj7WWimniCjfsdjnFGDjo2FEs8JfPt5Ufok75ZaWZAOcwWaDGkSN7mizAeNEoNxwtzG CH5qRtbshVMeHrRtAU3aQAGIziXqyP2F+TH7k4I7inSTaUYNTRP9a7IzakoYmSlpbvEl D8uXSlIx62cNnBKjQv/85YjE9K8eysRF+xNKv+C6aYiN6BtsU4JoutMaZLvbK5W9KoqM +mKw== 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=11fDOoD89XYwtAI0PHZUjX+Yj9I0KxTiJv3RjtEDo3E=; b=gSOVpLTW0ExmtuRw55/nnX/lPlHBdCi/oEXrsL26bhmQTmXPysHy6ryZoWM+3zY/Tl bHdYUFinJc9+FwOrYq/GSGFnwAZAkiL4j0UR0VwRKRLnwxU2nUMoFpns4VYVolKXOhvt HP0tXjKjTe4yU9IBWVJmgF72UT9lhlWI/L56zzh5sRQbcL69Xwt6SgxkeG2FnzYn/8LW nH18gwTWcKmzYo95/NS1xzNyJ+5v4+tDRmml5qGmkWbSpVLhRHYxaTroNbNlwbV8v7i7 YOL3wWgc2yCYs4Guzj3fAUtIUXE+bOF/fg2r95mjTibPXpTUueZz2ULOCUzBmml8euOz lBug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=QVk6G8vB; dkim=neutral (no key) header.i=@vger.kernel.org; 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=fail (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 rs7si3578358ejb.195.2020.08.13.10.30.27; Thu, 13 Aug 2020 10:30:51 -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=@linutronix.de header.s=2020 header.b=QVk6G8vB; dkim=neutral (no key) header.i=@vger.kernel.org; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgHMR3A (ORCPT + 99 others); Thu, 13 Aug 2020 13:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbgHMR3A (ORCPT ); Thu, 13 Aug 2020 13:29:00 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D22ADC061757 for ; Thu, 13 Aug 2020 10:28:59 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1597339737; 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=11fDOoD89XYwtAI0PHZUjX+Yj9I0KxTiJv3RjtEDo3E=; b=QVk6G8vBi5xZpbbEh5oCRYi3g2VIeVrUdWVVFu0SFo5zxbzhNELy6r3DddXMnRkJ88uI84 hJif/amrozMH1JapT/2OrxpCJ4R/koTofn8+TfLw8JEQDB9s6FSIy5tbJMljGF6jbVIiP7 UxXjLHb/1wS3ptLKcOmtPQOree4COB9bVBU6/A4WunKTWgpQUZwZ5guDNsvgq4dFMjJnr8 /SXjALm68UWrJemCH9J2g9dPWrPxsRolRId0NwDdKGZSxS2WmQYuYlr7eMhHAWarpcW2TA IBA92ilIaAKy19h95Kg367si1I9YpzaetOjBzwDYpGCz9CpvdRc+MG03NONoaQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1597339737; 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=11fDOoD89XYwtAI0PHZUjX+Yj9I0KxTiJv3RjtEDo3E=; b=xJjSVXYUS3PXpK9xYeHKjIJczdzRd+rekKdmNlMKjRHuqwxBYe2V81F25SVPcZHH9kSXFN lUOqDQm0qxyRKxCg== To: Nick Desaulniers , Ingo Molnar Cc: 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 , "Paul E. McKenney" , Will Deacon , Linus Torvalds Subject: Re: [PATCH] x86: work around clang IAS bug referencing __force_order In-Reply-To: References: <20200527135329.1172644-1-arnd@arndb.de> <878serh1b9.fsf@nanos.tec.linutronix.de> Date: Thu, 13 Aug 2020 19:28:57 +0200 Message-ID: <87h7t6tpye.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 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? Thanks, tglx