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: <20230403183216.3493-5-mario.limonciello@amd.com>
Date:   Mon, 3 Apr 2023 13:32:13 -0500
From:   Mario Limonciello <mario.limonciello@....com>
To:     Herbert Xu <herbert@...dor.apana.org.au>,
        Tom Lendacky <thomas.lendacky@....com>,
        John Allen <john.allen@....com>
CC:     Held Felix <Felix.Held@....com>, <linux-kernel@...r.kernel.org>,
        <linux-i2c@...r.kernel.org>, Mark Hasemeyer <markhas@...omium.org>,
        "Grzegorz Bernacki" <gjb@...ihalf.com>,
        Jan Dąbroś <jsd@...ihalf.com>,
        Mario Limonciello <mario.limonciello@....com>,
        "David S. Miller" <davem@...emloft.net>,
        <linux-crypto@...r.kernel.org>
Subject: [PATCH v8 4/6] crypto: ccp: Use lower 8 bytes to communicate with doorbell command register

Unlike other command registers used by the PSP, only the lower 8 bytes are
used for communication for both command and status of the command.

Suggested-by: Mark Hasemeyer <markhas@...omium.org>
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
Reviewed-by: Mark Hasemeyer <markhas@...omium.org>
Tested-by: Mark Hasemeyer <markhas@...omium.org>
---
 drivers/crypto/ccp/platform-access.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c
index 48f59ae91692..939c924fc383 100644
--- a/drivers/crypto/ccp/platform-access.c
+++ b/drivers/crypto/ccp/platform-access.c
@@ -19,6 +19,7 @@
 #include "platform-access.h"
 
 #define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
+#define DOORBELL_CMDRESP_STS	GENMASK(7, 0)
 
 /* Recovery field should be equal 0 to start sending commands */
 static int check_recovery(u32 __iomem *cmd)
@@ -154,7 +155,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
 		goto unlock;
 	}
 
-	iowrite32(FIELD_PREP(PSP_DRBL_MSG, msg), cmd);
+	iowrite32(FIELD_PREP(DOORBELL_CMDRESP_STS, msg), cmd);
 	iowrite32(PSP_DRBL_RING, button);
 
 	if (wait_cmd(cmd)) {
@@ -162,7 +163,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
 		goto unlock;
 	}
 
-	val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd));
+	val = FIELD_GET(DOORBELL_CMDRESP_STS, ioread32(cmd));
 	if (val) {
 		if (result)
 			*result = val;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