Re: [PATCH 2/5] ppc/pnv: Add support for NMI interface

2020-03-25 Thread Cédric Le Goater
[ Please use c...@kaod.org ! ] On 3/25/20 3:41 PM, Nicholas Piggin wrote: > This implements the NMI interface for the PNV machine, similarly to > commit 3431648272d ("spapr: Add support for new NMI interface") for > SPAPR. > > Signed-off-by: Nicholas Piggin one minor comment, Reviewed-by:

Re: [PATCH 4/5] ppc/spapr: Implement mce injection

2020-03-25 Thread Cédric Le Goater
On 3/25/20 3:41 PM, Nicholas Piggin wrote: > This implements mce injection for spapr. > > (qemu) mce 0 0x20 0x80 0xdeadbeef 1 > > Disabling lock debugging due to kernel taint > MCE: CPU0: machine check (Severe) Host SLB Multihit DAR: deadbeef > [Recovered] > MCE: CPU0:

Re: [PATCH v6 20/61] target/riscv: vector widening integer multiply instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 8:47 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 19 + > target/riscv/insn32.decode | 6 +++ >

Re: [PATCH v9 3/4] linux-user: Support futex_time64

2020-03-25 Thread Alistair Francis
On Wed, Mar 18, 2020 at 3:54 PM Alistair Francis wrote: > > Add support for host and target futex_time64. If futex_time64 exists on > the host we try that first before falling back to the standard futux > syscall. > > Signed-off-by: Alistair Francis @Laurent did you see this? I guess it's a

[Bug 1869006] Re: PCIe cards passthrough to TCG guest works on 2GB of guest memory but fails on 4GB (vfio_dma_map invalid arg)

2020-03-25 Thread Marcin Juszkiewicz
I wrote blog post about it: https://marcin.juszkiewicz.com.pl/2020/03/25 /sharing-pcie-cards-across-architectures/ -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1869006 Title: PCIe cards

Re: [PATCH v2 4/4] ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery fails

2020-03-25 Thread Greg Kurz
On Thu, 26 Mar 2020 00:29:06 +1000 Nicholas Piggin wrote: > Try to be tolerant of FWNMI delivery errors if the machine check had been > recovered by the host. > > Signed-off-by: Nicholas Piggin > --- > hw/ppc/spapr_events.c | 27 ++- > 1 file changed, 22 insertions(+),

Re: [PATCH 00/13] microvm: add acpi support

2020-03-25 Thread Igor Mammedov
On Wed, 25 Mar 2020 16:03:39 +0100 Gerd Hoffmann wrote: > On Wed, Mar 25, 2020 at 01:32:12PM +0100, Igor Mammedov wrote: > > On Thu, 19 Mar 2020 09:01:04 +0100 > > Gerd Hoffmann wrote: > > > > > I know that not supporting ACPI in microvm is intentional. If you still > > > don't want ACPI

