[PATCH (PING) 1/1] target/riscv: misa to ISA string conversion fix

2022-03-25 Thread Tsukasa OI
Some bits in RISC-V `misa' CSR should not be reflected in the ISA string. For instance, `S' and `U' (represents existence of supervisor and user mode, respectively) in `misa' CSR must not be copied since neither `S' nor `U' are valid single-letter extensions. This commit restricts which bits to

[PATCH (PING) 0/1] target/riscv: misa to ISA string conversion fix

2022-03-25 Thread Tsukasa OI
[This is the same patch as previous ones] (qemu-riscv only) (resent due to configuration error of my mail server; qemu-riscv only) I hope this is

Re: [RFC PATCH 0/2] hw/riscv: Baseline QEMU support for RISC-V IOMMU (draft)

2022-03-25 Thread Frank Chang
Hi Tomasz, Could you please send this patchset to qemu-ri...@nongnu.org, too? Regards, Frank Chang On Thu, Mar 17, 2022 at 6:24 AM Tomasz Jeznach wrote: > This is the series of patches to introduce RISC-V IOMMU emulation in QEMU. > > The Rivos IOMMU device implementation is based on a draft

Re: [RFC PATCH 2/2] hw/riscv: virt: Add rivos-iommu device to 'virt' machine.

2022-03-25 Thread Frank Chang
Hi Tomasz, I think this patch is trying to do two things: 1. Split riscv_load_kernel() and riscv_load_fdt() + riscv_setup_rom_reset_vec() to allow the devices to be added with -device or device_add(), which DTB should reflect the changes. 2. Allow IOMMU to be hotplugable to riscv vrit

Re: [RFC PATCH 1/6] target/ppc: Add support for the Processor Attention instruction

