Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4870311imm; Fri, 18 May 2018 12:05:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqDnikFjXkEEMttF22heYFuVjIHgwzaWbXkddWjUAuPRmPFAGoMmoH0bqG2hmuRa0TdPtw7 X-Received: by 2002:a17:902:d909:: with SMTP id c9-v6mr10499168plz.293.1526670324363; Fri, 18 May 2018 12:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526670324; cv=none; d=google.com; s=arc-20160816; b=GrrgQFRfHSNPYdoqNSwAk8vXZqDxYrIj/wTqk7yVB1AMLADbiqOz8zy29AHzsJf77U xLY7N6kAN5gh1Nk8u9/fBZXuToDHA4xDnYO1TSlPEqX3ap+0JP0m3XSU1i5x2qicTlDU DGT4WSwuKu27dj8Ju+qbUky65FeLDICDT9WEURcXrVQ/B3KVEx+qv/L9UgUOVdSB2Y3T pKZj0/xO8acCuF7chgW8u48sJ3f888kEATm9+enUzdbpJZoLekwn3pw/23oJWyNBBRuz abX2Sc1jTKTCYD9F56/LC8HaBURR2VSJ3cT6JBjiUBaotQYKRJEfelwL+gxFOvZHeF6D 1LvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=WOG/BXlZ/KzDGmPqklIT/Dkh0goZVCtLdgjfhMvD17g=; b=NaHOhtDybtqymW1imMHY/JQxn/XOZota515qkAggQlUqYvd7VjrpJHX0Z5DLCvASbC ow31d2TrbWrnD5PPlgjLbxUCV5hBd51WjNjLpZtgpiQdunq24VcFWVwvKms15Kyfx+/Q cbxr4gECXTRybwxpc34HkzpHXhd/ThPiP6KkH7C2c3fkP5aYtoYa2g33j/emdBc87vXh dyd1YdqpCMSHpyDhBi3sG5MErf0TLsWbqeZrviw5RkJASvpvajbsGirJS9uB6HBeynJM IBSlWJ+yhE1XBlpsZeTdVy+q0vv36Is7QE/iRAJAX7mFgvad5a+NprM+RlLq6jn6aOM+ 0j/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@onevmw.onmicrosoft.com header.s=selector1-vmware-com header.b=Ol+gdz0d; 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 w20-v6si1289188pgc.645.2018.05.18.12.05.09; Fri, 18 May 2018 12:05: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; dkim=pass header.i=@onevmw.onmicrosoft.com header.s=selector1-vmware-com header.b=Ol+gdz0d; 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 S1752204AbeERTCy (ORCPT + 99 others); Fri, 18 May 2018 15:02:54 -0400 Received: from mail-cys01nam02on0073.outbound.protection.outlook.com ([104.47.37.73]:58496 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751221AbeERTCx (ORCPT ); Fri, 18 May 2018 15:02:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WOG/BXlZ/KzDGmPqklIT/Dkh0goZVCtLdgjfhMvD17g=; b=Ol+gdz0dnFJg7amhqqKQZORB+KqRrEXROd/7CL3LkBeOuE+TuF3B9YU98SYEJQc2hYAxVlA9zH/VLY/DwAV1fn3ceCh975Ymyhz073pnfiu0ZRJOAQdFHyPlH3le3A6ZYShmsbDAhxvnWikLg+k5dmKRIba4ORs0SmTg8qaR2q8= Received: from SN2PR05MB2654.namprd05.prod.outlook.com (10.166.212.137) by SN2PR05MB2429.namprd05.prod.outlook.com (10.166.212.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.5; Fri, 18 May 2018 19:02:50 +0000 Received: from SN2PR05MB2654.namprd05.prod.outlook.com ([fe80::dcb:7409:11fc:2327]) by SN2PR05MB2654.namprd05.prod.outlook.com ([fe80::dcb:7409:11fc:2327%3]) with mapi id 15.20.0797.007; Fri, 18 May 2018 19:02:50 +0000 From: Nadav Amit To: "hpa@zytor.com" CC: Linus Torvalds , Peter Zijlstra , Linux Kernel Mailing List , the arch/x86 maintainers , Thomas Gleixner , Ingo Molnar , Josh Poimboeuf Subject: Re: [PATCH 2/6] x86: bug: prevent gcc distortions Thread-Topic: [PATCH 2/6] x86: bug: prevent gcc distortions Thread-Index: AQHT7jbL50o+w3m6PkeKHm2HX6GyP6Q1H7KAgACNMgCAABDSAIAAERIAgAACU4CAAASRAIAAAOaAgAACnwA= Date: Fri, 18 May 2018 19:02:50 +0000 Message-ID: <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> In-Reply-To: <2F760FAE-C19C-4BC3-A8CC-7D17CEF3B116@zytor.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [208.91.2.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN2PR05MB2429;7:J3xLfVpA97NDucxTd5wVVpYKVrvOrNJNEYlezWWlm/hdqBlVSeu768kLQ6n1FFbt1xQajh59+9Z+P9VSeFFIydMsFgR0+cJy7egXv2iFxu8ckFuS3BoWIus90Ly64TjXS4YuEqcM4r5CYXfxLEXQEVjYUvvJvfRWqljy2hwVPd0q/zVHBH02be4zOwAz/dBOBFbN8cdPsSw8IDeX5OpXmzVk4QJnjbCOG/OULPbrVtcFtZl7O9omOc8dVXBd7eLk;20:1gasFVhegF7C9QCMAd7YymBuFilSJwLko6naoDyv64aWgwypeWjgSJr7innInEVN0tQkDHskOwMtK2Hg0eO8OochItbeeFAb3smNRWe9HqFA43aq+q4Q6iFiK9dGsyTR+q8vOoRc+cHQFArFBFogwVs+3PRdK8iCV9nDBsCQ8Ic= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:SN2PR05MB2429; x-ms-traffictypediagnostic: SN2PR05MB2429: authentication-results: spf=none (sender IP is ) smtp.mailfrom=namit@vmware.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN2PR05MB2429;BCL:0;PCL:0;RULEID:;SRVR:SN2PR05MB2429; x-forefront-prvs: 0676F530A9 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(346002)(376002)(396003)(366004)(39380400002)(189003)(199004)(14454004)(478600001)(86362001)(6916009)(97736004)(4326008)(6512007)(53936002)(5250100002)(5660300001)(2501003)(6246003)(229853002)(6486002)(106356001)(105586002)(68736007)(83716003)(25786009)(2900100001)(76176011)(476003)(11346002)(316002)(446003)(2351001)(66066001)(2616005)(102836004)(186003)(54906003)(81156014)(1730700003)(8676002)(81166006)(8936002)(33656002)(82746002)(6116002)(3846002)(99286004)(5640700003)(3280700002)(3660700001)(53546011)(6506007)(93886005)(486006)(26005)(7736002)(305945005)(2906002)(6436002)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR05MB2429;H:SN2PR05MB2654.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8hU165aTdgptPBMRP2rg4FpvUshFaW4lo9dwphslgaBdRrjURZVylEYp293Bj49muxuo1rICYn6y7WgcGvVfrkr7ywQZOCoEC5qAuDvqU/Hn8/s6TXb4KZ80bWF0zLt+OLXtlDH8RFEg8BHJvdKWBjCHru7NlGHetRDHo1kzvCJiuFa4MaGfl97iFurxk745 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0fe2328a-7cff-46f5-955f-08d5bcf1f3e9 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fe2328a-7cff-46f5-955f-08d5bcf1f3e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2018 19:02:50.6386 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR05MB2429 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: >>=20 >>> On May 18, 2018 11:25:32 AM PDT, Linus Torvalds < >> torvalds@linux-foundation.org> wrote: >>=20 >>> Unfortunately gcc doesn't guarantee that global assembly inlines will >> appear at the top of the file. >>=20 >> Yeah. It really would be better to do the "asm version of -inline". >>=20 >> We already do something like that for real *.S files on some >> architectures >> (because their assembly really wants it, eg >>=20 >> arch/arm/Makefile: >> KBUILD_AFLAGS +=3D$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) >> -include >> asm/unified.h -msoft-float >>=20 >> but I do want to point out that KBUILD_AFLAGS is *not* used for >> compiler-generated assembly, only for actual *.S files. >>=20 >> 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. >>=20 >> Can you perhaps define a macro symbol for "--defsym"? Probably not. >>=20 >> Linus >=20 > I looked at this thing a long time ago; it's not there, and the best woul= d probably be to get global asm() working properly in gcc. I can add a -Wa,[filename.s] switch. It works, but sort of undocumented.