Re: [PATCH 14/16] bsd-user: Implment core dumps

2023-04-08 Thread Warner Losh
On Sat, Apr 8, 2023 at 1:15 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 4/5/23 14:36, Warner Losh wrote: > > From: Stacey Son > > > > Bring in the code that was originally copied from linxu-user/elfload.c > > and moved to elfcore.c. This code then removed the Linux specific b

Re: [PATCH for-8.0 v2] target/ppc: Fix temp usage in gen_op_arith_modw

2023-04-08 Thread Nicholas Piggin
On Sun Apr 9, 2023 at 7:24 AM AEST, Cédric Le Goater wrote: > On 4/8/23 09:05, Richard Henderson wrote: > > Fix a crash writing to 't3', which is now a constant. > > Instead, write the result of the remu to 't1'. > > > > Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c") > > Repor

Re: [PATCH for-8.0 v2] target/ppc: Fix temp usage in gen_op_arith_modw

2023-04-08 Thread Cédric Le Goater
On 4/8/23 09:05, Richard Henderson wrote: Fix a crash writing to 't3', which is now a constant. Instead, write the result of the remu to 't1'. Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c") Reported-by: Nicholas Piggin Reviewed-by: Anton Johansson Signed-off-by: Richard He

Re: [PATCH] target/ppc: Fix MPC8555 and MPC8560 core type to e500v1

2023-04-08 Thread Pali Rohár
On Monday 04 July 2022 12:18:51 Pali Rohár wrote: > Just for completeness, here is list of all Motorola/Freescale/NXP > processors which were released and have e500v1 or e500v2 cores. > > e500v1: > MPC8540 > MPC8541 > MPC8555 > MPC8560 > > e500v2: > BSC9131 > BSC9132 > C291 > C292 > C293 > MPC853

Error handling: Audit callers of load_image_targphys,...

2023-04-08 Thread Landon Johnson
Hello, I am a student at UT Austin. A few other students and I would like to work on this issue as part of a group project in our virtualization class: Error handling: Audit callers of load_image_targphys, get_image_size, event_notifier_init, msix_init

Re: [PATCH for-8.0] tcg/ppc: Fix TCG_TARGET_CALL_{ARG, RET}_I128 for ppc32

2023-04-08 Thread Mark Cave-Ayland
On 08/04/2023 16:43, Richard Henderson wrote: For both _CALL_SYSV and _CALL_DARWIN, return is by reference, not in 4 integer registers. For _CALL_SYSV, argument is also by reference. This error resulted in $ ./qemu-system-i386 -nographic qemu-system-i386: tcg/ppc/tcg-target.c.inc:18

Re: [PATCH 02/16] bsd-user: Ifdef a few MAP_ constants for NetBSD

2023-04-08 Thread Warner Losh
On Sat, Apr 8, 2023 at 1:03 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 4/5/23 14:35, Warner Losh wrote: > > MAP_GUARD, MAP_EXCL, and MAP_NOCORE are FreeBSD only. Add back the > > ifdefs that I removed in 36d5d891559f (but only these ifdefs, the > > rest of the commit is not r

Re: [PATCH 16/16] bsd-user: Implement SIGSYS on arm

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: When a system call returns ENOSYS, send a SIGSYS to the process (to generate a core dump). Signed-off-by: Warner Losh --- bsd-user/arm/target_arch_cpu.h | 8 1 file changed, 8 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH 15/16] bsd-user: Add SIGSYS to core dump signals.

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: SIGSYS creates a core by default if uncaught. Follow that here. Sort with the same order as is in the kernel. Signed-off-by: Warner Losh --- bsd-user/signal.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) Reviewed-by: Richard Henders

Re: [PATCH 14/16] bsd-user: Implment core dumps

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: From: Stacey Son Bring in the code that was originally copied from linxu-user/elfload.c and moved to elfcore.c. This code then removed the Linux specific bits, replacing them with FreeBSD specific bits. The commit history for this is not at all what we'd like

Re: [PATCH 13/16] bsd-user: Implement sysctl kern.proc, except kern.proc.full_path

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: From: Stacey Son Use the recently committed conversion routines to implement all the kern.proc flavors, except for the full path (the prereqs of which aren't yet in qemu-project's master branch). Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-

Re: [PATCH 12/16] bsd-user: Implement do_sysctl_kern_proc_vmmap

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: From: Stacey Son Implement do_sysctl_kern_proc_vmmap. This pulls kern.proc.vmmap out of the host kernel and converts it to the guest's format. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/os-sys.c | 115 +

Re: [PATCH 11/16] bsd-user: Implement do_sysctl_kern_proc_filedesc

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: From: Stacey Son Implement do_sysctl_kern_proc_filedesc. This pulls kern.proc.filedesc out of the host kernel and converts it to the guest's format. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/os-sys.c | 193 +++

Re: [PATCH 10/16] bsd-user: Implmenet do_sysctl_kern_getprocs

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: From: Stacey Son Implement do_sysctl_kern_getprocs to retrieve proc info from the kernel. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/os-sys.c | 165 +- bsd-user/qemu.h | 3 +

Re: [PATCH 09/16] bsd-user: h2g_rusage

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: From: Stacey Son Converts host's rusage to the guest's rusage. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-proc.c | 48 bsd-user/meson.build | 1 + bsd-user/qemu-bsd.h | 30

Re: [PATCH 08/16] bsd-user: Remove useless mmap definitions

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: On BSD, all architectures have the same mmap flags. Since we don't translate the flags, we don't need these defines here. We can't cross-run different BSD binaries. Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 36 -

