[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmwsOo4TCq1/5hgd@google.com>
Date: Fri, 29 Apr 2022 18:19:38 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Kai Huang <kai.huang@...el.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, pbonzini@...hat.com, len.brown@...el.com,
tony.luck@...el.com, rafael.j.wysocki@...el.com,
reinette.chatre@...el.com, dan.j.williams@...el.com,
peterz@...radead.org, ak@...ux.intel.com,
kirill.shutemov@...ux.intel.com,
sathyanarayanan.kuppuswamy@...ux.intel.com,
isaku.yamahata@...el.com
Subject: Re: [PATCH v3 13/21] x86/virt/tdx: Allocate and set up PAMTs for
TDMRs
On Fri, Apr 29, 2022, Dave Hansen wrote:
> On 4/29/22 07:30, Sean Christopherson wrote:
> > On Fri, Apr 29, 2022, Dave Hansen wrote:
> ...
> >> A *good* way (although not foolproof) is to launch a TDX VM early
> >> in boot before memory gets fragmented or consumed. You might even
> >> want to recommend this in the documentation.
> >
> > What about providing a kernel param to tell the kernel to do the
> > allocation during boot?
>
> I think that's where we'll end up eventually. But, I also want to defer
> that discussion until after we have something merged.
>
> Right now, allocating the PAMTs precisely requires running the TDX
> module. Running the TDX module requires VMXON. VMXON is only done by
> KVM. KVM isn't necessarily there during boot. So, it's hard to do
> precisely today without a bunch of mucking with VMX.
Meh, it's hard only if we ignore the fact that the PAMT entry size isn't going
to change for a given TDX module, and is extremely unlikely to change in general.
Odds are good the kernel can hardcode a sane default and Just Work. Or provide
the assumed size of a PAMT entry via module param. If the size ends up being
wrong, log an error, free the reserved memory, and move on with TDX setup with
the correct size.
> You can arm-wrestle the distro folks who hate adding command-line tweaks
> when the time comes. ;)
Sure, you just find me the person that's going to run TDX guests with an
off-the-shelf distro kernel :-D
Powered by blists - more mailing lists