summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-06-23 16:49:56 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2023-07-20 13:14:21 +0300
commitd9408716d2126439fbc46f6c40e72792069b8411 (patch)
tree3a6fb2b8e00a0b4f9e6786e61ae588cc5db390b3 /include
parentc04cf9e14f109ebcc425c1efd2c01294c52a4d62 (diff)
downloadlinux-d9408716d2126439fbc46f6c40e72792069b8411.tar.xz
crypto: ccp - Add support for setting user ID for dynamic boost control
As part of the authentication flow for Dynamic Boost Control, the calling software will need to send a uid used in all of its future communications. Add support for another IOCTL call to let userspace software set this up. Acked-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')
-rw-r--r--include/linux/psp-platform-access.h1
-rw-r--r--include/uapi/linux/psp-dbc.h20
2 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h
index 53b4a1df5180..18b9e0f0cb03 100644
--- a/include/linux/psp-platform-access.h
+++ b/include/linux/psp-platform-access.h
@@ -9,6 +9,7 @@ enum psp_platform_access_msg {
PSP_CMD_NONE = 0x0,
PSP_I2C_REQ_BUS_CMD = 0x64,
PSP_DYNAMIC_BOOST_GET_NONCE,
+ PSP_DYNAMIC_BOOST_SET_UID,
};
struct psp_req_buffer_hdr {
diff --git a/include/uapi/linux/psp-dbc.h b/include/uapi/linux/psp-dbc.h
index d032f78934e2..7443c78ede19 100644
--- a/include/uapi/linux/psp-dbc.h
+++ b/include/uapi/linux/psp-dbc.h
@@ -18,6 +18,7 @@
#define DBC_NONCE_SIZE 16
#define DBC_SIG_SIZE 32
+#define DBC_UID_SIZE 16
/**
* struct dbc_user_nonce - Nonce exchange structure (input/output).
@@ -35,6 +36,16 @@ struct dbc_user_nonce {
} __packed;
/**
+ * struct dbc_user_setuid - UID exchange structure (input).
+ * @uid: 16 byte value representing software identity
+ * @signature: 32 byte signature created by software using a previous nonce
+ */
+struct dbc_user_setuid {
+ __u8 uid[DBC_UID_SIZE];
+ __u8 signature[DBC_SIG_SIZE];
+} __packed;
+
+/**
* Dynamic Boost Control (DBC) IOC
*
* possible return codes for all DBC IOCTLs:
@@ -64,4 +75,13 @@ struct dbc_user_nonce {
*/
#define DBCIOCNONCE _IOWR(DBC_IOC_TYPE, 0x1, struct dbc_user_nonce)
+/**
+ * DBCIOCUID - Set the user ID (UID) of a calling process.
+ * The user ID is 8 bytes long. It must be programmed using a
+ * 32 byte signature built using the nonce fetched from
+ * DBCIOCNONCE.
+ * The UID can only be set once until the system is rebooted.
+ */
+#define DBCIOCUID _IOW(DBC_IOC_TYPE, 0x2, struct dbc_user_setuid)
+
#endif /* __PSP_DBC_USER_H__ */