[PULL 00/14] linux-user image mapping fixes

Richard Henderson posted 14 patches 9 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230808210856.95568-1-richard.henderson@linaro.org
Maintainers: Laurent Vivier <laurent@vivier.eu>, Brian Cain <bcain@quicinc.com>
include/qemu/selfmap.h               |  22 +-
linux-user/aarch64/target_mman.h     |  13 +
linux-user/alpha/target_mman.h       |  11 +
linux-user/arm/target_mman.h         |  11 +
linux-user/cris/target_mman.h        |  12 +
linux-user/hexagon/target_mman.h     |  13 +
linux-user/hppa/target_mman.h        |   6 +
linux-user/i386/target_mman.h        |  16 +
linux-user/loongarch64/target_mman.h |  11 +
linux-user/m68k/target_mman.h        |   5 +
linux-user/microblaze/target_mman.h  |  11 +
linux-user/mips/target_mman.h        |  10 +
linux-user/nios2/target_mman.h       |  10 +
linux-user/openrisc/target_mman.h    |  10 +
linux-user/ppc/target_mman.h         |  20 +
linux-user/qemu.h                    |   1 -
linux-user/riscv/target_mman.h       |  10 +
linux-user/s390x/target_mman.h       |  20 +
linux-user/sh4/target_mman.h         |   7 +
linux-user/sparc/target_mman.h       |  25 ++
linux-user/user-mmap.h               |  29 +-
linux-user/x86_64/target_mman.h      |  15 +
linux-user/xtensa/target_mman.h      |  10 +
linux-user/elfload.c                 | 792 +++++++++++++++++------------------
linux-user/main.c                    |  43 ++
linux-user/mmap.c                    |  19 +-
linux-user/syscall.c                 |  15 +-
util/selfmap.c                       | 114 +++--
28 files changed, 803 insertions(+), 478 deletions(-)
[PULL 00/14] linux-user image mapping fixes
Posted by Richard Henderson 9 months, 2 weeks ago
The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452:

  Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-08-07 13:55:00 -0700)

are available in the Git repository at:

  https://gitlab.com/rth7680/qemu.git tags/pull-lu-20230808

for you to fetch changes up to dd55885516f42f718d0d121c59a5f7be5fdae3e6:

  linux-user: Rewrite non-fixed probe_guest_base (2023-08-08 13:41:55 -0700)

----------------------------------------------------------------
linux-user: Adjust guest image layout vs reserved_va
linux-user: Do not adjust image mapping for host page size
linux-user: Adjust initial brk when interpreter is close to executable
util/selfmap: Rewrite using qemu/interval-tree.h
linux-user: Rewrite probe_guest_base

----------------------------------------------------------------
Helge Deller (1):
      linux-user: Adjust initial brk when interpreter is close to executable

Richard Henderson (13):
      linux-user: Adjust task_unmapped_base for reserved_va
      linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h
      linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
      linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap
      linux-user: Use elf_et_dyn_base for ET_DYN with interpreter
      linux-user: Do not adjust image mapping for host page size
      linux-user: Do not adjust zero_bss for host page size
      linux-user: Use zero_bss for PT_LOAD with no file contents too
      util/selfmap: Rewrite using qemu/interval-tree.h
      linux-user: Remove duplicate CPU_LOG_PAGE from probe_guest_base
      linux-user: Consolidate guest bounds check in probe_guest_base
      linux-user: Rewrite fixed probe_guest_base
      linux-user: Rewrite non-fixed probe_guest_base

 include/qemu/selfmap.h               |  22 +-
 linux-user/aarch64/target_mman.h     |  13 +
 linux-user/alpha/target_mman.h       |  11 +
 linux-user/arm/target_mman.h         |  11 +
 linux-user/cris/target_mman.h        |  12 +
 linux-user/hexagon/target_mman.h     |  13 +
 linux-user/hppa/target_mman.h        |   6 +
 linux-user/i386/target_mman.h        |  16 +
 linux-user/loongarch64/target_mman.h |  11 +
 linux-user/m68k/target_mman.h        |   5 +
 linux-user/microblaze/target_mman.h  |  11 +
 linux-user/mips/target_mman.h        |  10 +
 linux-user/nios2/target_mman.h       |  10 +
 linux-user/openrisc/target_mman.h    |  10 +
 linux-user/ppc/target_mman.h         |  20 +
 linux-user/qemu.h                    |   1 -
 linux-user/riscv/target_mman.h       |  10 +
 linux-user/s390x/target_mman.h       |  20 +
 linux-user/sh4/target_mman.h         |   7 +
 linux-user/sparc/target_mman.h       |  25 ++
 linux-user/user-mmap.h               |  29 +-
 linux-user/x86_64/target_mman.h      |  15 +
 linux-user/xtensa/target_mman.h      |  10 +
 linux-user/elfload.c                 | 792 +++++++++++++++++------------------
 linux-user/main.c                    |  43 ++
 linux-user/mmap.c                    |  19 +-
 linux-user/syscall.c                 |  15 +-
 util/selfmap.c                       | 114 +++--
 28 files changed, 803 insertions(+), 478 deletions(-)
