mbox

[PULL,00/15] tcg patch queue

Message ID 20230328225806.2278728-1-richard.henderson@linaro.org (mailing list archive)
State New, archived
Headers show

Pull-request

https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230328

Message

Richard Henderson March 28, 2023, 10:57 p.m. UTC
The following changes since commit d37158bb2425e7ebffb167d611be01f1e9e6c86f:

  Update version for v8.0.0-rc2 release (2023-03-28 20:43:21 +0100)

are available in the Git repository at:

  https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230328

for you to fetch changes up to 87e303de70f93bf700f58412fb9b2c3ec918c4b5:

  softmmu: Restore use of CPU watchpoint for all accelerators (2023-03-28 15:24:06 -0700)

----------------------------------------------------------------
Use a local version of GTree [#285]
Fix page_set_flags vs the last page of the address space [#1528]
Re-enable gdbstub breakpoints under KVM

----------------------------------------------------------------
Emilio Cota (2):
      util: import GTree as QTree
      tcg: use QTree instead of GTree

Philippe Mathieu-Daudé (3):
      softmmu: Restrict cpu_check_watchpoint / address_matches to TCG accel
      softmmu/watchpoint: Add missing 'qemu/error-report.h' include
      softmmu: Restore use of CPU watchpoint for all accelerators

Richard Henderson (10):
      linux-user: Diagnose misaligned -R size
      accel/tcg: Pass last not end to page_set_flags
      accel/tcg: Pass last not end to page_reset_target_data
      accel/tcg: Pass last not end to PAGE_FOR_EACH_TB
      accel/tcg: Pass last not end to page_collection_lock
      accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked
      accel/tcg: Pass last not end to tb_invalidate_phys_range
      linux-user: Pass last not end to probe_guest_base
      include/exec: Change reserved_va semantics to last byte
      linux-user/arm: Take more care allocating commpage

 configure                     |   15 +
 meson.build                   |    4 +
 include/exec/cpu-all.h        |   15 +-
 include/exec/exec-all.h       |    2 +-
 include/hw/core/cpu.h         |   39 +-
 include/hw/core/tcg-cpu-ops.h |   43 ++
 include/qemu/qtree.h          |  201 ++++++
 linux-user/arm/target_cpu.h   |    2 +-
 linux-user/user-internals.h   |   12 +-
 accel/tcg/tb-maint.c          |  112 ++--
 accel/tcg/translate-all.c     |    2 +-
 accel/tcg/user-exec.c         |   25 +-
 bsd-user/main.c               |   10 +-
 bsd-user/mmap.c               |   10 +-
 linux-user/elfload.c          |   72 ++-
 linux-user/flatload.c         |    2 +-
 linux-user/main.c             |   31 +-
 linux-user/mmap.c             |   22 +-
 linux-user/syscall.c          |    4 +-
 softmmu/physmem.c             |    2 +-
 softmmu/watchpoint.c          |    5 +
 target/arm/tcg/mte_helper.c   |    1 +
 target/arm/tcg/sve_helper.c   |    1 +
 target/s390x/tcg/mem_helper.c |    1 +
 tcg/region.c                  |   19 +-
 tests/bench/qtree-bench.c     |  286 +++++++++
 tests/unit/test-qtree.c       |  333 ++++++++++
 util/qtree.c                  | 1390 +++++++++++++++++++++++++++++++++++++++++
 softmmu/meson.build           |    2 +-
 tests/bench/meson.build       |    4 +
 tests/unit/meson.build        |    1 +
 util/meson.build              |    1 +
 32 files changed, 2474 insertions(+), 195 deletions(-)
 create mode 100644 include/qemu/qtree.h
 create mode 100644 tests/bench/qtree-bench.c
 create mode 100644 tests/unit/test-qtree.c
 create mode 100644 util/qtree.c

Comments

Peter Maydell March 29, 2023, 1:01 p.m. UTC | #1
On Tue, 28 Mar 2023 at 23:58, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The following changes since commit d37158bb2425e7ebffb167d611be01f1e9e6c86f:
>
>   Update version for v8.0.0-rc2 release (2023-03-28 20:43:21 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230328
>
> for you to fetch changes up to 87e303de70f93bf700f58412fb9b2c3ec918c4b5:
>
>   softmmu: Restore use of CPU watchpoint for all accelerators (2023-03-28 15:24:06 -0700)
>
> ----------------------------------------------------------------
> Use a local version of GTree [#285]
> Fix page_set_flags vs the last page of the address space [#1528]
> Re-enable gdbstub breakpoints under KVM
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.

-- PMM
Joel Stanley March 30, 2023, 10:37 a.m. UTC | #2
On Tue, 28 Mar 2023 at 22:59, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The following changes since commit d37158bb2425e7ebffb167d611be01f1e9e6c86f:
>
>   Update version for v8.0.0-rc2 release (2023-03-28 20:43:21 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230328
>
> for you to fetch changes up to 87e303de70f93bf700f58412fb9b2c3ec918c4b5:
>
>   softmmu: Restore use of CPU watchpoint for all accelerators (2023-03-28 15:24:06 -0700)
>
> ----------------------------------------------------------------
> Use a local version of GTree [#285]
> Fix page_set_flags vs the last page of the address space [#1528]
> Re-enable gdbstub breakpoints under KVM
>
> ----------------------------------------------------------------
> Emilio Cota (2):
>       util: import GTree as QTree
>       tcg: use QTree instead of GTree
>
> Philippe Mathieu-Daudé (3):
>       softmmu: Restrict cpu_check_watchpoint / address_matches to TCG accel
>       softmmu/watchpoint: Add missing 'qemu/error-report.h' include
>       softmmu: Restore use of CPU watchpoint for all accelerators
>
> Richard Henderson (10):
>       linux-user: Diagnose misaligned -R size
>       accel/tcg: Pass last not end to page_set_flags
>       accel/tcg: Pass last not end to page_reset_target_data
>       accel/tcg: Pass last not end to PAGE_FOR_EACH_TB
>       accel/tcg: Pass last not end to page_collection_lock
>       accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked
>       accel/tcg: Pass last not end to tb_invalidate_phys_range
>       linux-user: Pass last not end to probe_guest_base
>       include/exec: Change reserved_va semantics to last byte
>       linux-user/arm: Take more care allocating commpage

Thanks for getting these fixes merged.

This last one (4f5c67f8df7f26e559509c68c45e652709edd23f) causes a
regression for me. On ppc64le, qemu-arm now segfaults. If I revert
this one I can run executables without the assert.

The segfault looks like this:

#0  0x00000001001e44fc in stl_he_p (v=5, ptr=0x240450ffc) at
/home/joel/qemu/include/qemu/bswap.h:260
#1  stl_le_p (v=5, ptr=0x240450ffc) at /home/joel/qemu/include/qemu/bswap.h:302
#2  init_guest_commpage () at ../linux-user/elfload.c:460
#3  probe_guest_base (image_name=image_name@entry=0x1003c72e0
<real_exec_path> "/home/joel/hello",
    guest_loaddr=guest_loaddr@entry=65536,
guest_hiaddr=guest_hiaddr@entry=17411743) at
../linux-user/elfload.c:2818
#4  0x00000001001e50d4 in load_elf_image (image_name=0x1003c72e0
<real_exec_path> "/home/joel/hello",
    image_fd=<optimised out>, info=info@entry=0x7fffffffe7e8,
pinterp_name=pinterp_name@entry=0x7fffffffe558,
    bprm_buf=bprm_buf@entry=0x7fffffffe8d0 "\177ELF\001\001\001") at
../linux-user/elfload.c:3108
#5  0x00000001001e5434 in load_elf_binary (bprm=0x7fffffffe8d0,
info=0x7fffffffe7e8) at ../linux-user/elfload.c:3548
#6  0x00000001001e85bc in loader_exec (fdexec=<optimised out>,
filename=<optimised out>, argv=<optimised out>,
    envp=<optimised out>, regs=0x7fffffffe888, infop=0x7fffffffe7e8,
bprm=0x7fffffffe8d0) at ../linux-user/linuxload.c:155
#7  0x0000000100046c7c in main (argc=<optimised out>,
argv=0x7ffffffff1c8, envp=<optimised out>) at ../linux-user/main.c:892

Cheers,

Joel
Richard Henderson March 31, 2023, 5:20 p.m. UTC | #3
On 3/30/23 03:37, Joel Stanley wrote:
> On Tue, 28 Mar 2023 at 22:59, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> The following changes since commit d37158bb2425e7ebffb167d611be01f1e9e6c86f:
>>
>>    Update version for v8.0.0-rc2 release (2023-03-28 20:43:21 +0100)
>>
>> are available in the Git repository at:
>>
>>    https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230328
>>
>> for you to fetch changes up to 87e303de70f93bf700f58412fb9b2c3ec918c4b5:
>>
>>    softmmu: Restore use of CPU watchpoint for all accelerators (2023-03-28 15:24:06 -0700)
>>
>> ----------------------------------------------------------------
>> Use a local version of GTree [#285]
>> Fix page_set_flags vs the last page of the address space [#1528]
>> Re-enable gdbstub breakpoints under KVM
>>
>> ----------------------------------------------------------------
>> Emilio Cota (2):
>>        util: import GTree as QTree
>>        tcg: use QTree instead of GTree
>>
>> Philippe Mathieu-Daudé (3):
>>        softmmu: Restrict cpu_check_watchpoint / address_matches to TCG accel
>>        softmmu/watchpoint: Add missing 'qemu/error-report.h' include
>>        softmmu: Restore use of CPU watchpoint for all accelerators
>>
>> Richard Henderson (10):
>>        linux-user: Diagnose misaligned -R size
>>        accel/tcg: Pass last not end to page_set_flags
>>        accel/tcg: Pass last not end to page_reset_target_data
>>        accel/tcg: Pass last not end to PAGE_FOR_EACH_TB
>>        accel/tcg: Pass last not end to page_collection_lock
>>        accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked
>>        accel/tcg: Pass last not end to tb_invalidate_phys_range
>>        linux-user: Pass last not end to probe_guest_base
>>        include/exec: Change reserved_va semantics to last byte
>>        linux-user/arm: Take more care allocating commpage
> 
> Thanks for getting these fixes merged.
> 
> This last one (4f5c67f8df7f26e559509c68c45e652709edd23f) causes a
> regression for me. On ppc64le, qemu-arm now segfaults. If I revert
> this one I can run executables without the assert.
> 
> The segfault looks like this:
> 
> #0  0x00000001001e44fc in stl_he_p (v=5, ptr=0x240450ffc) at
> /home/joel/qemu/include/qemu/bswap.h:260
> #1  stl_le_p (v=5, ptr=0x240450ffc) at /home/joel/qemu/include/qemu/bswap.h:302
> #2  init_guest_commpage () at ../linux-user/elfload.c:460
> #3  probe_guest_base (image_name=image_name@entry=0x1003c72e0
> <real_exec_path> "/home/joel/hello",
>      guest_loaddr=guest_loaddr@entry=65536,
> guest_hiaddr=guest_hiaddr@entry=17411743) at
> ../linux-user/elfload.c:2818
> #4  0x00000001001e50d4 in load_elf_image (image_name=0x1003c72e0
> <real_exec_path> "/home/joel/hello",
>      image_fd=<optimised out>, info=info@entry=0x7fffffffe7e8,
> pinterp_name=pinterp_name@entry=0x7fffffffe558,
>      bprm_buf=bprm_buf@entry=0x7fffffffe8d0 "\177ELF\001\001\001") at
> ../linux-user/elfload.c:3108
> #5  0x00000001001e5434 in load_elf_binary (bprm=0x7fffffffe8d0,
> info=0x7fffffffe7e8) at ../linux-user/elfload.c:3548
> #6  0x00000001001e85bc in loader_exec (fdexec=<optimised out>,
> filename=<optimised out>, argv=<optimised out>,
>      envp=<optimised out>, regs=0x7fffffffe888, infop=0x7fffffffe7e8,
> bprm=0x7fffffffe8d0) at ../linux-user/linuxload.c:155
> #7  0x0000000100046c7c in main (argc=<optimised out>,
> argv=0x7ffffffff1c8, envp=<optimised out>) at ../linux-user/main.c:892

Gah!  I've exposed the same sort of overflow conditions within target_mmap and friends.  I 
think the only short-term solution for 8.0 is to revert the last patch.


r~