[PATCH 00/13] *-user: probe_guest_base improvments

Richard Henderson posted 13 patches 1 week, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260530211248.375318-1-richard.henderson@linaro.org
Maintainers: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
include/user/guest-host.h        |   1 +
include/user/mmap-min-addr.h     |  12 +
include/user/probe-guest-base.h  |  37 +++
include/{qemu => user}/selfmap.h |   0
linux-user/arm/target_elf.h      |   2 +-
linux-user/hppa/target_elf.h     |   2 +-
linux-user/user-internals.h      |  17 +-
bsd-user/elfload.c               |  37 +--
bsd-user/main.c                  |  42 +---
common-user/mmap-min-addr.c      |  50 ++++
common-user/probe-guest-base.c   | 347 +++++++++++++++++++++++++++
{util => common-user}/selfmap.c  |  45 +++-
linux-user/arm/elfload.c         |   2 +-
linux-user/elfload.c             | 400 ++-----------------------------
linux-user/flatload.c            |   3 +-
linux-user/hppa/elfload.c        |   4 +-
linux-user/main.c                |  35 +--
linux-user/mmap.c                |   1 +
linux-user/syscall.c             |   2 +-
common-user/meson.build          |   8 +
util/meson.build                 |   4 -
21 files changed, 565 insertions(+), 486 deletions(-)
create mode 100644 include/user/mmap-min-addr.h
create mode 100644 include/user/probe-guest-base.h
rename include/{qemu => user}/selfmap.h (100%)
create mode 100644 common-user/mmap-min-addr.c
create mode 100644 common-user/probe-guest-base.c
rename {util => common-user}/selfmap.c (69%)
[PATCH 00/13] *-user: probe_guest_base improvments
Posted by Richard Henderson 1 week, 1 day ago
The first 4 patches fix the ambiguous guest_lobase parameter,
which affects an odd usage of a bare metal image with qemu-arm.

The rest of the patches improve bsd-user to use probe_guest_base.

r~

Richard Henderson (13):
  linux-user: Introduce PGBRange
  linux-user: Use PGBRange in load_elf_image
  linux-user: Drop hiaddr out-of-range check in probe_guest_base
  linux-user: Pass image_range to probe_guest_base
  linux-user: Use PGBRange for commpage
  common-user: Move mmap_min_addr from linux-user
  common-user: Initialize mmap_min_addr for FreeBSD
  include/user/guest-host: Include missing cpu.h
  common-user: Move selfmap from util
  common-user: Implement read_self_maps for FreeBSD
  common-user: Move probe_guest_base from linux-user
  bsd-user: Use probe_guest_base
  common-user: Move guest_base, have_guest_base to probe-guest-base.c

 include/user/guest-host.h        |   1 +
 include/user/mmap-min-addr.h     |  12 +
 include/user/probe-guest-base.h  |  37 +++
 include/{qemu => user}/selfmap.h |   0
 linux-user/arm/target_elf.h      |   2 +-
 linux-user/hppa/target_elf.h     |   2 +-
 linux-user/user-internals.h      |  17 +-
 bsd-user/elfload.c               |  37 +--
 bsd-user/main.c                  |  42 +---
 common-user/mmap-min-addr.c      |  50 ++++
 common-user/probe-guest-base.c   | 347 +++++++++++++++++++++++++++
 {util => common-user}/selfmap.c  |  45 +++-
 linux-user/arm/elfload.c         |   2 +-
 linux-user/elfload.c             | 400 ++-----------------------------
 linux-user/flatload.c            |   3 +-
 linux-user/hppa/elfload.c        |   4 +-
 linux-user/main.c                |  35 +--
 linux-user/mmap.c                |   1 +
 linux-user/syscall.c             |   2 +-
 common-user/meson.build          |   8 +
 util/meson.build                 |   4 -
 21 files changed, 565 insertions(+), 486 deletions(-)
 create mode 100644 include/user/mmap-min-addr.h
 create mode 100644 include/user/probe-guest-base.h
 rename include/{qemu => user}/selfmap.h (100%)
 create mode 100644 common-user/mmap-min-addr.c
 create mode 100644 common-user/probe-guest-base.c
 rename {util => common-user}/selfmap.c (69%)

-- 
2.43.0
Re: [PATCH 00/13] *-user: probe_guest_base improvments
Posted by Warner Losh 1 week, 1 day ago
On Sat, May 30, 2026 at 3:12 PM Richard Henderson <
richard.henderson@linaro.org> wrote:

> The first 4 patches fix the ambiguous guest_lobase parameter,
> which affects an odd usage of a bare metal image with qemu-arm.
>
> The rest of the patches improve bsd-user to use probe_guest_base.
>

Thanks for taking the time to do this. I had some parallel work on this, but
I think this is likely a better base. The few things I think I might have
done a
bit better I've commented on in the reviews, but this series overall is much
more complete than I did in the blitz branch. Thank you!

Warner


> r~
>
> Richard Henderson (13):
>   linux-user: Introduce PGBRange
>   linux-user: Use PGBRange in load_elf_image
>   linux-user: Drop hiaddr out-of-range check in probe_guest_base
>   linux-user: Pass image_range to probe_guest_base
>   linux-user: Use PGBRange for commpage
>   common-user: Move mmap_min_addr from linux-user
>   common-user: Initialize mmap_min_addr for FreeBSD
>   include/user/guest-host: Include missing cpu.h
>   common-user: Move selfmap from util
>   common-user: Implement read_self_maps for FreeBSD
>   common-user: Move probe_guest_base from linux-user
>   bsd-user: Use probe_guest_base
>   common-user: Move guest_base, have_guest_base to probe-guest-base.c
>
>  include/user/guest-host.h        |   1 +
>  include/user/mmap-min-addr.h     |  12 +
>  include/user/probe-guest-base.h  |  37 +++
>  include/{qemu => user}/selfmap.h |   0
>  linux-user/arm/target_elf.h      |   2 +-
>  linux-user/hppa/target_elf.h     |   2 +-
>  linux-user/user-internals.h      |  17 +-
>  bsd-user/elfload.c               |  37 +--
>  bsd-user/main.c                  |  42 +---
>  common-user/mmap-min-addr.c      |  50 ++++
>  common-user/probe-guest-base.c   | 347 +++++++++++++++++++++++++++
>  {util => common-user}/selfmap.c  |  45 +++-
>  linux-user/arm/elfload.c         |   2 +-
>  linux-user/elfload.c             | 400 ++-----------------------------
>  linux-user/flatload.c            |   3 +-
>  linux-user/hppa/elfload.c        |   4 +-
>  linux-user/main.c                |  35 +--
>  linux-user/mmap.c                |   1 +
>  linux-user/syscall.c             |   2 +-
>  common-user/meson.build          |   8 +
>  util/meson.build                 |   4 -
>  21 files changed, 565 insertions(+), 486 deletions(-)
>  create mode 100644 include/user/mmap-min-addr.h
>  create mode 100644 include/user/probe-guest-base.h
>  rename include/{qemu => user}/selfmap.h (100%)
>  create mode 100644 common-user/mmap-min-addr.c
>  create mode 100644 common-user/probe-guest-base.c
>  rename {util => common-user}/selfmap.c (69%)
>
> --
> 2.43.0
>
>