drivers/crypto/ccp/sev-dev-tio.h

Source file repositories/reference/linux-study-clean/drivers/crypto/ccp/sev-dev-tio.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/ccp/sev-dev-tio.h
Extension
.h
Size
3453 bytes
Lines
124
Domain
Driver Families
Bucket
drivers/crypto
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sla_addr_t {
	union {
		u64 sla;
		struct {
			u64 page_type	:1,
			    page_size	:1,
			    reserved1	:10,
			    pfn		:40,
			    reserved2	:12;
		};
	};
} __packed;

#define SEV_TIO_MAX_COMMAND_LENGTH	128

/* SPDM control structure for DOE */
struct tsm_spdm {
	unsigned long req_len;
	void *req;
	unsigned long rsp_len;
	void *rsp;
};

/* Describes TIO device */
struct tsm_dsm_tio {
	u8 cert_slot;
	struct sla_addr_t dev_ctx;
	struct sla_addr_t req;
	struct sla_addr_t resp;
	struct sla_addr_t scratch;
	struct sla_addr_t output;
	size_t output_len;
	size_t scratch_len;
	struct tsm_spdm spdm;
	struct sla_buffer_hdr *reqbuf; /* vmap'ed @req for DOE */
	struct sla_buffer_hdr *respbuf; /* vmap'ed @resp for DOE */

	int cmd;
	int psp_ret;
	u8 cmd_data[SEV_TIO_MAX_COMMAND_LENGTH];
	void *data_pg; /* Data page for DEV_STATUS/TDI_STATUS/TDI_INFO/ASID_FENCE */

#define TIO_IDE_MAX_TC	8
	struct pci_ide *ide[TIO_IDE_MAX_TC];
};

/* Describes TSM structure for PF0 pointed by pci_dev->tsm */
struct tio_dsm {
	struct pci_tsm_pf0 tsm;
	struct tsm_dsm_tio data;
	struct sev_device *sev;
};

/* Data object IDs */
#define SPDM_DOBJ_ID_NONE		0
#define SPDM_DOBJ_ID_REQ		1
#define SPDM_DOBJ_ID_RESP		2

struct spdm_dobj_hdr {
	u32 id;     /* Data object type identifier */
	u32 length; /* Length of the data object, INCLUDING THIS HEADER */
	struct { /* Version of the data object structure */
		u8 minor;
		u8 major;
	} version;
} __packed;

/**
 * struct sev_tio_status - TIO_STATUS command's info_paddr buffer
 *
 * @length: Length of this structure in bytes
 * @tio_en: Indicates that SNP_INIT_EX initialized the RMP for SEV-TIO
 * @tio_init_done: Indicates TIO_INIT has been invoked
 * @spdm_req_size_min: Minimum SPDM request buffer size in bytes
 * @spdm_req_size_max: Maximum SPDM request buffer size in bytes
 * @spdm_scratch_size_min: Minimum SPDM scratch buffer size in bytes
 * @spdm_scratch_size_max: Maximum SPDM scratch buffer size in bytes
 * @spdm_out_size_min: Minimum SPDM output buffer size in bytes
 * @spdm_out_size_max: Maximum for the SPDM output buffer size in bytes
 * @spdm_rsp_size_min: Minimum SPDM response buffer size in bytes
 * @spdm_rsp_size_max: Maximum SPDM response buffer size in bytes
 * @devctx_size: Size of a device context buffer in bytes
 * @tdictx_size: Size of a TDI context buffer in bytes
 * @tio_crypto_alg: TIO crypto algorithms supported
 */
struct sev_tio_status {
	u32 length;
	u32 tio_en	  :1,
	    tio_init_done :1,
	    reserved	  :30;

Annotation

Implementation Notes