Re: [Qemu-devel] [PATCH v6 21/25] replay: replay BH for IDE trim operation

2018-09-13 Thread Pavel Dovgalyuk
> From: John Snow [mailto:js...@redhat.com] > On 09/12/2018 04:19 AM, Pavel Dovgalyuk wrote: > > This patch makes IDE trim BH deterministic, because it affects > > the device state. Therefore its invocation should be replayed > > instead of running at the random moment. > > > > Signed-off-by:

[Qemu-devel] [PATCH] hw: edu: replace device name with macro

2018-09-13 Thread Li Qiang
Just as other devices do. Signed-off-by: Li Qiang --- hw/misc/edu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index df26a4d046..0687ffd343 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -30,7 +30,8 @@ #include "qemu/main-loop.h"

Re: [Qemu-devel] [PATCH 5/8] hw: designware: add read memory region callback

2018-09-13 Thread Li Qiang
Paolo Bonzini 于2018年9月13日周四 下午11:12写道: > On 12/09/2018 18:01, Li Qiang wrote: > > From: Li Qiang > > > > Signed-off-by: Li Qiang > > --- > > hw/pci-host/designware.c | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c > >

Re: [Qemu-devel] Can I convert backing file to internal snapshot?

2018-09-13 Thread lampahome
Can I convert from internap snapshot to external snapshot? If there's 3 snapshots in one qcow2, can I convert them all to external snapshots?

Re: [Qemu-devel] What kind of situation to use internal or external snapshot?

2018-09-13 Thread lampahome
In general case, what's difference between internal and external snapshot? I mean in some user situation. Ex: If I want to all snapshots in only one qcow2, I should use internal snapshot. thx

Re: [Qemu-devel] [PATCH 0/5] contrib: add elf2dmp tool

2018-09-13 Thread Viktor Prutyanov
В Wed, 29 Aug 2018 15:41:23 +0300 Viktor Prutyanov пишет: > elf2dmp is a converter from ELF dump (produced by > 'dump-guest-memory') to Windows MEMORY.DMP format (also know as > 'Complete Memory Dump') which can be opened in WinDbg. > > This tool can help if VMCoreInfo device/driver is absent

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] virtio-scsi/virtio-blk: Disable poll handlers when stopping vq handler

2018-09-13 Thread Peter Xu
On Thu, Sep 13, 2018 at 10:00:43AM -0600, Alex Williamson wrote: > On Thu, 13 Sep 2018 12:04:34 +0200 > Paolo Bonzini wrote: > > > On 13/09/2018 11:11, Paolo Bonzini wrote: > > > On 13/09/2018 08:03, Fam Zheng wrote: > > >> On Wed, 09/12 14:42, Paolo Bonzini wrote: > > >>> On 12/09/2018

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread lampahome
Sorry, I need to explain what case I want to do Todo: I want to *backup a block device into qcow2 format image.* I met a problem which is the *file size limit of filesystem* ex: Max is 16TB for any file in ext4, but the block device maybe 32TB or more. I figure out one way is to *divide data of

[Qemu-devel] [PATCH V12-fix-V2 01/19] filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table

2018-09-13 Thread Zhang Chen
We add almost full TCP state machine in filter-rewriter, except TCPS_LISTEN and some simplify in VM active close FIN states. The reason for this simplify job is because guest kernel will track the TCP status and wait 2MSL time too, if client resend the FIN packet, guest will resend the last ACK,

Re: [Qemu-devel] [PATCH V12-fix 01/19] filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table

2018-09-13 Thread Zhang Chen
On Thu, Sep 13, 2018 at 10:49 PM Eric Blake wrote: > On 9/12/18 11:52 PM, Zhang Chen wrote: > > We add almost full TCP state machine in filter-rewriter, except > > TCPS_LISTEN and some simplify in VM active close FIN states. > > The reason for this simplify job is because guest kernel will track

[Qemu-devel] [PATCH 2/2] KVM: i386: Add support for save and restore nested state

2018-09-13 Thread Liran Alon
Kernel commit 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE") introduced new IOCTLs to extract and restore KVM internal state used to run a VM that is in VMX operation. Utilize these IOCTLs to add support of migration of VMs which are running nested hypervisors. Reviewed-by: Nikita

[Qemu-devel] [PATCH 0/2]: KVM: i386: Add support for save and restore nested state

2018-09-13 Thread Liran Alon
Hi, This series aims to add support for QEMU to be able to migrate VMs that are running nested hypervisors. In order to do so, it utilizes the new IOCTLs introduced in KVM commit 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE") which were created for this purpose. 1st patch is not

[Qemu-devel] [PATCH 1/2] i386: Compile CPUX86State xsave_buf only when support KVM or HVF

2018-09-13 Thread Liran Alon
While at it, also rename var to indicate it is not used only in KVM. Reviewed-by: Nikita Leshchenko Reviewed-by: Patrick Colp Signed-off-by: Liran Alon --- target/i386/cpu.h | 4 +++- target/i386/hvf/README.md | 2 +- target/i386/hvf/hvf.c | 2 +- target/i386/hvf/x86hvf.c | 4

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC

