Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp441456imm; Mon, 2 Jul 2018 14:37:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfdBm6t/RTYCGMfH9YS1cecxr2jeYdfYYugDKdSEcT4VNea1zo4UHbczYFR4suvckSoppOT X-Received: by 2002:a62:b29c:: with SMTP id z28-v6mr22303157pfl.8.1530567426320; Mon, 02 Jul 2018 14:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530567426; cv=none; d=google.com; s=arc-20160816; b=cqemLFsXpamTpTn6iHVxfQ6w3yvnKBWEXSgXonR1sNwOYS3fMCFWeojo5UEntInQDt VSnKqSB6MR8+DtbjLL/GLlibVnmKVTBvGASsidQALnOz3lCh3FkUPS2FejaI4+oAfd/1 2e9hoGoVdYny1C05zPPSe8gPX7h6A9CLtOMS4XE+czHMRU5ugHpO7lqB2WUIMkQGDiHu fLT+V9pvzW0oY8Wg8fkT+lQA29a2lbvzqdiS4SCczaWAVG5sy7+jt0SvMyyMXWM7N7qy BIv9RT3UpsWN8dsvGl40gBYwMpVsW/ToVBPUOeUlNvbZgKV+k+p4amVzjPct26fFmg1e 4+JA== 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=yha16T8LchjUd5Wb6hhGypG7eAcSVBmBnU0kQJcvaps=; b=1J+FpB3evLlKLACyxe/fPb3nlsRwpVPScCRJRgC2vuuZFilxc3qe69ck3BSZUmFIux tYbSaZ+8HMdmT8333XlYGbmxP6uhyCKnH3/qQwgZIZNzXwBFiKPOuq6vG6xCRqjc9jEH HOTBH0GIzxqIWwxb7891AQJfJSVC1eNCJqdx5ZF6P4XRpnrg8VUjuj1ZobMr158PwOaU 38rdpCo9eCVKw1SYtf/uhBBNgjpV9pDuIpvmmZ4ueqtusT/Iyn7f63F07uJH/i++gP0G 5mRTSQgyHnv1tdLtN1xn4w6lGRxWprEiSf0nsSCHs9kZUAW1UWB41xdaf22uvnim0xlB kXag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=GU5Y5oT0; 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 u10-v6si16592369plu.160.2018.07.02.14.36.51; Mon, 02 Jul 2018 14:37:06 -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=GU5Y5oT0; 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 S1753551AbeGBVgC (ORCPT + 99 others); Mon, 2 Jul 2018 17:36:02 -0400 Received: from mail-eopbgr680086.outbound.protection.outlook.com ([40.107.68.86]:38190 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752930AbeGBVf7 (ORCPT ); Mon, 2 Jul 2018 17:35:59 -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=yha16T8LchjUd5Wb6hhGypG7eAcSVBmBnU0kQJcvaps=; b=GU5Y5oT0RSuQB6ReK49BbDLl/q4KoAasn/pUBwFgYc4PnWPWNHP+EuWgwBx5Emy9Lwrw6askV5W08HjTHBgW5rkUUC5BEaPkhIQmBcB+08sJjrxRQ7fsB1xWTFyWC0N/zZJkvI/wKKNmtzlgtiDfLjRD02bCbTjpbD4EdgKiYpc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY1PR12MB0166.namprd12.prod.outlook.com (2a01:111:e400:50f6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.24; Mon, 2 Jul 2018 21:35:56 +0000 From: Tom Lendacky Subject: [PATCH 1/2] x86/bugs: Update when to check for the LS_CFG SSBD mitigation 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:35:53 -0500 Message-ID: <20180702213553.29202.21089.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: SN6PR1501CA0017.namprd15.prod.outlook.com (2603:10b6:805::30) To CY1PR12MB0166.namprd12.prod.outlook.com (2a01:111:e400:50f6::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b958aed0-71fb-4ad7-a1cf-08d5e063cbe2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(5600053)(711020)(2017052603328)(7153060)(7193020);SRVR:CY1PR12MB0166; X-Microsoft-Ex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XF5OPWle+88QsxohZD2zUHt1UjUiaC0aztkGvwuj5Mx/e/e9mpxlyNpOnYh76zesWIf6UjEA/QU9eRxn0yCznMI/FZFDnXFdHjnUUTFgPN5dqNWYTH4yY8f/cMiG9PGp6c6kMA2vnTn6aJeahN87bjWnRNttJWOTV4AbYdN4+9SSGQ7aG1JsbnpkCyJVJoOoSiINv5mCxxN5W0oNgW3VlPsEyosI1WVHEU2IyotIVydSuTDzBzOdJjU5tmyEC0/Ysb6Ou7ZJME4gDMGfXpOirgZvOrUjYZpwn94239VYY2/Kw6vMcyExBX9O6nL0YEpDma1PafqO4ozAmGfPeHMr28wwBL8VkWZddKiHuJCIsfdRbUbjI+2mVY;4:ky1zljgYSijAJiF9Do4X3s1GyA0VU6JksEAK1pdUDVpDP2063RfvUxVp7mrxUCGQH8kwovM+8ECYeC0gTIeQdM+DQ7MQWH/kJS5AimZS7FZgIgehBnbLKir5yOMToYP4dvhSgorvxsQllWC/uPqIWTsHcSgliibX0IwvMTIs0+CoEbDEyDN3PHjLfm7zSsEAmGMQHXgwPGDogzWmywN4WtdMj1BpfojbQzeIYPZUCAyHCel53DdNTJYStlQStRI+Uv4en4YbyMiFF3VS+sFqQP7tG8wtd2yBPFOeMKarWnpIn+Wps/AX6MFJdpIUGc2F 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)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:CY1PR12MB0166;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0166; X-Forefront-PRVS: 07215D0470 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(50466002)(106356001)(105586002)(53936002)(66066001)(230700001)(6116002)(1076002)(3846002)(2906002)(6666003)(97746001)(47776003)(11346002)(446003)(14444005)(25786009)(55016002)(4326008)(53416004)(9686003)(5660300001)(8676002)(81166006)(2486003)(52116002)(72206003)(23676004)(478600001)(7696005)(81156014)(6506007)(186003)(386003)(97736004)(76176011)(26005)(7736002)(8936002)(305945005)(16526019)(86362001)(68736007)(476003)(956004)(486006)(69596002)(58126008)(103116003)(316002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0166;H:tlendack-t1.amdoffice.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwMTY2OzIzOnoyUmNDTktmR0N5LzNHbUxSdU04VExBZ0Uy?= =?utf-8?B?b2ZIQ1ZNanozMWVMSzY4bEh3VHhyVC9TSDFNSXhKdjdGbmFwRG03bWJERE1M?= =?utf-8?B?QzVpMzVFd2V5Qk1CNkxiZ0lySnpLSHJwalFzeHhqOExpVEowQnZOYWpIUWsz?= =?utf-8?B?cEVPb0FVOFZnSndhRWh6ZE9CenlWYlVsK0gyYU9MeW9pbm9TTERKM1RWcnhx?= =?utf-8?B?NU9GNVpyYkpsdXhFYU9DTUJTNDJyVThIdmJVZEplZkw3ZVc0WXBxaUpSUTJv?= =?utf-8?B?Nm11RGVuRnZkMjByMXk3aGlOd2hFczlJc2NYYnUwNnBSQ2R6bXhZa2tpRWVt?= =?utf-8?B?cS9TWnJOaHhwZERUWjV3OWM3QWZybTZBQ1dJRnRHenlkRWJ1QUR4SUpDdG9r?= =?utf-8?B?ejM0RGtQRFkrRVV1WTRyU0NtVDF4MTN6L2pJeDBmaFNraGlYT1QzQTdTRHg0?= =?utf-8?B?bHNuUXJCcFJLQk03V0p3UUN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YDlv7eUs1NkwAvPTXrE7sGMcac9QukSGwkFXe8kjnbT4sQ6qXOVB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2018 21:35:56.4460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b958aed0-71fb-4ad7-a1cf-08d5e063cbe2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0166 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If either the X86_FEATURE_AMD_SSBD or X86_FEATURE_VIRT_SSBD features are present, then there is no need to perform the check for the LS_CFG SSBD mitigation support. Signed-off-by: Tom Lendacky --- arch/x86/kernel/cpu/amd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 082d787..38915fb 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -543,7 +543,9 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) nodes_per_socket = ((value >> 3) & 7) + 1; } - if (c->x86 >= 0x15 && c->x86 <= 0x17) { + if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) && + !boot_cpu_has(X86_FEATURE_VIRT_SSBD) && + c->x86 >= 0x15 && c->x86 <= 0x17) { unsigned int bit; switch (c->x86) {