Re: [PATCH 07/16] bsd-user: Move system call include to os-syscall.h

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: @@ -98,11 +75,9 @@ struct target_iovec { * sys/timex.h */ -typedef abi_long target_freebsd_suseconds_t; - /* compare to sys/timespec.h */ struct target_freebsd_timespec { -target_freebsd_time_t tv_sec; /* seconds */ +target_time_t

Re: [PATCH 06/16] bsd-user: Remove OpenBSD specific syscall printing

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: Nothing calls these routines now. In the bsd-user fork, though, they've moved to openbsd/os-syscall.c, but those aren't ready for upstreaming. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 5 - bsd-user/strace.c | 25 - 2

Re: [PATCH 05/16] bsd-user: Remove NetBSD specific syscall printing

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: Nothing calls these routines now. In the bsd-user fork, though, they've moved to netbsd/os-syscall.c, but those aren't ready for upstreaming. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 5 - bsd-user/strace.c | 17 - 2 files cha

Re: [PATCH 04/16] bsd-user: Move system FreeBSD call table to freebsd/os-syscall.c

2023-04-08 Thread Richard Henderson
On 4/5/23 14:36, Warner Losh wrote: Move the system call table, and FreeBSD helper routines out of strace.c. We do not support multiple BSD-types in one binary, so simplify things by moving it. Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 19 +++ bsd-user/qem

Re: [PATCH 03/16] bsd-user: Cleanup style.

2023-04-08 Thread Richard Henderson
On 4/5/23 14:35, Warner Losh wrote: The only diffs between bsd-user fork and qemu upstream is style. Make mmap.c pass checkpatch.pl. Signed-off-by: Warner Losh --- bsd-user/mmap.c | 91 - 1 file changed, 60 insertions(+), 31 deletions(-) Acked

Re: [PATCH 02/16] bsd-user: Ifdef a few MAP_ constants for NetBSD

2023-04-08 Thread Richard Henderson
On 4/5/23 14:35, Warner Losh wrote: MAP_GUARD, MAP_EXCL, and MAP_NOCORE are FreeBSD only. Add back the ifdefs that I removed in 36d5d891559f (but only these ifdefs, the rest of the commit is not reverted). Signed-off-by: Warner Losh --- bsd-user/mmap.c | 10 ++ 1 file changed, 10 inse

Re: [PATCH 01/16] bsd-user: Make print_* public

2023-04-08 Thread Richard Henderson
On 4/5/23 14:35, Warner Losh wrote: Make these functions public. Due to coming restructuring, we'll need to call these from *bsd/os-syscall.c. Add declarations to qemu.h. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 20 bsd-user/strace.c | 29 +--

[PATCH for-8.0] tcg/ppc: Fix TCG_TARGET_CALL_{ARG, RET}_I128 for ppc32

2023-04-08 Thread Richard Henderson
For both _CALL_SYSV and _CALL_DARWIN, return is by reference, not in 4 integer registers. For _CALL_SYSV, argument is also by reference. This error resulted in $ ./qemu-system-i386 -nographic qemu-system-i386: tcg/ppc/tcg-target.c.inc:185: \ tcg_target_call_oarg_reg: Assertion `s

Re: [PATCH] Hexagon (target/hexagon) Remove unused slot variable in helpers

2023-04-08 Thread Richard Henderson
On 4/7/23 13:45, Taylor Simpson wrote: The slot variable in helpers was only passed to log_reg_write function where the argument is unused. - Remove declaration from generated helper functions - Remove slot argument from log_reg_write Signed-off-by: Taylor Simpson --- target/hexagon/macros.h

[PATCH] target/riscv: Use check for relationship between Zdinx/Zhinx{min} and Zfinx

2023-04-08 Thread Weiwei Li
Zdinx/Zhinx{min} require Zfinx. And require relationship is usually done by check currently. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 1a5099

Re: [PATCH for-8.0? 0/2] target/arm: BTI guarded bit fixes

2023-04-08 Thread Peter Maydell
On Fri, 7 Apr 2023 at 19:52, Richard Henderson wrote: > > As reported by Coverity and triaged by Peter. > > > r~ > > Richard Henderson (2): > target/arm: PTE bit GP only applies to stage1 > target/arm: Copy guarded bit in combine_cacheattrs > > target/arm/ptw.c | 11 ++- > 1 file chan

Re: [PATCH v2] target/riscv: Fix Guest Physical Address Translation

2023-04-08 Thread liweiwei
On 2023/4/7 23:32, Irina Ryapolova wrote: Before changing the flow check for sv39/48/57. According to specification (for Supervisor mode): Sv39 implementations support a 39-bit virtual address space, divided into 4 KiB pages. Instruction fetch addresses and load and store effective addresses,

Re: [PATCH V2] tracing: install trace events file only if necessary

2023-04-08 Thread Carlos Santos
On Mon, Mar 27, 2023 at 2:59 PM Daniel P. Berrangé wrote: > > On Mon, Mar 27, 2023 at 02:30:58PM -0300, casan...@redhat.com wrote: > > From: Carlos Santos > > > > It is not useful when configuring with --enable-trace-backends=nop. > > > > Signed-off-by: Carlos Santos > > --- > > Reviewed-by: Dan

[PATCH for-8.0 v2] target/ppc: Fix temp usage in gen_op_arith_modw

2023-04-08 Thread Richard Henderson
Fix a crash writing to 't3', which is now a constant. Instead, write the result of the remu to 't1'. Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c") Reported-by: Nicholas Piggin Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- v2: Use a temp of the correct