Messages in this thread | | | Date | Mon, 2 May 2022 09:18:46 -0300 | From | Wander Lairson Costa <> | Subject | Re: [PATCH v5 1/3] x86/tdx: Add TDX Guest attestation interface driver |
| |
On Sun, May 01, 2022 at 11:34:58AM -0700, Kuppuswamy Sathyanarayanan wrote:
[snip]
> + > +static struct miscdevice miscdev; > + > +static long tdx_get_report(void __user *argp) > +{ > + void *reportdata = NULL, *tdreport = NULL; > + long ret = 0; > + > + /* Allocate buffer space for REPORTDATA */ > + reportdata = kmalloc(TDX_REPORTDATA_LEN, GFP_KERNEL); > + if (!reportdata) > + return -ENOMEM; > + > + /* Allocate buffer space for TDREPORT */ > + tdreport = kmalloc(TDX_REPORT_LEN, GFP_KERNEL); > + if (!tdreport) { > + ret = -ENOMEM; > + goto failed; > + } > + > + /* Copy REPORTDATA from the user buffer */ > + if (copy_from_user(reportdata, argp, TDX_REPORTDATA_LEN)) { > + ret = -EFAULT; > + goto failed; > + } > + > + /* > + * Generate TDREPORT using "TDG.MR.REPORT" TDCALL. > + * > + * Pass the physical address of user generated REPORTDATA > + * and the physical address of the output buffer to the TDX > + * module to generate the TDREPORT. Generated data contains > + * measurements/configuration data of the TD guest. More info > + * about ABI can be found in TDX 1.0 Module specification, sec > + * titled "TDG.MR.REPORT". > + */ > + ret = __tdx_module_call(TDX_GET_REPORT, virt_to_phys(tdreport), > + virt_to_phys(reportdata), 0, 0, NULL); > + if (ret) { > + pr_debug("TDREPORT TDCALL failed, status:%lx\n", > + TDCALL_STATUS_CODE(ret));
Should we use pr_err instead?
[snip]
| |