[PATCH] qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

2023-08-08 Thread Richard Henderson
In order for our emulation of MAP_FIXED_NOREPLACE to succeed within linux-user target_mmap, we require a non-zero value. This does not require host kernel support, merely the bit being defined. MAP_FIXED_NOREPLACE was added with glibc 2.28. From repology.org: Fedora 36: 2.35

Re: [PATCH 14/24] tcg/riscv: Implement negsetcond_*

2023-08-08 Thread Daniel Henrique Barboza
On 8/8/23 00:11, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/riscv/tcg-target.h | 4 ++-- tcg/riscv/tcg-target.c.inc | 45 ++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --

Re: [PATCH 07/24] target/ppc: Use tcg_gen_negsetcond_*

2023-08-08 Thread Daniel Henrique Barboza
On 8/8/23 00:11, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza target/ppc/translate/fixedpoint-impl.c.inc | 6 -- target/ppc/translate/vmx-impl.c.inc| 8 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff

Re: [PATCH 10/24] tcg/ppc: Implement negsetcond_*

2023-08-08 Thread Daniel Henrique Barboza
On 8/8/23 00:11, Richard Henderson wrote: In the general case we simply negate. However with isel we may load -1 instead of 1 with no extra effort. Consolidate EQ0 and NE0 logic. Replace the NE0 zero-extension with inversion+negation of EQ0, which is never worse and may eliminate one insn.

Re: [PATCH 11/24] tcg/ppc: Use the Set Boolean Extension

2023-08-08 Thread Daniel Henrique Barboza
On 8/8/23 00:11, Richard Henderson wrote: The SETBC family of instructions requires exactly two insns for all comparisions, saving 0-3 insns per (neg)setcond. Nice. Signed-off-by: Richard Henderson --- Reviewed-by: Daniel Henrique Barboza tcg/ppc/tcg-target.c.inc | 22 +++

Re: [PATCH for-8.1 v10 14/14] linux-user: Rewrite non-fixed probe_guest_base

2023-08-08 Thread Alex Bennée
Richard Henderson writes: > Use pgb_addr_set to probe for all of the guest addresses, > not just the main executable. Handle the identity map > specially and separately from the search. > > If /proc/self/maps is available, utilize the full power > of the interval tree search, rather than a lin

Re: [PATCH for-8.1 v10 01/14] linux-user: Adjust task_unmapped_base for reserved_va

2023-08-08 Thread Alex Bennée
Richard Henderson writes: > On 8/8/23 02:10, Alex Bennée wrote: >> One thing I'm slightly confused by is the ELF_ET_DYN_BASE can be above >> this (or sometimes the same). Should the mapping of ELF segments be >> handled with mmap_next_start? I assume once mmap_next_start meets the >> mappings f

Re: [PATCH v4 01/11] target/loongarch: Add macro to check current arch

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: Add macro to check if the current cpucfg[1].arch equals to 1(LA32) or 2(LA64). Signed-off-by: Jiajie Chen --- target/loongarch/cpu.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index fa371ca8ba

Re: [PATCH for-8.1 v10 00/14] linux-user: image mapping fixes

2023-08-08 Thread Alex Bennée
Richard Henderson writes: > This is the second half of > > https://patchew.org/QEMU/20230804220032.295411-1-richard.hender...@linaro.org/ > > which I held back because of regressions with s390x testing. > > It turns out that patch 4, "Use MAP_FIXED_NOREPLACE for initial image mmap" > actually t

[PATCH] i386/xen: Don't advertise XENFEAT_supervisor_mode_kernel

2023-08-08 Thread David Woodhouse
From: David Woodhouse XENFEAT_supervisor_mode_kernel shouldn't be set for HVM guests. It confuses lscpu into thinking it's running in PVH mode. No non-cosmetic effects have been observed so far. Signed-off-by: David Woodhouse --- Only really cosmetic. Don't feel strongly about whether it makes

Re: [PATCH] block-migration: Ensure we don't crash during migration cleanup

