Re: [Qemu-devel] [PATCH] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt

2018-09-13 Thread Greg Kurz
On Thu, 13 Sep 2018 07:16:05 +0200 Cédric Le Goater wrote: > So that we don't have to call qdev_get_machine() to get the machine > class and the sPAPRIrq backend holding the number of MSIs. > > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > include/hw/pci-host/spapr.h | 5

Re: [Qemu-devel] [PATCH V1 RESEND 1/6] hmat acpi: Build Memory Subsystem Address Range Structure(s) in ACPI HMAT

2018-09-13 Thread Liu, Jingqi
On Wednesday, September 12, 2018 10:34 PM, Eric Blake wrote: > On 7/16/18 6:54 AM, Igor Mammedov wrote: > > >> + > >> +#include "unistd.h" > >> +#include "fcntl.h" > >> +#include "qemu/osdep.h" > >> +#include "sysemu/numa.h" > >> +#include "hw/i386/pc.h" > >> +#include "hw/i386/acpi-build.h" > >>

Re: [Qemu-devel] [PATCH 2/3] aio-posix: compute timeout before polling

2018-09-13 Thread Fam Zheng
On Wed, 09/12 19:10, Paolo Bonzini wrote: > This is a preparation for the next patch, and also a very small > optimization. Compute the timeout only once, before invoking > try_poll_mode, and adjust it in run_poll_handlers. The adjustment > is the polling time when polling fails, or zero

Re: [Qemu-devel] [PATCH] qemu: Add virtio pmem device

2018-09-13 Thread Pankaj Gupta
> > > This patch adds virtio-pmem Qemu device. > > > > This device presents memory address range information to guest > > which is backed by file backend type. It acts like persistent > > memory device for KVM guest. Guest can perform read and > > persistent write operations on this

Re: [Qemu-devel] [PATCH 6/6] x86_iommu/amd: Enable Guest virtual APIC support

2018-09-13 Thread Suravee Suthikulpanit
Peter, On 9/12/18 11:52 AM, Peter Xu wrote: On Tue, Sep 11, 2018 at 11:49:49AM -0500, Brijesh Singh wrote: Now that amd-iommu support interrupt remapping, enable the GASup in IVRS table and GASup in extended feature register to indicate that IOMMU support guest virtual APIC mode. Note that

Re: [Qemu-devel] [PATCH 3/3] aio-posix: do skip system call if ctx->notifier polling succeeds

2018-09-13 Thread Fam Zheng
On Wed, 09/12 19:10, Paolo Bonzini wrote: > Commit 70232b5253 ("aio-posix: Don't count ctx->notifier as progress when > 2018-08-15), by not reporting progress, causes aio_poll to execute the > system call when polling succeeds because of ctx->notifier. This introduces > latency before the call to

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

2018-09-13 Thread Fam Zheng
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 is first you stop the > >> vq, then you drain the BlockBackends, then you switch AioContext. All > >> that matters is the outcome when

Re: [Qemu-devel] [PATCH 1/3] spapr: introduce a spapr_irq class 'nr_msis' attribute

2018-09-13 Thread David Gibson
On Tue, Sep 11, 2018 at 06:41:24AM +0200, Cédric Le Goater wrote: > On 09/11/2018 03:48 AM, David Gibson wrote: > > On Mon, Sep 10, 2018 at 01:02:20PM +0200, Cédric Le Goater wrote: > > 11;rgb://> The number of MSI interrupts a sPAPR machine can > > allocate is in direct > >> relation

Re: [Qemu-devel] [PATCH] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt

2018-09-13 Thread David Gibson
On Thu, Sep 13, 2018 at 07:16:05AM +0200, Cédric Le Goater wrote: > So that we don't have to call qdev_get_machine() to get the machine > class and the sPAPRIrq backend holding the number of MSIs. > > Signed-off-by: Cédric Le Goater Applied, thanks. > --- > include/hw/pci-host/spapr.h | 5

Re: [Qemu-devel] [PATCH 5/6] x86_iommu/amd: Add interrupt remap support when VAPIC is enabled

2018-09-13 Thread Suravee Suthikulpanit
Brijesh, On 9/11/18 11:49 PM, Brijesh Singh wrote: Emulate the interrupt remapping support when guest virtual APIC is enabled. See IOMMU spec:https://support.amd.com/TechDocs/48882_IOMMU.pdf (section 2.2.5.2) for details information. When VAPIC is enabled, it uses interrupt remapping as

Re: [Qemu-devel] [PATCH 3/3] display/stdvga: add edid support.

2018-09-13 Thread Gerd Hoffmann
> > --- a/docs/specs/standard-vga.txt > > +++ b/docs/specs/standard-vga.txt > > @@ -61,7 +61,7 @@ MMIO area spec > > Likewise applies to the pci variant only for obvious reasons. > > - - 03ff : reserved, for possible virtio extension. > > + - 03ff : edid data blob. > > > > +if

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

2018-09-13 Thread Xiao Guangrong
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 memblock 2) use save_page_use_compression instead

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

