Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1344140imm; Fri, 8 Jun 2018 14:31:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKcUzXsgn+EE72zpx94RzDnkZnA4ISSQzXeJLynumN6KqcpMhuO8fMeYZaf5ek+dL7Vpnvw X-Received: by 2002:a62:d453:: with SMTP id u19-v6mr7623082pfl.203.1528493469122; Fri, 08 Jun 2018 14:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528493469; cv=none; d=google.com; s=arc-20160816; b=pNSt5Auy3A5wJlHC0feyCqQPgZ8j4tQd3W7eAv/9sU7suwvfjK7krJDi3wP41tM16c B1oviScv3kKyq95VR8MU7o7WgqIH8MSzO+JLnKlsrc+zavDNrFybj0C7qACOoPBOCoJc s/g9k6paquJ9b0PJ/sBGg0eyGdexosSMpiRp4C8muc93nWmBYZP1XTQBK6WzHP4NWILZ HkAWJ5DE5dPs1+oSOBlM8hsNDBhiNCI7GIm2Vme8wjb/h3keI2M9mk5hG3/1EO6BYTAZ APXogmkU23iqCNERFih7Neni9ZYJjF/xkt+3AAlay23E0gJrpEquEuzwtHdAB016LhTA 7sfg== 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:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=4koR7Ym6vV21GSnVBRI/k6Zj9aML9Bk0Xy6pl6tnl0Q=; b=BijuR7dNJEWqtLFTeGxnZVueafKkCS8ZcNbnP9K/zmT57JvB9CoRJrtpp+5RGIOMih JHpA1sdmT/L0X1Gbuo2wLVuFSuOYA33IjfFeVfkcQeMrhBXlXgpeUmLnIFcljJoDoelj SXSVvtRphhCNvGHZiN3sgJPX2hSnas6+hUk0x6izgju7QXWr2NcZGmueoAuchahLU7SV IZulJmyZiEAfQbnIOQN/0zXKolQctH4QwLwoR8p+QJoGjYyPKkfnpoZfNIOAb3/kkX3w bSsz8pFhTe/YACgZJTip/MH5RaPiKryWezyzHdbz9YGcAk985dkLAbpZz3cUToGMdoiM sA0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=eZHtl5Fh; 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 y23-v6si5631540pfk.75.2018.06.08.14.30.54; Fri, 08 Jun 2018 14:31:09 -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=eZHtl5Fh; 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 S1752990AbeFHVaZ (ORCPT + 99 others); Fri, 8 Jun 2018 17:30:25 -0400 Received: from mail-eopbgr700075.outbound.protection.outlook.com ([40.107.70.75]:18704 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752863AbeFHVaX (ORCPT ); Fri, 8 Jun 2018 17:30:23 -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=4koR7Ym6vV21GSnVBRI/k6Zj9aML9Bk0Xy6pl6tnl0Q=; b=eZHtl5Fh+pIenw/vIL1bgD7XW0e1mMH1oxpj9poTyO7s5sHcYvA/h9Am08jBW2j6q9y0anM17pu0s2Hil8BGmI39ioGSrpgyIWxMbJRyi/lLwOWsWq9iFMY4zB408J+QuapSYGLFfItUD6Yei9VlcdSIGz7FbeujzaLoWnnRF74= Received: from [10.236.64.67] (165.204.78.1) by DM2PR12MB0170.namprd12.prod.outlook.com (2a01:111:e400:50ce::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.15; Fri, 8 Jun 2018 21:30:19 +0000 Subject: Re: [PATCH v1 3/3] x86/bugs: Switch the selection of mitigation from CPU vendor to CPU features To: Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, andrew.cooper3@citrix.com Cc: Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , David Woodhouse , Kees Cook , KarimAllah Ahmed References: <20180601145921.9500-1-konrad.wilk@oracle.com> <20180601145921.9500-4-konrad.wilk@oracle.com> From: Tom Lendacky Openpgp: preference=signencrypt Autocrypt: addr=thomas.lendacky@amd.com; prefer-encrypt=mutual; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH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IKxrp AFS1ax5uXmwYGyFzOWy034Zz5fWi260qiFplzKCij8t7sCgzOXwEbIt76L1basrRMY7urJm8 4VM6MeG2mfa92FfrMeL0pnD5ONg1FIuleGlvvKdQdFnE4AlwGcKid5GUD+vNNj/pbZyUpe4r zBFsc21/8jXSlR6zJS4mgkNDIIBGiPny3tvKINMZ8VK00mR6INpd+NErd2LxwZ/DQ5ejVyVL 080CbiD55mxxhqkbd5fHSfdhvvXIIYN+nM/RFLwaQGW9g62iFWlqeNRXezkERDV5ahFqZMP4 YDdodn0nRVZYu2kaXfOclKPcH58HlrRb8pKTE3t/TNKGY3SmKoznH0QtM27TWeZ9R9RgTYiV zSNqP+QUNp6BotWI Message-ID: <2a3e0323-7086-f764-1a3b-7ce4891e8784@amd.com> Date: Fri, 8 Jun 2018 16:30:15 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180601145921.9500-4-konrad.wilk@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0401CA0030.namprd04.prod.outlook.com (2603:10b6:803:2a::16) To DM2PR12MB0170.namprd12.prod.outlook.com (2a01:111:e400:50ce::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM2PR12MB0170; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0170;3:VyXrjrTZkmDxA8DE0I5EBGHztZlO2nYt3531KUnAJdbhGbuyhTPTd6MgOJ6qJSESGfK6MNUB81K6Agdx0tL1OX1nr2d6hjAYFrDdE5KUANf6sQkG03jAsYcW7ybX67cBhH1OT+5Ff19Wvwoqb/+8bnOxtpoxTYZyn9mguJulRXp1HbFXawxZGW7yjGlAsdoymDQhdneiQAY5XCACfqZfTeE+rO+21+At+8258jhh4Yc0V58CqnWLi5ooBBuK5BAt;25:BFZ/TClFAy1v51QZf6HZa1fwclNlNW1B1wsNtPYpF8cfrM9Ov75SSKyBEnc+cHVkmDiqM/4UhKHWACzY+QPEw52JmzhIgnMDZBy1KzgVq6JAyHH93zJp4iypV/Buf2Cjzd/PhPgPpZXvSH1+OF66DvBpP0thbchhEK9b7GaNQnPl8a9jAk2jG8FAwq8cXYu11S/4N135fEEDY0/Xtqvo2pfsDzFy9SC5U4h8YQYlkC0cAc7G6hMrz6xBG1sCYPVohbcMJd5Gv01Jr1FGLMJFWsxB3A1hFlBlEXr90ZdjrXWjaAOLSRDglkBEU3lGG55rHZNdCuO9q/bxaIzvJZ7Keg==;31:vtxezm7b/TQNtaL3I0rIv2yRWXjpZVq3Tv0TXyshi3WYlZZR5s1C7C+04nHbZAy45C6pJ8NcLwP/iJ0Bvab7D78TLICG+lKGKvtP1K+smas4Int1fF9I7ErnMrHH0Mkh7OCvo/qTGdrxXfUKhcenN3QadsZQ97PgaVluQA7iHWplDlIej79eQjWd7XMq2IA41Os+KaSLzpodboiOBQnv8royGDg92uqGLp6D82nsf0g= X-MS-TrafficTypeDiagnostic: DM2PR12MB0170: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0170;20:hMtS82yWX/ix0frU8AOt0Ks7aqWs9w0F0orY9ppeB8KpuO+01DhdBZYlOpWGd3Virh1yPVjRZH6ZCav9bhTJIGZmZmcrf/tZdYk6Lgj6EOni9O2rNv6/8SbrCpH8DNAdBeNZRBuudX/z2mrzY3PFRGRTe8aXbryZugF65L6c9Tt4cogrD5dxs4OIpzGmRWawbxz32KYYtdzSKqzMfqZnJQvnlTJnQ2uHGbqWjwfT7LBzcrtus2eg+FdmJaQLK592k5BpjhvYF4vP6xjczCaD7/rrqN5hr6aY97Vlqh/0jfxSFQcA/245T7qRNCF6qPbTC3BFeCFAsjOleBdPSWE4YQFgpFXML89cFVPjvdmwlhhBp416W7fzxSp5BMz/E/3/gxt8CLbUJEMQpEe3kWMmpZdOqEuRN2YNoHL7UExY1g0GV0xELSasYbdwaD7v3htdvUivqlWzpbOAqjC8rYNFkHIXbwAfNMMlPUYH/bm1RiVrfJWjYW/5nmnyoPm9JKDN;4:fXk07yN+rUryQhlWM/FTx+zMg00jGJn0gREKcGFE4JGQ3nCweA3P7L9WpyGttrXkcBgab2e6iZzxnZKO+748hW2R5PelUrZfd5YW4apONljcAjh0UjpCufHRgC0shTelVIG+EmJvJsoubM4aaFUlD0gyKJVvxA/pNDlUcKbz5R4240LIwGGnS2/ygP4sPp99v+ah6pOX+Hvwr6m87GH7rWoH7WDd5PEWofpwn9SqX0iXuwW4JhxLkElJr+QAkAYVbRfj+U3xBnx5SQsh/Pi0opbU5XkKy7vZ4N8lJpdnpsz6fHac4QbZymEXadnrhGCJo9MwqJ4kZjoCuobTs137fjoKYiUGPftqpQyLthABJ7U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(146755900322472)(146099531331640); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:DM2PR12MB0170;BCL:0;PCL:0;RULEID:;SRVR:DM2PR12MB0170; X-Forefront-PRVS: 06973FFAD3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(396003)(39380400002)(39860400002)(346002)(376002)(366004)(199004)(189003)(81156014)(50466002)(230700001)(81166006)(476003)(8676002)(76176011)(6486002)(31686004)(7736002)(386003)(23676004)(2486003)(31696002)(52146003)(53546011)(52116002)(486006)(54906003)(106356001)(66066001)(2906002)(305945005)(229853002)(4326008)(8936002)(575784001)(65806001)(65956001)(956004)(65826007)(8666007)(5660300001)(68736007)(3846002)(6666003)(72206003)(6116002)(64126003)(7416002)(47776003)(58126008)(97736004)(2616005)(186003)(446003)(16526019)(11346002)(36756003)(77096007)(316002)(6246003)(26005)(478600001)(53936002)(105586002)(3260700006)(25786009)(86362001)(16576012);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR12MB0170;H:[10.236.64.67];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?MTtETTJQUjEyTUIwMTcwOzIzOndJTGw0MjFFcEFMN3FPMU9TdXVnUUErQXI2?= =?utf-8?B?M0l2WlJaeEZGd0FiWHhlUHBkc3VBZittSkNBRGkvaGlPUUUxSXRYbW94TzE5?= =?utf-8?B?Zk10ZjVQYXhuTkVaL0Y2SW9HeUdyaVhOZmc1VlY2TWV5a25OUkxEcGk0THpF?= =?utf-8?B?aWMwS0V6bTBNVlFPNSsrb1B2NjVzdTQ4OGpweFZRUEFIdXV5T2lFR3VtWkV3?= =?utf-8?B?Q1l4am9ra1NWajhvS3dSQi81WHFjL3V1M0tHcFpsc1ZtR0ZndjI4bEJvVU9B?= =?utf-8?B?NTdGb2FaSlprYTJzTklpYW1adG5JVjd3ZFgxb3pQYXYzZmRqdWZPTlVtY0I5?= =?utf-8?B?UE1nR1c3OGNqOCtzYXFkYjlvckdJKzJ1RmdpMjAvTzZ2ZnkxUVFzNmloMUFH?= =?utf-8?B?ZUttdTR1MGtvZUg0Q1E1RXdGdHRyN3FaNXhIL0NmblNIL20zWHBUbXB3SHFI?= =?utf-8?B?b1VrUnhDWHVVcGxtM2JueEJUZENlVFZYeGpyNWlBcXZJbXVvVjZTMERkMDI0?= =?ut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+lCBHXVmPVp6Th8gPA/csujaRQPbmK6wUO7/5qLqeyGzo4RC/8YoKJTbizNv4dypvPGCyT2+cbaR+LyG/BQqnMrUzTw9VJf6Rw6/XZ0IrFqS0EFiC/EOGCV+WXdM7s+VOT/SJq/nvj2hmu8uvM/vBwrorQ29L/ySuB6zyHjsQv/h10+yjm4BtpfGjT6QtvZf6XGub6pJQhsmsFd X-MS-Office365-Filtering-Correlation-Id: eb4b1832-079d-43b7-c48c-08d5cd87091c X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 21:30:19.2296 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb4b1832-079d-43b7-c48c-08d5cd87091c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0170 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/1/2018 9:59 AM, Konrad Rzeszutek Wilk wrote: > Both AMD and Intel can have SPEC CTRL MSR for SSBD. > > However AMD also has two more other ways of doing it - which > are !SPEC_CTRL MSR ways. > > Signed-off-by: Konrad Rzeszutek Wilk > > --- > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Konrad Rzeszutek Wilk > Cc: Borislav Petkov > Cc: David Woodhouse > Cc: Kees Cook > Cc: KarimAllah Ahmed > --- > arch/x86/kernel/cpu/bugs.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c > index 6bea81855cdd..cd0fda1fff6d 100644 > --- a/arch/x86/kernel/cpu/bugs.c > +++ b/arch/x86/kernel/cpu/bugs.c > @@ -532,17 +532,12 @@ 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. > */ > - switch (boot_cpu_data.x86_vendor) { > - case X86_VENDOR_INTEL: > - case X86_VENDOR_AMD: > - if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) { > - x86_amd_ssb_disable(); > - break; > - } > + if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) > + x86_amd_ssb_disable(); > + else { As I think about this more, I don't think we can do this for AMD. The X86_FEATURE_SSBD could be true because of the LS_CFG support and not the AMD_SSBD CPUID bit. But if the IBRS CPUID bit was set, we would now try to use the SPEC_CTRL register for SSBD, which is not valid. I think you will have to keep the case statements and explicitly check for X86_FEATURE_AMD_SSBD before using SPEC_CTRL. Thanks, Tom > x86_spec_ctrl_base |= SPEC_CTRL_SSBD; > x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; > wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); > - break; > } > } > >