[PATCH-for-5.0 12/12] hw/riscv/sifive_u: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw [[manual check required: error_propagate() might be

Re: [PATCH 0/5] ppc: sreset and machine check injection

2020-03-25 Thread Cédric Le Goater
On 3/25/20 3:41 PM, Nicholas Piggin wrote: > This adds nmi injection for pnv, and similar mce injection for > spapr and pnv. The mce injection has already uncovered quite a > few bugs in Linux papr guest and one in pnv host code, so it > has been already very useful. Nice ! > The mambo

Re: [PATCH v2 1/4] ppc/spapr: KVM FWNMI should not be enabled until guest requests it

2020-03-25 Thread Greg Kurz
On Thu, 26 Mar 2020 00:29:03 +1000 Nicholas Piggin wrote: > The KVM FWNMI capability should be enabled with the "ibm,nmi-register" > rtas call. Although MCEs from KVM will be delivered as architected > interrupts to the guest before "ibm,nmi-register" is called, KVM has > different behaviour

Re: [PATCH v3] hw/char/pl011: Enable TxFIFO and async transmission

2020-03-25 Thread Peter Maydell
On Wed, 25 Mar 2020 at 15:56, Paolo Bonzini wrote: > > On 25/03/20 03:32, Gavin Shan wrote: > >> > > > > Marc-André, ping. Could you please review when you get a chance? Thanks in > > advance :) > > Or Peter; generally arch-specific changes (as opposed to fixes in > chardev API usage) are

[Bug 1869006] Re: PCIe cards passthrough to TCG guest works on 2GB of guest memory but fails on 4GB (vfio_dma_map invalid arg)

2020-03-25 Thread Peter Maydell
That's an awkward flaw in the IOMMU design :-( -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1869006 Title: PCIe cards passthrough to TCG guest works on 2GB of guest memory but fails on 4GB

[PATCH-for-5.0 08/12] hw/mips/boston: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw [[manual check required: error_propagate() might be

[PATCH-for-5.0 06/12] hw/dma/xilinx_axidma: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw [[manual check required: error_propagate() might be

Re: [PATCH v6 16/61] target/riscv: vector integer comparison instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 8:39 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 57 +++ > target/riscv/insn32.decode | 20 >

Re: [PATCH-for-5.0 2/3] virtio: Document virtqueue_pop()

2020-03-25 Thread Marc-André Lureau
On Mon, Mar 23, 2020 at 12:55 PM Marc-André Lureau wrote: > > On Mon, Mar 23, 2020 at 12:30 PM Philippe Mathieu-Daudé > wrote: > > > > Document that virtqueue_pop() returned memory must be released > > with free(). > > > > Signed-off-by: Philippe Mathieu-Daudé > > Reviewed-by: Marc-André Lureau

Re: [PATCH 0/2] mirror: Fix hang (operation waiting for itself/circular dependency)

2020-03-25 Thread Kevin Wolf
Am 25.03.2020 um 18:23 hat Kevin Wolf geschrieben: > The recent fix didn't actually fix the whole problem. Operations can't > only wait for themselves, but we can also end up with circular > dependencies like two operations waiting for each other to complete. > > This reverts the first fix and

Re: [PATCH v6 22/61] target/riscv: vector widening integer multiply-add instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 8:51 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 22 > target/riscv/insn32.decode | 7 >

[PATCH for-5.0 2/3] qmp: fix leak on callbacks that return both value and error

2020-03-25 Thread Marc-André Lureau
Direct leak of 4120 byte(s) in 1 object(s) allocated from: #0 0x7fa114931887 in __interceptor_calloc (/lib64/libasan.so.6+0xb0887) #1 0x7fa1144ad8f0 in g_malloc0 (/lib64/libglib-2.0.so.0+0x588f0) #2 0x561e3c9c8897 in qmp_object_add /home/elmarco/src/qemu/qom/qom-qmp-cmds.c:291 #3

Re: [PATCH RFC 6/9] KVM: Provide helper to sync dirty bitmap from slot to ramblock

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > kvm_physical_sync_dirty_bitmap() calculates the ramblock offset in an > awkward way from the MemoryRegionSection that passed in from the > caller. The truth is for each KVMSlot the ramblock offset never > change for the lifecycle. Cache the ramblock offset

[PATCH for-5.0 0/3] Memory leak fixes

2020-03-25 Thread Marc-André Lureau
Hi, A small series of leaks spotted by ASAN during "make check". Marc-André Lureau (3): migration: fix cleanup_bh leak on resume qmp: fix leak on callbacks that return both value and error object-add: don't create return value if failed migration/migration.c | 7 ++-

[PATCH for-5.0 3/3] object-add: don't create return value if failed

2020-03-25 Thread Marc-André Lureau
If object-add failed, no need to create a return value that may later be leaked. Signed-off-by: Marc-André Lureau --- qom/qom-qmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 435193b036..6bd137ccbf 100644 ---

[PATCH-for-5.0 10/12] hw/misc/macio/macio: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw [[manual check required: error_propagate() might be

[PATCH-for-5.0 11/12] hw/net/xilinx_axienet: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw [[manual check required: error_propagate() might be

[PATCH-for-5.0 09/12] hw/mips/mips_malta: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw [[manual check required: error_propagate() might be

Re: [PATCH v6 32/61] target/riscv: vector single-width floating-point multiply/divide instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 9:11 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 16 + > target/riscv/insn32.decode | 5 +++ >

Re: [PATCH 04/13] microvm: add minimal acpi support.

2020-03-25 Thread Igor Mammedov
On Wed, 25 Mar 2020 10:04:29 +0100 Gerd Hoffmann wrote: > Hi, > > > > +{ > > > +AcpiRsdpData rsdp_data = { > > > +.revision = 0, > > > +.oem_id = ACPI_BUILD_APPNAME6, > > > +.xsdt_tbl_offset = NULL, > > > +.rsdt_tbl_offset = , > >

[PATCH-for-5.0 02/12] hw/arm/bcm2835_peripherals: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH-for-5.0 00/12] hw: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
On Wed, Mar 25, 2020 at 8:18 PM Philippe Mathieu-Daudé wrote: > > This series is inspired of Peter fix: > "hw/arm/xlnx-zynqmp.c: fix some error-handling code" > https://www.mail-archive.com/qemu-devel@nongnu.org/msg691636.html > > Add a cocci script to fix the other places. > > Based-on:

Re: [EXTERNAL] [PATCH 5/5] ppc/pnv: Implement mce injection

2020-03-25 Thread Cédric Le Goater
On 3/25/20 3:41 PM, Nicholas Piggin wrote: > This implements mce injection for pnv. This would be the command to use ? (qemu) mce 0 0x10 0x80 0xdeadbeef 1 > Signed-off-by: Nicholas Piggin > --- > hw/ppc/pnv.c | 55 > target/ppc/cpu.h

Re: [PATCH RFC 3/9] memory: Introduce log_sync_global() to memory listener

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Some of the memory listener may want to do log synchronization without > being able to specify a range of memory to sync but always globally. > Such a memory listener should provide this new method instead of the > log_sync() method. > > Obviously we can

Re: [PATCH RFC 1/9] KVM: Fixup kvm_log_clear_one_slot() ioctl return check

2020-03-25 Thread Peter Xu
On Wed, Feb 05, 2020 at 09:17:41AM -0500, Peter Xu wrote: > kvm_vm_ioctl() handles the errno trick already for ioctl() on > returning -1 for errors. Fix this. > > Signed-off-by: Peter Xu > --- > accel/kvm/kvm-all.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH v6 61/61] target/riscv: configure and turn on vector extension from command line

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 10:09 AM LIU Zhiwei wrote: > > Vector extension is default off. The only way to use vector extension is > 1. use cpu rv32 or rv64 > 2. turn on it by command line > "-cpu rv64,x-v=true,vlen=128,elen=64,vext_spec=v0.7.1". > > vlen is the vector register length, default value

Re: [PATCH 00/13] microvm: add acpi support

2020-03-25 Thread Igor Mammedov
On Wed, 25 Mar 2020 10:16:36 +0100 Gerd Hoffmann wrote: > > > mounted. Decided to use the "i8042: PNP: No PS/2 controller found." > > > line instead for a simple test (just check the kernel log timestamps, > > > three runs each). The ACPI initialization is already done at that > > > point, so

[PATCH-for-5.0 07/12] hw/mips/cps: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH 3/5] nmi: add MCE class for implementing machine check injection commands

2020-03-25 Thread Cédric Le Goater
On 3/25/20 3:41 PM, Nicholas Piggin wrote: > Like commit 9cb805fd26 ("cpus: Define callback for QEMU "nmi" command") > this implements a machine check injection command framework and defines > a monitor command for ppc. > > Signed-off-by: Nicholas Piggin Looks good to me, Reviewed-by: Cédric

Re: [PATCH RFC 3/9] memory: Introduce log_sync_global() to memory listener

2020-03-25 Thread Peter Xu
On Wed, Mar 25, 2020 at 04:52:52PM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Some of the memory listener may want to do log synchronization without > > being able to specify a range of memory to sync but always globally. > > Such a memory listener should

[PATCH 0/2] mirror: Fix hang (operation waiting for itself/circular dependency)

2020-03-25 Thread Kevin Wolf
The recent fix didn't actually fix the whole problem. Operations can't only wait for themselves, but we can also end up with circular dependencies like two operations waiting for each other to complete. This reverts the first fix and implements another approach. Kevin Wolf (2): Revert "mirror:

[PATCH 1/2] Revert "mirror: Don't let an operation wait for itself"

2020-03-25 Thread Kevin Wolf
This reverts commit 7e6c4ff792734e196c8ca82564c56b5e7c6288ca. The fix was incomplete as it only protected against requests waiting for themselves, but not against requests waiting for each other. We need a different solution. Signed-off-by: Kevin Wolf --- block/mirror.c | 21

Re: [PATCH 2/2] mirror: Wait only for in-flight operations

2020-03-25 Thread Eric Blake
On 3/25/20 12:23 PM, Kevin Wolf wrote: mirror_wait_for_free_in_flight_slot() just picks a random operation to wait for. However, a MirrorOp is already in s->ops_in_flight when mirror_co_read() waits for free slots, so if not enough slots are immediately available, an operation can end up waiting

Re: [PATCH RFC 5/9] KVM: Provide helper to get kvm dirty log

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Provide a helper kvm_slot_get_dirty_log() to make the function > kvm_physical_sync_dirty_bitmap() clearer. We can even cache the as_id > into KVMSlot when it is created, so that we don't even need to pass it > down every time. > > Since at it, remove

Re: [PATCH] vfio/migration: fix dirty pages lost bug for ram beyond 3G

2020-03-25 Thread Alex Williamson
On Fri, 6 Mar 2020 17:41:29 +0800 Yan Zhao wrote: > the start address passing to > cpu_physical_memory_set_dirty_range() and > cpu_physical_memory_set_dirty_lebitmap() is the address within the > ram block plus ram block offset. > > it's safe to set this start address to gpa if total memory is

[PATCH for-5.0 1/3] migration: fix cleanup_bh leak on resume

2020-03-25 Thread Marc-André Lureau
Since commit 8c6b0356b53977bcfdea5299db07884915425b0c ("util/async: make bh_aio_poll() O(1)"), migration-test reveals a leak: QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 tests/qtest/migration-test -p /x86_64/migration/postcopy/recovery tests/qtest/libqtest.c:140: kill_qemu() tried to

Re: [PATCH RFC 7/9] KVM: Cache kvm slot dirty bitmap size

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Cache it too because we'll reference it more frequently in the future. > > Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert > --- > accel/kvm/kvm-all.c | 1 + > include/sysemu/kvm_int.h | 1 + > 2 files changed, 2 insertions(+) > >

[PATCH-for-5.0 03/12] hw/arm/fsl-imx: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH-for-5.0 04/12] hw/arm/stm32fx05_soc: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH-for-5.0 05/12] hw/i386/x86: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH RFC 8/9] KVM: Add dirty-ring-size property

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Add a parameter for size of dirty ring. If zero, dirty ring is > disabled. Otherwise dirty ring will be enabled with the per-vcpu size > as specified. If dirty ring cannot be enabled due to unsupported > kernel, it'll fallback to dirty logging. By

Re: [PATCH RFC 1/9] KVM: Fixup kvm_log_clear_one_slot() ioctl return check

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > kvm_vm_ioctl() handles the errno trick already for ioctl() on > returning -1 for errors. Fix this. > > Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert > --- > accel/kvm/kvm-all.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-)

Re: [PATCH v3] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-25 Thread Paolo Bonzini
On 25/03/20 16:45, Olaf Hering wrote: >> hw_compat_3_1 and pc_compat_3_1 > I have asked about this earlier, so again: > > What do all these arrays do in the context of 'xenfv' to the emulated system? They change the hardware and CPU features that is presented to the VMs, if the respective

[PATCH 2/2] mirror: Wait only for in-flight operations

2020-03-25 Thread Kevin Wolf
mirror_wait_for_free_in_flight_slot() just picks a random operation to wait for. However, a MirrorOp is already in s->ops_in_flight when mirror_co_read() waits for free slots, so if not enough slots are immediately available, an operation can end up waiting for itself, or two or more operations

Re: [PATCH v2 3/4] ppc/spapr: Add FWNMI machine check delivery warnings

2020-03-25 Thread Greg Kurz
On Thu, 26 Mar 2020 00:29:05 +1000 Nicholas Piggin wrote: > Add some messages which explain problems and guest misbehaviour that > may be difficult to diagnose in rare cases of machine checks. > > Signed-off-by: Nicholas Piggin > --- Reviewed-by: Greg Kurz > hw/ppc/spapr_events.c | 4

Re: [PATCH v6 21/61] target/riscv: vector single-width integer multiply-add instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 8:49 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 33 ++ > target/riscv/insn32.decode | 8 +++ >

Re: [PATCH 1/2] Revert "mirror: Don't let an operation wait for itself"

2020-03-25 Thread Eric Blake
On 3/25/20 12:23 PM, Kevin Wolf wrote: This reverts commit 7e6c4ff792734e196c8ca82564c56b5e7c6288ca. The fix was incomplete as it only protected against requests waiting for themselves, but not against requests waiting for each other. We need a different solution. Signed-off-by: Kevin Wolf

Re: [PATCH v6 18/61] target/riscv: vector single-width integer multiply instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 8:43 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 33 + > target/riscv/insn32.decode | 8 ++ > target/riscv/insn_trans/trans_rvv.inc.c | 10 ++ >

Re: [PATCH RFC 4/9] KVM: Create the KVMSlot dirty bitmap on flag changes

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Previously we have two places that will create the per KVMSlot dirty > bitmap: > > 1. When a newly created KVMSlot has dirty logging enabled, > 2. When the first log_sync() happens for a memory slot. > > The 2nd case is lazy-init, while the 1st case is

Re: [PATCH RFC 5/9] KVM: Provide helper to get kvm dirty log

2020-03-25 Thread Peter Xu
On Wed, Mar 25, 2020 at 05:52:20PM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Provide a helper kvm_slot_get_dirty_log() to make the function > > kvm_physical_sync_dirty_bitmap() clearer. We can even cache the as_id > > into KVMSlot when it is created, so that

[Bug 1869073] [NEW] qemu-arm-static crashes "segmentation fault" when running "git clone -s"

2020-03-25 Thread Manuel Reimer
Public bug reported: I want to use qemu-arm-static to cross-compile software. The compiler itself is a native cross-compiler connected via "distcc". The problem is that a script tries to do some stuff with "git" and with a "git clone -s" command the whole story reproducibly stops with a

[Bug 1815721] Re: RISC-V PLIC enable interrupt for multicore

2020-03-25 Thread RTOS Pharos
Thank you for the explanation. I actually built it for "Virt" machine. I'll try the "sifive_u" when I can. But I guess your explanation is correct so this bug could be closed from my part. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to

Re: [PATCH v6 37/61] target/riscv: vector floating-point min/max instructions

2020-03-25 Thread Alistair Francis
On Tue, Mar 17, 2020 at 9:21 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 13 > target/riscv/insn32.decode | 4 >

[PATCH-for-5.0 01/12] scripts/coccinelle: Add script to catch missing error_propagate() calls

2020-03-25 Thread Philippe Mathieu-Daudé
In some places in we put an error into a local Error*, but forget to check for failure and pass it back to the caller. Add a Coccinelle patch to catch automatically add the missing code. Inspired-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH-for-5.0 00/12] hw: Add missing error-propagation code

2020-03-25 Thread Philippe Mathieu-Daudé
This series is inspired of Peter fix: "hw/arm/xlnx-zynqmp.c: fix some error-handling code" https://www.mail-archive.com/qemu-devel@nongnu.org/msg691636.html Add a cocci script to fix the other places. Based-on: <20200324134947.15384-1-peter.mayd...@linaro.org> Philippe Mathieu-Daud=C3=A9 (12):

Re: [PATCH v16 QEMU 04/16] vfio: Add save and load functions for VFIO PCI devices

2020-03-25 Thread Alex Williamson
On Wed, 25 Mar 2020 02:39:02 +0530 Kirti Wankhede wrote: > These functions save and restore PCI device specific data - config > space of PCI device. > Tested save and restore with MSI and MSIX type. > > Signed-off-by: Kirti Wankhede > Reviewed-by: Neo Jia > --- > hw/vfio/pci.c

Re: [PATCH-for-5.0 04/12] hw/arm/stm32fx05_soc: Add missing error-propagation code

2020-03-25 Thread Alistair Francis
On Wed, Mar 25, 2020 at 12:22 PM Philippe Mathieu-Daudé wrote: > > Patch created mechanically by running: > > $ spatch \ > --macro-file scripts/cocci-macro-file.h --include-headers \ > --sp-file > scripts/coccinelle/object_property_missing_error_propagate.cocci \ > --keep-comments

Re: [PATCH-for-5.0 06/12] hw/dma/xilinx_axidma: Add missing error-propagation code

2020-03-25 Thread Alistair Francis
On Wed, Mar 25, 2020 at 12:24 PM Philippe Mathieu-Daudé wrote: > > Running the coccinelle script produced: > > $ spatch \ > --macro-file scripts/cocci-macro-file.h --include-headers \ > --sp-file > scripts/coccinelle/object_property_missing_error_propagate.cocci \ > --keep-comments

Re: [PATCH RFC 8/9] KVM: Add dirty-ring-size property

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Add a parameter for size of dirty ring. If zero, dirty ring is > disabled. Otherwise dirty ring will be enabled with the per-vcpu size > as specified. If dirty ring cannot be enabled due to unsupported > kernel, it'll fallback to dirty logging. By

Re: [PATCH-for-5.0 2/3] virtio: Document virtqueue_pop()

2020-03-25 Thread Philippe Mathieu-Daudé
On 3/25/20 6:50 PM, Marc-André Lureau wrote: On Mon, Mar 23, 2020 at 12:55 PM Marc-André Lureau wrote: On Mon, Mar 23, 2020 at 12:30 PM Philippe Mathieu-Daudé wrote: Document that virtqueue_pop() returned memory must be released with free(). Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH 1/5] ppc/spapr: tweak change system reset helper

2020-03-25 Thread David Gibson
On Thu, Mar 26, 2020 at 12:41:43AM +1000, Nicholas Piggin wrote: > Rather than have the helper take an optional vector address > override, instead have its caller modify env->nip itself. > This is more consistent when adding pnv nmi support, and also > with mce injection added later. > >

Re: [PATCH qemu] vfio/spapr: Fix page size calculation

2020-03-25 Thread David Gibson
On Tue, Mar 24, 2020 at 05:39:12PM +1100, Alexey Kardashevskiy wrote: > Coverity detected an issue (CID 1421903) with potential call of clz64(0) > which returns 64 which make it do "<<" with a negative number. > > This checks the mask and avoids undefined behaviour. > > In practice pgsizes and

Re: [PATCH v2 1/4] ppc/spapr: KVM FWNMI should not be enabled until guest requests it

2020-03-25 Thread David Gibson
On Thu, Mar 26, 2020 at 12:29:03AM +1000, Nicholas Piggin wrote: 65;5803;1c> The KVM FWNMI capability should be enabled with the "ibm,nmi-register" > rtas call. Although MCEs from KVM will be delivered as architected > interrupts to the guest before "ibm,nmi-register" is called, KVM has >

Re: [PATCH 2/5] ppc/pnv: Add support for NMI interface

2020-03-25 Thread David Gibson
On Thu, Mar 26, 2020 at 12:41:44AM +1000, Nicholas Piggin wrote: > This implements the NMI interface for the PNV machine, similarly to > commit 3431648272d ("spapr: Add support for new NMI interface") for > SPAPR. > > Signed-off-by: Nicholas Piggin Applied to ppc-for-5.1. > --- > hw/ppc/pnv.c

Re: [PATCH v2 4/4] ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery fails

2020-03-25 Thread David Gibson
On Thu, Mar 26, 2020 at 12:29:06AM +1000, Nicholas Piggin wrote: > Try to be tolerant of FWNMI delivery errors if the machine check had been > recovered by the host. > > Signed-off-by: Nicholas Piggin Applied to ppc-for-5.0. > --- > hw/ppc/spapr_events.c | 27 ++- > 1

Re: [PATCH for-5.0] hw/ppc/e500.c: Handle qemu_find_file() failure

2020-03-25 Thread David Gibson
On Tue, Mar 24, 2020 at 12:12:16PM +, Peter Maydell wrote: > If qemu_find_file() doesn't find the BIOS it returns NULL; we were > passing that unchecked through to load_elf(), which assumes a non-NULL > pointer and may misbehave. In practice it fails with a weird message: > > $

Re: [PATCH for-5.0 3/3] object-add: don't create return value if failed

2020-03-25 Thread Philippe Mathieu-Daudé
On 3/25/20 7:47 PM, Marc-André Lureau wrote: If object-add failed, no need to create a return value that may later be leaked. Signed-off-by: Marc-André Lureau --- qom/qom-qmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c

RE: [RFC PATCH v2 00/67] Hexagon patch series

2020-03-25 Thread Taylor Simpson
I know everyone is heads-down working on the 5.0 release, and I realize this is a lot of code. However, I would really appreciate some feedback on it. Is there anything I can do to make it easier to review? Thanks, Taylor > -Original Message- > From: Taylor Simpson > Sent: Friday,

Re: [PATCH v16 QEMU 09/16] vfio: Add save state functions to SaveVMHandlers

2020-03-25 Thread Alex Williamson
On Wed, 25 Mar 2020 02:39:07 +0530 Kirti Wankhede wrote: > Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy > functions. These functions handles pre-copy and stop-and-copy phase. > > In _SAVING|_RUNNING device state or pre-copy phase: > - read pending_bytes. If

Re: [PATCH v2 2/4] ppc/spapr: Improve FWNMI machine check delivery corner case comments

2020-03-25 Thread David Gibson
On Thu, Mar 26, 2020 at 12:29:04AM +1000, Nicholas Piggin wrote: > Some of the conditions are not as clearly documented as they could be. > Also the non-FWNMI case does not need a large comment. > > Reviewed-by: Greg Kurz > Signed-off-by: Nicholas Piggin Applied to ppc-for-5.0. > --- >

Re: [PATCH v2 4/4] ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery fails

2020-03-25 Thread David Gibson
On Wed, Mar 25, 2020 at 07:13:32PM +0100, Greg Kurz wrote: > On Thu, 26 Mar 2020 00:29:06 +1000 > Nicholas Piggin wrote: > > > Try to be tolerant of FWNMI delivery errors if the machine check had been > > recovered by the host. > > > > Signed-off-by: Nicholas Piggin > > --- > >

Re: [PATCH 1/4] spapr: Don't check capabilities removed between CAS calls

2020-03-25 Thread David Gibson
On Wed, Mar 25, 2020 at 04:25:30PM +0100, Greg Kurz wrote: > We currently check if some capability in OV5 was removed by the guest > since the previous CAS, and we trigger a CAS reboot in that case. This > was required because it could call for a device-tree property or node > removal, that we

Re: [PATCH v2 3/4] ppc/spapr: Add FWNMI machine check delivery warnings

2020-03-25 Thread David Gibson
On Thu, Mar 26, 2020 at 12:29:05AM +1000, Nicholas Piggin wrote: > Add some messages which explain problems and guest misbehaviour that > may be difficult to diagnose in rare cases of machine checks. > > Signed-off-by: Nicholas Piggin Applied to ppc-for-5.0. > --- > hw/ppc/spapr_events.c | 4

Re: [PATCH RFC 8/9] KVM: Add dirty-ring-size property

2020-03-25 Thread Peter Xu
On Wed, Mar 25, 2020 at 08:14:03PM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Add a parameter for size of dirty ring. If zero, dirty ring is > > disabled. Otherwise dirty ring will be enabled with the per-vcpu size > > as specified. If dirty ring cannot be

Re: [PATCH-for-5.0 10/12] hw/misc/macio/macio: Add missing error-propagation code

2020-03-25 Thread David Gibson
On Wed, Mar 25, 2020 at 08:18:28PM +0100, Philippe Mathieu-Daudé wrote: > Running the coccinelle script produced: > > $ spatch \ > --macro-file scripts/cocci-macro-file.h --include-headers \ > --sp-file > scripts/coccinelle/object_property_missing_error_propagate.cocci \ >

Re: [PATCH RFC 8/9] KVM: Add dirty-ring-size property

2020-03-25 Thread Peter Xu
On Wed, Mar 25, 2020 at 08:00:31PM +, Dr. David Alan Gilbert wrote: > > @@ -2077,6 +2079,33 @@ static int kvm_init(MachineState *ms) > > s->memory_listener.listener.coalesced_io_add = > > kvm_coalesce_mmio_region; > > s->memory_listener.listener.coalesced_io_del = > >

Re: [PATCH RFC 9/9] KVM: Dirty ring support

2020-03-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > KVM dirty ring is a new interface to pass over dirty bits from kernel > to the userspace. Instead of using a bitmap for each memory region, > the dirty ring contains an array of dirtied GPAs to fetch. For each > vcpu there will be one dirty ring that binds

Re: [PATCH v16 QEMU 08/16] vfio: Register SaveVMHandlers for VFIO device

2020-03-25 Thread Alex Williamson
On Wed, 25 Mar 2020 02:39:06 +0530 Kirti Wankhede wrote: > Define flags to be used as delimeter in migration file stream. > Added .save_setup and .save_cleanup functions. Mapped & unmapped migration > region from these functions at source during saving or pre-copy phase. > Set VFIO device state

Re: [PATCH v16 QEMU 10/16] vfio: Add load state functions to SaveVMHandlers

2020-03-25 Thread Alex Williamson
On Wed, 25 Mar 2020 02:39:08 +0530 Kirti Wankhede wrote: > Sequence during _RESUMING device state: > While data for this device is available, repeat below steps: > a. read data_offset from where user application should write data. > b. write data of data_size to migration region from

[Bug 1693050] Re: xhci HCIVERSION register read emulation incorrectly handled

2020-03-25 Thread Paul Menzel
According to [1], this is still an issue today. [1]: https://review.coreboot.org/c/coreboot/+/39838/ -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1693050 Title: xhci HCIVERSION register read

Re: [PATCH] hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads

2020-03-25 Thread Niek Linnenbank
On Tue, Mar 24, 2020 at 10:21 PM Peter Maydell wrote: > Coverity points out (CID 1421926) that the read code for > REG_ADDR_HIGH reads off the end of the buffer, because it does a > 32-bit read from byte 4 of a 6-byte buffer. > > The code also has an endianness issue for both REG_ADDR_HIGH and >

Re: [PATCH-for-5.0 11/12] hw/net/xilinx_axienet: Add missing error-propagation code

2020-03-25 Thread Alistair Francis
On Wed, Mar 25, 2020 at 12:26 PM Philippe Mathieu-Daudé wrote: > > Running the coccinelle script produced: > > $ spatch \ > --macro-file scripts/cocci-macro-file.h --include-headers \ > --sp-file > scripts/coccinelle/object_property_missing_error_propagate.cocci \ > --keep-comments

Re: [PATCH-for-5.0 12/12] hw/riscv/sifive_u: Add missing error-propagation code

2020-03-25 Thread Alistair Francis
On Wed, Mar 25, 2020 at 12:28 PM Philippe Mathieu-Daudé wrote: > > Running the coccinelle script produced: > > $ spatch \ > --macro-file scripts/cocci-macro-file.h --include-headers \ > --sp-file > scripts/coccinelle/object_property_missing_error_propagate.cocci \ > --keep-comments

Re: [kvm-unit-tests PATCH v7 08/13] arm/arm64: ITS: Device and collection Initialization

2020-03-25 Thread Auger Eric
Hi Zenghui, On 3/25/20 9:10 AM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/20 17:24, Eric Auger wrote: >> Introduce an helper functions to register >> - a new device, characterized by its device id and the >>    max number of event IDs that dimension its ITT (Interrupt >>    Translation Table). 

Re: [PATCH RFC 9/9] KVM: Dirty ring support

2020-03-25 Thread Peter Xu
On Wed, Mar 25, 2020 at 08:41:44PM +, Dr. David Alan Gilbert wrote: [...] > > +enum KVMReaperState { > > +KVM_REAPER_NONE = 0, > > +/* The reaper is sleeping */ > > +KVM_REAPER_WAIT, > > +/* The reaper is reaping for dirty pages */ > > +KVM_REAPER_REAPING, > > +}; > >

Re: [PATCH] hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads

2020-03-25 Thread Peter Maydell
On Wed, 25 Mar 2020 at 21:03, Niek Linnenbank wrote: > By the way, is the coverity output of master publically available by any > chance? We use the public 'coverity scan' service: https://scan.coverity.com/projects/qemu You can create an account and look at the defects if you like, but we

Re: [PATCH for-5.0 1/3] migration: fix cleanup_bh leak on resume

2020-03-25 Thread Juan Quintela
Marc-André Lureau wrote: > Since commit 8c6b0356b53977bcfdea5299db07884915425b0c ("util/async: > make bh_aio_poll() O(1)"), migration-test reveals a leak: > > QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 > tests/qtest/migration-test -p /x86_64/migration/postcopy/recovery >

RE: [PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 11:07 PM > To: Liu, Yi L > Cc: qemu-devel@nongnu.org; alex.william...@redhat.com; > eric.au...@redhat.com; pbonz...@redhat.com; m...@redhat.com; > da...@gibson.dropbear.id.au; Tian, Kevin ; Tian, Jun J > ; Sun, Yi Y ; k...@vger.kernel.org; >

[RFC for-5.1 0/4] Better handling of attempt NVLink2 unplug

2020-03-25 Thread David Gibson
Currently, attempting to unplug an NVLink2 device will generally result in the guest crashing. If you're lucky, it instead simply won't work and remain in a "pending unplug" state indefinitely. There is code we could we could theoretically improve in qemu to tear these devices down better.

[RFC for-5.1 1/4] spapr: Refactor locating NVLink2 devices for device tree creation

2020-03-25 Thread David Gibson
Currently spapr_phb_nvgpu_populate_pcidev_dt() works a little cryptically. It steps through all the NVLink2 GPUs and NPUs and if they match the device we're called for, we generate the relevant device tree information. Make this a little more obvious by introducing helpers to determine it a given

RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-25 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Wednesday, March 25, 2020 9:22 PM > To: 'Peter Xu' > Subject: RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb > invalidation to host > > > From: Peter Xu > > Sent: Wednesday, March 25, 2020 2:34 AM > > To: Liu, Yi L > > Subject: Re: [PATCH v1 20/22]

[PATCH 1/2] block: pass BlockDriver reference to the .bdrv_co_create

2020-03-25 Thread Maxim Levitsky
This will allow to reuse a single generic .bdrv_co_create implementation for several drivers. No functional changes. Signed-off-by: Maxim Levitsky --- block.c | 3 ++- block/crypto.c| 3 ++- block/file-posix.c| 4 +++- block/file-win32.c| 4 +++-

[PATCH 0/2] Fix the generic image creation code

2020-03-25 Thread Maxim Levitsky
The recent patches from Max Reitz allowed some block drivers to not provide the .bdrv_co_create_opts and still allow qemu-img to create/format images as long as the image is already existing (that is the case with various block storage drivers like nbd/iscsi/nvme, etc) However it was found out

  1   2   3   4   >