2018-09-13 Thread Michael S. Tsirkin
On Thu, Sep 13, 2018 at 05:20:34PM -0500, Brijesh Singh wrote: > > > On 09/13/2018 01:18 PM, Michael S. Tsirkin wrote: > ...>> > > > 0x01 00a0 00 00 48 > > > > > > Byte 0: 0x48 (special device) > > > Byte 1 & 2: must be zero > > > Byte 3: 0 (dte setting) > > > Byte 4: 0 (handle) > > > Byte

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC

2018-09-13 Thread Brijesh Singh
On 09/13/2018 01:18 PM, Michael S. Tsirkin wrote: ...>> 0x01 00a0 00 00 48 Byte 0: 0x48 (special device) Byte 1 & 2: must be zero Byte 3: 0 (dte setting) Byte 4: 0 (handle) Byte 5 & 6: IOAPIC devfn (14:0.0) Do you mean *bus* devfn? devfn is 0.0. Sorry my bad, I was meaning to write

Re: [Qemu-devel] [PATCH v2 17/17] test-bdrv-drain: AIO_WAIT_WHILE() in job .commit/.abort

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > This adds tests for calling AIO_WAIT_WHILE() in the .commit and .abort > callbacks. Both reasons why .abort could be called for a single job are > tested: Either .run or .prepare could return an error. > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-devel] [PATCH v2 16/17] job: Avoid deadlocks in job_completed_txn_abort()

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > Amongst others, job_finalize_single() calls the .prepare/.commit/.abort > callbacks of the individual job driver. Recently, their use was adapted > for all block jobs so that they involve code calling AIO_WAIT_WHILE() > now. Such code must be called under the

Re: [Qemu-devel] [PATCH v2 14/17] block: Remove aio_poll() in bdrv_drain_poll variants

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > bdrv_drain_poll_top_level() was buggy because it didn't release the > AioContext lock of the node to be drained before calling aio_poll(). > This way, callbacks called by aio_poll() would possibly take the lock a > second time and run into a deadlock with a

Re: [Qemu-devel] [PATCH v2 13/17] blockjob: Lie better in child_job_drained_poll()

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > Block jobs claim in .drained_poll() that they are in a quiescent state > as soon as job->deferred_to_main_loop is true. This is obviously wrong, > they still have a completion BH to run. We only get away with this > because commit 91af091f923 added an

Re: [Qemu-devel] [PATCH v2 12/17] mirror: Fix potential use-after-free in active commit

2018-09-13 Thread Max Reitz
On 13.09.18 22:55, Max Reitz wrote: > On 13.09.18 14:52, Kevin Wolf wrote: >> When starting an active commit job, other callbacks can run before >> mirror_start_job() calls bdrv_ref() where needed and cause the nodes to >> go away. Add another pair of bdrv_ref/unref() around it to protect >>

[Qemu-devel] [PATCH v3 1/3] softfloat: remove float64_trunc_to_int

2018-09-13 Thread Emilio G. Cota
It has not had users since f83311e476 ("target-m68k: use floatx80 internally", 2017-06-21). Note that no other bit-width has floatX_trunc_to_int. Signed-off-by: Emilio G. Cota --- include/fpu/softfloat.h | 1 - fpu/softfloat.c | 7 --- 2 files changed, 8 deletions(-) diff --git

[Qemu-devel] [PATCH v3 3/3] tests/fp/fp-test: add floating point tests

2018-09-13 Thread Emilio G. Cota
By leveraging berkeley's softfloat and testfloat. With this we get decent coverage of softfloat.c: $ ./fp-test -r even:67.22% coverage $ ./fp-test -r all: 73.11% coverage Note that we do not yet test parts of softfloat.c that aren't in the original softfloat library, namely: - denormal

[Qemu-devel] [PATCH v3 2/3] gitmodules: add berkeley's softfloat + testfloat version 3

2018-09-13 Thread Emilio G. Cota
These are BSD-licensed so we can add them as submodules. Signed-off-by: Emilio G. Cota --- .gitmodules | 6 ++ tests/fp/berkeley-softfloat-3 | 1 + tests/fp/berkeley-testfloat-3 | 1 + 3 files changed, 8 insertions(+) create mode 16 tests/fp/berkeley-softfloat-3

[Qemu-devel] [PATCH v3 0/3] softfloat tests based on berkeley's testfloat

2018-09-13 Thread Emilio G. Cota
v2: https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg00927.html Changes: - Add a patch to remove an unused FP primitive (patch 1). This patch can be applied before patches 2 and 3. The gcov numbers quoted in patch 3 assume that patch 1 has been applied. - Rewrite fp-test.c from

Re: [Qemu-devel] [PATCH 2/3] display/edid: add region helper.

2018-09-13 Thread Philippe Mathieu-Daudé
On 9/12/18 2:36 PM, Gerd Hoffmann wrote: > Create a io region for an EDID data block. > > Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé > --- > include/hw/display/edid.h | 4 > hw/display/edid-region.c | 33 + >

Re: [Qemu-devel] [PATCH v3 2/2] 40p: add fixed IRQ routing for LSI SCSI device

