Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753669AbeAJAWt (ORCPT + 1 other); Tue, 9 Jan 2018 19:22:49 -0500 Received: from mail-dm3nam03on0087.outbound.protection.outlook.com ([104.47.41.87]:9903 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752936AbeAJAWr (ORCPT ); Tue, 9 Jan 2018 19:22:47 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Subject: Re: [PATCH v1 1/2] x86/retpoline: Add a function to clear the RETPOLINE_AMD feature To: Thomas Gleixner Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Rik van Riel , Andi Kleen , Peter Zijlstra , Linus Torvalds , Jiri Kosina , Dan Williams , Dave Hansen , Borislav Petkov , Andy Lutomirski , Kees Cook , Tim Chen , Greg Kroah-Hartman , David Woodhouse , Paul Turner References: <20180109223723.29322.59126.stgit@tlendack-t1.amdoffice.net> <20180109223736.29322.5436.stgit@tlendack-t1.amdoffice.net> <12147db9-e975-268f-55ee-247868e0e0d8@amd.com> From: Tom Lendacky Message-ID: Date: Tue, 9 Jan 2018 18:22:39 -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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR11CA0047.namprd11.prod.outlook.com (10.173.25.33) To BN6PR12MB1139.namprd12.prod.outlook.com (10.168.226.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 48cee1df-1c1f-4756-a557-08d557c0446b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307)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oMdn/zaofEX+NCo3gl5p/Tt31X9rzbiIOC0QtzI3wJFl/j2yrc35fp9Ss06k5JZUGITcIcsRg9u+0tq+1i6khl/17khrgEyCshSOiPOKSNkaNJnmmig9+cjxIOdRqvMbqmhxt0ANQnIHzW9nji4THVZjvydKObl0k9BNPK0Qhv5H2FfGSNNhkaW7ijzqPjWjjCsm767U0tLF/GlM05vxpBBJSGtG843xyTLGB1TNLY8oT4siV2uIzoNwokduZgf+ZakoTkPpzlp6zH6JjCSlq200RkH5Ahuizc8NPB3UqafK0uMok8nbCQQdUmcmQnftdY0Illqe7fqkykvAZbemHlflAWduT3eGEE3Xi3ZT8YJLexSaoOgGtMowOa4tqsTl9qJHftaCCEV+nXuMLuDUYvKv9eMHfb8ORGsiPMx;4:DnNlFRoQRSGI1fLCFz0h7VUNKMvJvWQhDHWPs5pL3jrlQ4ACRXNk1grcHt4FP2JpA+kvdIgm7eODi7Zt4oC6+8tdLdjK3E8kUKLsPjVk/edePW9LRekAdshho5UqpWwoztieqttyQwFRr5cnKnVlgQym4B2vKTSCYhmphwps8MBui92N/EO8Z62CctBJNq9zGHt3rjI/8Pw4inZ9xcNmvYAWsfoBQ9G67Cjnt9bW49oUvxuMCwP6ChKIyOlQlI+6SZaggezdWGOKAzKJmuw1aw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501075)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:BN6PR12MB1139;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BN6PR12MB1139; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(376002)(396003)(366004)(39380400002)(346002)(39860400002)(24454002)(54534003)(189003)(199004)(6246003)(5660300001)(7736002)(50466002)(53546011)(105586002)(386003)(65806001)(65956001)(47776003)(66066001)(8676002)(31686004)(106356001)(31696002)(7416002)(81156014)(4326008)(93886005)(81166006)(305945005)(8936002)(3260700006)(36756003)(65826007)(230700001)(6116002)(6486002)(77096006)(86362001)(478600001)(25786009)(3846002)(64126003)(16576012)(90366009)(54906003)(2906002)(72206003)(83506002)(316002)(59450400001)(16526018)(53936002)(2950100002)(97736004)(2486003)(52146003)(23676004)(52116002)(6666003)(229853002)(76176011)(58126008)(68736007)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1139;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM5OzIzOjVJRW14SmRadU50TWhNeWhlSWtFVEFPUlBp?= =?utf-8?B?RGIxVlkwMm5DWkNNQzJiVFJoaWlWdERseFE5VEtGdThUbGljYTY1d0tyY3RS?= =?utf-8?B?YU9FWVVwbUVsQ2c3M3lyNDJ1OHk3TlkzS1RJMzE0L0VXMUNCUGVFWUVBQ05J?= =?utf-8?B?Z0R4Y2FINWpnVHZLaE9WaWNWN3pNWnVNUXlZU2l6QmZ4NUhiUkg1V2QxZW9R?= =?utf-8?B?emp6Rk41c21kUmJKbGNzaDhGQmNYaHpITmRXcFk4MlJQN1ZrZVR0SllNdXRv?= =?utf-8?B?Tkk2aTFJdVppaDdMcmtVcmVoU3pkeXlpQW44RGcxakdWUFUxZmIxZjEvWnp0?= =?utf-8?B?ODNrRmtCc0dXY3NIMDhBNlRPVW9UV1E4bWZzdys2dERQTXk4c1dRTHV6Q1ZE?= =?utf-8?B?dUFLQUloTzhqeTVuRHRYQzNZZ0tTa0JXWlp6SFZGU1hXSEFTV1ZSbjB1N0JN?= =?utf-8?B?b3hERGcreTZscmEwUGdiRy9VNlNEeHRNK293RkpJZnBrZWxaazdwSV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vrh6TWItScyedTWIlILnQnsatxn0n1x5r8kJo0ONCglTX+WsheyAb+M6Rrrl/T0hldSUXBBO0fcI5yRxPrm76TryIysD18Z4tKKIw6DqBlnSCsyp5PcG2Q=;5:ezH0K/jH89Y5/0o/anjyeMbCNo+jJ5cm/QaFa3krh/YcYn025QNXOmUs/TX4XXuxs23S80my7L2oXBeMFIU/M+coEHxTED6D2TW0V51VAZrTsWfV29hawC8F0+0vDWx0pfCcCubEvh0EoK2mpwxsFiegc7/dYUtRi1jDSvTiEwg=;24:u5icuAzm1yHWhTXOkgo1tDxcTMQPGiVuHlK5n+3y+INjXi4R5mnG6XVW/9EsyxNQ7U99vnk6RjCUSsF0tCjxFqCXDg6lyvUWUa5NITKDMGc=;7:PmJAuRic21qE1DxCL+0ceRipPIUH/hTk9YpbRWD+jlIN/DXDyeAOb6hM0DtIj5P7n6eRr2LbYj3ECDG/s8Y0oeEiO3AAUFBv7U4zaiwsk1qOa8BTIOLO/3YGtyXrCkWtYuLyB4ec2xcvq7xAv6xns8ICnLQ9fDKaz5A0de0XX4O/bydSc6Dhnny6wEX/VbY62mS4geZVwiq6NDq55guZMYHh2EvK9LXHsiyg9MXHOqoSZGd4z7AGn//3Hls23GRd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1139;20:sFRO4jCMFmBLKkbG9CnFJJGEg7Ek/qVQFn8/FDc83tm1sfzfcwuZOJHw/HuY0k8Aw49y/LtjsxAYzgq/QPeXaYmIDUcXatQ31DEiHHw78s3m7uuqwpmxafLLZMEPHez/pMnjbyl5v4uBC1oQFthskvVPebPbmESHm2ITJ1/YtbPceKnSjkbFWQgIFOzDJ20PQNsrAq6Ez4cdEL9Z76WqIU+/ftAu7STmM9EKoUPhimHEuKiZUpXCFAtP/nbDu9ie X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 00:22:42.5879 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48cee1df-1c1f-4756-a557-08d557c0446b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1139 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 1/9/2018 5:43 PM, Thomas Gleixner wrote: > On Tue, 9 Jan 2018, Tom Lendacky wrote: >> On 1/9/2018 5:09 PM, Thomas Gleixner wrote: >>> On Tue, 9 Jan 2018, Tom Lendacky wrote: >>>> On 1/9/2018 4:46 PM, Thomas Gleixner wrote: >>>>> Urgh. That's an awful hack. why not do the obvious? >>>> >>>> My first attempt was very similar to your change below, but testing >>>> showed that spectre_v2_check_boottime_disable() is called before the >>>> X86_FEATURE_LFENCE_RDTSC can be set. I can look at moving where the >>>> X86_FEATURE_LFENCE_RDTSC is set, maybe into early_init_amd() or such >>>> if you think that would be best. >>> >>> Wait, we can move the selection _AFTER_ identify_boot_cpu(). >> >> Much cleaner. Since it's just a single patch now, do you want me to >> re-submit this after I test it or will you just pick this up as is? >> >> I did notice that the patch does change the behavior associated with >> the command line options, though. Not sure if that was intentional. > > Yes. I noticed while looking at your issue that when AMD is selected on the > command line then we have no support at all on intel. So I prefer to err > out and enable the generic version. > > If you can just polish it up with a changelog and resubmit after testing > that would be appreciated as I'm steam blasting the IBRS stuff at the > moment. Will do. I'll add your Signed-off-by when I submit it. Thanks, Tom > > Thanks, > > tglx >