Re: [PATCH] qcow2: Reduce write_zeroes size in handle_alloc_space()

2020-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2020 19:19, Eric Blake wrote: On 6/9/20 10:18 AM, Kevin Wolf wrote: -    ret = bdrv_co_pwrite_zeroes(s->data_file, m->alloc_offset, -    m->nb_clusters * s->cluster_size, +    ret = bdrv_co_pwrite_zeroes(s->data_file, start, len,    

Re: Clarification regarding new qemu-img convert --target-is-zero flag

2020-06-09 Thread Sam Eiderman
Hi, My target format is a Persistent Disk on GCP. https://cloud.google.com/persistent-disk And my use case is converting VMDKs to PDs so I'm just using qemu-img for the conversion (not using qemu as a hypervisor). Luckily PDs are zeroed out when allocated but I was asking to understand the restr

Re: RFC: use VFIO over a UNIX domain socket to implement device offloading

2020-06-09 Thread John G Johnson
> On Jun 2, 2020, at 8:06 AM, Alex Williamson > wrote: > > On Wed, 20 May 2020 17:45:13 -0700 > John G Johnson wrote: > >>> I'm confused by VFIO_USER_ADD_MEMORY_REGION vs VFIO_USER_IOMMU_MAP_DMA. >>> The former seems intended to provide the server with access to the >>> entire GPA space, wh

Re: [PATCH 0/9] AMD SEV: Cleanup state handling

2020-06-09 Thread Paolo Bonzini
On 10/06/20 07:04, David Gibson wrote: >>> target/i386/sev.c | 257 +++-- >>> target/i386/sev_i386.h | 49 >>> 2 files changed, 143 insertions(+), 163 deletions(-) >> Queued, thanks. > Do you have a best guess at when these might merge? I have an

Re: [PATCH v2 4/7] vhost: involve device backends in feature negotiation

2020-06-09 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 01:53:57PM +0800, Jason Wang wrote: > > On 2020/6/10 下午12:15, Michael S. Tsirkin wrote: > > On Wed, Jun 10, 2020 at 11:21:50AM +0800, Jason Wang wrote: > > > On 2020/6/10 上午2:07, Michael S. Tsirkin wrote: > > > > > +/* > > > > > + * Default vhost_get_features() feature bits

Re: [PATCH v2 4/7] vhost: involve device backends in feature negotiation

2020-06-09 Thread Jason Wang
On 2020/6/10 下午2:11, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 01:53:57PM +0800, Jason Wang wrote: On 2020/6/10 下午12:15, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 11:21:50AM +0800, Jason Wang wrote: On 2020/6/10 上午2:07, Michael S. Tsirkin wrote: +/* + * Default vhost_get_fea

Re: [PATCH] virtio-pci: fix queue_enable write

2020-06-09 Thread Jason Wang
On 2020/6/10 下午12:16, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 10:03:28AM +0800, Jason Wang wrote: On 2020/6/9 下午11:43, Michael S. Tsirkin wrote: On Fri, May 29, 2020 at 11:07:28AM +0800, Jason Wang wrote: Spec said: The driver uses this to selectively prevent the device from execut

Re: [PATCH v2 4/7] vhost: involve device backends in feature negotiation

2020-06-09 Thread Michael S. Tsirkin
On Tue, Jun 09, 2020 at 06:02:15PM +0100, Stefan Hajnoczi wrote: > Many vhost devices in QEMU currently do not involve the device backend > in feature negotiation. This seems fine at first glance when no > device-specific feature bits are defined (virtio-net has many but some > devices have none).

Re: [PATCH 10/16] qdev: Improve netdev property override error a bit

2020-06-09 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 6/5/20 4:56 PM, Markus Armbruster wrote: >> qdev_prop_set_netdev() fails when the property already has a non-null >> value. Seems to go back to commit 30c367ed44 >> "qdev-properties-system.c: Allow vlan or netdev for -device, not >> both", v1.7.0. Board code

RE: [PATCH V3 0/3] migration/colo: Optimize COLO framework code

2020-06-09 Thread Zhang, Chen
Hi Dave, Any comments for this series? Thanks Zhang Chen > -Original Message- > From: Zhang, Chen > Sent: Monday, June 8, 2020 3:46 AM > To: Dr . David Alan Gilbert ; qemu-dev de...@nongnu.org> > Cc: Zhang Chen ; Zhanghailiang > ; Zhang, Chen > Subject: [PATCH V3 0/3] migration/colo:

Re: Clarification regarding new qemu-img convert --target-is-zero flag

2020-06-09 Thread Vladimir Sementsov-Ogievskiy
Hi Sam! 10.06.2020 08:28, Sam Eiderman wrote: Hi, 168468fe19c8 ("qemu-img: Add --target-is-zero to convert") has added a nice functionality for cloud scenarios: * Create a virtual disk What is the format of your target? * Convert a sparse image (qcow2, vmdk) to the virtual disk using --tar

[PATCH V2] virtio-pci: fix queue_enable write

2020-06-09 Thread Jason Wang
Spec said: The driver uses this to selectively prevent the device from executing requests from this virtqueue. 1 - enabled; 0 - disabled. Though write 0 to queue_enable is forbidden by the spec, we should not assume that the value is 1. Fix this by ignore the write value other than 1. Signed-off

[PATCH RESEND v3 45/58] sysbus: Convert to sysbus_realize() etc. with Coccinelle

2020-06-09 Thread Markus Armbruster
Convert from qdev_realize(), qdev_realize_and_unref() with null @bus argument to sysbus_realize(), sysbus_realize_and_unref(). Coccinelle script: @@ expression dev, errp; @@ -qdev_realize(DEVICE(dev), NULL, errp); +sysbus_realize(SYS_BUS_DEVICE(dev), errp); @@

Re: [PATCH RESEND v3 00/58] qdev: Rework how we plug into the parent bus

2020-06-09 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 07:31:49AM +0200, Markus Armbruster wrote: > Paolo recently suggested "to move the bus argument (and thus > qdev_set_parent_bus) to qdev_init"[1], and that it "would be quite > large but hopefully scriptable"[2]. Nerd sniped! > > The series is big, but at least the bigger

[PATCH RESEND v3 49/58] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3

2020-06-09 Thread Markus Armbruster
These are init/realize pairs produced by the previous commit's Coccinelle script where the argument test doesn't quite match. They need even more careful review. Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- hw/arm/armsse.c | 33 + hw/

[PATCH RESEND v3 56/58] qdev: Convert bus-less devices to qdev_realize() with Coccinelle

2020-06-09 Thread Markus Armbruster
All remaining conversions to qdev_realize() are for bus-less devices. Coccinelle script: // only correct for bus-less @dev! @@ expression errp; expression dev; @@ -qdev_init_nofail(dev); +qdev_realize(dev, NULL, &error_fatal); @ depends on !(file in "hw/co

[PATCH RESEND v3 36/58] qom: Less verbose object_initialize_child()

2020-06-09 Thread Markus Armbruster
All users of object_initialize_child() pass the obvious child size argument. Almost all pass &error_abort and no properties. Tiresome. Rename object_initialize_child() to object_initialize_child_with_props() to free the name. New convenience wrapper object_initialize_child() automates the size

[PATCH RESEND v3 55/58] qdev: Use qdev_realize() in qdev_device_add()

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- qdev-monitor.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qdev-monitor.c b/qdev-monitor.c index 20cfa7615b..22da107484 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -661,9 +661,7 @@ DeviceState *

[PATCH RESEND v3 04/58] qdev: New qdev_new(), qdev_realize(), etc.

2020-06-09 Thread Markus Armbruster
We commonly plug devices into their bus right when we create them, like this: dev = qdev_create(bus, type_name); Note that @dev is a weak reference. The reference from @bus to @dev is the only strong one. We realize at some later time, either with object_property_set_bool(OBJECT(dev),

[PATCH RESEND v3 54/58] qdev: Make qdev_realize() support bus-less devices

2020-06-09 Thread Markus Armbruster
So far, qdev_realize() supports only devices that plug into a bus: argument @bus cannot be null. Extend it to support bus-less devices, too. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/core/qdev.c | 9 ++--- 1 file changed, 6 inse

[PATCH RESEND v3 27/58] usb: Convert uses of usb_create()

2020-06-09 Thread Markus Armbruster
Replace dev = usb_create(bus, type_name); ... object_property_set_bool(OBJECT(dev), true, "realized", &err); by dev = isa_new(type_name); ... usb_realize_and_unref(dev, bus, &err); Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. Cc: Gerd Hoffman

[PATCH RESEND v3 52/58] microbit: Eliminate two local variables in microbit_init()

2020-06-09 Thread Markus Armbruster
Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- hw/arm/microbit.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index d20ebd3aad..8fe42c9d6a 100644 --- a/hw/arm/microb

[PATCH RESEND v3 41/58] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1

2020-06-09 Thread Markus Armbruster
The callers of sysbus_init_child_obj() commonly pass either &child, sizeof(child), or pchild, sizeof(*pchild). Tidy up the few that use sizeof(child_type) instead, mostly to keep future commits simpler. Coccinelle script: @@ expression parent, propname, type; type T; T child;

[PATCH RESEND v3 51/58] sysbus: sysbus_init_child_obj() is now unused, drop

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/sysbus.h | 17 - hw/core/sysbus.c| 8 2 files changed, 25 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 606095ba35..da9f85c58c 100644 --- a/include/hw/sysbus.h ++

[PATCH RESEND v3 50/58] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4

2020-06-09 Thread Markus Armbruster
This is still the same transformation as in the previous commits, but here the sysbus_init_child_obj() and its matching realize in are in separate files. Fortunately, there's just one realize left to convert. Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- hw/arm/aspeed_ast2600

[PATCH RESEND v3 40/58] microbit: Tidy up sysbus_init_child_obj() @child argument

2020-06-09 Thread Markus Armbruster
The callers of sysbus_init_child_obj() commonly pass either &child, sizeof(child), or pchild, sizeof(*pchild). Tidy up two that don't, mostly to keep future commits simpler. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/arm/microbit.c |

Re: [PATCH v2 4/7] vhost: involve device backends in feature negotiation

2020-06-09 Thread Jason Wang
On 2020/6/10 下午12:15, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 11:21:50AM +0800, Jason Wang wrote: On 2020/6/10 上午2:07, Michael S. Tsirkin wrote: +/* + * Default vhost_get_features() feature bits for existing device types that do + * not define their own. + * + * This is a workaround

[PATCH RESEND v3 11/58] qdev: Convert uses of qdev_set_parent_bus() with Coccinelle

2020-06-09 Thread Markus Armbruster
In addition to the qdev_create() patterns converted so far, we have a qdev_set_parent_bus() pattern. Mostly when we embed a device in a parent device rather than allocating it on the heap. This pattern also puts devices in the dangerous "no QOM parent, but plugged into bus" state I explained in r

[PATCH RESEND v3 38/58] macio: Eliminate macio_init_child_obj()

2020-06-09 Thread Markus Armbruster
macio_init_child_obj() has become a trivial wrapper around object_initialize_child_with_props(). Eliminate it, since the general convenience wrapper object_initialize_child() is just as convenient already. Cc: Mark Cave-Ayland Cc: David Gibson Signed-off-by: Markus Armbruster Reviewed-by: Paol

[PATCH RESEND v3 47/58] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 1

2020-06-09 Thread Markus Armbruster
I'm converting from qdev_set_parent_bus()/realize to qdev_realize(); recent commit "qdev: Convert uses of qdev_set_parent_bus() with Coccinelle" explains why. sysbus_init_child_obj() is a wrapper around object_initialize_child_with_props() and qdev_set_parent_bus(). It passes no properties. Conv

[PATCH RESEND v3 58/58] MAINTAINERS: Make section QOM cover hw/core/*bus.c as well

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 10de075638..784bdcd60c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2289,6 +2289,8 @@ R: Eduard

[PATCH RESEND v3 32/58] auxbus: New aux_bus_realize(), pairing with aux_bus_init()

2020-06-09 Thread Markus Armbruster
aux_bus_init() encapsulates the creation of an aux-bus and its aux-to-i2c-bridge device. Create aux_bus_realize() to similarly encapsulate their realization. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- include/hw/misc/auxbus.h | 7 ++

[PATCH RESEND v3 37/58] macio: Convert use of qdev_set_parent_bus()

2020-06-09 Thread Markus Armbruster
Convert qdev_set_parent_bus()/realize to qdev_realize(); recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. Cc: Mark Cave-Ayland Cc: David Gibson Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/misc/macio/macio.c |

[PATCH RESEND v3 53/58] s390x/event-facility: Simplify creation of SCLP event devices

2020-06-09 Thread Markus Armbruster
init_event_facility() creates the SCLP events bus with two SCLP event devices (sclpquiesce and sclp-cpu-hotplug). It leaves the devices unrealized. A comment explains they will be realized "via the bus". The bus's realize method sclp_events_bus_realize() indeed realizes all unrealized devices on

[PATCH RESEND v3 46/58] qdev: Drop qdev_realize() support for null bus

2020-06-09 Thread Markus Armbruster
The "null @bus means main system bus" convenience feature is no longer used. Drop it. Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- hw/core/qdev.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index a1fde

[PATCH RESEND v3 13/58] pci: New pci_new(), pci_realize_and_unref() etc.

2020-06-09 Thread Markus Armbruster
I'm converting from qdev_create()/qdev_init_nofail() to qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. PCI devices use qdev_create() through pci_create() and pci_create_multifunction(). Provide pci_new(), pci_new_multifunction(), and

[PATCH RESEND v3 28/58] usb: usb_create() is now unused, drop

2020-06-09 Thread Markus Armbruster
Cc: Gerd Hoffmann Signed-off-by: Markus Armbruster Reviewed-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini --- include/hw/usb.h | 1 - hw/usb/bus.c | 8 2 files changed, 9 deletions(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index 86093d941a..817dcebbef 100644 --- a/includ

[PATCH RESEND v3 16/58] pci: Convert uses of pci_create() etc. manually

2020-06-09 Thread Markus Armbruster
Same transformation as in the previous commit. Manual, because convincing Coccinelle to transform these cases is not worthwhile. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- hw/sparc64/sun4u.c | 12 1 file changed, 8

[PATCH RESEND v3 57/58] qdev: qdev_init_nofail() is now unused, drop

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/qdev-core.h | 3 +-- hw/core/qdev.c | 29 - 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index ef6137b6a8..7dc10be46f

[PATCH RESEND v3 29/58] usb: Eliminate usb_try_create_simple()

2020-06-09 Thread Markus Armbruster
usb_try_create_simple() is qdev_try_new() and qdev_realize_and_unref() with more verbose error messages. Of its two users, one ignores errors, and the other asserts they are impossible. Make them use qdev_try_new() and qdev_realize_and_unref() directly, and eliminate usb_try_create_simple Cc: Ge

[PATCH RESEND v3 44/58] sysbus: New sysbus_realize(), sysbus_realize_and_unref()

2020-06-09 Thread Markus Armbruster
Sysbus devices almost always plug into the main system bus. qdev_create() even has a convenience feature to make that easy: a null bus argument gets replaced by the main system bus. qdev_realize() and qdev_realize_and_unref() do the same. We can do better. Provide convenience wrappers around qde

[PATCH RESEND v3 23/58] ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle

2020-06-09 Thread Markus Armbruster
Replace dev = ssi_create_slave_no_init(bus, type_name); ... qdev_init_nofail(dev); by dev = qdev_new(type_name); ... qdev_realize_and_unref(dev, bus, &error_fatal); Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. @@ type SSIBus; iden

[PATCH RESEND v3 39/58] sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls

2020-06-09 Thread Markus Armbruster
OBJECT(child) expands to ((Object *)(child)). sysbus_init_child_obj() parameter @child is void *. Pass child instead of OBJECT(child). Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/arm/allwinner-a10.c | 4 ++-- hw/arm/aspeed_ast2600.

[PATCH RESEND v3 33/58] auxbus: Convert a use of qdev_set_parent_bus()

2020-06-09 Thread Markus Armbruster
Convert qdev_set_parent_bus()/qdev_init_nofail() to qdev_realize(); recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/display/xlnx_dp.c | 2 +- hw/misc/auxbus.c | 4

[PATCH RESEND v3 34/58] auxbus: Eliminate aux_create_slave()

2020-06-09 Thread Markus Armbruster
aux_create_slave() has become a trivial wrapper around qdev_new(). There's just one user. Eliminate. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- include/hw/misc/auxbus.h | 7 --- hw/display/xlnx_dp.c | 2 +- hw/misc/auxbus.c

[PATCH RESEND v3 43/58] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2

2020-06-09 Thread Markus Armbruster
The callers of sysbus_init_child_obj() commonly pass either &child, sizeof(child), or pchild, sizeof(*pchild). Tidy up the few that use something else instead, mostly to keep future commits simpler. Coccinelle script: @@ expression parent, propname, type; expression child; type T

[PATCH RESEND v3 35/58] qom: Tidy up a few object_initialize_child() calls

2020-06-09 Thread Markus Armbruster
The callers of object_initialize_child() commonly pass either &child, sizeof(child), or pchild, sizeof(*pchild). Tidy up the few that don't, mostly to keep the next commit simpler. Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by:

[PATCH RESEND v3 21/58] isa: isa_create(), isa_try_create() are now unused, drop

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/isa/isa.h | 2 -- hw/isa/isa-bus.c | 16 2 files changed, 18 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 3b6215fafe..52b61eed88 100644 --- a/include/hw/isa/isa.h +++

[PATCH RESEND v3 25/58] ssi: ssi_create_slave_no_init() is now unused, drop

2020-06-09 Thread Markus Armbruster
Cc: Alistair Francis Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Reviewed-by: Paolo Bonzini --- include/hw/ssi/ssi.h | 1 - hw/ssi/ssi.c | 5 - 2 files changed, 6 deletions(-) diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index 1725b13c32..93f2b8b0be

[PATCH RESEND v3 42/58] hw/arm/armsse: Pass correct child size to sysbus_init_child_obj()

2020-06-09 Thread Markus Armbruster
armsse_init() initializes s->armv7m[i] for all i. It passes the size of the entire array instead of the array element to sysbus_init_child_obj(). Harmless, but fix it anyway. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/arm/armsse.c |

[PATCH RESEND v3 22/58] ssi: ssi_auto_connect_slaves() never does anything, drop

2020-06-09 Thread Markus Armbruster
ssi_auto_connect_slaves(parent, cs_line, bus) iterates over @parent's QOM children @dev of type TYPE_SSI_SLAVE. It puts these on @bus, and sets cs_line[] to qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0). Suspicious: there is no protection against overrunning cs_line[]. Turns out it's safe because

[PATCH RESEND v3 31/58] auxbus: Rename aux_init_bus() to aux_bus_init()

2020-06-09 Thread Markus Armbruster
Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/misc/auxbus.h | 4 ++-- hw/display/xlnx_dp.c | 2 +- hw/misc/auxbus.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/misc/auxbus.h b/i

[PATCH RESEND v3 26/58] usb: New usb_new(), usb_realize_and_unref()

2020-06-09 Thread Markus Armbruster
I'm converting from qdev_create()/qdev_init_nofail() to qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. USB devices use qdev_create() through usb_create(). Provide usb_new() and usb_realize_and_unref() for converting USB devices. Cc:

[PATCH RESEND v3 15/58] pci: Convert uses of pci_create() etc. with Coccinelle

2020-06-09 Thread Markus Armbruster
Replace dev = pci_create(bus, type_name); ... qdev_init_nofail(dev); by dev = pci_new(type_name); ... pci_realize_and_unref(dev, bus, &error_fatal); and similarly for pci_create_multifunction(). Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. C

[PATCH RESEND v3 19/58] isa: Convert uses of isa_create() with Coccinelle

2020-06-09 Thread Markus Armbruster
Replace dev = isa_create(bus, type_name); ... qdev_init_nofail(dev); by dev = isa_new(type_name); ... isa_realize_and_unref(dev, bus, &error_fatal); Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. Coccinelle script: @@ expression dev, b

[PATCH RESEND v3 17/58] pci: pci_create(), pci_create_multifunction() are now unused, drop

2020-06-09 Thread Markus Armbruster
Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/pci/pci.h | 3 --- hw/pci/pci.c | 16 2 files changed, 19 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 66f8ba519b..a4

[PATCH RESEND v3 30/58] qdev: qdev_create(), qdev_try_create() are now unused, drop

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/qdev-core.h | 2 -- hw/core/qdev.c | 48 -- hw/core/sysbus.c | 1 - migration/migration.c | 2 +- 4 files changed, 1 insertion(+), 52 deletions(-) diff --git a/in

[PATCH RESEND v3 24/58] ssi: Convert last use of ssi_create_slave_no_init() manually

2020-06-09 Thread Markus Armbruster
Same transformation as in the previous commit. Manual, because convincing Coccinelle to transform this case is not worthwhile. Cc: Alistair Francis Signed-off-by: Markus Armbruster Acked-by: Alistair Francis Reviewed-by: Paolo Bonzini --- hw/ssi/ssi.c | 5 +++-- 1 file changed, 3 insertions(

[PATCH RESEND v3 18/58] isa: New isa_new(), isa_realize_and_unref() etc.

2020-06-09 Thread Markus Armbruster
I'm converting from qdev_create()/qdev_init_nofail() to qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains why. ISA devices use qdev_create() through isa_create() and isa_try_create(). Provide isa_new(), isa_try_new(), and isa_realize_and_unre

[PATCH RESEND v3 00/58] qdev: Rework how we plug into the parent bus

2020-06-09 Thread Markus Armbruster
Paolo recently suggested "to move the bus argument (and thus qdev_set_parent_bus) to qdev_init"[1], and that it "would be quite large but hopefully scriptable"[2]. Nerd sniped! The series is big, but at least the bigger patches are all mechanical. It is based on my "[PATCH v3 00/24] Fixes around

[PATCH RESEND v3 02/58] Revert "hw/prep: realize the PCI root bus as part of the prep init"

2020-06-09 Thread Markus Armbruster
This reverts commit 685f9a3428f625f580af0123aa95f4838d86cac3. Realizing a device automatically realizes its buses, in device_set_realized(). Realizing them in realize methods is redundant, unless the methods themselves require them to be realized early. raven_pcihost_realizefn() doesn't. Drop t

[PATCH RESEND v3 12/58] qdev: Convert uses of qdev_set_parent_bus() manually

2020-06-09 Thread Markus Armbruster
Same transformation as in the previous commit. Manual, because convincing Coccinelle to transform these cases is somewhere between not worthwhile and infeasible (at least for me). Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/pci-host/p

[PATCH RESEND v3 10/58] qdev: Convert uses of qdev_create() manually

2020-06-09 Thread Markus Armbruster
Same transformation as in the previous commit. Manual, because convincing Coccinelle to transform these cases is somewhere between not worthwhile and infeasible (at least for me). Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- hw/arm/highbank.c | 26 +

[PATCH RESEND v3 07/58] qdev: Convert to qdev_unrealize() with Coccinelle

2020-06-09 Thread Markus Armbruster
For readability, and consistency with qbus_realize(). Coccinelle script: @ depends on !(file in "hw/core/qdev.c")@ typedef DeviceState; DeviceState *dev; symbol false, error_abort; @@ -object_property_set_bool(OBJECT(dev), false, "realized", &error_abort); +qde

[PATCH RESEND v3 14/58] hw/ppc: Eliminate two superfluous QOM casts

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/ppc/mac_newworld.c | 4 ++-- hw/ppc/mac_oldworld.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 69281d7834..2d06

[PATCH RESEND v3 20/58] isa: Convert uses of isa_create(), isa_try_create() manually

2020-06-09 Thread Markus Armbruster
Same transformation as in the previous commit. Manual, because convincing Coccinelle to transform these cases is not worthwhile. Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini --- include/hw/net/ne2000-isa.h | 5 +++-- hw/block/fdc.c | 4 ++-- hw/i386/pc.c

[PATCH RESEND v3 06/58] qdev: Convert to qbus_realize(), qbus_unrealize()

2020-06-09 Thread Markus Armbruster
I'm going to convert device realization to qdev_realize() with the help of Coccinelle. Convert bus realization to qbus_realize() first, to get it out of Coccinelle's way. Readability improves. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini ---

[PATCH RESEND v3 05/58] qdev: Put qdev_new() to use with Coccinelle

2020-06-09 Thread Markus Armbruster
Let's start simple and put qdev_new() to use. Coccinelle script: @ depends on !(file in "hw/core/qdev.c")@ expression type_name; @@ -DEVICE(object_new(type_name)) +qdev_new(type_name) Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by:

[PATCH RESEND v3 08/58] qdev: Convert to qdev_unrealize() manually

2020-06-09 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- include/hw/qdev-core.h | 1 - hw/core/qdev.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index fba29308f7..be6

[PATCH RESEND v3 03/58] Revert "hw/versatile: realize the PCI root bus as part of the versatile init"

2020-06-09 Thread Markus Armbruster
This reverts commit b1af7959a66610669e1a019b9a84f6ed3a7936c6. Realizing a device automatically realizes its buses, in device_set_realized(). Realizing them in realize methods is redundant, unless the methods themselves require them to be realized early. pci_vpb_realize() doesn't. Drop the redun

[PATCH RESEND v3 01/58] qdev: Rename qbus_realize() to qbus_init()

2020-06-09 Thread Markus Armbruster
qbus_realize() does not actually realize. Rename it to qbus_init(). Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- hw/core/bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/core/bus.c b/hw/core/bus.c index 5

Re: [PULL 00/56] virtio,acpi,pci: features, fixes, cleanups, tests

2020-06-09 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200610042613.1459309-1-...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200610042613.1459309-1-...@redhat.com Subject: [PULL 00/56] virtio,acpi,pci: features, fixes, cleanups,

Clarification regarding new qemu-img convert --target-is-zero flag

2020-06-09 Thread Sam Eiderman
Hi, 168468fe19c8 ("qemu-img: Add --target-is-zero to convert") has added a nice functionality for cloud scenarios: * Create a virtual disk * Convert a sparse image (qcow2, vmdk) to the virtual disk using --target-is-zero * Use the virtual disk This saves many unnecessary writes - a qcow2 with 1M

Re: [PATCH v6 4/7] scripts: add coroutine-wrapper.py

2020-06-09 Thread Vladimir Sementsov-Ogievskiy
10.06.2020 00:21, Eric Blake wrote: On 6/9/20 9:13 AM, Vladimir Sementsov-Ogievskiy wrote: We have a very frequent pattern of creating coroutine from function with several arguments:    - create structure to pack parameters    - create _entry function to call original function taking parameters

Re: [PATCH v2 3/7] docs: document non-net VHOST_USER_GET_FEATURES behavior

2020-06-09 Thread Michael S. Tsirkin
On Tue, Jun 09, 2020 at 06:02:14PM +0100, Stefan Hajnoczi wrote: > QEMU enabled several feature bits for non-net devices without allowing > the device backend to control them. This only works when the device > backend implements support for those features. It won't work for new > features like the

Re: [PATCH 0/9] AMD SEV: Cleanup state handling

2020-06-09 Thread David Gibson
On Thu, Jun 04, 2020 at 08:37:47PM +0200, Paolo Bonzini wrote: > On 04/06/20 08:42, David Gibson wrote: > > This series has an assortment of cleanups to the AMD SEV memory > > encryption code. Amongst other things it: > > * Removes the confusion between struct SEVState and enum SevState > > *

Re: [RFC v2 00/18] Refactor configuration of guest memory protection

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 12:11:05PM +0200, Halil Pasic wrote: > On Sat, 6 Jun 2020 18:44:09 +1000 > David Gibson wrote: > > > On Fri, Jun 05, 2020 at 12:55:05PM +0200, Cornelia Huck wrote: > > > On Thu, 21 May 2020 13:42:46 +1000 > > > David Gibson wrote: > > > > > > > A number of hardware platf

Re: [RFC v2 18/18] guest memory protection: Alter virtio default properties for protected guests

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 05:40:46PM +0200, Halil Pasic wrote: > On Tue, 9 Jun 2020 12:16:41 +0200 > Cornelia Huck wrote: > > > On Sun, 7 Jun 2020 13:07:35 +1000 > > David Gibson wrote: > > > > > On Sat, Jun 06, 2020 at 04:21:31PM -0400, Michael S. Tsirkin wrote: > > > > On Thu, May 21, 2020 at 0

Re: [PATCH v5 0/2] Makefile: libfdt: build only the strict necessary

2020-06-09 Thread David Gibson
On Mon, Jun 08, 2020 at 01:14:31PM +0200, Claudio Fontana wrote: > On 6/8/20 11:52 AM, David Gibson wrote: > > On Sun, Jun 07, 2020 at 08:53:52AM +0200, Thomas Huth wrote: > >> Hi David, > >> > >> could you maybe take this through your ppc tree? > > > > Sounds reasonable, but this version doesn't

Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 06:28:39PM +0200, Halil Pasic wrote: > On Tue, 9 Jun 2020 17:47:47 +0200 > Claudio Imbrenda wrote: > > > On Tue, 9 Jun 2020 11:41:30 +0200 > > Halil Pasic wrote: > > > > [...] > > > > > I don't know. Janosch could answer that, but he is on vacation. Adding > > > Claudio

Re: [PATCH v5] numa: forbid '-numa node,mem' for 5.1 and newer machine types

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 09:56:35AM -0400, Igor Mammedov wrote: > Deprecation period is run out and it's a time to flip the switch > introduced by cd5ff8333a. Disable legacy option for new machine > types (since 5.1) and amend documentation. > > '-numa node,memdev' shall be used instead of disable

[PULL 51/56] acpi: make build_madt() more generic.

2020-06-09 Thread Michael S. Tsirkin
From: Gerd Hoffmann Remove PCMachineState dependency from build_madt(). Pass AcpiDeviceIf as separate argument instead of depending on PCMachineState->acpi_dev. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20200520132003.9492-6-kra..

Re: [RFC v2 18/18] guest memory protection: Alter virtio default properties for protected guests

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 12:16:41PM +0200, Cornelia Huck wrote: > On Sun, 7 Jun 2020 13:07:35 +1000 > David Gibson wrote: > > > On Sat, Jun 06, 2020 at 04:21:31PM -0400, Michael S. Tsirkin wrote: > > > On Thu, May 21, 2020 at 01:43:04PM +1000, David Gibson wrote: > > > > The default behaviour fo

[PULL 49/56] virtio: add vhost-user-vsock base device

2020-06-09 Thread Michael S. Tsirkin
From: Stefano Garzarella This patch introduces a vhost-user device for vsock, using the vhost-vsock-common parent class. The vhost-user-vsock device can be used to implement the virtio-vsock device emulation in user-space. Signed-off-by: Stefano Garzarella Message-Id: <20200522122512.87413-3-s

Re: [PATCH v2 0/7] virtio: enable VIRTIO_F_RING_PACKED for all devices

2020-06-09 Thread Michael S. Tsirkin
On Tue, Jun 09, 2020 at 06:02:11PM +0100, Stefan Hajnoczi wrote: > v2: > * Add libvhost-user VHOST_USER_GET_FEATURES patch to start reporting feature >bits correctly (already reviewed by Marc-André Lureau) > * Rephrase doc comments and drop vhost_get_default_features() [Jason] > * Simplify

[PULL 52/56] acpi: create acpi-common.c and move madt code

2020-06-09 Thread Michael S. Tsirkin
From: Gerd Hoffmann We'll need madt support for microvm. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Message-Id: <20200520132003.9492-7-kra...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-comm

[PULL 54/56] acpi: fadt: add hw-reduced sleep register support

2020-06-09 Thread Michael S. Tsirkin
From: Gerd Hoffmann Add fields to struct AcpiFadtData and update build_fadt() to properly generate sleep register entries. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Message-Id: <20200520132003.9492-9-kra...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Ts

[PULL 03/56] hw/acpi/nvdimm: add a helper to augment SRAT generation

2020-06-09 Thread Michael S. Tsirkin
From: Vishal Verma NVDIMMs can belong to their own proximity domains, as described by the NFIT. In such cases, the SRAT needs to have Memory Affinity structures in the SRAT for these NVDIMMs, otherwise Linux doesn't populate node data structures properly during NUMA initialization. See the follow

Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 08:44:02AM +0200, Cornelia Huck wrote: > On Mon, 8 Jun 2020 19:00:45 +0200 > Halil Pasic wrote: > > > > > I'm also not 100% sure about migration... would it make sense to > > > discuss all of this in the context of the cross-arch patchset? It seems > > > power has similar

[PULL 43/56] Support adding individual regions in libvhost-user

2020-06-09 Thread Michael S. Tsirkin
From: Raphael Norwitz When the VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS is enabled, qemu will transmit memory regions to a backend individually using the new message VHOST_USER_ADD_MEM_REG. With this change vhost-user backends built with libvhost-user can now map in new memory regions when VHOST

[PULL 30/56] hw/pci-host/prep: Correct RAVEN bus bridge memory region size

2020-06-09 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé memory_region_set_size() handle the 16 Exabytes limit by special-casing the UINT64_MAX value. This is not a problem for the 32-bit maximum, 4 GiB. By using the UINT32_MAX value, the bm-raven MemoryRegion ends up missing 1 byte: $ qemu-system-ppc -M prep -S -monitor

Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV

2020-06-09 Thread David Gibson
On Tue, Jun 09, 2020 at 12:44:39PM -0400, Michael S. Tsirkin wrote: > On Tue, Jun 09, 2020 at 06:28:39PM +0200, Halil Pasic wrote: > > On Tue, 9 Jun 2020 17:47:47 +0200 > > Claudio Imbrenda wrote: > > > > > On Tue, 9 Jun 2020 11:41:30 +0200 > > > Halil Pasic wrote: > > > > > > [...] > > > > >

[PULL 48/56] vhost-vsock: add vhost-vsock-common abstraction

2020-06-09 Thread Michael S. Tsirkin
From: Stefano Garzarella This patch prepares the introduction of vhost-user-vsock, moving the common code usable for both vhost-vsock and vhost-user-vsock devices, in the new vhost-vsock-common parent class. While moving the code, fixed checkpatch warnings about block comments. Signed-off-by: S

[PULL 26/56] virtio-balloon: Provide an interface for free page reporting

2020-06-09 Thread Michael S. Tsirkin
From: Alexander Duyck Add support for free page reporting. The idea is to function very similar to how the balloon works in that we basically end up madvising the page as not being used. However we don't really need to bother with any deflate type logic since the page will be faulted back into th

[PULL 44/56] Support individual region unmap in libvhost-user

2020-06-09 Thread Michael S. Tsirkin
From: Raphael Norwitz When the VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS protocol feature is enabled, on memory hot-unplug qemu will transmit memory regions to remove individually using the new message VHOST_USER_REM_MEM_REG message. With this change, vhost-user backends build with libvhost-user

[PULL 47/56] hw/pci: Fix crash when running QEMU with "-nic model=rocker"

2020-06-09 Thread Michael S. Tsirkin
From: Thomas Huth QEMU currently aborts when being started with "-nic model=rocker" or with "-net nic,model=rocker". This happens because the "rocker" device is not a normal NIC but a switch, which has different properties. Thus we should only consider real NIC devices for "-nic" and "-net". Thes

[PULL 37/56] Add vhost-user helper to get MemoryRegion data

2020-06-09 Thread Michael S. Tsirkin
From: Raphael Norwitz When setting the memory tables, qemu uses a memory region's userspace address to look up the region's MemoryRegion struct. Among other things, the MemoryRegion contains the region's offset and associated file descriptor, all of which need to be sent to the backend. With VHO

[PULL 39/56] Transmit vhost-user memory regions individually

2020-06-09 Thread Michael S. Tsirkin
From: Raphael Norwitz With this change, when the VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS protocol feature has been negotiated, Qemu no longer sends the backend all the memory regions in a single message. Rather, when the memory tables are set or updated, a series of VHOST_USER_ADD_MEM_REG and V

[PULL 56/56] Fix parameter type in vhost migration log path

2020-06-09 Thread Michael S. Tsirkin
From: Raphael Norwitz The ‘enable’ parameter to the vhost_migration_log() function is given as an int, but "true"/"false" values are passed in wherever it is invoked. Inside the function itself it is only ever compared with bool values. Therefore the parameter value itself should be changed to bo

[PULL 53/56] acpi: madt: skip pci override on pci-less systems.

2020-06-09 Thread Michael S. Tsirkin
From: Gerd Hoffmann Needed for microvm. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200520132003.9492-8-kra...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-common.h | 3 ++- hw

  1   2   3   4   5   6   7   >