[Bug 1882851] Re: QEMU video freezes with "Guest disabled display" (virtio driver)

2020-06-10 Thread Diego Viola
`xset dpms force off' on the guest is a good way to reproduce it. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1882851 Title: QEMU video freezes with "Guest disabled display" (virtio driver)

[PULL v2 0/3] NBD patches through 2020-06-09

2020-06-10 Thread Eric Blake
The following changes since commit 31d321c2b3574dcc74e9f6411af06bca6b5d10f4: Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sparc-next-20200609' into staging (2020-06-09 17:29:47 +0100) are available in the Git repository at: https://repo.or.cz/qemu/ericb.git

[PULL v2 2/3] nbd/server: Avoid long error message assertions CVE-2020-10761

2020-06-10 Thread Eric Blake
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 server first started sending error messages, the assertion could not be triggered, because messages

Re: [PATCH 2/3] spapr: Use error_append_hint() in spapr_caps.c

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
10.06.2020 20:17, Greg Kurz wrote: We have a dedicated error API for hints. Use it instead of embedding the hint in the error message, as recommanded in the "qapi/error.h" header file. Since spapr_caps_apply() passes _fatal, all functions must also call the ERRP_AUTO_PROPAGATE() macro for

Re: [PATCH v2 4/6] linux-user: Add strace support for printing arguments of lseek()

2020-06-10 Thread Laurent Vivier
Le 08/06/2020 à 18:43, Filip Bozuta a écrit : > From: Filip Bozuta > > This patch implements strace argument printing functionality for syscall: > > *lseek - reposition read/write file offset > > off_t lseek(int fd, off_t offset, int whence) > man page:

Re: [PATCH v2 6/6] linux-user: Add strace support for printing arguments of fallocate()

2020-06-10 Thread Laurent Vivier
Le 08/06/2020 à 18:43, Filip Bozuta a écrit : > From: Filip Bozuta > > This patch implements strace argument printing functionality for following > syscall: > > *fallocate - manipulate file space > > int fallocate(int fd, int mode, off_t offset, off_t len) > man page:

Re: [PATCH v9 39/61] target/riscv: vector floating-point compare instructions

2020-06-10 Thread Richard Henderson
On 6/10/20 4:37 AM, LIU Zhiwei wrote: > Signed-off-by: LIU Zhiwei > Reviewed-by: Alistair Francis > Richard Henderson > --- Missed the actual "Reviewed-by:" :-) r~

Re: [PATCH v2 1/6] linux-user: Extend strace support to enable argument printing after syscall execution

2020-06-10 Thread Laurent Vivier
Le 08/06/2020 à 18:43, Filip Bozuta a écrit : > From: Filip Bozuta > > Structure "struct syscallname" in file "strace.c" is used for "-strace" > to print arguments and return values of syscalls. The last field of > this structure "result" represents the calling function that prints

[Bug 1882671] Re: qemu-system-x86_64 (ver 4.2) stuck at boot with OVMF bios

2020-06-10 Thread Laszlo Ersek (Red Hat)
(From the UEFI executable name "82540em.efi" in the log, I initially suspected an assigned physical NIC with a buggy flashed-on oprom. But grepping the iPXE tree for "82540em" yields a match, and QEMU loads the iPXE oproms by default into the emulated NICs' ROM BARs.) -- You received this bug

[PATCH 3/3] spapr: Forbid nested KVM-HV in pre-power9 compat mode

2020-06-10 Thread Greg Kurz
Nested KVM-HV only works on POWER9. Signed-off-by: Greg Kurz --- hw/ppc/spapr_caps.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 0c3d3b64a508..05c8f70506ad 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -408,6

[PATCH 0/3] spapr: Improve error reporting in spapr_caps.c

2020-06-10 Thread Greg Kurz
Spapr capabilities are checked at machine init. If a capability cannot be used, an error message is printed and QEMU exits. In most places, the error message also contains an hint for the user. But we should use error_append_hint() for that, as explained in the "qapi/error.h" header. This is

[PATCH 2/3] spapr: Use error_append_hint() in spapr_caps.c

2020-06-10 Thread Greg Kurz
We have a dedicated error API for hints. Use it instead of embedding the hint in the error message, as recommanded in the "qapi/error.h" header file. Since spapr_caps_apply() passes _fatal, all functions must also call the ERRP_AUTO_PROPAGATE() macro for error_append_hint() to be functional.

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

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
10.06.2020 19:37, 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 server first started sending error messages, the assertion

[PATCH 1/3] error: auto propagated local_err

2020-06-10 Thread Greg Kurz
From: Vladimir Sementsov-Ogievskiy Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of functions with an errp OUT parameter. It has three goals: 1. Fix issue with error_fatal and error_prepend/error_append_hint: user can't see this additional information, because exit() happens

[Bug 1882671] Re: qemu-system-x86_64 (ver 4.2) stuck at boot with OVMF bios

2020-06-10 Thread Laszlo Ersek (Red Hat)
Vladislav, The OVMF debug log ends like this (with UEFI protocol GUIDs decoded as their textual identifiers in edk2): > [Security] 3rd party image[6D19D18] can be loaded after EndOfDxe: > PciRoot(0x0)/Pci(0x3,0x0)/Offset(0x16400,0x4B1FF). > InstallProtocolInterface: [EfiLoadedImageProtocol]

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

2020-06-10 Thread Denis V. Lunev
On 6/10/20 6:10 PM, Vladimir Sementsov-Ogievskiy wrote: > 10.06.2020 17:41, Denis V. Lunev wrote: >> 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

Re: [PATCH v3 00/13] Add Thread Sanitizer support to QEMU

2020-06-10 Thread Alex Bennée
Robert Foley writes: > Changes in v3: > - Fixed issue in tsan changes to start_switch_fiber(), > found by --enable-sanitizers testing. > - Removed the UC_TRACE() code. > - Removed the tb_destroy callback. > > v2: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg01534.html > > This

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

2020-06-10 Thread Eric Blake
On 6/10/20 10:03 AM, Alberto Garcia wrote: 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

Re: [PATCH v2 1/6] iotests: 194: wait migration completion on target too

2020-06-10 Thread Alex Bennée
Alex Bennée writes: > From: Vladimir Sementsov-Ogievskiy > > It is possible, that shutdown on target occurs earlier than migration > finish. In this case we crash in bdrv_release_dirty_bitmap_locked() > on assertion "assert(!bdrv_dirty_bitmap_busy(bitmap));" as we do have > busy bitmap, as

Re: [PATCH v2 4/5] bios-tables-test: Add Q35/TPM-TIS test

2020-06-10 Thread Stefan Berger
On 6/9/20 8:54 AM, Eric Auger wrote: Test tables specific to the TPM-TIS instantiation. The TPM2 is added in the framework. Also the DSDT is updated with the TPM. The new function should be be usable for CRB as well, later one. Signed-off-by: Eric Auger Reviewed-by: Stefan Berger ---

[PATCH v2 2/2] block: Call attention to truncation of long NBD exports

2020-06-10 Thread Eric Blake
Commit 93676c88 relaxed our NBD client code to request export names up to the NBD protocol maximum of 4096 bytes without NUL terminator, even though the block layer can't store anything longer than 4096 bytes including NUL terminator for display to the user. Since this means there are some export

Re: [PATCH v2 3/5] tests: tpm-emu: Remove assert on TPM2_ST_NO_SESSIONS

2020-06-10 Thread Stefan Berger
On 6/9/20 8:54 AM, Eric Auger wrote: bios-tables-test executes SeaBIOS. Indeed FW is needed to fetch tables from QEMU and put them into the guest RAM. Also the FW patches cross table pointers. At some point, SeaBIOS ends up calling the TPM2_CC_HierarchyControl command with TPM2_ST_SESSIONS tag,

[PATCH v2 0/2] Fix NBD CVE-2020-10761

2020-06-10 Thread Eric Blake
In qemu 4.2, I accidentally introduced the ability for an NBD client obeying the specification to kill qemu as NBD server with an assertion failure when the client requests an unusually long export name, as a regression from the intended graceful server error message back to the client. In v2: -

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

2020-06-10 Thread Eric Blake
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 server first started sending error messages, the assertion could not be triggered, because messages

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

2020-06-10 Thread Kevin Wolf
Am 10.06.2020 um 17:26 hat Sam Eiderman geschrieben: > 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

Re: [PATCH 2/2] block: Call attention to truncation of long NBD exports

2020-06-10 Thread Eric Blake
On 6/10/20 4:24 AM, Vladimir Sementsov-Ogievskiy wrote: 08.06.2020 21:26, Eric Blake wrote: Commit 93676c88 relaxed our NBD client code to request export names up to the NBD protocol maximum of 4096 bytes without NUL terminator, even though the block layer can't store anything longer than 4096

Re: Failure of test 'basic gdbstub support'

2020-06-10 Thread Alex Bennée
Robert Henry writes: > 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? No it shouldn't fail

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

2020-06-10 Thread Eric Blake
On 6/10/20 10:57 AM, David Edmondson wrote: On Wednesday, 2020-06-10 at 10:48:52 -05, Eric Blake wrote: On 6/10/20 10:42 AM, David Edmondson wrote: On Wednesday, 2020-06-10 at 18:29:33 +03, Sam Eiderman wrote: Excuse me, Vladimir already pointed out in the first comment that it will skip

Re: [PATCH v3 1/4] acpi: Convert build_tpm2() to build_append* API

2020-06-10 Thread Auger Eric
Hi Igor, On 6/5/20 4:23 PM, Igor Mammedov wrote: > On Mon, 1 Jun 2020 11:57:34 +0200 > Eric Auger wrote: > >> In preparation of its move to the generic acpi code, >> let's convert build_tpm2() to use build_append API. This >> latter now is prefered in place of direct ACPI struct field >>

Re: [PATCH] migration: fix xbzrle encoding rate calculation

2020-06-10 Thread Richard Henderson
On 6/7/20 5:53 PM, Wei Wang wrote: > It's reported an error of implicit conversion from "unsigned long" to > "double" when compiling with Clang 10. Simply make the encoding rate 0 > when the encoded_size is 0. > > Fixes: e460a4b1a4 > Reported-by: Richard Henderson > Signed-off-by: Wei Wang >

[PATCH v2 6/6] plugins: new hwprofile plugin

2020-06-10 Thread Alex Bennée
This is a plugin intended to help with profiling access to various bits of system hardware. It only really makes sense for system emulation. It takes advantage of the recently exposed helper API that allows us to see the device name (memory region name) associated with a device. You can specify

[PATCH v2 4/6] hw/virtio/pci: include vdev name in registered PCI sections

2020-06-10 Thread Alex Bennée
When viewing/debugging memory regions it is sometimes hard to figure out which PCI device something belongs to. Make the names unique by including the vdev name in the name string. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin --- v2 - swap

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

2020-06-10 Thread David Edmondson
On Wednesday, 2020-06-10 at 10:48:52 -05, Eric Blake wrote: > On 6/10/20 10:42 AM, David Edmondson wrote: >> On Wednesday, 2020-06-10 at 18:29:33 +03, Sam Eiderman wrote: >> >>> Excuse me, >>> >>> Vladimir already pointed out in the first comment that it will skip >>> writing real zeroes later.

[PATCH v2 5/6] plugins: add API to return a name for a IO device

2020-06-10 Thread Alex Bennée
This may well end up being anonymous but it should always be unique. Signed-off-by: Alex Bennée [r-b provisional given change to g_intern_string] Reviewed-by: Clement Deschamps Reviewed-by: Emilio G. Cota --- v3 - return a non-freeable const g_intern_string() - checkpatch cleanups ---

[PATCH v2 3/6] cputlb: ensure we save the IOTLB data in case of reset

2020-06-10 Thread Alex Bennée
Any write to a device might cause a re-arrangement of memory triggering a TLB flush and potential re-size of the TLB invalidating previous entries. This would cause users of qemu_plugin_get_hwaddr() to see the warning: invalid use of qemu_plugin_get_hwaddr because of the failed tlb_lookup

[PATCH v2 2/6] plugins: new lockstep plugin for debugging TCG changes

2020-06-10 Thread Alex Bennée
When we make changes to the TCG we sometimes cause regressions that are deep into the execution cycle of the guest. Debugging this often requires comparing large volumes of trace information to figure out where behaviour has diverged. The lockstep plugin utilises a shared socket so two QEMU's

[PATCH v2 0/6] plugins/next (lockstep, api, hwprofile)

2020-06-10 Thread Alex Bennée
Hi, This is the current plugins/next queue. The main changes are: - cputlb corruption workaround now just saves data ahead of io_writex - tweak to format of virtio-pci naming - the hwaddr device name now returns a g_intern_string() - bunch of extra features to hwprofile The question of

[PATCH v2 1/6] iotests: 194: wait migration completion on target too

2020-06-10 Thread Alex Bennée
From: Vladimir Sementsov-Ogievskiy It is possible, that shutdown on target occurs earlier than migration finish. In this case we crash in bdrv_release_dirty_bitmap_locked() on assertion "assert(!bdrv_dirty_bitmap_busy(bitmap));" as we do have busy bitmap, as bitmap migration is ongoing. We'll

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

2020-06-10 Thread Gerd Hoffmann
On Wed, Jun 10, 2020 at 10:54:26AM -0400, Michael S. Tsirkin wrote: > 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

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

2020-06-10 Thread Eric Blake
On 6/10/20 10:42 AM, David Edmondson wrote: On Wednesday, 2020-06-10 at 18:29:33 +03, Sam Eiderman wrote: Excuse me, Vladimir already pointed out in the first comment that it will skip writing real zeroes later. Right. That's why you want something like "--no-need-to-zero-initialise" (the

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

2020-06-10 Thread Sam Eiderman
Ok great, thanks for making it clear. On Wed, Jun 10, 2020 at 6:42 PM David Edmondson wrote: > > On Wednesday, 2020-06-10 at 18:29:33 +03, Sam Eiderman wrote: > > > Excuse me, > > > > Vladimir already pointed out in the first comment that it will skip > > writing real zeroes later. > > Right.

Re: [PATCH v3 08/24] mac_via: Fix to realize "mos6522-q800-via*" devices

2020-06-10 Thread Laurent Vivier
Le 09/06/2020 à 14:23, Markus Armbruster a écrit : > mac_via_realize() creates a "mos6522-q800-via1" and a > "mos6522-q800-via2" device, but neglects to realize them. Affects > machine q800. > > In theory, a device becomes real only on realize. In practice, the > transition from unreal to real

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

2020-06-10 Thread David Edmondson
On Wednesday, 2020-06-10 at 18:29:33 +03, Sam Eiderman wrote: > Excuse me, > > Vladimir already pointed out in the first comment that it will skip > writing real zeroes later. Right. That's why you want something like "--no-need-to-zero-initialise" (the name keeps getting longer!), which would

Re: [PATCH v9 00/61] target/riscv: support vector extension v0.7.1

2020-06-10 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200610113748.4754-1-zhiwei_...@c-sky.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200610113748.4754-1-zhiwei_...@c-sky.com Subject: [PATCH v9 00/61] target/riscv: support vector

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

[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

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

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

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
10.06.2020 17:41, Denis V. Lunev wrote: 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(+),

[PATCH v8 34/34] iotests: Add tests for qcow2 images with extended L2 entries

2020-06-10 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/271 | 801 + tests/qemu-iotests/271.out | 676 +++ tests/qemu-iotests/group | 1 + 3 files changed, 1478 insertions(+) create mode 100755 tests/qemu-iotests/271 create

[PATCH v8 28/34] qcow2: Add subcluster support to qcow2_co_pwrite_zeroes()

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

[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

[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 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 26/34] qcow2: Clear the L2 bitmap when allocating a compressed cluster

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

[PATCH v8 19/34] qcow2: Handle QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC

2020-06-10 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 v8 32/34] qcow2: Allow preallocation and backing files if extended_l2 is set

2020-06-10 Thread Alberto Garcia
Traditional qcow2 images don't allow preallocation if a backing file is set. This is because once a cluster is allocated there is no way to tell that its data should be read from the backing file. Extended L2 entries have individual allocation bits for each subcluster, and therefore it is

[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 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 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 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 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 29/34] qcow2: Add subcluster support to qcow2_measure()

2020-06-10 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 v8 14/34] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-06-10 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 v8 23/34] qcow2: Add subcluster support to discard_in_l2_slice()

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

[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 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 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 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 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 16/34] qcow2: Add qcow2_cluster_is_allocated()

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

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 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),

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 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),

Re: [PATCH v10 1/9] error: auto propagated local_err

2020-06-10 Thread Greg Kurz
On Tue, 17 Mar 2020 18:16:17 +0300 Vladimir Sementsov-Ogievskiy wrote: > Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of > functions with an errp OUT parameter. > > It has three goals: > > 1. Fix issue with error_fatal and error_prepend/error_append_hint: user > can't see

Re: [PATCH 06/16] fdc: Deprecate configuring floppies with -global isa-fdc

2020-06-10 Thread John Snow
On 6/5/20 10:56 AM, Markus Armbruster wrote: > Deprecate > > -global isa-fdc.driveA=... > -global isa-fdc.driveB=... > > in favour of > > -device floppy,unit=0,drive=... > -device floppy,unit=1,drive=... > > Same for the other floppy controller devices. > If you're not

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)

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

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

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

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: [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 1/2] nbd/server: Avoid long error message assertions CVE-2020-10761

2020-06-10 Thread Vladimir Sementsov-Ogievskiy
10.06.2020 16:39, Eric Blake wrote: 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

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

<    1   2   3   4   5   >