qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f93b99: linux-user/elfload: Disable core dump


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] f93b99: linux-user/elfload: Disable core dump if getrlimit...
Date: Mon, 04 Mar 2024 03:44:13 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: f93b9953703be41408d5f0e09a871775d4be3c36
      
https://github.com/qemu/qemu/commit/f93b9953703be41408d5f0e09a871775d4be3c36
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Disable core dump if getrlimit fails

Do not dump core at all if getrlimit fails; this ensures
that dumpsize is valid throughout the function, not just
for the initial test vs rlim_cur.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2
      
https://github.com/qemu/qemu/commit/b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Merge init_note_info and fill_note_info

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 6a202944354d077141bb97a21d35f8ab16b6a127
      
https://github.com/qemu/qemu/commit/6a202944354d077141bb97a21d35f8ab16b6a127
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Tidy fill_note_info and struct elf_note_info

In fill_note_info, there were unnecessary checks for
success of g_new/g_malloc.  But these structures do not
need to be dyamically allocated at all, and can in fact
be statically allocated within the parent structure.

This removes all error paths from fill_note_info, so
change the return type to void.

Change type of signr to match both caller (elf_core_dump)
and callee (fill_prstatus), which both use int for signr.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 0af22a6abf8397f966701f120eee8a5bdf22ab19
      
https://github.com/qemu/qemu/commit/0af22a6abf8397f966701f120eee8a5bdf22ab19
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Stack allocate struct mm_struct

Ignoring the fact that g_malloc cannot fail, the structure
is quite small and might as well be allocated locally.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: ccb6f3eee0f746961f95e9956fa20decd1f46da3
      
https://github.com/qemu/qemu/commit/ccb6f3eee0f746961f95e9956fa20decd1f46da3
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Latch errno before cleanup in elf_core_dump

On the off-chance that one of the cleanup functions changes
errno, latch the errno that we want to return beforehand.

Flush errno to 0 upon success, rather than at the beginning.
No need to avoid negation of 0.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 106f8da6643634f141b39198576156a4c5bd6e60
      
https://github.com/qemu/qemu/commit/106f8da6643634f141b39198576156a4c5bd6e60
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Open core file after vma_init

Swap the ordering of vma_init and open.  This will be necessary
for further changes, and adjusts the error cleanup path.  Narrow
the scope of corefile, as the variable can be freed immediately
after use in open().

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: e0add9a835c6259df211eb4874d3d00d9d016796
      
https://github.com/qemu/qemu/commit/e0add9a835c6259df211eb4874d3d00d9d016796
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Truncate core file on open

While we usually create a new corefile, truncate otherwise.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b5262077655ab586d90f80a0f1b9a536bbc999ba
      
https://github.com/qemu/qemu/commit/b5262077655ab586d90f80a0f1b9a536bbc999ba
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Lock cpu list and mmap during elf_core_dump

Do not allow changes to the set of cpus and memory regions
while we are dumping core.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 2410d28dc992082ec3348d6544ef30c1f950c8b9
      
https://github.com/qemu/qemu/commit/2410d28dc992082ec3348d6544ef30c1f950c8b9
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Size corefile before opening

Verify the size of the corefile vs the rlimit before
opening and creating the core file at all.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 243c47066253c4236b8792ee158f9971d1c27bf9
      
https://github.com/qemu/qemu/commit/243c47066253c4236b8792ee158f9971d1c27bf9
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Write corefile elf header in one block

Fixes a bug in which write_note() wrote namesz_rounded
and datasz_rounded bytes, even though name and data
pointers contain only the unrounded number of bytes.

Instead of many small writes, allocate a block to contain all
of the elf headers and all of the notes.  Copy the data into the
block piecemeal and the write it to the file as a chunk.
This also avoids the need to lseek forward for alignment.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b4c7ab816b48e0d2dd15753c0329bd4aa59f713f
      
https://github.com/qemu/qemu/commit/b4c7ab816b48e0d2dd15753c0329bd4aa59f713f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Write process memory to core file in larger chunks

We do not need to copy pages from guest memory before writing
them out.  Because vmas are contiguous in host memory, we can
write them in one go.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 1928d50bec7ef7956499e408ac3a501f02c57c47
      
https://github.com/qemu/qemu/commit/1928d50bec7ef7956499e408ac3a501f02c57c47
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Simplify vma_dump_size

Use the flags that we've already saved in order to test
accessibility.  Use g2h_untagged and compare guest memory
directly instead of copy_from_user.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 50e33f52fbc476f71eb006e0c8d3fa355539c3e1
      
https://github.com/qemu/qemu/commit/50e33f52fbc476f71eb006e0c8d3fa355539c3e1
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Rely on walk_memory_regions for vmas

Rather than creating new data structures for vma,
rely on the IntervalTree used by walk_memory_regions.

