Re: [PATCH v17 2/3] virt: Add TDX guest driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/9/22 6:24 AM, Wander Lairson Costa wrote:
>> +	reportdata = kmalloc(TDX_REPORTDATA_LEN, GFP_KERNEL);
>> +	if (!reportdata)
>> +		return -ENOMEM;
>> +
>> +	tdreport = kzalloc(TDX_REPORT_LEN, GFP_KERNEL);
>> +	if (!tdreport) {
>> +		ret = -ENOMEM;
>> +		goto out;
>> +	}
> Isn't simpler just allocating a struct tdx_report_req? You would save
> one allocation and a few lines of code.
> 

TDG.MR.TDCALL expects reportdata and tdreport buffers to be size aligned. So,
allocating them together with sizeof(struct tdx report req) will not work. We
can get around this by allocating a slightly larger buffer size. However, because
it is not a time-critical path, I believe that allocating two separate buffers
for input/output is simpler.

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux