Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4988987pxu; Thu, 10 Dec 2020 10:08:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEqsLBoKWN8f0YIxYae7hDo9PdXPR8WGJlG15IUv6ibg64hMjTEqH6EQ/RJ+GkCLwv6I2s X-Received: by 2002:a17:906:268c:: with SMTP id t12mr7383332ejc.91.1607623686344; Thu, 10 Dec 2020 10:08:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1607623686; cv=pass; d=google.com; s=arc-20160816; b=fxwWsTkGOF3O33PiTqsr/gfp+Zjbs7WqcsuNLv9II7DjYSqOOtzaLXmMm6ob7jCORL 5QwOxMLeLiya7ka1i5pTdScbDlPJWGNbHnqXer2IfHnnkZh35WWjphyBT0Z/75SbU/j2 kqcHnnn+c5ncvtmAi1r5ctB84CIwdkdnh1pz9Atz8dbqC9sn4wksWw4vQHrxYtpvuaaG XtUcINopwYWd6xD4/a7wX3e6qE9NCN1iwVLHbDQzblEn5qugrD5GHMDqLjJANzSWYyxn IbuxGRf1hsWH6FQFxU9AzldOEelH7P0eFTssoAYCOI11S2hEvGD3Tcd7MNFVmH/TQkBD Npjw== 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=r+xDsO1QTKHCEucSaBZKE7cS9MTQOG01bJoIrDpbPixxhT7D7NwumZAAEhar3FWARm f04YoV1bDCnh58qpAncOhN6aJslYPqTNhIld+09duEWvr6nMGHRTBppDb4QpZbAfyGqy yUlF0j2b3pID7q4SR7o4YNMHpw7W1GMuhJ+MUAMA2lW/irk0n6BFm/4lWGCck2t0jtgY BlR9SvVrUwAiKJmYuTEZLnCZoR0P9SsBg+tiBJPIhUpvfZyuxCizqaGNujuY7QcV825Z y0omzLsG19br3dFSE9tG63PglH4s2w4lYhOZSvvTe8+65a77KafCNE0rNOr7RnJSmDo7 Tk2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=inaRtfln; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si2977175ejm.412.2020.12.10.10.07.41; Thu, 10 Dec 2020 10:08:06 -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=inaRtfln; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392589AbgLJRME (ORCPT + 99 others); Thu, 10 Dec 2020 12:12:04 -0500 Received: from mail-dm6nam11on2069.outbound.protection.outlook.com ([40.107.223.69]:37494 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732949AbgLJRLi (ORCPT ); Thu, 10 Dec 2020 12:11:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F1lxS4fnFFXRYvaQ3qAZEN1oTaUIKb6iD0y0i5mvRs36IIO1rZyMpAolB0MF8SWxkqJg6Vkz7xMHgWKnB4WOk0UNTFlj07pOx0j+tJMHzYUoY+qtKGnyw3PTNpIOWu/0vwlgIKxd5uYP7OC0xP4QEkI1trxy349prP7Vf/18iNN1p8HcscYqgJF0K1+FolgsU2cQWhegzJxIU3IvDPdQHSOf1xgBIqqu8BLvc2XlsUbgk05Fdwv/LmSYP+WjvuBzhJGQUVAWq5TCilZOZcJEo4MrcaQh3jQbqvv5ybIe6u8jIkff4fggtcDB4VoG1lqAU0w2I7JmUNZ90XS73ihjqg== 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=DfUB43eIxKC90F3ExxbR7nxTs4NgYtvu3y+KcoRB+nsreqf87wlrXsu2k6mM73C9wxH9M8JEzageEJZ+xGQFRuMeSity3CB4LF3CMEkaGdKmsDGWz6JMs5c0aG5WSryQ9App1qU9K/mDjAfqzKaG06RdHSgr9mLOQDfk+Qp9Rg11cqPApRzgReVGcB3jA4u/Q05ptc3k8iaHcBuJ+5WZU7b9pyxqKY5KqB6M/MxfU9wRYnv9ffIG7rU2RvBlBaZe/8cffAMWVgjide3Mi68w4BFoT+Y8zWmpjz8vkeAV9bZ+4VlYr87Yrj8fGZQGkAG8ojWXkEb1ii/HolLJAmyYKg== 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=inaRtfln6rXCo3SoW6DDLe7pOM2MQFQxVvN7AhxYJVCJ8VdfNcpFJgJwnp3b8C4/3gPmltHSFSGiVWSohHV1pq768Fgszu5x9wrTIHoJNDd01CQnO2wWrAj4gxFQZ1xaA606nPKpKFcqKUCFnOsuboTSmYWx4QwDVPfNZKNrM3s= 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 CY4PR12MB1352.namprd12.prod.outlook.com (2603:10b6:903:3a::13) by CY4PR1201MB0168.namprd12.prod.outlook.com (2603:10b6:910:1d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.22; Thu, 10 Dec 2020 17:10:35 +0000 Received: from CY4PR12MB1352.namprd12.prod.outlook.com ([fe80::a10a:295e:908d:550d]) by CY4PR12MB1352.namprd12.prod.outlook.com ([fe80::a10a:295e:908d:550d%8]) with mapi id 15.20.3632.021; Thu, 10 Dec 2020 17:10:35 +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 v5 02/34] KVM: SVM: Remove the call to sev_platform_status() during setup Date: Thu, 10 Dec 2020 11:09:37 -0600 Message-Id: <618380488358b56af558f2682203786f09a49483.1607620209.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: CH2PR10CA0003.namprd10.prod.outlook.com (2603:10b6:610:4c::13) To CY4PR12MB1352.namprd12.prod.outlook.com (2603:10b6:903:3a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by CH2PR10CA0003.namprd10.prod.outlook.com (2603:10b6:610:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Thu, 10 Dec 2020 17:10:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 38015709-2c41-41d3-edb7-08d89d2e8278 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0168: 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: j6g4Cg4COSe8P7F6quS4eoCB38tfikB2hyL5UnalcufnrzPU4rdQTc1QsDt2y7+7fNBq29aVAtCd3hpLq3j+AKgQYtWsSfcEJN7CNS6tiz23Z7iG4oOMSUFHlJwYuCXa2BaFJoX7ioJWqxLMZw4y9pDZknhuF4tRVUFKuSy1wpnsO5SqAig1iNmTr8ahC8MbWo4BBN25Xr43WOzgIOZiuE4dQml1jv83VLOnHuh7b09r53R6xRoz7XJQaELvo3ZtNGJZMLOR34wFop/ClhdomQLS6WLY3/odfaDlRywYKD5hfMZcHjTJYnfNdEOE5sdbIlmQWzIa9vuw3L3DJZE9PFQ/gzSR5XHEjXrc43wniVaDRvxbfKQQ3XW0v9oV9Yd7 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR12MB1352.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(346002)(376002)(36756003)(8676002)(6486002)(4326008)(66476007)(86362001)(7416002)(66946007)(7696005)(54906003)(26005)(16526019)(34490700003)(66556008)(8936002)(83380400001)(186003)(2906002)(2616005)(52116002)(956004)(508600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FERpW1AXJf?= =?us-ascii?Q?WP6bYhHewzNyfJSjVMEnM3je4fBNCRiGLATq5rpuuUWYfkZpeKYMFFTHPQk3?= =?us-ascii?Q?es5doXRQBzEXxoi3F4IOVJzcMi2KfXWGzkkdhuJxtqnqcQ8fx/ac+F9VGeTH?= =?us-ascii?Q?GyWjNmYnRjs5MDveixcfhlX2qxsnk4XD5mcSjCZWo+ou2NgLuiu3G1Lj83WR?= =?us-ascii?Q?uIn7?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthSource: CY4PR12MB1352.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2020 17:10:35.5155 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: 38015709-2c41-41d3-edb7-08d89d2e8278 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fiN53wUMgaaO47Guol08md8M+FH8BV2oZteS3vlb/1B/7dqjr/oXSUXbFJ18lZbHMdK0Q+iW8oZzylFXuDy5Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0168 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