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

2020-06-10 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, _fatal); @ depends on !(file in

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

2020-06-10 Thread Markus Armbruster
All users of object_initialize_child() pass the obvious child size argument. Almost all pass _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-10 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 41/58] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1

2020-06-10 Thread Markus Armbruster
The callers of sysbus_init_child_obj() commonly pass either , 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-10 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-10 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 ---

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

2020-06-10 Thread Markus Armbruster
The callers of sysbus_init_child_obj() commonly pass either , 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 | 4

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

2020-06-10 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,

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

2020-06-10 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-10 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 V2] virtio-pci: fix queue_enable write

2020-06-10 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.

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

2020-06-10 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: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV

2020-06-10 Thread David Hildenbrand
On 10.06.20 06:31, David Gibson wrote: > 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

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

2020-06-10 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-10 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

[Bug 1882065] Re: Could this cause OOB bug ?

2020-06-10 Thread r1ng0hacking
You must start the trace function of QEMU to trigger this BUG! -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1882065 Title: Could this cause OOB bug ? Status in QEMU: New Bug description: In

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

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

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

2020-06-10 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 ---

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

2020-06-10 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 v2 4/7] vhost: involve device backends in feature negotiation

2020-06-10 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

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

2020-06-10 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

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

2020-06-10 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

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

2020-06-10 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 +

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

2020-06-10 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

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

2020-06-10 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-10 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

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

2020-06-10 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] virtio-pci: fix queue_enable write

2020-06-10 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

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

2020-06-10 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

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

2020-06-10 Thread Philippe Mathieu-Daudé
On 6/10/20 7:32 AM, Markus Armbruster wrote: > 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

Re: [PATCH v2 1/1] tricore: added triboard with tc27x_soc

2020-06-10 Thread Bastian Koppelmann
Hi, thanks for the patch. In general this looks good to me. However, a have a few nitpicks. On Tue, Jun 09, 2020 at 05:25:53PM +0200, David Brenken wrote: > From: Andreas Konopik > +static const int tc27x_soc_irqmap[] = { > +}; Since this is empty, it's best to just remove it. > + > +static

[PATCH v7 5/9] acpi: factor out fw_cfg_add_acpi_dsdt()

2020-06-10 Thread Gerd Hoffmann
Add helper function to add fw_cfg device, also move code to hw/i386/fw_cfg.c. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- hw/i386/fw_cfg.h | 1 + hw/i386/acpi-build.c | 24 +--- hw/i386/fw_cfg.c | 28

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

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 10:57:26AM +0200, Stefano Garzarella wrote: > On Wed, Jun 10, 2020 at 01:43:51PM +0800, Jason Wang wrote: > > Spec said: The driver uses this to selectively prevent the device from > > executing requests from this virtqueue. 1 - enabled; 0 - disabled. > > > > Though write

[PATCH v7 2/7] block/io: refactor coroutine wrappers

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
Most of our coroutine wrappers already follow this convention: We have 'coroutine_fn bdrv_co_()' as the core function, and a wrapper 'bdrv_()' which does parameters packing and call bdrv_run_co(). The only outsiders are the bdrv_prwv_co and bdrv_common_block_status_above wrappers. Let's refactor

[PATCH v7 0/7] coroutines: generate wrapper code

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
Hi all! The aim of the series is to reduce code-duplication and writing parameters structure-packing by hand around coroutine function wrappers. Benefits: - no code duplication - less indirection v7: apply Eric's suggestions 02: fix grammar in commit msg, add Eric's r-b 04: - don't create

[PATCH v7 5/7] block: generate coroutine-wrapper code

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
Use code generation implemented in previous commit to generated coroutine wrappers in block.c and block/io.c Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/coroutines.h| 6 +- include/block/block.h | 16 ++-- block.c | 73 ---

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

2020-06-10 Thread Viktor Mihajlovski
On 6/10/20 12:24 PM, David Hildenbrand wrote: On 10.06.20 12:07, David Gibson wrote: On Wed, Jun 10, 2020 at 09:22:45AM +0200, David Hildenbrand wrote: On 10.06.20 06:31, David Gibson wrote: On Tue, Jun 09, 2020 at 12:44:39PM -0400, Michael S. Tsirkin wrote: On Tue, Jun 09, 2020 at

