Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge tag 'pull-tcg-20230806' of https://gitlab.com/rth7680/qemu into…
… staging

accel/tcg: Do not issue misaligned i/o
accel/tcg: Call save_iotlb_data from io_readx
gdbstub: use 0 ("any process") on packets with no PID
linux-user: Fixes for MAP_FIXED_NOREPLACE
linux-user: Fixes for brk
linux-user: Adjust task_unmapped_base for reserved_va
linux-user: Use ELF_ET_DYN_BASE for ET_DYN with interpreter
linux-user: Remove host != guest page size workarounds in brk and image load
linux-user: Set V in ELF_HWCAP for RISC-V
*-user: Remove last_brk as unused

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmTP8dsdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV9YjwgAoCWGJ/b0s4nLbkWr
# DOPd7X2tL8gzHqTaZEK0+JdTxAW7OB79Xd5hUBN5tb2HgniCLJQ7x8uXKKCTxY54
# nH9E3fxx8tDYHEceg3tvvAtM5Gz9YBF8nXt/wYeg+EejvybLl1PKO5AaZxsfrJI1
# NPTHbHiMqXIfS2fChcfd8xlQoinkGPQ+R0udKvjD8ePW8FndiUsgTL2QyNmKi0+G
# JWPLhdpG4fN0YxpQLkdmWXDK/bflk7bdN9kPaV329poLu/Z6KQMQXZy41AvvJMaZ
# V8Vlazpbb+Cb9TSYGxlAV1zkcvaxj66id0hMe+VPdPHg0AZobcu/zAtAFH/kL4+r
# cPlUdA==
# =CMRa
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 06 Aug 2023 12:17:47 PM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-tcg-20230806' of https://gitlab.com/rth7680/qemu: (24 commits)
  linux-user: Use zero_bss for PT_LOAD with no file contents too
  linux-user: Do not adjust zero_bss for host page size
  linux-user: Do not adjust image mapping for host page size
  linux-user: Adjust initial brk when interpreter is close to executable
  linux-user: Use elf_et_dyn_base for ET_DYN with interpreter
  linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
  linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h
  linux-user: Adjust task_unmapped_base for reserved_va
  linux-user: Properly set image_info.brk in flatload
  bsd-user: Remove last_brk
  linux-user: Remove last_brk
  linux-user: Do not align brk with host page size
  linux-user: Do nothing if too small brk is specified
  linux-user: Use MAP_FIXED_NOREPLACE for do_brk()
  linux-user: Do not call get_errno() in do_brk()
  linux-user: Fix MAP_FIXED_NOREPLACE on old kernels
  linux-user: Unset MAP_FIXED_NOREPLACE for host
  linux-user/elfload: Set V in ELF_HWCAP for RISC-V
  configure: Fix linux-user host detection for riscv64
  gdbstub: use 0 ("any process") on packets with no PID
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Aug 6, 2023
2 parents 6db03cc + 810dcb4 commit 82c7e7d
Show file tree
Hide file tree
Showing 32 changed files with 626 additions and 294 deletions.
289 changes: 192 additions & 97 deletions accel/tcg/cputlb.c

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions bsd-user/mmap.c
Expand Up @@ -214,8 +214,6 @@ static int mmap_frag(abi_ulong real_start,
#endif
abi_ulong mmap_next_start = TASK_UNMAPPED_BASE;

unsigned long last_brk;

/*
* Subroutine of mmap_find_vma, used when we have pre-allocated a chunk of guest
* address space.
Expand Down
1 change: 0 additions & 1 deletion bsd-user/qemu.h
Expand Up @@ -232,7 +232,6 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
abi_ulong new_size, unsigned long flags,
abi_ulong new_addr);
int target_msync(abi_ulong start, abi_ulong len, int flags);
extern unsigned long last_brk;
extern abi_ulong mmap_next_start;
abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size);
void TSA_NO_TSA mmap_fork_start(void);
Expand Down
9 changes: 8 additions & 1 deletion configure
Expand Up @@ -469,6 +469,13 @@ else
echo "WARNING: unrecognized host CPU, proceeding with 'uname -m' output '$cpu'"
fi

case "$cpu" in
riscv*)
host_arch=riscv ;;
*)
host_arch="$cpu" ;;
esac

# Normalise host CPU name and set multilib cflags. The canonicalization
# isn't really necessary, because the architectures that we check for
# should not hit the 'uname -m' case, but better safe than sorry.
Expand Down Expand Up @@ -803,7 +810,7 @@ default_target_list=""
mak_wilds=""

if [ "$linux_user" != no ]; then
if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$cpu" ]; then
if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$host_arch" ]; then
linux_user=yes
elif [ "$linux_user" = yes ]; then
error_exit "linux-user not supported on this architecture"
Expand Down
2 changes: 1 addition & 1 deletion gdbstub/gdbstub.c
Expand Up @@ -537,7 +537,7 @@ static GDBThreadIdKind read_thread_id(const char *buf, const char **end_buf,
/* Skip '.' */
buf++;
} else {
p = 1;
p = 0;
}