Re: [PULL 00/14] linux-user image mapping fixes
Posted by Richard Henderson 9 months, 2 weeks ago
On 8/8/23 14:08, Richard Henderson wrote:
> The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452:
> 
>    Merge tag 'fixes-pull-request' ofhttps://gitlab.com/marcandre.lureau/qemu  into staging (2023-08-07 13:55:00 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/rth7680/qemu.git  tags/pull-lu-20230808
> 
> for you to fetch changes up to dd55885516f42f718d0d121c59a5f7be5fdae3e6:
> 
>    linux-user: Rewrite non-fixed probe_guest_base (2023-08-08 13:41:55 -0700)
> 
> ----------------------------------------------------------------
> linux-user: Adjust guest image layout vs reserved_va
> linux-user: Do not adjust image mapping for host page size
> linux-user: Adjust initial brk when interpreter is close to executable
> util/selfmap: Rewrite using qemu/interval-tree.h
> linux-user: Rewrite probe_guest_base

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.


r~
Re: [PULL 00/14] linux-user image mapping fixes
Posted by Michael Tokarev 9 months, 1 week ago
09.08.2023 00:08, Richard Henderson пишет:
> The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452:
> 
>    Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-08-07 13:55:00 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/rth7680/qemu.git tags/pull-lu-20230808
> 
> for you to fetch changes up to dd55885516f42f718d0d121c59a5f7be5fdae3e6:
> 
>    linux-user: Rewrite non-fixed probe_guest_base (2023-08-08 13:41:55 -0700)
> 
> ----------------------------------------------------------------
> linux-user: Adjust guest image layout vs reserved_va
> linux-user: Do not adjust image mapping for host page size
> linux-user: Adjust initial brk when interpreter is close to executable
> util/selfmap: Rewrite using qemu/interval-tree.h
> linux-user: Rewrite probe_guest_base
> 
> ----------------------------------------------------------------
> Helge Deller (1):
>        linux-user: Adjust initial brk when interpreter is close to executable
> 
> Richard Henderson (13):
>        linux-user: Adjust task_unmapped_base for reserved_va
>        linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h
>        linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
>        linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap
>        linux-user: Use elf_et_dyn_base for ET_DYN with interpreter
>        linux-user: Do not adjust image mapping for host page size
>        linux-user: Do not adjust zero_bss for host page size
>        linux-user: Use zero_bss for PT_LOAD with no file contents too
>        util/selfmap: Rewrite using qemu/interval-tree.h
>        linux-user: Remove duplicate CPU_LOG_PAGE from probe_guest_base
>        linux-user: Consolidate guest bounds check in probe_guest_base
>        linux-user: Rewrite fixed probe_guest_base
>        linux-user: Rewrite non-fixed probe_guest_base

Is there anything in there and in other linux-user late fixes which are applicable to 8.0?
Or should we declare 8.0 as semi-broken and be done with it?

Thanks,

/mjt


