[PATCH 2/2] i386/tdx: Don't build TDX for 32bit target

Xiaoyao Li posted 2 patches 4 months, 3 weeks ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Zhao Liu <zhao1.liu@intel.com>
[PATCH 2/2] i386/tdx: Don't build TDX for 32bit target
Posted by Xiaoyao Li 4 months, 3 weeks ago
TDX cannot work on 32-bit host. It's also not worth supported TDX with
32-bit QEMU.

Thus, make TDX depends on !I386.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 hw/i386/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 6fc353930985..c58802462a45 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -13,7 +13,7 @@ config SGX
 config TDX
     bool
     select X86_FW_OVMF
-    depends on KVM
+    depends on KVM && !I386
 
 config PC
     bool
-- 
2.43.0
Re: [PATCH 2/2] i386/tdx: Don't build TDX for 32bit target
Posted by Cédric Le Goater 4 months, 3 weeks ago
On 6/25/25 05:49, Xiaoyao Li wrote:
> TDX cannot work on 32-bit host. It's also not worth supported TDX with
> 32-bit QEMU.
> 
> Thus, make TDX depends on !I386.
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
>   hw/i386/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index 6fc353930985..c58802462a45 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -13,7 +13,7 @@ config SGX
>   config TDX
>       bool
>       select X86_FW_OVMF
> -    depends on KVM
> +    depends on KVM && !I386
>   
>   config PC
>       bool

Both patches look OK.

Out of curiosity, would the change below work as well (without patch 1) ?

Thanks,

C.




@@ -13,7 +13,7 @@ config SGX
  config TDX
      bool
      select X86_FW_OVMF
-    depends on KVM
+    depends on KVM && X86_64
  
  config PC
      bool
Re: [PATCH 2/2] i386/tdx: Don't build TDX for 32bit target
Posted by Xiaoyao Li 4 months, 3 weeks ago
On 6/25/2025 1:59 PM, Cédric Le Goater wrote:
> On 6/25/25 05:49, Xiaoyao Li wrote:
>> TDX cannot work on 32-bit host. It's also not worth supported TDX with
>> 32-bit QEMU.
>>
>> Thus, make TDX depends on !I386.
>>
>> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
>> ---
>>   hw/i386/Kconfig | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
>> index 6fc353930985..c58802462a45 100644
>> --- a/hw/i386/Kconfig
>> +++ b/hw/i386/Kconfig
>> @@ -13,7 +13,7 @@ config SGX
>>   config TDX
>>       bool
>>       select X86_FW_OVMF
>> -    depends on KVM
>> +    depends on KVM && !I386
>>   config PC
>>       bool
> 
> Both patches look OK.
> 
> Out of curiosity, would the change below work as well (without patch 1) ?
> 
> Thanks,
> 
> C.
> 
> 
> 
> 
> @@ -13,7 +13,7 @@ config SGX
>   config TDX
>       bool
>       select X86_FW_OVMF
> -    depends on KVM
> +    depends on KVM && X86_64
> 
>   config PC
>       bool
> 

It works! (It turns out I'm not clever enough)

Let's leave it to Paolo to pick.

Re: [PATCH 2/2] i386/tdx: Don't build TDX for 32bit target
Posted by Cédric Le Goater 4 months, 3 weeks ago
On 6/25/25 08:36, Xiaoyao Li wrote:
> On 6/25/2025 1:59 PM, Cédric Le Goater wrote:
>> On 6/25/25 05:49, Xiaoyao Li wrote:
>>> TDX cannot work on 32-bit host. It's also not worth supported TDX with
>>> 32-bit QEMU.
>>>
>>> Thus, make TDX depends on !I386.
>>>
>>> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
>>> ---
>>>   hw/i386/Kconfig | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
>>> index 6fc353930985..c58802462a45 100644
>>> --- a/hw/i386/Kconfig
>>> +++ b/hw/i386/Kconfig
>>> @@ -13,7 +13,7 @@ config SGX
>>>   config TDX
>>>       bool
>>>       select X86_FW_OVMF
>>> -    depends on KVM
>>> +    depends on KVM && !I386
>>>   config PC
>>>       bool
>>
>> Both patches look OK.
>>
>> Out of curiosity, would the change below work as well (without patch 1) ?
>>
>> Thanks,
>>
>> C.
>>
>>
>>
>>
>> @@ -13,7 +13,7 @@ config SGX
>>   config TDX
>>       bool
>>       select X86_FW_OVMF
>> -    depends on KVM
>> +    depends on KVM && X86_64
>>
>>   config PC
>>       bool
>>
> 
> It works! (It turns out I'm not clever enough)
>
> Let's leave it to Paolo to pick.

Could you please resend a v2 so someone can merge it while Paolo is on PTO ?

Thanks,

C.