Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/tdx: tdx_mcall_get_report0: Return -EBUSY on TDCALL_OPERAND_BUSY error

Return `-EBUSY` from tdx_mcall_get_report0() when `TDG.MR.REPORT` returns
`TDCALL_OPERAND_BUSY`. This enables the caller to retry obtaining a
TDREPORT later if another VCPU is extending an RTMR concurrently.

Signed-off-by: Cedric Xing <cedric.xing@intel.com>
Acked-by: Dionna Amalie Glaze <dionnaglaze@google.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://patch.msgid.link/20250506-tdx-rtmr-v6-4-ac6ff5e9d58a@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Cedric Xing and committed by
Dan Williams
2748566d 3f88ca96

+8 -5
+8 -5
arch/x86/coco/tdx/tdx.c
··· 110 110 * REPORTDATA to be included into TDREPORT. 111 111 * @tdreport: Address of the output buffer to store TDREPORT. 112 112 * 113 - * Refer to section titled "TDG.MR.REPORT leaf" in the TDX Module 114 - * v1.0 specification for more information on TDG.MR.REPORT TDCALL. 113 + * Refer to section titled "TDG.MR.REPORT leaf" in the TDX Module v1.0 114 + * specification for more information on TDG.MR.REPORT TDCALL. 115 + * 115 116 * It is used in the TDX guest driver module to get the TDREPORT0. 116 117 * 117 - * Return 0 on success, -EINVAL for invalid operands, or -EIO on 118 - * other TDCALL failures. 118 + * Return 0 on success, -ENXIO for invalid operands, -EBUSY for busy operation, 119 + * or -EIO on other TDCALL failures. 119 120 */ 120 121 int tdx_mcall_get_report0(u8 *reportdata, u8 *tdreport) 121 122 { ··· 130 129 ret = __tdcall(TDG_MR_REPORT, &args); 131 130 if (ret) { 132 131 if (TDCALL_RETURN_CODE(ret) == TDCALL_INVALID_OPERAND) 133 - return -EINVAL; 132 + return -ENXIO; 133 + else if (TDCALL_RETURN_CODE(ret) == TDCALL_OPERAND_BUSY) 134 + return -EBUSY; 134 135 return -EIO; 135 136 } 136 137