2018-09-13 Thread Philippe Mathieu-Daudé
On 9/10/18 10:46 PM, Mark Cave-Ayland wrote: > Whilst the PReP specification describes how all PCI IRQs are routed via IRQ > 15 on the interrupt controller, the real 40p machine has a routing quirk in > that the LSI SCSI device is routed directly to IRQ 13. > > Enable the external IRQ for the LSI

Re: [Qemu-devel] [PATCH v2 12/17] mirror: Fix potential use-after-free in active commit

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > When starting an active commit job, other callbacks can run before > mirror_start_job() calls bdrv_ref() where needed and cause the nodes to > go away. Add another pair of bdrv_ref/unref() around it to protect > against this case. > > Signed-off-by: Kevin

Re: [Qemu-devel] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > Request callbacks can do pretty much anything, including operations that > will yield from the coroutine (such as draining the backend). In that > case, a decreased in_flight would be visible to other code and could > lead to a drain completing while the

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Max Reitz
On 13.09.18 22:01, Eric Blake wrote: > On 9/13/18 1:37 PM, Max Reitz wrote: >> On 13.09.18 19:05, Eric Blake wrote: [...] >>> $ qemu-io -c 'discard 0 1m' --image-opts >>> driver=qcow2,backing=,file.driver=file,file.filename=img.003 >>> warning: Use of "backing": "" is deprecated; use "backing":

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Eric Blake
On 9/13/18 2:41 PM, Max Reitz wrote: On 13.09.18 20:37, Max Reitz wrote: [...] Or, we would have to use backing=null, but for some reason that doesn't work. I'll have to investigate. Turns out this was fixed in e59a0cf17b1b9932b65e6fc25d6856976f5e4831. (Why does Fedora still have only

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Eric Blake
On 9/13/18 1:37 PM, Max Reitz wrote: On 13.09.18 19:05, Eric Blake wrote: [adding Markus, because of an interesting observation about --image-opts vs. JSON null - search for [1] below] On 9/13/18 8:22 AM, Max Reitz wrote: On 13.09.18 05:33, lampahome wrote: I split data to 3 chunks and save

Re: [Qemu-devel] [PATCH 1/2] blockdev-backup: add bitmap argument

2018-09-13 Thread John Snow
On 08/30/2018 05:16 PM, John Snow wrote: > It is only an oversight that we don't allow incremental backup with > blockdev-backup. Add the bitmap argument which enables this. > > Signed-off-by: John Snow > --- > blockdev.c | 16 +++- > qapi/block-core.json | 7 ++- >

Re: [Qemu-devel] [PATCH v2 10/17] block-backend: Fix potential double blk_delete()

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > blk_unref() first decreases the refcount of the BlockBackend and calls > blk_delete() if the refcount reaches zero. Requests can still be in > flight at this point, they are only drained during blk_delete(): > > At this point, arbitrary callbacks can run. If

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Max Reitz
On 13.09.18 20:37, Max Reitz wrote: [...] > Or, we would have to use backing=null, but for some reason that doesn't > work. I'll have to investigate. Turns out this was fixed in e59a0cf17b1b9932b65e6fc25d6856976f5e4831. (Why does Fedora still have only qemu 2.11?) > So rebase will need to

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Max Reitz
On 13.09.18 19:05, Eric Blake wrote: > [adding Markus, because of an interesting observation about --image-opts > vs. JSON null - search for [1] below] > > On 9/13/18 8:22 AM, Max Reitz wrote: >> On 13.09.18 05:33, lampahome wrote: >>> I split data to 3 chunks and save it in 3 independent backing

Re: [Qemu-devel] [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model

2018-09-13 Thread Halil Pasic
On 09/13/2018 07:15 PM, Tony Krowiak wrote: On 09/13/2018 01:02 PM, Tony Krowiak wrote: On 09/13/2018 02:29 AM, Christian Borntraeger wrote: On 09/13/2018 07:48 AM, Thomas Huth wrote: On 2018-09-12 22:08, Tony Krowiak wrote: From: Tony Krowiak Introduces the base object model for

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC

2018-09-13 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 02:24:52PM -0500, Brijesh Singh wrote: > > > On 09/12/2018 11:35 AM, Igor Mammedov wrote: > ... > > > > +/* > > > + * When interrupt remapping is enabled, Linux IOMMU driver also > > > checks > > > + * for special IVHD device (type IO-APIC), which is

Re: [Qemu-devel] [PATCH v2 06/17] job: Use AIO_WAIT_WHILE() in job_finish_sync()

2018-09-13 Thread Kevin Wolf
Am 13.09.2018 um 17:15 hat Paolo Bonzini geschrieben: > On 13/09/2018 14:52, Kevin Wolf wrote: > > Also, job_drain() without aio_poll() isn't necessarily enough to make > > progress on a job, it could depend on bottom halves to be executed. > > This is not changed by the patch though;

Re: [Qemu-devel] [PATCH v2 01/17] job: Fix missing locking due to mismerge

2018-09-13 Thread John Snow
On 09/13/2018 08:52 AM, Kevin Wolf wrote: > job_completed() had a problem with double locking that was recently > fixed independently by two different commits: > > "job: Fix nested aio_poll() hanging in job_txn_apply" > "jobs: add exit shim" > > One fix removed the first

Re: [Qemu-devel] [PATCH v2 08/17] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-13 Thread Kevin Wolf
Am 13.09.2018 um 17:17 hat Paolo Bonzini geschrieben: > On 13/09/2018 14:52, Kevin Wolf wrote: > > bdrv_do_drained_begin/end() assume that they are called with the > > AioContext lock of bs held. If we call drain functions from a coroutine > > with the AioContext lock held, we yield and schedule a

Re: [Qemu-devel] crashes with win2008 host

2018-09-13 Thread Andrew Baumann via Qemu-devel
Does this crash always happen at startup? Is it deterministic? c135 is STATUS_DLL_NOT_FOUND. I suspect ntdll is trying to demand-load another DLL to provide that API, and it is missing or corrupt on your Windows installation. BTW, you’ll probably get a better stack trace from a native

Re: [Qemu-devel] [PATCH v2 03/17] aio-wait: Increase num_waiters even in home thread

2018-09-13 Thread Kevin Wolf
Am 13.09.2018 um 17:11 hat Paolo Bonzini geschrieben: > On 13/09/2018 14:52, Kevin Wolf wrote: > > Even if AIO_WAIT_WHILE() is called in the home context of the > > AioContext, we still want to allow the condition to change depending on > > other threads as long as they kick the AioWait.

Re: [Qemu-devel] [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model

2018-09-13 Thread Tony Krowiak
On 09/13/2018 01:02 PM, Tony Krowiak wrote: On 09/13/2018 02:29 AM, Christian Borntraeger wrote: On 09/13/2018 07:48 AM, Thomas Huth wrote: On 2018-09-12 22:08, Tony Krowiak wrote: From: Tony Krowiak Introduces the base object model for virtualizing AP devices. Signed-off-by: Tony Krowiak

Re: [Qemu-devel] [PATCH v2] change get_image_size return type to int64_t

2018-09-13 Thread Eric Blake
On 9/13/18 5:07 AM, Li Zhijian wrote: Previously, if the size of initrd >=2G, qemu exits with error: root@haswell-OptiPlex-9020:/home/lizj# /home/lizhijian/lkp/qemu-colo/x86_64-softmmu/qemu-system-x86_64 -kernel ./vmlinuz-4.16.0-rc4 -initrd large.cgz -nographic qemu: error reading initrd

Re: [Qemu-devel] [PATCH] migration-test: Only generate a single target architecture

2018-09-13 Thread Eric Blake
On 9/13/18 8:23 AM, Juan Quintela wrote: Several changes: - We only allow generate header "inside" the tree. Why? Because we need to connit the result, so it makes no sense to generate them on s/connit/commit/ the build dir. - We only generate a single target each time. Getting all

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Eric Blake
[adding Markus, because of an interesting observation about --image-opts vs. JSON null - search for [1] below] On 9/13/18 8:22 AM, Max Reitz wrote: On 13.09.18 05:33, lampahome wrote: I split data to 3 chunks and save it in 3 independent backing files like below: img.000 <-- img.001 <--

Re: [Qemu-devel] [PATCH v6 21/25] replay: replay BH for IDE trim operation

2018-09-13 Thread John Snow
On 09/12/2018 04:19 AM, Pavel Dovgalyuk wrote: > This patch makes IDE trim BH deterministic, because it affects > the device state. Therefore its invocation should be replayed > instead of running at the random moment. > > Signed-off-by: Pavel Dovgalyuk > Reviewed-by: Paolo Bonzini > --- >

[Qemu-devel] crashes with win2008 host

2018-09-13 Thread KONRAD Frederic
Hi Andrey, I've strange crashes since this commit: (yes its old) commit 12f8def0e02232d7c6416ad9b66640f973c531d1 Author: Andrey Shedel Date: Fri Mar 24 15:01:41 2017 -0700 win32: replace custom mutex and condition variable with native primitives Basically it just crashes..

Re: [Qemu-devel] [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model

2018-09-13 Thread Tony Krowiak
On 09/13/2018 02:29 AM, Christian Borntraeger wrote: On 09/13/2018 07:48 AM, Thomas Huth wrote: On 2018-09-12 22:08, Tony Krowiak wrote: From: Tony Krowiak Introduces the base object model for virtualizing AP devices. Signed-off-by: Tony Krowiak --- [...] diff --git

Re: [Qemu-devel] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-13 Thread Kevin Wolf
Am 13.09.2018 um 17:10 hat Paolo Bonzini geschrieben: > On 13/09/2018 14:52, Kevin Wolf wrote: > > + if (qemu_get_current_aio_context() == qemu_get_aio_context()) { > > + /* If we are in the main thread, the callback is allowed to unref > > + * the BlockBackend, so we have to hold an additional

Re: [Qemu-devel] [PATCH v2] blkdebug: Add support for latency rules

2018-09-13 Thread Marc Olson via Qemu-devel
Are there further thoughts on this patch? On 09/04/2018 05:24 PM, Marc Olson wrote: Sometimes storage devices can be slow to respond, due to media errors, firmware issues, SSD garbage collection, etc. This patch adds a new rule type to blkdebug that allows injection of latency to I/O

Re: [Qemu-devel] [PULL 12/12] tests/migration: Enable the migration test on s390x, too

2018-09-13 Thread Juan Quintela
Thomas Huth wrote: > On 2018-09-13 14:53, Juan Quintela wrote: >> From: Thomas Huth >> >> We can re-use the s390-ccw bios code to implement a small firmware >> for a s390x guest which prints out the "A" and "B" characters and >> modifies the memory, as required for the migration test. >> >>

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] virtio-scsi/virtio-blk: Disable poll handlers when stopping vq handler

2018-09-13 Thread Alex Williamson
On Thu, 13 Sep 2018 12:04:34 +0200 Paolo Bonzini wrote: > On 13/09/2018 11:11, Paolo Bonzini wrote: > > On 13/09/2018 08:03, Fam Zheng wrote: > >> On Wed, 09/12 14:42, Paolo Bonzini wrote: > >>> On 12/09/2018 13:50, Fam Zheng wrote: > > I think it's okay if it is invoked. The sequence

[Qemu-devel] [PATCH v4 3/3] hw/arm/virt: Allow dynamic vfio-platform devices again

2018-09-13 Thread Geert Uytterhoeven
Allow the instantation of generic dynamic vfio-platform devices again, without the need to create a new device-specific vfio type. This is more or less a partial revert of commit 6f2062b9758ebc64 ("hw/arm/virt: Allow only supported dynamic sysbus devices"). Signed-off-by: Geert Uytterhoeven ---

[Qemu-devel] [PATCH v4 1/3] vfio/platform: Make the vfio-platform device non-abstract

2018-09-13 Thread Geert Uytterhoeven
From: Auger Eric Up to now the vfio-platform device has been abstract and could not be instantiated. The integration of a new vfio platform device required creating a dummy derived device which only set the compatible string. Following the few vfio-platform device integrations we have seen the

[Qemu-devel] [PATCH v4 0/3] vfio/sysbus-fdt: Prepare for Generic DT Pass-Through

2018-09-13 Thread Geert Uytterhoeven
Hi all, This patch series prepares for exporting generic devices in DT using vfio-platform, providing direct access from a QEMU+KVM guest to the exported devices. - Patches 1-2 (submitted before by Eric Auger) make the vfio-platform device non-abstract, incl. matching using a

[Qemu-devel] [PATCH v4 2/3] hw/arm/sysbus-fdt: Allow device matching with DT compatible value

2018-09-13 Thread Geert Uytterhoeven
From: Auger Eric Up to now we have relied on the device type to identify a device tree node creation function. Since we would like the vfio-platform device to be instantiatable with different compatible strings we introduce the capability to specialize the node creation depending on actual

Re: [Qemu-devel] [PATCH v2 3/3] 40p: add fixed IRQ routing for LSI SCSI device

2018-09-13 Thread Mark Cave-Ayland
On 13/09/18 15:21, Artyom Tarasenko wrote: > On Sat, Sep 8, 2018 at 11:11 AM Mark Cave-Ayland > wrote: >> >> Whilst the PReP specification describes how all PCI IRQs are routed via IRQ >> 15 on the interrupt controller, the real 40p machine has routing quirk in >> that the LSI SCSI device is

Re: [Qemu-devel] [Qemu-block] [PATCH] block/linux-aio: acquire AioContext before qemu_laio_process_completions

2018-09-13 Thread Paolo Bonzini
On 05/09/2018 13:23, Sergio Lopez wrote: > diff --git a/block/linux-aio.c b/block/linux-aio.c > index 19eb922fdd..217ce60138 100644 > --- a/block/linux-aio.c > +++ b/block/linux-aio.c > @@ -234,9 +234,9 @@ static void qemu_laio_process_completions(LinuxAioState > *s) > > static void

Re: [Qemu-devel] [PATCH v2 10/17] block-backend: Fix potential double blk_delete()

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 14:52, Kevin Wolf wrote: > blk_unref() first decreases the refcount of the BlockBackend and calls > blk_delete() if the refcount reaches zero. Requests can still be in > flight at this point, they are only drained during blk_delete(): > > At this point, arbitrary callbacks can run.

Re: [Qemu-devel] [PATCH v2 08/17] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 14:52, Kevin Wolf wrote: > bdrv_do_drained_begin/end() assume that they are called with the > AioContext lock of bs held. If we call drain functions from a coroutine > with the AioContext lock held, we yield and schedule a BH to move out of > coroutine context. This means that the

Re: [Qemu-devel] [PATCH v2 06/17] job: Use AIO_WAIT_WHILE() in job_finish_sync()

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 14:52, Kevin Wolf wrote: > Also, job_drain() without aio_poll() isn't necessarily enough to make > progress on a job, it could depend on bottom halves to be executed. This is not changed by the patch though; AIO_WAIT_WHILE does not do the bottom halves part anymore,

Re: [Qemu-devel] [PATCH v2 03/17] aio-wait: Increase num_waiters even in home thread

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 14:52, Kevin Wolf wrote: > Even if AIO_WAIT_WHILE() is called in the home context of the > AioContext, we still want to allow the condition to change depending on > other threads as long as they kick the AioWait. Specfically block jobs > can be running in an I/O thread and should

Re: [Qemu-devel] [PATCH 5/8] hw: designware: add read memory region callback

2018-09-13 Thread Paolo Bonzini
On 12/09/2018 18:01, Li Qiang wrote: > From: Li Qiang > > Signed-off-by: Li Qiang > --- > hw/pci-host/designware.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c > index 29ea313798..f5641b5c8c 100644 > ---

Re: [Qemu-devel] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 14:52, Kevin Wolf wrote: > + if (qemu_get_current_aio_context() == qemu_get_aio_context()) { > + /* If we are in the main thread, the callback is allowed to unref > + * the BlockBackend, so we have to hold an additional reference */ > + blk_ref(acb->rwco.blk); > + } >

Re: [Qemu-devel] [PULL 12/12] tests/migration: Enable the migration test on s390x, too

2018-09-13 Thread Thomas Huth
On 2018-09-13 14:53, Juan Quintela wrote: > From: Thomas Huth > > We can re-use the s390-ccw bios code to implement a small firmware > for a s390x guest which prints out the "A" and "B" characters and > modifies the memory, as required for the migration test. > > Signed-off-by: Thomas Huth >

Re: [Qemu-devel] [PATCH v2 09/17] block-backend: Add .drained_poll callback

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > A bdrv_drain operation must ensure that all parents are quiesced, this > includes BlockBackends. Otherwise, callbacks called by requests that are > completed on the BDS layer, but not quite yet on the BlockBackend layer > could still create new requests. > >

Re: [Qemu-devel] [PATCH v2] change get_image_size return type to int64_t

2018-09-13 Thread Richard Henderson
On 09/13/2018 03:07 AM, Li Zhijian wrote: > Previously, if the size of initrd >=2G, qemu exits with error: > root@haswell-OptiPlex-9020:/home/lizj# > /home/lizhijian/lkp/qemu-colo/x86_64-softmmu/qemu-system-x86_64 -kernel > ./vmlinuz-4.16.0-rc4 -initrd large.cgz -nographic > qemu: error reading

Re: [Qemu-devel] [PATCH v2 08/17] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > bdrv_do_drained_begin/end() assume that they are called with the > AioContext lock of bs held. If we call drain functions from a coroutine > with the AioContext lock held, we yield and schedule a BH to move out of > coroutine context. This means that the lock

Re: [Qemu-devel] [Qemu-block] [PATCH] util/async: use qemu_aio_coroutine_enter in co_schedule_bh_cb

2018-09-13 Thread Paolo Bonzini
On 05/09/2018 11:33, Sergio Lopez wrote: > AIO Coroutines shouldn't by managed by an AioContext different than the > one assigned when they are created. aio_co_enter avoids entering a > coroutine from a different AioContext, calling aio_co_schedule instead. > > Scheduled coroutines are then

Re: [Qemu-devel] [PATCH v8 1/2] vl.c deprecate incorrect CPUs topology

2018-09-13 Thread Eric Blake
On 9/13/18 6:06 AM, Igor Mammedov wrote: -smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with

Re: [Qemu-devel] [PATCH V1 RESEND 6/6] hmat acpi: Implement _HMA method to update HMAT at runtime

2018-09-13 Thread Liu, Jingqi
On Thursday, September 13, 2018 7:38 PM, Igor Mammedov wrote: > On Wed, 12 Sep 2018 01:12:43 + > "Liu, Jingqi" wrote: > > > On Monday, July 16, 2018 8:29 PM, Igor Mammedov > wrote: > > > On Tue, 19 Jun 2018 23:20:57 +0800 > > > Liu Jingqi wrote: > > > > > > > OSPM evaluates HMAT only

Re: [Qemu-devel] [PATCH V12-fix 01/19] filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table

2018-09-13 Thread Eric Blake
On 9/12/18 11:52 PM, Zhang Chen wrote: We add almost full TCP state machine in filter-rewriter, except TCPS_LISTEN and some simplify in VM active close FIN states. The reason for this simplify job is because guest kernel will track the TCP status and wait 2MSL time too, if client resend the FIN

Re: [Qemu-devel] [PATCH 2/6] x86_iommu/amd: Prepare for interrupt remap support

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 10:15, Suravee Suthikulpanit wrote: > However, if you prefer to keep this option, > we probably should rename this to "intremap_sup", in which if the > default value should be 1. The main reason to have the property and to leave it off by default is that it is incompatible with

Re: [Qemu-devel] What kind of situation to use internal or external snapshot?

2018-09-13 Thread Eric Blake
On 9/12/18 8:33 PM, lampahome wrote: In general, we've spent more resources developing external snapshots. So if you want the most support and the fastest response on resolving any issues that you may encounter, external snapshots are the way to go. So internal snapshot is hard to use than

Re: [Qemu-devel] [PATCH v2 06/17] job: Use AIO_WAIT_WHILE() in job_finish_sync()

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > job_finish_sync() needs to release the AioContext lock of the job before > calling aio_poll(). Otherwise, callbacks called by aio_poll() would > possibly take the lock a second time and run into a deadlock with a > nested AIO_WAIT_WHILE() call. > > Also,

Re: [Qemu-devel] [PATCH v2] change get_image_size return type to int64_t

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 12:07, Li Zhijian wrote: > Previously, if the size of initrd >=2G, qemu exits with error: > root@haswell-OptiPlex-9020:/home/lizj# > /home/lizhijian/lkp/qemu-colo/x86_64-softmmu/qemu-system-x86_64 -kernel > ./vmlinuz-4.16.0-rc4 -initrd large.cgz -nographic > qemu: error reading

Re: [Qemu-devel] [PATCH] memory: cleanup side effects of memory_region_init_foo() on failure

2018-09-13 Thread Paolo Bonzini
On 04/09/2018 14:39, Igor Mammedov wrote: > if MemoryRegion intialization fails it's left in semi-initialized state, > where it's size is not 0 and attached as child to owner object. > And this leds to crash in following use-case: > (monitor) object_add >

Re: [Qemu-devel] [qemu-s390x] [RFC 08/15] s390-bios: Map low core memory

2018-09-13 Thread Jason J. Herne
On 09/13/2018 01:25 AM, Thomas Huth wrote: On 2018-09-10 16:17, Jason J. Herne wrote: On 07/17/2018 02:10 PM, Thomas Huth wrote: On 05.07.2018 19:25, Jason J. Herne wrote: From: "Jason J. Herne" ... The names of the fields look exactly the same as in the Linux kernel ... maybe credit them

Re: [Qemu-devel] [PATCH v2 02/17] blockjob: Wake up BDS when job becomes idle

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > In the context of draining a BDS, the .drained_poll callback of block > jobs is called. If this returns true (i.e. there is still some activity > pending), the drain operation may call aio_poll() with blocking=true to > wait for completion. > > As soon as

Re: [Qemu-devel] [PATCH v3 12/13] target/i386: move x86_64_hregs to DisasContext

2018-09-13 Thread Alex Bennée
Emilio G. Cota writes: > And convert it to a bool to use an existing hole > in the struct. > > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > target/i386/translate.c | 307 > 1 file changed, 154 insertions(+), 153 deletions(-) > >

Re: [Qemu-devel] [PATCH v3 04/13] target/i386: move cpu_T1 to DisasContext

2018-09-13 Thread Alex Bennée
Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > target/i386/translate.c | 341 > 1 file changed, 170 insertions(+), 171 deletions(-) > > diff --git a/target/i386/translate.c b/target/i386/translate.c > index

Re: [Qemu-devel] [PATCH v3 03/13] target/i386: move cpu_T0 to DisasContext

2018-09-13 Thread Alex Bennée
Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > target/i386/translate.c | 1174 --- > 1 file changed, 594 insertions(+), 580 deletions(-) > > diff --git a/target/i386/translate.c b/target/i386/translate.c > index

Re: [Qemu-devel] [PATCH v3 02/13] target/i386: move cpu_A0 to DisasContext

2018-09-13 Thread Alex Bennée
Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > target/i386/translate.c | 472 > 1 file changed, 236 insertions(+), 236 deletions(-) > > diff --git a/target/i386/translate.c b/target/i386/translate.c > index

Re: [Qemu-devel] [PATCH v3 01/13] target/i386: move cpu_cc_srcT to DisasContext

2018-09-13 Thread Alex Bennée
Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > target/i386/translate.c | 32 ++-- > 1 file changed, 18 insertions(+), 14 deletions(-) > > diff --git a/target/i386/translate.c b/target/i386/translate.c > index

Re: [Qemu-devel] [PATCH v2 3/3] 40p: add fixed IRQ routing for LSI SCSI device

2018-09-13 Thread Artyom Tarasenko
On Sat, Sep 8, 2018 at 11:11 AM Mark Cave-Ayland wrote: > > Whilst the PReP specification describes how all PCI IRQs are routed via IRQ > 15 on the interrupt controller, the real 40p machine has routing quirk in > that the LSI SCSI device is routed to IRQ 13. Is it a routing quirk or does 40p

Re: [Qemu-devel] [qemu-s390x] [PATCH v8 6/6] s390: doc: detailed specifications for AP virtualization

2018-09-13 Thread Tony Krowiak
On 09/13/2018 02:06 AM, Thomas Huth wrote: On 2018-09-12 22:08, Tony Krowiak wrote: This patch provides documentation describing the AP architecture and design concepts behind the virtualization of AP devices. It also includes an example of how to configure AP devices for exclusive use of KVM

Re: [Qemu-devel] [PATCH v2 01/17] job: Fix missing locking due to mismerge

2018-09-13 Thread Max Reitz
On 13.09.18 14:52, Kevin Wolf wrote: > job_completed() had a problem with double locking that was recently > fixed independently by two different commits: > > "job: Fix nested aio_poll() hanging in job_txn_apply" > "jobs: add exit shim" > > One fix removed the first aio_context_acquire(), the

Re: [Qemu-devel] [qemu-s390x] [PATCH v8 3/6] s390x/kvm: enable/disable AP instruction interpretation for guest

2018-09-13 Thread Tony Krowiak
On 09/13/2018 01:28 AM, Thomas Huth wrote: On 2018-09-12 22:08, Tony Krowiak wrote: From: Tony Krowiak Let's use the KVM_SET_DEVICE_ATTR ioctl to enable or disable hardware interpretation of AP instructions executed on the guest. If the S390_FEAT_AP feature is installed, AP instructions will

Re: [Qemu-devel] [PATCH v6 00/25] Fixing record/replay and adding reverse debugging

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 15:40, Pavel Dovgalyuk wrote: >> For now I'm queuing 12, 14, 19, 20 (pending question to you) and 23-25. > What about patch 21? I'd want an ACK from the IDE maintainer. Let's add him to Cc. Paolo

Re: [Qemu-devel] [PATCH v6 22/25] replay: add BH oneshot event for block layer

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 13:13, Pavel Dovgalyuk wrote: >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] >> On 12/09/2018 10:19, Pavel Dovgalyuk wrote: >>> + uint64_t id = replay_get_current_step(); >>> + replay_add_event(REPLAY_ASYNC_EVENT_BH_ONESHOT, cb, opaque, id); >> >> Why does it need an id, while

