RE: [RFC v2 13/22] intel_iommu: add PASID cache management infrastructure

2019-11-05 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, November 5, 2019 4:07 AM > To: Liu, Yi L > Subject: Re: [RFC v2 13/22] intel_iommu: add PASID cache management > infrastructure > > On Thu, Oct 24, 2019 at 08:34:34AM -0400, Liu Yi L wrote: > > This patch adds a PASID cache management

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-05 Thread Denis Plotnikov
On 05.11.2019 23:56, Michael S. Tsirkin wrote: > On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: >> The patch protects from creating illegal virtio device configuration >> via direct virtqueue size property setting. >> >> Signed-off-by: Denis Plotnikov >> --- >>

[PATCH] vhost-user: Refractor vhost_user_set_mem_table Functions

2019-11-05 Thread Raphael Norwitz
vhost_user_set_mem_table() and vhost_user_set_mem_table_postcopy() have gotten convoluted, and have some identical code. This change moves the logic populating the VhostUserMemory struct and fds array from vhost_user_set_mem_table() and vhost_user_set_mem_table_postcopy() to a new function,

[PATCH] [RFC] vhost-user: clean up set_mem_table functions

2019-11-05 Thread Raphael Norwitz
The functions sending vhost-user set memory table messages are getting convoluted. The amount of nested logic is getting in the way of my development and it looks like some identical logic should be refractored out anyways. Here???s an RFC which cleans these functions up a bit. Raphael Raphael

[PULL 1/1] qemu-options: Rework the help text of the '-display' option

