Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp606929pxa; Fri, 21 Aug 2020 16:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykkw+g4mC8S7NrSeRaOV9hjhOiphogOB4xAqA0hB8Pr8SqMYvmEZI3G4LI4QsshIsTctjD X-Received: by 2002:a17:906:2a14:: with SMTP id j20mr5428173eje.376.1598051258442; Fri, 21 Aug 2020 16:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598051258; cv=none; d=google.com; s=arc-20160816; b=Pnb+jjKMpwudZSMQbFOYmnhggLNbJthvko5KvT5jqoBkaXrxRcUHbq61omduV0l/u7 +LXwdljxUz8B8Uh4pDOZLgfMUlGDEr+aVwY26AbtHhOagkamJBU/Nb8KIPpgDaAnB+2B tWSPrnhYS0o9GBDT615Y8CU2fti9YxONwi5ZiWjoN3yA6SDq0MAa0hT7kmxPdvygsmDo e7Okno2axkdvXsiApgtS/YPpzPZpwB10nB2tRVXyX0mPo0mNlMff7Rwo0cCZ9Y3TCkO+ pyCAYFITBN+YyoQnF4o1RmkcApX/bNERUr6VdhQyYrxCr9EGDPra48jCHqlZlCqRKiqx kOLA== 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=JIkYYfWPZx8vu6g44rtUYz/n2J/i7vQ9ofU14VDGPeA=; b=ukiQBJdDTGnK0DZ4cznbOlvpE+BM6V+i6Ql+s7ScnGMojm+EMyw98XKo115ucS1BZj rgo5o+mjHbrsGHoQ48ZXhZbgng6m+BgP4QfMbYYTzQM69Q/ZOPbtHOA/LA9r3ZE5/seV 0Sp+OFSuKMbUfhwx6axRpP4ln91ipPAV5TC9COT4VTQCAXDMt0sUFPR3uchiHybAXusw 98XbR9SFzQEL1TjYiAWez8KgGKpcLcMymZzTw7BZsXxXyLmyet6zZ6G/8DPHI2B8KlZt NZqV29jOIgtWaxOTboE3sHrLw8/fjxHXwBJJR8zDrYS4/Lz9QTuEsVh6jna4dkyaH3FL geKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=X4bX19X9; 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 k19si2133070ejg.29.2020.08.21.16.07.13; Fri, 21 Aug 2020 16:07: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=fail header.i=@gmail.com header.s=20161025 header.b=X4bX19X9; 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 S1726746AbgHUXEl (ORCPT + 99 others); Fri, 21 Aug 2020 19:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbgHUXEk (ORCPT ); Fri, 21 Aug 2020 19:04:40 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B616CC061573 for ; Fri, 21 Aug 2020 16:04:39 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id t6so1379849qvw.1 for ; Fri, 21 Aug 2020 16:04:39 -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=JIkYYfWPZx8vu6g44rtUYz/n2J/i7vQ9ofU14VDGPeA=; b=X4bX19X9obqm/65OzN8iL2PSenhb4mACkxVlulMvGbvorYkOs1NhxDTWCxuo+8Dk5V uIncqA8ShvB3+us0ZldCrgvegpgjAYcFbe/xuN+c/1FsEZBR/QiwFxG8quWf3LVmQ4YP 09sa0zSu8ZFow0UWqlLMjpqLcOSXo5U9k/8FuDlE7iVYy3f/IR9h+tAcBv28tAdRnsKv HoUBi/ZJLUO2iAxnNmL66Cr+aKvmg3itvj+R1VMrTIenplG4t54sOA9QxmsSOHWxHYqm hZ3NY2o6WPJtscWNWLwaU+Y9tDNVzwO383zUFPZaGNxBa4nuHcrqCQr7uClEILjTsPJE JEbA== 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=JIkYYfWPZx8vu6g44rtUYz/n2J/i7vQ9ofU14VDGPeA=; b=NROR5qK/Bj/GFa6/60+lJ3B2G+8CeNDf7FcATwF7lzv/i1uhhU+4g2QQdVdCsOc0YN bMXxubtMWVqy2KVhGfG4OOFlQTPXGFPqXjfVzpVXlTKcazrPBdDa3Yi/BAdpAa40XZK7 svv5cbd9bFGdtiTd19pfakcwXpJYT5UoYbx3sC/eCpPMn3aHNopDjNlzbkuJA9fk0/gb bKjtAfYt/gA0eUPiyGBtC/2hl1rloizrUh//UlXt9PyKaTJIVFykxU9cWgcyhfhYv/WZ 6ZJFLoCHTHhgs4z8GlLzxnzhJbza+hsQ6tqpboMkD//FMEPye2H2X2mWkXZPTVALaT3G wTCg== X-Gm-Message-State: AOAM530hwi4snJ4B6/WtU0id4sfZL+xJo7HvvUlfLXKEtvKpyHVevVW2 98Wp3d4e2w4KhADG7gkdv0A= X-Received: by 2002:a05:6214:1454:: with SMTP id b20mr4509113qvy.35.1598051078892; Fri, 21 Aug 2020 16:04:38 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id q126sm2723114qkb.75.2020.08.21.16.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 16:04:38 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Fri, 21 Aug 2020 19:04:35 -0400 To: Thomas Gleixner Cc: Arvind Sankar , "Paul E. McKenney" , 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: <20200821230435.GA56974@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> <875z9dioll.fsf@nanos.tec.linutronix.de> <20200820130641.GA536306@rani.riverdale.lan> <87zh6ohm03.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87zh6ohm03.fsf@nanos.tec.linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 02:37:48AM +0200, Thomas Gleixner wrote: > On Thu, Aug 20 2020 at 09:06, Arvind Sankar wrote: > > I don't think that's an issue, or at least, not one where force_order > > helps. > > > > If the source for foo() is not visible to the compiler, the only reason > > force_order prevents the reordering is because foo() might have > > references to it, but equally foo() might have volatile asm, so the > > reordering isn't possible anyway. > > > > If the source is visible, force_order won't prevent any reordering > > except across references to force_order, but the only references are > > from the volatile asm's which already prevent reordering. > > > > I think force_order can only help with buggy compilers, and for those it > > should really have been an input-output operand -- it wouldn't currently > > do anything to prevent cr writes from being reordered. > > Fair enough. Care to provide a patch which has the collected wisdom of > this thread in the changelog? > > Thanks, > > tglx The gcc bug I linked to earlier is only fixed in gcc-6 onwards. Is that good enough to remove force_order? I can test gcc-4.9 and gcc-5 to check if it would currently have any impact. CBL guys, can you confirm that clang also will not reorder volatile asm? Thanks.