2018-09-13 Thread Thomas Huth
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 guests. > > Signed-off-by: Tony

[Qemu-devel] [Bug 588691] Re: QEMU is not correctly detecting host CDs

2018-09-13 Thread Thomas Huth
OK, thanks for the confirmation, John, so seems like this bug has been fixed in the past and we can close it now. ** Changed in: qemu Status: Incomplete => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

Re: [Qemu-devel] [PATCH] hw/arm/virt-acpi-build: Add a check for memory-less NUMA nodes

2018-09-13 Thread Andrew Jones
On Tue, Sep 11, 2018 at 07:26:43PM +0800, Shannon Zhao wrote: > From: Shannon Zhao > > Like commit 16b4226(hw/acpi-build: Add a check for memory-less NUMA node > ), it also needs to check memory length for NUMA nodes on ARM. > > Signed-off-by: Shannon Zhao > --- > hw/arm/virt-acpi-build.c |

Re: [Qemu-devel] [PATCH V12 00/19] COLO: integrate colo frame with block replication and COLO proxy

2018-09-13 Thread Zhang Chen
On Thu, Sep 13, 2018 at 11:10 AM Zhang Chen wrote: > > > On Wed, Sep 12, 2018 at 3:50 PM Jason Wang wrote: > >> >> >> On 2018年09月10日 16:16, Zhang Chen wrote: >> > Hi All. >> > Have any comments? >> > Ping... >> > >> > Thanks >> > Zhang Chen >> >> I've queued them with some tweaks on the commit

Re: [Qemu-devel] [PATCH 3/3] virtio-pmem: Add virtio pmem driver

2018-09-13 Thread Pankaj Gupta
Hi Luiz, Thanks for the review. > > > This patch adds virtio-pmem driver for KVM guest. > > > > Guest reads the persistent memory range information from > > Qemu over VIRTIO and registers it on nvdimm_bus. It also > > creates a nd_region object with the persistent memory > > range

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

2018-09-13 Thread Christian Borntraeger
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 a/hw/s390x/ap-bridge.c b/hw/s390x/ap-bridge.c >> new

Re: [Qemu-devel] [PATCH 1/3] aio-posix: fix concurrent access to poll_disable_cnt

2018-09-13 Thread Fam Zheng
On Wed, 09/12 19:10, Paolo Bonzini wrote: > It is valid for an aio_set_fd_handler to happen concurrently with > aio_poll. In that case, poll_disable_cnt can change under the heels > of aio_poll, and the assertion on poll_disable_cnt can fail in > run_poll_handlers. > > Therefore, this patch

[Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-13 Thread Peter Xu
There are two callers for vtd_sync_shadow_page_table_range(), one provided a valid context entry and one not. Move that fetching operation into the caller vtd_sync_shadow_page_table() where we need to fetch the context entry. Meanwhile, we should handle VTD_FR_CONTEXT_ENTRY_P properly when

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

2018-09-13 Thread Christian Borntraeger
On 09/13/2018 08:29 AM, Christian Borntraeger wrote: >>> +++ b/hw/s390x/ap-bridge.c >> [...] >>> +void s390_init_ap(void) >>> +{ >>> +DeviceState *dev; >>> + >>> +/* Create bridge device */ >>> +dev = qdev_create(NULL, TYPE_AP_BRIDGE); >>> +

Re: [Qemu-devel] [RFC PATCH v2 2/7] Add plugin support

2018-09-13 Thread Pavel Dovgalyuk
> From: Alex Bennée [mailto:alex.ben...@linaro.org] > Pavel Dovgalyuk writes: > > > This patch adds support for dynamically loaded plugins. > > Every plugin is a dynamic library with a set of optional exported > > functions that will be called from QEMU. > > > > Signed-off-by: Pavel Dovgalyuk >

Re: [Qemu-devel] [RFC PATCH v2 4/7] tcg: add instrumenting module

2018-09-13 Thread Pavel Dovgalyuk
> From: Alex Bennée [mailto:alex.ben...@linaro.org] > Pavel Dovgalyuk writes: > > > From: Pavel Dovgalyuk > > > > This is a samples of the instrumenting interface and implementation > > of some instruction tracing tasks. > > > > Signed-off-by: Pavel Dovgalyuk > > --- > >

Re: [Qemu-devel] [PATCH v2] vmdk: align end of file to a sector boundary

2018-09-13 Thread yuchenlin via Qemu-devel
On 2018-09-13 10:54, Fam Zheng wrote: On Thu, 09/13 10:31, yuchen...@synology.com wrote: From: yuchenlin There is a rare case which the size of last compressed cluster is larger than the cluster size, which will cause the file is not aligned at the sector boundary. The code looks good to

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

2018-09-13 Thread Suravee Suthikulpanit
Brijesh / Peter, On 9/13/18 10:15 AM, Peter Xu wrote: On Wed, Sep 12, 2018 at 01:59:06PM -0500, Brijesh Singh wrote: [...] } return _as[devfn]->as; } @@ -1172,6 +1274,10 @@ static void amdvi_realize(DeviceState *dev, Error **err) return; } +/* Pseudo

Re: [Qemu-devel] [Qemu-block] [PATCH 1/3] aio-posix: fix concurrent access to poll_disable_cnt

2018-09-13 Thread Fam Zheng
On Thu, 09/13 10:29, Paolo Bonzini wrote: > On 13/09/2018 08:56, Fam Zheng wrote: > >> +/* No need to order poll_disable_cnt writes against other updates; > >> + * the counter is only used to avoid wasting time and latency on > >> + * iterated polling when the system call will be

Re: [Qemu-devel] [PATCH] input-linux: customizable grab toggle keys v3

2018-09-13 Thread Gerd Hoffmann
On Mon, Sep 03, 2018 at 04:32:10PM +, Ryan El Kochta wrote: > This patch adds a new option to the input-linux object: > > grab_toggle=key-key-key "grab-toggle" (no underscore) please. I'm still not convinced we need that much flexibility. I would go for a fixed list of combinations.

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

2018-09-13 Thread Paolo Bonzini
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 is first you stop the vq, then you drain the BlockBackends, then you switch AioContext. All that matters is

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

2018-09-13 Thread Paolo Bonzini
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 the second one is intended to stop at the last breakpoint

Re: [Qemu-devel] [PATCH 6/6] x86_iommu/amd: Enable Guest virtual APIC support

2018-09-13 Thread Suravee Suthikulpanit
Brijesh/Peter, On 9/13/18 4:14 AM, Brijesh Singh wrote: On 09/11/2018 11:52 PM, Peter Xu wrote: ... diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 5c2c638..1cbc8ba 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2565,7 +2565,8 @@ build_amd_iommu(GArray

Re: [Qemu-devel] [PATCH v3] vmdk: align end of file to a sector boundary

2018-09-13 Thread Fam Zheng
On Thu, 09/13 16:29, yuchen...@synology.com wrote: > From: yuchenlin > > There is a rare case which the size of last compressed cluster > is larger than the cluster size, which will cause the file is > not aligned at the sector boundary. > > There are three reasons to do it. First, if vmdk

Re: [Qemu-devel] [PATCH v2 2/4] ui/vnc.c: polish vnc_init_func

2018-09-13 Thread Fei Li
On 09/12/2018 03:57 PM, Fam Zheng wrote: On Fri, 09/07 21:39, Fei Li wrote: Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let the call trace propagate the Error. Besides, make

[Qemu-devel] [Bug 1792193] Re: AMD Athlon(tm) X2 Dual-Core QL-64 bug

2018-09-13 Thread Dr. David Alan Gilbert
Hi Kirill, That's a bit tricky to debug; could you build qemu from git and try and bisect between 2.12.0 and 3.0 to see which commit broke it? -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1792193

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

2018-09-13 Thread Paolo Bonzini
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 is first you stop the > vq, then you drain the BlockBackends, then

Re: [Qemu-devel] [PATCH v6 20/25] replay: wake up vCPU when replaying

2018-09-13 Thread Paolo Bonzini
On 12/09/2018 10:19, Pavel Dovgalyuk wrote: > This patch tries to wake up the vCPU when it sleeps and the icount warp > checkpoint isn't met. It means that vCPU has something to do, because > there are no other reasons of non-matching warp checkpoint. What happens if !replay_has_checkpoint()?

Re: [Qemu-devel] [PATCH 9/9] hostmem-ram: use whole path for memory region name with >= 3.1

2018-09-13 Thread Dr. David Alan Gilbert
* Marc-André Lureau (marcandre.lur...@redhat.com) wrote: > hostmem-file and hostmem-memfd use the whole object path for the > memory region name, but hostname-ram uses only the path component (the > basename): > > qemu -m 1024 -object memory-backend-ram,id=mem,size=1G -numa node,memdev=mem >

Re: [Qemu-devel] [PATCH 8/8] exec: add read callback for notdirty memory region

2018-09-13 Thread Paolo Bonzini
On 12/09/2018 18:01, Li Qiang wrote: > From: Li Qiang > > Signed-off-by: Li Qiang This cannot happen, since TLB_NOTDIRTY is only added to the addr_write member (see accel/tcg/cputlb.c). Paolo > --- > exec.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/exec.c b/exec.c >

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-13 Thread Maxime Coquelin
Hi Peter, On 09/13/2018 09:55 AM, Peter Xu wrote: There are two callers for vtd_sync_shadow_page_table_range(), one provided a valid context entry and one not. Move that fetching operation into the caller vtd_sync_shadow_page_table() where we need to fetch the context entry. Meanwhile, we

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-13 Thread Peter Xu
On Thu, Sep 13, 2018 at 10:16:20AM +0200, Maxime Coquelin wrote: > Hi Peter, > > On 09/13/2018 09:55 AM, Peter Xu wrote: > > There are two callers for vtd_sync_shadow_page_table_range(), one > > provided a valid context entry and one not. Move that fetching > > operation into the caller

Re: [Qemu-devel] [PATCH v2 1/4] Fix segmentation fault when qemu_signal_init fails

2018-09-13 Thread Fei Li
On 09/12/2018 03:55 PM, Fam Zheng wrote: On Fri, 09/07 21:38, Fei Li wrote: Currently, when qemu_signal_init() fails it only returns a non-zero value but without propagating any Error. But its callers need a non-null err when runs error_report_err(err), or else 0->msg occurs. To avoid such

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

2018-09-13 Thread Peter Xu
On Thu, Sep 13, 2018 at 03:15:27PM +0700, Suravee Suthikulpanit wrote: > Brijesh / Peter, > > On 9/13/18 10:15 AM, Peter Xu wrote: > > On Wed, Sep 12, 2018 at 01:59:06PM -0500, Brijesh Singh wrote: > > > > [...] > > > > > > >} > > > > >return _as[devfn]->as; > > > > >} > > >

Re: [Qemu-devel] [PATCH v2 1/4] Fix segmentation fault when qemu_signal_init fails

2018-09-13 Thread Fam Zheng
On Thu, 09/13 16:46, Fei Li wrote: > > > On 09/12/2018 03:55 PM, Fam Zheng wrote: > > On Fri, 09/07 21:38, Fei Li wrote: > > > Currently, when qemu_signal_init() fails it only returns a non-zero > > > value but without propagating any Error. But its callers need a > > > non-null err when runs

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

2018-09-13 Thread Li Zhijian
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 large.cgz: No such file or directory

Re: [Qemu-devel] [PATCH v2 4/4] qemu_thread_create: propagate the error to callers to handle

2018-09-13 Thread Fei Li
On 09/12/2018 04:20 PM, Fam Zheng wrote: On Fri, 09/07 21:39, Fei Li wrote: Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the error message and let the callers handle it. Besides, directly return

Re: [Qemu-devel] [PATCH v2] vmdk: align end of file to a sector boundary

2018-09-13 Thread Fam Zheng
On Thu, 09/13 15:47, yuchenlin wrote: > On 2018-09-13 10:54, Fam Zheng wrote: > > On Thu, 09/13 10:31, yuchen...@synology.com wrote: > > > From: yuchenlin > > > > > > There is a rare case which the size of last compressed cluster > > > is larger than the cluster size, which will cause the file

[Qemu-devel] [PATCH v3] vmdk: align end of file to a sector boundary

2018-09-13 Thread yuchenlin--- via Qemu-devel
From: yuchenlin There is a rare case which the size of last compressed cluster is larger than the cluster size, which will cause the file is not aligned at the sector boundary. There are three reasons to do it. First, if vmdk doesn't align at the sector boundary, there may be many undefined

Re: [Qemu-devel] [Qemu-block] [PATCH 1/3] aio-posix: fix concurrent access to poll_disable_cnt

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 08:56, Fam Zheng wrote: >> +/* No need to order poll_disable_cnt writes against other updates; >> + * the counter is only used to avoid wasting time and latency on >> + * iterated polling when the system call will be ultimately necessary. >> + * Changing handlers is a

Re: [Qemu-devel] [PATCH v0 2/2] block: postpone the coroutine executing if the BDS's is drained

2018-09-13 Thread Kevin Wolf
Am 12.09.2018 um 19:03 hat Denis V. Lunev geschrieben: > On 09/12/2018 04:15 PM, Kevin Wolf wrote: > > Am 12.09.2018 um 14:03 hat Denis Plotnikov geschrieben: > >> On 10.09.2018 15:41, Kevin Wolf wrote: > >>> Am 29.06.2018 um 14:40 hat Denis Plotnikov geschrieben: > Fixes the problem of ide

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

2018-09-13 Thread Paolo Bonzini
On 13/09/2018 06:21, Mark Cave-Ayland wrote: > Indeed, see the Based-on header attached to the cover letter: it is > dependent upon the lsi53c8xx_create() removal patchset at > https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg00797.html > which Paolo has queued here: >

Re: [Qemu-devel] [PATCH v2 2/2] spapr: increase the size of the IRQ number space

2018-09-13 Thread Cédric Le Goater
On 09/13/2018 04:25 AM, David Gibson wrote: > On Tue, Sep 11, 2018 at 07:55:03AM +0200, Cédric Le Goater wrote: >> The new layout using static IRQ number does not leave much space to >> the dynamic MSI range, only 0x100 IRQ numbers. Increase the total >> number of IRQS for newer machines and

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

2018-09-13 Thread Paolo Bonzini
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 REPLAY_ASYNC_EVENT_BH does not? Paolo

Re: [Qemu-devel] [PATCH v6 20/25] replay: wake up vCPU when replaying

2018-09-13 Thread Pavel Dovgalyuk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 12/09/2018 10:19, Pavel Dovgalyuk wrote: > > This patch tries to wake up the vCPU when it sleeps and the icount warp > > checkpoint isn't met. It means that vCPU has something to do, because > > there are no other reasons of non-matching warp

Re: [Qemu-devel] [PATCH 6/6] x86_iommu/amd: Enable Guest virtual APIC support

2018-09-13 Thread Peter Xu
On Thu, Sep 13, 2018 at 03:36:28PM +0700, Suravee Suthikulpanit wrote: > Brijesh/Peter, > > On 9/13/18 4:14 AM, Brijesh Singh wrote: > > > > > > On 09/11/2018 11:52 PM, Peter Xu wrote: > > ... > > > > > > > > > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > > > > index

Re: [Qemu-devel] [PATCH] qemu: Add virtio pmem device

2018-09-13 Thread Luiz Capitulino
On Thu, 13 Sep 2018 03:06:27 -0400 (EDT) Pankaj Gupta wrote: > > > > > This patch adds virtio-pmem Qemu device. > > > > > > This device presents memory address range information to guest > > > which is backed by file backend type. It acts like persistent > > > memory device for KVM

[Qemu-devel] [PATCH v2 00/17] Fix some jobs/drain/aio_poll related hangs

2018-09-13 Thread Kevin Wolf
Especially the combination of iothreads, block jobs and drain tends to lead to hangs currently. This series fixes a few of these bugs, although there are more of them, to be addressed in separate patches. The primary goal of this series is to fix the scenario from:

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

2018-09-13 Thread Kevin Wolf
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, job_drain() without aio_poll() isn't necessarily

[Qemu-devel] [PATCH v2 05/17] test-blockjob: Acquire AioContext around job_cancel_sync()

2018-09-13 Thread Kevin Wolf
All callers in QEMU proper hold the AioContext lock when calling job_finish_sync(). test-blockjob should do the same when it calls the function indirectly through job_cancel_sync(). Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- include/qemu/job.h| 6 ++ tests/test-blockjob.c | 6

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

2018-09-13 Thread Kevin Wolf
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 AioContext lock for the respective job, but

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

2018-09-13 Thread Kevin Wolf
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 --- tests/test-bdrv-drain.c | 116

[Qemu-devel] [PATCH v2 15/17] test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level()

2018-09-13 Thread Kevin Wolf
This is a regression test for a deadlock that could occur in callbacks called from the aio_poll() in bdrv_drain_poll_top_level(). The AioContext lock wasn't released and therefore would be taken a second time in the callback. This would cause a possible AIO_WAIT_WHILE() in the callback to hang.

[Qemu-devel] [PULL 00/12] Migration queue

2018-09-13 Thread Juan Quintela
/20180913 for you to fetch changes up to 418fe4f69648b4f3f0afd2588926deafac81cfe8: tests/migration: Enable the migration test on s390x, too (2018-09-13 14:06:26 +0200) migration/next for 20180913 Hi this patchset has all pending

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

2018-09-13 Thread Kevin Wolf
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 unconditional aio_poll(false) to the drain

[Qemu-devel] [PULL 09/12] tests/migration: Support cross compilation in generating boot header file

2018-09-13 Thread Juan Quintela
From: Wei Huang Recently a new configure option, CROSS_CC_GUEST, was added to $(TARGET)-softmmu/config-target.mak to support TCG-related tests. This patch tries to leverage this option to support cross compilation when the migration boot block file is being re-generated: * The x86 related

[Qemu-devel] [PATCH v8 2/2] vl:c: make sure that sockets are calculated correctly in '-smp X' case

2018-09-13 Thread Igor Mammedov
commit (5cdc9b76e3 vl.c: Remove dead assignment) removed sockets calculation when 'sockets' weren't provided on CLI since there wasn't any users for it back then. Exiting checks are neither reachable } else if (sockets * cores * threads < cpus) { or nor triggerable if (sockets * cores *

[Qemu-devel] [PATCH v8 0/2] deprecate incorrect CPUs topolog

2018-09-13 Thread Igor Mammedov
Changelog since v7: * drop repetitive sentence in deprication doc (Eric Blake ) Changelog since v5: * add(v6) and then remove(v7) Notes section to/from deprication doc (Eduardo Habkost ) * fix up wording and math formating in deprication doc (Eduardo Habkost ) * drop !socket

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

2018-09-13 Thread Pavel Dovgalyuk
> 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 REPLAY_ASYNC_EVENT_BH does not? Because

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

2018-09-13 Thread Igor Mammedov
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 during system initialization. > > > Any changes to the HMAT state at runtime or

Re: [Qemu-devel] [PATCH v2 05/20] memory-device: convert get_region_size() to get_memory_region()

2018-09-13 Thread Igor Mammedov
On Wed, 29 Aug 2018 17:36:09 +0200 David Hildenbrand wrote: > To factor out plugging and unplugging of memory device we need access to > the memory region. So let's replace get_region_size() by > get_memory_region(). > > If any memory device will in the future have multiple memory regions >

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

2018-09-13 Thread Kevin Wolf
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. Signed-off-by: Kevin Wolf Reviewed-by: Fam

[Qemu-devel] [PULL 07/12] migration: use save_page_use_compression in flush_compressed_data

2018-09-13 Thread Juan Quintela
From: Xiao Guangrong It avoids to touch compression locks if xbzrle and compression are both enabled Signed-off-by: Xiao Guangrong Reviewed-by: Juan Quintela Message-Id: <20180906070101.27280-4-xiaoguangr...@tencent.com> Signed-off-by: Juan Quintela --- migration/ram.c | 4 +++- 1 file

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

2018-09-13 Thread Kevin Wolf
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 Wolf --- block/mirror.c | 11 +++ 1 file

[Qemu-devel] [PULL 04/12] Add a hint message to loadvm and exits on failure

2018-09-13 Thread Juan Quintela
From: Jose Ricardo Ziviani This patch adds a small hint for the failure case of the load snapshot process. It may be useful for users to remember that the VM configuration has changed between the save and load processes. (qemu) loadvm vm-20180903083641 Unknown savevm section or instance

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

2018-09-13 Thread Kevin Wolf
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 nested AIO_WAIT_WHILE() call. However, it

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

2018-09-13 Thread Igor Mammedov
-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 an invalid topology. Deprecate invalid

[Qemu-devel] [PATCH] vhost-user: define conventions for vhost-user backends

2018-09-13 Thread Marc-André Lureau
As discussed during "[PATCH v4 00/29] vhost-user for input & GPU" review, let's define a common set of backend conventions to help with management layer implementation, and interoperability. Cc: libvir-l...@redhat.com Cc: Gerd Hoffmann Cc: Daniel P. Berrangé Cc: Changpeng Liu Cc: Dr. David

Re: [Qemu-devel] [PATCH v2] hostmem: no need to check for host_memory_backend_mr_inited() in alloc()

2018-09-13 Thread Igor Mammedov
On Mon, 10 Sep 2018 17:49:46 +0400 Marc-André Lureau wrote: > memfd_backend_memory_alloc/file_backend_memory_alloc both needlessly > are are calling host_memory_backend_mr_inited() which creates an > illusion that alloc could be called multiple times but it isn't, it's > called once from

Re: [Qemu-devel] [PATCH v2 0/3] Misc usb-mtp fixes

2018-09-13 Thread Gerd Hoffmann
On Fri, Sep 07, 2018 at 06:08:48PM -0400, Bandan Das wrote: > v2: > Same as v1 but with another minor cleanup > patch. The write buffer breakup is still WIP. > > A documentation fix and changes to return the > right error code on write failures. Added to usb queue. thanks, Gerd

Re: [Qemu-devel] [PATCH v2 08/20] pc-dimm: implement memory device class function set_addr()

2018-09-13 Thread Igor Mammedov
On Wed, 29 Aug 2018 17:36:12 +0200 David Hildenbrand wrote: > Keep it simple for now and simply set the static property, that will > fail once realized. I'd merge this with previous patch and mention that set_addr will replace 'addr' property setting in the next patch where preliminary steps

Re: [Qemu-devel] [PATCH 3/3] virtio-pmem: Add virtio pmem driver

2018-09-13 Thread Luiz Capitulino
On Thu, 13 Sep 2018 02:58:21 -0400 (EDT) Pankaj Gupta wrote: > Hi Luiz, > > Thanks for the review. > > > > > > This patch adds virtio-pmem driver for KVM guest. > > > > > > Guest reads the persistent memory range information from > > > Qemu over VIRTIO and registers it on nvdimm_bus. It

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

2018-09-13 Thread Kevin Wolf
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 other fix removed the other one. Now we have a bug

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

2018-09-13 Thread Kevin Wolf
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 the pending activity is completed and the job

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

2018-09-13 Thread Kevin Wolf
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 any callback takes a temporary BlockBackend

[Qemu-devel] [PATCH v2 04/17] test-bdrv-drain: Drain with block jobs in an I/O thread

2018-09-13 Thread Kevin Wolf
This extends the existing drain test with a block job to include variants where the block job runs in a different AioContext. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- tests/test-bdrv-drain.c | 92 + 1 file changed, 86 insertions(+), 6

Re: [Qemu-devel] [PATCH v2 06/20] memory-device: document MemoryDeviceClass

2018-09-13 Thread Igor Mammedov
On Wed, 29 Aug 2018 17:36:10 +0200 David Hildenbrand wrote: > Document the functions and when to not expect errors. > > Signed-off-by: David Hildenbrand > --- > include/hw/mem/memory-device.h | 13 + > 1 file changed, 13 insertions(+) > > diff --git

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

2018-09-13 Thread Kevin Wolf
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 then be able to kick a drain in the main loop

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

2018-09-13 Thread Kevin Wolf
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 callback hasn't actually completed yet.

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

2018-09-13 Thread Kevin Wolf
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 for the home context of the coroutine is

[Qemu-devel] [PATCH v2 07/17] test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback

2018-09-13 Thread Kevin Wolf
This is a regression test for a deadlock that occurred in block job completion callbacks (via job_defer_to_main_loop) because the AioContext lock was taken twice: once in job_finish_sync() and then again in job_defer_to_main_loop_bh(). This would cause AIO_WAIT_WHILE() to hang. Signed-off-by:

[Qemu-devel] [PULL 01/12] migration/rdma: Fix uninitialised rdma_return_path

2018-09-13 Thread Juan Quintela
From: "Dr. David Alan Gilbert" Clang correctly errors out moaning that rdma_return_path is used uninitialised in the earlier error paths. Make it NULL so that the error path ignores it. Fixes: 55cc1b5937a8e709e4c102e74b206281073aab82 Signed-off-by: Dr. David Alan Gilbert Reported-by: Cornelia

[Qemu-devel] [PULL 06/12] migration: show the statistics of compression

2018-09-13 Thread Juan Quintela
From: Xiao Guangrong Currently, it includes: pages: amount of pages compressed and transferred to the target VM busy: amount of count that no free thread to compress data busy-rate: rate of thread busy compressed-size: amount of bytes after compression compression-rate: rate of compressed size

[Qemu-devel] [PULL 02/12] migration: fix calculating xbzrle_counters.cache_miss_rate

2018-09-13 Thread Juan Quintela
From: Xiao Guangrong As Peter pointed out: | - xbzrle_counters.cache_miss is done in save_xbzrle_page(), so it's | per-guest-page granularity | | - RAMState.iterations is done for each ram_find_and_save_block(), so | it's per-host-page granularity | | An example is that when we migrate a 2M

[Qemu-devel] [PULL 08/12] tests/migration: Convert x86 boot block compilation script into Makefile

2018-09-13 Thread Juan Quintela
From: Wei Huang The x86 boot block header currently is generated with a shell script. To better support other CPUs (e.g. aarch64), we convert the script into Makefile. This allows us to 1) support cross-compilation easily, and 2) avoid creating a script file for every architecture. Note that,

[Qemu-devel] [PULL 03/12] migration: handle the error condition properly

2018-09-13 Thread Juan Quintela
From: Xiao Guangrong ram_find_and_save_block() can return negative if any error hanppens, however, it is completely ignored in current code Signed-off-by: Xiao Guangrong Reviewed-by: Juan Quintela Message-Id: <20180903092644.25812-5-xiaoguangr...@tencent.com> Signed-off-by: Juan Quintela ---

[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:

[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

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] [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] [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 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 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

  1   2   >