[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <403d4d21-0238-3169-b43e-cab1e65a6421@linux.intel.com>
Date: Fri, 3 Jun 2022 10:15:11 -0700
From: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Wander Lairson Costa <wander@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Kai Huang <kai.huang@...el.com>,
Isaku Yamahata <isaku.yamahata@...il.com>,
marcelo.cerri@...onical.com, tim.gardner@...onical.com,
khalid.elmously@...onical.com, philip.cox@...onical.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 5/5] x86/tdx: Add Quote generation support
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
Powered by blists - more mailing lists