2023-08-08 Thread Stefan Hajnoczi
On Mon, Jul 31, 2023 at 05:33:38PM -0300, Fabiano Rosas wrote: > We can fail the blk_insert_bs() at init_blk_migration(), leaving the > BlkMigDevState without a dirty_bitmap and BlockDriverState. Account > for the possibly missing elements when doing cleanup. > > Fix the following crashes: > > Th

[PATCH 2/2] block: change reqs_lock to QemuMutex

2023-08-08 Thread Stefan Hajnoczi
CoMutex has poor performance when lock contention is high. The tracked requests list is accessed frequently and performance suffers in QEMU multi-queue block layer scenarios. It is not necessary to use CoMutex for the requests lock. The lock is always released across coroutine yield operations. It

[PATCH 15/33] Implement host-target convertion functions

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the stat converstion functions: h2t_freebds11_statfs Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 41 ++ 1 file changed, 41 insertions(+) diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/

[PATCH 05/33] Forward declare functions defined in os-stat.c

2023-08-08 Thread Karim Taha
From: Michal Meloun Add to bsd-user/freebsd/qemu-os.h the forward declarations of conversion functions related to stat syscalls. Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/qemu-os.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/bsd-user/

[PATCH 14/33] Implement host-target convertion functions

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the stat converstion functions: h2t_freebsd_fhandle t2h_freebsd_fhandle Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 37 + 1 file changed, 37 insertions(+) diff --git a/bsd-user/freebsd/os-

[PATCH 00/33] Implement the stat system calls for FreeBSD.

2023-08-08 Thread Karim Taha
Upstream the implementation of the stat system calls from the qemu-bsd-user fork, the following system calls are implemented: stat(2), lstat(2), fstat(2), fstatat(2), nstat, nfstat, nlstat getfh(2), lgetfh(2), fhopen(2), fhstat(2), fhstatfs(2), statfs(2) fstatfs(2), getfsstat(2), getdents(2), getdi

[PATCH 16/33] Implement host-target convertion functions

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the stat converstion functions: target_to_host_fcntl_cmd Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 71 ++ 1 file changed, 71 insertions(+) diff --git a/bsd-user/freebsd/os-stat.c b/bsd-u

[PATCH 13/33] Implement host-target convertion functions

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the stat converstion functions: h2t_freebsd11_stat h2t_freebsd_nstat Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 94 ++ 1 file changed, 94 insertions(+) create mode 100644 bsd-user/freebsd

