[Qemu-devel] [RFC PATCH v3 23/24] spapr: Support ibm, dynamic-reconfiguration-memory

2015-04-24 Thread Bharata B Rao
Parse ibm,architecture.vec table obtained from the guest and enable memory node configuration via ibm,dynamic-reconfiguration-memory if guest supports it. This is in preparation to support memory hotplug for sPAPR guests. This changes the way memory node configuration is done. Currently all memory

[Qemu-devel] [RFC PATCH v3 22/24] numa: API to lookup NUMA node by address

2015-04-24 Thread Bharata B Rao
Keep track of start and end address of each NUMA node in numa_info structure so that lookup of node by address becomes easier. Add an API get_numa_node() to lookup a node by address. This is needed by PowerPC memory hotplug implementation. Signed-off-by: Bharata B Rao Cc: Paolo Bonzini --- inc

[Qemu-devel] [RFC PATCH v3 16/24] qom: Introduce object_has_no_children() API

2015-04-24 Thread Bharata B Rao
This QOM API can be used to check of an object has any child objects associated with it. Needed by PowerPC CPU hotplug code to release parent CPU core and socket objects only after ascertaining that they don't have any child objects. Signed-off-by: Bharata B Rao --- include/qom/object.h | 11 ++

[Qemu-devel] [RFC PATCH v3 17/24] cpus: Reclaim vCPU objects

2015-04-24 Thread Bharata B Rao
From: Gu Zheng In order to deal well with the kvm vcpus (which can not be removed without any protection), we do not close KVM vcpu fd, just record and mark it as stopped into a list, so that we can reuse it for the appending cpu hot-add request if possible. It is also the approach that kvm guys

[Qemu-devel] [RFC PATCH v3 18/24] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled

2015-04-24 Thread Bharata B Rao
When supporting CPU hot removal by parking the vCPU fd and reusing it during hotplug again, there can be cases where we try to reenable KVM_CAP_IRQ_XICS CAP for the vCPU for which it was already enabled. Introduce a boolean member in ICPState to track this and don't reenable the CAP if it was alrea

[Qemu-devel] [RFC PATCH v3 21/24] spapr: Initialize hotplug memory address space

2015-04-24 Thread Bharata B Rao
Initialize a hotplug memory region under which all the hotplugged memory is accommodated. Also enable memory hotplug by setting CONFIG_MEM_HOTPLUG. Modelled on i386 memory hotplug. Signed-off-by: Bharata B Rao --- default-configs/ppc64-softmmu.mak | 1 + hw/ppc/spapr.c| 38

[Qemu-devel] [RFC PATCH v3 24/24] spapr: Memory hotplug support

2015-04-24 Thread Bharata B Rao
Make use of pc-dimm infrastructure to support memory hotplug for PowerPC. Modelled on i386 memory hotplug. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c| 157 +- hw/ppc/spapr_events.c | 3 + 2 files changed, 158 insertions(+), 2 deleti

Re: [Qemu-devel] [RFC PATCH v4 00/28] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service

2015-04-24 Thread Wen Congyang
On 04/22/2015 07:18 PM, Dr. David Alan Gilbert wrote: > * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: >> Hi, >> >> ping ... > > I will get to look at this again; but not until after next week. > >> The main blocked bugs for COLO have been solved, > > I've got the v3 set running, but th

Re: [Qemu-devel] [PATCH v11 0/4] machvirt dynamic sysbus device instantiation

2015-04-24 Thread Baptiste Reynal
I think it will be a pity to postpone VFIO support on QEMU and would rather introduce the support for VIRT_MMIO later. Alex, what is your position on it ? Best regards, Baptiste On Thu, Apr 23, 2015 at 5:17 PM, Eric Auger wrote: > Hi Baptiste, > > Well I need to increase the size of the platfor

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 04:16, Wen Congyang wrote: >>> >> I think the primary shouldn't do any I/O after failover (and the >>> >> secondary should close the NBD server) so it is probably okay to ignore >>> >> the removal for now. Inserting the filter dynamically is probably >>> >> needed though. >> > >>

Re: [Qemu-devel] [PATCH] qmp-commands.hx: Update the supported 'transaction' operations

2015-04-24 Thread Kashyap Chamarthy
On Thu, Apr 23, 2015 at 05:07:44PM -0600, Eric Blake wrote: > On 04/23/2015 06:46 AM, Kashyap Chamarthy wrote: > > Although the canonical source of reference for QMP commands is > > qapi-schema.json, for consistency's sake, update qmp-commands.hx to > > state the list of supported transactionable o

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Wen Congyang
On 04/24/2015 03:47 PM, Paolo Bonzini wrote: > > > On 24/04/2015 04:16, Wen Congyang wrote: >> I think the primary shouldn't do any I/O after failover (and the >> secondary should close the NBD server) so it is probably okay to ignore >> the removal for now. Inserting the filter dyna