2022-03-25 Thread David Gibson
On Fri, Mar 25, 2022 at 12:11:47PM -0300, Fabiano Rosas wrote: > Leandro Lupori writes: > > > From: Cédric Le Goater > > > > Check the HID0 bit to send signal, currently modeled as a checkstop. > > The QEMU implementation adds an exit using the GPR[3] value (that's a > > hack for tests) > > > >

Re: [PATCH] target/ppc: Improve KVM hypercall trace

2022-03-25 Thread Richard Henderson
On 3/25/22 16:33, Fabiano Rosas wrote: Before: kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall

Re: [RFC PATCH] vhost_net: should not use max_queue_pairs for non-mq guest

2022-03-25 Thread Si-Wei Liu
On 3/25/2022 12:59 AM, Jason Wang wrote: On Fri, Mar 25, 2022 at 3:02 PM Si-Wei Liu wrote: On 3/21/2022 8:47 PM, Jason Wang wrote: On Sat, Mar 19, 2022 at 12:14 PM Si-Wei Liu wrote: With MQ enabled vdpa device and non-MQ supporting guest e.g. booting vdpa with mq=on over OVMF of single

[PATCH] target/ppc: Improve KVM hypercall trace

2022-03-25 Thread Fabiano Rosas
Before: kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall kvm_handle_papr_hcall handle PAPR hypercall After:

[PATCH v2 14/14] qapi: fix example of dump-guest-memory

2022-03-25 Thread Victor Toso
The member "paging" is not optional Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/dump.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/dump.json b/qapi/dump.json index 9119c82b14..29441af9d8 100644 --- a/qapi/dump.json +++ b/qapi/dump.json @@ -83,7

[PATCH v2 0/2] spapr: Make the nested code TCG only

2022-03-25 Thread Fabiano Rosas
The spapr virtual hypervisor implementation of the nested KVM API depends on the first level guest to be emulated by TCG. So move the whole code under CONFIG_TCG. v2: - Created hypercall_register_nested instead of reusing hypercall_register_softmmu; - Rearranged the ifdef a bit to keep the

[PATCH v2 12/14] qapi: ui examples: add missing websocket member

2022-03-25 Thread Victor Toso
As the websocket is not optional in VncBasicInfo. Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/ui.json | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 664da9e462..a810ed680c 100644 --- a/qapi/ui.json +++

[PATCH] schemas: add missing vim modeline

2022-03-25 Thread Victor Toso
This is the last qapi schema that is missing the modeline. Fixes 7e7237cd2b "schemas: add missing vim modeline" Signed-off-by: Victor Toso --- qapi/pragma.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qapi/pragma.json b/qapi/pragma.json index 3bc0335d1f..e6a021c19c 100644 ---

[PATCH v2 11/14] qapi: fix example of MEMORY_FAILURE

2022-03-25 Thread Victor Toso
Minor issues found and fixed with the example: * The JSON object of EVENT was not closed * Missing timestamp * Flags are optional but if defined then all members should be include so we add "recursive" member. * Changed string from '' to "" in action-required member. Signed-off-by: Victor Toso

[PATCH v2 08/14] qapi: fix example of FAILOVER_NEGOTIATED event

2022-03-25 Thread Victor Toso
* Data is an object, not a string. It generates a qdict. * Timestamp is not optional, let's add for completeness. * Add missing "@" to proper document "device-id" * Add extra space for "Since" section Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/net.json | 6 -- 1 file

[PATCH v2 1/2] spapr: Move hypercall_register_softmmu

2022-03-25 Thread Fabiano Rosas
I'm moving this because next patch will add more code under the ifdef and it will be cleaner if we keep them together. Also switch the ifdef branches to make it more convenient to add code under CONFIG_TCG in the next patch. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 50

[PATCH v2 03/14] qapi: fix example of BLOCK_IO_ERROR event

2022-03-25 Thread Victor Toso
Reason is not optional. Signed-off-by: Victor Toso --- qapi/block-core.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 63c30a5378..46580ac551 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -5058,7

[PATCH v2 13/14] qapi: fix example of ACPI_DEVICE_OST event

2022-03-25 Thread Victor Toso
* Missing the timestamp * Missing the "info" object in the "data" member Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/acpi.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qapi/acpi.json b/qapi/acpi.json index 51f0d55db7..d148f6db9f 100644 ---

[PATCH v2 04/14] qapi: fix example of BLOCK_JOB_PENDING event

2022-03-25 Thread Victor Toso
* Event's name: BLOCK_JOB_WAITING -> BLOCK_JOB_PENDING * Argument device -> id Signed-off-by: Victor Toso Reviewed-by: John Snow Reviewed-by: Markus Armbruster --- qapi/block-core.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json

[PATCH v2 2/2] spapr: Move nested KVM hypercalls under a TCG only config.

2022-03-25 Thread Fabiano Rosas
These are the spapr virtual hypervisor implementation of the nested KVM API. They only make sense when running with TCG. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr_hcall.c

[PATCH v2 10/14] qapi: run-state examples: add missing timestamp

2022-03-25 Thread Victor Toso
Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/run-state.json | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qapi/run-state.json b/qapi/run-state.json index 1b9f64c9cd..7f1c788c4e 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -426,7 +426,8

[PATCH v2 06/14] qapi: fix example of MEMORY_DEVICE_SIZE_CHANGE event

2022-03-25 Thread Victor Toso
* qom-path is not optional Signed-off-by: Victor Toso Reviewed-by: John Snow Reviewed-by: Markus Armbruster --- qapi/machine.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index 42fc68403d..9c460ec450 100644 ---

[PATCH v2 09/14] qapi: fix examples: SHUTDOWN and RESET events

2022-03-25 Thread Victor Toso
The 'reason' member in not optional. Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/run-state.json | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qapi/run-state.json b/qapi/run-state.json index 43d66d700f..1b9f64c9cd 100644 --- a/qapi/run-state.json +++

[PATCH v2 07/14] qapi: fix example of UNPLUG_PRIMARY event

2022-03-25 Thread Victor Toso
* Timestamp is not optional, let's add for completeness. * Add '<-' to signalize it is receiving the data * Break lines like most of examples do Signed-off-by: Victor Toso Reviewed-by: John Snow --- qapi/migration.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2 05/14] qapi: fix example of DUMP_COMPLETED event

2022-03-25 Thread Victor Toso
* Timestamp is not optional, let's add for completeness. * Add '<-' to signalize it is receiving the data * While at it, add extra space before "result" and "total" and after "completed" value. Signed-off-by: Victor Toso Reviewed-by: Markus Armbruster Reviewed-by: John Snow ---

[PATCH v2 02/14] qapi: fix example of BLOCK_IMAGE_CORRUPTED event

2022-03-25 Thread Victor Toso
Fatal is not optional. Signed-off-by: Victor Toso --- qapi/block-core.json | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index e89f2dfb5b..63c30a5378 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -5006,10

[PATCH v2 00/14] Fix some qapi examples and a TODO section

2022-03-25 Thread Victor Toso
I've being using the examples as unit tests and found a few that doesn't work out-of-the-box, might be inteded in order to be less verbose in the qapi documentation but nevertheless I'm sending this out in case you want to cherry-pick them. * Changes in v2: 02/14: qapi: fix example of

[PATCH v2 01/14] qapi: BlockExportRemoveMode: move comments to TODO

2022-03-25 Thread Victor Toso
@hide and @soft are potential additions which fits the TODO section perfectly. The main motivation is to avoid this whole block of comment entering the wrong section in the python parser. Signed-off-by: Victor Toso Reviewed-by: Markus Armbruster Reviewed-by: John Snow ---

Re: [PATCH 02/14] qapi: fix example of BLOCK_IMAGE_CORRUPTED event

2022-03-25 Thread John Snow
On Fri, Mar 25, 2022 at 4:59 PM Victor Toso wrote: > > Hi, > > On Fri, Mar 25, 2022 at 01:43:06PM +0100, Markus Armbruster wrote: > > John Snow writes: > > > > > On Thu, Mar 24, 2022 at 3:15 PM John Snow wrote: > > >> > > >> > > >> > > >> On Thu, Mar 24, 2022, 1:50 PM Victor Toso wrote: > >

[PATCH v3 4/4] dump/win_dump: add 32-bit guest Windows support

2022-03-25 Thread Viktor Prutyanov
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32-bit guest Windows dump. So, add 32-bit guest Windows dumping support. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé ---

[PATCH v3 1/4] include/qemu: rename Windows context definitions to expose bitness

2022-03-25 Thread Viktor Prutyanov
Context structure in 64-bit Windows differs from 32-bit one and it should be reflected in its name. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé --- contrib/elf2dmp/main.c | 6 +++--- dump/win_dump.c | 14 +++--- include/qemu/win_dump_defs.h |

[PATCH v3 3/4] include/qemu: add 32-bit Windows dump structures

2022-03-25 Thread Viktor Prutyanov
These structures are required to produce 32-bit guest Windows Complete Memory Dump. Add 32-bit Windows dump header, CPU context and physical memory descriptor structures along with corresponding definitions. Signed-off-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé ---

[PATCH v3 2/4] dump/win_dump: add helper macros for Windows dump header access

2022-03-25 Thread Viktor Prutyanov
Perform read access to Windows dump header fields via helper macros. This is preparation for the next 32-bit guest Windows dump support. Signed-off-by: Viktor Prutyanov --- dump/win_dump.c | 100 +++- 1 file changed, 65 insertions(+), 35 deletions(-)

[PATCH v3 0/4] dump: add 32-bit guest Windows support

2022-03-25 Thread Viktor Prutyanov
Since 32-bit versions of Windows still exist, there is a need to take live and crash dumps of such guests along with 64-bit guests. So, add an ability for 'dump-guest-memory -w' to take dumps from 32-bit guest. When running the command QEMU consumes 32-bit Complete Memory Dump header passed by

Re: [PATCH 06/14] qapi: fix example of MEMORY_DEVICE_SIZE_CHANGE event

2022-03-25 Thread Victor Toso
On Thu, Mar 24, 2022 at 04:57:00PM -0400, John Snow wrote: > On Thu, Mar 24, 2022 at 1:50 PM Victor Toso wrote: > > > > * qom-path is not optional > > > > Signed-off-by: Victor Toso > > --- > > qapi/machine.json | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git

Re: [PATCH 05/14] qapi: fix example of DUMP_COMPLETED event

2022-03-25 Thread Victor Toso
Hi, On Fri, Mar 25, 2022 at 01:53:50PM +0100, Markus Armbruster wrote: > John Snow writes: > > > On Thu, Mar 24, 2022 at 1:50 PM Victor Toso wrote: > >> > >> * Timestamp is not optional, let's add for completeness. > >> * Add '<-' to signalize it is receiving the data > >> * While at it, add

Re: [PATCH 02/14] qapi: fix example of BLOCK_IMAGE_CORRUPTED event

2022-03-25 Thread Victor Toso
Hi, On Fri, Mar 25, 2022 at 01:43:06PM +0100, Markus Armbruster wrote: > John Snow writes: > > > On Thu, Mar 24, 2022 at 3:15 PM John Snow wrote: > >> > >> > >> > >> On Thu, Mar 24, 2022, 1:50 PM Victor Toso wrote: > >>> > >>> Fatal is not optional. > >>> > >>> Signed-off-by: Victor Toso >

Re: [PATCH 03/14] qapi: fix example of BLOCK_IO_ERROR event

2022-03-25 Thread Victor Toso
Hi, On Thu, Mar 24, 2022 at 04:47:30PM -0400, John Snow wrote: > On Thu, Mar 24, 2022 at 1:50 PM Victor Toso wrote: > > > > Reason is not optional. > > > > Signed-off-by: Victor Toso > > --- > > qapi/block-core.json | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git

Re: [PATCH 01/14] qapi: BlockExportRemoveMode: move comments to TODO

2022-03-25 Thread Victor Toso
Hi, On Fri, Mar 25, 2022 at 11:11:23AM -0400, John Snow wrote: > On Fri, Mar 25, 2022, 8:33 AM Markus Armbruster wrote: > > > Victor Toso writes: > > > > > @hide and @soft are potential additions which fits the TODO section > > > perfectly. > > > > > > The main motivation is to avoid this

Re: [PATCH 01/14] qapi: BlockExportRemoveMode: move comments to TODO

2022-03-25 Thread Victor Toso
Hi, Many thanks for the quick review! On Thu, Mar 24, 2022 at 04:34:42PM -0400, John Snow wrote: > On Thu, Mar 24, 2022 at 1:50 PM Victor Toso wrote: > > > > @hide and @soft are potential additions which fits the TODO section > > perfectly. > > > > The main motivation is to avoid this whole

[PATCH 2/4] python/aqmp: relicense as LGPLv2+

2022-03-25 Thread John Snow
I am the sole author of all of the async QMP code (python/qemu/aqmp) with the following exceptions: python/qemu/aqmp/qmp_shell.py and python/qemu/aqmp/legacy.py were written by Luiz Capitulino (et al) and are already licensed separately as GPLv2 (only). aqmp_tui.py was written by Niteesh Babu G

[PATCH 4/4] python/aqmp-tui: relicense as LGPLv2+

2022-03-25 Thread John Snow
aqmp-tui, the async QMP text user interface tool, is presently licensed as GPLv2+. I intend to include this tool as an add-on to an LGPLv2+ library package hosted on PyPI.org. I've selected LGPLv2+ to maximize compatibility with other licenses while retaining a copyleft license. To keep licensing

[PATCH 1/4] python/aqmp: add explicit GPLv2 license to legacy.py

2022-03-25 Thread John Snow
The legacy.py module is heavily based on the QMP module by Luiz Capitulino (et al) which is licensed as explicit GPLv2-only. The async QMP package is currently licensed similarly, but I intend to relicense the async package to the more flexible LGPLv2+. In preparation for that change, make the

[PATCH 0/4] Python: relicense async qmp as LGPLv2+

2022-03-25 Thread John Snow
Patch 2 explains most of the why. The only dangling exception is legacy.py (patch 1), which I have plans to replace "soon" :tm: (after I fork this code out of qemu.git.) John Snow (4): python/aqmp: add explicit GPLv2 license to legacy.py python/aqmp: relicense as LGPLv2+ python/qmp-shell:

[PATCH 3/4] python/qmp-shell: relicense as LGPLv2+

2022-03-25 Thread John Snow
qmp-shell is presently licensed as GPLv2 (only). I intend to include this tool as an add-on to an LGPLv2+ library package hosted on PyPI.org. I've selected LGPLv2+ to maximize compatibility with other licenses while retaining a copyleft license. To keep licensing matters simple, I'd like to

Re: [PATCH] vdpa: Avoid reset when stop device

2022-03-25 Thread Si-Wei Liu
On 3/25/2022 12:18 AM, Michael Qiu wrote: On 2022/3/25 14:32, Si-Wei Liu Wrote: On 3/23/2022 2:20 AM, Jason Wang wrote: Adding Eugenio,  and Ling Shan. On Wed, Mar 23, 2022 at 4:58 PM <08005...@163.com> wrote: From: Michael Qiu Currently, when VM poweroff, it will trigger vdpa

[PATCH v2 8/8] tests/tcg/nios2: Re-enable linux-user tests

2022-03-25 Thread Richard Henderson
Now that signal handling has been fixed, re-enable tests. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tests/tcg/nios2/Makefile.target | 11 --- 1 file changed, 11 deletions(-) delete mode 100644 tests/tcg/nios2/Makefile.target diff --git

[PATCH v2 6/8] linux-user/nios2: Remove do_sigreturn

2022-03-25 Thread Richard Henderson
There is no sigreturn syscall, only rt_sigreturn. This function is unused. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/signal.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index

[PATCH v2 7/8] linux-user/nios2: Use QEMU_ESIGRETURN from do_rt_sigreturn

2022-03-25 Thread Richard Henderson
Drop the kernel-specific "pr2" code structure and use the qemu-specific error return value. Signed-off-by: Richard Henderson --- linux-user/nios2/signal.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index

[PATCH v2 2/8] linux-user/nios2: Fix clone child return

2022-03-25 Thread Richard Henderson
The child side of clone needs to set the secondary syscall return value, r7, to indicate syscall success. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/target_cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/nios2/target_cpu.h

[PATCH v2 3/8] linux-user/nios2: Drop syscall 0 "workaround"

2022-03-25 Thread Richard Henderson
Syscall 0 is __NR_io_setup for this target; there is nothing to work around. Reviewed-by: Peter Maydell Fixes: a0a839b65b6 ("nios2: Add usermode binaries emulation") Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 4 1 file changed, 4 deletions(-) diff --git

[PATCH v2 for-7.1 0/8] linux-user/nios2: Fix clone and sigreturn

2022-03-25 Thread Richard Henderson
These two syscalls are the reason that the generic linux-user tests were failing, which allows us to re-enable the tests. Changes for v2: * Hoist the pc advance to apply to all EXCP_TRAP. Fixing this properly requires larger changes outside of linux-user; deferred until EIC patch set

[PATCH v2 4/8] linux-user/nios2: Adjust error return

2022-03-25 Thread Richard Henderson
Follow the kernel assembly, which considers all negative return values to be errors. Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index

[PATCH v2 5/8] linux-user/nios2: Handle special qemu syscall return values

2022-03-25 Thread Richard Henderson
Honor QEMU_ESIGRETURN and QEMU_ERESTARTSYS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 8 1 file changed, 8 insertions(+) diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 969460df58..dffe48b8e8 100644 ---

[PATCH v2 1/8] linux-user/nios2: Hoist pc advance to the top of EXCP_TRAP

2022-03-25 Thread Richard Henderson
Note that this advance *should* be done by the translator, as that's the pc value that's supposed to be generated by hardware. However, that's a much larger change across sysemu as well. In the meantime, produce the correct PC for any signals raised by the trap instruction. Signed-off-by:

[PATCH v7 12/17] vfio-user: IOMMU support for remote device

2022-03-25 Thread Jagannathan Raman
Assign separate address space for each device in the remote processes. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- include/hw/remote/iommu.h | 18 hw/remote/iommu.c | 95 +++ MAINTAINERS

[PATCH v7 17/17] vfio-user: avocado tests for vfio-user

2022-03-25 Thread Jagannathan Raman
Avocado tests for libvfio-user in QEMU - tests startup, hotplug and migration of the server object Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- MAINTAINERS| 1 + tests/avocado/vfio-user.py | 164

[PATCH v7 15/17] vfio-user: handle device interrupts

2022-03-25 Thread Jagannathan Raman
Forward remote device's interrupts to the guest Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- include/hw/pci/pci.h | 10 +++ include/hw/remote/vfio-user-obj.h | 6 ++ hw/pci/msi.c | 11 +++-

[PATCH v7 10/17] vfio-user: run vfio-user context

2022-03-25 Thread Jagannathan Raman
Setup a handler to run vfio-user context. The context is driven by messages to the file descriptor associated with it - get the fd for the context and hook up the handler with it Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Stefan

[PATCH v7 14/17] vfio-user: handle PCI BAR accesses

2022-03-25 Thread Jagannathan Raman
Determine the BARs used by the PCI device and register handlers to manage the access to the same. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- include/exec/memory.h | 3 + hw/remote/vfio-user-obj.c | 167

[PATCH v7 09/17] vfio-user: find and init PCI device

2022-03-25 Thread Jagannathan Raman
Find the PCI device with specified id. Initialize the device context with the QEMU PCI device Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Stefan Hajnoczi --- hw/remote/vfio-user-obj.c | 67 +++

[PATCH v7 06/17] vfio-user: build library

2022-03-25 Thread Jagannathan Raman
add the libvfio-user library as a submodule. build it as a cmake subproject. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- configure | 20 +- meson.build| 44

[PATCH v7 08/17] vfio-user: instantiate vfio-user context

2022-03-25 Thread Jagannathan Raman
create a context with the vfio-user library to run a PCI device Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/remote/vfio-user-obj.c | 82 +++ 1 file changed, 82 insertions(+) diff --git

[PATCH v7 13/17] vfio-user: handle DMA mappings

2022-03-25 Thread Jagannathan Raman
Define and register callbacks to manage the RAM regions used for device DMA Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Stefan Hajnoczi --- hw/remote/machine.c | 5 hw/remote/vfio-user-obj.c | 55

[PATCH v7 16/17] vfio-user: handle reset of remote device

2022-03-25 Thread Jagannathan Raman
Adds handler to reset a remote device Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/remote/vfio-user-obj.c | 20 1 file changed, 20 insertions(+) diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c

[PATCH v7 03/17] remote/machine: add HotplugHandler for remote machine

2022-03-25 Thread Jagannathan Raman
Allow hotplugging of PCI(e) devices to remote machine Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Stefan Hajnoczi --- hw/remote/machine.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/remote/machine.c

[PATCH v7 11/17] vfio-user: handle PCI config space accesses

2022-03-25 Thread Jagannathan Raman
Define and register handlers for PCI config space accesses Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Stefan Hajnoczi --- hw/remote/vfio-user-obj.c | 51 +++ hw/remote/trace-events| 2 ++

[PATCH v7 05/17] configure: require cmake 3.19 or newer

2022-03-25 Thread Jagannathan Raman
cmake needs to accept the compiler flags specified with CMAKE__COMPILER variable. It does so starting with version 3.19 Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- configure | 16 1 file changed, 16 insertions(+) diff

[PATCH v7 04/17] remote/machine: add vfio-user property

2022-03-25 Thread Jagannathan Raman
Add vfio-user to x-remote machine. It is a boolean, which indicates if the machine supports vfio-user protocol. The machine configures the bus differently vfio-user and multiprocess protocols, so this property informs it on how to configure the bus. This property should be short lived. Once

[PATCH v7 07/17] vfio-user: define vfio-user-server object

2022-03-25 Thread Jagannathan Raman
Define vfio-user object which is remote process server for QEMU. Setup object initialization functions and properties necessary to instantiate the object Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- qapi/qom.json | 20 +++-

[PATCH v7 02/17] qdev: unplug blocker for devices

2022-03-25 Thread Jagannathan Raman
Add blocker to prevent hot-unplug of devices Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- include/hw/qdev-core.h | 29 + hw/core/qdev.c | 24 softmmu/qdev-monitor.c | 4 3

[PATCH v7 01/17] tests/avocado: Specify target VM argument to helper routines

2022-03-25 Thread Jagannathan Raman
Specify target VM for exec_command and exec_command_and_wait_for_pattern routines Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Beraldo Leal Reviewed-by: Stefan Hajnoczi ---

[PATCH v7 00/17] vfio-user server in QEMU

2022-03-25 Thread Jagannathan Raman
Hi, This is v7 of the server side changes to enable vfio-user in QEMU. Thank you very much for reviewing the last revision of this series! In this revision, we've dropped the patches concerning migration due to a major changes in the VFIO PCI protocol. We are changing the client, library and

Re: [PATCH] vdpa: Avoid reset when stop device

2022-03-25 Thread Si-Wei Liu
On 3/25/2022 2:00 AM, Michael Qiu wrote: On 2022/3/25 14:32, Si-Wei Liu wrote: On 3/23/2022 2:20 AM, Jason Wang wrote: Adding Eugenio,  and Ling Shan. On Wed, Mar 23, 2022 at 4:58 PM <08005...@163.com> wrote: From: Michael Qiu Currently, when VM poweroff, it will trigger vdpa

Re: [PATCH 6/7] linux-user/nios2: Use QEMU_ESIGRETURN from do_rt_sigreturn

2022-03-25 Thread Richard Henderson
On 3/25/22 06:16, Peter Maydell wrote: +return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); Don't you also need to return -QEMU_ESIGRETURN in the badframe error-handling case? The other guest architecture implementations of do_sigreturn seem to do that.

