Re: [PATCH v6 13/60] i386/tdx: Validate TD attributes

2024-11-05 Thread Xiaoyao Li
On 11/6/2024 4:56 AM, Edgecombe, Rick P wrote: On Tue, 2024-11-05 at 01:23 -0500, Xiaoyao Li wrote: -static void setup_td_guest_attributes(X86CPU *x86cpu) +static int tdx_validate_attributes(TdxGuest *tdx, Error **errp) +{ +    if ((tdx->attributes & ~tdx_caps->supported_attrs)) { +    e

Re: [PATCH v6 13/60] i386/tdx: Validate TD attributes

2024-11-05 Thread Edgecombe, Rick P
On Tue, 2024-11-05 at 01:23 -0500, Xiaoyao Li wrote: > -static void setup_td_guest_attributes(X86CPU *x86cpu) > +static int tdx_validate_attributes(TdxGuest *tdx, Error **errp) > +{ > +    if ((tdx->attributes & ~tdx_caps->supported_attrs)) { > +    error_setg(errp, "Invalid attributes 0x%l

Re: [PATCH v6 13/60] i386/tdx: Validate TD attributes

2024-11-05 Thread Daniel P . Berrangé
On Tue, Nov 05, 2024 at 07:53:57PM +0800, Xiaoyao Li wrote: > On 11/5/2024 6:36 PM, Daniel P. Berrangé wrote: > > On Tue, Nov 05, 2024 at 01:23:21AM -0500, Xiaoyao Li wrote: > > > Validate TD attributes with tdx_caps that fixed-0 bits must be zero and > > > fixed-1 bits must be set. > > > > > > Be

Re: [PATCH v6 13/60] i386/tdx: Validate TD attributes

2024-11-05 Thread Xiaoyao Li
On 11/5/2024 6:36 PM, Daniel P. Berrangé wrote: On Tue, Nov 05, 2024 at 01:23:21AM -0500, Xiaoyao Li wrote: Validate TD attributes with tdx_caps that fixed-0 bits must be zero and fixed-1 bits must be set. Besides, sanity check the attribute bits that have not been supported by QEMU yet. e.g.,

Re: [PATCH v6 13/60] i386/tdx: Validate TD attributes

2024-11-05 Thread Daniel P . Berrangé
On Tue, Nov 05, 2024 at 01:23:21AM -0500, Xiaoyao Li wrote: > Validate TD attributes with tdx_caps that fixed-0 bits must be zero and > fixed-1 bits must be set. > > Besides, sanity check the attribute bits that have not been supported by > QEMU yet. e.g., debug bit, it will be allowed in the futu

[PATCH v6 13/60] i386/tdx: Validate TD attributes

2024-11-04 Thread Xiaoyao Li
Validate TD attributes with tdx_caps that fixed-0 bits must be zero and fixed-1 bits must be set. Besides, sanity check the attribute bits that have not been supported by QEMU yet. e.g., debug bit, it will be allowed in the future when debug TD support lands in QEMU. Signed-off-by: Xiaoyao Li Ac