lkml.org 
[lkml]   [2022]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 5/5] x86/tdx: Add Quote generation support
From


On 5/26/22 8:37 AM, Wander Lairson Costa wrote:
> On Mon, May 23, 2022 at 09:05:17PM -0700, Kuppuswamy Sathyanarayanan wrote:
>> +
>> +/* Used for buffer allocation in GetQuote request */
>> +struct quote_buf {
>> + /* vmapped address of kernel buffer (size is page aligned) */
>> + void *vmaddr;
>> + /* Number of pages */
>> + int count;
>> +};
>> +
>> +/* List entry of quote_list */
>> +struct quote_entry {
>> + /* Flag to check validity of the GetQuote request */
>> + bool valid;
>> + /* Kernel buffer to share data with VMM */
>> + struct quote_buf *buf;
>
> Instead of a pointer, we can embed the quote_buf object directly into the
> quote_entry. alloc_quote_buf would receive a pointer to quote_buf, and would
> only allocate vmaddr (may we should change the names from alloc/free to
> init/deinit). This way we can save one memory allocation and have a
> simpler code. Not to mention is one less pointer to track its lifetime.

Agree. I will change it to embed object.


--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

\
 
 \ /
  Last update: 2022-06-03 19:15    [W:1.920 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site