Re: [PATCH v3 4/4] hw/arm/virt: Unify ACPI processor ID in MADT and SRAT table

2022-03-25 Thread Gavin Shan
Hi Igor, On 3/25/22 10:00 PM, Igor Mammedov wrote: On Wed, 23 Mar 2022 15:24:38 +0800 Gavin Shan wrote: The value of the following field has been used in ACPI PPTT table to identify the corresponding processor. This takes the same field as the ACPI processor ID in MADT and SRAT tables.

Re: [PATCH 3/7] linux-user/nios2: Adjust error return

2022-03-25 Thread Richard Henderson
On 3/25/22 07:37, Peter Maydell wrote: This turns out to be because in 2015 kernel commit c3525940cca5 switched powerpc from checking against 515/516 and instead made them check MAX_ERRNO (4095). (If anybody cared about seccomp on sparc hosts they'd probably want to fix the sparc kernel

Re: [PATCH v3 1/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-03-25 Thread Gavin Shan
Hi Igor, On 3/25/22 9:19 PM, Igor Mammedov wrote: On Wed, 23 Mar 2022 15:24:35 +0800 Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this case, it's impossible to provide the default CPU-to-NUMA mapping or association based on the

[PATCH-for-7.0 v3] qemu/main-loop: Disable block backend global state assertion on Cocoa

2022-03-25 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Since commit 0439c5a462 ("block/block-backend.c: assertions for block-backend") QEMU crashes when using Cocoa on Darwin hosts. Example on macOS: $ qemu-system-i386 Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line

Re: [PATCH RESEND v1 0/2] i386: Make PIT and PIC the property of common x86 base machine type

2022-03-25 Thread Philippe Mathieu-Daudé
On 25/3/22 04:45, Xiaoyao Li wrote: On 3/10/2022 9:07 PM, Michael S. Tsirkin wrote: On Thu, Mar 10, 2022 at 08:28:09PM +0800, Xiaoyao Li wrote: For PIT, it's straightforward to merge microvm::pit and pc_machine::pit_enabled into x86ms::pit For PIC, move microvm::pic to x86ms:pic, which gives

[PATCH] tests/tcg/xtensa: allow testing big-endian cores

2022-03-25 Thread Max Filippov
Don't disable all big-endian tests, instead check whether $(CORE) is supported by the configured $(QEMU) and enable tests if it is. Signed-off-by: Max Filippov --- MAINTAINERS| 1 + tests/tcg/xtensa/Makefile.softmmu-target | 4 ++--

Re: [PATCH 01/10] python/aqmp: add explicit GPLv2 license to legacy.py

2022-03-25 Thread John Snow
On Fri, Mar 25, 2022, 10:55 AM Eric Blake wrote: > On Thu, Mar 24, 2022 at 12:07:24PM -0400, John Snow wrote: > ... > > > Yep, as I mentioned, I don't want to see us abandon copyleft either. > > > > > > Of course everyone has their own preferred license, so I'm sure > > > people who write apps

Re: [PATCH v2] block/stream: Drain subtree around graph change

2022-03-25 Thread Vladimir Sementsov-Ogievskiy
24.03.2022 17:09, Hanna Reitz wrote: When the stream block job cuts out the nodes between top and base in stream_prepare(), it does not drain the subtree manually; it fetches the base node, and tries to insert it as the top node's backing node with bdrv_set_backing_hd(). bdrv_set_backing_hd()

[PATCH v2] ui/console: Check console before emitting GL event

2022-03-25 Thread Akihiko Odaki
Without this change, The GL output of a console overwrites the other consoles and makes them unusable. Signed-off-by: Akihiko Odaki Reviewed-by: Marc-André Lureau --- ui/console.c | 21 + 1 file changed, 21 insertions(+) diff --git a/ui/console.c b/ui/console.c index

[PATCH 1/2] softmmu/physmem: move last_ram_page() call under qemu_mutex_lock_ramlist()

2022-03-25 Thread Andrey Ryabinin
The 'ram_list.blocks' modifications protected by 'ram_list.mutex'. last_ram_page() uses state of 'ram_list.blocks' to identify ram's size. ram_block_add() calls last_ram_page() before the mutex lock making the following race possible: CPU#0 CPU#1

[PATCH 2/2] softmmu/physmem: fix dirty memory bitmap memleak

2022-03-25 Thread Andrey Ryabinin
The sequence of ram_block_add()/qemu_ram_free()/ram_block_add() function calls leads to leaking some memory. ram_block_add() calls dirty_memory_extend() to allocate bitmap blocks for new memory. These blocks only grow but never shrink. So the qemu_ram_free() restores RAM size back to it's

Re: [PATCH 1/7] linux-user/nios2: Fix clone child return

2022-03-25 Thread Richard Henderson
On 3/25/22 05:49, Peter Maydell wrote: On Sun, 20 Mar 2022 at 16:12, Richard Henderson wrote: The child side of clone needs to set the secondary syscall return value, r7, to indicate syscall success. Advance the pc before do_syscall, so that the new thread does not re-execute the clone

Re: [RFC PATCH 1/6] target/ppc: Add support for the Processor Attention instruction

2022-03-25 Thread Fabiano Rosas
Leandro Lupori writes: > From: Cédric Le Goater > > Check the HID0 bit to send signal, currently modeled as a checkstop. > The QEMU implementation adds an exit using the GPR[3] value (that's a > hack for tests) > > Signed-off-by: Cédric Le Goater > Signed-off-by: Leandro Lupori > --- >

Re: [PATCH 01/14] qapi: BlockExportRemoveMode: move comments to TODO

2022-03-25 Thread John Snow
On Fri, Mar 25, 2022, 8:33 AM Markus Armbruster wrote: > Victor Toso writes: > > > @hide and @soft are potential additions which fits the TODO section > > perfectly. > > > > The main motivation is to avoid this whole block of comment entering > > the wrong section in the python parser. > > > >

Re: [PATCH v2 05/17] iotests/040: Fix TestCommitWithFilters test

2022-03-25 Thread John Snow
On Fri, Mar 25, 2022, 9:40 AM Hanna Reitz wrote: > On 24.03.22 19:30, John Snow wrote: > > Without this change, asserting that qemu_io always returns 0 causes this > > test to fail in a way we happened not to be catching previously: > > > > qemu.utils.VerboseProcessError: Command > >

Re: Re: [PATCH] kvm/arm64: Fix memory section did not set to kvm

2022-03-25 Thread Peter Maydell
On Fri, 25 Mar 2022 at 14:42, wrote: > I found this issue on qmeu 4.2 with host linux 4.19, I want to > use qxl on arm64. on arm64, default page size is 64k, and the > qxl_rom_size is fixed 8192. OK, so the fix to this is "use a newer QEMU". > but when I read qxl_rom region in guest, guest os

Re: [PULL for-7.1 08/36] *: Use fprintf between qemu_log_lock/unlock

2022-03-25 Thread Richard Henderson
On 3/24/22 08:30, Alex Bennée wrote: Richard Henderson writes: On 3/23/22 10:22, Alex Bennée wrote: Richard Henderson writes: Inside qemu_log, we perform qemu_log_lock/unlock, which need not be done if we have already performed the lock beforehand. Always check the result of

[PULL 2/2] hw/intc/arm_gicv3_its: Add missing newlines to process_mapc() logging

2022-03-25 Thread Peter Maydell
In commit 84d43d2e82da we rearranged the logging of errors in process_mapc(), and inadvertently dropped the trailing newlines from the log messages. Restore them. The same commit also attempted to switch the ICID printing to hex (which is how we print ICIDs elsewhere) but only did half the job,

Re: [PATCH] iotests: Fix status checks

2022-03-25 Thread Eric Blake
On Thu, Mar 24, 2022 at 07:02:21PM +0100, Hanna Reitz wrote: > An iotest's 'paused' condition is fickle; it will be reported as true > whenever the job is drained, for example, or when it is in the process > of completing. > > 030 and 041 contain such checks, we should replace them by checking

[PULL 1/2] target/arm: Fix sve_ld1_z and sve_st1_z vs MMIO

2022-03-25 Thread Peter Maydell
From: Richard Henderson Both of these functions missed handling the TLB_MMIO flag during the conversion to handle MTE. Fixes: 10a85e2c8ab6 ("target/arm: Reuse sve_probe_page for gather loads") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/925 Signed-off-by: Richard Henderson

[PULL 0/2] target-arm queue

2022-03-25 Thread Peter Maydell
/pmaydell/qemu-arm.git tags/pull-target-arm-20220325 for you to fetch changes up to c7ca3ad5e756e263daf082c315e311593ccec3d1: hw/intc/arm_gicv3_its: Add missing newlines to process_mapc() logging (2022-03-25 14:41:06 +

Re: [PATCH 01/10] python/aqmp: add explicit GPLv2 license to legacy.py

2022-03-25 Thread Eric Blake
On Thu, Mar 24, 2022 at 12:07:24PM -0400, John Snow wrote: ... > > Yep, as I mentioned, I don't want to see us abandon copyleft either. > > > > Of course everyone has their own preferred license, so I'm sure > > people who write apps with MIT, will think we should use MIT > > too. Ultimately

Re: [PATCH] iotests: update test owner contact information

2022-03-25 Thread Eric Blake
On Tue, Mar 22, 2022 at 01:42:12PM -0400, John Snow wrote: > Quite a few of these tests have stale contact information. This patch > updates the stale ones that I happen to be aware of at the moment. I would prefer we just drop the lines. Git history and MAINTAINERS is a better way to track

[PATCH 2/2] Some mmx/sse instructions in 'gen_sse' don't require CRO.TS=0

2022-03-25 Thread Wei Li
Some instructions in 'gen_sse' don't require CRO.TS=0 and the opcode of them are 0F38F[0-F], 0F3AF[0-F]. Signed-off-by: Wei Li --- target/i386/tcg/translate.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/target/i386/tcg/translate.c

Re: [PATCH] target/i386: tcg: high bits SSE cmp operation must be ignored

2022-03-25 Thread Richard Henderson
On 3/24/22 02:08, Paolo Bonzini wrote: High bits in the immediate operand of SSE comparisons are ignored, they do not result in an undefined opcode exception. This is mentioned explicitly in the Intel documentation. Reported-by:sonicadvan...@gmail.com

Re: [PATCH v2] block/stream: Drain subtree around graph change

2022-03-25 Thread Eric Blake
On Thu, Mar 24, 2022 at 03:09:07PM +0100, Hanna Reitz wrote: > When the stream block job cuts out the nodes between top and base in > stream_prepare(), it does not drain the subtree manually; it fetches the > base node, and tries to insert it as the top node's backing node with >

  1   2   >