Re: [PATCH 06/24] armv7m: Bury unwanted "ARM,bitband-memory" devices

2020-05-24 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 18 May 2020 at 06:04, Markus Armbruster wrote: >> >> These devices are optional, and enabled by property "enable-bitband". >> armv7m_instance_init() creates them unconditionally, because the >> property has not been set then. armv7m_realize() realizes them only

Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix

2020-05-24 Thread Markus Armbruster
Paolo Bonzini writes: > On 08/05/20 12:49, Markus Armbruster wrote: >> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c >> Fixes: Coverity CID 1428754 >> Signed-off-by: Markus Armbruster >> --- >> cpus.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/cpus.c

Re: [PATCH] hw/pci-bridge/dec: Remove dead debug code

2020-05-24 Thread David Gibson
On Mon, May 25, 2020 at 05:39:10AM +0200, Philippe Mathieu-Daudé wrote: > Remove debug code never used since added in commit e1c6bbabee30. > > Signed-off-by: Philippe Mathieu-Daudé Applied to ppc-for-5.1, thanks. > --- > hw/pci-bridge/dec.c | 10 -- > 1 file changed, 10 deletions(-) >

Re: [PATCH v3] spapr: Add a new level of NUMA for GPUs

2020-05-24 Thread David Gibson
On Fri, May 22, 2020 at 02:53:33PM -0500, Reza Arbab wrote: > NUMA nodes corresponding to GPU memory currently have the same > affinity/distance as normal memory nodes. Add a third NUMA associativity > reference point enabling us to give GPU nodes more distance. > > This is guest visible

Re: [PATCH] hw/nvram/mac_nvram: Convert debug printf()s to trace events

2020-05-24 Thread David Gibson
On Sun, May 24, 2020 at 06:51:26PM +0200, Philippe Mathieu-Daudé wrote: > Convert NVR_DPRINTF() to trace events and remove ifdef'ry. > > Signed-off-by: Philippe Mathieu-Daudé Applied to ppc-for-5.1, thanks. > --- > hw/nvram/mac_nvram.c | 17 +++-- > hw/nvram/trace-events | 4

Re: [PATCH v3] spapr: Add a new level of NUMA for GPUs

