qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] i386/tdx: Fix build on 32-bit host
@ 2025-06-02 17:30 Cédric Le Goater
  2025-06-02 17:31 ` [PATCH 1/2] " Cédric Le Goater
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Cédric Le Goater @ 2025-06-02 17:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Eduardo Habkost, Marcelo Tosatti,
	Cédric Le Goater

Hello,

Here is a little series fixing a build break on 32-bit host.

Thanks,

C.

Cédric Le Goater (2):
  i386/tdx: Fix build on 32-bit host
  i386/tdvf: Fix build on 32-bit host

 hw/i386/tdvf.c        |  6 +++---
 target/i386/kvm/tdx.c | 26 +++++++++++++-------------
 2 files changed, 16 insertions(+), 16 deletions(-)

-- 
2.49.0



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-02 17:30 [PATCH 0/2] i386/tdx: Fix build on 32-bit host Cédric Le Goater
@ 2025-06-02 17:31 ` Cédric Le Goater
  2025-06-03  3:04   ` Xiaoyao Li
  2025-06-02 17:31 ` [PATCH 2/2] i386/tdvf: " Cédric Le Goater
  2025-06-03 14:52 ` [PATCH 0/2] i386/tdx: " Paolo Bonzini
  2 siblings, 1 reply; 11+ messages in thread
From: Cédric Le Goater @ 2025-06-02 17:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Eduardo Habkost, Marcelo Tosatti,
	Cédric Le Goater, Xiaoyao Li

Use PRI formats where required and fix pointer cast.

Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 target/i386/kvm/tdx.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 0a21ae555c5c..820ca3614e27 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -284,7 +284,7 @@ static void tdx_post_init_vcpus(void)
 
     hob = tdx_get_hob_entry(tdx_guest);
     CPU_FOREACH(cpu) {
-        tdx_vcpu_ioctl(cpu, KVM_TDX_INIT_VCPU, 0, (void *)hob->address,
+        tdx_vcpu_ioctl(cpu, KVM_TDX_INIT_VCPU, 0, (void *)(uintptr_t)hob->address,
                        &error_fatal);
     }
 }
@@ -339,7 +339,7 @@ static void tdx_finalize_vm(Notifier *notifier, void *unused)
         uint32_t flags;
 
         region = (struct kvm_tdx_init_mem_region) {
-            .source_addr = (uint64_t)entry->mem_ptr,
+            .source_addr = (uintptr_t)entry->mem_ptr,
             .gpa = entry->address,
             .nr_pages = entry->size >> 12,
         };
@@ -893,16 +893,16 @@ static int tdx_check_features(X86ConfidentialGuest *cg, CPUState *cs)
 static int tdx_validate_attributes(TdxGuest *tdx, Error **errp)
 {
     if ((tdx->attributes & ~tdx_caps->supported_attrs)) {
-        error_setg(errp, "Invalid attributes 0x%lx for TDX VM "
-                   "(KVM supported: 0x%llx)", tdx->attributes,
-                   tdx_caps->supported_attrs);
+        error_setg(errp, "Invalid attributes 0x%"PRIx64" for TDX VM "
+                   "(KVM supported: 0x%"PRIx64")", tdx->attributes,
+                   (uint64_t)tdx_caps->supported_attrs);
         return -1;
     }
 
     if (tdx->attributes & ~TDX_SUPPORTED_TD_ATTRS) {
         error_setg(errp, "Some QEMU unsupported TD attribute bits being "
-                    "requested: 0x%lx (QEMU supported: 0x%llx)",
-                    tdx->attributes, TDX_SUPPORTED_TD_ATTRS);
+                    "requested: 0x%"PRIx64" (QEMU supported: 0x%"PRIx64")",
+                    tdx->attributes, (uint64_t)TDX_SUPPORTED_TD_ATTRS);
         return -1;
     }
 
@@ -931,8 +931,8 @@ static int setup_td_xfam(X86CPU *x86cpu, Error **errp)
            env->features[FEAT_XSAVE_XSS_HI];
 
     if (xfam & ~tdx_caps->supported_xfam) {
-        error_setg(errp, "Invalid XFAM 0x%lx for TDX VM (supported: 0x%llx))",
-                   xfam, tdx_caps->supported_xfam);
+        error_setg(errp, "Invalid XFAM 0x%"PRIx64" for TDX VM (supported: 0x%"PRIx64"))",
+                   xfam, (uint64_t)tdx_caps->supported_xfam);
         return -1;
     }
 
@@ -999,14 +999,14 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
 
     if (env->tsc_khz && (env->tsc_khz < TDX_MIN_TSC_FREQUENCY_KHZ ||
                          env->tsc_khz > TDX_MAX_TSC_FREQUENCY_KHZ)) {
-        error_setg(errp, "Invalid TSC %ld KHz, must specify cpu_frequency "
+        error_setg(errp, "Invalid TSC %"PRId64" KHz, must specify cpu_frequency "
                          "between [%d, %d] kHz", env->tsc_khz,
                          TDX_MIN_TSC_FREQUENCY_KHZ, TDX_MAX_TSC_FREQUENCY_KHZ);
        return -EINVAL;
     }
 
     if (env->tsc_khz % (25 * 1000)) {
-        error_setg(errp, "Invalid TSC %ld KHz, it must be multiple of 25MHz",
+        error_setg(errp, "Invalid TSC %"PRId64" KHz, it must be multiple of 25MHz",
                    env->tsc_khz);
         return -EINVAL;
     }
@@ -1014,7 +1014,7 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
     /* it's safe even env->tsc_khz is 0. KVM uses host's tsc_khz in this case */
     r = kvm_vm_ioctl(kvm_state, KVM_SET_TSC_KHZ, env->tsc_khz);
     if (r < 0) {
-        error_setg_errno(errp, -r, "Unable to set TSC frequency to %ld kHz",
+        error_setg_errno(errp, -r, "Unable to set TSC frequency to %"PRId64" kHz",
                          env->tsc_khz);
         return r;
     }
@@ -1139,7 +1139,7 @@ int tdx_handle_report_fatal_error(X86CPU *cpu, struct kvm_run *run)
     uint64_t gpa = -1ull;
 
     if (error_code & 0xffff) {
-        error_report("TDX: REPORT_FATAL_ERROR: invalid error code: 0x%lx",
+        error_report("TDX: REPORT_FATAL_ERROR: invalid error code: 0x%"PRIx64,
                      error_code);
         return -1;
     }
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] i386/tdvf: Fix build on 32-bit host
  2025-06-02 17:30 [PATCH 0/2] i386/tdx: Fix build on 32-bit host Cédric Le Goater
  2025-06-02 17:31 ` [PATCH 1/2] " Cédric Le Goater