Use PAGE_* constants, per the page table api, rather
than PROT_* constants, per the mmap api.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 41689bb30cb55f411a4d9f7a31f3e601292d3be2
      
https://github.com/qemu/qemu/commit/41689bb30cb55f411a4d9f7a31f3e601292d3be2
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Unprotect regions before core dump

By unprotecting regions, we re-instate writability and
unify regions that have been split, which may reduce
the total number of regions.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 7f89fdf8ebe6ef8df48f0a05f44e1020c713a94e
      
https://github.com/qemu/qemu/commit/7f89fdf8ebe6ef8df48f0a05f44e1020c713a94e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M tcg/aarch64/tcg-target.h

  Log Message:
  -----------
  tcg/aarch64: Apple does not align __int128_t in even registers

>From 
>https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms

  When passing an argument with 16-byte alignment in integer registers,
  Apple platforms allow the argument to start in an odd-numbered xN
  register. The standard ABI requires it to begin in an even-numbered
  xN register.

Cc: qemu-stable@nongnu.org
Fixes: 5427a9a7604 ("tcg: Add TCG_TARGET_CALL_{RET,ARG}_I128")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2169
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <9fc0c2c7-dd57-459e-aecb-528edb74b4a7@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: 62bcba836cb199bb0d9b5aa160919c863393859f
      
https://github.com/qemu/qemu/commit/62bcba836cb199bb0d9b5aa160919c863393859f
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M accel/tcg/cpu-exec.c

  Log Message:
  -----------
  accel/tcg: Set can_do_io at at start of lookup_tb_ptr helper

If a page table is in IO memory and lookup_tb_ptr probes
the TLB it can result in a page table walk for the instruction
fetch.  If this hits IO memory and io_prepare falsely assumes
it needs to do a TLB recompile.

Avoid that by setting can_do_io at the start of lookup_tb_ptr.

Link: 
https://lore.kernel.org/qemu-devel/CAFEAcA_a_AyQ=Epz3_+CheAT8Crsk9mOu894wbNW_FywamkZiw@mail.gmail.com/#t

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240219173153.12114-2-Jonathan.Cameron@huawei.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 6aba908d2b2d4c6c6e1e0c57a908b6ad9730525d
      
https://github.com/qemu/qemu/commit/6aba908d2b2d4c6c6e1e0c57a908b6ad9730525d
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M accel/tcg/cputlb.c

  Log Message:
  -----------
  tcg: Avoid double lock if page tables happen to be in mmio memory.

On i386, after fixing the page walking code to work with pages in
MMIO memory (specifically CXL emulated interleaved memory),
a crash was seen in an interrupt handling path.

Useful part of backtrace

