From patchwork Mon May 27 15:26:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13675515 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2067.outbound.protection.outlook.com [40.107.244.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 22802D529; Mon, 27 May 2024 15:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823637; cv=fail; b=SdETiM9g5EMwUjujb6W62Sy8fnwQPQPd58gPe1RYZpOIMsKnoK4uynf6FvJ8N0JITk2YIvViMwuQifwaS9M+rpxFtP6+5t7g0irtH1J9cA0BlSmHy9fq2Yi7k4SjpQDhi3ghQoaeM4g1q35xoCBG4/NWaJSh4P+YV0GusUVTuZo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823637; c=relaxed/simple; bh=KazZvZaW8z4I/+7LfOFeijHjWdXQCX+2ZN1VVpaVM+0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hk1oX9lLvbZ2wpifSEgGoYQPnkvZnWdl/47VDXf6p0FnNfO8Hzd0dCtQZAIas4JAgoEnRvk8fhX0mpzKK+i7lodG8AzeS3ETmIh0GyPEH5NwwU+D5+VWs3z3edRPh4M9e1JKRYBM4fMC1YrWroNtopvPkUxnU9GMKzAsum9pQIY= 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=yYSqdPb+; arc=fail smtp.client-ip=40.107.244.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="yYSqdPb+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BaPfiW4AeoqGjVf/W9iw0N4bXyouS3p5pbhbFvQQ4WRobn0ptdMYItZeTFYEfEbLiJztrYIJDdQwib15JM1RekNFaeAkeJkVI4Fe94QI1ozhbg9EagqicqWhnh9ZD8dq1rZylQAvhJuna3Y2SEt+B/Trj2ZPbbdH839hrCxHALB4ewQWBm0c85ne0+1z4jbGe1IZU7g6gzqYhPJorUNf/y7BrTO7yU5lPgXitMGk1byeohJMg9C27rD1WG+L7B4Wi3XPr5G0ab1WcuFD8tgWNVWsHHRqLMZHxqQMRluYXuo3mlIGsH55LZHfphdDCJXqVhRBJncvlofHjn1bIZG8ug== 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=5brGEfqhFNeGCOUQCafIiqGssVDX4P6mcmwuhsnYAg8=; b=NSoc314+AFlQ9EKxhDJdlFQ+6rIu4mhI3ve/kjycwB69ybCmOH8zH5VjMfnY9dRKM1lrw3/L2n3KRV3A3kklpyc5h8TVV863eq9QRcxyrVfSQLvbajNVsNBksU24H03984yQg/5DLeBi/0cWROXzEEVcH+QpFAYMyABtM4ekuE+f8Gjfv3CAG1N/W7W2BBdlX4r/4Ufkyq9CsCzCPU70jnzKpsK5/lnBuDEL9F4E9nZuyOCnq65w7hVqXIH5hcXeMpaJFPxCi2Es4W8U2JEKwZhg1fYKsYbdAOzHNpRjzhcKzdsl+oEU/QFsGXTVym34U7p0Wpbx8qoRmicK724tsg== 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=5brGEfqhFNeGCOUQCafIiqGssVDX4P6mcmwuhsnYAg8=; b=yYSqdPb+Lkq0dpuNVfTPfsfXqkohfK4R3nk1tmJ/ZgDJ1E6WsTO4ypw4BJzFw02/SZSIh92uY0jEDEJLLE/A1nYcEVZa5aerlzdIVHUGYd1HG827n9WOKIYeM79VTD3VvTU8pEl01qvK5hqZutM1WVIxXMcGnEIqrKPYIckDeEw= Received: from CH2PR05CA0006.namprd05.prod.outlook.com (2603:10b6:610::19) by SA3PR12MB9177.namprd12.prod.outlook.com (2603:10b6:806:39d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 27 May 2024 15:27:12 +0000 Received: from CH3PEPF0000000F.namprd04.prod.outlook.com (2603:10b6:610:0:cafe::36) by CH2PR05CA0006.outlook.office365.com (2603:10b6:610::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.16 via Frontend Transport; Mon, 27 May 2024 15:27:12 +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 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 27 May 2024 15:27:10 +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; Mon, 27 May 2024 10:27:09 -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 1/5] crypto: ccp: Represent capabilities register as a union Date: Mon, 27 May 2024 10:26:45 -0500 Message-ID: <20240527152649.3722-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527152649.3722-1-mario.limonciello@amd.com> References: <20240527152649.3722-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: 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: CH3PEPF0000000F:EE_|SA3PR12MB9177:EE_ X-MS-Office365-Filtering-Correlation-Id: 80e22b0f-89b9-47d3-bbf0-08dc7e617a5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|376005|36860700004; X-Microsoft-Antispam-Message-Info: j3hGeWoJJTV4BMoq/iU56ZO4yF2V0LJN3i+sJwreFu84gNhSrMx+C4Ruaron3JmLW3j8vrVTRGlWGKJASGnmSA4te6RuBAqAUmIhoB6a3r/IzkKULJSEkLjFNJxIczE3oLufetzENrrbMuJah7fUBC1LBr5sBjrw7Kq4gNR25y6btxC+vDkUNhGkMczfjdD9qxnt6i518LTYQ5Lu/30aJFEowNuWPWVfBhRfGjnCptpIu7ZTJo5JtMN/Z6JcON7VlDxmM/LpYYYwwsG1jA1seUJhHhqgpqrFTD66GY0cGGwVq72HeEBj+Tpux3M/wmRNsL9AvMeoGVAYAYla5Wwz/gxnGij57Z2p8Ea4jO6+q2KBVzIE30OB+8O2UnQJ3bAZQbjE1S2M8MJHEwLOvijbm0SdsRRNs16ACBQJx1txjzPfvtXOS/jho6scpg+CE9KWmkeU6nlIoq6ptlDn8ACNGpsWFIOyGQKJcAlKXBM3DUnRICUyACq0R4/9qD6t6P9iMs/kz85kSZJdtDlWoPbffi/uuCe63LQL05czHbssBXFqo1GaZbdDzvgm5EajXWlT049hGcKDvNWtXCraToWJMhY4LMXND4G1aKn7SYYB/z22T6aeJXYmwsHPOIyriSzCRIWpxi9AM8VCu0DYubQcHCKTR+pq6lsTUYt/mZhFhYUNgGMNg/ye3+JyjzasXDigklBh5qj8rzpDPEkGLcrvJww+j33ixc6fjjjxU4/jrC2UD1bNBhwj5QQ3imYpNsgsix7Da/NeEszIXub1QPO7NLYXcZZDnUcEmo2t3fWXBgT2SbK8jKLzPwy41aw25SQsHd1Hs8mP6G7EqpJZRCcJrdt8cn23+YdKLNSj3obWudDWqr7bZaLOvUMV+ODtSUmbIpr2DavKM5YTzsLhJUHKvrY52YbuTHgi4e72m8XWEhEeplHbMC1OmCwapGYa/UriJL7UIEHkupvVdivvXXPnjMFRm3S+2vtIgcEAUe6hGRKxS1zFjuzYbhNvcm7kjMOqpUTg21VDrOIWaZEdWOIhu4Fz3OeBu81BPFOfgu0+EWSLb2sYACYRLtvlTeCst2jIZWQ7aJXSDxTHitjFD8u9dTmUXFE0HA8w2KBir+vxlUwOdY8fFUbL1pCnIMg+NolQu8PKCca+PtGcRmrrWGf0iLwiuuCeWxKNvhLximhJlP88a3aoFwhWwXx5w7/TzD/wVoT8RqV49lhOqZteK9oxqvhEWUZ+hSCvkmlqEsVmJ52ryoZvgegnmrmDwSRY1O6JdNZ9mIAKpvMImd0BZFBsHem0uQjkStNOmMBogAVhbp1peA4k0p54mSoUqLlfZxJBN1yGLtmuVk+l5JRWzx2pzYey/X7PeJYB0D7ScTyUYDWcqQED1YOgueOq+ALftdnb 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)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 15:27:10.9099 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80e22b0f-89b9-47d3-bbf0-08dc7e617a5e 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: CH3PEPF0000000F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9177 Making the capabilities register a union makes it easier to refer to the members instead of always doing bit shifts. No intended functional changes. Suggested-by: Yazen Ghannam Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky --- 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 Mon May 27 15:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13675516 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2041.outbound.protection.outlook.com [40.107.92.41]) (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 350C461FD0; Mon, 27 May 2024 15:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823638; cv=fail; b=O1b8+CGkF2IuXawkHjL3GjPBcSNCog6SJSTtHmy5rxP9rf+pi1OU0m5dvIjrDsss6v0qKqvP7RjcQEdXXJzTZ4zxuT4KAlpexyfA5Vx9ORWJzYH9WWGak5BxR2ZW/kv3vWlZp6mJiR6VPuiwr4RsSccrs37ahgFI3hnk9iRZ71Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823638; c=relaxed/simple; bh=YMILWaOGRWSMBvrwhfePgXZ/ZIjbeF/602QMlaOBQSY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BBUhPnlk/LNZXl6X/Utcaa0KhMBn3Ng8PK8HkCHPqTH4+pWpnAQTcVrWQdxnImxc4yOBiLAnK/likRMY5jqoJLmaFs1BhOgt1behYq/x/1970ceRtal2twppUR5g8LceRr6pzecGunHkzK5Ah3GL3mRhK5HTYH6SrHoWsiIUYsE= 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=cIEgzpTi; arc=fail smtp.client-ip=40.107.92.41 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="cIEgzpTi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CkpEYDlOjA9YmDYmagmp98+QihSyD78rycnnxuihCUlchTa51rsMu8EMyttFWPG0B96CqJtb2P/6nMiIUUYRqygGA+1+pMWbzyHFtdnZ5YbY1pEHAyGwSe9PG/2FXN56+vUDdproCGfvk7u2ToECYqrItsu+mCvTkD9Gv2mwz0Qw7ImFXRMUyNpiD5mXzdL94Psjz/ZRCjIjR5Wq8ij1fDo13RZXbB3GqapVRocKUNhSjLGUQRHLCHhemxHyduZY2eyzxtbR6saNpJltQi/o/L9Q1oJHMO7WVKosK7QncjLe699EstqXBiqoaG1b2RfnwaQLKG7JWPz/HXgXlv2njw== 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=72JkkJTr3RB0Amnph3KZDQGNAS/VnqBT9ay/HYgD3FY=; b=LqDaPbWsPwdguwqfvrNIqfU70i4CUNvEKRfGnMd02NT6lsNszT35Z52EIJ4nsIWL+SpASqyrxyTgZ6ErWZ07zc9OuMrcsh/0tRstJRabLkdtx1JyBXnZZy7691b2MAsfIvT92xirnxetNq5YRm8JvsqyuHZlm7OrlamiF5CMx1rfJTzNES0n26Wmm4jqv/NPbg4UaYSZachCJPiPL8bifAAbA4M7PhEOC1OXi/iLkrXWt7xDjv5049nDw3EOeMLc8WlbvEU+tehPQ8JG82uUomwgzxkb0NjAcLnpmqRmxBwvLEOssHLDmTCETJrFYvCph7pgayoqgrRpA58jjgCzYA== 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=72JkkJTr3RB0Amnph3KZDQGNAS/VnqBT9ay/HYgD3FY=; b=cIEgzpTiKgIg0VgKJ7G4yUVzvFaRyUiwG1b2k6l1kIPtAPRa/F9ceJbMF3iTwAPA5jOX7nJDTFrAEM3SFiQLRLuyU5wAawmJDpSjjb49X9j2rxh2j+6qE10rx7okek8qqY+T1+fHbIVwY5cp6mOC01Z9EUMv/FW2wZOyFLeq+Nw= Received: from CH2PR05CA0016.namprd05.prod.outlook.com (2603:10b6:610::29) by CH3PR12MB8401.namprd12.prod.outlook.com (2603:10b6:610:130::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Mon, 27 May 2024 15:27:14 +0000 Received: from CH3PEPF0000000F.namprd04.prod.outlook.com (2603:10b6:610:0:cafe::2d) by CH2PR05CA0016.outlook.office365.com (2603:10b6:610::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.16 via Frontend Transport; Mon, 27 May 2024 15:27: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 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 27 May 2024 15:27:12 +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; Mon, 27 May 2024 10:27:09 -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 2/5] crypto: ccp: Move security attributes to their own file Date: Mon, 27 May 2024 10:26:46 -0500 Message-ID: <20240527152649.3722-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527152649.3722-1-mario.limonciello@amd.com> References: <20240527152649.3722-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: 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: CH3PEPF0000000F:EE_|CH3PR12MB8401:EE_ X-MS-Office365-Filtering-Correlation-Id: ebdd041c-0474-4efd-0fb8-08dc7e617b97 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: z67hZx7S2BJKWS2pNtW4fbyanUMAJHBjETWarB+x0d9K5kY5Hxa5IUFRGP62lxYXTWkg/R+Bp4fwzHcGBEwaTm0qLiaSVck9xS9jSYvcXI+g3PuVt18pbrdjzFKil+G6d6S9J+rN9Nntbi0I1QYeBjfJbQ4KYBnbq+aFZ0iQPLuI3lm5Yvt3bLwqtM6pQqpCnw3xHoJ9+N4uXpuU/DTQ/MpPAPzfOQDrPKASe/ZbA81JkuwAwxrdmuoAEvlxoQaRRoo/fT52XkhWgde9LIs2o4+GzQEUhGmCZ/VwtP0NTQTy5mskqvUX/Y9CBWsrRNwKOT8phTlPuVTeWHs8OjKsKtufcu3Gd87LWpaVe5MIv1JFl9ebxiBU2WTAjmozMPZ7biOuj2pp7Z4YdiDcAtsdTzavzMW9Fq6h01jyOD4AqA74CpNdHAnUrjNoBLdiEccq8Fq1vIsOjqIT0PcqClGstJ9m3u49AdC9yVVn/9sdOl030f5u6bWgXeczFHIbrSBVlNLrgjym36bAzby+1YxMkDBXP7T+AaI/kMu/CXZhO/jZjuJaUvUAF3B0uxuSEzjz3TACGx0znBX6NJGfR9XAekqKbPVaG6ORLmIzrcOewtaKx2B0utBiGUSk630QNX67Sg87t5lPZKOM+1XsGao7Tq9LbILOCojYUUzKnNbEwJEVw6wKj0FOwfAMMlPlfW2S0vUQA6MI5KY3yQyQVy/ydQhaSuQAaOtqiG0RyD1G0usDSVUxUVa/0BjxQ+rYkKsxuYfS5p8DiSYlbRdAtg017frWn6ApWvTJ6L/henN7/ty174yc51HkwxKOEu90OoLJ7NdXXG6Z9J1C2rKJZ/hAA7SqJHuEXTDU7rM3merM2QZvitjqBD2kNUQHLqhtTpufbNw/bCdYq4fszuZODmlnR9BFXgfmHIWVoGsYiDlCZwOI2K7ZRfg6TpJwnSahyd6HinduPsXYqKBLgHPKhqkHLTDLX8R83cPhP7wxwBd3p22hD+JpIgUgDrx9+5FzgWK2MiseN4vVvxLH4+wIOtXCTHShRX4vnSeL31ZlpgPRiPknhkvpGVIS3kIlnrCp1ZjZMKVfx5ebp7h8eSrfYxe5gs5cUTCUoGP1njtFh5C0KbH+GKpYkcf0XBv/4AizzX/4QT9sg3tSq0UNN+epqAjwWcLRRn/mIxqvT/HPpCGGQNgy4tSh7A2LtxrgZQyvGO2ZY+JKAJyy44SZupdgPOVM7B1tVMTCjk1CdnMLcsFLqR7+pene8S1RFWuttUfKaupIyaCHzF2Lwlwpjuh/YX0V5tvif0m3z+rA+i5gUF+NenvKeIJOMurzmWT8rwWWNm7dme4z/p/0bQRBjCkKY7/1t4OKdmGGI/d7V4vL7zLWEvxCoeex9FGQ3WtSH1KyH3O9 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: 27 May 2024 15:27:12.9567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebdd041c-0474-4efd-0fb8-08dc7e617b97 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: CH3PEPF0000000F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8401 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 --- 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 | 56 +---------------------------- 6 files changed, 93 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..2db46736a4d7 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) \ From patchwork Mon May 27 15:26:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13675518 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2056.outbound.protection.outlook.com [40.107.236.56]) (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 278CF155C99; Mon, 27 May 2024 15:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823642; cv=fail; b=NXqxOH9goalyW3ge7xn85LKxHnZ6gjfp6DoT6413cEiklF1E8rY4eszbxAbhESaEw0l2msx40vgbZot3kR3rnBj7xNT5ijTCvAiQ9hGTWeO/rFpkAIKiIsfQLrJs7Zhcb5fCXGmfItASAR/sggoqSudrsl1EVcaRTCve26WCF6U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823642; c=relaxed/simple; bh=YvGVSI5yLsVfrmqvZo9WsBMZWpMDeBIHDrJrwFLMFw4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lS9D3HjffizLsQwsNVSyMbnZFzaQbjmO3+eTqspTa7j7ZG4j6zEjofPW5Vq9qeB5MUCcrEofMle8vishgToU7To9xg2O82S+GN48AVY49FHXVPEP5FWIzEQUW2buzFSyC4dfpu1535fpym0PranNj9Pin3ysti+ypkTLLBpA23k= 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=NJSzqBcZ; arc=fail smtp.client-ip=40.107.236.56 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="NJSzqBcZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1EtETxHY3lntpk+hoQ86tg9F2WqfqzMJfqo5pQ2zeYcuzsWrrFcJz7i2Vjaf9Q5Sr6cN7D/VTSfkuZod0tNqzW0OaG4OW63/lMUSkms04ZI6zD65MlcfELI4N6gw+moDE0Tu6a/EeV92iB7dLbFDxpWCoD+a3g/QvKnCnWTsHRREFfJInyDO8snTOydhz/977AgZxOrAGNpMh251GcFr3KvpY7IZ0y+0Y3MvggnMv7xa7jqzquLjhpNnZ4jduJTsnzKnc+jCk5K1YeanID8F1RjGuC87KOAzJ51Sw/QG9KOUlIGzEyYeMaWA6DoZDnKps09OzGQzV2JLmc0qocT6w== 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=P8WekG4SsiDrYTszcQi305jWDJBY/UD4mb+BW9y4IkM=; b=JUY/vwUuCyliHg1GRhrUG6pZSKRty5w37MvXm/IC852pKPPDwj+FozszP/LQpcFlemnG4bs11j7TZflE4fcRVHfmMWSwMbWK0K0dJpRoJXyE5kzteR2uwgqdasOzm1VauiJrkyyeXTwU9FdzbaxVP2KTS1oz+AhAVsYvInvphutUpbiacijNmrhrfbb1ehIovyxVyDKHgomsitSsBXUkol+suvAmovGh7m49HIhPQDYv2E44WCDYwMiGg594ELOgJKS3JleTsvJX3smSE8KaBzim9x1Wu4bYfYpNKMayJ+EKaZN6EV2mSw62u44uazcMI/MtZ8DNpPAtEcA2ZwwqRQ== 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=P8WekG4SsiDrYTszcQi305jWDJBY/UD4mb+BW9y4IkM=; b=NJSzqBcZbcwWmork69HJDUiTdVYwRWjDpUl/O+7Zx2hqF9tAKdoX+K6AC+Yl8k/jaf0Pxkm/jgiS34XRjo2ZwjX95t0LgMzLqSNpGXJAipJue02G4CqZsw5vQuADLGM5FR8hEMB6uFw+BYvVhXkHWB9zWJgds3ZcLhVJ7yPm1lA= Received: from CH2PR05CA0025.namprd05.prod.outlook.com (2603:10b6:610::38) by DM6PR12MB4154.namprd12.prod.outlook.com (2603:10b6:5:21d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 27 May 2024 15:27:16 +0000 Received: from CH3PEPF0000000F.namprd04.prod.outlook.com (2603:10b6:610:0:cafe::21) by CH2PR05CA0025.outlook.office365.com (2603:10b6:610::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.16 via Frontend Transport; Mon, 27 May 2024 15:27:16 +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 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 27 May 2024 15:27:14 +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; Mon, 27 May 2024 10:27:10 -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 3/5] crypto: ccp: align psp_platform_access_msg Date: Mon, 27 May 2024 10:26:47 -0500 Message-ID: <20240527152649.3722-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527152649.3722-1-mario.limonciello@amd.com> References: <20240527152649.3722-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: 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: CH3PEPF0000000F:EE_|DM6PR12MB4154:EE_ X-MS-Office365-Filtering-Correlation-Id: b6e70b9d-2d0f-43e3-6882-08dc7e617cb0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|82310400017|1800799015|376005; X-Microsoft-Antispam-Message-Info: RZDOvD8NNE4PdZvXuWGlBoh9kgJssJsCnJ63hfIiSrenWkoPYke9QNsGRaPPM+pm6IbtxICiJ0e3n3TXI9eaQqOnY8ETpZcFAbhKWGBqImcZhVuPowbKrcJysbSfI7cfZsLs2kWsBRMA/ArbZ+wC1b0+zl9ToEM3rEus2xZudD184JKIlOZQebks2CLootjvIV545Twi54j1NcEZk0cfuii4vXQ/LEsBtPCBoBU+LtIj4qQ57eQZCaPbUuVugqdTfqMqHAYR3lSLahQSE0qXn0YDiQpjFkWJsg/t2NbwnD1yk1ULXJRrKfywQq4//xUdqPuDty5OK/4V1C+g7XnfJe5sOi06oVoIuHVHMhnJ9nobhrjZD7VAZBBCa7/M8qISyLYx93v5dOHITitwmEdm7wXLcbS9rQpVz9qoPQL7yn8l1KrmQcdieCubf+1M34fSZVaDCHAfyV3Ae6rol1U5j5/hFQ4fOgQjAnb0jMTx1A2Zck9EkbRr/SQSVMPcSe88ReQlxkwVS0itufEbcMQom9t+dvbXvU4sI/t2fNV7x4B0G7XW7ZaejXrF0WnDwLk+jWa/lVnmyEYAcH9ye9AXIJ/uD2rnVEnT1zQcaxMvNMJGVJ/8MNlKT4i9l9oRaznY4QmWQQDsvtvqhs+5l1RFKFbv9IvHKjG9FEvKHerJLbCYvI+2VXd0hYVxR4z3Qm1x23ZZlWayCIXsxdjRWuB2+wals7QtlDBM1a8ftVH2qixcsZ3htE+7RqgDoi+kx/dLoQsjPRv3waiXNefFhVGs+NHXi7rNZJM4Fvek9pr52T81iefkiDnWe9q2sPV9NH9akSeNxjHPXQih81HpWkOKHeP5rrxBTlOUymzKQFqEkZaRQSbUnZg14DZpLGXsP/boXdFyEiYEteN0QlbV2VQSAIxQuO6J9wzr8+yeypRtDi+BjncYv05PaR4aRfWtTw0MyS+/bIgrRDlyG3h3zMhrjx6dL01JTGBJMwytMIrBijUJ3das3wbGCovD3g9CQOrfJ6bpz6lLJJ8rnZnalT572ZIa2qRPXB1oe51S4aydXmfQKY4zlC+vjlAAibd/f/df8sfsA/9wk5nLTnijfBafXV0dU/EOooiv1qq09iyahi5qRPpv+q1c3CumL57cLt+L0OJ1embU1W57xuizmWboAaEMHO+1HrcTGvHxF3g2IHgs5Py7D7mXPfq54YVrWVwFj8qZO/Vo96PQtDKlfScQrbmeIzhuFldEmsF4FkMtL1Oj/yR5DVHcvIsWPhRR8cvKCG8Dpj2LgVwv2R+nQHpBw2wVkOee3wBKCFG9VvshYxYg7LlTR1mY1KzijjlvJvv7R9jYpSaHblLSLIwnwmkCwrj4Gu0Uz/GeQNKdIwWVWLH0lyaR4ocDtmF0vsePvwz4 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)(82310400017)(1800799015)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 15:27:14.8005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6e70b9d-2d0f-43e3-6882-08dc7e617cb0 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: CH3PEPF0000000F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4154 Align the whitespace so that future messages will also be better aligned. Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky --- 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 Mon May 27 15:26:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13675517 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2063.outbound.protection.outlook.com [40.107.94.63]) (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 A4ECD155C94; Mon, 27 May 2024 15:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823642; cv=fail; b=UQnB5F/1d+iqmmQlDlhbjpI8/wWuD7Z3Fwptk2ABeuIlL5h1XUEoWrTVYVQ22tOoajXgPpp7jogdYC8a76gON+GF0NCq1E7ccKXYACogOG8H2DNqPUd3958HNVcEftrNWexeiZM1TQuGm7JAucN4A8DShAmnXMUDUaBy/svB9Rs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823642; c=relaxed/simple; bh=S90x49+7R+I998XJ3s8cV1me2a1iMGchH+LNYBE1+sc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sFT6dnE4FpgD6oXXB0vP16wu2OU0CloYquhoS7Rb1gruIc1GTy3+Dwy+uxswAnBoZVYb4CPZRa30/M+hSbBcB1MBt3tH0HHn0eT9Oo29lo4ojPuKrkmZ2+O0C+4NqGjAW2yp/ZACBbztfIAAPBLNi+6u0FFoSy504epG9x4FbRA= 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=CYOnl7+8; arc=fail smtp.client-ip=40.107.94.63 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="CYOnl7+8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JwoEaqv5+pO4pvH91xKqz4tMcjxRgR9osvt2XUUmu7xmLkSeCzrj+MbOue8cA176sEY156aV3b2tmHCISiJvmWPRA5u4G9DL2WCmhyl/y9h0zbOB9wgnMu3e6Uh80wd4IUfc1MxqxPg5npR7pYLrmjx0tdMxc4nAD3mTLZPIrYGNAvp8XLQdzmOfkIE1AGIfgP6NpZAWQWHdHA/EszMYu4LemaoZ7dHwLOvWwZoLMOfwS0okDAVSiOJe/HsZfmH07RDGSTVyTHLj7Lcbk80lx1kGEB7saGZTVOSbfX/EvHoGVWfxBzMWJ4nmzXZkrVb8bgrDnwdWXRonCweQAqjK5Q== 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=PHC1CfXe+YG8K8xprxUb30xtOttWxi1+KljRX0WY7ZE=; b=TGZS/dM1YXjLu8zp3XRuBg1bQWlfGCr0Tqgb3XqtY2jp3VWwKuL2A09KQONGuh1RiPsx4F/kZFGQpGhKxvVsREc0gLzxjIygDsRpI46mhChGsQc1Ve0n6IdCb5ejlOO0isXsArUCwvEnPrcsUrRKwfbRByC0WNvnCk+mlU2dw+j8ig6xXBHlH3qsajkGzHvFGCksv+jl/JIXfRH0pPeaq+ctMXSgpDvcjkHGia+iFl/Vg0W63mJ/B3Oywq3WIb5e6uejN7bUKZ2dawxwkUpKhLiukmo0inxDpnWtVd7oo9gSYAmsxNu1xwwX7EDxuedDJIpGohQEvSrh507/Y+qdwg== 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=PHC1CfXe+YG8K8xprxUb30xtOttWxi1+KljRX0WY7ZE=; b=CYOnl7+8JtfrIDqcpwKgLD8pMJpFk3AkNgc5LpYjsJ8dmHFa500cNz8nmk/ptyHUEtLLl1gfJqSyeRx4jjakozhqF+0IG0X8kVSpYHCm6Cgq/PnR5ctahJR2eEGVEFK0FfWi0ZXGlt0qNUKiaNKkAji8QCPioRiJa53GZ/APOAI= Received: from CH2PR05CA0013.namprd05.prod.outlook.com (2603:10b6:610::26) by CH0PR12MB8508.namprd12.prod.outlook.com (2603:10b6:610:18c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 27 May 2024 15:27:18 +0000 Received: from CH3PEPF0000000F.namprd04.prod.outlook.com (2603:10b6:610:0:cafe::40) by CH2PR05CA0013.outlook.office365.com (2603:10b6:610::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17 via Frontend Transport; Mon, 27 May 2024 15:27:18 +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 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 27 May 2024 15:27:16 +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; Mon, 27 May 2024 10:27:11 -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 4/5] crypto: ccp: Add support for getting security attributes on some older systems Date: Mon, 27 May 2024 10:26:48 -0500 Message-ID: <20240527152649.3722-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527152649.3722-1-mario.limonciello@amd.com> References: <20240527152649.3722-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: 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: CH3PEPF0000000F:EE_|CH0PR12MB8508:EE_ X-MS-Office365-Filtering-Correlation-Id: d6d52cc7-7bfb-4ada-9192-08dc7e617de1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|82310400017|376005|1800799015; X-Microsoft-Antispam-Message-Info: enYiohqzqmzRxu8l7IOuMnVtFZ2YWCL3EmCnYPSIzi/e5NKecQzMoGS4BwFG8EJfG7wlsjFKdvfmc6+YBZpCwSeMFnVr0MNQk7H831ZQ3UDVT6C7SIG5g73CSN6gamvZHHm7FpJd5FyqreIRXDtkVQnRhEFDnbzZ9jwLgb+XSO/NJGwAvq0bxC12Pw4YMJtIXep6B8FnKjxdWlTINuOoTFfBQ86w+OOEznl1xzw+Jj5zgTZOeKPZjjhdFXXfcTD9U2gTTFDeP2WahDy5SMOuu3zwvS6nMGvfAP176GlGji9wN+86ZJR0qq7ln2VNtvfY8rK6uACaEck1+5a47GE8A3BPr3T63IQewT0B014i6da0Pxz9OJ1AMLyJzldXX9leBbgxamQTf1DrmGHyOS+I49yVd824uN4LT/Bg9UYEpyF0eZFrICYWSSyS9q0cTrkyHbMKYwqTr7U3ounMGjH6JavcUKd1z85Aaik7ef2vgMdVWnB3sRaf8ZqfvdZcYF3DnbvmOlkISRq958ms8FVd/ZDAWWYTZCT+/3wDwa3UUkBg6aTaam7k00q833PAZhKEXQJGsQf4o4Y0265qoGyZulJXEDuLp+m5qACoL67EAO8WAKIdbkGR+n+VwqUzIyy+4wUJ5zbzh7ESoUCV93K8LUnAd68Yj8UYy++6Mvg4apCyRJbPQhzWC/OauJtmyp/6ryKFJ9Qbcon5YwOWPiP9ZBU3hnRE89+jFWj96mHjT+EZTmGMvQ4l1MVz4uW/4ye25Y2zcIVQDwyYmWoHDzj7EMnd7c0VfNrGPySPqKhlEgJbKioCovo/ozs57UP8hkEmLdGCXIs/+jkTrcXyL9nPeY0jk+nFBGFbpflRi8KhwBoLIF41PRHcJBJ/YYUPAyQJvc65NBoEZXtB+FgJTh0R5BkZ3vwhSdEBll0oXh8rE08DxMq4/pDIMojcrtGotXrf+crDppWxKDgT8f8jM3K/seewvO9uKBI6E/q7bOokaFL4UqE1/HekIM/rX3GAnWrz0fozH0VafnYX5MJOOCzo3XXKlC5XacQPWRyRRiFdxwjQdgE/SBIpCEQELaEg2XA5wMPAQwXr6INE3CnDnocQyA2wQajqMTyhflYiEkW4+FLvtjjNJM0JaY3dRvAAADPXEyCWKlvRWLQvllAm2rDRjMsrxWXyV7jcAUOK9HCEqyOliyHHJyd+QryNlVWD2r5DZ2/cUYLXYb48J3WG+8Uq9gIkhHMAH3TF2LdkWPVFvvlm1FzTSs0dKFLTxUN6PZ7jbiuUbocElWZ5kw+poYZfcbeLb8pPravw8kwAq0O7zphDdZ9dwN2rovjkJpNxAXrIfDp3SV8xt7aDSYzVLlJTwA== 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)(82310400017)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 15:27:16.8161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6d52cc7-7bfb-4ada-9192-08dc7e617de1 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: CH3PEPF0000000F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8508 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 --- drivers/crypto/ccp/hsti.c | 63 +++++++++++++++++++++++++++++ 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, 76 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 076c1d175b2b..8f583902d786 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,59 @@ 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; + } + + /* + * 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; + + 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 2db46736a4d7..f2d416a4f539 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -395,10 +395,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 = { @@ -411,7 +413,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 Mon May 27 15:26:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13675519 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2084.outbound.protection.outlook.com [40.107.220.84]) (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 CC7E515EFA8; Mon, 27 May 2024 15:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823647; cv=fail; b=Dnr1ZF0SQd3PtKCM/bVFVugKYh8Z+cbNTwvLO9WYEsbudauYiLeJVX57IAPf548gNuSLCRqJ6Qv4uMa7ASYb1vJOZn2LEBeWSzMXSKlV7/YNvEeQqVXIjm2yj3e8QH+9Wjeb696M4PvprNSRt+OC2eFiLVNjSlkaH92sgCkb41U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823647; c=relaxed/simple; bh=xRIHbcRh7gbg0yDMMARawggtgJypuKz0aBUSh9SBoMw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KQI1dhMVHSFul0e4brINUeU07LPqfIa3EWKSns6W0GbV9ffaO9uLj5SOHNHhZ49hKga6NDhIuG08lwfXPsC7WMvvBdH03z1M8KG4JngwkbXYOZAe/nVVhCAKdVtgGaZcKDj5ucM+l2O1ZxbkdtbOl7m+c1BQU4CwU0TFjVo92c0= 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=rmMk1pIO; arc=fail smtp.client-ip=40.107.220.84 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="rmMk1pIO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WqC2+z1/Q0dyLBMnTOpjZKtpDn71mzNwFPrOWNoGfAYQVlboRysQoqMLuJhfZuG+I1kiTkln3Gcc9VclmF2XpiGKt5S71hacRzMHdIlMnWabPBYpdC6P+MX8iU5fA9Hr3hXJ3fFOvorpSd+yWHpn1onW1qketEx4lFmhBzDWngzklOx3tv1PLjufQgZbqh7lW1RIld6ZFY4VD/I6jP7+A9FIt9ZPCHCStZHDhKDUD9nb0Vyb6YmspqRnSa2fhNgpTZwOU2ceD+L+gj4S7bkIH1/9RoVgMDLZuLt6lxWbwtfvP/mFknI8sjxEmmSwCZZE3JtF3o9jqKxOwFsqI5Lu9g== 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=YquFsLnkm1GDh9ty+4t8dlGgHsWR7Z+Y/isQ2dgcbmg=; b=F1RqATgs9Lwhvjw30WUra1CnCZstKEN5w2UCZ9hK30GK15PTGGvfaSNYNxrOB5I5jVm+GKE3wVDRnN1NeWn23bVgThQYSxqiwzJaamdNr4LVlX4wqNWdGClAYfaIbbSsk6paZzq7nrZfIZjdU7O48vLMthMVkyOtUzUHkOxzf5zJ16icQ57DyMR+tFJI2rtYX0viMi9fk1ENM2K4aiIoB044+x4D3VgBH+KxHlHOzQfkguy+vDXjesVdvsSmzu0fJD2N+6ouahmHeB+uI/jh8E8eUHWDqxrWy2hMhV2QhOZs5pFcmpH3MnsZ/FdXtPwQJU+RnjX9jElHa1flqi07Jw== 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=YquFsLnkm1GDh9ty+4t8dlGgHsWR7Z+Y/isQ2dgcbmg=; b=rmMk1pIO4dcIGux2ybj20La1/blgTaDQNkx738GCV4UMT42RReCYTSNCFUBVgK3HJAiRzfFC1kzPfoz3wnI1y3sdB1lkZ4NzQWOiFxuOaE92TRv2yUACLY8rui1VRSmcN1mb9duW7Gd6hjvWfcxWxYO2af6bRymp+MM5KAqc430= Received: from CH2PR05CA0028.namprd05.prod.outlook.com (2603:10b6:610::41) by DM4PR12MB6160.namprd12.prod.outlook.com (2603:10b6:8:a7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 27 May 2024 15:27:22 +0000 Received: from CH3PEPF0000000F.namprd04.prod.outlook.com (2603:10b6:610:0:cafe::a8) by CH2PR05CA0028.outlook.office365.com (2603:10b6:610::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.16 via Frontend Transport; Mon, 27 May 2024 15:27:20 +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 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 27 May 2024 15:27:18 +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; Mon, 27 May 2024 10:27:11 -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 5/5] crypto: ccp: Move message about TSME being enabled later in init Date: Mon, 27 May 2024 10:26:49 -0500 Message-ID: <20240527152649.3722-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527152649.3722-1-mario.limonciello@amd.com> References: <20240527152649.3722-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: 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: CH3PEPF0000000F:EE_|DM4PR12MB6160:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a1c6f0b-4f23-433f-f95d-08dc7e617f0d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|376005|36860700004; X-Microsoft-Antispam-Message-Info: jrpXh2erEb/kB1bI0gEr2+7qDqTqW7nMP8tBcGL5KgrPsflzG/Ko/JUjSCloV90OmK5b5RGyQP+49yc4yfIuyIqbodzTedbZ8Skv92FHPCtXaG/iqtxDBBc/H4GkqakMJ1JhCgdHEADaazmA4ZXMnmnWfLeMKqTkbhMciWu7+ATQjNO7ZFAE5NeDOEj8LH/krPxn+Atgs2Bp0TKR4KNQ9MvE2L+uub8aMIkWgPV5GR40KPXqqDHNSehoUH8ges1DP2rV7WBuS9QqOxq19GF08lyykHCH2GYFVuIIZEfbmyPxBsr5homxqTwoGwHvl1GwvIqdxW9y+mhv30plyXFEVvBJfPZG2myMFQnG1I+ZexPhWikFxzp6kwNox7/s41EyP2P4EERIfZoc3GT5QVI5HkuMB+qkBCMXCek45YPlrmZ5f8T3PhGT07esV7IE3Jq16uByYFRCGuuAfEAyly5RMSEmIdwq9/2bXakfonceTQ7VAPJZxS60rHJpeh3F4kPtK/0auUxAKWuTg5+Y9TUs66RtVZWfbsF5ZAsBt2vuAi468gg916FuSmFTBVYIzq6AYENx3YTIhBsxyZ392RxWpnIx0ZK8kJVQ2+qNYU8DvtlHoXYzzVO7Sbk20DAZ9iLfiAdm8CDb1l7v49Q8VIt7a7UPgz4U9KO9mZonlKbfaOyWipmeSQiDFlnogjmlqMM8weRKj/KyrSILjhC732GWGcDcJW+OlSz0tqGA/vnHapziEM29zyReskN0K0ZdE7Ay+ABVc5P80h5jOjt5XiNO/vIoWfunChkQk7KNlO9mJgJLSchmkfM5tkeU6Lh63FyKjmB66T+BvTp9ap5VwMWd3m85e/PYoNogjhUxHtszMvL6KfpZxOrkb94Bc0Wg5aqUzfakPOVLGvGBPY2so+yaBDCCgY8Mv1hYW1/a5fslPkRl+ceqjBP1LeQme86Fef+8xZMHJ/WDB7yQFotxZGIGv0+RiSQe+Rprh7e0XNeoWFaM0nPsdqaHpu08UoXR/o9gCWSDQmz4OEepXxymd/MSb28z5EiwctW8oLQVFkXUHozRD+Bm0HXcAkK+HtUlNfhAQ9givXkGLFgRIQmsqsW4nGjNanV/15bocFspcRwFBRxKOzxHZbSE7+UlxP/Skuy4jFw1lIt0C5w5u3vp8LsW/CAC8lvh7ANKjJO5CyXMKQlLQWriYJvVY9w6HMsN/1RxoqY5HHF2FGhjdpiJq6Fp9Bm9yESzUolP0sB6ehho1dzbJu+JIxKYWXRNDn1pLErGDRtCfYfG/TbB0/514NURbFodJunaV2r+kwRktdHdzO61XOCY4T3cC+eddp2ATQteKmdOatHOhhHiA//I0hzB3bC5njblNKAXYYjaFwmyredsz845FZalAv1N18Q8MiYO 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)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 15:27:18.7692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a1c6f0b-4f23-433f-f95d-08dc7e617f0d 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: CH3PEPF0000000F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6160 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 --- drivers/crypto/ccp/hsti.c | 7 +++++++ drivers/crypto/ccp/psp-dev.c | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 8f583902d786..1b39a4fb55c0 100644 --- a/drivers/crypto/ccp/hsti.c +++ b/drivers/crypto/ccp/hsti.c @@ -127,5 +127,12 @@ int psp_init_hsti(struct psp_device *psp) 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; }