[PATCH v9 59/61] target/riscv: vector register gather instruction

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 9 +++ target/riscv/insn32.decode | 3 + target/riscv/insn_trans/trans_rvv.inc.c | 78 + target/riscv/vector_helper.c| 60 +++

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

2020-06-10 Thread Halil Pasic
On Tue, 9 Jun 2020 18:05:59 +0200 Cornelia Huck wrote: > Which devices are compatible in the end? It seems the only ones that > are known to be working are virtio-ccw devices with IOMMU_PLATFORM on. > virtio-pci devices and non-virtio ccw (vfio-ccw, 3270) seem to be out, > as far as I understand

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

2020-06-10 Thread Halil Pasic
On Wed, 10 Jun 2020 12:24:14 +0200 David Hildenbrand wrote: > On 10.06.20 12:07, David Gibson wrote: > > On Wed, Jun 10, 2020 at 09:22:45AM +0200, David Hildenbrand wrote: > >> On 10.06.20 06:31, David Gibson wrote: > >>> On Tue, Jun 09, 2020 at 12:44:39PM -0400, Michael S. Tsirkin wrote: >

[PATCH v9 60/61] target/riscv: vector compress instruction

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 5 target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.inc.c | 32 + target/riscv/vector_helper.c| 26

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

2020-06-10 Thread David Hildenbrand
On 10.06.20 15:19, Viktor Mihajlovski wrote: > > > On 6/10/20 12:24 PM, David Hildenbrand wrote: >> On 10.06.20 12:07, David Gibson wrote: >>> On Wed, Jun 10, 2020 at 09:22:45AM +0200, David Hildenbrand wrote: On 10.06.20 06:31, David Gibson wrote: > On Tue, Jun 09, 2020 at 12:44:39PM

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

2020-06-10 Thread Kevin Wolf
Am 10.06.2020 um 14:19 hat Sam Eiderman geschrieben: > Thanks David, > > Yes, I imaging the following use case: > > disk.vmdk is a 50 GB disk that contains 12 MB binary of zeroes in its > beginning. > /dev/sda is a raw disk containing garbage > > I invoke: > qemu-img convert disk.vmdk -O raw

what is the difference to transfer elf execute file or binary file on "-kernel" paramter?

2020-06-10 Thread tugouxp
what is the difference to transfer elf execute file or binary file on "-kernel" paramter? is it the same and all be reconganized rightly for qemu? thank you!

[PATCH 0/2] qcow2: seriously improve savevm performance

2020-06-10 Thread Denis V. Lunev
This series do standard basic things: - it creates intermediate buffer for all writes from QEMU migration code to QCOW2 image, - this buffer is sent to disk asynchronously, allowing several writes to run in parallel. In general, migration code is fantastically inefficent (by observation),

[PATCH v8 03/34] qcow2: Add calculate_l2_meta()

2020-06-10 Thread Alberto Garcia
handle_alloc() creates a QCowL2Meta structure in order to update the image metadata and perform the necessary copy-on-write operations. This patch moves that code to a separate function so it can be used from other places. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz ---

[PATCH v8 11/34] qcow2: Add offset_into_subcluster() and size_to_subclusters()

2020-06-10 Thread Alberto Garcia
Like offset_into_cluster() and size_to_clusters(), but for subclusters. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/qcow2.h b/block/qcow2.h index 2503374677..4fe31adfd3 100644 --- a/block/qcow2.h

[PATCH v8 15/34] qcow2: Add qcow2_get_subcluster_range_type()

2020-06-10 Thread Alberto Garcia
There are situations in which we want to know how many contiguous subclusters of the same type there are in a given cluster. This can be done by simply iterating over the subclusters and repeatedly calling qcow2_get_subcluster_type() for each one of them. However once we determined the type of a

[PATCH v8 13/34] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

2020-06-10 Thread Alberto Garcia
Extended L2 entries are 128-bit wide: 64 bits for the entry itself and 64 bits for the subcluster allocation bitmap. In order to support them correctly get/set_l2_entry() need to be updated so they take the entry width into account in order to calculate the correct offset. This patch also adds