7  0x0000555555ab1929 in bql_lock_impl (file=0x555556049122 
"../../accel/tcg/cputlb.c", line=2033) at ../../system/cpus.c:524
8  bql_lock_impl (file=file@entry=0x555556049122 "../../accel/tcg/cputlb.c", 
line=line@entry=2033) at ../../system/cpus.c:520
9  0x0000555555c9f7d6 in do_ld_mmio_beN (cpu=0x5555578e0cb0, 
full=0x7ffe88012950, ret_be=ret_be@entry=0, addr=19595792376, 
size=size@entry=8, mmu_idx=4, type=MMU_DATA_LOAD, ra=0) at 
../../accel/tcg/cputlb.c:2033
10 0x0000555555ca0fbd in do_ld_8 (cpu=cpu@entry=0x5555578e0cb0, 
p=p@entry=0x7ffff4efd1d0, mmu_idx=<optimized out>, 
type=type@entry=MMU_DATA_LOAD, memop=<optimized out>, ra=ra@entry=0) at 
../../accel/tcg/cputlb.c:2356
11 0x0000555555ca341f in do_ld8_mmu (cpu=cpu@entry=0x5555578e0cb0, 
addr=addr@entry=19595792376, oi=oi@entry=52, ra=0, ra@entry=52, 
access_type=access_type@entry=MMU_DATA_LOAD) at ../../accel/tcg/cputlb.c:2439
12 0x0000555555ca5f59 in cpu_ldq_mmu (ra=52, oi=52, addr=19595792376, 
env=0x5555578e3470) at ../../accel/tcg/ldst_common.c.inc:169
13 cpu_ldq_le_mmuidx_ra (env=0x5555578e3470, addr=19595792376, 
mmu_idx=<optimized out>, ra=ra@entry=0) at ../../accel/tcg/ldst_common.c.inc:301
14 0x0000555555b4b5fc in ptw_ldq (ra=0, in=0x7ffff4efd320) at 
../../target/i386/tcg/sysemu/excp_helper.c:98
15 ptw_ldq (ra=0, in=0x7ffff4efd320) at 
../../target/i386/tcg/sysemu/excp_helper.c:93
16 mmu_translate (env=env@entry=0x5555578e3470, in=0x7ffff4efd3e0, 
out=0x7ffff4efd3b0, err=err@entry=0x7ffff4efd3c0, ra=ra@entry=0) at 
../../target/i386/tcg/sysemu/excp_helper.c:174
17 0x0000555555b4c4b3 in get_physical_address (ra=0, err=0x7ffff4efd3c0, 
out=0x7ffff4efd3b0, mmu_idx=0, access_type=MMU_DATA_LOAD, 
addr=18446741874686299840, env=0x5555578e3470) at 
../../target/i386/tcg/sysemu/excp_helper.c:580
18 x86_cpu_tlb_fill (cs=0x5555578e0cb0, addr=18446741874686299840, 
size=<optimized out>, access_type=MMU_DATA_LOAD, mmu_idx=0, probe=<optimized 
out>, retaddr=0) at ../../target/i386/tcg/sysemu/excp_helper.c:606
19 0x0000555555ca0ee9 in tlb_fill (retaddr=0, mmu_idx=0, 
access_type=MMU_DATA_LOAD, size=<optimized out>, addr=18446741874686299840, 
cpu=0x7ffff4efd540) at ../../accel/tcg/cputlb.c:1315
20 mmu_lookup1 (cpu=cpu@entry=0x5555578e0cb0, data=data@entry=0x7ffff4efd540, 
mmu_idx=0, access_type=access_type@entry=MMU_DATA_LOAD, ra=ra@entry=0) at 
../../accel/tcg/cputlb.c:1713
21 0x0000555555ca2c61 in mmu_lookup (cpu=cpu@entry=0x5555578e0cb0, 
addr=addr@entry=18446741874686299840, oi=oi@entry=32, ra=ra@entry=0, 
type=type@entry=MMU_DATA_LOAD, l=l@entry=0x7ffff4efd540) at 
../../accel/tcg/cputlb.c:1803
22 0x0000555555ca3165 in do_ld4_mmu (cpu=cpu@entry=0x5555578e0cb0, 
addr=addr@entry=18446741874686299840, oi=oi@entry=32, ra=ra@entry=0, 
access_type=access_type@entry=MMU_DATA_LOAD) at ../../accel/tcg/cputlb.c:2416
23 0x0000555555ca5ef9 in cpu_ldl_mmu (ra=0, oi=32, addr=18446741874686299840, 
env=0x5555578e3470) at ../../accel/tcg/ldst_common.c.inc:158
24 cpu_ldl_le_mmuidx_ra (env=env@entry=0x5555578e3470, 
addr=addr@entry=18446741874686299840, mmu_idx=<optimized out>, ra=ra@entry=0) 
at ../../accel/tcg/ldst_common.c.inc:294
25 0x0000555555bb6cdd in do_interrupt64 (is_hw=1, 
next_eip=18446744072399775809, error_code=0, is_int=0, intno=236, 
env=0x5555578e3470) at ../../target/i386/tcg/seg_helper.c:889
26 do_interrupt_all (cpu=cpu@entry=0x5555578e0cb0, intno=236, 
is_int=is_int@entry=0, error_code=error_code@entry=0, 
next_eip=next_eip@entry=0, is_hw=is_hw@entry=1) at 
../../target/i386/tcg/seg_helper.c:1130
27 0x0000555555bb87da in do_interrupt_x86_hardirq 
(env=env@entry=0x5555578e3470, intno=<optimized out>, is_hw=is_hw@entry=1) at 
../../target/i386/tcg/seg_helper.c:1162
28 0x0000555555b5039c in x86_cpu_exec_interrupt (cs=0x5555578e0cb0, 
interrupt_request=<optimized out>) at 
../../target/i386/tcg/sysemu/seg_helper.c:197
29 0x0000555555c94480 in cpu_handle_interrupt (last_tb=<synthetic pointer>, 
cpu=0x5555578e0cb0) at ../../accel/tcg/cpu-exec.c:844

Peter identified this as being due to the BQL already being
held when the page table walker encounters MMIO memory and attempts
to take the lock again.  There are other examples of similar paths
TCG, so this follows the approach taken in those of simply checking
if the lock is already held and if it is, don't take it again.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240219173153.12114-4-Jonathan.Cameron@huawei.com>
[rth: Use BQL_LOCK_GUARD]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: a372d483f1ea6c1a37ce7ba5c44978bd53ca7938
      
https://github.com/qemu/qemu/commit/a372d483f1ea6c1a37ce7ba5c44978bd53ca7938
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Remove qemu_host_page_size from page_protect/page_unprotect

Use qemu_real_host_page_size instead.  Except for the final mprotect
within page_protect, we already handled host < target page size.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-2-richard.henderson@linaro.org>


  Commit: f11c05c3b90a8b873ddecc1fc037858445aa9b9c
      