@ 2025-06-02 17:31 ` Cédric Le Goater
  2025-06-03 14:52 ` [PATCH 0/2] i386/tdx: " Paolo Bonzini
  2 siblings, 0 replies; 11+ messages in thread
From: Cédric Le Goater @ 2025-06-02 17:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Eduardo Habkost, Marcelo Tosatti,
	Cédric Le Goater, Isaku Yamahata

Use PRI formats where required.

Cc: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/i386/tdvf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/i386/tdvf.c b/hw/i386/tdvf.c
index bd993ea2f07a..645d9d1294b4 100644
--- a/hw/i386/tdvf.c
+++ b/hw/i386/tdvf.c
@@ -101,16 +101,16 @@ static int tdvf_parse_and_check_section_entry(const TdvfSectionEntry *src,
 
     /* sanity check */
     if (entry->size < entry->data_len) {
-        error_report("Broken metadata RawDataSize 0x%x MemoryDataSize 0x%lx",
+        error_report("Broken metadata RawDataSize 0x%x MemoryDataSize 0x%"PRIx64,
                      entry->data_len, entry->size);
         return -1;
     }
     if (!QEMU_IS_ALIGNED(entry->address, TDVF_ALIGNMENT)) {
-        error_report("MemoryAddress 0x%lx not page aligned", entry->address);
+        error_report("MemoryAddress 0x%"PRIx64" not page aligned", entry->address);
         return -1;
     }
     if (!QEMU_IS_ALIGNED(entry->size, TDVF_ALIGNMENT)) {
-        error_report("MemoryDataSize 0x%lx not page aligned", entry->size);
+        error_report("MemoryDataSize 0x%"PRIx64" not page aligned", entry->size);
         return -1;
     }
 
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-02 17:31 ` [PATCH 1/2] " Cédric Le Goater
@ 2025-06-03  3:04   ` Xiaoyao Li
  2025-06-03 11:26     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 11+ messages in thread
From: Xiaoyao Li @ 2025-06-03  3:04 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-devel
  Cc: Paolo Bonzini, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Eduardo Habkost, Marcelo Tosatti

On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
> Use PRI formats where required and fix pointer cast.

Maybe we can make 32-bit build exclusive with CONFIG_TDX? since TDX is 
not supported on 32-bit host.

> Cc: Xiaoyao Li <xiaoyao.li@intel.com>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   target/i386/kvm/tdx.c | 26 +++++++++++++-------------
>   1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
> index 0a21ae555c5c..820ca3614e27 100644
> --- a/target/i386/kvm/tdx.c
> +++ b/target/i386/kvm/tdx.c
> @@ -284,7 +284,7 @@ static void tdx_post_init_vcpus(void)
>   
>       hob = tdx_get_hob_entry(tdx_guest);
>       CPU_FOREACH(cpu) {
> -        tdx_vcpu_ioctl(cpu, KVM_TDX_INIT_VCPU, 0, (void *)hob->address,
> +        tdx_vcpu_ioctl(cpu, KVM_TDX_INIT_VCPU, 0, (void *)(uintptr_t)hob->address,
>                          &error_fatal);
>       }
>   }
> @@ -339,7 +339,7 @@ static void tdx_finalize_vm(Notifier *notifier, void *unused)
>           uint32_t flags;
>   
>           region = (struct kvm_tdx_init_mem_region) {
> -            .source_addr = (uint64_t)entry->mem_ptr,
> +            .source_addr = (uintptr_t)entry->mem_ptr,
>               .gpa = entry->address,
>               .nr_pages = entry->size >> 12,
>           };
> @@ -893,16 +893,16 @@ static int tdx_check_features(X86ConfidentialGuest *cg, CPUState *cs)
>   static int tdx_validate_attributes(TdxGuest *tdx, Error **errp)
>   {
>       if ((tdx->attributes & ~tdx_caps->supported_attrs)) {
> -        error_setg(errp, "Invalid attributes 0x%lx for TDX VM "
> -                   "(KVM supported: 0x%llx)", tdx->attributes,
> -                   tdx_caps->supported_attrs);
> +        error_setg(errp, "Invalid attributes 0x%"PRIx64" for TDX VM "
> +                   "(KVM supported: 0x%"PRIx64")", tdx->attributes,
> +                   (uint64_t)tdx_caps->supported_attrs);
>           return -1;
>       }
>   
>       if (tdx->attributes & ~TDX_SUPPORTED_TD_ATTRS) {
>           error_setg(errp, "Some QEMU unsupported TD attribute bits being "
> -                    "requested: 0x%lx (QEMU supported: 0x%llx)",
> -                    tdx->attributes, TDX_SUPPORTED_TD_ATTRS);
> +                    "requested: 0x%"PRIx64" (QEMU supported: 0x%"PRIx64")",
> +                    tdx->attributes, (uint64_t)TDX_SUPPORTED_TD_ATTRS);
>           return -1;
>       }
>   
> @@ -931,8 +931,8 @@ static int setup_td_xfam(X86CPU *x86cpu, Error **errp)
>              env->features[FEAT_XSAVE_XSS_HI];
>   
>       if (xfam & ~tdx_caps->supported_xfam) {
> -        error_setg(errp, "Invalid XFAM 0x%lx for TDX VM (supported: 0x%llx))",
> -                   xfam, tdx_caps->supported_xfam);
> +        error_setg(errp, "Invalid XFAM 0x%"PRIx64" for TDX VM (supported: 0x%"PRIx64"))",
> +                   xfam, (uint64_t)tdx_caps->supported_xfam);
>           return -1;
>       }
>   
> @@ -999,14 +999,14 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
>   
>       if (env->tsc_khz && (env->tsc_khz < TDX_MIN_TSC_FREQUENCY_KHZ ||
>                            env->tsc_khz > TDX_MAX_TSC_FREQUENCY_KHZ)) {
> -        error_setg(errp, "Invalid TSC %ld KHz, must specify cpu_frequency "
> +        error_setg(errp, "Invalid TSC %"PRId64" KHz, must specify cpu_frequency "
>                            "between [%d, %d] kHz", env->tsc_khz,
>                            TDX_MIN_TSC_FREQUENCY_KHZ, TDX_MAX_TSC_FREQUENCY_KHZ);
>          return -EINVAL;
>       }
>   
>       if (env->tsc_khz % (25 * 1000)) {
> -        error_setg(errp, "Invalid TSC %ld KHz, it must be multiple of 25MHz",
> +        error_setg(errp, "Invalid TSC %"PRId64" KHz, it must be multiple of 25MHz",
>                      env->tsc_khz);
>           return -EINVAL;
>       }
> @@ -1014,7 +1014,7 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
>       /* it's safe even env->tsc_khz is 0. KVM uses host's tsc_khz in this case */
>       r = kvm_vm_ioctl(kvm_state, KVM_SET_TSC_KHZ, env->tsc_khz);
>       if (r < 0) {
> -        error_setg_errno(errp, -r, "Unable to set TSC frequency to %ld kHz",
> +        error_setg_errno(errp, -r, "Unable to set TSC frequency to %"PRId64" kHz",
>                            env->tsc_khz);
>           return r;
>       }
> @@ -1139,7 +1139,7 @@ int tdx_handle_report_fatal_error(X86CPU *cpu, struct kvm_run *run)
>       uint64_t gpa = -1ull;
>   
>       if (error_code & 0xffff) {
> -        error_report("TDX: REPORT_FATAL_ERROR: invalid error code: 0x%lx",
> +        error_report("TDX: REPORT_FATAL_ERROR: invalid error code: 0x%"PRIx64,
>                        error_code);
>           return -1;
>       }



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-03  3:04   ` Xiaoyao Li
@ 2025-06-03 11:26     ` Philippe Mathieu-Daudé
  2025-06-03 14:53       ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-03 11:26 UTC (permalink / raw)
  To: Xiaoyao Li, Cédric Le Goater, qemu-devel
  Cc: Paolo Bonzini, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Eduardo Habkost, Marcelo Tosatti

On 3/6/25 05:04, Xiaoyao Li wrote:
> On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
>> Use PRI formats where required and fix pointer cast.
> 
> Maybe we can make 32-bit build exclusive with CONFIG_TDX? since TDX is 
> not supported on 32-bit host.

Yes please!

> 
>> Cc: Xiaoyao Li <xiaoyao.li@intel.com>
>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>> ---
>>   target/i386/kvm/tdx.c | 26 +++++++++++++-------------
>>   1 file changed, 13 insertions(+), 13 deletions(-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] i386/tdx: Fix build on 32-bit host
  2025-06-02 17:30 [PATCH 0/2] i386/tdx: Fix build on 32-bit host Cédric Le Goater
  2025-06-02 17:31 ` [PATCH 1/2] " Cédric Le Goater
  2025-06-02 17:31 ` [PATCH 2/2] i386/tdvf: " Cédric Le Goater
@ 2025-06-03 14:52 ` Paolo Bonzini
  2 siblings, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2025-06-03 14:52 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: qemu-devel, Michael S . Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Eduardo Habkost, Marcelo Tosatti

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-03 11:26     ` Philippe Mathieu-Daudé
@ 2025-06-03 14:53       ` Paolo Bonzini
  2025-06-06  8:49         ` Xiaoyao Li
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2025-06-03 14:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Xiaoyao Li, Cédric Le Goater,
	qemu-devel
  Cc: Michael S. Tsirkin, Richard Henderson, Marcel Apfelbaum,
	Eduardo Habkost, Marcelo Tosatti

On 6/3/25 13:26, Philippe Mathieu-Daudé wrote:
> On 3/6/25 05:04, Xiaoyao Li wrote:
>> On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
>>> Use PRI formats where required and fix pointer cast.
>>
>> Maybe we can make 32-bit build exclusive with CONFIG_TDX? since TDX is 
>> not supported on 32-bit host.
> 
> Yes please!

No objections, but I'm still applying these first to fix the build.

Paolo



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-03 14:53       ` Paolo Bonzini
@ 2025-06-06  8:49         ` Xiaoyao Li
  2025-06-06  9:19           ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 11+ messages in thread
From: Xiaoyao Li @ 2025-06-06  8:49 UTC (permalink / raw)
  To: Paolo Bonzini, Philippe Mathieu-Daudé, Cédric Le Goater,
	qemu-devel
  Cc: Michael S. Tsirkin, Richard Henderson, Marcel Apfelbaum,
	Eduardo Habkost, Marcelo Tosatti

On 6/3/2025 10:53 PM, Paolo Bonzini wrote:
> On 6/3/25 13:26, Philippe Mathieu-Daudé wrote:
>> On 3/6/25 05:04, Xiaoyao Li wrote:
>>> On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
>>>> Use PRI formats where required and fix pointer cast.
>>>
>>> Maybe we can make 32-bit build exclusive with CONFIG_TDX? since TDX 
>>> is not supported on 32-bit host.
>>
>> Yes please!
> 
> No objections, but I'm still applying these first to fix the build.

Can anyone guide how to implement it? Or directly help cook a patch?

I'm struggling to learn the 32-bit build stuff and create a 32-bit 
environment.

> Paolo
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-06  8:49         ` Xiaoyao Li
@ 2025-06-06  9:19           ` Philippe Mathieu-Daudé
  2025-06-06  9:28             ` Xiaoyao Li
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-06  9:19 UTC (permalink / raw)
  To: Xiaoyao Li, Paolo Bonzini, Cédric Le Goater, qemu-devel
  Cc: Michael S. Tsirkin, Richard Henderson, Marcel Apfelbaum,
	Eduardo Habkost, Marcelo Tosatti

On 6/6/25 10:49, Xiaoyao Li wrote:
> On 6/3/2025 10:53 PM, Paolo Bonzini wrote:
>> On 6/3/25 13:26, Philippe Mathieu-Daudé wrote:
>>> On 3/6/25 05:04, Xiaoyao Li wrote:
>>>> On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
>>>>> Use PRI formats where required and fix pointer cast.
>>>>
>>>> Maybe we can make 32-bit build exclusive with CONFIG_TDX? since TDX 
>>>> is not supported on 32-bit host.
>>>
>>> Yes please!
>>
>> No objections, but I'm still applying these first to fix the build.
> 
> Can anyone guide how to implement it? Or directly help cook a patch?
> 
> I'm struggling to learn the 32-bit build stuff and create a 32-bit 
> environment.

-- >8 --
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index eb65bda6e07..b5970f9a1f3 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

---


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-06  9:19           ` Philippe Mathieu-Daudé
@ 2025-06-06  9:28             ` Xiaoyao Li
  2025-06-06  9:38               ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 11+ messages in thread
From: Xiaoyao Li @ 2025-06-06  9:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Paolo Bonzini, Cédric Le Goater,
	qemu-devel
  Cc: Michael S. Tsirkin, Richard Henderson, Marcel Apfelbaum,
	Eduardo Habkost, Marcelo Tosatti

On 6/6/2025 5:19 PM, Philippe Mathieu-Daudé wrote:
> On 6/6/25 10:49, Xiaoyao Li wrote:
>> On 6/3/2025 10:53 PM, Paolo Bonzini wrote:
>>> On 6/3/25 13:26, Philippe Mathieu-Daudé wrote:
>>>> On 3/6/25 05:04, Xiaoyao Li wrote:
>>>>> On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
>>>>>> Use PRI formats where required and fix pointer cast.
>>>>>
>>>>> Maybe we can make 32-bit build exclusive with CONFIG_TDX? since TDX 
>>>>> is not supported on 32-bit host.
>>>>
>>>> Yes please!
>>>
>>> No objections, but I'm still applying these first to fix the build.
>>
>> Can anyone guide how to implement it? Or directly help cook a patch?
>>
>> I'm struggling to learn the 32-bit build stuff and create a 32-bit 
>> environment.
> 
> -- >8 --
> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index eb65bda6e07..b5970f9a1f3 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_X86_64 selects I386 in target/i386/Kconfig, so above change will 
just leads to CONFIG_TDX always being 0.

config X86_64
     bool
     select I386






^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] i386/tdx: Fix build on 32-bit host
  2025-06-06  9:28             ` Xiaoyao Li
@ 2025-06-06  9:38               ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-06  9:38 UTC (permalink / raw)
  To: Xiaoyao Li, Paolo Bonzini, Cédric Le Goater, qemu-devel
  Cc: Michael S. Tsirkin, Richard Henderson, Marcel Apfelbaum,
	Eduardo Habkost, Marcelo Tosatti

On 6/6/25 11:28, Xiaoyao Li wrote:
> On 6/6/2025 5:19 PM, Philippe Mathieu-Daudé wrote:
>> On 6/6/25 10:49, Xiaoyao Li wrote:
>>> On 6/3/2025 10:53 PM, Paolo Bonzini wrote:
>>>> On 6/3/25 13:26, Philippe Mathieu-Daudé wrote:
>>>>> On 3/6/25 05:04, Xiaoyao Li wrote:
>>>>>> On 6/3/2025 1:31 AM, Cédric Le Goater wrote:
>>>>>>> Use PRI formats where required and fix pointer cast.
>>>>>>
>>>>>> Maybe we can make 32-bit build exclusive with CONFIG_TDX? since 
>>>>>> TDX is not supported on 32-bit host.
>>>>>
>>>>> Yes please!
>>>>
>>>> No objections, but I'm still applying these first to fix the build.
>>>
>>> Can anyone guide how to implement it? Or directly help cook a patch?
>>>
>>> I'm struggling to learn the 32-bit build stuff and create a 32-bit 
>>> environment.
>>
>> -- >8 --
>> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
>> index eb65bda6e07..b5970f9a1f3 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_X86_64 selects I386 in target/i386/Kconfig, so above change will 
> just leads to CONFIG_TDX always being 0.
> 
> config X86_64
>      bool
>      select I386

Doh. We could expose TARGET_LONG_BITS to Kconfig (see commit 
bae3e3a5c6b, "meson: make target endianneess available to Kconfig"),
but there is likely a clever way.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-06-06  9:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 17:30 [PATCH 0/2] i386/tdx: Fix build on 32-bit host Cédric Le Goater
2025-06-02 17:31 ` [PATCH 1/2] " Cédric Le Goater
2025-06-03  3:04   ` Xiaoyao Li
2025-06-03 11:26     ` Philippe Mathieu-Daudé
2025-06-03 14:53       ` Paolo Bonzini
2025-06-06  8:49         ` Xiaoyao Li
2025-06-06  9:19           ` Philippe Mathieu-Daudé
2025-06-06  9:28             ` Xiaoyao Li
2025-06-06  9:38               ` Philippe Mathieu-Daudé
2025-06-02 17:31 ` [PATCH 2/2] i386/tdvf: " Cédric Le Goater
2025-06-03 14:52 ` [PATCH 0/2] i386/tdx: " Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).