Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1242547pxa; Sat, 22 Aug 2020 17:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB30HYXRuENjhIlaoyiHhbJnwW47AupUELKwMA/vCLdDR1WNrQIqVgM75H+Oq+xaLI3Skv X-Received: by 2002:a05:6402:22d9:: with SMTP id dm25mr607edb.2.1598142291292; Sat, 22 Aug 2020 17:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598142291; cv=none; d=google.com; s=arc-20160816; b=owsG29p/SDZP4lHEGJ35lBmHXXZKswEVswv9r5oJSZavb0fo2dV0t0R5aeBOStLHOQ 17rLSc83Siju4McgCJ4NEe4Df6/SPqx7LFUVmIOKTDFTiW0SN/92MSztSJkbGAQk/ReO jH/qg9bZfxP9a6CMkXqfHXu77RUPoDtMP63D3hwW1zYU4YgWgaPA7c3x5fC5PM+Wywj+ TkgEriFA3LjFTGFXZOIUmJ0MzKhef+W2DZKdbO40vIapiIGKei9k27W+srfC3nFW+RIB 5hk4UD+wJek07ZFYUlIX8AmEoAme1gSUee/2Yr6SPMXX/vCc50m9zbE5waJOCJhmdYNm BwmQ== 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=WP9wSIBfD5wQcrpZkPoM0hMwoWbFysB2p8Lq1GzRYos=; b=EGManeXDLTFUdEwoO2USRsJIJK4bJATdDrhM/qUh1fJ29jQOV63Wtkin1NSZmh1kZI YAC9Mi9AF+ZIjQfAWkSKM8CK3hLL09Mal7R1JoEVnZ0D3QdKNb1o85SSInD7INt6hGt2 IVz+/zehTRSVGLIc8wMs5FwneEHzBk2xcE/YL044DvUiA+o0+zxILtT0AcMLzAYMx0LI en9Y4OR6ra/mrDWOT+cyicfdnFqk7VxPddSf5wI9DfbNbp9DQv10vuZoxnCjRo0p0FDd rAEHQQW0hIqfgvSMevePqThpEbhWtD/KjcN0dtELFhRaQpis0tv7/5kE+Z3pqdjYLGO3 XNqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ht6E7a1e; 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 t21si4140135edw.393.2020.08.22.17.23.49; Sat, 22 Aug 2020 17:24: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=@gmail.com header.s=20161025 header.b=ht6E7a1e; 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 S1727807AbgHVXLA (ORCPT + 99 others); Sat, 22 Aug 2020 19:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbgHVXK7 (ORCPT ); Sat, 22 Aug 2020 19:10:59 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D44C061573 for ; Sat, 22 Aug 2020 16:10:59 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id c12so3806985qtn.9 for ; Sat, 22 Aug 2020 16:10:59 -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=WP9wSIBfD5wQcrpZkPoM0hMwoWbFysB2p8Lq1GzRYos=; b=ht6E7a1eeLBJIHl9aEjd3ev1/r7WsVvVKww5iOuCNDhCAduLaASmfQpoUjIloOPDXe KqGFzgukIGYxxjVfUWPeb9q8AH1TihQTQ4z9EwPOA8C4f3sdmd54Z0vePcQAnaX18gC6 hSM1lZyF2nw43CeUKprvNYjlSyde1iCa7YCOvAKMbuO2x2MFDqztu9lJxHs0d9wUXsBS B43ZPYojNY8aFKCkGU8TOs5bHwRUkNjbv8iW/VbfPCvfXsmK2PwwWb7wrZkoO2H2/9ph JUGCWcGr9/xb7RmodLwXwTXMPVVRmD1jxDjeEMN1BauAKNYBNJhOZncmHGkAYMyt6R+P 1KSQ== 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=WP9wSIBfD5wQcrpZkPoM0hMwoWbFysB2p8Lq1GzRYos=; b=Ff3JkaF4vzbS5o4Es6zx6siAgtYEt1aGL7ofoQgmYFlHrUbzF1DrSDpjJy8OpbPOG3 3HprYKpjc5NWwEshUSL/KS4btZMJngEfAojDtv9jPujp8eYkRjKUSgGYxI1yy9JMwBPO 7WDavcIA3mi3itwg+NdEK8j2AUTnslLgEHD9qKPXnlPAJcqJiLct8jfLUAYtnDwPL5Uy RFSV4LF7OwIAEulD41m+QYv3zRAIINMwAmYvEtUf8oxStC0ik+Vw4kmgYAEW06cKkLKb UZUTxrhlOjr3OIzTwZSXPsTknSevFqi0a9gMyZfAtZq0TCQdOOqkIm5cmGuSH/iibVmO 4QCg== X-Gm-Message-State: AOAM531PChPq7JWrl79MiVKYCf80G3e2t8CRHqghc/7KQ41KZCbMkAe5 zspdRSistvji0yI5YGZFLCE= X-Received: by 2002:ac8:777a:: with SMTP id h26mr8246848qtu.141.1598137857602; Sat, 22 Aug 2020 16:10:57 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id z10sm6774896qtf.24.2020.08.22.16.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Aug 2020 16:10:57 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Sat, 22 Aug 2020 19:10:55 -0400 To: Linus Torvalds Cc: Miguel Ojeda , Sedat Dilek , Segher Boessenkool , Arvind Sankar , Thomas Gleixner , Nick Desaulniers , "Paul E. McKenney" , 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 Subject: Re: [PATCH] x86: work around clang IAS bug referencing __force_order Message-ID: <20200822231055.GA1871205@rani.riverdale.lan> References: <87zh6ohm03.fsf@nanos.tec.linutronix.de> <20200821230435.GA56974@rani.riverdale.lan> <87eenzqzmr.fsf@nanos.tec.linutronix.de> <20200822035552.GA104886@rani.riverdale.lan> <20200822084133.GL28786@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 22, 2020 at 02:08:27PM -0700, Linus Torvalds wrote: > However, in this case, can we just leave that old "__force_order" hack > alone, and to work around the clang thing, just make a dummy > definition of it anyway. > > Alternatively, just use the memory clobber. We use memory clobbers > elsewhere in inline asms to make sure they are serialized, it's not > normally a huge problem. Both clang and gcc should be smart enough to > know that a memory clobber doesn't matter for things like local > variables etc that might be on stack but have never had their address > taken. > > Or are there other cases than that particular __force_order thing that > people now worry about? > > Linus Actually, is a memory clobber required for correctness? Memory accesses probably shouldn't be reordered across a CRn write. Is asm volatile enough to stop that or do you need a memory clobber? Replacing force_order with memory clobber introduces a few extra instructions (testing with defconfig), but only in x86-64 hibernate/reboot/sleep code and early_ioremap_init on x86-32.