https://github.com/qemu/qemu/commit/f11c05c3b90a8b873ddecc1fc037858445aa9b9c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Adjust SVr4 NULL page mapping

Use TARGET_PAGE_SIZE and MAP_FIXED_NOREPLACE.

We really should be attending to this earlier during
probe_guest_base, as well as better detection and
emulation of various Linux personalities.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-3-richard.henderson@linaro.org>


  Commit: ae6bffe05efd73c284170a7709bce641c27ca9fb
      
https://github.com/qemu/qemu/commit/ae6bffe05efd73c284170a7709bce641c27ca9fb
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Remove qemu_host_page_{size, mask} in probe_guest_base

The host SHMLBA is by definition a multiple of the host page size.
Thus the remaining component of qemu_host_page_size is the
target page size.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-4-richard.henderson@linaro.org>


  Commit: d17b684c10e1707d535b9dfa685df610834ec210
      
https://github.com/qemu/qemu/commit/d17b684c10e1707d535b9dfa685df610834ec210
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Remove qemu_host_page_size from create_elf_tables

AT_PAGESZ is supposed to advertise the guest page size.
The random adjustment made here using qemu_host_page_size
does not match anything else within linux-user.

The idea here is good, but should be done more systemically
via adjustment to TARGET_PAGE_SIZE.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-5-richard.henderson@linaro.org>


  Commit: d1fc62303e1447c516bf6c1fa1c6331715a88180
      
https://github.com/qemu/qemu/commit/d1fc62303e1447c516bf6c1fa1c6331715a88180
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/hppa: Simplify init_guest_commpage

If reserved_va, then we have already reserved the entire
guest virtual address space; no need to remap page.
If !reserved_va, then use MAP_FIXED_NOREPLACE.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-6-richard.henderson@linaro.org>


  Commit: 51f8c9b8720f30ba1c4eb1d977ae7bce7884555e
      
https://github.com/qemu/qemu/commit/51f8c9b8720f30ba1c4eb1d977ae7bce7884555e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/nios2: Remove qemu_host_page_size from init_guest_commpage

Use qemu_real_host_page_size.
If !reserved_va, use MAP_FIXED_NOREPLACE.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-7-richard.henderson@linaro.org>


  Commit: 2cd71515c4bef41c6348d87dfd3a709d3905ba77
      
https://github.com/qemu/qemu/commit/2cd71515c4bef41c6348d87dfd3a709d3905ba77
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/arm: Remove qemu_host_page_size from init_guest_commpage

Use qemu_real_host_page_size.
If the commpage is not within reserved_va, use MAP_FIXED_NOREPLACE.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-8-richard.henderson@linaro.org>


  Commit: 2c796d230e0bb82134d034020026bc8b711adfe0
      
https://github.com/qemu/qemu/commit/2c796d230e0bb82134d034020026bc8b711adfe0
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Remove qemu_host_page_size from elf_core_dump

Used only once in wmr_page_unprotect_regions.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 621ac47d3778b8e883affd04fe80e76e3c8b64e1
      
https://github.com/qemu/qemu/commit/621ac47d3778b8e883affd04fe80e76e3c8b64e1
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Remove qemu_host_page_{size, mask} from mmap.c

Use qemu_real_host_page_size instead.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-9-richard.henderson@linaro.org>


  Commit: e56922abf0754df87fff949cc1f8f23956552aba
      
https://github.com/qemu/qemu/commit/e56922abf0754df87fff949cc1f8f23956552aba
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Remove REAL_HOST_PAGE_ALIGN from mmap.c

We already have qemu_real_host_page_size() in a local variable.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-10-richard.henderson@linaro.org>


  Commit: b36b2b1d3d41c02cc3a112df95478a4bd46d5f9a
      
https://github.com/qemu/qemu/commit/b36b2b1d3d41c02cc3a112df95478a4bd46d5f9a
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Remove HOST_PAGE_ALIGN from mmap.c

This removes a hidden use of qemu_host_page_size, using instead
the existing host_page_size local within each function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-11-richard.henderson@linaro.org>


  Commit: 5d2203691ed5d1657616c402d30b3143382fc25d
      
https://github.com/qemu/qemu/commit/5d2203691ed5d1657616c402d30b3143382fc25d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Remove qemu_host_page_size

Replace with the maximum of the real host page size
and the target page size.  This is an exact replacement.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-12-richard.henderson@linaro.org>


  Commit: b61af9b0d192c23bf5bcf01f206d87b8518f216e
      
https://github.com/qemu/qemu/commit/b61af9b0d192c23bf5bcf01f206d87b8518f216e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M hw/tpm/tpm_ppi.c

  Log Message:
  -----------
  hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init

