From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Peter Xu" <peterx@redhat.com>
Subject: [PATCH v2 6/9] linux-user: Remove 32bit host support in thunk_convert|print()
Date: Tue, 18 Aug 2026 13:20:09 -0400 [thread overview]
Message-ID: <20260818172012.3052821-7-peterx@redhat.com> (raw)
In-Reply-To: <20260818172012.3052821-1-peterx@redhat.com>
QEMU has switched to 64bit-only hosts for all system/user emulations.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
linux-user/thunk.c | 47 +++-------------------------------------------
1 file changed, 3 insertions(+), 44 deletions(-)
diff --git a/linux-user/thunk.c b/linux-user/thunk.c
index 3cd19e79c6..892ff3d154 100644
--- a/linux-user/thunk.c
+++ b/linux-user/thunk.c
@@ -145,13 +145,7 @@ const argtype *thunk_convert(void *dst, const void *src,
case TYPE_ULONGLONG:
*(uint64_t *)dst = tswap64(*(uint64_t *)src);
break;
-#if HOST_LONG_BITS == 32 && TARGET_ABI_BITS == 32
- case TYPE_LONG:
- case TYPE_ULONG:
- case TYPE_PTRVOID:
- *(uint32_t *)dst = tswap32(*(uint32_t *)src);
- break;
-#elif HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_PTRVOID:
@@ -166,27 +160,12 @@ const argtype *thunk_convert(void *dst, const void *src,
*(uint32_t *)dst = tswap32(*(uint64_t *)src & 0xffffffff);
}
break;
-#elif HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
+#elif TARGET_ABI_BITS == 64
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_PTRVOID:
*(uint64_t *)dst = tswap64(*(uint64_t *)src);
break;
-#elif HOST_LONG_BITS == 32 && TARGET_ABI_BITS == 64
- case TYPE_LONG:
- case TYPE_ULONG:
- case TYPE_PTRVOID:
- if (to_host) {
- *(uint32_t *)dst = tswap64(*(uint64_t *)src);
- } else {
- if (type == TYPE_LONG) {
- /* sign extension */
- *(uint64_t *)dst = tswap64(*(int32_t *)src);
- } else {
- *(uint64_t *)dst = tswap64(*(uint32_t *)src);
- }
- }
- break;
#else
#warning unsupported conversion
#endif
@@ -294,17 +273,7 @@ const argtype *thunk_print(void *arg, const argtype *type_ptr)
case TYPE_ULONGLONG:
qemu_log("%" PRIu64, tswap64(*(uint64_t *)arg));
break;
-#if HOST_LONG_BITS == 32 && TARGET_ABI_BITS == 32
- case TYPE_PTRVOID:
- qemu_log("0x%" PRIx32, tswap32(*(uint32_t *)arg));
- break;
- case TYPE_LONG:
- qemu_log("%" PRId32, tswap32(*(uint32_t *)arg));
- break;
- case TYPE_ULONG:
- qemu_log("%" PRIu32, tswap32(*(uint32_t *)arg));
- break;
-#elif HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32
case TYPE_PTRVOID:
qemu_log("0x%" PRIx32, tswap32(*(uint64_t *)arg & 0xffffffff));
break;
@@ -314,16 +283,6 @@ const argtype *thunk_print(void *arg, const argtype *type_ptr)
case TYPE_ULONG:
qemu_log("%" PRIu32, tswap32(*(uint64_t *)arg & 0xffffffff));
break;
-#elif HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
- case TYPE_PTRVOID:
- qemu_log("0x%" PRIx64, tswap64(*(uint64_t *)arg));
- break;
- case TYPE_LONG:
- qemu_log("%" PRId64, tswap64(*(uint64_t *)arg));
- break;
- case TYPE_ULONG:
- qemu_log("%" PRIu64, tswap64(*(uint64_t *)arg));
- break;
#else
case TYPE_PTRVOID:
qemu_log("0x%" PRIx64, tswap64(*(uint64_t *)arg));
--
2.54.0
next prev parent reply other threads:[~2026-08-18 17:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 17:20 [PATCH v2 0/9] Remove 32bit support on system/user emulations Peter Xu
2026-08-18 17:20 ` [PATCH v2 1/9] system: Define ram_addr_t to be always uint64_t Peter Xu
2026-08-18 17:20 ` [PATCH v2 2/9] hw/vexpress.c: Remove forced cast to u64 Peter Xu
2026-08-18 17:20 ` [PATCH v2 3/9] arm/mps: Remove 32bit define for MPS3_DDR_SIZE Peter Xu
2026-08-18 17:20 ` [PATCH v2 4/9] xen-mapcache: Remove 32bit support Peter Xu
2026-08-18 17:20 ` [PATCH v2 5/9] bsd-user: Remove 32bit host support in thunk_convert|print() Peter Xu
2026-08-18 17:20 ` Peter Xu [this message]
2026-08-18 17:20 ` [PATCH v2 7/9] arm/aspeed: Drop ASPEED_RAM_SIZE Peter Xu
2026-08-18 17:20 ` [PATCH v2 8/9] hw/arm/raspi4b: Drop board_rev for 32bit hosts Peter Xu
2026-08-18 17:20 ` [PATCH v2 9/9] machine: Remove 32bit limitation on ram size Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260818172012.3052821-7-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.