lkml.org 
[lkml]   [2022]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]

\
 
 \ /
  Last update: 2022-05-02 14:19    [W:0.267 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site