Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4871292imm; Fri, 18 May 2018 12:06:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpo67z0r7olYPKy28zFt34XGY0WSlkju7ByHHhvIjMxMxM3RjfCB3U+xrJh3UwWi6NUgn1b X-Received: by 2002:a62:fb14:: with SMTP id x20-v6mr10623863pfm.48.1526670384074; Fri, 18 May 2018 12:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526670384; cv=none; d=google.com; s=arc-20160816; b=0BoE+RPAJx4m7lQLEIWB69Vdf9Z+XiTVX3IhjX2ept+Y+Fbx+K7lM2JyAb/et3cOXJ DROXM4NbBmngfEpi4/BQOp25ENZu8LSlohc5orQ7m1L77RpggIxzf1WpOp93kp5LmbtF L9CszzTqUMJBPwUMyRTSeIa/MnqD3Xacly1TWSaHFxwP9M9bd5MlwqcSbNla3TC6aK2j eggl16DCGo7+feCvi2cyy5GPksYw/8zth3ZgiFeKqN3VFSEIZzANla52fV9of9HzuFJq dxyjepTAEV5cR5+oCAQfeoTFDyDwSui0zHWQ/IL09Cx+Jxgz1idsJVupUC2cjzVQKsn/ 3kOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:arc-authentication-results; bh=gp2aA/tYK+/pytogSOqO0QmPhjN5Cx00oimcLzZ28TQ=; b=bOVlOIwAS9BgucJtVXsX+CjYvfgD54FycDdr8Kkk0dJXbEqmUUwF49tZaa2Emj5are dPISwLnWfyjnWG4wDLZG5SHk7XnaBpL21GGG4fiowvSJ9YY8SzCW00KMB2az9boXHYPn VseZXCbj9AKX0d8hXqvdd5kImDMxw66SVjF6lhxCYdJge/LegWNgD1LBYyvbxgCfyh5j aRGpczww+6KNjfh9gFB5lXRL2zkPrwRAY0XkEWCzVjRx7LKQbx61jmtw7IiRtR4vOUA9 +BwZinbZihCOZWKecT7UBl89tYFuIKGbNyYHRzZVypqJUrylHP4UvSS7bS8FWT80GGam LJKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9-v6si7759615plk.434.2018.05.18.12.06.09; Fri, 18 May 2018 12:06:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752199AbeERTFv convert rfc822-to-8bit (ORCPT + 99 others); Fri, 18 May 2018 15:05:51 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33273 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbeERTFt (ORCPT ); Fri, 18 May 2018 15:05:49 -0400 Received: from [10.170.141.84] ([192.55.54.58]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w4IJ5Uvp2542765 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 18 May 2018 12:05:31 -0700 Date: Fri, 18 May 2018 12:05:28 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <6A3E90AA-7838-4C2A-B628-908F34902B75@vmware.com> References: <20180517161402.78089-1-namit@vmware.com> <20180517161402.78089-3-namit@vmware.com> <20180518075853.GD12217@hirez.programming.kicks-ass.net> <6DB0E0C2-CCD2-4FCE-BD8B-5E340E308FF7@vmware.com> <2F760FAE-C19C-4BC3-A8CC-7D17CEF3B116@zytor.com> <6A3E90AA-7838-4C2A-B628-908F34902B75@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH 2/6] x86: bug: prevent gcc distortions To: Nadav Amit CC: Linus Torvalds , Peter Zijlstra , Linux Kernel Mailing List , the arch/x86 maintainers , Thomas Gleixner , Ingo Molnar , Josh Poimboeuf From: hpa@zytor.com Message-ID: <0AE4A626-C4E1-47BC-912A-F768643C8689@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On May 18, 2018 12:02:50 PM PDT, Nadav Amit wrote: >hpa@zytor.com wrote: > >> On May 18, 2018 11:50:12 AM PDT, Linus Torvalds > wrote: >>> On Fri, May 18, 2018 at 11:34 AM wrote: >>> >>>> On May 18, 2018 11:25:32 AM PDT, Linus Torvalds < >>> torvalds@linux-foundation.org> wrote: >>> >>>> Unfortunately gcc doesn't guarantee that global assembly inlines >will >>> appear at the top of the file. >>> >>> Yeah. It really would be better to do the "asm version of -inline". >>> >>> We already do something like that for real *.S files on some >>> architectures >>> (because their assembly really wants it, eg >>> >>> arch/arm/Makefile: >>> KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) >>> -include >>> asm/unified.h -msoft-float >>> >>> but I do want to point out that KBUILD_AFLAGS is *not* used for >>> compiler-generated assembly, only for actual *.S files. >>> >>> Sadly, I don't actually know any way to make gcc call the 'as' phase >>> with >>> particular options. We can use "-Wa,xyzzy" to pass in xyzzy to the >>> assembler, but there is no "-include" option for GNU as afaik. >>> >>> Can you perhaps define a macro symbol for "--defsym"? Probably not. >>> >>> Linus >> >> I looked at this thing a long time ago; it's not there, and the best >would probably be to get global asm() working properly in gcc. > >I can add a -Wa,[filename.s] switch. It works, but sort of >undocumented. Ah, I thought that would have assembled each file separately. We can request it be documented, that's usually much easier than getting a new feature implemented. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.