From patchwork Wed Aug 14 20:42:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 13764090 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2067.outbound.protection.outlook.com [40.107.236.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6E8C1D2F71; Wed, 14 Aug 2024 20:43:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723668202; cv=fail; b=s4mL6mHGEk2Q0ZJjhBgv0PePqXubbsf0vuvLtklzcfJfGrOaqHGqNgr6bqYXAuE6WlJA2kHYqh6y8KJsEXS7NaYCmkHMJ8J+Dzvy0oXO+24iT5nTgrEKlo6iSThqLvVMvfwrBIwIsfqn23v0HAtYNbfOO13mXABu/DiXI+9maO8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723668202; c=relaxed/simple; bh=wto2bESn8z7Divh1qrLKE8vHGkHle59z3HcODp7GYbc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NpeiuGyFrmdVNZKojnapWuM1lgGcuikxdeuaaSOuvXrIMS3cx4M6IgcDOsgYH4J8RYwwryqwe6fiMkRpgIeNaARAoJjUDU1keRroDbFbAaHe39SMsqBU0W2MKO23eOr6zeOM7ZdSOUULLO9e5BOVkVpV24LZaloLtostGYtcIgE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=KyXP45/6; arc=fail smtp.client-ip=40.107.236.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="KyXP45/6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UiYWaHvlJRRVboYc7byGcwxnLk3D17JcVDqYKKxn4vb876cyQuz5tYOyXwuu1c4IQB3uAaKZUv2KD4ptjvLZrQVsF3x5qXlQg34hWU2P4RGJjxOnK2FiejMu88JCgkEU9A5leFLQM9uiaQlBXfqABwOgyBoNjvEWwM3R+MRb98g7yVrh7Flkkk/eii/eH/txT5ZTqkE4R1NJwb7ahf+jhkleG4vQHEmGirazKvU0sN73m3BZNkenMZMWNJFNL/RlF/iq2k/LEFqFNj15brNC1K/HrOfujZdNGwHkHuVT4zje3c4l6pyCTWPGrVdr/5+3gBakIlizIm87AnfFVUduDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=magN7AVVzHhsPvHzIQUHp4dRtyyY3nSiiXINbpEf/TI=; b=cjpZ9/kQw0ICzjpwLU2LXe3AR1bL+OgJVEm0B94hJIewXrTg/C2HJwEkDWYbLiJHAJJ5d01RcWY48ZzJBLt9V0NDwXhzT29wm6DREy3Fu00B1AY882CIllmfRDq8vFEmctFDA+DeeEAeGFdrPuq6hhQxChdMketAGlSAAZ4zRRibfGKTrjQOm6FpEexKAWztqmlaSiHWx5n+B/baqyO2k+NH0els8CsvSF8WR5EDE2EVzj+yDHb/zZkw27DhgBUwOZa4WgvGXffCvWnRyRZGjQ6dHyOQjYz2l06XlaKTIgwjb3/zlBMFA2o/LCBr8WCPk811UMCdlJi/vTgbKvO8iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=magN7AVVzHhsPvHzIQUHp4dRtyyY3nSiiXINbpEf/TI=; b=KyXP45/6/f05J7oGXUa1USY46DONAJbK1gtujRKDdvwxAbauTTd9y0guiPxhSGCUthXjAgnYBfcmJsA5FmLWKDlbihW1ksnVNddDdMbpF23yAtjllQiLTOs4GpxxYNQPLQ/CdbKKjigY0SAWuSdCu8pYcSwdFqE/PZxSGd359hM= Received: from BY5PR20CA0029.namprd20.prod.outlook.com (2603:10b6:a03:1f4::42) by CYYPR12MB8853.namprd12.prod.outlook.com (2603:10b6:930:cb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug 2024 20:43:14 +0000 Received: from MWH0EPF000971E9.namprd02.prod.outlook.com (2603:10b6:a03:1f4:cafe::f5) by BY5PR20CA0029.outlook.office365.com (2603:10b6:a03:1f4::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20 via Frontend Transport; Wed, 14 Aug 2024 20:43:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000971E9.mail.protection.outlook.com (10.167.243.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 20:43:14 +0000 Received: from tlendack-t1.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug 2024 15:43:12 -0500 From: Tom Lendacky To: , CC: Herbert Xu , David Miller , John Allen , Ashish Kalra Subject: [PATCH] crypto: ccp: Add additional information about an SEV firmware upgrade Date: Wed, 14 Aug 2024 15:42:40 -0500 Message-ID: X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E9:EE_|CYYPR12MB8853:EE_ X-MS-Office365-Filtering-Correlation-Id: acb30720-dadf-4eb4-58f1-08dcbca1b809 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: nGnvybVCSm7osDRukkiC5pSVpZcDKMGtGureb1yVVsisVGiYcLXVgNLHxF3TXLq7oHK2jZkb3UOU7+eKAJyAr3LshEU/Xm5IO2icNlBAtOfYwDIKYCjJN2q4YjRgwNhFV4dRMo7134tMg7vTUkXlqi59Q5yVmYtFAlVFtjdy1YlonQ1K5/b9An+64ekLW6TBybmo4Ac0hnIXE41GgAvpa8QnXX3F4AQpo+YqT2oM1zh4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BjGPTXvix084bZ57FtuDLq2L3OfJnq/JOMUE2nESUgXzUXcRWr4vO1DEZFyO//9EmwgVAkAZyYqMRdpGB+N3ZwzPNSOToASfEe+P5GkyJJM6ijblz6NSG0766jqxlPkXlJ/1GCnI5HwJ6vrUhwoLygb9+3KZ X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 20:43:14.1269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: acb30720-dadf-4eb4-58f1-08dcbca1b809 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8853 Print additional information, in the form of the old and new versions of the SEV firmware, so that it can be seen what the base firmware was before the upgrade. Signed-off-by: Tom Lendacky Reviewed-by: Ashish Kalra --- drivers/crypto/ccp/sev-dev.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 9810edbb272d..3b89f23afcd7 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1629,8 +1629,6 @@ static int sev_update_firmware(struct device *dev) if (ret) dev_dbg(dev, "Failed to update SEV firmware: %#x\n", error); - else - dev_info(dev, "SEV firmware update successful\n"); __free_pages(p, order); @@ -2382,6 +2380,7 @@ void sev_pci_init(void) { struct sev_device *sev = psp_master->sev_data; struct sev_platform_init_args args = {0}; + u8 api_major, api_minor, build; int rc; if (!sev) @@ -2392,9 +2391,19 @@ void sev_pci_init(void) if (sev_get_api_version()) goto err; + api_major = sev->api_major; + api_minor = sev->api_minor; + build = sev->build; + if (sev_update_firmware(sev->dev) == 0) sev_get_api_version(); + if (api_major != sev->api_major || api_minor != sev->api_minor || + build != sev->build) + dev_info(sev->dev, "SEV firmware updated from %d.%d.%d to %d.%d.%d\n", + api_major, api_minor, build, + sev->api_major, sev->api_minor, sev->build); + /* Initialize the platform */ args.probe = true; rc = sev_platform_init(&args);