[PATCH 0/3] Widen QEMU_ARCH_* and arch_bitmask to uint64_t

Yonggang Luo posted 3 patches 3 weeks, 5 days ago
Failed in applying to current master (apply log)
include/qemu/base-arch-defs.h  | 67 ++++++++++++++++++----------------
monitor/monitor-hmp-internal.h |  2 +-
system/arch_init.c             |  4 +-
system/qdev-monitor.c          |  2 +-
system/vl.c                    |  2 +-
5 files changed, 40 insertions(+), 37 deletions(-)
[PATCH 0/3] Widen QEMU_ARCH_* and arch_bitmask to uint64_t
Posted by Yonggang Luo 3 weeks, 5 days ago
QEMU_ARCH_* was defined as (1UL << target).  unsigned long is 32 bits
on Windows and 64 bits on LP64 hosts, so the mask width depended on
the host data model.  Define the bits with 1ULL and store every
arch_bitmask as uint64_t.
SYS_EMU_TARGET__MAX is already 29.  With a 32-bit mask, __MAX has to
stay at most 31, so there is almost no room for new targets.  A
uint64_t mask raises that ceiling to 63.  It stays 63, rather than
64, so the all-targets mask still fits in the int64_t range used by
qemu_opt_set_number().

Yonggang Luo (3):
  qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
  qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
  qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits

 include/qemu/base-arch-defs.h  | 67 ++++++++++++++++++----------------
 monitor/monitor-hmp-internal.h |  2 +-
 system/arch_init.c             |  4 +-
 system/qdev-monitor.c          |  2 +-
 system/vl.c                    |  2 +-
 5 files changed, 40 insertions(+), 37 deletions(-)

-- 
2.55.0.windows.3
Re: [PATCH 0/3] Widen QEMU_ARCH_* and arch_bitmask to uint64_t
Posted by Pierrick Bouvier 3 weeks, 5 days ago
On 10/26/2026 10:15 PM, Yonggang Luo wrote:
> QEMU_ARCH_* was defined as (1UL << target).  unsigned long is 32 bits
> on Windows and 64 bits on LP64 hosts, so the mask width depended on
> the host data model.  Define the bits with 1ULL and store every
> arch_bitmask as uint64_t.
> SYS_EMU_TARGET__MAX is already 29.  With a 32-bit mask, __MAX has to
> stay at most 31, so there is almost no room for new targets.  A
> uint64_t mask raises that ceiling to 63.  It stays 63, rather than
> 64, so the all-targets mask still fits in the int64_t range used by
> qemu_opt_set_number().
> 
> Yonggang Luo (3):
>   qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
>   qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
>   qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits
> 
>  include/qemu/base-arch-defs.h  | 67 ++++++++++++++++++----------------
>  monitor/monitor-hmp-internal.h |  2 +-
>  system/arch_init.c             |  4 +-
>  system/qdev-monitor.c          |  2 +-
>  system/vl.c                    |  2 +-
>  5 files changed, 40 insertions(+), 37 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Re: [PATCH 0/3] Widen QEMU_ARCH_* and arch_bitmask to uint64_t
Posted by Philippe Mathieu-Daudé 3 weeks, 5 days ago
On 27/10/26 07:15, Yonggang Luo wrote:
> QEMU_ARCH_* was defined as (1UL << target).  unsigned long is 32 bits
> on Windows and 64 bits on LP64 hosts, so the mask width depended on
> the host data model.  Define the bits with 1ULL and store every
> arch_bitmask as uint64_t.
> SYS_EMU_TARGET__MAX is already 29.  With a 32-bit mask, __MAX has to
> stay at most 31, so there is almost no room for new targets.  A
> uint64_t mask raises that ceiling to 63.  It stays 63, rather than
> 64, so the all-targets mask still fits in the int64_t range used by
> qemu_opt_set_number().
> 
> Yonggang Luo (3):
>    qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
>    qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
>    qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits

Series:Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>