[PATCH v8 07/34] qcow2: Document the Extended L2 Entries feature

2020-06-10 Thread Alberto Garcia
Subcluster allocation in qcow2 is implemented by extending the existing L2 table entries and adding additional information to indicate the allocation status of each subcluster. This patch documents the changes to the qcow2 format and how they affect the calculation of the L2 cache size.

[PATCH v8 12/34] qcow2: Add l2_entry_size()

2020-06-10 Thread Alberto Garcia
qcow2 images with subclusters have 128-bit L2 entries. The first 64 bits contain the same information as traditional images and the last 64 bits form a bitmap with the status of each individual subcluster. Because of that we cannot assume that L2 entries are sizeof(uint64_t) anymore. This

[PATCH v8 27/34] qcow2: Add subcluster support to handle_alloc_space()

2020-06-10 Thread Alberto Garcia
The bdrv_co_pwrite_zeroes() call here fills complete clusters with zeroes, but it can happen that some subclusters are not part of the write request or the copy-on-write. This patch makes sure that only the affected subclusters are overwritten. A potential improvement would be to also fill with

[PATCH v8 21/34] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-06-10 Thread Alberto Garcia
The logic of this function remains pretty much the same, except that it uses count_contiguous_subclusters(), which combines the logic of count_contiguous_clusters() / count_contiguous_clusters_unallocated() and checks individual subclusters. qcow2_cluster_to_subcluster_type() is not necessary as

[PATCH v9 51/61] target/riscv: vmfirst find-first-set mask bit

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 2 ++ target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.inc.c | 32 + target/riscv/vector_helper.c| 19 +++ 4

[PATCH v2 2/2] qemu-options.hx: Document hmat-lb and hmat-cache order

2020-06-10 Thread Michal Privoznik
To simplify internal implementation the hmat-cache parsing code expects hmat-lb to be already parsed. This means, that hmat-lb arguments must come before hmat-cache. Document this restriction so that management applications can follow it. Signed-off-by: Michal Privoznik --- qemu-options.hx | 3

[PATCH v9 56/61] target/riscv: integer scalar move instruction

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.inc.c | 60 + target/riscv/internals.h| 6 +++ 3 files changed, 67 insertions(+) diff --git

[PATCH v9 53/61] target/riscv: vector iota instruction

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 5 + target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.inc.c | 27 +++ target/riscv/vector_helper.c| 29

[PATCH v9 54/61] target/riscv: vector element index instruction

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 5 + target/riscv/insn32.decode | 2 ++ target/riscv/insn_trans/trans_rvv.inc.c | 25 + target/riscv/vector_helper.c| 24

Re: [RFC] hw: nios2: update interrupt_request when STATUS_PIE disabled

2020-06-10 Thread Thomas Huth
On 09/06/2020 10.39, Wu, Wentong wrote: > Hi @Thomas Huth, > It's my first time to send patch in qemu community, not sure if there is > something wrong sending patch like below and I'm happy to receive any > suggestions. And by the way, could you please help review the patch? Hi, it would be

[PATCH V2] Rename use_acpi_pci_hotplug to more appropriate use_acpi_hotplug_bridge

2020-06-10 Thread Ani Sinha
Currently, the option use_acpi_pci_hotplug is being used to control device hotplug capability using ACPI for slots of cold plugged bridges. Hence, we are renaming this option to better reflect what it actually does. Change-Id: I2a6ab47e80fa2bc9504ce88e063d710efaceb842 Signed-off-by: Ani Sinha

Re: [PATCH 00/16] Crazy shit around -global (pardon my french)

2020-06-10 Thread John Snow
On 6/5/20 10:56 AM, Markus Armbruster wrote: > There are three ways to configure backends: > > * -nic, -serial, -drive, ... (onboard devices) > > * Set the property with -device, or, if you feel masochistic, with > -set device (pluggable devices) > > * Set the property with -global (both)

[PATCH 1/2] aio: allow to wait for coroutine pool from different coroutine