This removes a hidden use of qemu_host_page_size, hoisting
two uses of qemu_real_host_page_size to a local variable.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>


  Commit: 80c3aeef7f31e2bbac621521e72434e87fd0e64f
      
https://github.com/qemu/qemu/commit/80c3aeef7f31e2bbac621521e72434e87fd0e64f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M system/physmem.c

  Log Message:
  -----------
  softmmu/physmem: Remove qemu_host_page_size

Use qemu_real_host_page_size() instead.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-14-richard.henderson@linaro.org>


  Commit: 9260bd40130e934fce5b5716977307129171fa7e
      
https://github.com/qemu/qemu/commit/9260bd40130e934fce5b5716977307129171fa7e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M system/physmem.c

  Log Message:
  -----------
  softmmu/physmem: Remove HOST_PAGE_ALIGN

Align allocation sizes to the maximum of host and target page sizes.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-15-richard.henderson@linaro.org>


  Commit: 13c13397556afccc05f0f604cbc7d74df0980335
      
https://github.com/qemu/qemu/commit/13c13397556afccc05f0f604cbc7d74df0980335
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/main.c

  Log Message:
  -----------
  linux-user: Remove qemu_host_page_size from main

Use qemu_real_host_page_size() instead.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-16-richard.henderson@linaro.org>


  Commit: d558c395a9bc3f15e010dc0fb786af9a400bccac
      
https://github.com/qemu/qemu/commit/d558c395a9bc3f15e010dc0fb786af9a400bccac
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Split out target_mmap__locked

All "goto fail" may be transformed to "return -1".

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-17-richard.henderson@linaro.org>


  Commit: e8cec51be073bb1abac3850a4c1a90f96a416af2
      
https://github.com/qemu/qemu/commit/e8cec51be073bb1abac3850a4c1a90f96a416af2
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Move some mmap checks outside the lock

Basic validation of operands does not require the lock.
Hoist them from target_mmap__locked back into target_mmap.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-18-richard.henderson@linaro.org>


  Commit: f0a362c476d5e866d91bdca8cad108d7f8e3897c
      
https://github.com/qemu/qemu/commit/f0a362c476d5e866d91bdca8cad108d7f8e3897c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Fix sub-host-page mmap

We cannot skip over the_end1 to the_end, because we fail to
record the validity of the guest page with the interval tree.
Remove "the_end" and rename "the_end1" to "the_end".

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-19-richard.henderson@linaro.org>


  Commit: 6ecc25570f2ef691def1c9d1583c4a3586e56f3a
      
https://github.com/qemu/qemu/commit/6ecc25570f2ef691def1c9d1583c4a3586e56f3a
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Split out mmap_end

Use a subroutine instead of a goto within target_mmap__locked.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-20-richard.henderson@linaro.org>


  Commit: ad87d26e6bb13257409f412224c862fc54025e8b
      
https://github.com/qemu/qemu/commit/ad87d26e6bb13257409f412224c862fc54025e8b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Do early mmap placement only for reserved_va

For reserved_va, place all non-fixed maps then proceed
as for MAP_FIXED.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-21-richard.henderson@linaro.org>


  Commit: 2952b642a555207748dd961fcbfdc48f198eebb6
      
https://github.com/qemu/qemu/commit/2952b642a555207748dd961fcbfdc48f198eebb6
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Split out do_munmap

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 3bfa271e46b506b2ceff41e3b258ad2ddeb25bc3
      
https://github.com/qemu/qemu/commit/3bfa271e46b506b2ceff41e3b258ad2ddeb25bc3
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Use do_munmap for target_mmap failure

For the cases for which the host mmap succeeds, but does
not yield the desired address, use do_munmap to restore
the reserved_va memory reservation.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 68098de90e653adbb8bfc30f85aab9d12f111b80
      
https://github.com/qemu/qemu/commit/68098de90e653adbb8bfc30f85aab9d12f111b80
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Split out mmap_h_eq_g

Move the MAX_FIXED_NOREPLACE check for reserved_va earlier.
Move the computation of host_prot earlier.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-22-richard.henderson@linaro.org>


  Commit: 8080b2f80430e15c28c7e3abd45451fb55a6dd95
      
https://github.com/qemu/qemu/commit/8080b2f80430e15c28c7e3abd45451fb55a6dd95
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Split out mmap_h_lt_g

Work much harder to get alignment and mapping beyond the end
of the file correct.  Both of which are excercised by our
test-mmap for alpha (8k pages) on any 4k page host.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-23-richard.henderson@linaro.org>


  Commit: eb5027ac618f3df76c93fe617a969f82dbeab49b
      
https://github.com/qemu/qemu/commit/eb5027ac618f3df76c93fe617a969f82dbeab49b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Split out mmap_h_gt_g

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-24-richard.henderson@linaro.org>


  Commit: e9206163d9d9cdd962abb00e40b22141a5e29684
      
