Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752154AbeAEQHp (ORCPT + 1 other); Fri, 5 Jan 2018 11:07:45 -0500 Received: from mail-co1nam03on0082.outbound.protection.outlook.com ([104.47.40.82]:51072 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751784AbeAEQHn (ORCPT ); Fri, 5 Jan 2018 11:07:43 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; From: Tom Lendacky Subject: [PATCH v1 0/3] x86/cpu/AMD: Make LFENCE a serializing instruction on AMD To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Linus Torvalds , Dave Hansen , Borislav Petkov , Thomas Gleixner , Tim Chen , Greg Kroah-Hartman , David Woodhouse , Paul Turner Date: Fri, 05 Jan 2018 10:07:36 -0600 Message-ID: <20180105160736.23786.45026.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR1201CA0021.namprd12.prod.outlook.com (10.174.238.31) To DM5PR12MB1147.namprd12.prod.outlook.com (10.168.236.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 58c88212-801a-4ea5-3328-08d5545672ea X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:DM5PR12MB1147; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1147;3:7+lJdI6XoflwvXPoSO9YIaUHYhk0zg4LRcTY0/PSNdg6dBt/1j8ASWTF1jOVuvyRy4R0FcEDnqeRYHMrSpc3AyeBb1nv0o7BrnrbAeKgxjovFVscPy1Ug+PYrd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O/1MoBuquQR23B83+I+XYFAWoUE/FPFMQa+c9zH5QBa/T1csiD+zsMqvnkmmz+TvkK6zWxd8+UuhseZsLZUwODSlSk47TVzNt9fnSm4W551mmD9Gj5OIuvidzWYAaiKU0l52mgQQVeizQPW8uFQtOdHgT/+QL489OPRDJuEwsrAb3qHLZ9GxEHLrXY3I6T7cx/g//nWCfdIw2aUtvK+M6OPz+tFa;4:jiDcWpc2bqrPeRxG6i9L8AnDNO+QT/X/qsQBtIgOr3KmDDs0pbEWplQeS3W2l22xA7jIprYkGwgKfrPb/UWVE5HvkHQ5uXRiUUmARrQFCn54mM447JfIYpZOOYHMC0+YoN2pcmKbB4o1nZmMjBdJTJZ/3J0aTd1rF7xSr10NXxqI0WPIR2mw54+XXtvAVw949DVG+73KS/1VvMFKFU1EXKOsAksKvZPb9LT/9Ms+vA0QUhmntBFzYKftwtbLQOU47VLYM72ynAC5Lh63ToQWlw== 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)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR12MB1147;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM5PR12MB1147; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(366004)(396003)(39860400002)(39380400002)(376002)(199004)(189003)(103116003)(1076002)(53936002)(6666003)(305945005)(7736002)(55016002)(6506007)(97736004)(386003)(5660300001)(53416004)(6116002)(97746001)(52116002)(3846002)(50466002)(2486003)(7696005)(23676004)(230700001)(86362001)(9686003)(478600001)(83506002)(2906002)(72206003)(8676002)(47776003)(66066001)(25786009)(105586002)(69596002)(81166006)(68736007)(8936002)(81156014)(106356001)(16526018)(4326008)(54906003)(316002)(7416002)(58126008);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1147;H:tlendack-t1.amdoffice.net;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ3OzIzOmdXWGFEZk5FTXVFc1U0alMxTXRNRHROSERN?= =?utf-8?B?cG9MSTNpWlp6dVpGSElmeXRDbVRDWm1XYm5jSi9GcGpNbjhTNXlGMnhhWmYy?= =?utf-8?B?ZU9weElYUm56Zzk5dmYrREc1Y2VCbTRrRGo1b3hLWDM4UW1kOUl1QjVKUTVw?= =?utf-8?B?Y2w5TlJnSzBJdWlOV0VaMG82M0owNlpBNlFLbFY4bG9mdlR6bS9zYjRqZmZt?= =?utf-8?B?THZTaHpFL294K0d6Ulo2SkF3dFk2dHJGdWYxaXVMQWJrcnhNa29YWGoxbkNV?= =?utf-8?B?R0NCNkpTc3IzWmQvaGdDU2dRN2JYMWlUM2FmNkMydlZmVDJtMGxQT0p1Zllr?= =?utf-8?B?ZDdoNmZWdDh6WHFiNUdObU1MVUVUL01Pb0VidlAvQWY1UXRDKy9Ha0poZDZh?= =?utf-8?B?QytoWTk2NGhYVTVDRkJLMUdDTDZ0ZnpJdmRBQW9ZZjh4S3FsanE3RGNScEFm?= =?utf-8?B?OXhLT0dXRnVqbk05VnJXbXgvTUlPTFp4OHIrUWNHM2lLRFRtZHVRZ1N6bHRp?= =?utf-8?B?Nk5OVWVHSzhJMi9oblpoVk9JbFVDVHJrNkhUWUExdGxtaUdNUXV4MC9rUkRW?= =?utf-8?B?bGtFalFpSUJLOXhqMGhEZERBYWY3clk4cnVKUUlQblpOMXFwYllONGJOL1VU?= =?utf-8?B?RXFxMEphY3BkbWVTMWxkT2E4eHJXejh4bkp5NU1jMTRPRXZoM1BBQndJVHVD?= =?utf-8?B?TWh4bWhoc08rTm5URzFyaUVGUzE4akdscVc2VF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R8qje3eogDGt8lHegV3Qq6VlvnH0BVr9Lp/etWwy8LvTXcuV8wvMXbK2QMfH+reww4K958TvBf7yMfY00ortj70piuvhZzkA/veQo2q3iC7nb8EO9uQOQZWiPoJfhqvDPc+Agc/38nYjOfj0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 16:07:39.9664 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58c88212-801a-4ea5-3328-08d5545672ea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1147 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: To aid in speculation control, the LFENCE instruction will be turned into a serializing instruction. There is less performance impact using LFENCE in this way compared to MFENCE. With LFENCE now being a serializing instruction, it can be used in rdtsc_ordered() in place of MFENCE_RDTSC. The other two patches in this series make this change and remove the MFENCE_RDTSC feature. The following patches are included in this series: - Make LFENCE a serializing instruction on AMD - Change over to LFENCE_RDTSC from MFENCE_RDTSC on AMD - Remove the MFENCE_RDTSC feature This patch series is based on tip:x86/pti. --- Tom Lendacky (3): x86/cpu/AMD: Make LFENCE a serializing instruction x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC x86/msr: Remove now unused definition of MFENCE_RDTSC feature arch/x86/include/asm/cpufeatures.h | 2 +- arch/x86/include/asm/msr-index.h | 2 ++ arch/x86/include/asm/msr.h | 3 +-- arch/x86/kernel/cpu/amd.c | 13 +++++++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) -- Tom Lendacky