Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965552AbeAJPSS (ORCPT + 1 other); Wed, 10 Jan 2018 10:18:18 -0500 Received: from mail-sn1nam01on0055.outbound.protection.outlook.com ([104.47.32.55]:50144 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965006AbeAJPSQ (ORCPT ); Wed, 10 Jan 2018 10:18:16 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Subject: Re: [PATCH v3 3/3] x86/retpoline: Convert generic specific retpolines to use RETPOLINE_GENERIC To: "Woodhouse, David" , "tglx@linutronix.de" , "andi@firstfloor.org" Cc: "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "tim.c.chen@linux.intel.com" , "torvalds@linux-foundation.org" , "ak@linux.intel.com" , "x86@kernel.org" , "luto@kernel.org" , "pjt@google.com" , "dave.hansen@intel.com" , "jikos@kernel.org" , "gregkh@linux-foundation.org" References: <20180110022831.29826-1-andi@firstfloor.org> <20180110022831.29826-4-andi@firstfloor.org> <1515590133.22302.148.camel@amazon.co.uk> <1515595594.22302.170.camel@amazon.co.uk> From: Tom Lendacky Message-ID: <1e4e8acb-7f21-aa13-5c0c-5dccb2c4c8e4@amd.com> Date: Wed, 10 Jan 2018 09:18:09 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1515595594.22302.170.camel@amazon.co.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR21CA0044.namprd21.prod.outlook.com (10.172.92.158) To MWHPR12MB1150.namprd12.prod.outlook.com (10.169.204.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 79456e55-d406-497b-cb5c-08d5583d5e0f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:MWHPR12MB1150; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1150;3:sGFPSVyXxp7fje7tnC3UCbddNHjOJp65co8WYljkwp1MOHOiMpN4pyFffJ+YXYEer3Ju9/BEt86m+UkEGENz+QEyi5q3K2tkfX3hp0sHony/x0zAeXhqaYs5obu9+HkS3kmI9nz2TeYShy63S8qbfVAx+FQIobSE9qghf+iKxbIbmJSNvOh7KaYzuANC6a5CYpmEfYYSspRuJGXMgyfzvrKP91y3ivLAmUipbNbncYle/SHHPMhGwhf6Zev1XkAc;25:SiKK1ryfLiPg2GWaMtxbdZwMwWm5zKJObBfsGzg1xzirX65E5F189H1l4xHie9y9+h2wE00mxhOanYJhQSfVjbWek1EYw38/m3MX2DYjK2kc9vvJGr2s3LuMO2cTFygEqXvu4T1XsuXmMLdhDvrGe0nAgOSVaVfUF8U6xov0Mn3HsSCQGidIuqAZCCURCvvurXwouBokg93s/q2BKRYsjI5NwFG3gAlXIL2LX5U99UVJa7Z76BWS2qWfWtHml2nR4EmRCsSlROzyPxr35YOWdx+pEXfbHPp4M/8fSMp6se35zzx/OXE25dtQ5IQjjDZYh+2Q+K6zbWnv5OmBv/5cJg==;31:6imrlKdHzkwtqVro3lvLr9AYDn6rxl9YtN8TDsx4AFZw+aSj+MWgCTy2jkmat12SsxwCUkXV85TplDiYSUh2LB1y5mpKtoPNmchSHn2/wo8EddqAvxpgEqUt37kYLliYF8Tn/t3Ip/WMACLDIFWp/rRmb3ns44A9O68W6cFnF+GqS+gyQFugFqkWbgq+5j2OIncNXo8xmBQSDSmS9Wik7qGM6m5ZIs2poyK9ARjACJs= X-MS-TrafficTypeDiagnostic: MWHPR12MB1150: X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1150;20:fYNLPPAsnYylAa/bJgfm9Vi4/us9a1yA0EjgQd3G34vxEw65UX6zVIDtk2Oc+hihWwXSpvA4EaLtOZu/9Er2uOc/z/4HzLptue+vbZZVvyUds1nTDRbn2wwh+MPlZIcMv4UuYZr+RBEGMnt0zzrSwoKVYfrZXGPNQ9l3k8RDWvCiCqDJtks6KhyYzsc0AlplhSvFiCwsBfk4Ogdx0foyr2QwnIsF2Usv7MK9yn7n/FFx6Ys17ZNAcTariBxNj/9Ia5zt+461BxjLomvatRoRrmQTrHnDmzX9w/DRVUMPsm0E8Oum1hn9tCQVuU3QeHZ6h2tOrUzmdqk3nTo7eEGwm0ZGNhmTtfkcetAewFi/jc3yk/11Wy5jCNe4t1AOzMAo3AKBGbF5eBqJusIvrt+5XfK6c42KTyRXsT8OGsxFOFqb7m/FSuGPL70YFgaQN5JCe/S5tRh0jtTr1f0HPsnPc5F72umU+J0HRVoXe6xhaXinre+XbUHLhTRfb66/z1fX;4:z6bmfXd2A6SWnkg8M+/bpPq2rNDckp0m4zPJ3GYC2whrwsfHvf8UT0ezW2X1698Ky8ORRgBZeE15l2/j6u3EOyyxtl8knMp8vpRRUl7uabPU8sI7ACXbt/CyfWgQ2piXQCXs3qxEM+MlEhf6IJsIt0ARA7/XSgHRJJzvAH9o4MZpuU8QUSDjRQYOuR54AZK/3saaOpa1D9xtltBjdmHHXr1X2H1ILWE7PI0YtXItaGbzT/3nfk/ODq1yhe0Syfsy07kx1zpl+vfpduIec0EbuLcFDOgFNQa87UnDG88t2Zl58ZYqaZUrnQxceVim3vQA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231023)(944501075)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:MWHPR12MB1150;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR12MB1150; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39860400002)(396003)(39380400002)(346002)(376002)(366004)(377424004)(199004)(189003)(24454002)(25786009)(8936002)(47776003)(52146003)(6666003)(2870700001)(76176011)(81166006)(6116002)(81156014)(3846002)(31696002)(65956001)(66066001)(97736004)(2486003)(2906002)(2950100002)(6246003)(31686004)(3260700006)(65806001)(53936002)(106356001)(8676002)(5660300001)(4326008)(64126003)(65826007)(2501003)(50466002)(23676004)(105586002)(229853002)(52116002)(86362001)(68736007)(90366009)(6486002)(77096006)(16576012)(2201001)(7736002)(478600001)(386003)(53546011)(16526018)(72206003)(58126008)(93886005)(83506002)(305945005)(316002)(7416002)(110136005)(54906003)(36756003)(41533002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1150;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUwOzIzOk55Z1o2TDBRV2RFMjJtMEFoV0NWZVJHSU40?= =?utf-8?B?WHlpKytNSFo4OFpaSStCYzdkcVlGaklsaGRDY1dPbXBhSG9qQ2RmZXZYdDZz?= =?utf-8?B?aXVMTDZNRVRYL3luLzBZc1BMYm9nR0VBZzhsc0FXdUlUN2hwL01DczVuYzlJ?= =?utf-8?B?ZzlFWGVUWDJ4U3NLWWFwUlBvU2Vsc1JzZUFTTTFPWTBXMWRpRTY0b0x1cnln?= =?utf-8?B?aUJYbjBHMFFPZExoNU82M1Vvc3lnNUZVRjBwYUVNM3d2ekVHNkZsd3ZrTGRG?= =?utf-8?B?czBBeUw1L2pvVWNLRnJOamJnMjY1aC9nQktadS95eHYxTjFhZkVtajY3VzRM?= =?utf-8?B?MmFRVlQ3U3B5b1E4MmtYOG8wVFJqZk9OeVc5MWg4RFdOdUJiK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7IMx/sYZdpn6GNGBHV3t0z/dqtmvJrrG29a6Eju5G5IgaZL7YQUjOeHx3aEidocoo78KqvDcJsDSiGud+/EKbwNqxeuJhQxKLAjg+4O4zJCSJqpHA5KkR/XkcEa35WAOt1j8DrPqLv1E12XTjd88+p7NgMus42MYDM5RWq1X9OYqbg X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 15:18:12.5573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79456e55-d406-497b-cb5c-08d5583d5e0f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1150 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 1/10/2018 8:46 AM, Woodhouse, David wrote: > On Wed, 2018-01-10 at 08:23 -0600, Tom Lendacky wrote: >> On 1/10/2018 7:15 AM, Woodhouse, David wrote: >>> On Tue, 2018-01-09 at 18:28 -0800, Andi Kleen wrote: >>>> From: Andi Kleen >>>> >>>> X86_FEATURE_RETPOLINE has been renamed to X86_FEATURE_RETPOLINE_GENERIC. >>>> Convert the sequences using it. >>>   >>> AMD documentation says they need the RSB fill too, so these should stay >>> under X86_FEATURE_RETPOLINE I think. >> >> AMD processors don't fall back to the indirect predictor on an underflow >> so this isn't needed on AMD if it is purely for underflow prevention. > > It isn't purely for underflow protection. This is needed (see the AMD > doc) for protecting against RSB entries that actually point to > userspace addresses. It's only not needed if we have SMEP. Ok, hence my caveat on the underflow in the reply. If it's to eliminate userspace addresses, then yes, it needs to be applied for AMD as well. In that case maybe the comments in arch/x86/entry/entry_{32,64}.S need to be updated since they only talk about underflow. Thanks, Tom > > > > Amazon Web Services UK Limited. Registered in England and Wales with > registration number 08650665 and which has its registered office at 60 > Holborn Viaduct, London EC1A 2FD, United Kingdom.