Re: [PULL 00/14] linux-user image mapping fixes
Posted by Richard Henderson 9 months, 1 week ago
On 8/15/23 06:51, Michael Tokarev wrote:
> 09.08.2023 00:08, Richard Henderson пишет:
>> The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452:
>>
>>    Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into 
>> staging (2023-08-07 13:55:00 -0700)
>>
>> are available in the Git repository at:
>>
>>    https://gitlab.com/rth7680/qemu.git tags/pull-lu-20230808
>>
>> for you to fetch changes up to dd55885516f42f718d0d121c59a5f7be5fdae3e6:
>>
>>    linux-user: Rewrite non-fixed probe_guest_base (2023-08-08 13:41:55 -0700)
>>
>> ----------------------------------------------------------------
>> linux-user: Adjust guest image layout vs reserved_va
>> linux-user: Do not adjust image mapping for host page size
>> linux-user: Adjust initial brk when interpreter is close to executable
>> util/selfmap: Rewrite using qemu/interval-tree.h
>> linux-user: Rewrite probe_guest_base
>>
>> ----------------------------------------------------------------
>> Helge Deller (1):
>>        linux-user: Adjust initial brk when interpreter is close to executable
>>
>> Richard Henderson (13):
>>        linux-user: Adjust task_unmapped_base for reserved_va
>>        linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h
>>        linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
>>        linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap
>>        linux-user: Use elf_et_dyn_base for ET_DYN with interpreter
>>        linux-user: Do not adjust image mapping for host page size
>>        linux-user: Do not adjust zero_bss for host page size
>>        linux-user: Use zero_bss for PT_LOAD with no file contents too
>>        util/selfmap: Rewrite using qemu/interval-tree.h
>>        linux-user: Remove duplicate CPU_LOG_PAGE from probe_guest_base
>>        linux-user: Consolidate guest bounds check in probe_guest_base
>>        linux-user: Rewrite fixed probe_guest_base
>>        linux-user: Rewrite non-fixed probe_guest_base
> 
> Is there anything in there and in other linux-user late fixes which are applicable to 8.0?
> Or should we declare 8.0 as semi-broken and be done with it?

Let's wait a bit and see if we're not just exchanging one set of bugs for another.


r~


Re: [PULL 00/14] linux-user image mapping fixes
Posted by Helge Deller 9 months, 1 week ago
On 8/15/23 23:09, Richard Henderson wrote:
> On 8/15/23 06:51, Michael Tokarev wrote:
>> 09.08.2023 00:08, Richard Henderson пишет:
>>> The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452:
>>>
>>>    Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-08-07 13:55:00 -0700)
>>>
>>> are available in the Git repository at:
>>>
>>>    https://gitlab.com/rth7680/qemu.git tags/pull-lu-20230808
>>>
>>> for you to fetch changes up to dd55885516f42f718d0d121c59a5f7be5fdae3e6:
>>>
>>>    linux-user: Rewrite non-fixed probe_guest_base (2023-08-08 13:41:55 -0700)
>>>
>>> ----------------------------------------------------------------
>>> linux-user: Adjust guest image layout vs reserved_va
>>> linux-user: Do not adjust image mapping for host page size
>>> linux-user: Adjust initial brk when interpreter is close to executable
>>> util/selfmap: Rewrite using qemu/interval-tree.h
>>> linux-user: Rewrite probe_guest_base
>>>
>>> ----------------------------------------------------------------
>>> Helge Deller (1):
>>>        linux-user: Adjust initial brk when interpreter is close to executable
>>>
>>> Richard Henderson (13):
>>>        linux-user: Adjust task_unmapped_base for reserved_va
>>>        linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h
>>>        linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
>>>        linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap
>>>        linux-user: Use elf_et_dyn_base for ET_DYN with interpreter
>>>        linux-user: Do not adjust image mapping for host page size
>>>        linux-user: Do not adjust zero_bss for host page size
>>>        linux-user: Use zero_bss for PT_LOAD with no file contents too
>>>        util/selfmap: Rewrite using qemu/interval-tree.h
>>>        linux-user: Remove duplicate CPU_LOG_PAGE from probe_guest_base
>>>        linux-user: Consolidate guest bounds check in probe_guest_base
>>>        linux-user: Rewrite fixed probe_guest_base
>>>        linux-user: Rewrite non-fixed probe_guest_base
>>
>> Is there anything in there and in other linux-user late fixes which are applicable to 8.0?
>> Or should we declare 8.0 as semi-broken and be done with it?
>
> Let's wait a bit and see if we're not just exchanging one set of bugs for another.

Yes, and I think 8.0 isn't in that bad shape?

Helge
Re: [PULL 00/14] linux-user image mapping fixes
Posted by Michael Tokarev 9 months, 1 week ago
16.08.2023 00:42, Helge Deller wrote:
> On 8/15/23 23:09, Richard Henderson wrote:
...
>> Let's wait a bit and see if we're not just exchanging one set of bugs for another.
> 
> Yes, and I think 8.0 isn't in that bad shape?

Well, I dunno. It all started with 8.0 bugs, after I uploaded 8.0 to debian
and things started breaking there, like building stuff in a qemu-user-based
chroots.  arm commpage mapping issue affects 8.0, klibc issue is now re-
open, something else I forgot already... :)

But I agree, let's wait for a bit more.  It was a large amount of changes.
Myself, I tend to think about 8.0 having quite broken linux-user.

/mjt