https://github.com/qemu/qemu/commit/e9206163d9d9cdd962abb00e40b22141a5e29684
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M tests/tcg/alpha/Makefile.target
    M tests/tcg/arm/Makefile.target
    M tests/tcg/hppa/Makefile.target
    M tests/tcg/i386/Makefile.target
    M tests/tcg/m68k/Makefile.target
    M tests/tcg/multiarch/Makefile.target
    R tests/tcg/ppc/Makefile.target
    M tests/tcg/sh4/Makefile.target
    R tests/tcg/sparc64/Makefile.target

  Log Message:
  -----------
  tests/tcg: Remove run-test-mmap-*

These tests are confused, because -p does not change
the guest page size, but the host page size.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-25-richard.henderson@linaro.org>


  Commit: 6ada8619510002e7b0ad5925597232c750282592
      
https://github.com/qemu/qemu/commit/6ada8619510002e7b0ad5925597232c750282592
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M tests/tcg/multiarch/linux/linux-madvise.c

  Log Message:
  -----------
  tests/tcg: Extend file in linux-madvise.c

When guest page size > host page size, this test can fail
due to the SIGBUS protection hack.  Avoid this by making
sure that the file size is at least one guest page.

Visible with alpha guest on x86_64 host.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-26-richard.henderson@linaro.org>


  Commit: 01e449809b0289a5535e935615e5e7f0a695f227
      
https://github.com/qemu/qemu/commit/01e449809b0289a5535e935615e5e7f0a695f227
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M bsd-user/main.c
    M docs/about/deprecated.rst
    M docs/user/main.rst
    M linux-user/main.c

  Log Message:
  -----------
  *-user: Deprecate and disable -p pagesize

This option controls the host page size.  From the mis-usage in
our own testsuite, this is easily confused with guest page size.

The only thing that occurs when changing the host page size is
that stuff breaks, because one cannot actually change the host
page size.  Therefore reject all but the no-op setting as part
of the deprecation process.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-27-richard.henderson@linaro.org>


  Commit: 8c45039f9ecab8bc5b123e39bb0433763524e39d
      
https://github.com/qemu/qemu/commit/8c45039f9ecab8bc5b123e39bb0433763524e39d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M accel/tcg/translate-all.c
    M bsd-user/main.c
    M bsd-user/qemu.h
    M cpu-target.c
    M include/exec/cpu-common.h
    M include/hw/core/cpu.h
    M system/vl.c

  Log Message:
  -----------
  cpu: Remove page_size_init

Move qemu_host_page_{size,mask} and HOST_PAGE_ALIGN into bsd-user.
It should be removed from bsd-user as well, but defer that cleanup.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-28-richard.henderson@linaro.org>


  Commit: 33402cea1f9bae189f80daa0a90fdebd1669ab62
      
https://github.com/qemu/qemu/commit/33402cea1f9bae189f80daa0a90fdebd1669ab62
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Disconnect TargetPageDataNode from page size

Dynamically size the node for the runtime target page size.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-29-richard.henderson@linaro.org>


  Commit: ff8a8bbc2ad198f879fc516abff0e9cf0c30f6cb
      
https://github.com/qemu/qemu/commit/ff8a8bbc2ad198f879fc516abff0e9cf0c30f6cb
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/main.c

  Log Message:
  -----------
  linux-user: Allow TARGET_PAGE_BITS_VARY

If set, match the host and guest page sizes.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-30-richard.henderson@linaro.org>


  Commit: a575230f95cf6b05e5ba97f5f52e33b0878bc0aa
      
https://github.com/qemu/qemu/commit/a575230f95cf6b05e5ba97f5f52e33b0878bc0aa
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M target/arm/cpu-param.h
    M target/arm/cpu.c

  Log Message:
  -----------
  target/arm: Enable TARGET_PAGE_BITS_VARY for AArch64 user-only

Since aarch64 binaries are generally built for multiple
page sizes, it is trivial to allow the page size to vary.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-31-richard.henderson@linaro.org>


  Commit: 78b79b2cb349114f1b3584b67f94433dd08ba05e
      
https://github.com/qemu/qemu/commit/78b79b2cb349114f1b3584b67f94433dd08ba05e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/main.c

  Log Message:
  -----------
  linux-user: Bound mmap_min_addr by host page size

Bizzarely, it is possible to set /proc/sys/vm/mmap_min_addr
to a value below the host page size.  Fix that.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-32-richard.henderson@linaro.org>


  Commit: 835e5fe9e2e1ccd259474a9eb5f5063497e4e4ab
      
https://github.com/qemu/qemu/commit/835e5fe9e2e1ccd259474a9eb5f5063497e4e4ab
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M target/ppc/cpu-param.h

  Log Message:
  -----------
  target/ppc: Enable TARGET_PAGE_BITS_VARY for user-only

