lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220329031553.798-3-mario.limonciello@amd.com>
Date:   Mon, 28 Mar 2022 22:15:52 -0500
From:   Mario Limonciello <mario.limonciello@....com>
To:     Tom Lendacky <thomas.lendacky@....com>,
        John Allen <john.allen@....com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>
CC:     open list <linux-kernel@...r.kernel.org>,
        "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER" 
        <linux-crypto@...r.kernel.org>,
        Kerneis Gabriel <Gabriel.Kerneis@....gouv.fr>,
        Richard Hughes <hughsient@...il.com>,
        "Mario Limonciello" <mario.limonciello@....com>
Subject: [PATCH 3/4] crypto: ccp: Allow PSP driver to load without SEV/TEE support

Previously the PSP probe routine would fail if both SEV and TEE were
missing.  This is possibly the case for some client parts.

As capabilities can now be accessed from userspace, it may still be
useful to have the PSP driver finish loading so that those capabilities
can be read.

Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
 drivers/crypto/ccp/psp-dev.c | 2 +-
 drivers/crypto/ccp/sp-dev.c  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
index 8cd404121cd5..3f47b2d81e3c 100644
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -158,7 +158,7 @@ int psp_dev_init(struct sp_device *sp)
 
 	ret = psp_check_support(psp);
 	if (ret)
-		goto e_disable;
+		return 0;
 
 	/* Disable and clear interrupts until ready */
 	iowrite32(0, psp->io_regs + psp->vdata->inten_reg);
diff --git a/drivers/crypto/ccp/sp-dev.c b/drivers/crypto/ccp/sp-dev.c
index 7eb3e4668286..77cf533b0db0 100644
--- a/drivers/crypto/ccp/sp-dev.c
+++ b/drivers/crypto/ccp/sp-dev.c
@@ -132,6 +132,8 @@ int sp_request_psp_irq(struct sp_device *sp, irq_handler_t handler,
 
 void sp_free_ccp_irq(struct sp_device *sp, void *data)
 {
+	if (!sp->irq_registered)
+		return;
 	if ((sp->psp_irq == sp->ccp_irq) && sp->dev_vdata->psp_vdata) {
 		/* Using common routine to manage all interrupts */
 		if (!sp->psp_irq_handler) {
@@ -151,6 +153,8 @@ void sp_free_ccp_irq(struct sp_device *sp, void *data)
 
 void sp_free_psp_irq(struct sp_device *sp, void *data)
 {
+	if (!sp->irq_registered)
+		return;
 	if ((sp->psp_irq == sp->ccp_irq) && sp->dev_vdata->ccp_vdata) {
 		/* Using common routine to manage all interrupts */
 		if (!sp->ccp_irq_handler) {
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