Re: [PATCH v11 11/20] x86/virt/tdx: Fill out TDMRs to cover all TDX memory regions

From: Dave Hansen
Date: Wed Jun 07 2023 - 12:08:56 EST


On 6/4/23 07:27, Kai Huang wrote:
> + /*
> + * Loop over TDX memory regions and fill out TDMRs to cover them.
> + * To keep it simple, always try to use one TDMR to cover one
> + * memory region.
> + *
> + * In practice TDX1.0 supports 64 TDMRs, which is big enough to
> + * cover all memory regions in reality if the admin doesn't use
> + * 'memmap' to create a bunch of discrete memory regions. When
> + * there's a real problem, enhancement can be done to merge TDMRs
> + * to reduce the final number of TDMRs.
> + */

Rather than focus in on one specific command-line parameter, let's just say:

In practice TDX supports at least 64 TDMRs. A 2-socket system
typically only consumes <NUMBER> of those. This code is dumb
and simple and may use more TMDRs than is strictly required.

Let's also put a pr_warn() in here if we exceed, say 1/2 or maybe 3/4 of
the 64. We'll hopefully start to get reports somewhat in advance if
systems get close to the limit.