Re: [Qemu-devel] [PATCH v6 00/25] Fixing record/replay and adding reverse debugging

2018-09-13 Thread Pavel Dovgalyuk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 12/09/2018 10:17, Pavel Dovgalyuk wrote: > > GDB remote protocol supports reverse debugging of the targets. > > It includes 'reverse step' and 'reverse continue' operations. > > The first one finds the previous step of the execution, > > and

Re: [Qemu-devel] [PULL 0/5] Migration queue

2018-09-13 Thread Juan Quintela
Juan Quintela wrote: > The following changes since commit 19b599f7664b2ebfd0f405fb79c14dd241557452: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-08-27-v2' > into staging (2018-08-27 16:44:20 +0100) > > are available in the Git repository at: > >

Re: [Qemu-devel] [PATCH v3 09/10] block: Allow changing 'detect-zeroes' on reopen

2018-09-13 Thread Max Reitz
On 06.09.18 11:37, Alberto Garcia wrote: > 'detect-zeroes' is one of the basic BlockdevOptions available for all > drivers, but it's not handled by bdrv_reopen_prepare(), so any attempt > to change it results in an error: > >(qemu) qemu-io virtio0 "reopen -o detect-zeroes=on" >Cannot

Re: [Qemu-devel] [PATCH v3 08/10] block: Allow changing 'discard' on reopen

