Skip to contentSkip to conversation

i386: Don't build TDX for 32-bit target

PATCH In review Xiaoyao Li 2 participants 6 messages Jun 25, 2025

lore
Share & tools
lore

Xiaoyao Li

author
#0 lore raw

cover i386: Don't build TDX for 32-bit target

Build errors of TDX were reported when built on 32-bit host[1][2]. People were agreed to disable TDX on 32-bit build[3].

This series implemnts the agreement that it makes TDX available when !I386.

[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/
[3] https://lore.kernel.org/qemu-devel/[email protected]/

Xiaoyao Li (2):
i386/Kconfig: Make I386 and X86_64 independant
i386/tdx: Don't build TDX for 32bit target

 hw/i386/Kconfig     | 12 ++++++------
 target/i386/Kconfig |  1 -
 2 files changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 1/2 i386/Kconfig: Make I386 and X86_64 independant

Commit 4921d0a7535b ('i386: switch boards to "default y"') makes CONIFG_X86_64 select CONFIG_I386, which makes it difficult to define X86_64 only configs, e.g., for TDX.

Decouple I386 from X86_64.

---
 hw/i386/Kconfig     | 10 +++++-----
 target/i386/Kconfig |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)
hw/i386/Kconfig +5 -5
index eb65bda6e071..6fc353930985 100644
@@ -74,7 +74,7 @@ config PC_ACPI
 config I440FX
     bool
     default y
-    depends on I386
+    depends on (I386 || X86_64)
     imply E1000_PCI
     imply VMPORT
     imply VMMOUSE
@@ -91,7 +91,7 @@ config I440FX
 config ISAPC
     bool
     default y
-    depends on I386
+    depends on (I386 || X86_64)
     imply VGA_ISA
     select ISA_BUS
     select PC
@@ -103,7 +103,7 @@ config ISAPC
 config Q35
     bool
     default y
-    depends on I386
+    depends on (I386 || X86_64)
     imply VTD
     imply AMD_IOMMU
     imply E1000E_PCI_EXPRESS
@@ -122,7 +122,7 @@ config Q35
 config MICROVM
     bool
     default y
-    depends on I386 && FDT
+    depends on (I386 || X86_64) && FDT
     select DEVICE_TREE
     select SERIAL_ISA # for serial_hds_isa_init()
     select ISA_BUS
@@ -168,4 +168,4 @@ config VMMOUSE
 config XEN_EMU
     bool
     default y
-    depends on KVM && I386
+    depends on KVM && (I386 || X86_64)
target/i386/Kconfig +0 -1
index 6b0feef02997..f16efa7137d5 100644
@@ -6,4 +6,3 @@ config I386
 
 config X86_64
     bool
-    select I386
Signature · 1 line
2.43.0
author
#2 lore raw

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

In reply to Xiaoyao Li

TDX cannot work on 32-bit host. It's also not worth supported TDX with 32-bit QEMU.

Thus, make TDX depends on !I386.

---
 hw/i386/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/Kconfig +1 -1
index 6fc353930985..c58802462a45 100644
@@ -13,7 +13,7 @@ config SGX
 config TDX
     bool
     select X86_FW_OVMF
-    depends on KVM
+    depends on KVM && !I386
 
 config PC
     bool
Signature · 1 line
2.43.0
#3 lore raw

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

Quoted 15 lines · Xiaoyao Li

TDX cannot work on 32-bit host. It's also not worth supported TDX with 32-bit QEMU.

Thus, make TDX depends on !I386.

---
  hw/i386/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/Kconfig +0 -0
index 6fc353930985..c58802462a45 100644

hw/i386/Kconfig config SGX · line 19

Quoted 8 lines
hw/i386/Kconfig +1 -1
@@ -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

author
#4 lore raw

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

Quoted 37 lines · Cédric Le Goater
Quoted 15 lines · Xiaoyao Li

TDX cannot work on 32-bit host. It's also not worth supported TDX with 32-bit QEMU.

Thus, make TDX depends on !I386.

---
  hw/i386/Kconfig | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/Kconfig +0 -0
index 6fc353930985..c58802462a45 100644
@@ -13,7 +13,7 @@ config SGX
Quoted 7 lines

  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.

hw/i386/Kconfig config SGX · line 19

Quoted 8 lines
hw/i386/Kconfig +1 -1
@@ -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.

#5 lore raw

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

Quoted 43 lines · Xiaoyao Li
Quoted 42 lines · Cédric Le Goater
Quoted 15 lines · Xiaoyao Li

TDX cannot work on 32-bit host. It's also not worth supported TDX with 32-bit QEMU.

Thus, make TDX depends on !I386.

---
  hw/i386/Kconfig | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/Kconfig +0 -0
index 6fc353930985..c58802462a45 100644
@@ -13,7 +13,7 @@ config SGX
Quoted 7 lines

  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.

(quoted diff) +0 -0
@@ -13,7 +13,7 @@ config SGX

  config TDX
      bool
      select X86_FW_OVMF
-    depends on KVM
+    depends on KVM && X86_64

Quoted 7 lines
Quoted 3 lines

  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.