2020-06-10 Thread Denis V. Lunev
The patch preserves the constraint that the only waiter is allowed. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Max Reitz CC: Vladimir Sementsov-Ogievskiy CC: Denis Plotnikov --- block/aio_task.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 2/2] qcow2: improve savevm performance

2020-06-10 Thread Denis V. Lunev
This patch does 2 standard basic things: - it creates intermediate buffer for all writes from QEMU migration code to QCOW2 image, - this buffer is sent to disk asynchronously, allowing several writes to run in parallel. In general, migration code is fantastically inefficent (by observation),

[PATCH v8 01/34] qcow2: Make Qcow2AioTask store the full host offset

2020-06-10 Thread Alberto Garcia
The file_cluster_offset field of Qcow2AioTask stores a cluster-aligned host offset. In practice this is not very useful because all users(*) of this structure need the final host offset into the cluster, which they calculate using host_offset = file_cluster_offset + offset_into_cluster(s,

[PATCH v8 08/34] qcow2: Add dummy has_subclusters() function

2020-06-10 Thread Alberto Garcia
This function will be used by the qcow2 code to check if an image has subclusters or not. At the moment this simply returns false. Once all patches needed for subcluster support are ready then QEMU will be able to create and read images with subclusters and this function will return the actual

[PATCH v8 24/34] qcow2: Add subcluster support to check_refcounts_l2()

2020-06-10 Thread Alberto Garcia
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an image has subclusters. Instead, the individual 'all zeroes' bits must be used. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/qcow2-refcount.c

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

2020-06-10 Thread Sam Eiderman
Excuse me, Vladimir already pointed out in the first comment that it will skip writing real zeroes later. Sam On Wed, Jun 10, 2020 at 6:26 PM Sam Eiderman wrote: > > Thanks for the clarification Kevin, > > Well first I want to discuss unallocated blocks. > From my understanding operating

[PATCH v9 58/61] target/riscv: vector slide instructions

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 17 target/riscv/insn32.decode | 7 ++ target/riscv/insn_trans/trans_rvv.inc.c | 18 target/riscv/vector_helper.c| 114 4 files

Re: [PATCH 1/2] nbd/server: Avoid long error message assertions CVE-2020-10761

2020-06-10 Thread Eric Blake
On 6/10/20 3:57 AM, Vladimir Sementsov-Ogievskiy wrote: 08.06.2020 21:26, Eric Blake wrote: Ever since commit 36683283 (v2.8), the server code asserts that error strings sent to the client are well-formed per the protocol by not exceeding the maximum string length of 4096.  At the time the

[PATCH v9 57/61] target/riscv: floating-point scalar move instructions

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 2 + target/riscv/insn_trans/trans_rvv.inc.c | 49 + 2 files changed, 51 insertions(+) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index

[PATCH v9 55/61] target/riscv: integer extract instruction

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.inc.c | 116 2 files changed, 117 insertions(+) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index

AW: [PATCH v2 1/1] tricore: added triboard with tc27x_soc

2020-06-10 Thread Hofstetter, Georg (EFS-GH2)
Hello Bastian, Thanks for your feedback, I like your proposals. > Also what do the _U and _C suffixes mean? I could not find them in the user > manual [1]. See TC27X UM chapter 3.2 "Contents of the Segments" "CPUx default attributes for these segments: non-cached" vs "cached" These regions are

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

2020-06-10 Thread LIU Zhiwei
Vector extension is default off. The only way to use vector extension is 1. use cpu rv32 or rv64 2. turn on it by command line "-cpu rv64,x-v=true,vlen=128,elen=64,vext_spec=v0.7.1". vlen is the vector register length, default value is 128 bit. elen is the max operator size in bits, default

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

2020-06-10 Thread Halil Pasic
On Wed, 10 Jun 2020 14:29:29 +1000 David Gibson 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: > > > > > > [...] > > > > > > > I

Re: [PATCH v4 02/21] vfio: Convert to ram_block_discard_disable()

2020-06-10 Thread David Hildenbrand
On 10.06.20 15:04, Tony Krowiak wrote: > > > On 6/10/20 7:54 AM, David Hildenbrand wrote: >> VFIO is (except devices without a physical IOMMU or some mediated devices) >> incompatible with discarding of RAM. The kernel will pin basically all VM >> memory. Let's convert to

[PATCH v8 10/34] qcow2: Add offset_to_sc_index()

2020-06-10 Thread Alberto Garcia
For a given offset, return the subcluster number within its cluster (i.e. with 32 subclusters per cluster it returns a number between 0 and 31). Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 5 + 1 file changed, 5

[PATCH v8 33/34] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters

2020-06-10 Thread Alberto Garcia
This function is only used by qcow2_expand_zero_clusters() to downgrade a qcow2 image to a previous version. It is however not possible to downgrade an image with extended L2 entries because older versions of qcow2 do not have this feature. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake

[PATCH v8 04/34] qcow2: Split cluster_needs_cow() out of count_cow_clusters()

2020-06-10 Thread Alberto Garcia
We are going to need it in other places. Signed-off-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/block/qcow2-cluster.c

[PATCH v8 05/34] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied()

2020-06-10 Thread Alberto Garcia
When writing to a qcow2 file there are two functions that take a virtual offset and return a host offset, possibly allocating new clusters if necessary: - handle_copied() looks for normal data clusters that are already allocated and have a reference count of 1. In those clusters we

[PATCH v8 17/34] qcow2: Add cluster type parameter to qcow2_get_host_offset()

2020-06-10 Thread Alberto Garcia
This function returns an integer that can be either an error code or a cluster type (a value from the QCow2ClusterType enum). We are going to start using subcluster types instead of cluster types in some functions so it's better to use the exact data types instead of integers for clarity and in

[PATCH v8 30/34] qcow2: Add prealloc field to QCowL2Meta

2020-06-10 Thread Alberto Garcia
This field allows us to indicate that the L2 metadata update does not come from a write request with actual data but from a preallocation request. For traditional images this does not make any difference, but for images with extended L2 entries this means that the clusters are allocated normally

[PATCH v8 09/34] qcow2: Add subcluster-related fields to BDRVQcow2State

2020-06-10 Thread Alberto Garcia
This patch adds the following new fields to BDRVQcow2State: - subclusters_per_cluster: Number of subclusters in a cluster - subcluster_size: The size of each subcluster, in bytes - subcluster_bits: No. of bits so 1 << subcluster_bits = subcluster_size Images without subclusters are treated as if

[PATCH v8 31/34] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-06-10 Thread Alberto Garcia
Now that the implementation of subclusters is complete we can finally add the necessary options to create and read images with this feature, which we call "extended L2 entries". Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- qapi/block-core.json | 7 +++ block/qcow2.h

[PATCH v8 18/34] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*

2020-06-10 Thread Alberto Garcia
In order to support extended L2 entries some functions of the qcow2 driver need to start dealing with subclusters instead of clusters. qcow2_get_host_offset() is modified to return the subcluster type instead of the cluster type, and all callers are updated to replace all values of

[PATCH v8 20/34] qcow2: Add subcluster support to calculate_l2_meta()

2020-06-10 Thread Alberto Garcia
If an image has subclusters then there are more copy-on-write scenarios that we need to consider. Let's say we have a write request from the middle of subcluster #3 until the end of the cluster: 1) If we are writing to a newly allocated cluster then we need copy-on-write. The previous contents

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

2020-06-10 Thread Sam Eiderman
Thanks for the clarification Kevin, Well first I want to discuss unallocated blocks. >From my understanding operating systems do not rely on disks to be zero initialized, on the contrary, physical disks usually contain garbage. So an unallocated block should never be treated as zero by any real

[PATCH v9 52/61] target/riscv: set-X-first mask bit

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 4 ++ target/riscv/insn32.decode | 3 ++ target/riscv/insn_trans/trans_rvv.inc.c | 28 +++ target/riscv/vector_helper.c| 63 + 4

Re: [PATCH] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 09:47:52AM -0400, Michael S. Tsirkin wrote: > Memory API documentation documents valid .min_access_size and .max_access_size > fields and explains that any access outside these boundaries is blocked. > > This is what devices seem to assume. > > However this is not what

[PATCH] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"

2020-06-10 Thread Michael S. Tsirkin
Memory API documentation documents valid .min_access_size and .max_access_size fields and explains that any access outside these boundaries is blocked. This is what devices seem to assume. However this is not what the implementation does: it simply ignores the boundaries unless there's an

Re: [PATCH] hw/vfio/pci-quirks: Fix broken legacy IGD passthrough

2020-06-10 Thread Thomas Huth
On 10/06/2020 15.16, Laurent Vivier wrote: > Le 10/06/2020 à 09:50, Thomas Huth a écrit : >> On 10/06/2020 09.31, Philippe Mathieu-Daudé wrote: >>> On 6/10/20 5:51 AM, Thomas Huth wrote: The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h

Failure of test 'basic gdbstub support'

2020-06-10 Thread Robert Henry
The newish test 'basic gdbstub support' fails for me on an out-of-the-box build on a host x86_64. (See below for the config.log head.) Is this failure expected? If so, where can I see that in the various CI engines you have running them? In digging through the test driver python code in

Re: [PATCH v7 0/9] acpi: i386 tweaks

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 01:40:02PM +0200, Igor Mammedov wrote: > On Wed, 10 Jun 2020 11:41:22 +0200 > Gerd Hoffmann wrote: > > > First batch of microvm patches, some generic acpi stuff. > > Split the acpi-build.c monster, specifically split the > > pc and q35 and pci bits into a separate file

[PATCH v8 06/34] qcow2: Add get_l2_entry() and set_l2_entry()

2020-06-10 Thread Alberto Garcia
The size of an L2 entry is 64 bits, but if we want to have subclusters we need extended L2 entries. This means that we have to access L2 tables and slices differently depending on whether an image has extended L2 entries or not. This patch replaces all l2_slice[] accesses with calls to

[PATCH v8 22/34] qcow2: Add subcluster support to zero_in_l2_slice()

2020-06-10 Thread Alberto Garcia
The QCOW_OFLAG_ZERO bit that indicates that a cluster reads as zeroes is only used in standard L2 entries. Extended L2 entries use individual 'all zeroes' bits for each subcluster. This must be taken into account when updating the L2 entry and also when deciding that an existing entry does not

[PATCH v8 00/34] Add subcluster allocation to qcow2

2020-06-10 Thread Alberto Garcia
Hi, here's the new version of the patches to add subcluster allocation support to qcow2. Please refer to the cover letter of the first version for a full description of the patches: https://lists.gnu.org/archive/html/qemu-block/2019-10/msg00983.html The big change here is that now when an

[PATCH v8 25/34] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2()

2020-06-10 Thread Alberto Garcia
The L2 bitmap needs to be updated after each write to indicate what new subclusters are now allocated. This needs to happen even if the cluster was already allocated and the L2 entry was otherwise valid. In some cases however a write operation doesn't need change the L2 bitmap (because all

[PATCH v8 02/34] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-06-10 Thread Alberto Garcia
qcow2_get_cluster_offset() takes an (unaligned) guest offset and returns the (aligned) offset of the corresponding cluster in the qcow2 image. In practice none of the callers need to know where the cluster starts so this patch makes the function calculate and return the final host offset

[Bug 1674117] Re: Qemu VM start kills Pulseaudio

2020-06-10 Thread Thomas Huth
Looking through old bug tickets... can you still reproduce this issue with the latest version of QEMU? Or could we close this ticket nowadays? ** Changed in: qemu Status: New => Incomplete -- You received this bug notification because you are a member of qemu- devel-ml, which is

[PATCH v9 50/61] target/riscv: vector mask population count vmpopc

2020-06-10 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/helper.h | 2 ++ target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.inc.c | 32 + target/riscv/vector_helper.c| 20 4

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

2020-06-10 Thread Halil Pasic
On Wed, 10 Jun 2020 10:48:42 +0200 Cornelia Huck wrote: > On Wed, 10 Jun 2020 14:39:22 +1000 > David Gibson wrote: > > > 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

  1   2   3   4   5   >