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>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH v2 1/9] system: Define ram_addr_t to be always uint64_t
Date: Tue, 18 Aug 2026 13:20:04 -0400 [thread overview]
Message-ID: <20260818172012.3052821-2-peterx@redhat.com> (raw)
In-Reply-To: <20260818172012.3052821-1-peterx@redhat.com>
QEMU's 32bit host support was deprecated since 10.0 and removed in
11.0 (commit 372ec46b9f), at least system emulation part (cf634dfcd8fc
revived tools). Now it's safe to move ram_addr_t completely over to
uint64_t.
It should be almost the same as uintptr_t as before for !Xen, except that
on some systems (like MacOS) uintptr_t and uint64_t can be typed slightly
differently, causing unnecessary compiler warnings when use them in a
mixture way.
Hopefully, this change also makes it clear that ram_addr_t is never used as
a host pointer in any form, but only an internal QEMU integer based address
space for allocating ramblocks.
[1] https://lore.kernel.org/r/d7b2fbf6-f9fa-4b39-8f40-95b7d5d0d8fb@oss.qualcomm.com
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@mailo.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
include/system/ram_addr.h | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/include/system/ram_addr.h b/include/system/ram_addr.h
index 129f6b8757..044c0b52cc 100644
--- a/include/system/ram_addr.h
+++ b/include/system/ram_addr.h
@@ -14,16 +14,14 @@
#ifndef RAM_ADDR_H
#define RAM_ADDR_H
-/* address in the RAM (different from a physical address) */
-#if defined(CONFIG_XEN_BACKEND)
+/*
+ * QEMU's internal RAM address space for ramblock allocations (different
+ * from guest physical address).
+ */
typedef uint64_t ram_addr_t;
-# define RAM_ADDR_MAX UINT64_MAX
-# define RAM_ADDR_FMT "%" PRIx64
-#else
-typedef uintptr_t ram_addr_t;
-# define RAM_ADDR_MAX UINTPTR_MAX
-# define RAM_ADDR_FMT "%" PRIxPTR
-#endif
+
+#define RAM_ADDR_MAX UINT64_MAX
+#define RAM_ADDR_FMT "%" PRIx64
#define DIRTY_MEMORY_VGA 0
#define DIRTY_MEMORY_CODE 1
--
2.54.0
next prev parent reply other threads:[~2026-08-18 17:22 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 ` Peter Xu [this message]
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 ` [PATCH v2 6/9] linux-user: " Peter Xu
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-2-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=philmd@oss.qualcomm.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.