2020-05-24 Thread David Gibson
On Fri, May 22, 2020 at 03:08:56PM -0500, Reza Arbab wrote: > On Fri, May 22, 2020 at 02:53:33PM -0500, Reza Arbab wrote: > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -889,10 +889,16 @@ static int spapr_dt_rng(void *fdt) > > static void spapr_dt_rtas(SpaprMachineState *spapr, void

Re: [PATCH] configure: Do not ignore malloc value

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/25/20 12:12 AM, Leonid Bloch wrote: > From: Leonid Bloch > > Not checking the value of malloc will cause a warning with GCC 10.1, > which may result in configuration failure, with the following line in > config.log: > > config-temp/qemu-conf.c:2:18: error: ignoring return value of ‘malloc’

Re: [PATCH 3/5] vhost-user-blk: add VIRTIO_F_RING_PACKED feature bit

2020-05-24 Thread Raphael Norwitz
On Fri, May 22, 2020 at 1:20 PM Stefan Hajnoczi wrote: > > Vhost devices have a list of feature bits that the device backend is > allowed to control. The VIRTIO_F_RING_PACKED feature is a feature that > must be negotiated through all the way to the device backend. Add it so > the device backend

Re: [PATCH 4/5] vhost-scsi: add VIRTIO_F_VERSION_1 and VIRTIO_F_RING_PACKED

2020-05-24 Thread Raphael Norwitz
On Fri, May 22, 2020 at 1:19 PM Stefan Hajnoczi wrote: > > Let vhost-scsi and vhost-user-scsi device backends determine whether > VIRTIO 1.0 and packed virtqueues are supported. It doesn't make sense to > handle these feature bits in QEMU since the device backend needs to > support them if we

Re: [PATCH v3 2/2] vhost-user-blk: delay vhost_user_blk_disconnect

2020-05-24 Thread Raphael Norwitz
I'm mostly happy with this. A couple comments. On Wed, May 20, 2020 at 11:54 AM Dima Stepanov wrote: > > A socket write during vhost-user communication may trigger a disconnect > event, calling vhost_user_blk_disconnect() and clearing all the > vhost_dev structures holding data that vhost-user

[PATCH 4/4] hw/display/xlnx_dp: Replace disabled DPRINTF() by error_report()

2020-05-24 Thread Philippe Mathieu-Daudé
DPRINTF() calls are disabled by default, so when unexpected data is used, the whole process abort without information. Display a bit of information with error_report() before crashing. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/xlnx_dp.c | 14 -- 1 file changed, 8

[PATCH 2/4] hw/display/dpcd: Fix memory region size

2020-05-24 Thread Philippe Mathieu-Daudé
The memory region size is 512K. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/dpcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c index 170545c605..0c1b7b35fb 100644 --- a/hw/display/dpcd.c +++ b/hw/display/dpcd.c @@ -1,5

[PATCH 3/4] hw/display/dpcd: Convert debug printf()s to trace events

2020-05-24 Thread Philippe Mathieu-Daudé
Convert DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/dpcd.c | 16 +++- hw/display/trace-events | 4 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c index

[PATCH 1/4] hw/misc/auxbus: Use qemu_log_mask(UNIMP) instead of debug printf

2020-05-24 Thread Philippe Mathieu-Daudé
Convert the deprecated DPRINTF() call by qemu_log_mask(LOG_UNIMP). Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/auxbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c index f8e7b97971..06aabf20c5 100644 --- a/hw/misc/auxbus.c +++

[PATCH 0/4] hw/display/xlnx_dp: Fix memory region size, improve logging

2020-05-24 Thread Philippe Mathieu-Daudé
A collection of cleanup patches written while fuzzing the Xilinx Display Port device. Philippe Mathieu-Daudé (4): hw/misc/auxbus: Use qemu_log_mask(UNIMP) instead of debug printf hw/display/dpcd: Fix memory region size hw/display/dpcd: Convert debug printf()s to trace events

[PATCH] hw/pci-bridge/dec: Remove dead debug code

2020-05-24 Thread Philippe Mathieu-Daudé
Remove debug code never used since added in commit e1c6bbabee30. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-bridge/dec.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c index 3ae2f788a4..952bc71122 100644 --- a/hw/pci-bridge/dec.c

Re: [PATCH v3 2/2] vhost-user-blk: delay vhost_user_blk_disconnect

2020-05-24 Thread Jason Wang
On 2020/5/20 下午11:53, Dima Stepanov wrote: A socket write during vhost-user communication may trigger a disconnect event, calling vhost_user_blk_disconnect() and clearing all the vhost_dev structures holding data that vhost-user functions expect to remain valid to roll back initialization

Re: [PATCH] scripts/clean-includes: Mark 'qemu/qemu-plugin.h' as special header

2020-05-24 Thread Emilio G. Cota
On Sun, May 24, 2020 at 23:56:54 +0200, Philippe Mathieu-Daudé wrote: > "qemu/qemu-plugin.h" isn't meant to be include by QEMU codebase, > but by 3rd party plugins that QEMU can use. These plugins can be > built out of QEMU and don't include "qemu/osdep.h". > Mark "qemu/qemu-plugin.h" as a special

Re: [PATCH V2 0/7] Latest COLO tree queued patches

2020-05-24 Thread Jason Wang
On 2020/5/22 下午3:53, Zhang Chen wrote: From: Zhang Chen Hi Jason, this series include latest COLO related patches. I have finish basic test and review. If no other comments, please check and merge this series. Derek Su (1): colo-compare: Fix memory leak in packet_enqueue() Lukas Straub

[Bug 1879425] Re: The thread of "CPU 0 /KVM" keeping 99.9%CPU

2020-05-24 Thread cliff chen
Add the ticket link in centos https://bugs.centos.org/view.php?id=17385 ** Bug watch added: bugs.centos.org/ #17385 https://bugs.centos.org/view.php?id=17385 -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

Re: [PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-05-24 Thread Yan Zhao
On Thu, May 21, 2020 at 04:38:47PM +0200, Paolo Bonzini wrote: > On 30/04/20 11:40, Peter Maydell wrote: > >> This does not "drop" a write to a r/o region -- it causes it to generate > >> whatever the guest architecture's equivalent of a bus error is (eg data > >> abort on Arm). > > > > More

[PATCH] configure: Do not ignore malloc value

2020-05-24 Thread Leonid Bloch
From: Leonid Bloch Not checking the value of malloc will cause a warning with GCC 10.1, which may result in configuration failure, with the following line in config.log: config-temp/qemu-conf.c:2:18: error: ignoring return value of ‘malloc’ declared with attribute ‘warn_unused_result’

[Bug 1810000] Re: qemu system emulator crashed with the attachment of usb-bt-dongle device

2020-05-24 Thread BALATON Zoltan
This issue has nothing to do with bluetooth rather something with xhci. I've got the same error while trying to pass through a usb device to a Windows VM, once the guest driver is loaded in the the assert fires so probably it's trying to send something that's not handled correctly. A similar

Re: [PATCH] qemu-plugin.h: add missing include to define size_t

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 10:24 PM, Emilio G. Cota wrote: > Signed-off-by: Emilio G. Cota > --- > include/qemu/qemu-plugin.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h > index 89ed579f55..bab8b0d4b3 100644 > --- a/include/qemu/qemu-plugin.h

[PATCH] scripts/clean-includes: Mark 'qemu/qemu-plugin.h' as special header

2020-05-24 Thread Philippe Mathieu-Daudé
"qemu/qemu-plugin.h" isn't meant to be include by QEMU codebase, but by 3rd party plugins that QEMU can use. These plugins can be built out of QEMU and don't include "qemu/osdep.h". Mark "qemu/qemu-plugin.h" as a special header that doesn't need to be cleaned for "qemu/osdep.h". Signed-off-by:

Re: [PATCH 0/7] hw/misc/empty_slot: Spring cleaning

2020-05-24 Thread Peter Maydell
On Sun, 24 May 2020 at 21:21, Philippe Mathieu-Daudé wrote: > On 5/24/20 9:37 PM, Aleksandar Markovic wrote: > > I agree with all of your patches, they absolutely make sense to me, > > but I would like to know Peter's opinion on such treatment of empty > > slots. > > > > I am going to give r-bs

Re: [PATCH v3 0/4] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1590344541.git.lukasstra...@web.de/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash

Re: [PATCH v3 0/4] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1590344541.git.lukasstra...@web.de/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

[PATCH] qemu-plugin.h: add missing include to define size_t

2020-05-24 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qemu/qemu-plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 89ed579f55..bab8b0d4b3 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -12,6 +12,7 @@

Re: [PATCH 0/7] hw/misc/empty_slot: Spring cleaning

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 9:37 PM, Aleksandar Markovic wrote: > нед, 24. мај 2020. у 18:58 Philippe Mathieu-Daudé > је написао/ла: >> >> ping? >> > > I agree with all of your patches, they absolutely make sense to me, > but I would like to know Peter's opinion on such treatment of empty > slots. > > I am

Re: [PATCH 0/7] hw/misc/empty_slot: Spring cleaning

2020-05-24 Thread Aleksandar Markovic
нед, 24. мај 2020. у 18:58 Philippe Mathieu-Daudé је написао/ла: > > ping? > I agree with all of your patches, they absolutely make sense to me, but I would like to know Peter's opinion on such treatment of empty slots. I am going to give r-bs and integrate mips patches as soon as Peter OKs the

[PATCH v3 4/4] migration: Add yank feature

2020-05-24 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub --- Makefile.objs | 1 + migration/channel.c | 12 migration/migration.c | 18 +- migration/multifd.c | 10 ++

[PATCH v3 3/4] chardev/char-socket.c: Add yank feature

2020-05-24 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub --- Makefile.objs | 1 + chardev/char-socket.c | 24 2 files changed, 25 insertions(+) diff --git a/Makefile.objs b/Makefile.objs index 8e403b81f3..5582f4eda9 100644 ---

[PATCH v3 1/4] Introduce yank feature

2020-05-24 Thread Lukas Straub
The yank feature allows to recover from hanging qemu by "yanking" at various parts. Other qemu systems can register themselves and multiple yank functions. Then all yank functions for selected instances can be called by the 'yank' out-of-band qmp command. Available instances can be queried by a

[PATCH v3 2/4] block/nbd.c: Add yank feature

2020-05-24 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub --- Makefile.objs | 1 + block/nbd.c | 101 -- 2 files changed, 65

[PATCH v3 0/4] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-05-24 Thread Lukas Straub
Hello Everyone, In many cases, if qemu has a network connection (qmp, migration, chardev, etc.) to some other server and that server dies or hangs, qemu hangs too. These patches introduce the new 'yank' out-of-band qmp command to recover from these kinds of hangs. The different subsystems register

Re: [PATCH RFC v3 01/11] linux-headers: Update

2020-05-24 Thread Peter Maydell
On Sun, 24 May 2020 at 15:07, Peter Xu wrote: > > Hi, Peter, > > On Sun, May 24, 2020 at 02:27:14PM +0100, Peter Maydell wrote: > > On Sun, 24 May 2020 at 00:21, Peter Xu wrote: > > > > > > Signed-off-by: Peter Xu > > > > Header updates should always include the upstream > > kernel commit

[Bug 1880424] [NEW] I/O write make imx_epit_reset() crash

2020-05-24 Thread Philippe Mathieu-Daudé
Public bug reported: libFuzzer found: qemu-fuzz-arm: hw/core/ptimer.c:377: void ptimer_transaction_begin(ptimer_state *): Assertion `!s->in_transaction' failed. ==6041== ERROR: libFuzzer: deadly signal #8 0x7fcaba320565 in __GI___assert_fail (/lib64/libc.so.6+0x30565) #9 0x563b46f91637

[PATCH] hw/display/cg3: Convert debug printf()s to trace events

2020-05-24 Thread Philippe Mathieu-Daudé
Convert DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/cg3.c| 14 -- hw/display/trace-events | 4 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index

Re: [PATCH 0/7] hw/misc/empty_slot: Spring cleaning

2020-05-24 Thread Philippe Mathieu-Daudé
ping? On 5/10/20 5:28 PM, Philippe Mathieu-Daudé wrote: > New Spring, new opportunity to clean this device :) > (v1 was in 2018, v2 in 2019). > > - lower device priority > - follow qdev model and use properties > - convert to trace events > - describe with slot name > - move under hw/misc/ and

[PATCH] hw/nvram/mac_nvram: Convert debug printf()s to trace events

2020-05-24 Thread Philippe Mathieu-Daudé
Convert NVR_DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- hw/nvram/mac_nvram.c | 17 +++-- hw/nvram/trace-events | 4 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c index

[PATCH] hw/isa/apm: Convert debug printf()s to trace events

2020-05-24 Thread Philippe Mathieu-Daudé
Convert APM_DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/apm.c| 15 +-- hw/isa/trace-events | 4 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/isa/apm.c b/hw/isa/apm.c index 6300b1ba7a..bce266b957

Re: [PATCH v6 00/32] Add subcluster allocation to qcow2

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1590331741.git.be...@igalia.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash export

[PATCH] hw/unicore32/puv3: Use qemu_log_mask(ERROR) instead of debug printf()

2020-05-24 Thread Philippe Mathieu-Daudé
Replace some debug printf() calls by qemu_log_mask(LOG_GUEST_ERROR). Signed-off-by: Philippe Mathieu-Daudé --- hw/dma/puv3_dma.c | 9 +++-- hw/gpio/puv3_gpio.c | 15 +++ hw/intc/puv3_intc.c | 9 +++-- hw/misc/puv3_pm.c | 9 +++-- hw/timer/puv3_ost.c | 9 +++--

Re: [PATCH] fuzz: add information about useful libFuzzer flags

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 4:37 PM, Alexander Bulekov wrote: > Signed-off-by: Alexander Bulekov > --- > docs/devel/fuzzing.txt | 33 + > 1 file changed, 33 insertions(+) > > diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt > index 324d2cd92b..3458763e53 100644 > ---

Re: [PATCH v6 00/32] Add subcluster allocation to qcow2

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1590331741.git.be...@igalia.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

Re: [PATCH RFC v3 03/11] KVM: Fixup kvm_log_clear_one_slot() ioctl return check

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 1:20 AM, Peter Xu wrote: > kvm_vm_ioctl() handles the errno trick already for ioctl() on > returning -1 for errors. Fix this. > > Reviewed-by: Dr. David Alan Gilbert > Signed-off-by: Peter Xu > --- > accel/kvm/kvm-all.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >

Re: [PATCH v6 00/32] Add subcluster allocation to qcow2

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1590331741.git.be...@igalia.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash export

Re: [PATCH v6 00/32] Add subcluster allocation to qcow2

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1590331741.git.be...@igalia.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

[PATCH v6 32/32] iotests: Add tests for qcow2 images with extended L2 entries

2020-05-24 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/271 | 705 + tests/qemu-iotests/271.out | 603 +++ tests/qemu-iotests/group | 1 + 3 files changed, 1309 insertions(+) create mode 100755 tests/qemu-iotests/271 create

[PATCH v6 18/32] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*

2020-05-24 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 v6 07/32] qcow2: Document the Extended L2 Entries feature

2020-05-24 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 v6 20/32] qcow2: Add subcluster support to calculate_l2_meta()

2020-05-24 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

[PATCH v6 04/32] qcow2: Split cluster_needs_cow() out of count_cow_clusters()

2020-05-24 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

Re: [RFC v2 3/3] cpus: extract out accel-specific code to each accel

2020-05-24 Thread Claudio Fontana
On 5/22/20 7:10 PM, Claudio Fontana wrote: > each accelerator registers a new "CpusAccelInterface" > on initialization, providing functions for starting a vcpu, > kicking a vcpu, and sychronizing state. > > This way the code in cpus.cc is now all general softmmu code, > nothing (or almost

[PATCH v6 08/32] qcow2: Add dummy has_subclusters() function

2020-05-24 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 v6 15/32] qcow2: Add qcow2_get_subcluster_range_type()

2020-05-24 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 v6 13/32] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

2020-05-24 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 v6 21/32] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-05-24 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 v6 11/32] qcow2: Add offset_into_subcluster() and size_to_subclusters()

2020-05-24 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 ca73ac9b67..79c4f82383 100644 --- a/block/qcow2.h

[PATCH v6 25/32] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2()

2020-05-24 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 v6 17/32] qcow2: Add cluster type parameter to qcow2_get_host_offset()

2020-05-24 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 v6 27/32] qcow2: Add subcluster support to handle_alloc_space()

2020-05-24 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 v6 24/32] qcow2: Add subcluster support to check_refcounts_l2()

2020-05-24 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

[PATCH v6 31/32] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters

2020-05-24 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 v6 22/32] qcow2: Add subcluster support to zero_in_l2_slice()

2020-05-24 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 v6 19/32] qcow2: Handle QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC

2020-05-24 Thread Alberto Garcia
When dealing with subcluster types there is a new value called QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC that has no equivalent in QCow2ClusterType. This patch handles that value in all places where subcluster types are processed. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by:

[PATCH v6 28/32] qcow2: Add subcluster support to qcow2_co_pwrite_zeroes()

2020-05-24 Thread Alberto Garcia
This works now at the subcluster level and pwrite_zeroes_alignment is updated accordingly. qcow2_cluster_zeroize() is turned into qcow2_subcluster_zeroize() with the following changes: - The request can now be subcluster-aligned. - The cluster-aligned body of the request is still zeroized

[PATCH v6 02/32] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-05-24 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

[PATCH v6 30/32] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-05-24 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 --- qapi/block-core.json | 7 +++ block/qcow2.h| 8

[PATCH v6 00/32] Add subcluster allocation to qcow2

2020-05-24 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 the code does

[PATCH v6 09/32] qcow2: Add subcluster-related fields to BDRVQcow2State

2020-05-24 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 v6 01/32] qcow2: Make Qcow2AioTask store the full host offset

2020-05-24 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 v6 26/32] qcow2: Clear the L2 bitmap when allocating a compressed cluster

2020-05-24 Thread Alberto Garcia
Compressed clusters always have the bitmap part of the extended L2 entry set to 0. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index c8d6e16237..3639dc8057

[PATCH v6 06/32] qcow2: Add get_l2_entry() and set_l2_entry()

2020-05-24 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 v6 16/32] qcow2: Add qcow2_cluster_is_allocated()

2020-05-24 Thread Alberto Garcia
This helper function tells us if a cluster is allocated (that is, there is an associated host offset for it). Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/qcow2.h b/block/qcow2.h index

[PATCH v6 12/32] qcow2: Add l2_entry_size()

2020-05-24 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 v6 05/32] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied()

2020-05-24 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 v6 10/32] qcow2: Add offset_to_sc_index()

2020-05-24 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 v6 03/32] qcow2: Add calculate_l2_meta()

2020-05-24 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 v6 29/32] qcow2: Add subcluster support to qcow2_measure()

2020-05-24 Thread Alberto Garcia
Extended L2 entries are bigger than normal L2 entries so this has an impact on the amount of metadata needed for a qcow2 file. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git

[PATCH v6 14/32] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-05-24 Thread Alberto Garcia
This patch adds QCow2SubclusterType, which is the subcluster-level version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the the same meaning as their QCOW2_CLUSTER_* equivalents (when they exist). See below for details and caveats. In images without extended L2 entries clusters are

[PATCH v6 23/32] qcow2: Add subcluster support to discard_in_l2_slice()

2020-05-24 Thread Alberto Garcia
Two things need to be taken into account here: 1) With full_discard == true the L2 entry must be cleared completely. This also includes the L2 bitmap if the image has extended L2 entries. 2) With full_discard == false we have to make the discarded cluster read back as zeroes. With

[PATCH] fuzz: add information about useful libFuzzer flags

2020-05-24 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- docs/devel/fuzzing.txt | 33 + 1 file changed, 33 insertions(+) diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt index 324d2cd92b..3458763e53 100644 --- a/docs/devel/fuzzing.txt +++ b/docs/devel/fuzzing.txt @@

Re: [Bug 1880355] [NEW] Length restrictions for fw_cfg_dma_transfer?

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 3:40 PM, Peter Maydell wrote: > On Sun, 24 May 2020 at 11:30, Philippe Mathieu-Daudé > wrote: >> It looks to me a normal behavior for a DMA device. DMA devices have a >> different address space view than the CPUs. >> Also note the fw_cfg is a generic device, not restricted to the x86

Re: [PATCH 3/3] plugins: avoid failing plugin when CPU is inited several times

2020-05-24 Thread Emilio G. Cota
Hi Alex, On Tue, May 12, 2020 at 21:11:46 +0100, Alex Bennée wrote: > > Emilio G. Cota writes: > > > On Mon, May 11, 2020 at 18:53:19 +0300, Nikolay Igotti wrote: > >> Attached to the mail counter.c when running with attached test.c compiled > >> to Linux standalone binary shows failing

Re: [PATCH RFC v3 01/11] linux-headers: Update

2020-05-24 Thread Peter Xu
Hi, Peter, On Sun, May 24, 2020 at 02:27:14PM +0100, Peter Maydell wrote: > On Sun, 24 May 2020 at 00:21, Peter Xu wrote: > > > > Signed-off-by: Peter Xu > > Header updates should always include the upstream > kernel commit against which you ran the scripts/update-linux-headers.sh > script,

Re: [PATCH 0/4] hw/display/cirrus_vga: Convert debug printf() to qemu_log_mask & trace

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 2:26 PM, no-re...@patchew.org wrote: > > This series seems to have some coding style problems. See output below for > more information: > [...] > 3/4 Checking commit 0b01a633fe92 (hw/display/cirrus_vga: Use > qemu_log_mask(ERROR) instead of debug printf) > ERROR: suspect code indent

Re: [PATCH] hw/display/omap_dss: Replace fprintf() call by qemu_log_mask(LOG_UNIMP)

2020-05-24 Thread Philippe Mathieu-Daudé
On 5/24/20 2:41 PM, Alexander Bulekov wrote: > On 200524 1238, Philippe Mathieu-Daudé wrote: >> Replace fprintf() call by qemu_log_mask(LOG_UNIMP), which is >> disabled by default. This avoid flooding the terminal when >> fuzzing the device. >> > Hi Philippe, > libfuzzer also lets you pass

Re: [PULL 0/4] pflash-next patches for 2020-05-22

2020-05-24 Thread Peter Maydell
On Fri, 22 May 2020 at 18:47, Philippe Mathieu-Daudé wrote: > > The following changes since commit d19f1ab0de8b763159513e3eaa12c5bc68122361: > > Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-2020052= > 1-1' into staging (2020-05-21 22:06:56 +0100) > > are available in the

Re: [Bug 1880355] [NEW] Length restrictions for fw_cfg_dma_transfer?

2020-05-24 Thread Peter Maydell
On Sun, 24 May 2020 at 11:30, Philippe Mathieu-Daudé wrote: > It looks to me a normal behavior for a DMA device. DMA devices have a > different address space view than the CPUs. > Also note the fw_cfg is a generic device, not restricted to the x86 arch. In an ideal world all our DMA devices

Re: [PATCH RFC v3 01/11] linux-headers: Update

2020-05-24 Thread Peter Maydell
On Sun, 24 May 2020 at 00:21, Peter Xu wrote: > > Signed-off-by: Peter Xu Header updates should always include the upstream kernel commit against which you ran the scripts/update-linux-headers.sh script, please. linux-headers/asm-x86/kvm.h | 1 + linux-headers/linux/kvm.h | 53

Re: [PATCH RFC v3 00/11] KVM: Dirty ring support (QEMU part)

2020-05-24 Thread Peter Xu
On Sat, May 23, 2020 at 07:20:24PM -0400, Peter Xu wrote: > I kept the dirty sync in kvm_set_phys_mem() for kvmslot removals, left a > comment on the known issue about strict dirty sync so we can fix it someday in > the future together with dirty log and dirty ring. Side note: patch 3,5-8 should

Re: [PATCH] hw/display/omap_dss: Replace fprintf() call by qemu_log_mask(LOG_UNIMP)

2020-05-24 Thread Alexander Bulekov
On 200524 1238, Philippe Mathieu-Daudé wrote: > Replace fprintf() call by qemu_log_mask(LOG_UNIMP), which is > disabled by default. This avoid flooding the terminal when > fuzzing the device. > Hi Philippe, libfuzzer also lets you pass -close_fd_mask=[1,2,3] to close stdout, stderr or both. As a

Re: [PATCH 0/4] hw/display/cirrus_vga: Convert debug printf() to qemu_log_mask & trace

2020-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200524110121.12686-1-f4...@amsat.org/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200524110121.12686-1-f4...@amsat.org Subject: [PATCH 0/4] hw/display/cirrus_vga: Convert debug printf()

[PATCH 1/1] util/getauxval: Porting to FreeBSD getauxval feature

2020-05-24 Thread David CARLIER
Hi here porting qemu_getauxval to FreeBSD. Thanks. Regards. >From 5be5e56a59631b28ed7b738d251dda252ba9b03e Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 24 May 2020 13:03:32 +0100 Subject: [PATCH] util/getauxval: FreeBSD has a similar auxilary vector API Signed-off-by: David Carlier

Re: [RFC v2 2/3] cpu-timers, icount: new modules

2020-05-24 Thread Claudio Fontana
On 5/22/20 7:10 PM, Claudio Fontana wrote: > refactoring of cpus.c continues with two new modules extracted from it. > > cpu-timers: responsible for the cpu timers state, and for access to > cpu clocks and ticks. > > icount: counts the TCG instructions executed. As such it is specific to > the

[PATCH] hw/display/exynos4210_fimd: Use qemu_log_mask(GUEST_ERROR)

2020-05-24 Thread Philippe Mathieu-Daudé
Replace DPRINT_ERROR() by qemu_log_mask(GUEST_ERROR). Signed-off-by: Philippe Mathieu-Daudé --- hw/display/exynos4210_fimd.c | 46 +++- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c

[PATCH 3/4] hw/display/cirrus_vga: Use qemu_log_mask(ERROR) instead of debug printf

2020-05-24 Thread Philippe Mathieu-Daudé
Replace some debug printf() calls by qemu_log_mask(LOG_GUEST_ERROR). Signed-off-by: Philippe Mathieu-Daudé --- hw/display/cirrus_vga.c | 77 ++--- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/hw/display/cirrus_vga.c

[PATCH 2/4] hw/display/cirrus_vga: Use qemu_log_mask(UNIMP) instead of debug printf

2020-05-24 Thread Philippe Mathieu-Daudé
Replace some debug printf() calls by qemu_log_mask(LOG_UNIMP), and add a new one in cirrus_linear_bitblt_read(). Signed-off-by: Philippe Mathieu-Daudé --- hw/display/cirrus_vga.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/display/cirrus_vga.c

  1   2   >