[PATCH 22/33] Implement stat related syscalls

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the following syscalls: fcntl(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 74 ++ 1 file changed, 74 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h in

[PATCH 21/33] Implement stat related syscalls

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the following syscalls: getdents(2) getdirecentries(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 72 ++ 1 file changed, 72 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-use

[PATCH 10/33] Add struct target_freebsd_fhandle and fcntl flags to bsd-user/syscall_defs.h

2023-08-08 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 51 + 1 file changed, 51 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index ab59d00a47..608731f0ac 100644 --- a/bsd-user/s

[PATCH 27/33] Implement freebsd11 stat related syscalls

2023-08-08 Thread Karim Taha
From: Michal Meloun Forward declaration of the nstat syscalls: nstat nlstat nfstat Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/bsd-user/f

[PATCH 30/33] Add glue to call the following syscalls to the freebsd_syscall function:

2023-08-08 Thread Karim Taha
From: Warner Losh freebsd11_stat freebsd11_lstat freebsd11_fstat freebsd11_fstatat freebsd11_nstat, freebsd11_nfstat, freebsd11_nlstat fstatat fstat Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c | 42 +++ 1 file changed,

[PATCH 11/33] Define safe_fcntl macro in bsd-user/syscall_defs.h

2023-08-08 Thread Karim Taha
From: Kyle Evans Signed-off-by: Kyle Evans Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 608731f0ac..52ebadbe2c 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs

[PATCH 24/33] Implement freebsd11 stat related syscalls

2023-08-08 Thread Karim Taha
From: Michal Meloun Implement the freebsd11 variant of the following syscalls: fstat(2) fstatat(2) fhstat(2) fhstatfs(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 78 ++

[PATCH 12/33] Rename target_freebsd_time_t to target_time_t

2023-08-08 Thread Karim Taha
From: Warner Losh This is necessary for future code using target_time_t, in bsd-user/syscall_defs. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bsd-user/syscall_defs.h b/bsd-user/sy

[PATCH 04/33] Declarations of h2t and t2h conversion functions.

2023-08-08 Thread Karim Taha
From: Stacey Son Declarations of functions that convert between host and target structs. Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/qemu-os.h | 35 +++ bsd-user/qemu.h| 1 + 2 files changed, 36 insertions(+) create mo

[PATCH 18/33] Implement stat related syscalls

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the following syscalls: stat(2) lstat(2) fstat(2) fstatat(2) nstat nfstat nlstat Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 130 + 1 file changed, 130 insertions(+) create mode 100644 bsd

[PATCH 23/33] Implement freebsd11 stat related syscalls

2023-08-08 Thread Karim Taha
From: Michal Meloun Rename the following syscalls to the freebsd11 variant: do_freebsd_lstat -> do_freebsd11_lstat do_freebsd_stat -> do_freebsd11_stat Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h

[PATCH 17/33] Implement h2t_freebsd_stat and h2t_freebsd_statfs functions

2023-08-08 Thread Karim Taha
From: Michal Meloun They are the 64-bit variants of h2t_freebsd11_stat and h2t_freebsd11_statfs, respectively Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.c | 82 ++ 1 file changed, 82 insertions(+) diff --git a/bsd-u

[PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Karim Taha
From: Warner Losh Use __builtin_choose_expr to avoid type promotion from ?: in __put_user_e and __get_user_e macros. Copied from linux-user/qemu.h, originally by Blue Swirl. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/qemu.h | 81 ---

[PATCH 06/33] Add struct target_freebsd11_stat to bsd-user/syscall_defs

2023-08-08 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 33 + 1 file changed, 33 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index b6d113d24a..5ef76ffa52 100644 --- a/bsd-user/syscall_d

[PATCH 20/33] Implement stat related syscalls

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the following syscalls: statfs(2) fstatfs(2) getfsstat(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 69 ++ 1 file changed, 69 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-

[PATCH 01/33] Move _WANT_FREEBSD macros to include/qemu/osdep.h

2023-08-08 Thread Karim Taha
From: Warner Losh move _WANT_FREEBSD macros from bsd-user/freebsd/os-syscall.c to include/qemu/osdep.h in order to pull some struct defintions needed later in the build. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c | 11 --- include/qemu/osdep

[PATCH 19/33] Implement stat related syscalls

2023-08-08 Thread Karim Taha
From: Stacey Son Implement the following syscalls: getfh(2) lgetfh(2) fhopen(2) fhstat(2) fhstatfs(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 83 ++ 1 file changed, 83 insertions(+) diff --git a/bsd-user/freebsd

[PATCH 28/33] Implement do_freebsd_realpathat syscall

2023-08-08 Thread Karim Taha
From: Mikaël Urankar Signed-off-by: Mikaël Urankar Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index e31b2aab9e..cf56c778ae 100644 --- a/bsd-user

[PATCH 31/33] Add glue to call the following syscalls to the freebsd_syscall function:

2023-08-08 Thread Karim Taha
From: Warner Losh getfh lgetfh fhopen freebsd11_fhstat freebsd11_fhstatfs fhstat fhstatfs Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c | 28 1 file changed, 28 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bs

[PATCH 09/33] Add struct target_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Karim Taha
From: Michal Meloun Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 25 + 1 file changed, 25 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 06be8244de..ab59d00a47 100644 --- a/bsd-user/syscall_def

[PATCH 26/33] Implement freebsd11 stat related syscalls

2023-08-08 Thread Karim Taha
From: Michal Meloun Implement the freebsd11 variant of the following syscalls: getdirecentries(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 44 ++ 1 file ch

[PATCH 07/33] Add struct target_stat to bsd-user/syscall_defs.h

2023-08-08 Thread Karim Taha
From: Michal Meloun Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 38 ++ 1 file changed, 38 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 5ef76ffa52..e796e7e13d 100644 --- a/bsd-use

[PATCH 08/33] Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h

2023-08-08 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 65 + 1 file changed, 65 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index e796e7e13d..06be8244de 100644 --- a/bsd-user/s

[PATCH 02/33] Disable clang warnings arising from bsd-user/qemu.h

2023-08-08 Thread Karim Taha
From: Kyle Evans Implement PRAGMA_DISABLE_PACKED_WARNING and PRAGMA_REENABLE_PACKED_WARNING macros in bsd-user/qemu.h. Signed-off-by: Kyle Evans Signed-off-by: Karim Taha --- bsd-user/qemu.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/bsd-user/qemu.h

[PATCH 29/33] Add os-stat.c to the build

2023-08-08 Thread Karim Taha
Signed-off-by: Karim Taha --- bsd-user/freebsd/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/bsd-user/freebsd/meson.build b/bsd-user/freebsd/meson.build index f87c788e84..f2f047cca3 100644 --- a/bsd-user/freebsd/meson.build +++ b/bsd-user/freebsd/meson.build @@ -1,4 +1,5 @@ bsd

[PATCH 25/33] Implement freebsd11 stat related syscalls

2023-08-08 Thread Karim Taha
From: Michal Meloun Implement the freebsd11 variant of the following syscalls: statfs(2) fstatfs(2) getfsstat(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/os-stat.h | 75 ++

[PATCH 33/33] Add glue to call the following syscalls to the freebsd_syscall function:

2023-08-08 Thread Karim Taha
From: Warner Losh freebsd11_getdents getdirentries freebsd11_getdirentries fcntl Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c | 16 1 file changed, 16 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-sys

Re: [PATCH v4 01/11] target/loongarch: Add macro to check current arch

2023-08-08 Thread Jiajie Chen
On 2023/8/9 01:01, Richard Henderson wrote: On 8/7/23 18:54, Jiajie Chen wrote: Add macro to check if the current cpucfg[1].arch equals to 1(LA32) or 2(LA64). Signed-off-by: Jiajie Chen ---   target/loongarch/cpu.h | 7 +++   1 file changed, 7 insertions(+) diff --git a/target/loongarch/

[PATCH 32/33] Add glue to call the following syscalls to the freebsd_syscall function:

2023-08-08 Thread Karim Taha
From: Warner Losh freebsd11_statfs statfs freebsd11_fstatfs fstatfs freebsd11_getfsstat getfsstat Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c | 24 1 file changed, 24 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c

Re:[PATCH v1 0/3] softmmu/physmem: file_ram_open() readonly improvements

2023-08-08 Thread ThinerLogoer
At 2023-08-08 03:07:31, "David Hildenbrand" wrote: >Patch #1 is the result of the discussion of: >"[PATCH v2] softmmu/physmem: try opening file readonly before failure > in file_ram_open" [1] > >Instead of handling it inside file_ram_open(), handle it in the caller >and only fallback to r

Re: [PATCH for-8.1 v10 01/14] linux-user: Adjust task_unmapped_base for reserved_va

2023-08-08 Thread Richard Henderson
On 8/8/23 09:59, Alex Bennée wrote: All of this is part of the "legacy" memory layout, for which there is a personality flag. For 8.2, I think we should work on implementing the "new" memory layout, which places everything top-down. But most importantly it completely separates brk from the bin

Re: [PATCH v5 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-08 Thread Andrew Melnichenko
Hi all, Thanks for the comments - I'll update and send new patches. On Sat, Aug 5, 2023 at 10:34 AM Markus Armbruster wrote: > > Andrew Melnychenko writes: > > > Now, the binary objects may be retrieved by id. > > It would require for future qmp commands that may require specific > > eBPF blob.

Re: [PATCH 1/2] block: minimize bs->reqs_lock section in tracked_request_end()

2023-08-08 Thread Eric Blake
On Tue, Aug 08, 2023 at 11:58:51AM -0400, Stefan Hajnoczi wrote: > Signed-off-by: Stefan Hajnoczi > --- > block/io.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/block/io.c b/block/io.c > index 055fcf7438..85d5176256 100644 > --- a/bl

[PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Vineet Gupta
zicond is now codegen supported in both llvm and gcc. This change allows seamless enabling/testing of zicond in downstream projects. e.g. currently riscv-gnu-toolchain parses elf attributes to create a cmdline for qemu but fails short of enabling it because of the "x-" prefix. Signed-off-by: Vine

[PATCH 2/2] riscv: zicond: make default

2023-08-08 Thread Vineet Gupta
Again this helps with better testing and something qemu has been doing with newer features anyways. Signed-off-by: Vineet Gupta --- target/riscv/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 022bd9d01223..e6e28414b223 1

Re: [PATCH v4 02/11] target/loongarch: Add new object class for loongarch32 cpus

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: Add object class for future loongarch32 cpus. It is derived from the loongarch64 object class. Signed-off-by: Jiajie Chen --- target/loongarch/cpu.c | 24 target/loongarch/cpu.h | 11 +++ 2 files changed, 35 insertions(+)

Re: [PATCH 2/2] block: change reqs_lock to QemuMutex

2023-08-08 Thread Eric Blake
On Tue, Aug 08, 2023 at 11:58:52AM -0400, Stefan Hajnoczi wrote: > CoMutex has poor performance when lock contention is high. The tracked > requests list is accessed frequently and performance suffers in QEMU > multi-queue block layer scenarios. > > It is not necessary to use CoMutex for the reque

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Richard Henderson
On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in both llvm and gcc. It is still not in https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions r~

Re: [PATCH v4 03/11] target/loongarch: Add GDB support for loongarch32 mode

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: GPRs and PC are 32-bit wide in loongarch32 mode. Signed-off-by: Jiajie Chen --- configs/targets/loongarch64-softmmu.mak | 2 +- gdb-xml/loongarch-base32.xml| 45 + target/loongarch/cpu.c | 10 +-

Re: [PATCH v4 04/11] target/loongarch: Support LoongArch32 TLB entry

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: The TLB entry of LA32 lacks NR, NX and RPLV and they are hardwired to zero in LoongArch32. Signed-off-by: Jiajie Chen --- target/loongarch/cpu-csr.h| 9 + target/loongarch/tlb_helper.c | 17 - 2 files changed, 17 insertions(+)

Re: [PATCH v4 05/11] target/loongarch: Support LoongArch32 DMW

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: LA32 uses a different encoding for CSR.DMW and a new direct mapping mechanism. Signed-off-by: Jiajie Chen --- target/loongarch/cpu-csr.h| 7 +++ target/loongarch/tlb_helper.c | 26 +++--- 2 files changed, 26 insertions(+), 7 de

Re: [PATCH v4 06/11] target/loongarch: Support LoongArch32 VPPN

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: VPPN of TLBEHI/TLBREHI is limited to 19 bits in LA32. Signed-off-by: Jiajie Chen --- target/loongarch/cpu-csr.h| 6 -- target/loongarch/tlb_helper.c | 23 ++- 2 files changed, 22 insertions(+), 7 deletions(-) Reviewed-by: Ric

Re: [PATCH v4 07/11] target/loongarch: Add LA32 & VA32 to DisasContext

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -119,6 +119,9 @@ static void loongarch_tr_init_disas_context(DisasContextBase *dcbase, ctx->vl = LSX_LEN; } +ctx->la32 = LOONGARCH_CPUCFG_ARCH(env, LA32); +ctx

Re: [PATCH 2/2] hw/intc: Make rtc variable names consistent

2023-08-08 Thread Jason Chien
Hi, The patch seems to be ignored. I am not sure who to ping. Could someone please review this patch? Thank you! patch link: https://lore.kernel.org/qemu-devel/20230728082502.26439-2-jason.ch...@sifive.com/ Jason On Fri, Jul 28, 2023 at 4:25 PM Jason Chien wrote: > The variables whose values ar

Re: [PATCH 1/2] hw/intc: Fix upper/lower mtime write calculation

2023-08-08 Thread Jason Chien
Hi, The patch seems to be ignored. I am not sure who to ping. Could someone please review this patch? Thank you! patch link: https://lore.kernel.org/qemu-devel/20230728082502.26439-1-jason.ch...@sifive.com/ On Fri, Jul 28, 2023 at 4:25 PM Jason Chien wrote: > When writing the upper mtime, we sho

Re: [PATCH] target/loongarch: Split fcc register to fcc0-7 in gdbstub

2023-08-08 Thread Alex Bennée
bibo mao writes: > I think that it is problem of loongarch gdb, rather qemu. > If so, everytime when gdb changes register layout, qemu need modify. > There should be compatible requirements between gdb client and gdb server. > > Tiezhu, > > what is your opition? You can always register additio

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Vineet Gupta
On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in both llvm and gcc. It is still not in https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions Right, its been frozen since April though and with support trickling in

[PULL 0/3] fix ppc64le build, fully kill alpha and s390 linux-user

2023-08-08 Thread Paolo Bonzini
The following changes since commit 9400601a689a128c25fa9c21e932562e0eeb7a26: Merge tag 'pull-tcg-20230806-3' of https://gitlab.com/rth7680/qemu into staging (2023-08-06 16:47:48 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to

[PULL 1/3] configure: fix detection for x32 linux-user

2023-08-08 Thread Paolo Bonzini
x32 uses the same signal handling fragments as x86_64, since host_arch is set to x86_64 when Meson runs. Remove the unnecessary forwarder and set the host_arch variable properly in configure. Reviewed-by: Richard Henderson Acked-by: Ilya Leoshkevich Reviewed-by: Michael Tokarev Tested-by: Ilya

[PULL 2/3] linux-user: cleanup unused linux-user/include/host directories

2023-08-08 Thread Paolo Bonzini
Alpha and 31-bit s390 lack the assembly fragment to handle signals occurring at the same time as system calls, so they cannot run linux-user emulation anymore. Drop the host-signal.h files for them. Signed-off-by: Paolo Bonzini Acked-by: Ilya Leoshkevich Reviewed-by: Michael Tokarev Tested-by:

[PULL 3/3] configure: unify case statements for CPU canonicalization

2023-08-08 Thread Paolo Bonzini
The CPU model has to be canonicalized to what Meson wants in the cross file, to what Linux uses for its asm-$ARCH directories, and to what QEMU uses for its user-mode emulation host/$ARCH directories. Do all three in a single case statement, and check that the Linux and QEMU directories actually e

Re: [PATCH v4 08/11] target/loongarch: Reject la64-only instructions in la32 mode

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: -TRANS(addi_d, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_addi_tl) -TRANS(alsl_w, gen_rrr_sa, EXT_NONE, EXT_SIGN, gen_alsl) -TRANS(alsl_wu, gen_rrr_sa, EXT_NONE, EXT_ZERO, gen_alsl) -TRANS(alsl_d, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_alsl) +TRANS_64(addi_d, gen_rri_

Re: [PATCH v4 09/11] target/loongarch: Truncate high 32 bits of address in VA32 mode

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: When running in VA32 mode(LA32 or VA32L[1-3] matching PLV), virtual address is truncated to 32 bits before address mapping. Signed-off-by: Jiajie Chen --- target/loongarch/cpu.h | 6 +- target/loongarch/insn_trans/trans_atomic

Re: [PATCH v4 10/11] target/loongarch: Sign extend results in VA32 mode

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -218,6 +218,19 @@ static TCGv va32_address(DisasContext *ctx, TCGv addr) return addr; } +static uint64_t sign_extend32(uint64_t data) +{ +return (data & 0x7FFF) - (data

Re: [PATCH v4 11/11] target/loongarch: Add loongarch32 cpu la132

2023-08-08 Thread Richard Henderson
On 8/7/23 18:54, Jiajie Chen wrote: +static void loongarch_la464_initfn(Object *obj) +{ +LoongArchCPU *cpu = LOONGARCH_CPU(obj); +CPULoongArchState *env = &cpu->env; + +loongarch_cpu_initfn_common(env); + +cpu->dtb_compatible = "loongarch,Loongson-3A5000"; +env->cpucfg[0] = 0x

Re: [PATCH for-8.2 v2 1/2] qapi/migration: Deduplicate migration parameter field comments

2023-08-08 Thread Peter Xu
On Sun, Aug 06, 2023 at 11:49:46AM -0400, Peter Xu wrote: > > I think we have a tradeoff here. If perpetuating the unclean and ugly > > use of "" is what it takes to de-triplicate migration parameters, we may > > decide to accept that. > > I don't think it's a must. As Dan raised, we can convert

Re: [PATCH 01/33] Move _WANT_FREEBSD macros to include/qemu/osdep.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Warner Losh move _WANT_FREEBSD macros from bsd-user/freebsd/os-syscall.c to include/qemu/osdep.h in order to pull some struct defintions needed later in the build. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/freebsd/os-syscall.c |

Re: [PATCH 02/33] Disable clang warnings arising from bsd-user/qemu.h

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: +/* + * Tricky points: + * - Use __builtin_choose_expr to avoid type promotion from ?:, + * - Invalid sizes result in a compile time error stemming from + * the fact that abort has no parameters. + * - It's easier to use the endian-specific unaligned load/stor

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Palmer Dabbelt
On Tue, 08 Aug 2023 11:45:49 PDT (-0700), Vineet Gupta wrote: On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in both llvm and gcc. It is still not in https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions Right, it

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-08 Thread Peter Xu
On Mon, Aug 07, 2023 at 09:07:32PM +0200, David Hildenbrand wrote: > From: Thiner Logoer > > Users may specify > * "-mem-path" or > * "-object memory-backend-file,share=off,readonly=off" > and expect such COW (MAP_PRIVATE) mappings to work, even if the user > does not have write permissions to op

Re: [PATCH 03/33] Update the definitions of __put_user and __get_user macros

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Warner Losh Use __builtin_choose_expr to avoid type promotion from ?: in __put_user_e and __get_user_e macros. Copied from linux-user/qemu.h, originally by Blue Swirl. Signed-off-by: Warner Losh Signed-off-by: Karim Taha --- bsd-user/qemu.h | 81 +

Re: [PATCH 2/2] riscv: zicond: make default

2023-08-08 Thread Daniel Henrique Barboza
(CCing Alistair and other reviewers) On 8/8/23 15:17, Vineet Gupta wrote: Again this helps with better testing and something qemu has been doing with newer features anyways. Signed-off-by: Vineet Gupta --- Even if we can reach a consensus about removing the experimental (x- prefix) status f

[PULL 07/14] linux-user: Do not adjust image mapping for host page size

2023-08-08 Thread Richard Henderson
Remove TARGET_ELF_EXEC_PAGESIZE, and 3 other TARGET_ELF_PAGE* macros based off of that. Rely on target_mmap to handle guest vs host page size mismatch. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson ---

[PULL 01/14] linux-user: Adjust task_unmapped_base for reserved_va

2023-08-08 Thread Richard Henderson
Ensure that the chosen values for mmap_next_start and task_unmapped_base are within the guest address space. Tested-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/user-mmap.h | 34 +- linux-user/main.c | 28 +

[PULL 03/14] linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h

2023-08-08 Thread Richard Henderson
Copy each guest kernel's default value, then bound it against reserved_va or the host address space. Tested-by: Helge Deller Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 3 +++ linux-user/alpha/target_mman.h | 3 +++ linux-user/a

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

2023-08-08 Thread 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-l

[PULL 02/14] linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h

2023-08-08 Thread Richard Henderson
Provide default values that are as close as possible to the values used by the guest's kernel. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 10 ++ linu

[PULL 13/14] linux-user: Rewrite fixed probe_guest_base

2023-08-08 Thread Richard Henderson
Create a set of subroutines to collect a set of guest addresses, all of which must be mappable on the host. Use this within the renamed pgb_fixed subroutine to validate the user's choice of guest_base specified by the -B command-line option. Reviewed-by: Alex Bennée Signed-off-by: Richard Hender

[PULL 11/14] linux-user: Remove duplicate CPU_LOG_PAGE from probe_guest_base

2023-08-08 Thread Richard Henderson
The proper logging for probe_guest_base is in the main function. There is no need to duplicate that in the subroutines. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/elfload.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/linux-user/elfload.c

[PULL 10/14] util/selfmap: Rewrite using qemu/interval-tree.h

2023-08-08 Thread Richard Henderson
We will want to be able to search the set of mappings. For this patch, the two users iterate the tree in order. Signed-off-by: Richard Henderson --- include/qemu/selfmap.h | 22 linux-user/elfload.c | 14 +++-- linux-user/syscall.c | 15 +++--- util/selfmap.c | 114 ++

[PULL 12/14] linux-user: Consolidate guest bounds check in probe_guest_base

2023-08-08 Thread Richard Henderson
The three sets of checks are identical, logically. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/elfload.c | 50 +++- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c in

[PULL 06/14] linux-user: Adjust initial brk when interpreter is close to executable

2023-08-08 Thread Richard Henderson
From: Helge Deller While we attempt to load a ET_DYN executable far away from TASK_UNMAPPED_BASE, we are not completely in control of the address space layout. If the interpreter lands close to the executable, leaving insufficient heap space, move brk. Tested-by: Helge Deller Signed-off-by: He

[PULL 05/14] linux-user: Use elf_et_dyn_base for ET_DYN with interpreter

2023-08-08 Thread Richard Henderson
Follow the lead of the linux kernel in fs/binfmt_elf.c, in which an ET_DYN executable which uses an interpreter (usually a PIE executable) is loaded away from where the interpreter itself will be loaded. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by:

[PULL 09/14] linux-user: Use zero_bss for PT_LOAD with no file contents too

2023-08-08 Thread Richard Henderson
If p_filesz == 0, then vaddr_ef == vaddr. We can reuse the code in zero_bss rather than incompletely duplicating it in load_elf_image. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/elfloa

[PULL 14/14] linux-user: Rewrite non-fixed probe_guest_base

2023-08-08 Thread Richard Henderson
Use pgb_addr_set to probe for all of the guest addresses, not just the main executable. Handle the identity map specially and separately from the search. If /proc/self/maps is available, utilize the full power of the interval tree search, rather than a linear search through the address list. If

[PULL 08/14] linux-user: Do not adjust zero_bss for host page size

2023-08-08 Thread Richard Henderson
Rely on target_mmap to handle guest vs host page size mismatch. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 63 +++- 1 file changed, 27 insertions(+), 36 deleti

[PULL 04/14] linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap

2023-08-08 Thread Richard Henderson
Use this as extra protection for the guest mapping over any qemu host mappings. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/l

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Daniel Henrique Barboza
On 8/8/23 17:52, Palmer Dabbelt wrote: On Tue, 08 Aug 2023 11:45:49 PDT (-0700), Vineet Gupta wrote: On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in both llvm and gcc. It is still not in https://wiki.riscv.org/display/HO

Re: [PATCH 1/2] riscv: zicond: make non-experimental

2023-08-08 Thread Palmer Dabbelt
On Tue, 08 Aug 2023 14:10:54 PDT (-0700), dbarb...@ventanamicro.com wrote: On 8/8/23 17:52, Palmer Dabbelt wrote: On Tue, 08 Aug 2023 11:45:49 PDT (-0700), Vineet Gupta wrote: On 8/8/23 11:29, Richard Henderson wrote: On 8/8/23 11:17, Vineet Gupta wrote: zicond is now codegen supported in

Re: [PATCH 04/33] Declarations of h2t and t2h conversion functions.

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Declarations of functions that convert between host and target structs. Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/freebsd/qemu-os.h | 35 +++ bsd-user/qemu.h| 1 + 2 fi

Re: [PATCH 05/33] Forward declare functions defined in os-stat.c

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Michal Meloun Add to bsd-user/freebsd/qemu-os.h the forward declarations of conversion functions related to stat syscalls. Signed-off-by: Michal Meloun Signed-off-by: Karim Taha --- bsd-user/freebsd/qemu-os.h | 15 +++ 1 file changed, 1

Re: [PATCH 06/33] Add struct target_freebsd11_stat to bsd-user/syscall_defs

2023-08-08 Thread Richard Henderson
On 8/7/23 23:07, Karim Taha wrote: From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha --- bsd-user/syscall_defs.h | 33 + 1 file changed, 33 insertions(+) Acked-by: Richard Henderson r~

<    1   2   3   >