Since ppc binaries are generally built for multiple
page sizes, it is trivial to allow the page size to vary.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-33-richard.henderson@linaro.org>


  Commit: f2ffdfab7e5ae5217567508bb74c329e3b19dd44
      
https://github.com/qemu/qemu/commit/f2ffdfab7e5ae5217567508bb74c329e3b19dd44
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M target/alpha/cpu-param.h

  Log Message:
  -----------
  target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only

Since alpha binaries are generally built for multiple
page sizes, it is trivial to allow the page size to vary.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-34-richard.henderson@linaro.org>


  Commit: b816e1b5ba58a986b10cd830d6617f351979ab91
      
https://github.com/qemu/qemu/commit/b816e1b5ba58a986b10cd830d6617f351979ab91
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Remove pgb_dynamic alignment assertion

The assertion was never correct, because the alignment is a composite
of the image alignment and SHMLBA.  Even if the image alignment didn't
match the image address, an assertion would not be correct -- more
appropriate would be an error message about an ill formed image.  But
the image cannot be held to SHMLBA under any circumstances.

Fixes: ee94743034b ("linux-user: completely re-write init_guest_space")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2157
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reported-by: Alexey Sheplyakov <asheplyakov@yandex.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: ff202817dc2b0b3b42992fa7f1ce503f081068fe
      
https://github.com/qemu/qemu/commit/ff202817dc2b0b3b42992fa7f1ce503f081068fe
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M tcg/optimize.c

  Log Message:
  -----------
  tcg/optimize: fix uninitialized variable

The variables uext_opc and sext_opc are used without initialization if
TCG_TARGET_extract_i{32,64}_valid returns false.  The result, depending
on the compiler, might be the generation of extract and sextract opcodes
with invalid offset and count, or just random data in the TCG opcode
stream.

Fixes: ceb9ee06b71 ("tcg/optimize: Handle TCG_COND_TST{EQ,NE}", 2024-02-03)
Cc: Richard Henderson <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240228110641.287205-1-pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 4ef1f559f270c66b3ffc23f6c845ff3d008c6356
      
https://github.com/qemu/qemu/commit/4ef1f559f270c66b3ffc23f6c845ff3d008c6356
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user/x86_64: Handle the vsyscall page in open_self_maps_{2,4}

This is the only case in which we expect to have no host memory backing
for a guest memory page, because in general linux user processes cannot
map any pages in the top half of the 64-bit address space.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2170
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 01a721167a117403c83b947966be1a91ef4dcfba
      
https://github.com/qemu/qemu/commit/01a721167a117403c83b947966be1a91ef4dcfba
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M linux-user/loongarch64/target_syscall.h

  Log Message:
  -----------
  linux-user/loongarch64: Remove TARGET_FORCE_SHMLBA

The kernel abi was changed with

    commit d23b77953f5a4fbf94c05157b186aac2a247ae32
    Author: Huacai Chen <chenhuacai@kernel.org>
    Date:   Wed Jan 17 12:43:08 2024 +0800

        LoongArch: Change SHMLBA from SZ_64K to PAGE_SIZE

during the v6.8 cycle.

Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 9f7c97324c273015812fe93b85d000335d6fa7c4
      
https://github.com/qemu/qemu/commit/9f7c97324c273015812fe93b85d000335d6fa7c4
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
    M linux-user/strace.c
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add strace for shmat

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 78bc8ed9a8f092f6666d7a949ad67dac33cc014d
      
https://github.com/qemu/qemu/commit/78bc8ed9a8f092f6666d7a949ad67dac33cc014d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Rewrite target_shmat

Handle combined host and guest alignment requirements.
Handle host and guest page size differences.
Handle SHM_EXEC.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/115
Tested-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 04dadd22aed00e5a2955ab078d7edd676812cf41
      
https://github.com/qemu/qemu/commit/04dadd22aed00e5a2955ab078d7edd676812cf41
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
    A tests/tcg/multiarch/linux/linux-shmat-maps.c

  Log Message:
  -----------
  tests/tcg: Check that shmat() does not break /proc/self/maps

Add a regression test for a recently fixed issue, where shmat()
desynced the guest and the host view of the address space and caused
open("/proc/self/maps") to SEGV.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <jwyuvao4apydvykmsnvacwshdgy3ixv7qvkh4dbxm3jkwgnttw@k4wpaayou7oq>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: dcce36a7cd45cee3bf68ab5dd53c7caca45cc643
      
