Re: [PATCH 8/9] x86/virt/tdx: Exclude memory region hole within CMR as TDMR's reserved area

From: Binbin Wu
Date: Thu Jul 04 2024 - 23:01:10 EST




On 6/19/2024 9:23 AM, Huang, Kai wrote:
[...]

furthermore the alignement checks
suggest it's actually some sanity checking function. Furthermore if we
have:"

ORDINARY_CMR,EMPTY_CMR,ORDINARY_CMR

(Is such a scenario even possible), in this case we'll ommit also the
last ordinary cmr region?
It cannot happen.

The fact is:

1) CMR base/size are 4KB aligned. This is architectural behaviour.
2) TDX architecturally supports 32 CMRs maximumly;
Do you think it's worth a comment to the definition of TDX_MAX_CMRS that the number is architectural?

3) In practice, TDX can just report the 'NUM_CMRS' metadata field as 32,
but there can be empty/null CMRs following valid CMRs.
4) A empty/null CMR between valid CMRs cannot happen.