2019-11-05 Thread Gerd Hoffmann
From: Thomas Huth Improve the help text of the "-display" option: - Only print the options that we have enabled in the binary (similar to what we do for other options like -netdev already) - The "frame=on|off" from "-display sdl" has been removed in commit 09bd7ba9f5f7 ("Remove deprecated

[PULL 0/1] Ui 20191106 patches

2019-11-05 Thread Gerd Hoffmann
The following changes since commit 36609b4fa36f0ac934874371874416f7533a5408: Merge remote-tracking branch 'remotes/palmer/tags/palmer-for-master-4.2-sf1' into staging (2019-11-02 17:59:03 +) are available in the Git repository at: git://git.kraxel.org/qemu tags/ui-20191106-pull-request

Re: [PATCH v6 1/3] hw: rtc: Add Goldfish RTC device

2019-11-05 Thread Anup Patel
On Wed, Nov 6, 2019 at 4:54 AM Philippe Mathieu-Daudé wrote: > > Hi Anup, > > On 11/3/19 8:55 AM, Anup Patel wrote: > > This patch adds model for Google Goldfish virtual platform RTC device. > > > > We will be adding Goldfish RTC device to the QEMU RISC-V virt machine > > for providing real

Re: guest / host buffer sharing ...

2019-11-05 Thread Gerd Hoffmann
> > (1) The virtio device > > = > > > > Has a single virtio queue, so the guest can send commands to register > > and unregister buffers. Buffers are allocated in guest ram. Each > > buffer > > has a list of memory ranges for the data. Each buffer also has some > >

Re: git-publish, --pull-request and --signoff (was: Re: [PULL 0/9] Ide patches)

2019-11-05 Thread Stefan Hajnoczi
On Tue, Nov 5, 2019 at 9:22 PM Eduardo Habkost wrote: > On Tue, Nov 05, 2019 at 09:17:42PM +0100, Stefan Hajnoczi wrote: > > On Thu, Oct 31, 2019 at 5:07 PM John Snow wrote: > > > On 10/31/19 11:02 AM, Peter Maydell wrote: > > > > On Thu, 31 Oct 2019 at 10:59, John Snow wrote: > > > >> > > > >>

Re: [PATCH 2/3] dp8393x: fix dp8393x_receive()

2019-11-05 Thread Hervé Poussineau
Le 05/11/2019 à 22:53, Laurent Vivier a écrit : Le 05/11/2019 à 22:06, Hervé Poussineau a écrit : Le 02/11/2019 à 18:15, Laurent Vivier a écrit : address_space_rw() access size must be multiplied by the width. This fixes DHCP for Q800 guest. Signed-off-by: Laurent Vivier ---  

RE: [RFC v2 11/22] intel_iommu: process pasid cache invalidation

2019-11-05 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Sunday, November 3, 2019 12:06 AM > To: Liu, Yi L > Subject: Re: [RFC v2 11/22] intel_iommu: process pasid cache invalidation > > On Thu, Oct 24, 2019 at 08:34:32AM -0400, Liu Yi L wrote: > > This patch adds PASID cache invalidation handling.

RE: [PATCH v1 Resend] target/i386: set the CPUID level to 0x14 on old machine-type

2019-11-05 Thread Kang, Luwei
> > The CPUID level need to be set to 0x14 manually on old machine-type if > > Intel PT is enabled in guest. e.g. in Qemu 3.1 -machine pc-i440fx-3.1 > > -cpu qemu64,+intel-pt will be CPUID[0].EAX(level)=7 and > > CPUID[7].EBX[25](intel-pt)=1. > > > > Some Intel PT capabilities are exposed by leaf

Re: [PATCH 1/2] i386: Add missing cpu feature bits in EPYC model

2019-11-05 Thread Eduardo Habkost
On Wed, Nov 06, 2019 at 12:16:53AM +, Moger, Babu wrote: [...] > > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > > > index 51b72439b4..a72fe1db31 100644 > > > --- a/hw/i386/pc.c > > > +++ b/hw/i386/pc.c > > > @@ -105,7 +105,13 @@ struct hpet_fw_config hpet_cfg = {.count = > > UINT8_MAX}; > > >

RE: [PATCH 1/2] i386: Add missing cpu feature bits in EPYC model

2019-11-05 Thread Moger, Babu
> -Original Message- > From: Eduardo Habkost > Sent: Tuesday, November 5, 2019 3:43 PM > To: Moger, Babu > Cc: m...@redhat.com; marcel.apfelb...@gmail.com; pbonz...@redhat.com; > r...@twiddle.net; qemu-devel@nongnu.org > Subject: Re: [PATCH 1/2] i386: Add missing cpu feature bits in

[PATCH v2 4/4] target/arm: Add support for DC CVAP & DC CVADP ins

2019-11-05 Thread Beata Michalska
ARMv8.2 introduced support for Data Cache Clean instructions to PoP (point-of-persistence) - DC CVAP and PoDP (point-of-deep-persistence) - DV CVADP. Both specify conceptual points in a memory system where all writes that are to reach them are considered persistent. The support provided considers

[PATCH v2 3/4] migration: ram: Switch to ram block writeback

2019-11-05 Thread Beata Michalska
Switch to ram block writeback for pmem migration. Signed-off-by: Beata Michalska Reviewed-by: Richard Henderson Acked-by: Dr. David Alan Gilbert --- migration/ram.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 5078f94..38070f1

Re: [EXTERNAL] Re: Adding New, Unsupported ISA to Qemu

2019-11-05 Thread Philippe Mathieu-Daudé
On 11/5/19 10:39 PM, Peter Maydell wrote: On Tue, 5 Nov 2019 at 21:23, Hanson, Seth wrote: I completely understand your concern. Rest assured, this project is entirely internal and requires no code contribution, unit testing, etc. from QEMU devs. We simply want to garner as much

[PATCH v2 2/4] Memory: Enable writeback for given memory region

2019-11-05 Thread Beata Michalska
Add an option to trigger memory writeback to sync given memory region with the corresponding backing store, case one is available. This extends the support for persistent memory, allowing syncing on-demand. Signed-off-by: Beata Michalska --- exec.c | 43

[PATCH v2 1/4] tcg: cputlb: Add probe_read

2019-11-05 Thread Beata Michalska
Add probe_read alongside the write probing equivalent. Signed-off-by: Beata Michalska Reviewed-by: Alex Bennée --- include/exec/exec-all.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index d85e610..350c4b4 100644 ---

[PATCH v2 0/4] target/arm: Support for Data Cache Clean up to PoP

2019-11-05 Thread Beata Michalska
ARMv8.2 introduced support for Data Cache Clean instructions to PoP (point-of-persistence) and PoDP (point-of-deep-persistence): ARMv8.2-DCCVAP & ARMv8.2-DCCVADP respectively. This patch set adds support for emulating both, though there is no distinction between the two points: the PoDP is

Re: [PATCH v6 1/3] hw: rtc: Add Goldfish RTC device

2019-11-05 Thread Philippe Mathieu-Daudé
Hi Anup, On 11/3/19 8:55 AM, Anup Patel wrote: This patch adds model for Google Goldfish virtual platform RTC device. We will be adding Goldfish RTC device to the QEMU RISC-V virt machine for providing real date-time to Guest Linux. The corresponding Linux driver for Goldfish RTC device is

Re: [PULL 00/13] Linux user for 4.2 patches

2019-11-05 Thread Philippe Mathieu-Daudé
On 11/5/19 11:14 PM, Laurent Vivier wrote: Richard, could you update your series? If you prefer to wait next release I can drop your series from the pull request. Thanks, Laurent Le 05/11/2019 à 23:06, no-re...@patchew.org a écrit : Patchew URL:

[PULL v2 00/21] hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge

2019-11-05 Thread Philippe Mathieu-Daudé
in the Git repository at: https://gitlab.com/philmd/qemu.git tags/mips-next-20191105 for you to fetch changes up to 48bc99a09cb160a3a2612c4bd5a8a225ed7bf6fb: hw/pci-host/i440fx: Remove the last PIIX3 traces (2019-11-05 23:33:12 +0100

[PULL v2 01/21] Makefile: Fix config-devices.mak not regenerated when Kconfig updated

2019-11-05 Thread Philippe Mathieu-Daudé
When hw/$DIR/Kconfig is changed, the corresponding generated hw/$DIR/config-devices.mak is not being updated. Fix this by including all the hw/*/Kconfig files to the prerequisite names of the rule generating the config-devices.mak files. Fixes: e0e312f3525a (build: switch to Kconfig) Reported-by:

Re: [PULL 00/13] Linux user for 4.2 patches

2019-11-05 Thread Laurent Vivier
Richard, could you update your series? If you prefer to wait next release I can drop your series from the pull request. Thanks, Laurent Le 05/11/2019 à 23:06, no-re...@patchew.org a écrit : > Patchew URL: > https://patchew.org/QEMU/20191105181119.26779-1-laur...@vivier.eu/ > > > > Hi, > >

Re: [PATCH 1/2] i386: Add missing cpu feature bits in EPYC model

2019-11-05 Thread Eduardo Habkost
On Tue, Nov 05, 2019 at 09:17:30PM +, Moger, Babu wrote: > Adds the following missing CPUID bits: > perfctr-core : core performance counter extensions support. Enables the VM >to use extended performance counter support. It enables six >programmable counters

Re: [PULL 00/13] Linux user for 4.2 patches

2019-11-05 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191105181119.26779-1-laur...@vivier.eu/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PULL 00/13] Linux user for 4.2 patches Type: series Message-id: 20191105181119.26779-1-laur...@vivier.eu

[PATCH 2/2] i386: Add 2nd Generation AMD EPYC processors

2019-11-05 Thread Moger, Babu
Adds the support for 2nd Gen AMD EPYC Processors. The model display name will be EPYC-Rome. Adds the following new feature bits on top of the feature bits from the first generation EPYC models. perfctr-core : core performance counter extensions support. Enables the VM to use

Re: Adding New, Unsupported ISA to Qemu

2019-11-05 Thread Palmer Dabbelt
On Tue, 05 Nov 2019 08:42:53 PST (-0800), stefa...@gmail.com wrote: On Mon, Nov 04, 2019 at 11:50:11PM +, Hanson, Seth via wrote: I'm looking for in-depth documentation pertaining to how an unsupported 16 bit RISC ISA can be emulated in Qemu. I've referenced this:

Re: [PATCH 2/3] dp8393x: fix dp8393x_receive()

2019-11-05 Thread Laurent Vivier
Le 05/11/2019 à 22:06, Hervé Poussineau a écrit : > Le 02/11/2019 à 18:15, Laurent Vivier a écrit : >> address_space_rw() access size must be multiplied by the width. >> >> This fixes DHCP for Q800 guest. >> >> Signed-off-by: Laurent Vivier >> --- >>   hw/net/dp8393x.c | 2 +- >>   1 file changed,

Re: [EXTERNAL] Re: Adding New, Unsupported ISA to Qemu

2019-11-05 Thread Hanson, Seth
Gentlemen, Thank you for your input. Peter, I completely understand your concern. Rest assured, this project is entirely internal and requires no code contribution, unit testing, etc. from QEMU devs. We simply want to garner as much documentation as possible to ensure optimal

[PATCH 1/2] i386: Add missing cpu feature bits in EPYC model

2019-11-05 Thread Moger, Babu
Adds the following missing CPUID bits: perfctr-core : core performance counter extensions support. Enables the VM to use extended performance counter support. It enables six programmable counters instead of 4 counters. clzero : instruction zeroes out the 64 byte

[PATCH 37/55] roms/Makefile.edk2: don't pull in submodules when building from tarball

2019-11-05 Thread Michael Roth
Currently the `make efi` target pulls submodules nested under the roms/edk2 submodule as dependencies. However, when we attempt to build from a tarball this fails since we are no longer in a git tree. A preceding patch will pre-populate these submodules in the tarball, so assume this build

[PATCH 0/2] Add support for 2nd generation AMD EPYC processors

2019-11-05 Thread Moger, Babu
The following series adds the support for 2nd generation AMD EPYC Processors on qemu guests. The model display name for will be EPYC-Rome. Also fixes few missed cpu feature bits in 1st generation EPYC models. The Reference documents are available at

[PATCH 06/55] xen-bus: Fix backend state transition on device reset

2019-11-05 Thread Michael Roth
From: Anthony PERARD When a frontend wants to reset its state and the backend one, it starts with setting "Closing", then waits for the backend (QEMU) to do the same. But when QEMU is setting "Closing" to its state, it triggers an event (xenstore watch) that re-execute

Re: [EXTERNAL] Re: Adding New, Unsupported ISA to Qemu

2019-11-05 Thread Peter Maydell
On Tue, 5 Nov 2019 at 21:23, Hanson, Seth wrote: > I completely understand your concern. Rest assured, this project is entirely > internal and requires no code contribution, unit testing, etc. from QEMU > devs. We simply want to garner as much documentation as possible to ensure > optimal

[PATCH 05/55] pc: Don't make die-id mandatory unless necessary

2019-11-05 Thread Michael Roth
From: Eduardo Habkost We have this issue reported when using libvirt to hotplug CPUs: https://bugzilla.redhat.com/show_bug.cgi?id=1741451 Basically, libvirt is not copying die-id from query-hotpluggable-cpus, but die-id is now mandatory. We could blame libvirt and say it is not following the

Re: [PATCH 2/3] dp8393x: fix dp8393x_receive()

2019-11-05 Thread Hervé Poussineau
Le 02/11/2019 à 18:15, Laurent Vivier a écrit : address_space_rw() access size must be multiplied by the width. This fixes DHCP for Q800 guest. Signed-off-by: Laurent Vivier --- hw/net/dp8393x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/dp8393x.c

[PATCH 55/55] virtio-blk: Cancel the pending BH when the dataplane is reset

2019-11-05 Thread Michael Roth
From: Philippe Mathieu-Daudé When 'system_reset' is called, the main loop clear the memory region cache before the BH has a chance to execute. Later when the deferred function is called, some assumptions that were made when scheduling them are no longer true when they actually execute. This is

[PATCH 10/55] pr-manager: Fix invalid g_free() crash bug

2019-11-05 Thread Michael Roth
From: Markus Armbruster pr_manager_worker() passes its @opaque argument to g_free(). Wrong; it points to pr_manager_worker()'s automatic @data. Broken when commit 2f3a7ab39be converted @data from heap- to stack-allocated. Fix by deleting the g_free(). Fixes:

Re: [PATCH v1 Resend] target/i386: set the CPUID level to 0x14 on old machine-type

2019-11-05 Thread Eduardo Habkost
On Wed, Oct 30, 2019 at 02:28:02PM +0800, Luwei Kang wrote: > The CPUID level need to be set to 0x14 manually on old > machine-type if Intel PT is enabled in guest. e.g. in Qemu 3.1 > -machine pc-i440fx-3.1 -cpu qemu64,+intel-pt > will be CPUID[0].EAX(level)=7 and CPUID[7].EBX[25](intel-pt)=1. >

[PATCH 51/55] hbitmap: handle set/reset with zero length

2019-11-05 Thread Michael Roth
From: Vladimir Sementsov-Ogievskiy Passing zero length to these functions leads to unpredicted results. Zero-length set/reset may occur in active-mirror, on zero-length write (which is unlikely, but not guaranteed to never happen). Let's just do nothing on zero-length request. Signed-off-by:

[PATCH 54/55] scsi: lsi: exit infinite loop while executing script (CVE-2019-12068)

2019-11-05 Thread Michael Roth
From: Paolo Bonzini When executing script in lsi_execute_script(), the LSI scsi adapter emulator advances 's->dsp' index to read next opcode. This can lead to an infinite loop if the next opcode is empty. Move the existing loop exit after 10k iterations so that it covers no-op opcodes as well.

Re: [PULL 0/2] fw_cfg for-4.2-soft-freeze patches

2019-11-05 Thread Peter Maydell
On Sun, 3 Nov 2019 at 22:26, Philippe Mathieu-Daudé wrote: > > Hi Peter, > > One fw_cfg fix from David Gilbert. > > The following changes since commit f3cad9c6dbd4b9877232c44bf2dd877353a73209: > > iotests: Remove 130 from the "auto" group (2019-10-31 11:04:10 +) > > are available in the Git

[PATCH 50/55] util/hbitmap: strict hbitmap_reset

2019-11-05 Thread Michael Roth
From: Vladimir Sementsov-Ogievskiy hbitmap_reset has an unobvious property: it rounds requested region up. It may provoke bugs, like in recently fixed write-blocking mode of mirror: user calls reset on unaligned region, not keeping in mind that there are possible unrelated dirty bytes, covered

Re: Adding New, Unsupported ISA to Qemu

2019-11-05 Thread Peter Maydell
On Tue, 5 Nov 2019 at 16:44, Stefan Hajnoczi wrote > The general advice I've seen is: > > 1. Look at existing TCG targets to learn how to implement aspects of >your ISA. ...and *don't* look at older/less maintained targets (including x86), as they have a lot of bad habits you don't want to

[PATCH 41/55] vhost-user: save features if the char dev is closed

2019-11-05 Thread Michael Roth
From: Adrian Moreno That way the state can be correctly restored when the device is opened again. This might happen if the backend is restarted. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1738768 Reported-by: Pei Zhang Fixes: 6ab79a20af3a ("do not call vhost_net_cleanup() on running

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-05 Thread Michael S. Tsirkin
On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: > The patch protects from creating illegal virtio device configuration > via direct virtqueue size property setting. > > Signed-off-by: Denis Plotnikov > --- > hw/virtio/virtio-blk-pci.c | 9 + >

[PATCH 40/55] iotests: Test internal snapshots with -blockdev

2019-11-05 Thread Michael Roth
From: Kevin Wolf Signed-off-by: Kevin Wolf Reviewed-by: Peter Krempa Tested-by: Peter Krempa (cherry picked from commit 92b22e7b1789b0e5f20d245706e72eae70dbddce) Signed-off-by: Michael Roth --- tests/qemu-iotests/267 | 168 tests/qemu-iotests/267.out

[PATCH 49/55] COLO-compare: Fix incorrect `if` logic

2019-11-05 Thread Michael Roth
From: Fan Yang 'colo_mark_tcp_pkt' should return 'true' when packets are the same, and 'false' otherwise. However, it returns 'true' when 'colo_compare_packet_payload' returns non-zero while 'colo_compare_packet_payload' is just a 'memcmp'. The result is that COLO-compare reports inconsistent

[PATCH 04/55] target/alpha: fix tlb_fill trap_arg2 value for instruction fetch

2019-11-05 Thread Michael Roth
From: Aurelien Jarno Commit e41c94529740cc26 ("target/alpha: Convert to CPUClass::tlb_fill") slightly changed the way the trap_arg2 value is computed in case of TLB fill. The type of the variable used in the ternary operator has been changed from an int to an enum. This causes the -1 value to

[PATCH 46/55] ui: Fix hanging up Cocoa display on macOS 10.15 (Catalina)

2019-11-05 Thread Michael Roth
From: Hikaru Nishida macOS API documentation says that before applicationDidFinishLaunching is called, any events will not be processed. However, some events are fired before it is called in macOS Catalina. This causes deadlock of iothread_lock in handleEvent while it will be released after the

[PATCH 13/55] iotests: add testing shim for script-style python tests

2019-11-05 Thread Michael Roth
From: John Snow Because the new-style python tests don't use the iotests.main() test launcher, we don't turn on the debugger logging for these scripts when invoked via ./check -d. Refactor the launcher shim into new and old style shims so that they share environmental configuration. Two

[PATCH 44/55] iotests: Test large write request to qcow2 file

2019-11-05 Thread Michael Roth
From: Max Reitz Without HEAD^, the following happens when you attempt a large write request to a qcow2 file such that the number of bytes covered by all clusters involved in a single allocation will exceed INT_MAX: (A) handle_alloc_space() decides to fill the whole area with zeroes and

[PATCH 25/55] curl: Check completion in curl_multi_do()

2019-11-05 Thread Michael Roth
From: Max Reitz While it is more likely that transfers complete after some file descriptor has data ready to read, we probably should not rely on it. Better be safe than sorry and call curl_multi_check_completion() in curl_multi_do(), too, just like it is done in curl_multi_read(). With this

[PATCH 47/55] virtio: new post_load hook

2019-11-05 Thread Michael Roth
From: "Michael S. Tsirkin" Post load hook in virtio vmsd is called early while device is processed, and when VirtIODevice core isn't fully initialized. Most device specific code isn't ready to deal with a device in such state, and behaves weirdly. Add a new post_load hook in a device class

[PATCH 21/55] qcow2: Fix the calculation of the maximum L2 cache size

2019-11-05 Thread Michael Roth
From: Alberto Garcia The size of the qcow2 L2 cache defaults to 32 MB, which can be easily larger than the maximum amount of L2 metadata that the image can have. For example: with 64 KB clusters the user would need a qcow2 image with a virtual size of 256 GB in order to have 32 MB of L2

[PATCH 52/55] target/arm: Allow reading flags from FPSCR for M-profile

2019-11-05 Thread Michael Roth
From: Christophe Lyon rt==15 is a special case when reading the flags: it means the destination is APSR. This patch avoids rejecting vmrs apsr_nzcv, fpscr as illegal instruction. Cc: qemu-sta...@nongnu.org Signed-off-by: Christophe Lyon Message-id:

[PATCH 38/55] s390: PCI: fix IOMMU region init

2019-11-05 Thread Michael Roth
From: Matthew Rosato The fix in dbe9cf606c shrinks the IOMMU memory region to a size that seems reasonable on the surface, however is actually too small as it is based against a 0-mapped address space. This causes breakage with small guests as they can overrun the IOMMU window. Let's go back

[PATCH 42/55] hw/core/loader: Fix possible crash in rom_copy()

2019-11-05 Thread Michael Roth
From: Thomas Huth Both, "rom->addr" and "addr" are derived from the binary image that can be loaded with the "-kernel" paramer. The code in rom_copy() then calculates: d = dest + (rom->addr - addr); and uses "d" as destination in a memcpy() some lines later. Now with bad kernel images, it

[PATCH 39/55] block/snapshot: Restrict set of snapshot nodes

2019-11-05 Thread Michael Roth
From: Kevin Wolf Nodes involved in internal snapshots were those that were returned by bdrv_next(), inserted and not read-only. bdrv_next() in turn returns all nodes that are either the root node of a BlockBackend or monitor-owned nodes. With the typical -drive use, this worked well enough.

[PATCH 34/55] block/backup: fix backup_cow_with_offload for last cluster

2019-11-05 Thread Michael Roth
From: Vladimir Sementsov-Ogievskiy We shouldn't try to copy bytes beyond EOF. Fix it. Fixes: 9ded4a0114968e Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow Message-id: 20190920142056.12778-3-vsement...@virtuozzo.com Signed-off-by: Max Reitz (cherry

[PATCH 07/55] xen-bus: check whether the frontend is active during device reset...

2019-11-05 Thread Michael Roth
From: Paul Durrant ...not the backend Commit cb323146 "xen-bus: Fix backend state transition on device reset" contained a subtle mistake. The hunk @@ -539,11 +556,11 @@ static void xen_device_backend_changed(void *opaque) /* * If the toolstack (or unplug request callback) has set

[PATCH 45/55] mirror: Do not dereference invalid pointers

2019-11-05 Thread Michael Roth
From: Max Reitz mirror_exit_common() may be called twice (if it is called from mirror_prepare() and fails, it will be called from mirror_abort() again). In such a case, many of the pointers in the MirrorBlockJob object will already be freed. This can be seen most reliably for s->target, which

[PATCH 08/55] block/file-posix: Reduce xfsctl() use

2019-11-05 Thread Michael Roth
From: Max Reitz This patch removes xfs_write_zeroes() and xfs_discard(). Both functions have been added just before the same feature was present through fallocate(): - fallocate() has supported PUNCH_HOLE for XFS since Linux 2.6.38 (March 2011); xfs_discard() was added in December 2010. -

[PATCH 03/55] s390x/tcg: Fix VERIM with 32/64 bit elements

2019-11-05 Thread Michael Roth
From: David Hildenbrand Wrong order of operands. The constant always comes last. Makes QEMU crash reliably on specific git fetch invocations. Reported-by: Stefano Brivio Signed-off-by: David Hildenbrand Message-Id: <20190814151242.27199-1-da...@redhat.com> Reviewed-by: Cornelia Huck Fixes:

[PATCH 32/55] qcow2: Fix corruption bug in qcow2_detect_metadata_preallocation()

2019-11-05 Thread Michael Roth
From: Kevin Wolf qcow2_detect_metadata_preallocation() calls qcow2_get_refcount() which requires s->lock to be taken to protect its accesses to the refcount table and refcount blocks. However, nothing in this code path actually took the lock. This could cause the same cache entry to be used by

[PATCH 36/55] make-release: pull in edk2 submodules so we can build it from tarballs

2019-11-05 Thread Michael Roth
The `make efi` target added by 536d2173 is built from the roms/edk2 submodule, which in turn relies on additional submodules nested under roms/edk2. The make-release script currently only pulls in top-level submodules, so these nested submodules are missing in the resulting tarball. We could try

[PATCH 48/55] virtio-net: prevent offloads reset on migration

2019-11-05 Thread Michael Roth
From: Mikhail Sennikovsky Currently offloads disabled by guest via the VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET command are not preserved on VM migration. Instead all offloads reported by guest features (via VIRTIO_PCI_GUEST_FEATURES) get enabled. What happens is: first the

[PATCH 02/55] Revert "ide/ahci: Check for -ECANCELED in aio callbacks"

2019-11-05 Thread Michael Roth
From: John Snow This reverts commit 0d910cfeaf2076b116b4517166d5deb0fea76394. It's not correct to just ignore an error code in a callback; we need to handle that error and possible report failure to the guest so that they don't wait indefinitely for an operation that will now never finish.

[PATCH 33/55] block/backup: fix max_transfer handling for copy_range

2019-11-05 Thread Michael Roth
From: Vladimir Sementsov-Ogievskiy Of course, QEMU_ALIGN_UP is a typo, it should be QEMU_ALIGN_DOWN, as we are trying to find aligned size which satisfy both source and target. Also, don't ignore too small max_transfer. In this case seems safer to disable copy_range. Fixes: 9ded4a0114968e

[PATCH 22/55] block/nfs: tear down aio before nfs_close

2019-11-05 Thread Michael Roth
From: Peter Lieven nfs_close is a sync call from libnfs and has its own event handler polling on the nfs FD. Avoid that both QEMU and libnfs are intefering here. CC: qemu-sta...@nongnu.org Signed-off-by: Peter Lieven Signed-off-by: Kevin Wolf (cherry picked from commit

[PATCH 43/55] qcow2: Limit total allocation range to INT_MAX

2019-11-05 Thread Michael Roth
From: Max Reitz When the COW areas are included, the size of an allocation can exceed INT_MAX. This is kind of limited by handle_alloc() in that it already caps avail_bytes at INT_MAX, but the number of clusters still reflects the original length. This can have all sorts of effects, ranging

[PATCH 18/55] target/arm: Free TCG temps in trans_VMOV_64_sp()

2019-11-05 Thread Michael Roth
From: Peter Maydell The function neon_store_reg32() doesn't free the TCG temp that it is passed, so the caller must do that. We got this right in most places but forgot to free the TCG temps in trans_VMOV_64_sp(). Cc: qemu-sta...@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Richard

[PATCH 31/55] coroutine: Add qemu_co_mutex_assert_locked()

2019-11-05 Thread Michael Roth
From: Kevin Wolf Some functions require that the caller holds a certain CoMutex for them to operate correctly. Add a function so that they can assert the lock is really held. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Tested-by: Michael Weiser Reviewed-by: Michael Weiser

[PATCH 19/55] target/arm: Don't abort on M-profile exception return in linux-user mode

2019-11-05 Thread Michael Roth
From: Peter Maydell An attempt to do an exception-return (branch to one of the magic addresses) in linux-user mode for M-profile should behave like a normal branch, because linux-user mode is always going to be in 'handler' mode. This used to work, but we broke it when we added support for the

[PATCH 35/55] hw/arm/boot.c: Set NSACR.{CP11, CP10} for NS kernel boots

2019-11-05 Thread Michael Roth
From: Peter Maydell If we're booting a Linux kernel directly into Non-Secure state on a CPU which has Secure state, then make sure we set the NSACR CP11 and CP10 bits, so that Non-Secure is allowed to access the FPU. Otherwise an AArch32 kernel will UNDEF as soon as it tries to use the FPU. It

[PATCH 26/55] curl: Pass CURLSocket to curl_multi_do()

2019-11-05 Thread Michael Roth
From: Max Reitz curl_multi_do_locked() currently marks all sockets as ready. That is not only inefficient, but in fact unsafe (the loop is). A follow-up patch will change that, but to do so, curl_multi_do_locked() needs to know exactly which socket is ready; and that is accomplished by this

[PATCH 27/55] curl: Report only ready sockets

2019-11-05 Thread Michael Roth
From: Max Reitz Instead of reporting all sockets to cURL, only report the one that has caused curl_multi_do_locked() to be called. This lets us get rid of the QLIST_FOREACH_SAFE() list, which was actually wrong: SAFE foreaches are only safe when the current element is removed in each iteration.

[PATCH 28/55] curl: Handle success in multi_check_completion

2019-11-05 Thread Michael Roth
From: Max Reitz Background: As of cURL 7.59.0, it verifies that several functions are not called from within a callback. Among these functions is curl_multi_add_handle(). curl_read_cb() is a callback from cURL and not a coroutine. Waking up acb->co will lead to entering it then and there,

[PATCH 20/55] libvhost-user: fix SLAVE_SEND_FD handling

2019-11-05 Thread Michael Roth
From: Johannes Berg It doesn't look like this could possibly work properly since VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD is defined to 10, but the dev->protocol_features has a bitmap. I suppose the peer this was tested with also supported VHOST_USER_PROTOCOL_F_LOG_SHMFD, in which case the test would

Re: [PATCH v1 3/4] virtio: increase virtuqueue sizes in new machine types

2019-11-05 Thread Michael S. Tsirkin
On Tue, Nov 05, 2019 at 07:11:04PM +0300, Denis Plotnikov wrote: > Linux guests submit IO requests no longer than PAGE_SIZE * max_seg > field reported by SCSI controler. Thus typical sequential read with > 1 MB size results in the following pattern of the IO from the guest: > 8,16 115754

[PATCH 24/55] curl: Keep *socket until the end of curl_sock_cb()

2019-11-05 Thread Michael Roth
From: Max Reitz This does not really change anything, but it makes the code a bit easier to follow once we use @socket as the opaque pointer for aio_set_fd_handler(). Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz Message-id: 20190910124136.10565-3-mre...@redhat.com Reviewed-by: Maxim

[PATCH 29/55] blockjob: update nodes head while removing all bdrv

2019-11-05 Thread Michael Roth
From: Sergio Lopez block_job_remove_all_bdrv() iterates through job->nodes, calling bdrv_root_unref_child() for each entry. The call to the latter may reach child_job_[can_]set_aio_ctx(), which will also attempt to traverse job->nodes, potentially finding entries that where freed on previous

[PATCH 00/55] Patch Round-up for stable 4.1.1, freeze on 2019-11-12

2019-11-05 Thread Michael Roth
Hi everyone, The following new patches are queued for QEMU stable v4.1.1: https://github.com/mdroth/qemu/commits/stable-4.1-staging The release is tentatively planned for 2019-11-14: https://wiki.qemu.org/Planning/4.1 Please note that the original release date was planned for 2019-11-21,

[PATCH 14/55] iotests: Add supported protocols to execute_test()

2019-11-05 Thread Michael Roth
From: Max Reitz Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf (cherry picked from commit 88d2aa533a4a1aad44a27c2e6cd5bc5fbcbce7ed) Signed-off-by: Michael Roth --- tests/qemu-iotests/iotests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH 23/55] curl: Keep pointer to the CURLState in CURLSocket

2019-11-05 Thread Michael Roth
From: Max Reitz A follow-up patch will make curl_multi_do() and curl_multi_read() take a CURLSocket instead of the CURLState. They still need the latter, though, so add a pointer to it to the former. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz Reviewed-by: John Snow Message-id:

[PATCH 30/55] block/qcow2: Fix corruption introduced by commit 8ac0f15f335

2019-11-05 Thread Michael Roth
From: Maxim Levitsky This fixes subtle corruption introduced by luks threaded encryption in commit 8ac0f15f335 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1745922 The corruption happens when we do a write that * writes to two or more unallocated clusters at once * doesn't fully

[PATCH 15/55] iotests: Restrict file Python tests to file

2019-11-05 Thread Michael Roth
From: Max Reitz Most of our Python unittest-style tests only support the file protocol. You can run them with any other protocol, but the test will simply ignore your choice and use file anyway. We should let them signal that they require the file protocol so they are skipped when you want to

[PATCH 01/55] dma-helpers: ensure AIO callback is invoked after cancellation

2019-11-05 Thread Michael Roth
From: Paolo Bonzini dma_aio_cancel unschedules the BH if there is one, which corresponds to the reschedule_dma case of dma_blk_cb. This can stall the DMA permanently, because dma_complete will never get invoked and therefore nobody will ever invoke the original AIO callback in dbs->common.cb.

[PATCH 11/55] x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set

2019-11-05 Thread Michael Roth
From: Igor Mammedov Commit 176d2cda0 (i386/cpu: Consolidate die-id validity in smp context) added new 'die-id' topology property to CPUs and exposed it via QMP command query-hotpluggable-cpus, which broke -device/device_add cpu-foo for existing users that do not support die-id/dies yet. That's

[PATCH 17/55] iotests: Test blockdev-create for vpc

2019-11-05 Thread Michael Roth
From: Max Reitz Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf (cherry picked from commit cb73747e1a47b93d3dfdc3f769c576b053916938) Signed-off-by: Michael Roth --- tests/qemu-iotests/266 | 153 + tests/qemu-iotests/266.out | 137

[PATCH 16/55] iotests: Restrict nbd Python tests to nbd

2019-11-05 Thread Michael Roth
From: Max Reitz We have two Python unittest-style tests that test NBD. As such, they should specify supported_protocols=['nbd'] so they are skipped when the user wants to test some other protocol. Furthermore, we should restrict their choice of formats to 'raw'. The idea of a protocol/format

[PATCH 09/55] iotests: Test reverse sub-cluster qcow2 writes

2019-11-05 Thread Michael Roth
From: Max Reitz This exercises the regression introduced in commit 50ba5b2d994853b38fed10e0841b119da0f8b8e5. On my machine, it has close to a 50 % false-negative rate, but that should still be sufficient to test the fix. Signed-off-by: Max Reitz Reviewed-by: Stefano Garzarella Reviewed-by:

[PATCH 12/55] vpc: Return 0 from vpc_co_create() on success

2019-11-05 Thread Michael Roth
From: Max Reitz blockdev_create_run() directly uses .bdrv_co_create()'s return value as the job's return value. Jobs must return 0 on success, not just any nonnegative value. Therefore, using blockdev-create for VPC images may currently fail as the vpc driver may return a positive integer.

Re: [PATCH v1 2/4] virtio: make seg_max virtqueue size dependent

2019-11-05 Thread Michael S. Tsirkin
On Tue, Nov 05, 2019 at 07:11:03PM +0300, Denis Plotnikov wrote: > seg_max has a restriction to be less or equal to virtqueue size > according to Virtio 1.0 specification > > Although seg_max can't be set directly, it's worth to express this > dependancy directly in the code for sanity purpose. >

Re: [PATCH 3/3] dp8393x: fix receiving buffer exhaustion

2019-11-05 Thread Laurent Vivier
Le 05/11/2019 à 21:45, Hervé Poussineau a écrit : > Le 02/11/2019 à 18:15, Laurent Vivier a écrit : >> The card is not able to exit from exhaustion state, because >> while the drive consumes the buffers, the RRP is incremented >> (when the driver clears the ISR RBE bit), so it stays equal >> to

Re: [PATCH v1 1/1] opensbi: Upgrade from v0.4 to v0.5

2019-11-05 Thread Palmer Dabbelt
On Tue, 05 Nov 2019 11:23:39 PST (-0800), alistai...@gmail.com wrote: > On Tue, Oct 29, 2019 at 3:33 AM Alistair Francis wrote: >> >> On Mon, Oct 28, 2019 at 5:56 PM Palmer Dabbelt wrote: >> > >> > On Sat, 26 Oct 2019 01:46:45 PDT (-0700), phi...@redhat.com wrote: >> > > On Sat, Oct 26, 2019 at

Re: [PATCH 3/3] dp8393x: fix receiving buffer exhaustion

2019-11-05 Thread Hervé Poussineau
Le 02/11/2019 à 18:15, Laurent Vivier a écrit : The card is not able to exit from exhaustion state, because while the drive consumes the buffers, the RRP is incremented (when the driver clears the ISR RBE bit), so it stays equal to RWP, and while RRP == RWP, the card thinks it is always in

Re: [PULL 0/1] Require Python >= 3.5 to build QEMU

2019-11-05 Thread Eduardo Habkost
On Tue, Nov 05, 2019 at 08:25:03PM +, Alex Bennée wrote: > > Eduardo Habkost writes: > > > On Thu, Oct 31, 2019 at 08:12:01AM +, Peter Maydell wrote: > >> On Fri, 25 Oct 2019 at 21:34, Eduardo Habkost wrote: > >> > > >> > The following changes since commit > >> >

  1   2   3   >