https://github.com/qemu/qemu/commit/dcce36a7cd45cee3bf68ab5dd53c7caca45cc643
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-03-04 (Mon, 04 Mar 2024)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/cputlb.c
    M accel/tcg/translate-all.c
    M accel/tcg/user-exec.c
    M bsd-user/main.c
    M bsd-user/qemu.h
    M cpu-target.c
    M docs/about/deprecated.rst
    M docs/user/main.rst
    M hw/tpm/tpm_ppi.c
    M include/exec/cpu-common.h
    M include/hw/core/cpu.h
    M linux-user/elfload.c
    M linux-user/loongarch64/target_syscall.h
    M linux-user/main.c
    M linux-user/mmap.c
    M linux-user/strace.c
    M linux-user/strace.list
    M linux-user/syscall.c
    M migration/ram.c
    M system/physmem.c
    M system/vl.c
    M target/alpha/cpu-param.h
    M target/arm/cpu-param.h
    M target/arm/cpu.c
    M target/ppc/cpu-param.h
    M tcg/aarch64/tcg-target.h
    M tcg/optimize.c
    M tests/tcg/alpha/Makefile.target
    M tests/tcg/arm/Makefile.target
    M tests/tcg/hppa/Makefile.target
    M tests/tcg/i386/Makefile.target
    M tests/tcg/m68k/Makefile.target
    M tests/tcg/multiarch/Makefile.target
    M tests/tcg/multiarch/linux/linux-madvise.c
    A tests/tcg/multiarch/linux/linux-shmat-maps.c
    R tests/tcg/ppc/Makefile.target
    M tests/tcg/sh4/Makefile.target
    R tests/tcg/sparc64/Makefile.target

  Log Message:
  -----------
  Merge tag 'pull-tcg-20240301' of https://gitlab.com/rth7680/qemu into staging

linux-user: Rewrite elf coredump
tcg/aarch64: Apple does not align __int128_t in even registers
accel/tcg: Fixes for page tables in mmio memory
linux-user: Remove qemu_host_page_{size,mask}, HOST_PAGE_ALIGN
migration: Remove qemu_host_page_size
hw/tpm: Remove qemu_host_page_size
softmmu: Remove qemu_host_page_{size,mask}, HOST_PAGE_ALIGN
linux-user: Split and reorganize target_mmap.
*-user: Deprecate and disable -p pagesize
linux-user: Allow TARGET_PAGE_BITS_VARY
target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only
target/arm: Enable TARGET_PAGE_BITS_VARY for AArch64 user-only
target/ppc: Enable TARGET_PAGE_BITS_VARY for user-only
linux-user: Remove pgb_dynamic alignment assertion
tcg/optimize: fix uninitialized variable
linux-user: Rewrite shmat

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmXiXxQdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/H3QgApu4OgadviJuOBenT
# yaGiq+iG4wTL5vVZFK8CgMtq59dJbgJSCooh7U8dn5hIhVuvOU7odUm6embt+4WZ
# 0fDZIjrRvdDMM3LdLFhfdZszMNg6w2ceN9dn5iLkW3wxjRBpTzZNbxhh2Sg308+Q
# oNd+MlYLijDvQP97+tlQ/PBtndLfV5FkpU74ZinWRgcpcT6oH9sP6TRlAVttefy7
# 3GsIXhDKGoDa/0Jpy86qE//3FUaVRqqcNlAIPXMf47ABQ2y2lZlwsfyty7s55sVW
# KgdXdH1GiCgxIonVg4bYvovnwKVH5xHlpsJY48jQtBXR/4exPBFBpeTc422E0Sed
# swpayg==
# =W3pb
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 01 Mar 2024 23:04:52 GMT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-tcg-20240301' of https://gitlab.com/rth7680/qemu: (60 commits)
  tests/tcg: Check that shmat() does not break /proc/self/maps
  linux-user: Rewrite target_shmat
  linux-user: Add strace for shmat
  linux-user/loongarch64: Remove TARGET_FORCE_SHMLBA
  linux-user/x86_64: Handle the vsyscall page in open_self_maps_{2,4}
  tcg/optimize: fix uninitialized variable
  linux-user: Remove pgb_dynamic alignment assertion
  target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only
  target/ppc: Enable TARGET_PAGE_BITS_VARY for user-only
  linux-user: Bound mmap_min_addr by host page size
  target/arm: Enable TARGET_PAGE_BITS_VARY for AArch64 user-only
  linux-user: Allow TARGET_PAGE_BITS_VARY
  accel/tcg: Disconnect TargetPageDataNode from page size
  cpu: Remove page_size_init
  *-user: Deprecate and disable -p pagesize
  tests/tcg: Extend file in linux-madvise.c
  tests/tcg: Remove run-test-mmap-*
  linux-user: Split out mmap_h_gt_g
  linux-user: Split out mmap_h_lt_g
  linux-user: Split out mmap_h_eq_g
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/e1007b6bab5c...dcce36a7cd45

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



reply via email to

[Prev in Thread] Current Thread [Next in Thread]