Re: [PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-07 Thread Kyle Evans
On Sat, Aug 7, 2021 at 10:11 PM Richard Henderson wrote: > > On 8/7/21 11:42 AM, Warner Losh wrote: > > +path = g_strdup(p); > > +if (path == NULL) { > > Only returns null when the input is null, which you've already eliminated. > > > +static bool find_in_path(char *path, const

Re: [PATCH for 6.2 22/49] bsd-user: Move per-cpu code into target_arch_cpu.h

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: diff --git a/bsd-user/i386/target_arch_cpu.c b/bsd-user/i386/target_arch_cpu.c index 7f2f755a11..71998e5ba5 100644 --- a/bsd-user/i386/target_arch_cpu.c +++ b/bsd-user/i386/target_arch_cpu.c @@ -1,6 +1,7 @@ /* * i386 cpu related code * + *

Re: [PATCH for 6.2 20/49] bsd-user: save the path the qemu emulator

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Save the path to the qemu emulator. This will be used later when we have a more complete implementation of exec. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 21 + bsd-user/qemu.h | 1 + 2 files

Re: [PATCH for 6.2 19/49] bsd-user: Include host-os.h from main

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Include host-os.h from main.c to pick up the default OS to emulate. Set that default in main(). Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/host-os.h | 2 ++ bsd-user/main.c| 4 +++- bsd-user/netbsd/host-os.h

Re: [PATCH for 6.2 18/49] bsd-user: add host-os.h

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Host OS specific bits for this implementation go in this file. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/host-os.h | 23 +++ bsd-user/netbsd/host-os.h | 23 +++

Re: [PATCH for 6.2 17/49] bsd-user: assume pthreads and support of __thread

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: All compilers for some time have supported this. Follow linux-user and eliminate the #define THREAD and unconditionally insert __thread where needed. Signed-off-by: Warner Losh --- bsd-user/main.c | 2 +- bsd-user/qemu.h | 10 +- 2 files

Re: [PATCH for 6.2 16/49] bsd-user: elfload: simplify bswap a bit.

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Reduce the number of ifdefs by always calling the swapping routine, but making them empty when swapping isn't needed. Signed-off-by: Warner Losh --- bsd-user/elfload.c | 97 ++ 1 file changed, 47

Re: [PATCH for 6.2 15/49] bsd-user: TARGET_NGROUPS unused in this file, remove

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for 6.2 14/49] bsd-user: remove a.out support

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Remove still-born a.out support. The BSDs switched from a.out to ELF 20+ years ago. It's out of scope for bsd-user, and what little support there was would simply wind up at a not-implemented message. Simplify the whole mess by removing it entirely. Should

Re: [PATCH for 6.2 13/49] bsd-user: Eliminate elf personality

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: The linux kernel supports a number of different ELF binaries. The Linux userland emulator inheritted some of that. And we inheritted it from there. However, for BSD there's only one kind of ELF file supported per platform, so there's no need to cope with

Re: [PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: +path = g_strdup(p); +if (path == NULL) { Only returns null when the input is null, which you've already eliminated. +static bool find_in_path(char *path, const char *filename, char *retpath, + size_t rpsize) +{ +

Re: [PATCH for 6.2 11/49] bsd-user: Fix calculation of size to allocate

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: It was incorrect to subtract off the size of an unsigned int here. In bsd-user fork, this change was made when moving the arch specific items to specific files. The size in BSD that's available for the arguments does not need a return address subtracted

Re: [PATCH for 6.2 10/49] bsd-user: pass the bsd_param into loader_exec

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Pass the bsd_param into loader_exec, and adjust. Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 37 +++-- bsd-user/main.c| 7 ++- bsd-user/qemu.h| 3 ++- 3 files changed, 27 insertions(+), 20

Re: [PATCH for 6.2 09/49] bsd-user: add license

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Pull in the license statement at the top of the bsdload.c file from the bsd-user fork version of this file. No functional changes. Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-)

Re: [PATCH for 6.2 08/49] bsd-user: style nits: fix whitespace issues to be qemu standard

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for 6.2 07/49] bsd-user: style nits: apply qemu style to these files

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: Fix style wrt {} placement, spaces around () and line lengths. Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_elf.h | 27 --- bsd-user/x86_64/target_arch_elf.h | 11 +++ 2 files changed, 23 insertions(+), 15

Re: [PATCH for 6.2 06/49] bsd-user: merge comments and guards from bsd-user fork

2021-08-07 Thread Richard Henderson
On 8/7/21 11:41 AM, Warner Losh wrote: Diff reduction against bsd-user fork: bring in the copyright/license comments, and guard ifdefs. Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_elf.h | 22 ++ bsd-user/x86_64/target_arch_elf.h | 23 +++

Re: [PATCH for 6.2 05/49] bsd-user: move arch specific defines out of elfload.c

2021-08-07 Thread Richard Henderson
On 8/7/21 11:41 AM, Warner Losh wrote: Move the arcitecture specific defines to target_arch_elf.h and delete them from elfload.c. unifdef as appropriate for i386 vs x86_64 versions. Signed-off-by: Warner Losh --- bsd-user/elfload.c| 81 +--

Re: [PATCH for 6.2 03/49] bsd-user: Add Stacey's copyright to main.c

2021-08-07 Thread Richard Henderson
On 8/7/21 11:41 AM, Warner Losh wrote: From: Warner Losh Add Stacey's updated copyright to main.c Signed-off-by: Warner Losh Signed-off-by: Stacey Son Sponsored by: Netflix --- bsd-user/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Richard

Re: [PATCH for 6.2 04/49] bsd-user: Remove all non-x86 code from elfload.c

2021-08-07 Thread Richard Henderson
On 8/7/21 11:41 AM, Warner Losh wrote: bsd-user only builds x86 at the moment. Remove all non x86 code from elfload.c. We'll move the x86 code to {i386,x86_64}/target_arch_elf.h and bring it that support code from the forked bsd-user when the time comes. Signed-off-by: Warner Losh ---

Re: [PATCH for 6.2 02/49] bsd-user: add copyright header to elfload.c

2021-08-07 Thread Richard Henderson
On 8/7/21 11:41 AM, Warner Losh wrote: From: Warner Losh Add Stacey's copyright to elfload.c Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/elfload.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for 6.2 01/49] bsd-user: remove sparc and sparc64

2021-08-07 Thread Richard Henderson
On 8/7/21 11:41 AM, Warner Losh wrote: From: Warner Losh These are broken here and in the bsd-user fork. They won't be fixed as FreeBSD has dropped support for sparc. If people wish to support this in other BSDs, you're better off starting over than starting from these files. Signed-off-by:

[PATCH] hw/ssi: imx_spi: Improve chip select handling

2021-08-07 Thread Guenter Roeck
The control register does not really have a means to deselect all chip selects directly. As result, CS is effectively never deselected, and connected flash chips fail to perform read operations since they don't get the expected chip select signals to reset their state machine. Normally and per

Re: [PATCH] hw/riscv: virt: Move flash node to root

2021-08-07 Thread Alistair Francis
On Sat, Aug 7, 2021 at 1:57 PM Bin Meng wrote: > > The flash is not inside the SoC, so it's inappropriate to put it > under the /soc node. Move it to root instead. > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair > --- > > hw/riscv/virt.c | 2 +- > 1 file changed, 1

Re: [PATCH] target/riscv: Correct a comment in riscv_csrrw()

2021-08-07 Thread Alistair Francis
On Sun, Aug 8, 2021 at 12:10 AM Bin Meng wrote: > > When privilege check fails, RISCV_EXCP_ILLEGAL_INST is returned, > not -1 (RISCV_EXCP_NONE). > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair > --- > > target/riscv/csr.c | 2 +- > 1 file changed, 1 insertion(+), 1

[PATCH for 6.2 49/49] bsd-user: Add '-0 argv0' option to bsd-user/main.c

2021-08-07 Thread Warner Losh
From: Colin Percival Previously it was impossible to emulate a program with a file name different from its argv[0]. With this change, you can run qemu -0 fakename realname args which runs the program "realname" with an argv of "fakename args". Signed-off-by: Colin Percival Signed-off-by:

[PATCH for 6.2 46/49] bsd-user: move qemu_log to later in the file

2021-08-07 Thread Warner Losh
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index c8fafa78d0..7ba616a995 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -85,14 +85,6 @@ unsigned

[PATCH for 6.2 48/49] bsd-user: Implement cpu_copy() helper routine

2021-08-07 Thread Warner Losh
From: Warner Losh cpu_copy shouldbe called when processes are creating new threads. It copies the current state of the CPU to a new cpu state needed for the new thread. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Signed-off-by: Justin Hibbits --- bsd-user/main.c | 30

[PATCH for 6.2 41/49] bsd-user: Add target_os_user.h to capture the user/kernel structures

2021-08-07 Thread Warner Losh
From: Warner Losh This file evolved over the years to capture the user/kernel interfaces, including those that changed over time. Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_user.h | 429 ++ 1

[PATCH for 6.2 39/49] bsd-user: Need to reset CPU after creation.

2021-08-07 Thread Warner Losh
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bsd-user/main.c b/bsd-user/main.c index 36852604f8..08f88d9668 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -405,8 +405,10 @@ int main(int argc, char **argv)

[PATCH for 6.2 37/49] bsd-user: update debugging in mmap.c

2021-08-07 Thread Warner Losh
From: Warner Losh Update the debugging code for new features and different targets. Signed-off-by: Mikaël Urankar Signed-off-by: Sean Bruno Signed-off-by: Kyle Evans Signed-off-by: Warner Losh --- bsd-user/mmap.c | 49 ++--- 1 file changed, 30

[PATCH for 6.2 38/49] bsd-user: Update mapping to handle reserved and starting conditions

2021-08-07 Thread Warner Losh
From: Warner Losh Update the reserved base based on what platform we're on, as well as the start of the mmap range. Update routines that find va ranges to interact with the reserved ranges as well as properly align the mapping (this is especially important for targets whose page size does not

[PATCH for 6.2 36/49] bsd-user: Make cpu_model and cpu_type visible to all of main.c

2021-08-07 Thread Warner Losh
From: Warner Losh cpu_model and cpu_type will be used future commits, so move them from main() scoped to file scoped. Signed-off-by: Warner Losh --- bsd-user/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index

[PATCH for 6.2 32/49] bsd-user: *BSD specific siginfo defintions

2021-08-07 Thread Warner Losh
From: Warner Losh Add FreeBSD, NetBSD and OpenBSD values for the various signal info types and defines to decode different signals to discover more information about the specific signal types. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_siginfo.h | 145

[PATCH for 6.2 44/49] bsd-user: Refactor load_elf_sections and is_target_elf_binary

2021-08-07 Thread Warner Losh
From: Warner Losh Factor out load_elf_sections and is_target_elf_binary out of load_elf_interp. Signed-off-by: Mikaël Urankar Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/elfload.c | 350 + 1 file changed, 164 insertions(+),

[PATCH for 6.2 31/49] bsd-user: Remove dead #ifdefs from elfload.c

2021-08-07 Thread Warner Losh
From: Warner Losh LOW_ELF_STACK doesn't exist on FreeBSD and likely never will. Remove it. Likewise, remove an #if 0 block that's not useful Signed-off-by: Warner Losh --- bsd-user/elfload.c | 20 1 file changed, 20 deletions(-) diff --git a/bsd-user/elfload.c

[PATCH for 6.2 34/49] bsd-user: Fix initializtion of task state

2021-08-07 Thread Warner Losh
From: Warner Losh Fix a number of mismerges in initializing the task state. Save a copy of bprm in this structure and move it earlier before starting to setup other state. Remove linux specific procfs access to find minimal vm address that likely is here through a misguided merge. Remove

[PATCH for 6.2 45/49] bsd-user: Make guest_base an unsigned long

2021-08-07 Thread Warner Losh
From: Warner Losh Make the guest_base a plan, uneigned long rather than a uintptr_t. It isn't really a pointer. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c

[PATCH for 6.2 29/49] bsd-user: Add system independent stack, data and text limiting

2021-08-07 Thread Warner Losh
From: Warner Losh Eliminate the x86 specific stack stuff in favor of more generic control over the process size: target_maxtsiz max text size target_dfldsiz initial data size limit target_maxdsiz max data size target_dflssiz initial stack size limit target_maxssiz max

[PATCH for 6.2 33/49] bsd-user: Rewrite target system call definintion glue

2021-08-07 Thread Warner Losh
From: Warner Losh Rewrite target definnitions to interface with the FreeBSD system calls. This covers basic types (time_t, iovec, umtx_time, timespec, timeval, rusage, rwusage) and basic defines (mmap, rusage). Also included are FreeBSD version-specific variations. Signed-off-by: Stacey Son

[PATCH for 6.2 42/49] bsd-user: add stubbed out core dump support

2021-08-07 Thread Warner Losh
From: Warner Losh Add a stubbed-out version of the bsd-user fork's core dump support. This allows elfload.c to be almost the same between what's upstream and what's in qemu-project upstream w/o the burden of reviewing the core dump support. Signed-off-by: Stacey Son Signed-off-by: Warner Losh

[PATCH for 6.2 35/49] bsd-user: remove error_init

2021-08-07 Thread Warner Losh
From: Warner Losh Error reporting isn't used, so gc it until it's used. Signed-off-by: Warner Losh --- bsd-user/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index b5527537b4..7e20430fb7 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@

[PATCH for 6.2 30/49] bsd-user: elf cleanup

2021-08-07 Thread Warner Losh
From: Warner Losh Move OS-dependent defines into target_os_elf.h. Move the architectural dependent stuff into target_arch_elf.h. Adjust elfload.c to use target_create_elf_tables instead of create_elf_tables. Signed-off-by: Warner Losh Signed-off-by: Stacey Son Signed-off-by: Kyle Evans

[PATCH for 6.2 22/49] bsd-user: Move per-cpu code into target_arch_cpu.h

2021-08-07 Thread Warner Losh
From: Warner Losh Move cpu_loop() into target_cpu_loop(), and put that in target_arch_cpu.h for each architecture. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_cpu.c | 1 + bsd-user/i386/target_arch_cpu.h | 306

[PATCH for 6.2 23/49] bsd-user: pull in target_arch_thread.h update target_arch_elf.h

2021-08-07 Thread Warner Losh
From: Warner Losh Update target_arch_elf.h to remove thread_init. Move its contents to target_arch_thread.h and rename to target_thread_init(). Update elfload.c to call it. Create thread_os_thread.h to hold the os specific parts of the thread and threat manipulation routines. Currently, it just

[PATCH for 6.2 27/49] bsd-user: Add architecture specific signal tramp code

2021-08-07 Thread Warner Losh
From: Warner Losh Add a stubbed out version of setup_sigtramp. This is not yet used for x86, but is used for other architectures. This will be connected in future commits. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_sigtramp.h | 29

[PATCH for 6.2 47/49] bsd-user: Implement interlock for atomic operations

2021-08-07 Thread Warner Losh
From: Warner Losh Implement the internlock in fork_start() and fork_end() to properly cope with atomic operations and to safely keep state for parent and child processes. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 23 +++ 1 file changed, 23

[PATCH for 6.2 28/49] bsd-user: Move stack initializtion into a per-os file.

2021-08-07 Thread Warner Losh
From: Warner Losh Move all of the stack initialization into target_os_stack.h. Each BSD sets up processes a little differently. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_stack.h | 181 + bsd-user/netbsd/target_os_stack.h

[PATCH for 6.2 26/49] bsd-user: Create target specific vmparam.h

2021-08-07 Thread Warner Losh
From: Warner Losh Target specific values for vm parameters and details. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_vmparam.h | 38 ++ bsd-user/i386/target_arch_vmparam.h | 46 +++ bsd-user/qemu.h

[PATCH for 6.2 21/49] bsd-user: start to move target CPU functions to target_arch*

2021-08-07 Thread Warner Losh
From: Warner Losh Move the CPU functons into target_arch_cpu.c that are unique to each CPU. These are defined in target_arch.h. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target_arch.h | 31 + bsd-user/i386/target_arch_cpu.c | 75

[PATCH for 6.2 24/49] bsd-user: Include more things in qemu.h

2021-08-07 Thread Warner Losh
From: Warner Losh Include more header files to match bsd-user fork. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 9 + 1 file changed, 9 insertions(+) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 6c4ec61d76..02e6e8327a 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@

[PATCH for 6.2 43/49] bsd-user: elfload.c style catch up patch

2021-08-07 Thread Warner Losh
From: Warner Losh Various style fixes to elfload.c that were too painful to make earlier in this series. Signed-off-by: Warner Losh Sponsored by: Netflix --- bsd-user/elfload.c | 212 ++--- 1 file changed, 105 insertions(+), 107 deletions(-)

[PATCH for 6.2 20/49] bsd-user: save the path the qemu emulator

2021-08-07 Thread Warner Losh
Save the path to the qemu emulator. This will be used later when we have a more complete implementation of exec. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 21 + bsd-user/qemu.h | 1 + 2 files changed, 22 insertions(+) diff --git

[PATCH for 6.2 25/49] bsd-user: define max args in terms of pages

2021-08-07 Thread Warner Losh
From: Warner Losh For 32-bit platforms, pass in up to 256k of args. For 64-bit, bump that to 512k. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh --- bsd-user/qemu.h | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h

[PATCH for 6.2 19/49] bsd-user: Include host-os.h from main

2021-08-07 Thread Warner Losh
Include host-os.h from main.c to pick up the default OS to emulate. Set that default in main(). Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/host-os.h | 2 ++ bsd-user/main.c| 4 +++- bsd-user/netbsd/host-os.h | 2 ++ bsd-user/openbsd/host-os.h | 2 ++

[PATCH for 6.2 40/49] bsd-user: Add target_arch_reg to describe a target's register set

2021-08-07 Thread Warner Losh
From: Warner Losh target_reg_t is the normal register. target_fpreg_t is the floating point registers. target_copy_regs copies the registers out of CPU context for things like core dumps. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_reg.h | 82

[PATCH for 6.2 17/49] bsd-user: assume pthreads and support of __thread

2021-08-07 Thread Warner Losh
All compilers for some time have supported this. Follow linux-user and eliminate the #define THREAD and unconditionally insert __thread where needed. Signed-off-by: Warner Losh --- bsd-user/main.c | 2 +- bsd-user/qemu.h | 10 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff

[PATCH for 6.2 18/49] bsd-user: add host-os.h

2021-08-07 Thread Warner Losh
Host OS specific bits for this implementation go in this file. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/freebsd/host-os.h | 23 +++ bsd-user/netbsd/host-os.h | 23 +++ bsd-user/openbsd/host-os.h | 23 +++ 3

[PATCH for 6.2 16/49] bsd-user: elfload: simplify bswap a bit.

2021-08-07 Thread Warner Losh
Reduce the number of ifdefs by always calling the swapping routine, but making them empty when swapping isn't needed. Signed-off-by: Warner Losh --- bsd-user/elfload.c | 97 ++ 1 file changed, 47 insertions(+), 50 deletions(-) diff --git

[PATCH for 6.2 14/49] bsd-user: remove a.out support

2021-08-07 Thread Warner Losh
Remove still-born a.out support. The BSDs switched from a.out to ELF 20+ years ago. It's out of scope for bsd-user, and what little support there was would simply wind up at a not-implemented message. Simplify the whole mess by removing it entirely. Should future support be required, it would be

[PATCH for 6.2 10/49] bsd-user: pass the bsd_param into loader_exec

2021-08-07 Thread Warner Losh
Pass the bsd_param into loader_exec, and adjust. Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 37 +++-- bsd-user/main.c| 7 ++- bsd-user/qemu.h| 3 ++- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/bsd-user/bsdload.c

[PATCH for 6.2 15/49] bsd-user: TARGET_NGROUPS unused in this file, remove

2021-08-07 Thread Warner Losh
Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index df81e36d88..006e19cf3f 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -19,8 +19,6 @@ #include "qemu.h" -#define TARGET_NGROUPS 32

[PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-07 Thread Warner Losh
Use the PATH to find the executable given a bare argument. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 73 +- bsd-user/qemu.h| 3 +- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git

[PATCH for 6.2 13/49] bsd-user: Eliminate elf personality

2021-08-07 Thread Warner Losh
The linux kernel supports a number of different ELF binaries. The Linux userland emulator inheritted some of that. And we inheritted it from there. However, for BSD there's only one kind of ELF file supported per platform, so there's no need to cope with historical quirks. Simply the code as a

[PATCH for 6.2 04/49] bsd-user: Remove all non-x86 code from elfload.c

2021-08-07 Thread Warner Losh
bsd-user only builds x86 at the moment. Remove all non x86 code from elfload.c. We'll move the x86 code to {i386,x86_64}/target_arch_elf.h and bring it that support code from the forked bsd-user when the time comes. Signed-off-by: Warner Losh --- bsd-user/elfload.c | 347

[PATCH for 6.2 06/49] bsd-user: merge comments and guards from bsd-user fork

2021-08-07 Thread Warner Losh
Diff reduction against bsd-user fork: bring in the copyright/license comments, and guard ifdefs. Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_elf.h | 22 ++ bsd-user/x86_64/target_arch_elf.h | 23 +++ 2 files changed, 45 insertions(+) diff

[PATCH for 6.2 11/49] bsd-user: Fix calculation of size to allocate

2021-08-07 Thread Warner Losh
It was incorrect to subtract off the size of an unsigned int here. In bsd-user fork, this change was made when moving the arch specific items to specific files. The size in BSD that's available for the arguments does not need a return address subtracted from it. Signed-off-by: Warner Losh ---

[PATCH for 6.2 05/49] bsd-user: move arch specific defines out of elfload.c

2021-08-07 Thread Warner Losh
Move the arcitecture specific defines to target_arch_elf.h and delete them from elfload.c. unifdef as appropriate for i386 vs x86_64 versions. Signed-off-by: Warner Losh --- bsd-user/elfload.c| 81 +-- bsd-user/i386/target_arch_elf.h | 54

[PATCH for 6.2 09/49] bsd-user: add license

2021-08-07 Thread Warner Losh
Pull in the license statement at the top of the bsdload.c file from the bsd-user fork version of this file. No functional changes. Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bsd-user/bsdload.c

[PATCH for 6.2 08/49] bsd-user: style nits: fix whitespace issues to be qemu standard

2021-08-07 Thread Warner Losh
Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 8d83f21eda..39098170d5 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -125,7 +125,7 @@ abi_ulong

[PATCH for 6.2 03/49] bsd-user: Add Stacey's copyright to main.c

2021-08-07 Thread Warner Losh
From: Warner Losh Add Stacey's updated copyright to main.c Signed-off-by: Warner Losh Signed-off-by: Stacey Son Sponsored by: Netflix --- bsd-user/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index

[PATCH for 6.2 07/49] bsd-user: style nits: apply qemu style to these files

2021-08-07 Thread Warner Losh
Fix style wrt {} placement, spaces around () and line lengths. Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_elf.h | 27 --- bsd-user/x86_64/target_arch_elf.h | 11 +++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git

[PATCH for 6.2 00/49] bsd-user updates to run hello world

2021-08-07 Thread Warner Losh
This series of patches gets me to the point that I can run "Hello World" on i386 and x86_64. This is for static binaries only, that are relatively small, but it's better than the 100% instant mmap failre that is the current state of all things bsd-user in upstream qemu. Future patch sets will

[PATCH for 6.2 02/49] bsd-user: add copyright header to elfload.c

2021-08-07 Thread Warner Losh
From: Warner Losh Add Stacey's copyright to elfload.c Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/elfload.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 6edceb3ea6..ae62f3aab3

[PATCH for 6.2 01/49] bsd-user: remove sparc and sparc64

2021-08-07 Thread Warner Losh
From: Warner Losh These are broken here and in the bsd-user fork. They won't be fixed as FreeBSD has dropped support for sparc. If people wish to support this in other BSDs, you're better off starting over than starting from these files. Signed-off-by: Warner Losh --- bsd-user/main.c

Re: [PATCH] vmxnet3: add stub for encapsulation offload

2021-08-07 Thread Alexander Bulekov
On 210807 1019, Philippe Mathieu-Daudé wrote: > On 8/7/21 12:23 AM, Alexander Bulekov wrote: > > Encapsulation offload (offload mode 1) is a valid mode present in the > > kernel that isn't implemented in QEMU, yet. > > > > https://lore.kernel.org/lkml/20200528015426.8285-4-dos...@vmware.com/ > >

[PATCH] monitor/hmp: schedule qemu_chr_fe_accept_input() after read

2021-08-07 Thread Volker Rümelin
Since commit 584af1f1d9 (ui/gtk: add a keyboard fifo to the VTE consoles) a GTK VTE console chardev backend relies on the connected chardev frontend to call qemu_chr_fe_accept_input() whenever it can receive new characters. The HMP monitor doesn't do this. It only schedules a call to

[PATCH for 6.1 0/1] Fix chardev frontend bug in HMP

2021-08-07 Thread Volker Rümelin
Since commit 584af1f1d9 (ui/gtk: add a keyboard fifo to the VTE consoles) a GTK VTE console chardev backend relies on the connected chardev frontend to call qemu_chr_fe_accept_input() whenever it can receive new characters. The HMP monitor doesn't do this. It only schedules a call to

[PATCH-for-6.1? 0/3] ps2: Fix issue #501 and #502

2021-08-07 Thread Philippe Mathieu-Daudé
On 8/7/21 2:10 PM, Volker Rümelin wrote: > Since commit ff6e1624b3 (pckbd: don't update OBF flags if > KBD_STAT_OBF is set) the OSes Minoca OS and Visopsys no longer > have a working PS/2 keyboard and mouse. This is caused by a > PS/2 queue stall due to a lost interrupt in the guest OS. This >

Re: [PATCH v12] qapi: introduce 'query-x86-cpuid' QMP command.

2021-08-07 Thread Markus Armbruster
I'm afraid this needs a rebase now. Reviewing anyway. Valeriy Vdovin writes: > Introducing new QMP command 'query-x86-cpuid'. This command can be used to > get virtualized cpu model info generated by QEMU during VM initialization in > the form of cpuid representation. > > Diving into more

[PATCH] target/riscv: Correct a comment in riscv_csrrw()

2021-08-07 Thread Bin Meng
When privilege check fails, RISCV_EXCP_ILLEGAL_INST is returned, not -1 (RISCV_EXCP_NONE). Signed-off-by: Bin Meng --- target/riscv/csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 9a4ed18ac5..e747fbe0e9 100644 ---

Re: [PATCH for-6.2 v6 7/7] memory_hotplug.c: send DEVICE_UNPLUG_ERROR in acpi_memory_hotplug_write()

2021-08-07 Thread Markus Armbruster
Daniel Henrique Barboza writes: > MEM_UNPLUG_ERROR is deprecated since the introduction of > DEVICE_UNPLUG_ERROR. Keep emitting both while the deprecation of > MEM_UNPLUG_ERROR is pending. > > CC: Michael S. Tsirkin > CC: Igor Mammedov > Reviewed-by: Greg Kurz > Signed-off-by: Daniel Henrique

Re: [PATCH for-6.2 v6 6/7] spapr: use DEVICE_UNPLUG_ERROR to report unplug errors

2021-08-07 Thread Markus Armbruster
Daniel Henrique Barboza writes: > Linux Kernel 5.12 is now unisolating CPU DRCs in the device_removal > error path, signalling that the hotunplug process wasn't successful. > This allow us to send a DEVICE_UNPLUG_ERROR in drc_unisolate_logical() > to signal this error to the management layer. >

Re: [PATCH for-6.2 v6 5/7] qapi/qdev.json: add DEVICE_UNPLUG_ERROR QAPI event

2021-08-07 Thread Markus Armbruster
Daniel Henrique Barboza writes: > At this moment we only provide one event to report a hotunplug error, > MEM_UNPLUG_ERROR. As of Linux kernel 5.12 and QEMU 6.0.0, the pseries > machine is now able to report unplug errors for other device types, such > as CPUs. > > Instead of creating a

Re: [PATCH for-6.2 v6 1/7] hw/acpi/memory_hotplug.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL

2021-08-07 Thread Markus Armbruster
I apologize for the not reviewing this promptly. Daniel Henrique Barboza writes: > qapi_event_send_mem_unplug_error() deals with @device being NULL by > replacing it with an empty string ("") when emitting the event. Aside > from the fact that this is a side effect that can be patched someday,

Re: [PATCH for-6.2 v6 4/7] qapi/qdev.json: fix DEVICE_DELETED parameters doc

2021-08-07 Thread Markus Armbruster
Daniel Henrique Barboza writes: > Clarify that @device is optional and that 'path' is the device > path from QOM. > > This change follows Markus' suggestion verbatim, provided in full > context here: > > https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01891.html > > Suggested-by: Markus

Re: [PATCH for-6.2 v6 3/7] spapr_drc.c: do not error_report() when drc->dev->id == NULL

2021-08-07 Thread Markus Armbruster
Daniel Henrique Barboza writes: > The error_report() call in drc_unisolate_logical() is not considering > that drc->dev->id can be NULL, and the underlying functions error_report() > calls to do its job (vprintf(), g_strdup_printf() ...) has undefined > behavior when trying to handle "%s" with

Re: [PATCH for-6.2 v6 2/7] spapr.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL

2021-08-07 Thread Markus Armbruster
Daniel Henrique Barboza writes: > As done in hw/acpi/memory_hotplug.c, avoid sending > qapi_event_send_mem_unplug_error() if dev->id is NULL. > > Suggested-by: Markus Armbruster > Reviewed-by: Greg Kurz > Signed-off-by: Daniel Henrique Barboza > --- > hw/ppc/spapr.c | 8 +--- > 1 file

[no subject]

2021-08-07 Thread Daniel Page
Is it possible to increase and decrease ram, cpu and also limit bandwidth speed without shut down the guest?

Re: [PATCH 5/5] qmp: Added qemu-ebpf-rss-path command.

2021-08-07 Thread Markus Armbruster
Andrew Melnychenko writes: > New qmp command to query ebpf helper. > It's crucial that qemu and helper are in sync and in touch. > Technically helper should pass eBPF fds that qemu may accept. > And different qemu's builds may have different eBPF programs and helpers. > Qemu returns helper that

Re: [PATCH v6 4/6] qmp: add QMP command x-debug-virtio-queue-status

2021-08-07 Thread Markus Armbruster
Jonah Palmer writes: > From: Laurent Vivier > > This new command shows internal status of a VirtQueue. > (vrings and indexes). > > Signed-off-by: Laurent Vivier > Signed-off-by: Jonah Palmer [...] > diff --git a/qapi/virtio.json b/qapi/virtio.json > index 78873cd..7007e0c 100644 > ---

Re: [PATCH v6 2/6] qmp: add QMP command x-debug-virtio-status

2021-08-07 Thread Markus Armbruster
Jonah Palmer writes: > From: Laurent Vivier > > This new command shows the status of a VirtIODevice > (features, endianness and number of virtqueues) > > Next patch will improve output by decoding feature bits. > > Signed-off-by: Laurent Vivier > Signed-off-by: Jonah Palmer [...] > diff

[CXL Volatile MEM]: How to change the CXL persistent memory device to a volatile memory

2021-08-07 Thread Samarth Saxena
Hi All, I am trying to modify the CXL persistent memory device, given at: hw/mem/cxl_type3.c to a volatile memory device. I tried the following: * In hw/cxl/cxl-mailbox-utils.c: * changed the IDENTIFY_MEMORY_DEVICE mailbox handler to return persistent capacity as 0,

Re: [PATCH v6 1/6] qmp: add QMP command x-debug-query-virtio

2021-08-07 Thread Markus Armbruster
QAPI schema review only. Jonah Palmer writes: > From: Laurent Vivier > > This new command lists all the instances of VirtIODevice with > their path and virtio type. > > Signed-off-by: Laurent Vivier > Reviewed-by: Eric Blake > Signed-off-by: Jonah Palmer [...] > diff --git

Re: [PATCH v3] net/macos: implement vmnet-based netdev

2021-08-07 Thread Markus Armbruster
Jason, did this fall through the cracks? My review is for the QAPI schema only. Akihiko Odaki writes: > From: Phillip Tennen > > This patch implements a new netdev device, reachable via -netdev > vmnet-macos, that’s backed by macOS’s vmnet framework. > > The vmnet framework provides native

ps2: Fix issue #501 and #502

2021-08-07 Thread Volker Rümelin
Since commit ff6e1624b3 (pckbd: don't update OBF flags if KBD_STAT_OBF is set) the OSes Minoca OS and Visopsys no longer have a working PS/2 keyboard and mouse. This is caused by a PS/2 queue stall due to a lost interrupt in the guest OS. This already happened before commit ff6e1624b3, but no one

[PATCH 1/3] ps2: use the whole ps2 buffer but keep queue size

2021-08-07 Thread Volker Rümelin
Extend the used ps2 buffer size to the available buffer size but keep the maximum ps2 queue size. The next patch needs a few bytes of the larger buffer size. Signed-off-by: Volker Rümelin --- hw/input/ps2.c | 69 +++--- 1 file changed, 20

[PATCH 2/3] ps2: use a separate keyboard command reply queue

2021-08-07 Thread Volker Rümelin
A PS/2 keyboard has a separate command reply queue that is independant of the key queue. This prevents that command replies and keyboard input mix. Keyboard command replies take precedence over queued keystrokes. A new keyboard command removes any remaining command replies from the command reply

[PATCH 3/3] ps2: migration support for command reply queue

2021-08-07 Thread Volker Rümelin
Add migration support for the PS/2 keyboard command reply queue. Signed-off-by: Volker Rümelin --- hw/input/ps2.c | 40 ++-- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 8c06fd7fb4..9376a8f4ce 100644 ---

Re: [PULL V3 for 6.2 1/6] qapi/net: Add IPFlowSpec and QMP command for filter passthrough

2021-08-07 Thread Markus Armbruster
Markus Armbruster writes: > I see Jason queued this while I was failing at keeping up with review. > I apologize for dropping the ball. > > There still are a few unresolved issues I raised in prior review. The > documentation is not ready, and there is no consensus on the design of >

  1   2   >