Re: [Qemu-devel] [PATCH 05/27] block/parallels: add get_block_status

2015-04-24 Thread Stefan Hajnoczi
On Thu, Apr 23, 2015 at 12:23:43PM +0300, Denis V. Lunev wrote: > On 23/04/15 12:03, Stefan Hajnoczi wrote: > >On Wed, Apr 22, 2015 at 03:42:23PM +0300, Denis V. Lunev wrote: > >>On 22/04/15 15:39, Stefan Hajnoczi wrote: > >>>On Wed, Mar 11, 2015 at 01:27:59PM +0300, Denis V. Lunev wrote: > +st

[Qemu-devel] [PATCH v2] qmp-commands.hx: Update the supported 'transaction' operations

2015-04-24 Thread Kashyap Chamarthy
Although the canonical source of reference for QMP commands is qapi-schema.json, for consistency's sake, update qmp-commands.hx to state the list of supported transactionable operations, namely: drive-backup blockdev-backup blockdev-snapshot-internal-sync abort block-dirty-bitm

Re: [Qemu-devel] [PATCH 0/2] virtfs-proxy-helper: small fixes

2015-04-24 Thread Stefan Hajnoczi
On Thu, Apr 23, 2015 at 02:15:26PM +0530, Aneesh Kumar K.V wrote: > "Aneesh Kumar K.V" writes: > > > Stefan Hajnoczi writes: > > > >> On Mon, Mar 30, 2015 at 02:57:14PM +0100, Stefan Hajnoczi wrote: > >>> These fixes are not critical but it wouldn't hurt to get them into QEMU > >>> 2.3. > >>>

[Qemu-devel] [PATCH 1/3] scsi-disk: Limit zero write request to SCSI_WRITE_SAME_MAX

2015-04-24 Thread Fam Zheng
SBC-4 says: If the number of logical blocks specified to be unmapped or written exceeds the value indicated in the MAXIMUM WRITE SAME LENGTH field in the Block Limits VPD page (see 6.6.4), then the device server shall terminate the command with CHECK CONDITION status with the s

[Qemu-devel] [PATCH 0/3] block: Fix unaligned bdrv_aio_write_zeroes

2015-04-24 Thread Fam Zheng
An unaligned zero write causes NULL deferencing in bdrv_co_do_pwritev. That path is reachable from bdrv_co_write_zeroes and bdrv_aio_write_zeroes. You can easily trigger through the former with qemu-io, as the test case added by 61815d6e0aa. For bdrv_aio_write_zeroes, in common cases there's alway

Re: [Qemu-devel] [RFC PATCH v4 00/28] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service

2015-04-24 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 04/22/2015 07:18 PM, Dr. David Alan Gilbert wrote: > > * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > >> Hi, > >> > >> ping ... > > > > I will get to look at this again; but not until after next week. > > > >> The main blocked bugs for

[Qemu-devel] [PATCH 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-04-24 Thread Fam Zheng
For zero write, qiov passed by callers (qemu-io "write -z" and scsi-disk "write same") is NULL. Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler fix would be in bdrv_co_do_pwritev which is the NULL dereferen

[Qemu-devel] [PATCH 3/3] Revert "block: Fix unaligned zero write"

2015-04-24 Thread Fam Zheng
This reverts commit fc3959e4669a1c2149b91ccb05101cfc7ae1fc05. The core write code already handles the case, so remove this duplication. Signed-off-by: Fam Zheng --- block.c | 45 ++--- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/block.c

Re: [Qemu-devel] [Qemu-block] [PATCH v6 00/21] block: transactionless incremental backup series

2015-04-24 Thread Stefan Hajnoczi
On Thu, Apr 23, 2015 at 03:40:03PM -0400, John Snow wrote: > It's too late! You've opened Pandora's Box! This is why it's a waste of time to play with licenses. Stefan pgpKS1E6FASSz.pgp Description: PGP signature

[Qemu-devel] physical memory address in guest (from his point of view)

2015-04-24 Thread Catalin Vasile
Does a physical memory address in a guest points to the same memory as qemu? For example: if I have a physical pointer 0x34 in the guest, does it point to the same location that qemu points with 0x34 address?

Re: [Qemu-devel] [PATCH 1/3] scsi-disk: Limit zero write request to SCSI_WRITE_SAME_MAX

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 10:33, Fam Zheng wrote: > SBC-4 says: > > If the number of logical blocks specified to be unmapped or written > exceeds the value indicated in the MAXIMUM WRITE SAME LENGTH field > in the Block Limits VPD page (see 6.6.4), then the device server > shall terminate th

Re: [Qemu-devel] [RFC PATCH v4 00/28] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service

2015-04-24 Thread zhanghailiang
On 2015/4/22 19:18, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: Hi, ping ... I will get to look at this again; but not until after next week. OK, thanks for your reply. :) The main blocked bugs for COLO have been solved, I've got the v3 set run

