Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp441660imm; Mon, 2 Jul 2018 14:37:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeSA7BQco996bB2RaNFU8TuyLdHikXO/AvtACz5TYep++YBVdyVBnkzhpGELSph14KEwYgZ X-Received: by 2002:a62:f909:: with SMTP id o9-v6mr2921633pfh.141.1530567442855; Mon, 02 Jul 2018 14:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530567442; cv=none; d=google.com; s=arc-20160816; b=QdIvvBmGhd/TYjPmWjEv9ES94GEdpERxBGJxC98/fZiQEgxA3G4DRnZ9ceKrLHwgFR va35jbJwQRqQhkkZrcJv6nTRAskQAxW7fDCZQZWS3aaVUaNQM6h07v61ECj0RNgdnI6W U3uVQRGlQPR/11s2qrX+Y+VSdZ4URA+Ur8pOwLGSu/jn4TB6L1PdUEz2NlNi99JIweKW mCFbCpr2GBedlFoLjyIrzM4fj/COY0YVxZgOY5h6E8Q5b/sYgdcZUVXtGshtUP2xRhxr BfUl1GzhnVdVqnFMwa55ghBxeSAsgBqXfeRKORFXP5tclp1ZoiYOuniWGlQ/QbDbQzJ4 JP5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:subject :from:dkim-signature:arc-authentication-results; bh=4E5kkq3ujvUcNa4yWjtP3rnowe6bPCxGjsgSabMWwRM=; b=V8QTvzyY+5+p/Mb2DUI7tGshf1TutxZl2IT42I0rTj+GeSfHxtl0SSTUDT22mQKAdM CNoXeJopsKETXB6wSKm8F1MTMtRvPGTOhyMTRIBMcMMCJYTG+K+i6i19lT7fhZ2njvgB 4nXihJ9TUfsOWGZIEKU5VLrZuJvgy9+lXcBbx9DZ1rzPDC9LGtXZJe7t9IsnpXLx8nFs HLIASt3k6SnjPne+Yn9vyiAtOw4Jxi25S9O+Ob2oG4DOK2XZARikiZBmL5nXjEVL1/ee ovs1ROyFynFUp1sc5qbWWcTRMyOLZaTDsyul0bvCHsY9uJt+Kk3sU+8MoSnADTfuaJQQ upcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=z1tDeHVP; 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 s12-v6si14003758pgo.112.2018.07.02.14.37.08; Mon, 02 Jul 2018 14:37:22 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=z1tDeHVP; 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 S1753611AbeGBVgN (ORCPT + 99 others); Mon, 2 Jul 2018 17:36:13 -0400 Received: from mail-eopbgr720061.outbound.protection.outlook.com ([40.107.72.61]:45216 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753573AbeGBVgL (ORCPT ); Mon, 2 Jul 2018 17:36:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4E5kkq3ujvUcNa4yWjtP3rnowe6bPCxGjsgSabMWwRM=; b=z1tDeHVPPhPIIodt3zxXmRO6VIEZhiR0V0GGst7eCWBynPeWjWsqNiD4kTRxosAltwCbshUKrMbBV5qG29hBL4PzaR3mMHE/7IgFPZnylPyEyAMnLsfHgwy9x8Qbgs38gVXfJgpmvKcXTY49cwTyBXXUEB0DHYTM6fBwzQWX9sE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY1PR12MB0165.namprd12.prod.outlook.com (2a01:111:e400:50f6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Mon, 2 Jul 2018 21:36:05 +0000 From: Tom Lendacky Subject: [PATCH 2/2] x86/bugs: Fix the AMD SSBD usage of the SPEC_CTRL MSR To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Konrad Rzeszutek Wilk , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Borislav Petkov , David Woodhouse Date: Mon, 02 Jul 2018 16:36:02 -0500 Message-ID: <20180702213602.29202.33151.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20180702213543.29202.79104.stgit@tlendack-t1.amdoffice.net> References: <20180702213543.29202.79104.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: DM5PR21CA0060.namprd21.prod.outlook.com (2603:10b6:3:129::22) To CY1PR12MB0165.namprd12.prod.outlook.com (2a01:111:e400:50f6::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c1d6b78-c523-47fc-0106-08d5e063d11d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:CY1PR12MB0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pBC7nRVV5irJOXLVHeNhmAZt3WsDndlCTMppMfv8wOAvWsR1h1vQkvPERivfFDFLNc1B0+M5RFcXeryGpVwXQo87pJ3SwRjb98lc4GdTVfTSrfKcw3FAvJhkfVhsLIIMeZOy8PCxs/Xnfo4GSHjDKvWM5tjY0Y4JmEg7bE+E8tQZxphVrmRgPsECN1NrYC0U8wjvrbTJvHtkaLlGV4AltDJyAWRDMNskfRwybZ2lldKHb1V5MuZGFUgv9HNrHSLo5XciM3GkjLuiPcpBafFNAJ01Kc0uftB3dJAJnibFp+EhaIxk1+X1Sii4wWkjBxD8KGEDfDTJiij/audrVEFiq0jbmj9R9Lun7Bf5dpZ0z8//Coie9ZU3DgKKSsO5gj4EZzPIAiKO6;4:yBuBoktynmgnlEd+9uMjsQ/NTo2mCgr2qvwjCPPZkI8rXpRhNEOr1ShuZaS0kBZ0xe3Mr7HC8QElLGTs1WQAPhJw08H01PT/B1IdVxgSqWeBrTi+VpKqH3hE8G1HPXPtI7zsZcq4nRnKjzQSkI4F2i4aCa4Mi3OD6f/WznIEYbQ17FiDr9gbiw9L+F9y1cYutrGI3uSAHQzvGAHKTWPotZjONsQ8uQCFA+gZCmfK+Kb/MCmYhDnL4l3oOFmYDPV0+StmSaYw5fWz8KkrHaydp7TAxphvpzobAYAxwT+q6fWV4c84p9cH52gjEXtUBRN8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); 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)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:CY1PR12MB0165;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0165; X-Forefront-PRVS: 07215D0470 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(366004)(376002)(346002)(396003)(189003)(199004)(1076002)(5660300001)(50466002)(14444005)(6116002)(97746001)(2906002)(68736007)(230700001)(3846002)(316002)(58126008)(54906003)(66066001)(47776003)(97736004)(69596002)(53416004)(105586002)(72206003)(103116003)(4326008)(25786009)(53936002)(106356001)(478600001)(386003)(7736002)(81156014)(81166006)(575784001)(86362001)(305945005)(6666003)(23676004)(486006)(8676002)(55016002)(26005)(956004)(2486003)(6506007)(446003)(186003)(9686003)(76176011)(52116002)(7696005)(11346002)(476003)(8936002)(16526019)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0165;H:tlendack-t1.amdoffice.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwMTY1OzIzOnRWYkN1cHVPdmJFdDNHYXlZTjBSOVVtS1Nt?= =?utf-8?B?RnZwQ0MrUXRHVlFoNXArZW94YklQdm5Zb0hQa2FlOXY2emhLdmlsM21TbklM?= =?utf-8?B?djkwMVJLcGh0eFVPcEFjOXZTTitNWHRQamR0bVRVL3dqamk5SmxRTXdjcmRH?= =?utf-8?B?eG5kdFk0UnBBamsrNFpmc1lrQm8xYkN5Tmw5d3oxZUNaeE1MOW1qQXpRbVlo?= =?utf-8?B?T0tmTEFocGlFMVNaMjRLSGVsbVY3SUE2SDdRSFZJZFQ5bUQrSURwZWQrVjh4?= =?utf-8?B?ZVRxK2lVdGRNbFlDZ0IwWEhpMGVjVmVTNVE1OE1UaUE0VnpIQWJMNXUyZWJB?= =?utf-8?B?RUJ2U0hFQUpRd3J6cVlkUTB2OUFlemQyY1cyTEU5aGZTMFk3NWpzTkZEK3VP?= =?utf-8?B?UVNzVTJzcWR4cnJOekxWZUxaN2QxUW9keGI1VkhWZFAraXJ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tweMdfJui7+PVsVDrpV/PPRLog3FK1B8dIVjVOcbrWWJ6yVD8G+o4bPk0vm9ZcSE9JfOPuT1Z86khRWoQ1xdfLrKkX8b6dEXkillQ11YKZ7bb3fEYABD9DFMJr0M85cus6HRk4vyDBGk44QJUl8nAdIeFgAgkxBo4kdKgCUw6NRJFN58P1BZmq X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2018 21:36:05.2712 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c1d6b78-c523-47fc-0106-08d5e063d11d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0165 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On AMD, the presence of the MSR_SPEC_CTRL feature does not imply that the SSBD mitigation support should use the SPEC_CTRL MSR. Other features could have caused the MSR_SPEC_CTRL feature to be set, while a different SSBD mitigation option is in place. Update the SSBD support to check for the actual SSBD features that will use the SPEC_CTRL MSR. Fixes: 6ac2f49edb1e ("x86/bugs: Add AMD's SPEC_CTRL MSR usage") Signed-off-by: Tom Lendacky --- arch/x86/kernel/cpu/bugs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 404df26..5c0ea39 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -155,7 +155,8 @@ enum spectre_v2_mitigation_cmd { guestval |= guest_spec_ctrl & x86_spec_ctrl_mask; /* SSBD controlled in MSR_SPEC_CTRL */ - if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD)) + if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) || + static_cpu_has(X86_FEATURE_AMD_SSBD)) hostval |= ssbd_tif_to_spec_ctrl(ti->flags); if (hostval != guestval) { @@ -533,9 +534,10 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD may * use a completely different MSR and bit dependent on family. */ - if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) + if (!static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) && + !static_cpu_has(X86_FEATURE_AMD_SSBD)) { x86_amd_ssb_disable(); - else { + } else { x86_spec_ctrl_base |= SPEC_CTRL_SSBD; x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);