Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3553223pxb; Mon, 9 Nov 2020 14:28:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGV1VWYWmq6pcha/4EZF8Egsf3oU55hccvVeWgwZB5jdSb+qTIsLPu6K8mLXCvGYDvoaW0 X-Received: by 2002:a50:d5dd:: with SMTP id g29mr17664325edj.344.1604960920271; Mon, 09 Nov 2020 14:28:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1604960920; cv=pass; d=google.com; s=arc-20160816; b=0x8wxVh/QjRBcGkI75y6ymTAI4PbpNK4KEG6kTnsmxSgDS+Fg8/5YzdmbH6h3nNb5H iolXG0533BhohQMAoxzcG9cZKKvbYN9+Rx/uyrwuzQsOshTovkxhjB2ty0dkg5Ou3vJZ h5DY0tIPGaP/YyaGwMIQ+/6Oc8tJc2UVrqoLwM9CWIsVZZ9hORv+ovfMFGwZyi3T08Sq zUhFGuI8Zy537PrZ51X1lD6ktSScPXHBQlIl7KQFFX8Wa11m6ea6rlLCSkMnhgYPkSch v5BJiz8x4uIYRnWhboIZuoNy+koxrvvvBCA4pcEx14Ug+nDLQDK69rP0TKWm2De78qu+ FNmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dezrM75SgkRzYWh4Ln72KARkco3Iwy+sJTmsje+sres=; b=FLlbNkciHJdnfFUYoU70XTpvqhPW3eRXuVDKg3cUGgUhBcFZzToeM8PItljDwMVOYj fG2ggl96INU1q7sZ2YAmKpC5LSpY0JkMKKE3I/mLER1KzwnpvmYw0c9VCECBaJEa7Q/p Z2HyvaoF0u1hmzJD4d+9E1BnYn+zb/QX7thjMYm9OH/KUZWiNtp4ROA22ovGSeiQNFjW q1DlYiCmtq47s/l3zXt6IsJ2IZEXc8sobis0aAQQzbaOTDKqz4hpg69H7PcPwGnqhfJP QrEp3iib1m5Vn86Fc8KKWwC+uz4KYjMzhU+kJo84AtK1nHh0h5eV3KBVtJJ+SE9nWGn8 z/Wg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=aN5SdRvM; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr12si2107554ejc.562.2020.11.09.14.28.17; Mon, 09 Nov 2020 14:28:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=aN5SdRvM; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731521AbgKIW0f (ORCPT + 99 others); Mon, 9 Nov 2020 17:26:35 -0500 Received: from mail-bn8nam12on2047.outbound.protection.outlook.com ([40.107.237.47]:23872 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731181AbgKIW0e (ORCPT ); Mon, 9 Nov 2020 17:26:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KfDivebfbuVDg6dFX3wEH9/btDYvxgcWFpTvB3QZAp5c5079zjdD4sW3MPZFTzXbnddiCPaaxo3ZcxxTBeAc6xPOobgBixW9fOZzg2xtlx+nWNtAMVyig0+KUSCW4C0KLXnrXYnaTU+y6Vq7cOpjtdVa1YwHnQF+5TVc/lgMDQivxviIn8L6IhhOaB7c7XcfsSZVhxccaR0D2UZLEbs8QHXYR6eehIEoDLIgAJ6UKjH5abUmNfJeTK9ti62zALo4JRkRdNjuw+VV8LjEmPx9hKq0AZq183EIKx0CpmTvc5kV5SHm/pEwM0llxtxMHoS2RI/awqGDkJyegJnVsdgNKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dezrM75SgkRzYWh4Ln72KARkco3Iwy+sJTmsje+sres=; b=j2kOuY6wZX4JIGE/fxahJX96a3MfajNRiL1KggcVXe+cPng96rrdfRugVa/M9LjONrS/QSTbbTGHWGNiAmGbiaYlqABikrauc6NMiN8h0m68M50hHjbVZ5o0g9jmlf3ODv8vmZAzeEOBRKoSRloNEKmnbLhxClucXACcU9+iX7sUmOpXzX6uc0N3mHzTfh8CA1xR2zUTcYvTpatsN+56QJFZUv8Vi+m4+oMfTqfx3b4MuMhTOSsp6SO9xhwkQ+ywL5j1LBJhiMfPVOonOEN0bAOcscEO/bf33Mr4INhW/pcPuiZHjhAwvZJ4GXVzMNxG0/VZlm8BAdkc9r1/trnM5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dezrM75SgkRzYWh4Ln72KARkco3Iwy+sJTmsje+sres=; b=aN5SdRvMhG8wVsjDK5x+BQgnCR90F3yepEjXbrJA045x9y7Leh24w++qybKMpwX/Qnb5ADu3PZDAE51qKqVVW9d22BdHv4K+y1kr72OJ24CMJPAwalycbt8aiCb/TPb4acKdxb70JXqaP/RGB1l9aXy+a98tDTATmkYOx5qmOP4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB4058.namprd12.prod.outlook.com (2603:10b6:5:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21; Mon, 9 Nov 2020 22:26:31 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba%6]) with mapi id 15.20.3499.032; Mon, 9 Nov 2020 22:26:31 +0000 From: Tom Lendacky To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org Cc: Paolo Bonzini , Jim Mattson , Joerg Roedel , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Borislav Petkov , Ingo Molnar , Thomas Gleixner , Brijesh Singh Subject: [PATCH v3 02/34] KVM: SVM: Remove the call to sev_platform_status() during setup Date: Mon, 9 Nov 2020 16:25:28 -0600 Message-Id: <1b420ccfe763099dee756e935ce3909cee11d141.1604960760.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR12CA0113.namprd12.prod.outlook.com (2603:10b6:802:21::48) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by SN1PR12CA0113.namprd12.prod.outlook.com (2603:10b6:802:21::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Mon, 9 Nov 2020 22:26:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 79f9d326-8876-43ec-8b45-08d884fe822c X-MS-TrafficTypeDiagnostic: DM6PR12MB4058: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ELstBj5BK0wHuefz1jGCejFP8BiythMpU39LKVnidxkWzhpUTen49qRLS9DBSxSrEjKmrPPAOTbSZAiRmsI7xHLsv8PPKNANP9G9SAJw2dfg93eTvRQwu8Dc89QmfioF2M2vmlZOjFiJOR4T5ay0s9f3/vE6FVzqDeBNqMEtO0cGwGj5MiwPDr8o5VA4XyhoHMtZwHPhNqmlX0UPOzdtC5RIvWsnBRmnAHndO2gvguqe96W7fLTbrKs9RSfKUEG0gHxzwPgC8ykW5S4p62qZ28mcqX6R78DVv2NzniZaTywMXCpQ+ACA33dlM850mooYuGk6bobX9nfnOnZ5r7gQOw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(396003)(136003)(39860400002)(366004)(2616005)(956004)(8676002)(16526019)(54906003)(316002)(86362001)(4326008)(26005)(8936002)(7416002)(36756003)(5660300002)(52116002)(7696005)(66556008)(66476007)(66946007)(6486002)(478600001)(83380400001)(2906002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ISmsFScE87uw/NN1Yx51eMGCmtRMoKYNmgjOC2e72KB5KPTAwVedbiKklleBvAHFmg1j8vWqdqZqb/wR/9eWNFobOQVks4N6mGrOEzuKPjXR2RHPm6v9Z5JQGFbmSINnM1L/VIKTAam76P3YdwnOcFHSuEfq1rpFtTkES4Q0hgBJ+sPrGbRgRQZmlOSnaS6/seRxHKX+ZoUPafbODcQgJRiwTl+tHkJgRnLeeSMyz7ZxkZIyrBngF35Tt2btuCjtjRLo6Ng17ao+x1rR0yglU59ecD19w12MZGLdEgvYJBK/CKPzmZ2jhdIuJLwOWQwX673RIArsNCh7vNZvBbx/6ghTaa/OC3icpSGXOOCOA/nl9RlqV+op09avlm+Rss5OLct/fmsoWIa5wshGwT3zjV+FSTPGjOO6FNh30pDKkY0R7zpg+9WgxnKBEvBz6B8VUTuhZlXYYYFUgStp3gDs+S5VHamIatFA/AyRr4e5kIgVk8Y+pbXCKQsekFrrtDHoAK89ATGFqV51EZIIEtWyBqY6gWMOBEzDXtVMrI01EP6gKe3O1utQL0WfdJ/lmt495F002L0cTUJ36WL/Bhnny1Q1+pN15c264FoEEYYiNM51SChK1C2liyaoujAJ+cxXK5iqHRfc5lBZFwC7HKcBQw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79f9d326-8876-43ec-8b45-08d884fe822c X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2020 22:26:31.5551 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gUl1WVMFXVQA05kNmershwvqfLpFaxejLUSrpv5uhKE7KJzo8NawicDpcRdbuCaOJF2wFEM0DCGrWY7cGJhuUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4058 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Lendacky When both KVM support and the CCP driver are built into the kernel instead of as modules, KVM initialization can happen before CCP initialization. As a result, sev_platform_status() will return a failure when it is called from sev_hardware_setup(), when this isn't really an error condition. Since sev_platform_status() doesn't need to be called at this time anyway, remove the invocation from sev_hardware_setup(). Signed-off-by: Tom Lendacky --- arch/x86/kvm/svm/sev.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index c0b14106258a..a4ba5476bf42 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -1127,9 +1127,6 @@ void sev_vm_destroy(struct kvm *kvm) int __init sev_hardware_setup(void) { - struct sev_user_data_status *status; - int rc; - /* Maximum number of encrypted guests supported simultaneously */ max_sev_asid = cpuid_ecx(0x8000001F); @@ -1148,26 +1145,9 @@ int __init sev_hardware_setup(void) if (!sev_reclaim_asid_bitmap) return 1; - status = kmalloc(sizeof(*status), GFP_KERNEL); - if (!status) - return 1; - - /* - * Check SEV platform status. - * - * PLATFORM_STATUS can be called in any state, if we failed to query - * the PLATFORM status then either PSP firmware does not support SEV - * feature or SEV firmware is dead. - */ - rc = sev_platform_status(status, NULL); - if (rc) - goto err; - pr_info("SEV supported\n"); -err: - kfree(status); - return rc; + return 0; } void sev_hardware_teardown(void) -- 2.28.0