Skip to contentSkip to conversation

i386/tdx: Fix build on 32-bit host

PATCH New Cédric Le Goater 1 participant 1 message Jun 23, 2025 x86 trust domain extensions (TDX)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386/tdx: Fix build on 32-bit host

---
 target/i386/kvm/tdx-quote-generator.c |  6 +++---
 target/i386/kvm/tdx.c                 | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)
target/i386/kvm/tdx-quote-generator.c +3 -3
index f59715f61751..3a31a4a68365 100644
@@ -113,7 +113,7 @@ static gboolean tdx_get_quote_read(QIOChannel *ioc, GIOCondition condition,
                                      task->receive_buf_received);
         if (len == 0 ||
             len > (task->payload_len - HEADER_SIZE)) {
-            error_report("Message len %u must be non-zero & less than %zu",
+            error_report("Message len %u must be non-zero & less than %"PRIu64,
                          len, (task->payload_len - HEADER_SIZE));
             task->status_code = TDX_VP_GET_QUOTE_ERROR;
             goto end;
@@ -143,7 +143,7 @@ static gboolean tdx_get_quote_read(QIOChannel *ioc, GIOCondition condition,
             goto end;
         }
         if (hdr->size > (task->payload_len - HEADER_SIZE)) {
-            error_report("QGS message size %d exceeds payload capacity %zu",
+            error_report("QGS message size %d exceeds payload capacity %"PRIu64,
                          hdr->size, task->payload_len);
             task->status_code = TDX_VP_GET_QUOTE_ERROR;
             goto end;
@@ -166,7 +166,7 @@ static gboolean tdx_get_quote_read(QIOChannel *ioc, GIOCondition condition,
 
         if ((task->payload_len - HEADER_SIZE - sizeof(qgs_msg_get_quote_resp_t)) !=
             msg->quote_size) {
-            error_report("QGS quote size %d should be %zu",
+            error_report("QGS quote size %d should be %"PRIu64,
                          msg->quote_size,
                          (task->payload_len - sizeof(qgs_msg_get_quote_resp_t)));
             task->status_code = TDX_VP_GET_QUOTE_ERROR;
target/i386/kvm/tdx.c +6 -6
index e809e4b2dfa2..c98109dadc2e 100644
@@ -1035,8 +1035,8 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
             return -1;
         }
         if (data_len != QCRYPTO_HASH_DIGEST_LEN_SHA384) {
-            error_setg(errp, "TDX 'mrconfigid' sha384 digest was %ld bytes, "
-                             "expected %d bytes", data_len,
+            error_setg(errp, "TDX 'mrconfigid' sha384 digest was %"PRId64" bytes, "
+                             "expected %d bytes", (uint64_t)data_len,
                              QCRYPTO_HASH_DIGEST_LEN_SHA384);
             return -1;
         }
@@ -1050,8 +1050,8 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
             return -1;
         }
         if (data_len != QCRYPTO_HASH_DIGEST_LEN_SHA384) {
-            error_setg(errp, "TDX 'mrowner' sha384 digest was %ld bytes, "
-                             "expected %d bytes", data_len,
+            error_setg(errp, "TDX 'mrowner' sha384 digest was %"PRId64" bytes, "
+                             "expected %d bytes", (uint64_t)data_len,
                              QCRYPTO_HASH_DIGEST_LEN_SHA384);
             return -1;
         }
@@ -1065,8 +1065,8 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
             return -1;
         }
         if (data_len != QCRYPTO_HASH_DIGEST_LEN_SHA384) {
-            error_setg(errp, "TDX 'mrownerconfig' sha384 digest was %ld bytes, "
-                             "expected %d bytes", data_len,
+            error_setg(errp, "TDX 'mrownerconfig' sha384 digest was %"PRId64" bytes, "
+                             "expected %d bytes", (uint64_t)data_len,
                              QCRYPTO_HASH_DIGEST_LEN_SHA384);
             return -1;
         }
Signature · 1 line
2.49.0