Commit 71ded61b authored by Dan Williams's avatar Dan Williams
Browse files

configfs-tsm: Namespace TSM report symbols



In preparation for new + common TSM (TEE Security Manager)
infrastructure, namespace the TSM report symbols in tsm.h with an
_REPORT suffix to differentiate them from other incoming tsm work.

Cc: Yilun Xu <yilun.xu@intel.com>
Cc: Samuel Ortiz <sameo@rivosinc.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Steven Price <steven.price@arm.com>
Reviewed-by: default avatarAlexey Kardashevskiy <aik@amd.com>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: default avatarKai Huang <kai.huang@intel.com>
Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Link: https://patch.msgid.link/174107246021.1288555.7203769833791489618.stgit@dwillia2-xfh.jf.intel.com


Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 8ffd015d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24559,7 +24559,7 @@ TRUSTED SECURITY MODULE (TSM) ATTESTATION REPORTS
M:	Dan Williams <dan.j.williams@intel.com>
L:	linux-coco@lists.linux.dev
S:	Maintained
F:	Documentation/ABI/testing/configfs-tsm
F:	Documentation/ABI/testing/configfs-tsm-report
F:	drivers/virt/coco/tsm.c
F:	include/linux/tsm.h
+4 −4
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static int arm_cca_report_new(struct tsm_report *report, void *data)
	struct arm_cca_token_info info;
	void *buf;
	u8 *token __free(kvfree) = NULL;
	struct tsm_desc *desc = &report->desc;
	struct tsm_report_desc *desc = &report->desc;

	if (desc->inblob_len < 32 || desc->inblob_len > 64)
		return -EINVAL;
@@ -181,7 +181,7 @@ static int arm_cca_report_new(struct tsm_report *report, void *data)
	return ret;
}

static const struct tsm_ops arm_cca_tsm_ops = {
static const struct tsm_report_ops arm_cca_tsm_ops = {
	.name = KBUILD_MODNAME,
	.report_new = arm_cca_report_new,
};
@@ -202,7 +202,7 @@ static int __init arm_cca_guest_init(void)
	if (!is_realm_world())
		return -ENODEV;

	ret = tsm_register(&arm_cca_tsm_ops, NULL);
	ret = tsm_report_register(&arm_cca_tsm_ops, NULL);
	if (ret < 0)
		pr_err("Error %d registering with TSM\n", ret);

@@ -216,7 +216,7 @@ module_init(arm_cca_guest_init);
 */
static void __exit arm_cca_guest_exit(void)
{
	tsm_unregister(&arm_cca_tsm_ops);
	tsm_report_unregister(&arm_cca_tsm_ops);
}
module_exit(arm_cca_guest_exit);

+6 −6
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ struct snp_msg_cert_entry {
static int sev_svsm_report_new(struct tsm_report *report, void *data)
{
	unsigned int rep_len, man_len, certs_len;
	struct tsm_desc *desc = &report->desc;
	struct tsm_report_desc *desc = &report->desc;
	struct svsm_attest_call ac = {};
	unsigned int retry_count;
	void *rep, *man, *certs;
@@ -481,7 +481,7 @@ static int sev_svsm_report_new(struct tsm_report *report, void *data)
static int sev_report_new(struct tsm_report *report, void *data)
{
	struct snp_msg_cert_entry *cert_table;
	struct tsm_desc *desc = &report->desc;
	struct tsm_report_desc *desc = &report->desc;
	struct snp_guest_dev *snp_dev = data;
	struct snp_msg_report_resp_hdr hdr;
	const u32 report_size = SZ_4K;
@@ -610,7 +610,7 @@ static bool sev_report_bin_attr_visible(int n)
	return false;
}

static struct tsm_ops sev_tsm_ops = {
static struct tsm_report_ops sev_tsm_report_ops = {
	.name = KBUILD_MODNAME,
	.report_new = sev_report_new,
	.report_attr_visible = sev_report_attr_visible,
@@ -619,7 +619,7 @@ static struct tsm_ops sev_tsm_ops = {

static void unregister_sev_tsm(void *data)
{
	tsm_unregister(&sev_tsm_ops);
	tsm_report_unregister(&sev_tsm_report_ops);
}

static int __init sev_guest_probe(struct platform_device *pdev)
@@ -656,9 +656,9 @@ static int __init sev_guest_probe(struct platform_device *pdev)
	misc->fops = &snp_guest_fops;

	/* Set the privlevel_floor attribute based on the vmpck_id */
	sev_tsm_ops.privlevel_floor = mdesc->vmpck_id;
	sev_tsm_report_ops.privlevel_floor = mdesc->vmpck_id;

	ret = tsm_register(&sev_tsm_ops, snp_dev);
	ret = tsm_report_register(&sev_tsm_report_ops, snp_dev);
	if (ret)
		goto e_msg_init;

+4 −4
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static int tdx_report_new(struct tsm_report *report, void *data)
{
	u8 *buf, *reportdata = NULL, *tdreport = NULL;
	struct tdx_quote_buf *quote_buf = quote_data;
	struct tsm_desc *desc = &report->desc;
	struct tsm_report_desc *desc = &report->desc;
	int ret;
	u64 err;

@@ -297,7 +297,7 @@ static const struct x86_cpu_id tdx_guest_ids[] = {
};
MODULE_DEVICE_TABLE(x86cpu, tdx_guest_ids);

static const struct tsm_ops tdx_tsm_ops = {
static const struct tsm_report_ops tdx_tsm_ops = {
	.name = KBUILD_MODNAME,
	.report_new = tdx_report_new,
	.report_attr_visible = tdx_report_attr_visible,
@@ -322,7 +322,7 @@ static int __init tdx_guest_init(void)
		goto free_misc;
	}

	ret = tsm_register(&tdx_tsm_ops, NULL);
	ret = tsm_report_register(&tdx_tsm_ops, NULL);
	if (ret)
		goto free_quote;

@@ -339,7 +339,7 @@ module_init(tdx_guest_init);

static void __exit tdx_guest_exit(void)
{
	tsm_unregister(&tdx_tsm_ops);
	tsm_report_unregister(&tdx_tsm_ops);
	free_quote_buf(quote_data);
	misc_deregister(&tdx_misc_dev);
}
Loading