ret = qemu_strtoul(buf, &buf, 16, &t);
Expand Down
13 changes: 13 additions & 0 deletions linux-user/aarch64/target_mman.h
Expand Up @@ -4,6 +4,19 @@
#define TARGET_PROT_BTI 0x10
#define TARGET_PROT_MTE 0x20

/*
* arch/arm64/include/asm/processor.h:
*
* TASK_UNMAPPED_BASE DEFAULT_MAP_WINDOW / 4
* DEFAULT_MAP_WINDOW DEFAULT_MAP_WINDOW_64
* DEFAULT_MAP_WINDOW_64 UL(1) << VA_BITS_MIN
* VA_BITS_MIN 48 (unless explicitly configured smaller)
*/
#define TASK_UNMAPPED_BASE (1ull << (48 - 2))

/* arch/arm64/include/asm/elf.h */
#define ELF_ET_DYN_BASE TARGET_PAGE_ALIGN((1ull << 48) / 3 * 2)

#include "../generic/target_mman.h"

#endif
11 changes: 11 additions & 0 deletions linux-user/alpha/target_mman.h
Expand Up @@ -20,6 +20,17 @@
#define TARGET_MS_SYNC 2
#define TARGET_MS_INVALIDATE 4

/*
* arch/alpha/include/asm/processor.h:
*
* TASK_UNMAPPED_BASE TASK_SIZE / 2
* TASK_SIZE 0x40000000000UL
*/
#define TASK_UNMAPPED_BASE 0x20000000000ull

/* arch/alpha/include/asm/elf.h */
#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)

#include "../generic/target_mman.h"

#endif
11 changes: 11 additions & 0 deletions linux-user/arm/target_mman.h
@@ -1 +1,12 @@
/*
* arch/arm/include/asm/memory.h
* TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M)
* TASK_SIZE CONFIG_PAGE_OFFSET
* CONFIG_PAGE_OFFSET 0xC0000000 (default in Kconfig)
*/
#define TASK_UNMAPPED_BASE 0x40000000

/* arch/arm/include/asm/elf.h */
#define ELF_ET_DYN_BASE 0x00400000

#include "../generic/target_mman.h"
12 changes: 12 additions & 0 deletions linux-user/cris/target_mman.h
@@ -1 +1,13 @@
/*
* arch/cris/include/asm/processor.h:
* TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
*
* arch/cris/include/arch-v32/arch/processor.h
* TASK_SIZE 0xb0000000
*/
#define TASK_UNMAPPED_BASE TARGET_PAGE_ALIGN(0xb0000000 / 3)

/* arch/cris/include/uapi/asm/elf.h */
#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE * 2)

#include "../generic/target_mman.h"

0 comments on commit 82c7e7d

Please sign in to comment.