Re: [Qemu-devel] [RFC PATCH v4 00/28] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service

2015-04-24 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > On 2015/4/22 19:18, Dr. David Alan Gilbert wrote: > >* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > >>Hi, > >> > >>ping ... > > > >I will get to look at this again; but not until after next week. > > > > OK, thanks for your reply

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 04/24/2015 03:47 PM, Paolo Bonzini wrote: > > > > > > On 24/04/2015 04:16, Wen Congyang wrote: > >> I think the primary shouldn't do any I/O after failover (and the > >> secondary should close the NBD server) so it is probably okay to igno

Re: [Qemu-devel] [PATCH 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 10:33, Fam Zheng wrote: > For zero write, qiov passed by callers (qemu-io "write -z" and > scsi-disk "write same") is NULL. > > Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case > for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler > fix would

Re: [Qemu-devel] [PATCH 1/3] scsi-disk: Limit zero write request to SCSI_WRITE_SAME_MAX

2015-04-24 Thread Fam Zheng
On Fri, 04/24 10:50, Paolo Bonzini wrote: > > > On 24/04/2015 10:33, Fam Zheng wrote: > > SBC-4 says: > > > > If the number of logical blocks specified to be unmapped or written > > exceeds the value indicated in the MAXIMUM WRITE SAME LENGTH field > > in the Block Limits VPD page (s

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Eric Auger
On 04/23/2015 11:58 AM, Paolo Bonzini wrote: > > > On 23/04/2015 11:40, Eric Auger wrote: Why can't you just use a GHashTable? >> You mean implementing this hash table in the interrupt controller? > > No, in KVM. Basically the kvm-vgic interrupt controller registers its > qemu_irqs with k

Re: [Qemu-devel] [PATCH 1/3] scsi-disk: Limit zero write request to SCSI_WRITE_SAME_MAX

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 11:02, Fam Zheng wrote: > >> > However, it shouldn't be a problem for >> > the rest of the series. > It is. The request has to be splitted to aligned part and unaligned part > because the latter requires a buffer, as we don't like unbounded allocation. Yes, I found that out after

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 10:58, Dr. David Alan Gilbert wrote: >> > If we can add a filter dynamically, we can add a filter that's file is nbd >> > dynamically after secondary qemu's nbd server is ready. In this case, I >> > think >> > there is no need to touch nbd client. > Yes, I think maybe the harder pa

Re: [Qemu-devel] physical memory address in guest (from his point of view)

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 10:46, Catalin Vasile wrote: > Does a physical memory address in a guest points to the same memory as qemu? > For example: if I have a physical pointer 0x34 in the guest, does it > point to the same location that qemu points with 0x34 address? No. QEMU converts guest pointers (whi

Re: [Qemu-devel] [PATCH 1/6] s390x/virtio-ccw: enable has_dynamic_sysbus

2015-04-24 Thread Cornelia Huck
On Wed, 22 Apr 2015 14:21:36 +0200 Alexander Graf wrote: > > > > Am 22.04.2015 um 13:40 schrieb Cornelia Huck : > > > > On Wed, 22 Apr 2015 11:14:40 +0200 > > Alexander Graf wrote: > > > >>> On 04/22/2015 10:25 AM, Cornelia Huck wrote: > >>> On Tue, 21 Apr 2015 21:06:42 +0200 > >>> Alexander

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 11:01, Eric Auger wrote: >> > void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p) >> > { >> > SysBusDeviceClass *sdc = SYSBUS_DEVICE_GET_CLASS(dev); >> > qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, 1, >> > sdc->irq_set_hook)

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Eric Auger
On 04/24/2015 11:11 AM, Paolo Bonzini wrote: > > > On 24/04/2015 11:01, Eric Auger wrote: void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p) { SysBusDeviceClass *sdc = SYSBUS_DEVICE_GET_CLASS(dev); qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, 1, >

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Stefan Hajnoczi
On Thu, Apr 23, 2015 at 01:50:28PM +0200, Alberto Garcia wrote: > On Thu 23 Apr 2015 12:15:04 PM CEST, Stefan Hajnoczi wrote: > > >> For a cache size of 128MB, the PSS is actually ~10MB larger without > >> the patch, which seems to come from posix_memalign(). > > > > Do you mean RSS or are you usi

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 11:18, Eric Auger wrote: >>> >> I implemented this alternative but my concern is the check method is >>> >> called before the qemu_irq setting. So on this callback I cannot >>> >> retrieve the qemu_irq VFIOINTp struct container object needed to setup >>> >> irqfd hence does not work

Re: [Qemu-devel] [PATCH 07/10] linux-headers: update

2015-04-24 Thread Paolo Bonzini
On 09/04/2015 10:51, Cornelia Huck wrote: > This updates linux-headers against kvm/queue (commit > c7f0cf16df59ac98b58af974c3947cac21402e29), with the exception of > avoiding undoing 2106ba30105969262a7810417a57524d9a225b91 > ("uapi/virtio_scsi: allow overriding CDB/SENSE size"). > > Signed-off-

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Wen Congyang
On 04/24/2015 05:04 PM, Paolo Bonzini wrote: > > > On 24/04/2015 10:58, Dr. David Alan Gilbert wrote: If we can add a filter dynamically, we can add a filter that's file is nbd dynamically after secondary qemu's nbd server is ready. In this case, I think there is no need to t

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 11:38, Wen Congyang wrote: >> > >> > That can be done with drive-mirror. But I think it's too early for that. > Do you mean use drive-mirror instead of quorum? Only before starting up a new secondary. Basically you do a migration with non-shared storage, and then start the secon

Re: [Qemu-devel] physical memory address in guest (from his point of view)

2015-04-24 Thread Peter Maydell
On 24 April 2015 at 09:46, Catalin Vasile wrote: > Does a physical memory address in a guest points to the same memory as qemu? > For example: if I have a physical pointer 0x34 in the guest, does it > point to the same location that qemu points with 0x34 address? As an additional point to Paolo's

Re: [Qemu-devel] [PATCH 00/17] Update to adding an IPMI device to qemu

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 00:57, miny...@acm.org wrote: > The major changes from last time are: > > * Don't use callbacks for adding firmware tables, provide binary > blobs instead. > > * Add the SSDT as a separate table. > > * Modify the BIOS tests to test for the IPMI tables. I disagree with both of

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Kevin Wolf
Am 24.04.2015 um 11:26 hat Stefan Hajnoczi geschrieben: > On Thu, Apr 23, 2015 at 01:50:28PM +0200, Alberto Garcia wrote: > > On Thu 23 Apr 2015 12:15:04 PM CEST, Stefan Hajnoczi wrote: > > > > >> For a cache size of 128MB, the PSS is actually ~10MB larger without > > >> the patch, which seems to

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Eric Auger
On 04/24/2015 11:29 AM, Paolo Bonzini wrote: > > > On 24/04/2015 11:18, Eric Auger wrote: >> I implemented this alternative but my concern is the check method is >> called before the qemu_irq setting. So on this callback I cannot >> retrieve the qemu_irq VFIOINTp struct container obje

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Wen Congyang
On 04/24/2015 05:36 PM, Paolo Bonzini wrote: > > > On 24/04/2015 11:38, Wen Congyang wrote: That can be done with drive-mirror. But I think it's too early for that. >> Do you mean use drive-mirror instead of quorum? > > Only before starting up a new secondary. Basically you do a migr

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Kevin Wolf
Am 24.04.2015 um 11:26 hat Stefan Hajnoczi geschrieben: > The posix_memalign() call wastes memory. I compared: > > posix_memalign(&memptr, 65536, 2560 * 65536); > memset(memptr, 0, 2560 * 65536); > > with: > > for (i = 0; i < 2560; i++) { > posix_memalign(&memptr, 65536, 65536); >

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 11:48, Eric Auger wrote: >> > What did the notifier code look like with your patch? > Currently both notifiers are stored in the VFIOINTp struct. They are > initialized in vfio_init_intp. VFIO platform device holds a list of > VFIOINTp struct. > > When the vfio_start_irqfd callback

Re: [Qemu-devel] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 11:53, Wen Congyang wrote: >> > Only before starting up a new secondary. Basically you do a migration >> > with non-shared storage, and then start the secondary in colo mode. >> > >> > But it's only for the failover case. Quorum (or a new block/colo.c >> > driver or filter) is fi

Re: [Qemu-devel] physical memory address in guest (from his point of view)

2015-04-24 Thread Catalin Vasile
On Fri, Apr 24, 2015 at 12:05 PM, Paolo Bonzini wrote: > > > On 24/04/2015 10:46, Catalin Vasile wrote: >> Does a physical memory address in a guest points to the same memory as qemu? >> For example: if I have a physical pointer 0x34 in the guest, does it >> point to the same location that qemu po

Re: [Qemu-devel] [PATCH 07/10] linux-headers: update

2015-04-24 Thread Cornelia Huck
On Fri, 24 Apr 2015 11:30:44 +0200 Paolo Bonzini wrote: > > > On 09/04/2015 10:51, Cornelia Huck wrote: > > This updates linux-headers against kvm/queue (commit > > c7f0cf16df59ac98b58af974c3947cac21402e29), with the exception of > > avoiding undoing 2106ba30105969262a7810417a57524d9a225b91 > >

[Qemu-devel] [PATCH 0/2] mips/kvm: Fixes for big endian & MIPS64 hosts

2015-04-24 Thread James Hogan
A couple of small fixes for accessing 32-bit KVM registers on big endian, and to sign extend struct kvm_regs registers so as to work on MIPS64 hosts. James Hogan (2): mips/kvm: Fix Big endian 32-bit register access mips/kvm: Sign extend registers written to KVM target-mips/kvm.c | 21 +++

[Qemu-devel] [PATCH 1/2] mips/kvm: Fix Big endian 32-bit register access

2015-04-24 Thread James Hogan
Fix access to 32-bit registers on big endian targets. The pointer passed to the kernel must be for the actual 32-bit value, not a temporary 64-bit value, otherwise on big endian systems the kernel will only interpret the upper half. Signed-off-by: James Hogan Cc: Paolo Bonzini Cc: Leon Alrae Cc

[Qemu-devel] [PATCH 2/2] mips/kvm: Sign extend registers written to KVM

2015-04-24 Thread James Hogan
In case we're running on a 64-bit host, be sure to sign extend the general purpose registers and hi/lo/pc before writing them to KVM, so as to take advantage of MIPS32/MIPS64 compatibility. Signed-off-by: James Hogan Cc: Paolo Bonzini Cc: Leon Alrae Cc: Aurelien Jarno Cc: k...@vger.kernel.org

Re: [Qemu-devel] [Qemu-ppc] [PATCH v8 15/16] spapr_pci: enable basic hotplug operations

2015-04-24 Thread Nikunj A Dadhania
Hi Michael, Couple of issues I found during my testing with pci enumerations patches yesterday: Michael Roth writes: > This enables hotplug of PCI devices to a PHB. Upon hotplug we > generate the OF-nodes required by PAPR specification and > IEEE 1275-1994 "PCI Bus Binding to Open Firmware" for

[Qemu-devel] [PATCH v2 1/2] Revert "block: Fix unaligned zero write"

2015-04-24 Thread Fam Zheng
This reverts commit fc3959e4669a1c2149b91ccb05101cfc7ae1fc05. The core write code already handles the case, so remove this duplication. Signed-off-by: Fam Zheng --- block.c | 45 ++--- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/block.c

[Qemu-devel] [PATCH v2 2/2] block: Fix NULL deference for unaligned write if qiov is NULL

2015-04-24 Thread Fam Zheng
For zero write, qiov passed by callers (qemu-io "write -z" and scsi-disk "write same") is NULL. Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler fix would be in bdrv_co_do_pwritev which is the NULL dereferen

[Qemu-devel] [PATCH v2 0/2] block: Fix unaligned bdrv_aio_write_zeroes

2015-04-24 Thread Fam Zheng
An unaligned zero write causes NULL deferencing in bdrv_co_do_pwritev. That path is reachable from bdrv_co_write_zeroes and bdrv_aio_write_zeroes. You can easily trigger through the former with qemu-io, as the test case added by 61815d6e0aa. For bdrv_aio_write_zeroes, in common cases there's alway

[Qemu-devel] [PATCH v3 6/9] mips/kvm: Support unsigned KVM registers

2015-04-24 Thread James Hogan
Add KVM register access functions for the uint32_t type. This is required for FP and MSA control registers, which are represented as unsigned 32-bit integers. Signed-off-by: James Hogan Cc: Paolo Bonzini Cc: Leon Alrae Cc: Aurelien Jarno --- Changes in v3: - Fix big endian (the pointer passed

Re: [Qemu-devel] physical memory address in guest (from his point of view)

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 12:22, Catalin Vasile wrote: > > > Does a physical memory address in a guest points to the same memory as > > > qemu? > > > For example: if I have a physical pointer 0x34 in the guest, does it > > > point to the same location that qemu points with 0x34 address? > > > > No. QEMU co

[Qemu-devel] [PATCH 0/5] virtio-test: Test case update

2015-04-24 Thread Fam Zheng
Thanks to Marc Marí's work on libqos virtio support, it's now very easy to add a test case to drive a virtio-scsi device. The added test covers the recent fix for unaligned zero write in block layer, we exercise it here with scsi-disk WRITE SAME. Fam Zheng (5): tests: Link libqos virtio object

[Qemu-devel] [PATCH 1/5] tests: Link libqos virtio object to virtio-scsi-test

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 55aa745..b6c0f18 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -343,7 +343,7 @@ tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-tes

[Qemu-devel] [PATCH 4/5] tests: virtio-scsi: Move start/stop to individual test functions

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/virtio-scsi-test.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c index 989f825..ba119c1 100644 --- a/tests/virtio-scsi-test.c +++ b/tests/virtio-scsi-test.c @

[Qemu-devel] [PATCH 5/5] tests: virtio-scsi: Add test for unaligned WRITE SAME

2015-04-24 Thread Fam Zheng
This is an exercise for virtio-scsi tests using the libqos virtio library. A few common routines are added to facilitate future extensions of the test set. The added test case is a regression test for the bug in d7f4b1999e. Signed-off-by: Fam Zheng --- tests/virtio-scsi-test.c | 173 +++

[Qemu-devel] [PATCH 3/5] libqos: Complete virtio device ID definition list

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/libqos/virtio.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 2449fee..0101278 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -19,8 +19,14 @@ #define QVIRTIO

[Qemu-devel] [PATCH 2/5] libqos: Allow calling guest_free on NULL pointer

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/libqos/malloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index 67f3190..c15be89 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -283,6 +283,9 @@ uint64_t guest_alloc(QGuestAllocator *a

Re: [Qemu-devel] [PATCH v2 2/2] block: Fix NULL deference for unaligned write if qiov is NULL

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 12:33, Fam Zheng wrote: > For zero write, qiov passed by callers (qemu-io "write -z" and > scsi-disk "write same") is NULL. > > Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case > for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler > fix would

Re: [Qemu-devel] [PATCH 5/5] tests: virtio-scsi: Add test for unaligned WRITE SAME

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 12:53, Fam Zheng wrote: > +const uint8_t write_same_cdb[] = { 0x41, 0x00, 0x00, 0x00, > + 0x00, 0x01, 0x02 }; The array size should be CDB_SIZE and there's 3 missing bytes in the 10-byte WRITE SAME CDB. byte 0: WRITE SAME opcode byte 1: al

Re: [Qemu-devel] [PATCH v2 1/2] Revert "block: Fix unaligned zero write"

2015-04-24 Thread Fam Zheng
On Fri, 04/24 18:33, Fam Zheng wrote: > This reverts commit fc3959e4669a1c2149b91ccb05101cfc7ae1fc05. > > The core write code already handles the case, so remove this > duplication. Not already. I meant to put this patch after 2/2 so there is no intermediate state. So if apply the series, please

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Alberto Garcia
On Fri 24 Apr 2015 11:52:14 AM CEST, Kevin Wolf wrote: >> The posix_memalign() call wastes memory. I compared: >> >> posix_memalign(&memptr, 65536, 2560 * 65536); >> memset(memptr, 0, 2560 * 65536); >> >> with: >> >> for (i = 0; i < 2560; i++) { >> posix_memalign(&memptr, 65536, 6

Re: [Qemu-devel] [PATCH 5/5] tests: virtio-scsi: Add test for unaligned WRITE SAME

2015-04-24 Thread Fam Zheng
On Fri, 04/24 13:07, Paolo Bonzini wrote: > > > On 24/04/2015 12:53, Fam Zheng wrote: > > +const uint8_t write_same_cdb[] = { 0x41, 0x00, 0x00, 0x00, > > + 0x00, 0x01, 0x02 }; > > The array size should be CDB_SIZE and there's 3 missing bytes in the > 10-

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 04:10, Wenjie Liu wrote: > The thing I am trying to achieve is to get the data and guest physical > address of every guest memory access, so I need to known which API can > be used to do the address transform. The short answer is that is difficult, because most guest memory accesse

[Qemu-devel] [PATCH v2 3/5] libqos: Complete virtio device ID definition list

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/libqos/virtio.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 2449fee..0101278 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -19,8 +19,14 @@ #define QVIRTIO

[Qemu-devel] [PATCH v2 0/5] virtio-test: Test case update

2015-04-24 Thread Fam Zheng
v2: Fix CDB for WRITE SAME. [Paolo] Thanks to Marc Marí's work on libqos virtio support, it's now very easy to add a test case to drive a virtio-scsi device. The added test covers the recent fix for unaligned zero write in block layer, we exercise it here with scsi-disk WRITE SAME. Fam Zheng (5

[Qemu-devel] [PATCH v2 5/5] tests: virtio-scsi: Add test for unaligned WRITE SAME

2015-04-24 Thread Fam Zheng
This is an exercise for virtio-scsi tests using the libqos virtio library. A few common routines are added to facilitate future extensions of the test set. The added test case is a regression test for the bug in d7f4b1999e. Signed-off-by: Fam Zheng --- tests/virtio-scsi-test.c | 173 +++

[Qemu-devel] [PATCH v2 1/5] tests: Link libqos virtio object to virtio-scsi-test

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 55aa745..b6c0f18 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -343,7 +343,7 @@ tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-tes

[Qemu-devel] [PATCH v2 4/5] tests: virtio-scsi: Move start/stop to individual test functions

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/virtio-scsi-test.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c index 989f825..ba119c1 100644 --- a/tests/virtio-scsi-test.c +++ b/tests/virtio-scsi-test.c @

[Qemu-devel] [PATCH v2 2/5] libqos: Allow calling guest_free on NULL pointer

2015-04-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/libqos/malloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index 67f3190..c15be89 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -283,6 +283,9 @@ uint64_t guest_alloc(QGuestAllocator *a

[Qemu-devel] [PATCH 02/11] block: allow block jobs in any arbitrary node

2015-04-24 Thread Alberto Garcia
Currently, block jobs can only be owned by root nodes. This patch allows block jobs to be in any arbitrary node, by making the following changes: - Block jobs can now be identified by the node name of their BlockDriverState in addition to the device name. Since both device and node names live

[Qemu-devel] [PATCH 07/11] qemu-iotests: fix test_stream_partial()

2015-04-24 Thread Alberto Garcia
This test is streaming to the top layer using the intermediate image as the base. This is a mistake since block-stream never copies data from the base image and its backing chain, so this is effectively a no-op. In addition to fixing the base parameter, this patch also writes some data to the inte

[Qemu-devel] [PATCH 03/11] block: never cancel a streaming job without running stream_complete()

2015-04-24 Thread Alberto Garcia
We need to call stream_complete() in order to do all the necessary clean-ups, even if there's an early failure. At the moment it's only useful to make sure that s->backing_file_str is not leaked, but it will become more important as we introduce support for streaming to any intermediate node. Sign

[Qemu-devel] [PATCH 06/11] docs: Document how to stream to an intermediate layer

2015-04-24 Thread Alberto Garcia
Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- docs/live-block-ops.txt | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/live-block-ops.txt b/docs/live-block-ops.txt index a257087..a05d869 100644 --- a/do

[Qemu-devel] [PATCH v5 00/11] Support streaming to an intermediate layer

2015-04-24 Thread Alberto Garcia
New version of the patchset. Apart from a couple of minor documentation fixes, this one has new test cases. Since we now allow block jobs in arbitrary nodes, I wanted to test that given a sufficiently long snapshot chain, it's possible to launch several block-stream operations in parallel as long

[Qemu-devel] [PATCH 04/11] block: Support streaming to an intermediate layer

2015-04-24 Thread Alberto Garcia
This makes sure that the image we are steaming into is open in read-write mode during the operation. Operation blockers are also set in all intermediate nodes, since they will be removed from the chain afterwards. Finally, this also unblocks the stream operation in backing files. Signed-off-by:

[Qemu-devel] [PATCH 10/11] qemu-iotests: test block-stream operations in parallel

2015-04-24 Thread Alberto Garcia
This test case checks that it's possible to launch several stream operations in parallel in the same snapshot chain, each one involving a different set of nodes. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 80 ++ tests/qemu-iotests/0

[Qemu-devel] [PATCH 01/11] block: keep a list of block jobs

2015-04-24 Thread Alberto Garcia
The current way to obtain the list of existing block jobs is to iterate over all root nodes and check which ones own a job. Since we want to be able to support block jobs in other nodes as well, this patch keeps a list of jobs that is updated every time one is created or destroyed. This also upda

[Qemu-devel] [PATCH 11/11] qemu-iotests: test overlapping block-stream operations

2015-04-24 Thread Alberto Garcia
This test case checks that it's not possible to perform two block-stream operations if there are nodes involved in both. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 27 +++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 29 insertions(+), 2 delet

[Qemu-devel] [PATCH 08/11] qemu-iotests: add no-op streaming test

2015-04-24 Thread Alberto Garcia
This patch updates test_stream_partial() to test that the block-stream operation never copies data from the image specified as base. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iot

[Qemu-devel] [PATCH 05/11] block: Add QMP support for streaming to an intermediate layer

2015-04-24 Thread Alberto Garcia
This patch makes the 'device' parameter of the 'block-stream' command accept a node name as well as a device name. In addition to that, operation blockers will be checked in all intermediate nodes between the top and the base node. Since qmp_block_stream() now uses the error from bdrv_lookup_bs()

[Qemu-devel] [PATCH 09/11] qemu-iotests: test streaming to an intermediate layer

2015-04-24 Thread Alberto Garcia
This adds test_stream_intermediate(), similar to test_stream() but streams to the intermediate image instead. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 18 +- tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 19 insertions(+), 3 d

Re: [Qemu-devel] [PATCH v2 2/2] block: Fix NULL deference for unaligned write if qiov is NULL

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 13:00, Paolo Bonzini wrote: >> -qemu_iovec_add(&local_qiov, head_buf, offset & (align - 1)); >> -qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size); >> -use_local_qiov = true; >> +if (qiov) { >> +qemu_iovec_init(&local_qiov, qiov ? qiov->

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Eric Auger
On 04/24/2015 12:02 PM, Paolo Bonzini wrote: > > > On 24/04/2015 11:48, Eric Auger wrote: What did the notifier code look like with your patch? >> Currently both notifiers are stored in the VFIOINTp struct. They are >> initialized in vfio_init_intp. VFIO platform device holds a list of >> VF

Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 13:59, Eric Auger wrote: > > Then I would go for the other solution (the notifier, just adding the > > callback to SysbusDeviceClass). But I still do not understand why you > > didn't have exactly the same problem :) unless you were walking the list > > to find the relevant VFIOINT

Re: [Qemu-devel] [PATCH v2 RESEND 1/5] apic: Implement LAPIC low priority arbitration functions

2015-04-24 Thread Radim Krčmář
2015-04-23 12:34-0600, James Sullivan: > On 04/23/2015 07:49 AM, Radim Krčmář wrote: >> 2015-04-06 17:45-0600, James Sullivan: >>> Currently, apic_get_arb_pri() is unimplemented and returns 0. >>> >>> Implemented apic_get_arb_pri() and added two helper functions >>> apic_compare_prio() and apic_low

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Stefan Hajnoczi
On Fri, Apr 24, 2015 at 12:10 PM, Alberto Garcia wrote: > On Fri 24 Apr 2015 11:52:14 AM CEST, Kevin Wolf wrote: > >>> The posix_memalign() call wastes memory. I compared: >>> >>> posix_memalign(&memptr, 65536, 2560 * 65536); >>> memset(memptr, 0, 2560 * 65536); >>> >>> with: >>> >>> for (

[Qemu-devel] [RFC v4] monitor: add memory search commands s, sp

2015-04-24 Thread hw . claudio
From: Claudio Fontana usage is similar to the commands x, xp. Example with string: looking for "ELF" header in memory: (qemu) s/100cb 0x40001000 "ELF" searching memory area [40001000-400f5240] 40090001 (qemu) x/20b 0x4009 4009: '\x7f' 'E' 'L' 'F' '\x0

[Qemu-devel] [PATCH v2] sysbus: add irq_routing_notifier

2015-04-24 Thread Eric Auger
Add a new irq_routing_notifier notifier in the SysBusDeviceClass. This notifier, if populated, is called after sysbus_connect_irq. This mechanism is used to setup VFIO signaling once VFIO platform devices get attached to their platform bus, on a machine init done notifier. Signed-off-by: Eric Aug

Re: [Qemu-devel] [PATCH v2 RESEND 5/5] apic: Implement handling of RH=1 for MSI interrupt delivery

2015-04-24 Thread Radim Krčmář
2015-04-23 13:08-0600, James Sullivan: > On 04/23/2015 08:14 AM, Radim Krčmář wrote: >> 2015-04-06 17:45-0600, James Sullivan: >>> diff --git a/hw/intc/apic.c b/hw/intc/apic.c >>> @@ -519,23 +521,27 @@ static void apic_get_delivery_bitmask(uint32_t >>> *deliver_bitmask, >>> +if (apic_m

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Peter Maydell
On 24 April 2015 at 12:26, Paolo Bonzini wrote: > On 24/04/2015 04:10, Wenjie Liu wrote: >> The thing I am trying to achieve is to get the data and guest physical >> address of every guest memory access, so I need to known which API can >> be used to do the address transform. > > The short answer

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Alberto Garcia
On Fri 24 Apr 2015 02:37:21 PM CEST, Stefan Hajnoczi wrote: >> I think it would be nice to have a way to free unused cache entries >> after a while. > > Do you think mmap plus a periodic timer would work? > > I'm hesitant about changes like this because they make QEMU more > complex, slow down the

Re: [Qemu-devel] [edk2] implementing EFI_SMM_CONTROL2_PROTOCOL.Trigger()

2015-04-24 Thread Paolo Bonzini
On 24/04/2015 13:56, Yao, Jiewen wrote: > BTW: I am not sure how QEMU emulate SMI. Does SMI can be trigger by > 0xB2 port? And CPU will run to SMBASE in real mode? Yes, operation is the same. Paolo

  1   2   3   >