Re: [PATCH v11 08/20] x86/virt/tdx: Get information about TDX module and TDX-capable memory

From: Huang, Kai
Date: Sun Jun 11 2023 - 22:00:46 EST


On Thu, 2023-06-08 at 06:13 -0700, Dave Hansen wrote:
> On 6/8/23 04:41, kirill.shutemov@xxxxxxxxxxxxxxx wrote:
> > These structures take 1.5K of memory and the memory will be allocated for
> > all machines that boots the kernel with TDX enabled, regardless if the
> > machine has TDX or not. It seems very wasteful to me.
>
> Actually, those variables are in .bss. They're allocated forever for
> anyone that runs a kernel that has TDX support.
>

Hi Dave/Kirill,

Thanks for feedback.

My understanding is you both prefer dynamic allocation. I'll change to use
that. Also I will free them after module initialization as for now they are
only used by module initialization.

Please let me know if you have any comments.