From patchwork Tue May 28 21:07:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13677453 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2065.outbound.protection.outlook.com [40.107.223.65]) (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 1413917BB2C; Tue, 28 May 2024 21:07:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930466; cv=fail; b=Z0TW1zmIBRo01Jgf5Cj9H/ASSli0AqV2WWkcISfTfbEA9fI4JeirZC8gbrSVJpSxJPIxPM/P0TT88YMHRFiPhTjgwo4FAn5qhayexn9JRD+lErlFfaugSQbuiPhCSN5m8khaDSs4CogvJSh4HD5fuFrncEGTSA764TDVr/KH8B4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930466; c=relaxed/simple; bh=F7TmE8xiCfKcBMxVvi+3Gt+dEjvi/++HXwgjwprumfo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OVwONKhXY23VnbpzQx1jAJqepJzBKffkjQi5XDitX4pzMYDTnQQejAH83M21I2NSKOrWMGyefTT4MlWJts/+eG4a6SLbX92Fg4ePiMmDT9XaSFlaJd9a7A1nf76F99P//HEU2jjWbf6nd3c3+QT6hnN8Nq3IiYsaKAPM03Vj6yE= 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=mliqyj9K; arc=fail smtp.client-ip=40.107.223.65 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="mliqyj9K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mlI+SHUKNiyQIjpEKnrXiIOeZppMSr4kDFygeQEGjMZFnnovAnxtLYUkHNCOUzmLgTg8AZZGa5wi2bu7awJGgH+D1jxQbHqV1A+dVSdVufHcKynvRx/0+cBnDECxJH0BhO420TYvtO9u7Ioe4Vks2CbCn11N9Zywc4CpXGW8/hDGGyUTapSWnmm42vUlUzpFNVa2Pfi6p9HSjO2D0CU8qCz6S+4JIXxMM4cxCGJmzntnu8BQhO3ovJoVSpuicfcu1EHjeUijJagOUJ8E5wnv7tKbL6DnZ/fVq2cTaARg4WODGLoXnPiHd8v74xYfeBSpzEBR2Ufz5PrSnwSgOA8eSw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rFwB+4oOAEKNYEVcarAe9qZ/8ftwCBOwj1aNgWNasbU=; b=jPipRwuyI79ojH3EngjHiY+1DxP8dmrf4zHNVj25JkMTvHqJqtvMaFGO4D0vxv9tPdZ9QohhBgIHfg4ketOjpAzm4vYGdNtDh8U9pGVvscQx6VNyRKTtEIm8vkyNfU1f88rQF18DAIT1C8RkSuyUJSL5Hr9urxCETYbOyNxUP+HOPUGZKdPGFCVgv0CyjZtVW5gpQHVjoq1tk2w1TCyXlPZJ4urXy9FEWHYYB6fIbtertbu9Nq2EW9G0F8g3d2ROkg6FXlC4oNpCh4V/6q9RFrMrtSk78HsyZSiXjxRth17WyIzFgHMJLzo6bqky6QswKF2MGmV4znnEjw7nYlobZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au 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=rFwB+4oOAEKNYEVcarAe9qZ/8ftwCBOwj1aNgWNasbU=; b=mliqyj9KjNOe411Row1Y4AwGHJtW1VO2A4r5+NNUKN8Itu7yexo+lq+n2VOgJFRevSvS4Nu7mLUkn3AayAsAFxQlp1F6nL6PI/EMosABy3M2ihqNIUxzu2bANkegJsKq7G67xp2ayvaOAOh0GFgiMrd2JD8QdVexGJNvrBtZtO8= Received: from MN2PR16CA0015.namprd16.prod.outlook.com (2603:10b6:208:134::28) by BL3PR12MB6545.namprd12.prod.outlook.com (2603:10b6:208:38c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 21:07:36 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:134:cafe::6) by MN2PR16CA0015.outlook.office365.com (2603:10b6:208:134::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 21:07:35 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 21:07:34 +0000 Received: from AUS-P9-MLIMONCI.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.35; Tue, 28 May 2024 16:07:33 -0500 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , Richard Hughes , open list , "Yazen Ghannam" Subject: [PATCH v2 1/5] crypto: ccp: Represent capabilities register as a union Date: Tue, 28 May 2024 16:07:08 -0500 Message-ID: <20240528210712.1268-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528210712.1268-1-mario.limonciello@amd.com> References: <20240528210712.1268-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E64:EE_|BL3PR12MB6545:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c24ba64-2a55-477e-8a0f-08dc7f5a322b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: IkDPG7+ZMQq39A62eXrOyLazJZzl+6PjdGoW3fkFqPIYAmB642YQJkpPA9CR8bVk0hNNMllxkjwfAx8HETyDdfeEOXoGt0B2uvzt73vF6NfLdhGmzlNw9j5jUyaEfZFqNt72cn1szYQ0D1EUImF5pYUMhhfRfKLTjK2X57kqh0klZ6bmSWx5efj+xUF3YV08K0Nttcf/5xF93tCeK8K5xAjmAUhnjpM/xFKhbsNzYIHFFVyIw28/qNMWyIFEag4PEG3r9fnA3iMvH29JKita6f0XK670IY7WXkwO74zemPq/9pYe8zMG2AQ65ebdVIVedZOFF+4MpDRk15RXW03qshPWVLunQdfmE/Hc77vD0DD6bZwyNF58rqy1NE9RX5LM0cmUT88gmiILbTjhZNMQ69HY5b2Gkb/p3ViZZb9opJeNQ9ljJJYH8pn9oBu0DARcHKeVHA7N6gTkWVwuBTTsaQOGdutoNnvP6nFnCe4MxV57ac5MwOZDgwnJmxl0UjeOjFBcFLHRhxzI7ZaO86NFWlfnbHsb6DWnt9VCwR/H2kI1bN0LLHY1CIKc2ctJRHXGBUumqUsEg+4AuMDbZnBcrqfYcvJOMeoE6zuDMcv/DCI/AZDJPcmAMNijwB6JuXn5s5D1zFZndgnAhP1GeKgxEneRE4f96GZL+vrEGdB/2Q5y6WLavN/hsKQRpCurekWHbeXooU9B3G7EYbL8kxQTsIeBdqN6LVqf1mse/fZg7Dnjai+21g8qFwhh9t+/hLCQbxFEHjaDTKF1xjdn3YXVzu8vVqeM0RBJaGjJK6ybRH3VXVUjtF+ZHaZSdbKQusTmabUj6xcRrZbrZg/9RYg4zQ6qJDPaFQi8zv8sGrczYGcPuqi+z6VI98TaYp6JSLcKWDsoi6kkllRFIWUgT2SWoaO22nanwkiCw2MFi8fLUawRs++88W4Ybj/9ICdmgLVJuWn2OcB5FlsrXYV6pyFXUZCJDGkAdC7k8HNo+am0uxBMzNHkIFDPF+TOIEzlMWCew1M+0CYdlYUJt/TwKfTQ/YtEtRSRobVOctjilVwKolenrle1Co0xGmZwvtPK6BppRjvtMTYqRl+gnrlAKKPBEABko5lXn+v778pOfDTELxuQuFDx78vrS8ly76LuQQ1pedFQRfRHifHMsfcf8ijIqhqmVIelZ2oMHWdHQNP7QWWQCYq32Wv5sMuYVgmTD4NOHmaylchGH4yVZm3PN1LIWbHqBvM6EHd0MiQlTeG9++8x/u1X/yoBjo/tKOr4h3BInR8tiYYDiTDI6GJUicJiX30Dmm1xiDbEdigk74iXgbbGzKDMDUqA3sjACCBBIVj5Pv/9ozXtjhWN40XKzeTxXYqjIZSD9Jvu0H6xsesVDt72UdueuDXWnyhGqLgfB/f3 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:(13230031)(376005)(1800799015)(82310400017)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 21:07:34.4953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c24ba64-2a55-477e-8a0f-08dc7f5a322b 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6545 Making the capabilities register a union makes it easier to refer to the members instead of always doing bit shifts. No intended functional changes. Acked-by: Tom Lendacky Suggested-by: Yazen Ghannam Signed-off-by: Mario Limonciello --- v1->v2: * Add tag --- drivers/crypto/ccp/dbc.c | 2 +- drivers/crypto/ccp/psp-dev.c | 11 ++++----- drivers/crypto/ccp/psp-dev.h | 44 ++++++++++++++++++++---------------- drivers/crypto/ccp/sp-dev.h | 1 - drivers/crypto/ccp/sp-pci.c | 26 ++++++++++----------- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/crypto/ccp/dbc.c b/drivers/crypto/ccp/dbc.c index d373caab52f8..5b105a23f699 100644 --- a/drivers/crypto/ccp/dbc.c +++ b/drivers/crypto/ccp/dbc.c @@ -223,7 +223,7 @@ int dbc_dev_init(struct psp_device *psp) dbc_dev->dev = dev; dbc_dev->psp = psp; - if (PSP_CAPABILITY(psp, DBC_THRU_EXT)) { + if (psp->capability.dbc_thru_ext) { dbc_dev->use_ext = true; dbc_dev->payload_size = &dbc_dev->mbox->ext_req.header.payload_size; dbc_dev->result = &dbc_dev->mbox->ext_req.header.status; diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index 56bf832c2947..7d9d2042be35 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -154,11 +154,10 @@ static unsigned int psp_get_capability(struct psp_device *psp) dev_notice(psp->dev, "psp: unable to access the device: you might be running a broken BIOS.\n"); return -ENODEV; } - psp->capability = val; + psp->capability.raw = val; /* Detect TSME and/or SME status */ - if (PSP_CAPABILITY(psp, PSP_SECURITY_REPORTING) && - psp->capability & (PSP_SECURITY_TSME_STATUS << PSP_CAPABILITY_PSP_SECURITY_OFFSET)) { + if (psp->capability.security_reporting && psp->capability.tsme_status) { if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n"); else @@ -171,7 +170,7 @@ static unsigned int psp_get_capability(struct psp_device *psp) static int psp_check_sev_support(struct psp_device *psp) { /* Check if device supports SEV feature */ - if (!PSP_CAPABILITY(psp, SEV)) { + if (!psp->capability.sev) { dev_dbg(psp->dev, "psp does not support SEV\n"); return -ENODEV; } @@ -182,7 +181,7 @@ static int psp_check_sev_support(struct psp_device *psp) static int psp_check_tee_support(struct psp_device *psp) { /* Check if device supports TEE feature */ - if (!PSP_CAPABILITY(psp, TEE)) { + if (!psp->capability.tee) { dev_dbg(psp->dev, "psp does not support TEE\n"); return -ENODEV; } @@ -214,7 +213,7 @@ static int psp_init(struct psp_device *psp) /* dbc must come after platform access as it tests the feature */ if (PSP_FEATURE(psp, DBC) || - PSP_CAPABILITY(psp, DBC_THRU_EXT)) { + psp->capability.dbc_thru_ext) { ret = dbc_dev_init(psp); if (ret) return ret; diff --git a/drivers/crypto/ccp/psp-dev.h b/drivers/crypto/ccp/psp-dev.h index ae582ba63729..02a7c94c02df 100644 --- a/drivers/crypto/ccp/psp-dev.h +++ b/drivers/crypto/ccp/psp-dev.h @@ -26,6 +26,29 @@ extern struct psp_device *psp_master; typedef void (*psp_irq_handler_t)(int, void *, unsigned int); +union psp_cap_register { + unsigned int raw; + struct { + unsigned int sev :1, + tee :1, + dbc_thru_ext :1, + rsvd1 :4, + security_reporting :1, + fused_part :1, + rsvd2 :1, + debug_lock_on :1, + rsvd3 :2, + tsme_status :1, + rsvd4 :1, + anti_rollback_status :1, + rpmc_production_enabled :1, + rpmc_spirom_available :1, + hsp_tpm_available :1, + rom_armor_enforced :1, + rsvd5 :12; + }; +}; + struct psp_device { struct list_head entry; @@ -46,7 +69,7 @@ struct psp_device { void *platform_access_data; void *dbc_data; - unsigned int capability; + union psp_cap_register capability; }; void psp_set_sev_irq_handler(struct psp_device *psp, psp_irq_handler_t handler, @@ -55,26 +78,7 @@ void psp_clear_sev_irq_handler(struct psp_device *psp); struct psp_device *psp_get_master_device(void); -#define PSP_CAPABILITY_SEV BIT(0) -#define PSP_CAPABILITY_TEE BIT(1) -#define PSP_CAPABILITY_DBC_THRU_EXT BIT(2) -#define PSP_CAPABILITY_PSP_SECURITY_REPORTING BIT(7) - #define PSP_CAPABILITY_PSP_SECURITY_OFFSET 8 -/* - * The PSP doesn't directly store these bits in the capability register - * but instead copies them from the results of query command. - * - * The offsets from the query command are below, and shifted when used. - */ -#define PSP_SECURITY_FUSED_PART BIT(0) -#define PSP_SECURITY_DEBUG_LOCK_ON BIT(2) -#define PSP_SECURITY_TSME_STATUS BIT(5) -#define PSP_SECURITY_ANTI_ROLLBACK_STATUS BIT(7) -#define PSP_SECURITY_RPMC_PRODUCTION_ENABLED BIT(8) -#define PSP_SECURITY_RPMC_SPIROM_AVAILABLE BIT(9) -#define PSP_SECURITY_HSP_TPM_AVAILABLE BIT(10) -#define PSP_SECURITY_ROM_ARMOR_ENFORCED BIT(11) /** * enum psp_cmd - PSP mailbox commands diff --git a/drivers/crypto/ccp/sp-dev.h b/drivers/crypto/ccp/sp-dev.h index 03d5b9e04084..c4e125efe6c7 100644 --- a/drivers/crypto/ccp/sp-dev.h +++ b/drivers/crypto/ccp/sp-dev.h @@ -30,7 +30,6 @@ #define PLATFORM_FEATURE_DBC 0x1 -#define PSP_CAPABILITY(psp, cap) (psp->capability & PSP_CAPABILITY_##cap) #define PSP_FEATURE(psp, feat) (psp->vdata && psp->vdata->platform_features & PLATFORM_FEATURE_##feat) /* Structure to hold CCP device data */ diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index 300dda14182b..b57392292af1 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -39,31 +39,30 @@ struct sp_pci { }; static struct sp_device *sp_dev_master; -#define security_attribute_show(name, def) \ +#define security_attribute_show(name) \ static ssize_t name##_show(struct device *d, struct device_attribute *attr, \ char *buf) \ { \ struct sp_device *sp = dev_get_drvdata(d); \ struct psp_device *psp = sp->psp_data; \ - int bit = PSP_SECURITY_##def << PSP_CAPABILITY_PSP_SECURITY_OFFSET; \ - return sysfs_emit(buf, "%d\n", (psp->capability & bit) > 0); \ + return sysfs_emit(buf, "%d\n", psp->capability.name); \ } -security_attribute_show(fused_part, FUSED_PART) +security_attribute_show(fused_part) static DEVICE_ATTR_RO(fused_part); -security_attribute_show(debug_lock_on, DEBUG_LOCK_ON) +security_attribute_show(debug_lock_on) static DEVICE_ATTR_RO(debug_lock_on); -security_attribute_show(tsme_status, TSME_STATUS) +security_attribute_show(tsme_status) static DEVICE_ATTR_RO(tsme_status); -security_attribute_show(anti_rollback_status, ANTI_ROLLBACK_STATUS) +security_attribute_show(anti_rollback_status) static DEVICE_ATTR_RO(anti_rollback_status); -security_attribute_show(rpmc_production_enabled, RPMC_PRODUCTION_ENABLED) +security_attribute_show(rpmc_production_enabled) static DEVICE_ATTR_RO(rpmc_production_enabled); -security_attribute_show(rpmc_spirom_available, RPMC_SPIROM_AVAILABLE) +security_attribute_show(rpmc_spirom_available) static DEVICE_ATTR_RO(rpmc_spirom_available); -security_attribute_show(hsp_tpm_available, HSP_TPM_AVAILABLE) +security_attribute_show(hsp_tpm_available) static DEVICE_ATTR_RO(hsp_tpm_available); -security_attribute_show(rom_armor_enforced, ROM_ARMOR_ENFORCED) +security_attribute_show(rom_armor_enforced) static DEVICE_ATTR_RO(rom_armor_enforced); static struct attribute *psp_security_attrs[] = { @@ -84,7 +83,7 @@ static umode_t psp_security_is_visible(struct kobject *kobj, struct attribute *a struct sp_device *sp = dev_get_drvdata(dev); struct psp_device *psp = sp->psp_data; - if (psp && PSP_CAPABILITY(psp, PSP_SECURITY_REPORTING)) + if (psp && psp->capability.security_reporting) return 0444; return 0; @@ -134,8 +133,7 @@ static umode_t psp_firmware_is_visible(struct kobject *kobj, struct attribute *a psp->vdata->bootloader_info_reg) val = ioread32(psp->io_regs + psp->vdata->bootloader_info_reg); - if (attr == &dev_attr_tee_version.attr && - PSP_CAPABILITY(psp, TEE) && + if (attr == &dev_attr_tee_version.attr && psp->capability.tee && psp->vdata->tee->info_reg) val = ioread32(psp->io_regs + psp->vdata->tee->info_reg); From patchwork Tue May 28 21:07:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13677452 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.87]) (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 8CA73224D1; Tue, 28 May 2024 21:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930464; cv=fail; b=YcIWcfXPmWV8ljFG+6nKblJmrxSivAKBnziI6xJEQshnvURj3LwFfH3JsIscLUFsBTLCaxXgClLmi5ciNF9qhXTVmr2aGIIeRcEna2FoR6nEdJWOB4UFNN3vG+Js23gwTYke1iYEgyJ0/8eUDxpW2x8HuojykKWZoavhCS+mq/8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930464; c=relaxed/simple; bh=+f4Lnmwh2gzeqUWqzm4t5O4hfXQa4KQqwOz+GY9rHvA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iiF3wBHVXOLjEJXFj7fLD1IoT7PqA5Rmpo5W06MrB3ufLzQ3kzil4oYBK1rPRyLbRUdPWMNfv9mFuOqbG4Mzgf8UejC3kbYT9GtDIZ4WP1iXrYlS0t51AmyJhZPNsGgeMDqPrhIBcK9olLTFY73Ai5enNeOXqxVyEcQw/eio1ZE= 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=q+09dSjY; arc=fail smtp.client-ip=40.107.243.87 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="q+09dSjY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hW4jn4ec7oZT74zdVBAtlwRhtoQznJf5WqVKdlp/naUmdKRewUUomn1ARp18vT7Mpm8Au3wSCgylX+XJoOJK+3gLZ7crm+IJagfmbpUm/ohtTK6RN3ptr5ukChyNXnzr/nf2zqjqP6eW4dfuOvRqwS4NzeVDWxL6yuqwzXjK3YoV8N1iWOtb9M/e1satkKnEYcOFCn9fW6xLnDX1Xal+jj+YImJg0IbQ0BpAuZ+j6BiPf2IhKgcpXYIRWeMCDIfqG6C20QsCIv9QfWdwIUEhOAesUf+cf+0FYGVn9ExFYnHyHfsmNXtueh+j8CKfMB/97FSCv4oJEHgFJ+Z3mqXBHQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qJtYjAp0J6y+yVYbmMW8UV/A9XznDq/6znnfIjRCkT8=; b=ihvu63+KY5XVatUSgC1fQkTkYNuKLETTNj87yKfBRq6nhZNsewRUjlgkd6YFD1h24KwjqqGngb/jBzaeGmpovRxPPu4Z0hDba5d0FsVvGejEFgp3GLXrrMGZw3xpubV3bCjDwRS78nUacfK9RNbwfrGIp6vaHT16l3FpFjpD3h9YebCvbr4gY2vlwyYs9f0aEO4WzYUcQSy2nz+ltlgPfsJhD864wRJ3b2S6uj3MzZCFofeSO5WVMNdvrG+mTNaMDngLB6R7G0EKrVFWaDAnSFM+tgkmhOgxVSW1QhWzjUr2GfKnBfnStZEfXB6NGl9LM+1dTAOxUJA6cwdLkV0/gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au 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=qJtYjAp0J6y+yVYbmMW8UV/A9XznDq/6znnfIjRCkT8=; b=q+09dSjYHjzoH6e7Kagr06jTI23ihD6CL+VySBsn5ZO20FJkv0rumAwa9FWG4vv/gFGDXp7s0yb+apT8y+UFRMIWzwjWOyXeKoTuAUok7u5v1hJ8Ku6Pz80HC7B1psBb0thamjXfxDEBy5Ob4h0xPTaWkDnK7L5xRr5jboc7Oh4= Received: from MN2PR16CA0012.namprd16.prod.outlook.com (2603:10b6:208:134::25) by DS7PR12MB6311.namprd12.prod.outlook.com (2603:10b6:8:94::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 21:07:38 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:134:cafe::9) by MN2PR16CA0012.outlook.office365.com (2603:10b6:208:134::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 21:07:37 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 21:07:37 +0000 Received: from AUS-P9-MLIMONCI.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.35; Tue, 28 May 2024 16:07:33 -0500 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , Richard Hughes , open list Subject: [PATCH v2 2/5] crypto: ccp: Move security attributes to their own file Date: Tue, 28 May 2024 16:07:09 -0500 Message-ID: <20240528210712.1268-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528210712.1268-1-mario.limonciello@amd.com> References: <20240528210712.1268-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E64:EE_|DS7PR12MB6311:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f674aed-a13b-4abe-edc0-08dc7f5a33b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|376005|36860700004; X-Microsoft-Antispam-Message-Info: Hc5AM6Bd5zHDnssoSUosPta+9GJFDjuiEKaACCm4vXzhOnfFUUAofzKjNfnR7CgEcJyjwaJXbWIWZGG1NyRCh73nQDp0aeVSolfMzZjxAwg6Xc5Sk5AX1NloAQfPjTm1GHWobpNAYitM6pYR/CL+LIIH9ly+3CD19Jbon+9OivdhOm7nEBWvCrV0P4WFiO0v7LmmeRfZNV76Qw7HwhEwgi3zdVzhQPCktRJqHBiGEjK84KlikyZpFvVXeiSANDZN9xcxVta7vNDihbG0eUn3nRBBPZcnAU93DigLtphy+COPzm5dxJZDwYwtZItnCCKPmNCvLYH1VBJfwABCipyo9VFhhyFTPdK8YL8LWAx+7cGW7gF5Ha5MEhFCSzM654ci7I1PVj0hZhiXuSmq4GpnJH2h74vlEx0VE8qFIra+jNGVlUpJvJGsu1t+SkQgP28OjJWo/ABXS7V1cPU3UitmMUeE//feeUDGkni2+84zheFFnIhsM6fHmjtA8IucB8KG4qN1mO1fjwemuLYUgcm4hbeWKY2Qx7ykLFVWAb14oOyQNGxIZ4J11eKVAKF6oMjb2LfFIg+6WpCWhOPAz+TpbSb3IF80AgRPu/O+ggQOITIpNAhID5xkCnR36FXeShIS1IzS3EseRv/H6QgZiimWZO4B2byPHBlt4/M6IfoLTOW34Qhv6udAAxZGvmLaJt03acrlIEL/ooX51gKR+R5GRPyo02/ekmjK952FTNfZIp1BOBiknrR78nHJYVFt3yf6EOzfDRT1AYfAEd7fVdqXndSuhgIoMPqvuKl2/unIyyyHuHPjcIAabqhmvZ/Ijigc/X3En9nILhRUY4tJC6Dv7W/W84u7pGS+Rm/cj+0b/trhq9Oi2iGlUYe183XjJtovoy8k71w/Y16Iw+KbKBXumL6+UiGoWXp6b5tQ+cpXETKSeq0ya/Kdi6DnnDeNnYBvv6iQXgeQ8mghVuzZPk7LOm9D2xYgaXX6aigLGaJFqwcXOsmuacgWye3xkMnkj5p2y2k67EuEMPG87W/ze7RRQkScZLUCCrNtml/Us7qTLxONlToHOzHk0AJouUt9UvNjJYR0ywuLro1qSjZk/n+rAq0+8FuOopmPPORHf9AxQ+P7nk5qI3Ajoc+PRTJgpAwtCjgpXR4NzuWs/EZy7IOGkDE7TukhLLoOqdSJyKIm26fATMNBOJG8D7OfyZrECSvfk3n8INe7C0B+ewH6560WQiAFV30wjYPKh2CmZ48m/TrTRAQYwH638eeHT2qY1394r63tRAkoKQ/aTtba28v52jXXa4Ma+OZ2DLd+3uqEcXPqYvN/98XS7/2YTYLpNVN+5gG/RN1lman6WLiQRj+WspEruPPU3/mj5s9ek0AuKfzMVGXcWGUXC7awLGQgZ82s 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:(13230031)(82310400017)(1800799015)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 21:07:37.0734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f674aed-a13b-4abe-edc0-08dc7f5a33b4 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6311 To prepare for other code that will manipulate security attributes move the handling code out of sp-pci.c. No intended functional changes. Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky --- v1->v2: * Only add psp_security_attr_group when PSP support enabled (Fixes lkp robot reported Kconfig issue) --- MAINTAINERS | 6 ++++ drivers/crypto/ccp/Makefile | 3 +- drivers/crypto/ccp/hsti.c | 68 ++++++++++++++++++++++++++++++++++++ drivers/crypto/ccp/hsti.h | 15 ++++++++ drivers/crypto/ccp/psp-dev.c | 1 + drivers/crypto/ccp/sp-pci.c | 58 ++---------------------------- 6 files changed, 95 insertions(+), 56 deletions(-) create mode 100644 drivers/crypto/ccp/hsti.c create mode 100644 drivers/crypto/ccp/hsti.h diff --git a/MAINTAINERS b/MAINTAINERS index d6c90161c7bf..883fb3b246b6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -991,6 +991,12 @@ F: include/uapi/linux/psp-dbc.h F: tools/crypto/ccp/*.c F: tools/crypto/ccp/*.py +AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - HSTI SUPPORT +M: Mario Limonciello +L: linux-crypto@vger.kernel.org +S: Supported +F: drivers/crypto/ccp/hsti.* + AMD DISPLAY CORE M: Harry Wentland M: Leo Li diff --git a/drivers/crypto/ccp/Makefile b/drivers/crypto/ccp/Makefile index aa0ba2d17e1e..394484929dae 100644 --- a/drivers/crypto/ccp/Makefile +++ b/drivers/crypto/ccp/Makefile @@ -12,7 +12,8 @@ ccp-$(CONFIG_CRYPTO_DEV_SP_PSP) += psp-dev.o \ sev-dev.o \ tee-dev.o \ platform-access.o \ - dbc.o + dbc.o \ + hsti.o obj-$(CONFIG_CRYPTO_DEV_CCP_CRYPTO) += ccp-crypto.o ccp-crypto-objs := ccp-crypto-main.o \ diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c new file mode 100644 index 000000000000..076c1d175b2b --- /dev/null +++ b/drivers/crypto/ccp/hsti.c @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * AMD Secure Processor device driver, security attributes + * + * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. + * + * Author: Mario Limonciello + */ + +#include + +#include "psp-dev.h" +#include "hsti.h" + +#define security_attribute_show(name) \ +static ssize_t name##_show(struct device *d, struct device_attribute *attr, \ + char *buf) \ +{ \ + struct sp_device *sp = dev_get_drvdata(d); \ + struct psp_device *psp = sp->psp_data; \ + return sysfs_emit(buf, "%d\n", psp->capability.name); \ +} + +security_attribute_show(fused_part) +static DEVICE_ATTR_RO(fused_part); +security_attribute_show(debug_lock_on) +static DEVICE_ATTR_RO(debug_lock_on); +security_attribute_show(tsme_status) +static DEVICE_ATTR_RO(tsme_status); +security_attribute_show(anti_rollback_status) +static DEVICE_ATTR_RO(anti_rollback_status); +security_attribute_show(rpmc_production_enabled) +static DEVICE_ATTR_RO(rpmc_production_enabled); +security_attribute_show(rpmc_spirom_available) +static DEVICE_ATTR_RO(rpmc_spirom_available); +security_attribute_show(hsp_tpm_available) +static DEVICE_ATTR_RO(hsp_tpm_available); +security_attribute_show(rom_armor_enforced) +static DEVICE_ATTR_RO(rom_armor_enforced); + +static struct attribute *psp_security_attrs[] = { + &dev_attr_fused_part.attr, + &dev_attr_debug_lock_on.attr, + &dev_attr_tsme_status.attr, + &dev_attr_anti_rollback_status.attr, + &dev_attr_rpmc_production_enabled.attr, + &dev_attr_rpmc_spirom_available.attr, + &dev_attr_hsp_tpm_available.attr, + &dev_attr_rom_armor_enforced.attr, + NULL +}; + +static umode_t psp_security_is_visible(struct kobject *kobj, struct attribute *attr, int idx) +{ + struct device *dev = kobj_to_dev(kobj); + struct sp_device *sp = dev_get_drvdata(dev); + struct psp_device *psp = sp->psp_data; + + if (psp && psp->capability.security_reporting) + return 0444; + + return 0; +} + +struct attribute_group psp_security_attr_group = { + .attrs = psp_security_attrs, + .is_visible = psp_security_is_visible, +}; diff --git a/drivers/crypto/ccp/hsti.h b/drivers/crypto/ccp/hsti.h new file mode 100644 index 000000000000..e5c5ceab9973 --- /dev/null +++ b/drivers/crypto/ccp/hsti.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * AMD Secure Processor device driver, security attributes + * + * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. + * + * Author: Mario Limonciello + */ + +#ifndef __HSTI_H +#define __HSTI_H + +extern struct attribute_group psp_security_attr_group; + +#endif /* __HSTI_H */ diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index 7d9d2042be35..1a7b991c27f7 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -19,6 +19,7 @@ #include "tee-dev.h" #include "platform-access.h" #include "dbc.h" +#include "hsti.h" struct psp_device *psp_master; diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index b57392292af1..dd31e791156d 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -24,6 +24,7 @@ #include "ccp-dev.h" #include "psp-dev.h" +#include "hsti.h" /* used for version string AA.BB.CC.DD */ #define AA GENMASK(31, 24) @@ -39,61 +40,6 @@ struct sp_pci { }; static struct sp_device *sp_dev_master; -#define security_attribute_show(name) \ -static ssize_t name##_show(struct device *d, struct device_attribute *attr, \ - char *buf) \ -{ \ - struct sp_device *sp = dev_get_drvdata(d); \ - struct psp_device *psp = sp->psp_data; \ - return sysfs_emit(buf, "%d\n", psp->capability.name); \ -} - -security_attribute_show(fused_part) -static DEVICE_ATTR_RO(fused_part); -security_attribute_show(debug_lock_on) -static DEVICE_ATTR_RO(debug_lock_on); -security_attribute_show(tsme_status) -static DEVICE_ATTR_RO(tsme_status); -security_attribute_show(anti_rollback_status) -static DEVICE_ATTR_RO(anti_rollback_status); -security_attribute_show(rpmc_production_enabled) -static DEVICE_ATTR_RO(rpmc_production_enabled); -security_attribute_show(rpmc_spirom_available) -static DEVICE_ATTR_RO(rpmc_spirom_available); -security_attribute_show(hsp_tpm_available) -static DEVICE_ATTR_RO(hsp_tpm_available); -security_attribute_show(rom_armor_enforced) -static DEVICE_ATTR_RO(rom_armor_enforced); - -static struct attribute *psp_security_attrs[] = { - &dev_attr_fused_part.attr, - &dev_attr_debug_lock_on.attr, - &dev_attr_tsme_status.attr, - &dev_attr_anti_rollback_status.attr, - &dev_attr_rpmc_production_enabled.attr, - &dev_attr_rpmc_spirom_available.attr, - &dev_attr_hsp_tpm_available.attr, - &dev_attr_rom_armor_enforced.attr, - NULL -}; - -static umode_t psp_security_is_visible(struct kobject *kobj, struct attribute *attr, int idx) -{ - struct device *dev = kobj_to_dev(kobj); - struct sp_device *sp = dev_get_drvdata(dev); - struct psp_device *psp = sp->psp_data; - - if (psp && psp->capability.security_reporting) - return 0444; - - return 0; -} - -static struct attribute_group psp_security_attr_group = { - .attrs = psp_security_attrs, - .is_visible = psp_security_is_visible, -}; - #define version_attribute_show(name, _offset) \ static ssize_t name##_show(struct device *d, struct device_attribute *attr, \ char *buf) \ @@ -150,7 +96,9 @@ static struct attribute_group psp_firmware_attr_group = { }; static const struct attribute_group *psp_groups[] = { +#ifdef CONFIG_CRYPTO_DEV_SP_PSP &psp_security_attr_group, +#endif &psp_firmware_attr_group, NULL, }; From patchwork Tue May 28 21:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13677451 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2054.outbound.protection.outlook.com [40.107.223.54]) (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 A141617B410; Tue, 28 May 2024 21:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930464; cv=fail; b=SvWJ9Rip2GsbIMCQpYjGHe7IDi+RE3Pdg89VFiPq2QjR21UwvUwi3A0lQMF8ONSBy5lUMJZgwBhQB7bEARphV+U5b5/jx8Gz02alnhzqviOAhYhZr2WbE/bdqleuK5hoCrc+PHf+yS+rwzEPyOy0Hv9r0W9Rn2bhLwDBEwHHNN4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930464; c=relaxed/simple; bh=AYyTRJqC7IsWTASylpHjhf5/AXo0kYF/meAnJyOACNQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lu9Tz/JZb0AIA9ajAXnZlHO1C3lQSeBvjmSl9hjwLsg9vR4Eg3/PPalqEmm6ceaMJl9G2FxUVh/ZT9x4ycW1unQWAX/MGNFObcrRAPfj5QgTBjPca2Jd5cIN50pCpzVA4Pba6vU4LOpYhG+h9vi5NW3EHdsOKSTV0XmQddF9N+M= 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=Ld6ZR719; arc=fail smtp.client-ip=40.107.223.54 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="Ld6ZR719" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YVAJ4PixxG24CvhR0evAr9OlyqhpM6+ascPlDfT0UAC6oKpxvwSzZmbXFggB2gRtYru3949NdNyYQvLmVnYKzXrGNAzKlYCckiidVVsITPBTyKHkipIL9liog5x7cUEeY3+qGdmB3+0zCvqlrznxWgSr8vDxnZuDgr1TgfIaX2ioZP6bHljygMDq84B50Xwbeqe6b4yuF7cizxn82CG1DfAFGWCFgAy0W7V1BhgZDmaqlK71PX4DOxa9av2VZIeFyHWisjEk+CSeyKYUHiCWdUcV+3uhadeFyMMXFeVD6K2FnD9OguNW5u416I+puxTLbPOMBb5tMKoiNDcd+gjN4A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5DYByaFjjTieVakmh1ZORKaASEbDVoB1wTHOhCZ+IDg=; b=D/2LpkZyH6A3vkPFfPHqkJlPKLVs6dVpA4N8TFjhWoPHE9KYhep4Hunq8KHxMrT0lw+INw7ZvskdlFoBXSzrvWBiPv3xWJDaZ78lENKuFyfMtrqV+G9plKwY9u9U4tNvdAf66Akkd0zO4oMhkoER3CYex+GCJIQJPe4V+Fk/YT0ZgekG65u+9g6iZv6LWP68Xsi7FUrBeXRBcJe9m7AXPsT1CxRBMigqIZTdkAMbMGakFRgaxeTZBe2BtXUON6m5pwZaIzfyuFLpO/4VH7i/ohSWiU1eEG1OGE0klpPg7T1OT7K0/wuxOVbbqSJo/7av8ghPeIMUS5+tMcdtPvTl3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au 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=5DYByaFjjTieVakmh1ZORKaASEbDVoB1wTHOhCZ+IDg=; b=Ld6ZR719Z2hsN10YtAcZQT7kytYj8WKtzqZLaZAlJHKczb2wzML6DHhO5e035+zGfwTKZmcObS/Xq91icBOX7drDg3UJgF103OSm1qsG/AoOm/uspFWJQQQkm2TTz2ERoBNZtAo1d/iid1HT9GH2i31YWRPBlJ8Pl7u9aZ3Byrs= Received: from MN2PR16CA0021.namprd16.prod.outlook.com (2603:10b6:208:134::34) by CH3PR12MB9172.namprd12.prod.outlook.com (2603:10b6:610:198::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 21:07:40 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:134:cafe::d) by MN2PR16CA0021.outlook.office365.com (2603:10b6:208:134::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.18 via Frontend Transport; Tue, 28 May 2024 21:07:39 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 21:07:38 +0000 Received: from AUS-P9-MLIMONCI.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.35; Tue, 28 May 2024 16:07:34 -0500 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , Richard Hughes , open list Subject: [PATCH v2 3/5] crypto: ccp: align psp_platform_access_msg Date: Tue, 28 May 2024 16:07:10 -0500 Message-ID: <20240528210712.1268-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528210712.1268-1-mario.limonciello@amd.com> References: <20240528210712.1268-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E64:EE_|CH3PR12MB9172:EE_ X-MS-Office365-Filtering-Correlation-Id: 6eca8308-e7f9-4f70-45e7-08dc7f5a3490 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|36860700004|376005; X-Microsoft-Antispam-Message-Info: fvOyMmKkgn1QW4igloBtOzsDY1UXeW4X/Pu+NbDT+9X6XTIezs2Y+UcSDAx8tXHiKy2AZZ+4HC9Bqpf365ldVcUrHGSOjs045SD0dZVBmaYp2Rb9Jo0XSulYgNtqfp7Kh5yTwY/v9taqbovpHNjXaZI325jWSvvMT79aLCGJmhgZaTp6gwQLWovIlK+d+DqkH3tEPS/Z/BvXuxT8EkvhZEQDtdx/dJGlu8riwnpUZSDqbc09TlS98wbDVYqHwqtoVjuLOxpkdNdAEoaaJ6LwnZetLwMHx99DWxuVc3/6q3pSDAlYjYhzTM/CtkWm3SVN0frFnw+KJRqcZ9m2RQ1OSBnxZc40hOWS5rwsMLfdVv5f2ov2iMC69NQc6WazPhuHwJUkdd4CfZ5XyWeeUGSL8opFL8p1HNs+XQIiUns2AJWDmQL9QouzE3pFobn8F486Rwe+FQE8FdSknH9gVQ+XZM4vvCzca0lAJtetHUBXgJLIb05bA7vs72I3spjd9uFs+2GAxDxnhF7BqOp/IMan+dxM6AXUSLERXAdXPTObytYUtssy+v1zfbBv4RyxrkEMKGqaU3ml7v+kfUgS6N9W/vwuEL04WRsnjm+bcYSrjlz/ewVjRpTqhfLerhqLFw9MNXBJgztdHHy0KRKPelV+J8hL50JSFjDTn90+s6NGm/i6y8rB8WE87zbCt7DpnPAZwPXhdsOvGoZdRtyeL0Ux6nX1AnhowTv6cH1J1ybN/BklCIrZL42pR6kWUpS7zoRAzUaXEFs7C9M0O/46X83lti74SI5gU8+itvo7Dh2JEb0aezwZVNr8nH8l3wdVpewwwnTazltYCadFp0Nb46X9Y0hfsFz9gVxpZf4xjWfF7pG8JTCTeqqyPdzCYEdQqLKvCPixE9j1FMQ7SHpNRyUFqzY5SsNOapqTgOnBqGjwISIqxGd1Qf32drNfsg90JLokvoJMI42Forbr6Ncad2v4KeqJxfb7Lw+5mPQkOchtjdlaLkKELFx/z2diZaDTbB9AGvC1quY9Bw7FKWu5pc0ZuhREuW4IrPcZ4479GvqxVLbB9hpp/KvRMFyV/QosNR5iX3/N8LRhTlBqpPiolR8Bq3C59wJHhIpyq17h0N58KkBLdufAnARmt+5sa8h960W7DygafZnYSewlhnZbrkjFJLZ8JyAz1tRm2tJCjQPp9V584gmqHtWTsutoT4fPI1bQzTB7J4iavqT9/LSljgtQpUbVFnR/TTH360gsiD/Vl7cQQUB6reUrtnTh6NGJLvsgUCQIIm43k5Zqm1/qPYfDdgsr9Sn9Bgnp3PjiiAqTQCutW4jeUVHurrksGnatbelSTTRfpAKvXpbyIOqW9VAC/lgn+rz0IAV7/RRhKKIfHdx8U5Iy5+8h1CEKFF83hCVU 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:(13230031)(1800799015)(82310400017)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 21:07:38.4797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6eca8308-e7f9-4f70-45e7-08dc7f5a3490 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9172 Align the whitespace so that future messages will also be better aligned. Acked-by: Tom Lendacky Signed-off-by: Mario Limonciello --- v1->v2: * Add tag --- include/linux/psp-platform-access.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h index c1dc87fc536b..23893b33e48c 100644 --- a/include/linux/psp-platform-access.h +++ b/include/linux/psp-platform-access.h @@ -6,8 +6,8 @@ #include enum psp_platform_access_msg { - PSP_CMD_NONE = 0x0, - PSP_I2C_REQ_BUS_CMD = 0x64, + PSP_CMD_NONE = 0x0, + PSP_I2C_REQ_BUS_CMD = 0x64, PSP_DYNAMIC_BOOST_GET_NONCE, PSP_DYNAMIC_BOOST_SET_UID, PSP_DYNAMIC_BOOST_GET_PARAMETER, From patchwork Tue May 28 21:07:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13677454 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2073.outbound.protection.outlook.com [40.107.93.73]) (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 1810717DE09; Tue, 28 May 2024 21:07:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930466; cv=fail; b=BVgXlDxk+JcejoiG97eA95oCxLD0MwXnpFZmuoWO/OrX87kgaeIFqk/fV76kU9ki8UxxkhP46XxEGfmxVenzjqzXXeewHbLAtT4ujRIoLqHPKLl9LDMjtKg+ZXyTy656+HwvDTEma5A5q9Eml6LQK5f/sHKloBn11tRW6SiuV6k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930466; c=relaxed/simple; bh=3shmZ5d//7qZN2slioqsRi+XosG0hrS2ylJoXixjNuA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fg+KvSUuuZ6kxGUKMu8YCStKotTFOPGFf3zSNYghGroM1oDmksZY0VNo2BtAb3KOG2309H3Oy5gIBCsYpw8zBI96IOdolKs4MHL2PDWV2Di9B6cO6e5SD9jFnLrlPJhhOB1PTV5l36FshVbeMcq9bZNwOQi3ePV5qRT9OKh4fjY= 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=Z3SeAo0c; arc=fail smtp.client-ip=40.107.93.73 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="Z3SeAo0c" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JvRln6mEK+Rk4ob6w0NYFfobVSABoKWD6fOAv4FtFE5CBA3Db9TooKeAyfJKXUJ0KTh1PgMTz69o1OwgFh0P0IozYfvNwYyLu0aMUWk9x95Gu9rM1YwkWQVnHDLmYN/EjDKOfRQ/0vYoapQoDhuQIbiJC1CHsrBtN/2aSSIkxgKF2+z9WbYL8uep7eQev9O7R+Toa/kh4UE0oVS5SyQxIsA8KkJMJFXIOwyzALngpO9+GydKrKGbhTmiGvXao8ajmDackmlQuFAalWgVpwrSz9Lt/Amt5hP3pKJn3p7G4qns5R15uKR4vNh/sB9G1Z9ORML9PevctBsUO42el2eHaQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jmifaAvRtj5zAU+dGIOHQOE2YQbq/+vN0MS95zHT5e4=; b=BlfSwFDx4QFvPgsYnjPjDrYhHnxAM/49WVrKljybelWUFGTEg3ZucxKkjk1LjYOL4ukkWqdMrAciGOoQLMZZbXFFbKnxBDARATslona+bibiNQKBvpIgq4eFDgdQb+6zzzdYAsG2gmVdj2xlCFX4sP8uNbvd7wGUeWp4AOWEaXkjr77y2Puf6iA1XMC1LFOt9CQD4x6OlDcXqr2pMYUVwsTpIkIRj8MVKSYM2OZ/rwNL0oq1kmvARDQGoKsbfVxj5QkFmJfsMIBmlLGrwzrztnHPYE20phYmkf5M6cSCL4+JF16xAKpe4Afu2EXYSiIJjbwxTuLTWZCBUC7277Y3Cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au 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=jmifaAvRtj5zAU+dGIOHQOE2YQbq/+vN0MS95zHT5e4=; b=Z3SeAo0cga7oHrSQj3udyK+f7eIpnY9uD3vPo9j0xVgpvIqFDcVKMj9mY0VaCzGJjKwYCMH4BjoNXwFoE0UgCsdf6I+g+uePRm3AVOdG/tYOLwhtav4l+vnitLsDStA71ZK+PzRqUe0r94YRUrgEY/XUpv1tCt0f1Ee23byaQcE= Received: from MN2PR16CA0003.namprd16.prod.outlook.com (2603:10b6:208:134::16) by BY5PR12MB4290.namprd12.prod.outlook.com (2603:10b6:a03:20e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 21:07:42 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:134:cafe::16) by MN2PR16CA0003.outlook.office365.com (2603:10b6:208:134::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.18 via Frontend Transport; Tue, 28 May 2024 21:07:41 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 21:07:40 +0000 Received: from AUS-P9-MLIMONCI.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.35; Tue, 28 May 2024 16:07:34 -0500 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , Richard Hughes , open list Subject: [PATCH v2 4/5] crypto: ccp: Add support for getting security attributes on some older systems Date: Tue, 28 May 2024 16:07:11 -0500 Message-ID: <20240528210712.1268-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528210712.1268-1-mario.limonciello@amd.com> References: <20240528210712.1268-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E64:EE_|BY5PR12MB4290:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d7867e8-1b29-4465-4b71-08dc7f5a35ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|36860700004|376005; X-Microsoft-Antispam-Message-Info: 29a+1PSBzFDjeIKe+3iyfmokb0MVGODo0Vcvo6Yk3uFkQHi0QonJkTdodPCRgl9C4yG5YSnAbPAKEl5CDHzqLX5vULuqu6UL3vgQ7KwXWgNpaTROiLSkz5Nro3c+hMOp/OTa58HR46ranXcLkxs9Pp9tesSerXy9yhSsqcOr//n5Bxe5cIk8+UXBhHEhQApR18It060NFLRkjLMs9Pv3KXk8RxMB7ItWwWfW46zWUbnFFgRwjWTGhb/V1ozOA2LQfTfC8VqKRtjBOyElHC+TxFVDW1RRPwNzMoss8y/5EK+y390iqbcz0sKpj1fSlA6yK1AqaRmfBUwBBd9XQMdiOdvuaHY6qDWVTnKfXsEZQJRYx595QYCtT20/+tuMzqhyv248xW2asKFL6MvKy00/U4wNW+F+UKxEnU+DiCqo+iWMn5CN7sgrww6WTQlzxPZYXSrGz7ybHGPa1r2XDvSudSeHNjUEzKipVDoxjezA97rDakN1okXRhS6ejqzDNcVMJhT2gM/eQIvwWs2Sjg31BeQEaz9bACaISZvomTN+twyR+Pt7yqBJZYjFTok2YqcaQq8/S0WNRMXhC6P+UYUgdctjhMcsz80+1ZcUiNxLeW+2wGJ6WgIsst54LVtxtG6vLw3cTrsHne8HobRk3BJyd00CVoFAjn937py4N2gDiiBpSao+RMzb18V9lXNKn6LqtyZNWrQn2NQF87bo5wQrgKm+9pe5ozYRSTOF6H6N5kj1QCfQAqE5iHEZiJZTgjxgey19N5kmXi2X/Cr03k0zBp1CdWjBefD6GExz5tx31v2k2q0HgSmnAgpoTLVMthp2uhAlPgoSKcqAZYQhlSl9bTcxUwmjzgSGQaHdqSuvUCTC0kqWDQjRNn4F7NGOQGernvHPNiukmukt3w50nXmzbYwwhSKpYTsNr/PIeRg9eSNP2m91ynb1erlYLk3IKL47Jh0jlwKmxLCxLuPNXI1HbR5qPJlkwTsJwesLs+SAk655lvT3BqLsTr0K9RdIeFfx1S0L//TTNoFsABSU2gdsj+yk9emDtglzwSxcgZSmAnO/9l10AK/97e3GpP2x5BC3PKOcpjkL/MM2e4lbbQPZN0utCgsF2xM0ezrJveR0J4XpsaZUuR7lZCQT02rMVaVNvhg4zxwBnjbHLT7Lf0F1goCvzddOP+l60w413QUfZpYzN6cirk2IZwbLrtHGrRpedwewTr4FPaFR5T+qHEBWQ/xa4pxeHLt8/MeQPUG5AAtZi13KJL98e3NMw9Tc2TQ2vhR0bnPE7rpAnJCtiR7P21d9Bp5YO7OK5toPbPoUwhW49VKHg9A6xXxKnzD94v1QDUhYenfBSwS4GxIiF1/I+g== 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:(13230031)(82310400017)(1800799015)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 21:07:40.4640 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d7867e8-1b29-4465-4b71-08dc7f5a35ba 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4290 Older systems will not populate the security attributes in the capabilities register. The PSP on these systems, however, does have a command to get the security attributes. Use this command during ccp startup to populate the attributes if they're missing. Closes: https://github.com/fwupd/fwupd/issues/5284 Closes: https://github.com/fwupd/fwupd/issues/5675 Closes: https://github.com/fwupd/fwupd/issues/6253 Closes: https://github.com/fwupd/fwupd/issues/7280 Closes: https://github.com/fwupd/fwupd/issues/6323 Closes: https://github.com/fwupd/fwupd/discussions/5433 Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky --- v1->v2: * Move code to patch 5 --- drivers/crypto/ccp/hsti.c | 55 +++++++++++++++++++++++++++++ drivers/crypto/ccp/hsti.h | 2 ++ drivers/crypto/ccp/psp-dev.c | 5 +++ drivers/crypto/ccp/psp-dev.h | 2 -- drivers/crypto/ccp/sp-dev.h | 1 + drivers/crypto/ccp/sp-pci.c | 5 ++- include/linux/psp-platform-access.h | 1 + 7 files changed, 68 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 076c1d175b2b..8b99bbd4efe2 100644 --- a/drivers/crypto/ccp/hsti.c +++ b/drivers/crypto/ccp/hsti.c @@ -12,6 +12,13 @@ #include "psp-dev.h" #include "hsti.h" +#define PSP_CAPABILITY_PSP_SECURITY_OFFSET 8 + +struct hsti_request { + struct psp_req_buffer_hdr header; + u32 hsti; +} __packed; + #define security_attribute_show(name) \ static ssize_t name##_show(struct device *d, struct device_attribute *attr, \ char *buf) \ @@ -66,3 +73,51 @@ struct attribute_group psp_security_attr_group = { .attrs = psp_security_attrs, .is_visible = psp_security_is_visible, }; + +static int psp_poulate_hsti(struct psp_device *psp) +{ + struct hsti_request *req; + int ret; + + /* Are the security attributes already reported? */ + if (psp->capability.security_reporting) + return 0; + + /* Allocate command-response buffer */ + req = kzalloc(sizeof(*req), GFP_KERNEL | __GFP_ZERO); + if (!req) + return -ENOMEM; + + req->header.payload_size = sizeof(req); + + ret = psp_send_platform_access_msg(PSP_CMD_HSTI_QUERY, (struct psp_request *)req); + if (ret) + goto out; + + if (req->header.status != 0) { + dev_dbg(psp->dev, "failed to populate HSTI state: %d\n", req->header.status); + ret = -EINVAL; + goto out; + } + + psp->capability.security_reporting = 1; + psp->capability.raw |= req->hsti << PSP_CAPABILITY_PSP_SECURITY_OFFSET; + +out: + kfree(req); + + return ret; +} + +int psp_init_hsti(struct psp_device *psp) +{ + int ret; + + if (PSP_FEATURE(psp, HSTI)) { + ret = psp_poulate_hsti(psp); + if (ret) + return ret; + } + + return 0; +} diff --git a/drivers/crypto/ccp/hsti.h b/drivers/crypto/ccp/hsti.h index e5c5ceab9973..6a70f922d2c4 100644 --- a/drivers/crypto/ccp/hsti.h +++ b/drivers/crypto/ccp/hsti.h @@ -12,4 +12,6 @@ extern struct attribute_group psp_security_attr_group; +int psp_init_hsti(struct psp_device *psp); + #endif /* __HSTI_H */ diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index 1a7b991c27f7..0a01ad134609 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -220,6 +220,11 @@ static int psp_init(struct psp_device *psp) return ret; } + /* HSTI uses platform access on some systems. */ + ret = psp_init_hsti(psp); + if (ret) + return ret; + return 0; } diff --git a/drivers/crypto/ccp/psp-dev.h b/drivers/crypto/ccp/psp-dev.h index 02a7c94c02df..e43ce87ede76 100644 --- a/drivers/crypto/ccp/psp-dev.h +++ b/drivers/crypto/ccp/psp-dev.h @@ -78,8 +78,6 @@ void psp_clear_sev_irq_handler(struct psp_device *psp); struct psp_device *psp_get_master_device(void); -#define PSP_CAPABILITY_PSP_SECURITY_OFFSET 8 - /** * enum psp_cmd - PSP mailbox commands * @PSP_CMD_TEE_RING_INIT: Initialize TEE ring buffer diff --git a/drivers/crypto/ccp/sp-dev.h b/drivers/crypto/ccp/sp-dev.h index c4e125efe6c7..0895de823674 100644 --- a/drivers/crypto/ccp/sp-dev.h +++ b/drivers/crypto/ccp/sp-dev.h @@ -29,6 +29,7 @@ #define CACHE_WB_NO_ALLOC 0xb7 #define PLATFORM_FEATURE_DBC 0x1 +#define PLATFORM_FEATURE_HSTI 0x2 #define PSP_FEATURE(psp, feat) (psp->vdata && psp->vdata->platform_features & PLATFORM_FEATURE_##feat) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index dd31e791156d..248d98fd8c48 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -397,10 +397,12 @@ static const struct psp_vdata pspv1 = { static const struct psp_vdata pspv2 = { .sev = &sevv2, + .platform_access = &pa_v1, .bootloader_info_reg = 0x109ec, /* C2PMSG_59 */ .feature_reg = 0x109fc, /* C2PMSG_63 */ .inten_reg = 0x10690, /* P2CMSG_INTEN */ .intsts_reg = 0x10694, /* P2CMSG_INTSTS */ + .platform_features = PLATFORM_FEATURE_HSTI, }; static const struct psp_vdata pspv3 = { @@ -413,7 +415,8 @@ static const struct psp_vdata pspv3 = { .feature_reg = 0x109fc, /* C2PMSG_63 */ .inten_reg = 0x10690, /* P2CMSG_INTEN */ .intsts_reg = 0x10694, /* P2CMSG_INTSTS */ - .platform_features = PLATFORM_FEATURE_DBC, + .platform_features = PLATFORM_FEATURE_DBC | + PLATFORM_FEATURE_HSTI, }; static const struct psp_vdata pspv4 = { diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h index 23893b33e48c..1504fb012c05 100644 --- a/include/linux/psp-platform-access.h +++ b/include/linux/psp-platform-access.h @@ -7,6 +7,7 @@ enum psp_platform_access_msg { PSP_CMD_NONE = 0x0, + PSP_CMD_HSTI_QUERY = 0x14, PSP_I2C_REQ_BUS_CMD = 0x64, PSP_DYNAMIC_BOOST_GET_NONCE, PSP_DYNAMIC_BOOST_SET_UID, From patchwork Tue May 28 21:07:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13677455 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) (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 98EAA17DE36; Tue, 28 May 2024 21:07:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930468; cv=fail; b=bh6koC5LQO1k6wE46HGFnHVWEKitxBfd1ascj3crSzt5vl24ESl+yPnnqa3AyJKiP9eLJnsYhFwDkJCYlrGSwCUiRM/PK7Fx8ZCyrjT3vc/FEAJYT7rhvA3qVLESII14auVWqr56yriv61idOntKdgRk5kuT1gCQLGCbgQk9sEI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716930468; c=relaxed/simple; bh=2vNSvuEeughsOfGEix/zWS2NTHvSnXsbH16bexSPGUo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GWIp4s0D/5IsVqtlAIroZvgnMlr4fDfrNmmAKx++Qywdg3D9Z9Z9KqWFV6lLnA8F+y3EAQLiUHCKQhjgNQnD9XME/VlF6icimXnTZAyg7Rt8tb1XIyzGmVwRlmAF2dv5oX/yq7FEZZDeuEOD/C+PbstrzWieZ31k1QyCgMD4a7c= 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=kp7yiksx; arc=fail smtp.client-ip=40.107.244.78 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="kp7yiksx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+FO0WcVM911VA8DxrOURtb6zLKvS3bneqcNxe8znosdAnOo3bRYmsaPN3h2i6WH6bQCz+zPpPhPpAFpaNBNmMACy2zRfEdZ2CDhlmF6jM5tWeP4M5P7cn1ZF2Wt84CC/Zdcvqch3gzUmBTFpGQuByozDLh0rAf8rq1x9XGW05E/AniTBLytCtAm2fL6g9ptI+xyTunkoy52I8h3nuAeiHV5NLk2bMjMZlHAhf9mfJA0nn9/ti2MZjHWW8HuBnPQIYPq3jaME3qULaZMRyLDk5/Nnt7O3PcKQoQjyvkSTMywS90YKNKJVKOoGuYChaZPdn7owoEfb6Qw0Ddt7wC4Xg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7wy7Tu6JuM4mF/LAM5XeHS/VPLYE1E8iFBIIr6qWKwM=; b=Q6XNGHZMCwnbURDpo923AThEQc+Txad+j797rq1WQvVaSsvE2rYIAxkz/i5eTdpnLJHoKC10XeE7dCJXwLfa5TIZzvMV1FwnsBx0ccn4MDsxrysqd94STb9gq3cToCYFKOtMRJROn+WW9PvIXamu20JrpgmV7Hay0O/VkS/+Ef8oJVdkGFiIfFIkZJ2MpmNsUfXmuDg8Fpvven51OJKBO+Nxkl6TK7CRsLHWUhqOXXtKbKozVrY5yhEu1VNjL5+D4La260OYsjnrRIp3bBeHbityARWPjIiyceZx5XCEHMd7j/HILjnYDQMlEvlEf9fFSkCz09G/ZVguFwBck4kF5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gondor.apana.org.au 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=7wy7Tu6JuM4mF/LAM5XeHS/VPLYE1E8iFBIIr6qWKwM=; b=kp7yiksxE7LWeZK+s8ERKV0Zmskh2/7a/hfGF9iVMHI04KPZwNQ91owSKk6hMBSm4No3+BuqRZtLOgh3bY5I6XLILSrWxQ9R9Um3XarIgIhyAaRSvbL52ioNOwAxOiGELE80os4oXXPj5M/mQvATHi2OJhZcqPRHgpwRqK56qQY= Received: from MN2PR16CA0002.namprd16.prod.outlook.com (2603:10b6:208:134::15) by SJ2PR12MB9116.namprd12.prod.outlook.com (2603:10b6:a03:557::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 21:07:44 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:134:cafe::70) by MN2PR16CA0002.outlook.office365.com (2603:10b6:208:134::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.18 via Frontend Transport; Tue, 28 May 2024 21:07:43 +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 BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 21:07:42 +0000 Received: from AUS-P9-MLIMONCI.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.35; Tue, 28 May 2024 16:07:34 -0500 From: Mario Limonciello To: Herbert Xu CC: Mario Limonciello , Tom Lendacky , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - DB..." , Richard Hughes , open list Subject: [PATCH v2 5/5] crypto: ccp: Move message about TSME being enabled later in init Date: Tue, 28 May 2024 16:07:12 -0500 Message-ID: <20240528210712.1268-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528210712.1268-1-mario.limonciello@amd.com> References: <20240528210712.1268-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E64:EE_|SJ2PR12MB9116:EE_ X-MS-Office365-Filtering-Correlation-Id: 1dff57dc-d872-40c6-c343-08dc7f5a3737 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: xva4elvqeWxBB0rb/CjIFRu2Zj2CqaeZx5FbGQwQDm1U9i93f+tjYhNyNj104/TJV8PjZZ0DDlhBpnIk0+VERW9T7DfVBt12tgeTcjttu9plcn+yJ02kdGmV5IPRuOwGnEMn/N9yfXpIoUQOxxGIldESBZJQvtKoLkTzld4QWIGakAhcZJxBOT0sv5uvzH0zEnOCwgCZsxiBgotqDrmCCmUCmmcUXvCtvH67uli1DzgDchG2C1nXyOhxD5/VrbRCttqZK81f7BQLbIu2eY7fOQlacYaTyryTMoWGxxY7QxyiecXu+D9xD3WpHFj0Jq3YDJ/1M4yUsvy+ZCGp/K9oxCgHkbiYgVeHz5aQr9w5SFuto3Tcrvvip0tRFADMhjG/1M9LIXYve2d4ORt16NrlisSgK7DSobw2JZjCdSWyb1AelCza3keskfm1k9n8VZQJEZlHokbxvnKm2LeGjN3DcFbRdHcAQaEU0v0+tIv4SiaDHmPy1nzBP9KjWjxas6ayau7LNnZs7KC5jBpizWluITmn0vxMEQ/C2AkqxLj1NgftZW3Vt28hYC6z25d6RBjnKjnPsG0gZtMmdfqW7chwZRMs4SEotiPrrL8idUHrvZCCTowJdnUEa0MJIh1X8QGo5bZrI9Hwk80kqU4PzkEg2KsXi9PULhbJrxwMMzzrr/lLUcQKeGSwRr3ni8CrkoSWUwPgXmWj7RM6pmYEqQv+si4A8SQbn+3vHSiMOUkNqhfwck8sKR0tgcaF25PKzmZs4qF7B19DemjeaLjh0BSYSWPE0SUL3nakjBefZmd/WmIEuZXbT2Ww2HWgXuAnFzLzV/5hFua/1hR/0xwSI4XLTnZrI7E2zdINwo43kpza/qZzDQzyYg/HCniegvh1ylFCxVlfF8AKnAxSmbVscVW4b6CDDBkv6mkeQPhfn9HinQ2KemRQGzi/OZg2kC6p4LDohxl9VefUs6xZOCMjunggXQtSfwdRnHdIiY1H6FznJLf1YWvQWP/auosqIVRx/rk6woZSInc2Jwv8lNq99nzyqbTbyMjLTljDkPY2VGoW+G6xGxiGC4IxsbGBR+zA+670IJckZAsDR1s56fCRTAQCTp1ZXixLwfCLyuzdE4/oXYh/AKjZzTyVxU25lNQSn7ojqdFc67w3pbbBClj9nnlWXo5/0NnOGwEwMPtCZIOItOa7mjAOKKh6LFR+OJl/uxCWPeuGhJM90v7poW/y3BA1NSHkwpsi67NErZzcNLpp0VM3GF+WYJkDxoGrKAH1zrgrXcdqZk1xG2IBo83FqlhBm4FFZPzHtFC4awWV1ni2o3gmcwWndVwL4rYzVF85CUT+lFKsmxOKvhXzrybs2Kb+Yhj4P8cRvpx6UzNRn6h30tTaTHE1bLROs8He4X5fEGbT 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:(13230031)(36860700004)(376005)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 21:07:42.9640 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1dff57dc-d872-40c6-c343-08dc7f5a3737 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: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9116 Some of the security attributes data is now populated from an HSTI command on some processors, so show the message after it has been populated. Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky --- v1->v2: * Move code from patch 4 --- drivers/crypto/ccp/hsti.c | 15 +++++++++++++++ drivers/crypto/ccp/psp-dev.c | 8 -------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 8b99bbd4efe2..1b39a4fb55c0 100644 --- a/drivers/crypto/ccp/hsti.c +++ b/drivers/crypto/ccp/hsti.c @@ -119,5 +119,20 @@ int psp_init_hsti(struct psp_device *psp) return ret; } + /* + * At this stage, if security information hasn't been populated by + * either the PSP or by the driver through the platform command, + * then there is nothing more to do. + */ + if (!psp->capability.security_reporting) + return 0; + + if (psp->capability.tsme_status) { + if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) + dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n"); + else + dev_notice(psp->dev, "psp: TSME enabled\n"); + } + return 0; } diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index 0a01ad134609..1c5a7189631e 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -157,14 +157,6 @@ static unsigned int psp_get_capability(struct psp_device *psp) } psp->capability.raw = val; - /* Detect TSME and/or SME status */ - if (psp->capability.security_reporting && psp->capability.tsme_status) { - if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) - dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n"); - else - dev_notice(psp->dev, "psp: TSME enabled\n"); - } - return 0; }