2018-09-13 Thread Max Reitz
On 06.09.18 11:37, Alberto Garcia wrote: > 'discard' is one of the basic BlockdevOptions available for all > drivers, but it's not handled by bdrv_reopen_prepare() so any attempt > to change it results in an error: > >(qemu) qemu-io virtio0 "reopen -o discard=on" >Cannot change the option

Re: [Qemu-devel] [PATCH v6 0/3] migration: compression optimization

2018-09-13 Thread Juan Quintela
Xiao Guangrong wrote: > On 09/06/2018 07:03 PM, Juan Quintela wrote: >> guangrong.x...@gmail.com wrote: >>> From: Xiao Guangrong >>> >>> Changelog in v6: >>> >>> Thanks to Juan's review, in this version we >>> 1) move flush compressed data to find_dirty_block() where it hits the end >>> of

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread Max Reitz
On 13.09.18 05:33, lampahome wrote: > I split data to 3 chunks and save it in 3 independent backing files like > below: > img.000 <-- img.001 <-- img.002 > img.000 is the backing file of img.001 and 001 is the backing file of 002. > img.000 saves the 1st chunk of data and img.001 saves the 2nd

[Qemu-devel] [PATCH] migration-test: Only generate a single target architecture

2018-09-13 Thread Juan Quintela
Several changes: - We only allow generate header "inside" the tree. Why? Because we need to connit the result, so it makes no sense to generate them on the build dir. - We only generate a single target each time. Getting all the cross-compilers correctly is an impossible task. So know

[Qemu-devel] [PULL 11/12] tests: Add migration test for aarch64

2018-09-13 Thread Juan Quintela
From: Wei Huang This patch adds migration test support for aarch64. The test code, which implements the same functionality as x86, is booted as a kernel in qemu. Here are the design choices we make for aarch64: * We choose this -kernel approach because aarch64 QEMU doesn't provide a

[Qemu-devel] [PULL 12/12] tests/migration: Enable the migration test on s390x, too

2018-09-13 Thread Juan Quintela
From: Thomas Huth We can re-use the s390-ccw bios code to implement a small firmware for a s390x guest which prints out the "A" and "B" characters and modifies the memory, as required for the migration test. Signed-off-by: Thomas Huth Message-Id:

  1   2   >