Thread (27 messages) 27 messages, 8 authors, 2021-07-15

Re: [PATCH v2 1/6] x86/tdx: Add TDREPORT TDX Module call support

From: "Kuppuswamy, Sathyanarayanan" <sathyanarayanan.kuppuswamy@linux.intel.com>
Date: 2021-07-08 14:07:33
Also in: bpf, lkml, platform-driver-x86


On 7/8/21 1:16 AM, Xiaoyao Li wrote:
Sorry I guess I didn't state it clearly during internal review.

I suggest something like this

if (ret != TDCALL_SUCCESS) {
     if (TDCALL_RETURN_CODE(ret) == TDCALL_INVALID_OPERAND)
         return -EINVAL;
     else if (TDCALL_RETURN_CODE(ret) == TDCALL_OPERAND_BUSY)
         return -EBUSY;
     else
         return -EFAULT; //I'm not sure if -EFAULT is proper.
}
As per current spec, TDCALL_INVALID_OPERAND, TDCALL_OPERAND_BUSY and
0 are the only possible return values. So I have checked for failure case
in if condition and returned success by default. Any reason for specifically
checking for success code ?

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help