Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp96621imm; Mon, 4 Jun 2018 13:44:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLtdglg/vABav5Q7FulA94bq+sqlsMO60WnanEUUXUjKqTH2TOTkijrUG4M8tEGJD3T35p7 X-Received: by 2002:a63:5fc1:: with SMTP id t184-v6mr18530940pgb.132.1528145059583; Mon, 04 Jun 2018 13:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528145059; cv=none; d=google.com; s=arc-20160816; b=Z57ZzVeRd66YfFR8WEuQ2AFESQXUfd3LDBateD6Z9TWD2L9NCcdrYZB7TvMxt95E5k 8kVhVlkhucwv5v/h2mwrcBeLr7xM4/Qcrpg7VM9KbL23n/owD22FrohQhnexuhHI3cYG +ubNvMFv5o5wqPARw7TlWi89enrnhNbMJqYHoSQoe4Wv08hMIQ1mAR1gzD+58y4PezSj qsuXT7xzpOzNRcVi04v6FsqVyyau5Ve7LqRm+shrOh5rF60LOkoxwyDJJNEQtm/BM00k svKKsAEMu2zrqkCo79oDtqpaXLHEABGN9dGVwn6DYcuN1LdbvM9pnLT/qoKiNitZi/QY VVUQ== 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=yfdQwdZfwOJwqfOi/5f4pBe845ECJhtFO4ANBKfmxXQ=; b=RoVNyLL/0QV63voG8Fd/u1xSABxz8A/m4VzZADbDKpxgdpDT20x+dI8auFoxauISo+ Ivt6D6AGwK2EMvM/44Fx71kEHliquqLCkLkdU7chTq0nRfHYw1Ojrw2Wwc9YuxkK+oat 0WHp0r8w5gCeMXdQbk5xRreJudoRuywQuFrc150oFG+RkO1XFcqdwKdceOMhDFxEMdGH eVpTFU48a4elPDgiUBQfku8Pq2iVIpclRrI297gDOdD0ljG7U4gxvaQYy5odXflUyL24 GAj4QAbYwwDOL1SaEwF0r635nZXrj4ZLIOt0Z7zH3SMQc7iE74s5+165zEyPKYB4y6Qo n00w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=gfrm2a6o; 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 z4-v6si25177334pfl.31.2018.06.04.13.44.05; Mon, 04 Jun 2018 13:44:19 -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=gfrm2a6o; 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 S1751634AbeFDUn3 (ORCPT + 99 others); Mon, 4 Jun 2018 16:43:29 -0400 Received: from mail-cys01nam02on0085.outbound.protection.outlook.com ([104.47.37.85]:40333 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750950AbeFDUn0 (ORCPT ); Mon, 4 Jun 2018 16:43:26 -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=yfdQwdZfwOJwqfOi/5f4pBe845ECJhtFO4ANBKfmxXQ=; b=gfrm2a6oZ0KGkzr1VWdqyKaHE9Ok4xeDXSheNHWTpd/PbYdBCF0EghVnupnuRrqBBq8r0vrqO0jNauKOHLOi8sQYAUdsI9iHzdMoId0mPl3ISeW9IcgouMapHJOdf3BL9A2/JIeMOlkNthJLzdU3BZ8kbBPdrgTRz5d64XEjTJE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.64.67] (165.204.78.1) by DM2PR12MB0169.namprd12.prod.outlook.com (2a01:111:e400:50ce::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Mon, 4 Jun 2018 20:43:21 +0000 Subject: Re: [PATCH v1 2/3] x86/bugs: Add AMD's SPEC_CTRL MSR usage To: Konrad Rzeszutek Wilk Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, andrew.cooper3@citrix.com, Ingo Molnar , "H. Peter Anvin" , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Joerg Roedel , Borislav Petkov , David Woodhouse , Janakarajan Natarajan , Kees Cook , KarimAllah Ahmed , Andy Lutomirski References: <20180601145921.9500-1-konrad.wilk@oracle.com> <20180601145921.9500-3-konrad.wilk@oracle.com> <20180604202024.GF5867@char.us.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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83NTqhxBZu mlAuPCfFpyH4IEEEB0j+9WEZnzl9cBLzw3rVv9bEIixe5ykSmG8UHJ6FJ6cI2myru6uwzbOu n8DkNLspmZppoTpwzPCY/6iljBLUBzDDRD8rzEavva2IhzINkrAvNSW6VpBMSpUBgsEIKxrp AFS1ax5uXmwYGyFzOWy034Zz5fWi260qiFplzKCij8t7sCgzOXwEbIt76L1basrRMY7urJm8 4VM6MeG2mfa92FfrMeL0pnD5ONg1FIuleGlvvKdQdFnE4AlwGcKid5GUD+vNNj/pbZyUpe4r zBFsc21/8jXSlR6zJS4mgkNDIIBGiPny3tvKINMZ8VK00mR6INpd+NErd2LxwZ/DQ5ejVyVL 080CbiD55mxxhqkbd5fHSfdhvvXIIYN+nM/RFLwaQGW9g62iFWlqeNRXezkERDV5ahFqZMP4 YDdodn0nRVZYu2kaXfOclKPcH58HlrRb8pKTE3t/TNKGY3SmKoznH0QtM27TWeZ9R9RgTYiV zSNqP+QUNp6BotWI Message-ID: <2f325eea-5ffc-70f5-43d8-59ceef73d04d@amd.com> Date: Mon, 4 Jun 2018 15:43:17 -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: <20180604202024.GF5867@char.us.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: SN4PR0501CA0071.namprd05.prod.outlook.com (2603:10b6:803:41::48) To DM2PR12MB0169.namprd12.prod.outlook.com (2a01:111:e400:50ce::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM2PR12MB0169; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0169;3:8ZHziyCqzO35Eq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P3v6rQ0xBDpNyOAA0ZFGzCGQMgbpmDBq8C1jlPxFsCfq7n8GDrCH747RMsbLCvMgtUx1tQhI/rjDHDHiWM2e7d+vfdbDXyMfpYMCC3H61YJ0O9ARlllK0DLrDkcx4s6LKFTHSBzopQBJ+ejlx0mzXyDGQrktOckSzJoa6NwK+rt0hYiocJY3wDmLu95QQi+t9/I/pyAtVGwSiz3AuyS0KZgSXUuT/4HWnBLTjPNruIk1iPilzGvf75brnmGRJzPFjfm5lIxQhw2HJAdCLvvPjpUKl8Teodb86Jg3tplHAwBOktns6hZkQwA+ue4LVltvHzFxGVCBybelDq836JtYAR;4:lnpKdROyPwSrruKJzjOfmSvAC9r49mHwZnYD3kce9xbvuBHp9EtJxh6ui/bkWnv1f5kRXGiqJhBmPH45B01nId/Up0YAIzqN8zgGZUgRbzlWjwuyg1T5XWtZVzYYfM1L/RAqK1d37Dqtjim2XxXxNjPYBAi4kf3EH5bMysKNyBaXwNg1m2HeJ4qPyC2mKVUVALEq6LVOvS3YqVest4lbzkIvczYBnGgx/73Q+njeQEgG7/FKJ0SXj0PvYeRCXN3g5g2HAdQUNgEBBwl81G0f9g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM2PR12MB0169;BCL:0;PCL:0;RULEID:;SRVR:DM2PR12MB0169; X-Forefront-PRVS: 069373DFB6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(396003)(366004)(376002)(346002)(39860400002)(39380400002)(189003)(199004)(2486003)(6916009)(316002)(65806001)(23676004)(65956001)(66066001)(7736002)(81156014)(16576012)(305945005)(93886005)(31686004)(58126008)(105586002)(52146003)(68736007)(3846002)(77096007)(386003)(11346002)(106356001)(52116002)(76176011)(186003)(53546011)(47776003)(54906003)(230700001)(26005)(50466002)(956004)(6666003)(86362001)(6486002)(36756003)(97736004)(8676002)(31696002)(65826007)(229853002)(7416002)(2906002)(8936002)(53936002)(6246003)(25786009)(81166006)(5660300001)(446003)(486006)(8666007)(6116002)(476003)(4326008)(64126003)(16526019)(3260700006)(72206003)(2616005)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR12MB0169;H:[10.236.64.67];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?MTtETTJQUjEyTUIwMTY5OzIzOmdUWm5UTERldkdpUFdVbGNaVEpFZFVtL3Q2?= =?utf-8?B?MlNXcUlCSFRidTdkLyt6Q3BHQWdHTk51TGs5cTV5dFZSeElTdFQzRzFWQ3dw?= =?utf-8?B?ZjRqdjk1aTNFUTBZZXV4bXVVdFR0ZGpOQnArWGZTeG51YXVYNDltWlVGSDJD?= =?utf-8?B?bk1DQzB0QTlJdTdROE9iazdOMWUzenRJMDVZODkrM1hmUjNpWWl2SnhyckZR?= =?utf-8?B?eGw4RzA2ekI4Rmo3a0srWVFaazBaL3hqKzA3Nml1dWxTUTlUNmJBZVdVaWJF?= =?utf-8?B?ZERXM3l0NndNdjZPNXI3UkxLTVpBVUJyaHJvUHl6MzBvWDU2YmlJNDJ2QTZo?= =?utf-8?B?ZHZhWkQyQksrNjlnaWZDakhCWFJCNFZxMkp5K0RkR3l5b2RNVEtuaVJGUkI5?= =?utf-8?B?cHdZSzNZd2drSHhQSGd3Q0RyQ1cwUm1oRFlHQXFCVEFzODVSejNGdURNZHli?= =?utf-8?B?UHVyQ3Vxd25Oc1RnZSt1SHdYT1UrQVU0L25CSHA0bkZ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pNyNBH+cmvvlyXl16mB2O0MR6ToYu6txbp1FwN2lhxQ7xJt3GrZo5GV06qOgNpQrjDm6GAeyidB71225yBYaPD86S0YaUbWPfJjqJbDAdGMCvW7pLSomTMoSMTl006ItxdS9u9bVKL+8JIJCAxbW59tiAjQn5/KpOgzTPBJA244iCl9/2iv+w3hwcvat9DDe3pJMYIffnLEtAtZVU0OCQ7tnOfVR5wcI80f+g+T5AvX6hAu48XqPy X-MS-Office365-Filtering-Correlation-Id: 18cd2d5b-c5ab-482b-770c-08d5ca5bd029 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2018 20:43:21.7099 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18cd2d5b-c5ab-482b-770c-08d5ca5bd029 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0169 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/4/2018 3:20 PM, Konrad Rzeszutek Wilk wrote: >>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c >>> index 26110c202b19..950ec50f77c3 100644 >>> --- a/arch/x86/kvm/svm.c >>> +++ b/arch/x86/kvm/svm.c >>> @@ -4115,7 +4115,8 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) >>> break; >>> case MSR_IA32_SPEC_CTRL: >>> if (!msr_info->host_initiated && >>> - !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS)) >>> + !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS) && >>> + !guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD)) >> >> Shouldn't the IBRS/SSBD check be an "or" check? I don't think it's >> necessarily true that IBRS and SSBD have to both be set. Maybe something >> like: >> >> if (!msr_info->host_initiated && >> !(guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS) || >> guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD)) >> >> Does that make sense? > > The '!' on each of the CPUID and '&&' make this the same. See: Doh! Yes, I don't know what I was thinking. Just the end of a long week I guess. > > > AMD_IBRS set | AMD_SSBD set | !AMD_IBRS && !AMD_SSBD | !(AMD_IBRS || AMD_SSBD) > 0 | 0 | 1 && 1 -> return 1 | !(0) -> 1 -> return 1 > 1 | 0 | 0 && 1, continue | !(1 || 0) -> continue > 1 | 1 | 0 && 0, continue | !(1 || 1) -> continue > 0 | 1 | 1 && 0, continue | !(0 || 1) -> continue > > Meaning we will return 1 if: > the host has not initiator it or, > the guest CPUID does not have AMD_IBRS flag or, > the guest CPUID does not have AMD SSBD flag > > I am fine modifying it the way you had in mind, but in the past the logic > was to use ! and &&, hence stuck to that. No reason to change, it's fine the way you have it. Thanks, Tom >> >>> return 1; >>> >>> msr_info->data = svm->spec_ctrl; >>> @@ -4217,11 +4218,12 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) >>> break; >>> case MSR_IA32_SPEC_CTRL: >>> if (!msr->host_initiated && >>> - !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS)) >>> + !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS) && >>> + !guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD)) >> >> Same question as above. >> >> Thanks, >> Tom >> >>> return 1; >>> >>> /* The STIBP bit doesn't fault even if it's not advertised */ >>> - if (data & ~(SPEC_CTRL_IBRS | SPEC_CTRL_STIBP)) >>> + if (data & ~(SPEC_CTRL_IBRS | SPEC_CTRL_STIBP | SPEC_CTRL_SSBD)) >>> return 1; >>> >>> svm->spec_ctrl = data; >>>