Re: [PATCH v3 12/21] x86/virt/tdx: Create TDMRs to cover all system RAM

From: Dave Hansen
Date: Fri Apr 29 2022 - 09:57:10 EST


On 4/29/22 00:24, Kai Huang wrote:
> On Thu, 2022-04-28 at 09:22 -0700, Dave Hansen wrote:
>> On 4/5/22 21:49, Kai Huang wrote:
>>> implies that one TDMR could cover multiple e820 RAM entries. If a RAM
>>> entry spans the 1GB boundary and the former part is already covered by
>>> the previous TDMR, just create a new TDMR for the latter part.
>>>
>>> TDX only supports a limited number of TDMRs (currently 64). Abort the
>>> TDMR construction process when the number of TDMRs exceeds this
>>> limitation.
>>
>> ... and what does this *MEAN*? Is TDX disabled? Does it throw away the
>> RAM? Does it eat puppies?
>
> How about:
>
> TDX only supports a limited number of TDMRs. Simply return error when
> the number of TDMRs exceeds the limitation. TDX is disabled in this
> case.

Better, but two things there that need to be improved. This is a cover
letter. Talking at the function level ("return error") is too
low-level. It's also slipping into passive mode "is disabled". Fixing
those, it looks like this:

TDX only supports a limited number of TDMRs. Disable TDX if all
TDMRs are consumed but there is more RAM to cover.