[Qemu-devel] [PULL v4 00/19] Initial support for Hypervisor.framework

2017-12-22 Thread Paolo Bonzini
The following changes since commit 43ab9a5376c95c61ae898a222c4d04bdf60e239b: hw/i386/vmport: fix missing definitions with non-log trace backends (2017-12-21 22:52:28 +) are available in the Git repository at: git://github.com/bonzini/qemu.git tags/for-upstream-hvf for you to fetch chan

Re: [Qemu-devel] [PATCH v2 1/2] vhost: add used memslot number for vhost-user and vhost-kernel separately

2017-12-22 Thread Zhoujian (jay)
Hi Igor, > -Original Message- > From: Igor Mammedov [mailto:imamm...@redhat.com] > Sent: Saturday, December 23, 2017 3:03 AM > To: Zhoujian (jay) > Cc: Huangweidong (C) ; m...@redhat.com; wangxin > (U) ; qemu-devel@nongnu.org; Liuzhe (Cloud > Open Labs, NFV) ; dgilb...@redhat.com; Gonglei

Re: [Qemu-devel] [PATCH v2 1/2] vhost: add used memslot number for vhost-user and vhost-kernel separately

2017-12-22 Thread Zhoujian (jay)
> -Original Message- > From: Igor Mammedov [mailto:imamm...@redhat.com] > Sent: Saturday, December 23, 2017 12:25 AM > To: Zhoujian (jay) > Cc: qemu-devel@nongnu.org; m...@redhat.com; Huangweidong (C) > ; Gonglei (Arei) ; > wangxin (U) ; Liuzhe (Cloud Open Labs, NFV) > ; dgilb...@redhat.co

Re: [Qemu-devel] [PATCH v20 3/7 RESEND] xbitmap: add more operations

2017-12-22 Thread Matthew Wilcox
On Sat, Dec 23, 2017 at 11:59:54AM +0900, Tetsuo Handa wrote: > Matthew Wilcox wrote: > > + bit %= IDA_BITMAP_BITS; > > + radix_tree_iter_init(&iter, index); > > + slot = idr_get_free_cmn(root, &iter, GFP_NOWAIT | __GFP_NOWARN, index); > > + if (IS_ERR(slot)) { > > + if (slot == E

[Qemu-devel] [PATCH] hw/xtensa/xtfpga: rewrite mini bootloader

2017-12-22 Thread Max Filippov
Don't load jump target into the CPU config, instead put it and initial a2 as literals into the mini bootloader and use l32r to load them natively. With these changes it should be possible to do warm reboot of the guest. Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 28

Re: [Qemu-devel] [PATCH v20 3/7 RESEND] xbitmap: add more operations

2017-12-22 Thread Tetsuo Handa
Matthew Wilcox wrote: > +/** > + * xb_set_bit() - Set a bit in the XBitmap. > + * @xb: The XBitmap. > + * @bit: Index of the bit to set. > + * > + * This function is used to set a bit in the xbitmap. > + * > + * Return: 0 on success. -ENOMEM if memory could not be allocated. > + */ > +int xb_set_bi

[Qemu-devel] [RFC PATCH] target/arm: Fix stlxp for aarch64_be

2017-12-22 Thread Michael Weiser
In big-endian mode, stlxp would not only store the individual doublewords big-endian but also swap them in memory. This does not correspond to how ldxp behaves nor how native code expects the result of stlxp to be stored in memory. Also, when comparing if the values in memory still match what was

[Qemu-devel] [PATCH v2 0/3] virtio_net: allow hypervisor to indicate linkspeed and duplex setting

2017-12-22 Thread Jason Baron via Qemu-devel
We have found it useful to be able to set the linkspeed and duplex settings from the host-side for virtio_net. This obviates the need for guest changes and settings for these fields, and does not require custom ethtool commands for virtio_net.

[Qemu-devel] [PATCH 2/3] qemu: use 64-bit values for feature flags in virtio-net

2017-12-22 Thread Jason Baron via Qemu-devel
In prepartion for using some of the high order feature bits, make sure that virtio-net uses 64-bit values everywhere. Signed-off-by: Jason Baron Cc: "Michael S. Tsirkin" Cc: Jason Wang --- hw/net/virtio-net.c| 54 +- include/hw/virtio/virtio-

[Qemu-devel] [PATCH net-next v2 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor

2017-12-22 Thread Jason Baron via Qemu-devel
The ability to set speed and duplex for virtio_net in useful in various scenarios as described here: 16032be virtio_net: add ethtool support for set and get of settings However, it would be nice to be able to set this from the hypervisor, such that virtio_net doesn't require custom guest ethtool

[Qemu-devel] [PATCH 3/3] qemu: add linkspeed and duplex settings to virtio-net

2017-12-22 Thread Jason Baron via Qemu-devel
Although linkspeed and duplex can be set in a linux guest via 'ethtool -s', this requires custom ethtool commands for virtio-net by default. Introduce a new feature flag, VIRTIO_NET_F_SPEED_DUPLEX, which allows the hypervisor to export a linkspeed and duplex setting. The user can subsequently over

Re: [Qemu-devel] [PATCH v4 0/5] Add a valid_cpu_types property

2017-12-22 Thread Eduardo Habkost
On Fri, Dec 22, 2017 at 11:47:00AM -0800, Alistair Francis wrote: > On Fri, Dec 22, 2017 at 10:45 AM, Alistair Francis > wrote: > > On Wed, Dec 20, 2017 at 2:06 PM, Eduardo Habkost > > wrote: > >> On Tue, Dec 19, 2017 at 05:03:59PM -0800, Alistair Francis wrote: > >>> On Tue, Dec 19, 2017 at 4:5

Re: [Qemu-devel] [PATCH v2 2/2] vhost: double check used memslots number

2017-12-22 Thread Michael S. Tsirkin
On Fri, Dec 22, 2017 at 07:48:55PM +0100, Igor Mammedov wrote: > On Fri, 15 Dec 2017 16:45:55 +0800 > Jay Zhou wrote: > > > If the VM already has N(N>8) available memory slots for vhost user, > > the VM will be crashed in vhost_user_set_mem_table if we try to > > hotplug the first vhost user NIC.

Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Alistair Francis
On Fri, Dec 22, 2017 at 12:30 PM, Markus Armbruster wrote: > Alistair Francis writes: > >> On Fri, Dec 22, 2017 at 9:17 AM, Thomas Huth wrote: >>> On 22.12.2017 16:37, Markus Armbruster wrote: Second thoughts... Alistair Francis writes: >>> [...] > #include "qemu/osdep.h" >>

Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Markus Armbruster
Alistair Francis writes: > On Fri, Dec 22, 2017 at 9:17 AM, Thomas Huth wrote: >> On 22.12.2017 16:37, Markus Armbruster wrote: >>> Second thoughts... >>> >>> Alistair Francis writes: >> [...] #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h"

[Qemu-devel] [PULL v1 08/10] tpm_tis: merge r/w_offset into rw_offset

2017-12-22 Thread Stefan Berger
We can now merge the r_offset and w_offset into a single rw_offset. This is possible since when the offset is used for writing in RECEPTION state then reads are ignore. Conversely, when the offset is used for reading when in COMPLETION state, then writes are ignored. Signed-off-by: Stefan Berger

[Qemu-devel] [PULL v1 07/10] tpm_tis: move r/w_offsets to TPMState

2017-12-22 Thread Stefan Berger
Now that we have a single buffer, we also only need a single set of read/write offsets into that buffer. This works since only one locality can be active. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 57 +++---

[Qemu-devel] [PULL v1 02/10] tpm_tis: convert uint32_t to size_t

2017-12-22 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index b8e811b..ac5f51f 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -974,7 +974,7 @@ static const Me

[Qemu-devel] [PULL v1 10/10] acpi: Update TPM2 ACPI table to more recent specs

2017-12-22 Thread Stefan Berger
From: Stefan Berger More recent specs of the TPM2 ACPI table add fields for the log area start address and the log area minimum size, which we already use for the TCPA table. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/i386/acpi-build.c| 19 ++-

[Qemu-devel] [PULL v1 03/10] tpm_tis: limit size of buffer from backend

2017-12-22 Thread Stefan Berger
This is a preparatory patch for the subsequent ones where we get rid of the flexibility of supporting any kind of buffer size that the backend may support. We keep the size at 4096, which is also the size the external emulator supports. So, limit the size of the buffer we can support and pass it ba

[Qemu-devel] [PULL v1 04/10] tpm_tis: remove TPMSizeBuffer usage

2017-12-22 Thread Stefan Berger
Remove usage of TPMSizeBuffer. The size of the buffers is limited now by s->be_buffer_size, which is the size of the buffer the TIS has negotiated with the backend. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 68

[Qemu-devel] [PULL v1 06/10] tpm_tis: merge read and write buffer into single buffer

2017-12-22 Thread Stefan Berger
Since we can only be in read or write mode, we can merge the buffers into a single buffer. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/tpm/tpm_tis.c b/hw/t

[Qemu-devel] [PULL v1 05/10] tpm_tis: move buffers from localities into common location

2017-12-22 Thread Stefan Berger
One read buffer and one write buffer is sufficient for all localities. The localities cannot all be active at the same time, and only the active locality can use the r/w buffers. Inactive localities will require the COMMAND_READY flag to be set on the STS register to move to the READY state, which

[Qemu-devel] [PULL v1 09/10] tpm: Implement tpm_sized_buffer_reset

2017-12-22 Thread Stefan Berger
Move the definition of TPMSizedBuffer out of tpm_tis.c into tpm_util.h and implement tpm_sized_buffer_reset() for the following patches to use. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 5 - hw/tpm/tpm_util.c | 7 +++ hw/tpm/tpm_util.h | 7 +

[Qemu-devel] [PULL v1 01/10] tpm_emulator: Add a caching layer for the TPM Established flag

2017-12-22 Thread Stefan Berger
Add a caching layer for the TPM established flag so that we don't need to go to the emulator every time the flag is read by accessing the REG_ACCESS register. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_emulator.c | 17 ++--- 1 file changed, 14 inserti

[Qemu-devel] [PULL v1 00/10] Merge tpm 2017/12/22

2017-12-22 Thread Stefan Berger
The following series of patches most important parts add a caching layer to the TPM emulator backend for reducing the number of control commands sent to retrieve the TPMEstablished flag. They also simplify the TPM TIS internal usage of buffers and r/w offsets in preparation for adding migration sup

Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Alistair Francis
On Fri, Dec 22, 2017 at 9:17 AM, Thomas Huth wrote: > On 22.12.2017 16:37, Markus Armbruster wrote: >> Second thoughts... >> >> Alistair Francis writes: > [...] >>> #include "qemu/osdep.h" >>> +#include "qemu/error-report.h" >>> #include "qapi/error.h" >>> #include "qemu-common.h" >>> #includ

Re: [Qemu-devel] [PATCH v4 0/5] Add a valid_cpu_types property

2017-12-22 Thread Alistair Francis
On Fri, Dec 22, 2017 at 10:45 AM, Alistair Francis wrote: > On Wed, Dec 20, 2017 at 2:06 PM, Eduardo Habkost wrote: >> On Tue, Dec 19, 2017 at 05:03:59PM -0800, Alistair Francis wrote: >>> On Tue, Dec 19, 2017 at 4:55 PM, Alistair Francis >>> wrote: >>> > On Tue, Dec 19, 2017 at 4:43 PM, Peter M

Re: [Qemu-devel] [RESEND PATCH for-2.12 2/2] hw/acpi-build: Make next_base easy to follow

2017-12-22 Thread Michael S. Tsirkin
On Thu, Dec 14, 2017 at 12:08:55PM +0800, Dou Liyang wrote: > It may be hard to read the assignment statement of "next_base", so > > S/next_base += (1ULL << 32) - pcms->below_4g_mem_size; > /next_base = mem_base + mem_len; > > ... for readability. > > No functionality change. > > Signed-off-by

Re: [Qemu-devel] [RESEND PATCH for-2.12 0/2] ACPI/unit-test: Add a testcase

2017-12-22 Thread Michael S. Tsirkin
On Fri, Dec 22, 2017 at 08:24:34PM +0100, Igor Mammedov wrote: > On Wed, 20 Dec 2017 19:38:20 -0200 > Eduardo Habkost wrote: > > > On Tue, Dec 19, 2017 at 12:01:59PM +0800, Dou Liyang wrote: > > > Hi Eduardo, > > > > > > At 12/19/2017 06:09 AM, Eduardo Habkost wrote: > > > > On Thu, Dec 14, 2017

Re: [Qemu-devel] [RESEND PATCH for-2.12 0/2] ACPI/unit-test: Add a testcase

2017-12-22 Thread Igor Mammedov
On Wed, 20 Dec 2017 19:38:20 -0200 Eduardo Habkost wrote: > On Tue, Dec 19, 2017 at 12:01:59PM +0800, Dou Liyang wrote: > > Hi Eduardo, > > > > At 12/19/2017 06:09 AM, Eduardo Habkost wrote: > > > On Thu, Dec 14, 2017 at 12:08:53PM +0800, Dou Liyang wrote: > > > > These are the patches left over

Re: [Qemu-devel] [PATCH v3 00/13] tpm: Extend TPM with state migration support (not 2.11)

2017-12-22 Thread Stefan Berger
On 12/22/2017 12:52 PM, Marc-André Lureau wrote: Hi On Fri, Dec 22, 2017 at 6:47 PM, Stefan Berger wrote: On 12/22/2017 11:13 AM, Marc-André Lureau wrote: Hi On Fri, Dec 22, 2017 at 4:59 PM, Stefan Berger wrote: On 12/22/2017 07:49 AM, Marc-André Lureau wrote: Hi On Fri, Nov 10, 2017 at

Re: [Qemu-devel] [PATCH v5 6/7] vhost: Clean out old vhost_set_memory and friends

2017-12-22 Thread Igor Mammedov
On Mon, 18 Dec 2017 20:13:39 + "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Remove the old update mechanism, vhost_set_memory, and the functions > and flags it used. > > Signed-off-by: Dr. David Alan Gilbert > --- [...] > - > -static void vhost_set_memory(Me

Re: [Qemu-devel] [PATCH v2 1/2] vhost: add used memslot number for vhost-user and vhost-kernel separately

2017-12-22 Thread Igor Mammedov
On Fri, 22 Dec 2017 17:25:13 +0100 Igor Mammedov wrote: > On Fri, 15 Dec 2017 16:45:54 +0800 > Jay Zhou wrote: [...] > > +static void vhost_user_set_used_memslots(struct vhost_dev *dev) > > +{ > > +int counter = 0; > > +int i; > > + > > +for (i = 0; i < dev->mem->nregions; ++i) { >

Re: [Qemu-devel] [PATCH v2 2/2] vhost: double check used memslots number

2017-12-22 Thread Igor Mammedov
On Fri, 15 Dec 2017 16:45:55 +0800 Jay Zhou wrote: > If the VM already has N(N>8) available memory slots for vhost user, > the VM will be crashed in vhost_user_set_mem_table if we try to > hotplug the first vhost user NIC. > This patch checks if memslots number exceeded or not after updating > vh

Re: [Qemu-devel] [PATCH v6 0/9] Add memfd memory backend

2017-12-22 Thread Marc-André Lureau
Hi On Mon, Oct 23, 2017 at 4:18 PM, Marc-André Lureau wrote: > Add a new Linux-specific memory backend, similar to hostmem-file, > except that it doesn't need file path. It also try to enforce memory > sealing if available. It is thus slightly easier and secure, and is > compatible with transpare

Re: [Qemu-devel] [PATCH v4 0/5] Add a valid_cpu_types property

2017-12-22 Thread Alistair Francis
On Wed, Dec 20, 2017 at 2:06 PM, Eduardo Habkost wrote: > On Tue, Dec 19, 2017 at 05:03:59PM -0800, Alistair Francis wrote: >> On Tue, Dec 19, 2017 at 4:55 PM, Alistair Francis >> wrote: >> > On Tue, Dec 19, 2017 at 4:43 PM, Peter Maydell >> > wrote: >> >> On 20 December 2017 at 00:27, Alistair

Re: [Qemu-devel] [PATCH v3 00/13] tpm: Extend TPM with state migration support (not 2.11)

2017-12-22 Thread Marc-André Lureau
Hi On Fri, Dec 22, 2017 at 6:47 PM, Stefan Berger wrote: > On 12/22/2017 11:13 AM, Marc-André Lureau wrote: >> >> Hi >> >> On Fri, Dec 22, 2017 at 4:59 PM, Stefan Berger >> wrote: >>> >>> On 12/22/2017 07:49 AM, Marc-André Lureau wrote: Hi On Fri, Nov 10, 2017 at 3:11 PM, Ste

Re: [Qemu-devel] [PATCH v3 00/13] tpm: Extend TPM with state migration support (not 2.11)

2017-12-22 Thread Stefan Berger
On 12/22/2017 11:13 AM, Marc-André Lureau wrote: Hi On Fri, Dec 22, 2017 at 4:59 PM, Stefan Berger wrote: On 12/22/2017 07:49 AM, Marc-André Lureau wrote: Hi On Fri, Nov 10, 2017 at 3:11 PM, Stefan Berger wrote: This set of patches implements support for migrating the state of the external

Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Thomas Huth
On 22.12.2017 16:37, Markus Armbruster wrote: > Second thoughts... > > Alistair Francis writes: [...] >> #include "qemu/osdep.h" >> +#include "qemu/error-report.h" >> #include "qapi/error.h" >> #include "qemu-common.h" >> #include "cpu.h" >> @@ -1311,8 +1312,8 @@ static void omap_prcm_apll_up

Re: [Qemu-devel] [PULL v3 00/19] Initial support for Hypervisor.framework

2017-12-22 Thread Programmingkid
> On Dec 22, 2017, at 11:52 AM, Paolo Bonzini wrote: > > On 22/12/2017 17:51, Programmingkid wrote: >> Thanks. When I tried using qemu-system-i386 with the -accel hvf feature I >> saw this error: accel=hvf: No accelerator found. >> >> I tried to build the qemu-system-x86_64 target but I also s

Re: [Qemu-devel] [PULL v3 00/19] Initial support for Hypervisor.framework

2017-12-22 Thread Paolo Bonzini
On 22/12/2017 17:51, Programmingkid wrote: > Thanks. When I tried using qemu-system-i386 with the -accel hvf feature I saw > this error: accel=hvf: No accelerator found. > > I tried to build the qemu-system-x86_64 target but I also saw this error: > > /Users/misbah/desktop/qemu/target/i386/hvf/x

Re: [Qemu-devel] [PULL v3 00/19] Initial support for Hypervisor.framework

2017-12-22 Thread Programmingkid
> On Dec 22, 2017, at 11:42 AM, Paolo Bonzini wrote: > > On 22/12/2017 17:26, Programmingkid wrote: >> I was able to clone your git repository and successfully build the hvf >> branch. The latest commit is this: >> >> commit aabe2a1a77b70efe96c9345f737068a0dcef0281 (HEAD -> hvf, origin/hvf) >>

Re: [Qemu-devel] [PULL v3 00/35] Block layer patches

2017-12-22 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20171222151846.28110-1-kw...@redhat.com Subject: [Qemu-devel] [PULL v3 00/35] Block layer patches === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log --oneli

Re: [Qemu-devel] [PULL v3 00/19] Initial support for Hypervisor.framework

2017-12-22 Thread Paolo Bonzini
On 22/12/2017 17:26, Programmingkid wrote: > I was able to clone your git repository and successfully build the hvf > branch. The latest commit is this: > > commit aabe2a1a77b70efe96c9345f737068a0dcef0281 (HEAD -> hvf, origin/hvf) > Author: Paolo Bonzini > Date: Thu Dec 21 00:10:03 2017 +0100

Re: [Qemu-devel] [PATCH v2 2/3] qcow2: handle reopening bitmaps on bdrv_invalidate_cache

2017-12-22 Thread Kevin Wolf
Am 22.12.2017 um 17:12 hat Vladimir Sementsov-Ogievskiy geschrieben: > 22.12.2017 18:43, Kevin Wolf wrote: > > Am 22.12.2017 um 15:25 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > 22.12.2017 16:39, Kevin Wolf wrote: > > > > Am 12.12.2017 um 17:04 hat Vladimir Sementsov-Ogievskiy geschrieben:

Re: [Qemu-devel] [PULL v3 00/19] Initial support for Hypervisor.framework

2017-12-22 Thread Programmingkid
> On Dec 22, 2017, at 9:10 AM, qemu-devel-requ...@nongnu.org wrote: > > Message: 16 > Date: Fri, 22 Dec 2017 15:03:04 +0100 > From: Paolo Bonzini > To: Peter Maydell > Cc: QEMU Developers > Subject: Re: [Qemu-devel] [PULL v3 00/19] Initial support for > Hypervisor.framework > Message-ID:

Re: [Qemu-devel] [PATCH v2 1/2] vhost: add used memslot number for vhost-user and vhost-kernel separately

2017-12-22 Thread Igor Mammedov
On Fri, 15 Dec 2017 16:45:54 +0800 Jay Zhou wrote: > Used_memslots is equal to dev->mem->nregions now, it is true for > vhost kernel, but not for vhost user, which uses the memory regions > that have file descriptor. In fact, not all of the memory regions > have file descriptor. > It is usefully

Re: [Qemu-devel] [PATCH v2 2/3] qcow2: handle reopening bitmaps on bdrv_invalidate_cache

2017-12-22 Thread Vladimir Sementsov-Ogievskiy
22.12.2017 18:43, Kevin Wolf wrote: Am 22.12.2017 um 15:25 hat Vladimir Sementsov-Ogievskiy geschrieben: 22.12.2017 16:39, Kevin Wolf wrote: Am 12.12.2017 um 17:04 hat Vladimir Sementsov-Ogievskiy geschrieben: Consider migration with shared storage. Persistent bitmaps are stored on bdrv_inacti

Re: [Qemu-devel] [PATCH v3 00/13] tpm: Extend TPM with state migration support (not 2.11)

2017-12-22 Thread Marc-André Lureau
Hi On Fri, Dec 22, 2017 at 4:59 PM, Stefan Berger wrote: > On 12/22/2017 07:49 AM, Marc-André Lureau wrote: >> >> Hi >> >> On Fri, Nov 10, 2017 at 3:11 PM, Stefan Berger >> wrote: >>> >>> This set of patches implements support for migrating the state of the >>> external 'swtpm' TPM emulator as w

Re: [Qemu-devel] [PATCH] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type

2017-12-22 Thread Paolo Bonzini
On 22/12/2017 02:51, Haozhong Zhang wrote: > When -no-acpi option is used with Q35 machine type, no guest ACPI is > built, but the ACPI device is still created, so only checking the > presence of ACPI device before memory plug/unplug is not enough in > such cases. Check whether ACPI is disabled glo

Re: [Qemu-devel] [PATCH] scsi: fix scsi_convert_sense crash when in_buf == NULL && in_len == 0

2017-12-22 Thread Roman Kagan
On Fri, Dec 22, 2017 at 04:55:22PM +0100, Paolo Bonzini wrote: > scsi_disk_emulate_command passes in_buf == NULL when sent a REQUEST > SENSE command. Check for in_len == 0 before dereferencing in_buf. > > Fixes: f68d98b21fa74155dc7c1fd212474379ac3c7531 > Reported-by: Roman Kagan > Signed-off-by:

Re: [Qemu-devel] [PATCH v2 0/6] nbd export qmp interface

2017-12-22 Thread Eric Blake
On 12/22/2017 02:53 AM, Vladimir Sementsov-Ogievskiy wrote: 21.12.2017 21:32, Eric Blake wrote: On 12/21/2017 09:28 AM, Markus Armbruster wrote: Looks like you forgot to cc: Eric. Fixing... Or that he did cc me, and the mailman bug ate the cc line because of my list subscription settings.  (

Re: [Qemu-devel] [PATCH v2 2/3] qcow2: handle reopening bitmaps on bdrv_invalidate_cache

2017-12-22 Thread Kevin Wolf
Am 22.12.2017 um 15:25 hat Vladimir Sementsov-Ogievskiy geschrieben: > 22.12.2017 16:39, Kevin Wolf wrote: > > Am 12.12.2017 um 17:04 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > Consider migration with shared storage. Persistent bitmaps are stored > > > on bdrv_inactivate. Then, on destinat

Re: [Qemu-devel] [PATCH v3 00/13] tpm: Extend TPM with state migration support (not 2.11)

2017-12-22 Thread Stefan Berger
On 12/22/2017 07:49 AM, Marc-André Lureau wrote: Hi On Fri, Nov 10, 2017 at 3:11 PM, Stefan Berger wrote: This set of patches implements support for migrating the state of the external 'swtpm' TPM emulator as well as that of the emulated device interfaces. I have primarily tested this with the

[Qemu-devel] [PATCH] scsi: fix scsi_convert_sense crash when in_buf == NULL && in_len == 0

2017-12-22 Thread Paolo Bonzini
scsi_disk_emulate_command passes in_buf == NULL when sent a REQUEST SENSE command. Check for in_len == 0 before dereferencing in_buf. Fixes: f68d98b21fa74155dc7c1fd212474379ac3c7531 Reported-by: Roman Kagan Signed-off-by: Paolo Bonzini --- scsi/utils.c | 12 ++-- 1 file changed, 6 inse

[Qemu-devel] [PATCH 3/3] input: virtio: don't send mouse wheel event twice

2017-12-22 Thread Miika S
On Linux, a mouse event is generated for both down and up when mouse wheel is used. This caused virtio_input_send() to be called twice each time the wheel was used. This commit adds a check for the button down state and only calls virtio_input_send() when it is true. Signed-off-by: Miika S ---

[Qemu-devel] [PATCH 2/3] input: add mouse side buttons to virtio input

2017-12-22 Thread Miika S
Signed-off-by: Miika S --- hw/input/virtio-input-hid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index 9628d289f9..2cac659469 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -154,6 +154,8 @@ static

Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Markus Armbruster
Second thoughts... Alistair Francis writes: > Replace a large number of the fprintf(stderr, "*\n" calls with > error_report(). The functions were renamed with these commands and then > compiler issues where manually fixed. > > find ./* -type f -exec sed -i \ > 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fp

[Qemu-devel] [PULL v3 32/35] block: Allow graph changes in subtree drained section

2017-12-22 Thread Kevin Wolf
We need to remember how many of the drain sections in which a node is were recursive (i.e. subtree drain rather than node drain), so that they can be correctly applied when children are added or removed during the drained section. With this change, it is safe to modify the graph even inside a bdrv

Re: [Qemu-devel] [PULL 32/46] scsi: provide general-purpose functions to manage sense data

2017-12-22 Thread Roman Kagan
On Wed, Dec 20, 2017 at 06:14:44PM +0100, Paolo Bonzini wrote: > @@ -274,52 +319,21 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = { > int scsi_convert_sense(uint8_t *in_buf, int in_len, > uint8_t *buf, int len, bool fixed) > { > -bool fixed_in; > SCSIS

Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Markus Armbruster
Alistair Francis writes: > Replace a large number of the fprintf(stderr, "*\n" calls with > error_report(). The functions were renamed with these commands and then > compiler issues where manually fixed. > > find ./* -type f -exec sed -i \ > 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, > "\(

[Qemu-devel] [PULL v3 31/35] test-bdrv-drain: Recursive draining with multiple parents

2017-12-22 Thread Kevin Wolf
Test that drain sections are correctly propagated through the graph. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 74 + 1 file changed, 74 insertions(+) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 354c6151a0..69

[Qemu-devel] [PULL v3 33/35] test-bdrv-drain: Test graph changes in drained section

2017-12-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 80 + 1 file changed, 80 insertions(+) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 690b585b4d..d760e2b243 100644 --- a/tests/test-bdrv-drain.c +++ b/tests/test-bdrv-dr

[Qemu-devel] [PULL v3 29/35] test-bdrv-drain: Tests for bdrv_subtree_drain

2017-12-22 Thread Kevin Wolf
Add a subtree drain version to the existing test cases. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 9098b77ab4..f363d51b34 100644 ---

[Qemu-devel] [PATCH 0/3] input: add keys and mouse buttons to virtio input

2017-12-22 Thread Miika S
This patchset adds some missing keys and mouse buttons to hw/input/virtio-input-hid.c. On a JIS keyboard such as this one (106/109 - JIS) https://upload.wikimedia.org/wikipedia/commons/b/b2/Physical_keyboard_layouts_comparison_ANSI_ISO_KS_ABNT_JIS.png the keys are located as follows: muhenkan: lef

[Qemu-devel] [PULL v3 30/35] test-bdrv-drain: Test behaviour in coroutine context

2017-12-22 Thread Kevin Wolf
If bdrv_do_drained_begin/end() are called in coroutine context, they first use a BH to get out of the coroutine context. Call some existing tests again from a coroutine to cover this code path. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 59 +++

[Qemu-devel] [PULL v3 27/35] block: Don't notify parents in drain call chain

2017-12-22 Thread Kevin Wolf
This is in preparation for subtree drains, i.e. drained sections that affect not only a single node, but recursively all child nodes, too. Calling the parent callbacks for drain is pointless when we just came from that parent node recursively and leads to multiple increases of bs->quiesce_counter

[Qemu-devel] [PULL v3 26/35] test-bdrv-drain: Test nested drain sections

2017-12-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 57 + 1 file changed, 57 insertions(+) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 6da66ae841..9098b77ab4 100644 --- a/tests/test-bdrv-drain.c +++ b/tests/test-bdrv-dr

[Qemu-devel] [PULL v3 23/35] test-bdrv-drain: Test drain vs. block jobs

2017-12-22 Thread Kevin Wolf
Block jobs must be paused if any of the involved nodes are drained. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 121 1 file changed, 121 insertions(+) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 323cb0b961..97

[Qemu-devel] [PULL v3 28/35] block: Add bdrv_subtree_drained_begin/end()

2017-12-22 Thread Kevin Wolf
bdrv_drained_begin() waits for the completion of requests in the whole subtree, but it only actually keeps its immediate bs parameter quiesced until bdrv_drained_end(). Add a version that keeps the whole subtree drained. As of this commit, graph changes cannot be allowed during a subtree drained s

[Qemu-devel] [PULL v3 21/35] test-bdrv-drain: Test bs->quiesce_counter

2017-12-22 Thread Kevin Wolf
This is currently only working correctly for bdrv_drain(), not for bdrv_drain_all(). Leave a comment for the drain_all case, we'll address it later. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 45 + 1 file changed, 45 insertions(+) diff --

[Qemu-devel] [PULL v3 25/35] block: Nested drain_end must still call callbacks

2017-12-22 Thread Kevin Wolf
bdrv_do_drained_begin() restricts the call of parent callbacks and aio_disable_external() to the outermost drain section, but the block driver callbacks are always called. bdrv_do_drained_end() must match this behaviour, otherwise nodes stay drained even if begin/end calls were balanced. Signed-of

[Qemu-devel] [PATCH 1/3] input: add missing JIS keys to virtio input

2017-12-22 Thread Miika S
keycodemapdb updated to add the QKeyCodes muhenkan and katakanahiragana Signed-off-by: Miika S --- hw/input/virtio-input-hid.c | 7 +++ qapi/ui.json| 5 - ui/keycodemapdb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/input/virtio-i

[Qemu-devel] [PULL v3 22/35] blockjob: Pause job on draining any job BDS

2017-12-22 Thread Kevin Wolf
Block jobs already paused themselves when their main BlockBackend entered a drained section. This is not good enough: We also want to pause a block job and may not submit new requests if, for example, the mirror target node should be drained. This implements .drained_begin/end callbacks in child_j

[Qemu-devel] [PULL v3 24/35] block: Don't block_job_pause_all() in bdrv_drain_all()

2017-12-22 Thread Kevin Wolf
Block jobs are already paused using the BdrvChildRole drain callbacks, so we don't need an additional block_job_pause_all() call. Signed-off-by: Kevin Wolf --- block/io.c | 4 tests/test-bdrv-drain.c | 10 -- 2 files changed, 4 insertions(+), 10 deletions(-) diff --gi

[Qemu-devel] [PULL v3 19/35] block: Make bdrv_drain() driver callbacks non-recursive

2017-12-22 Thread Kevin Wolf
bdrv_drained_begin() doesn't increase bs->quiesce_counter recursively and also doesn't notify other parent nodes of children, which both means that the child nodes are not actually drained, and bdrv_drained_begin() is providing useful functionality only on a single node. To keep things consistent,

[Qemu-devel] [PULL v3 20/35] test-bdrv-drain: Test callback for bdrv_drain

2017-12-22 Thread Kevin Wolf
The existing test is for bdrv_drain_all_begin/end() only. Generalise the test case so that it can be run for the other variants as well. At the moment this is only bdrv_drain_begin/end(), but in a while, we'll add another one. Also, add a backing file to the test node to test whether the operation

[Qemu-devel] [PULL v3 18/35] block: Assert drain_all is only called from main AioContext

2017-12-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- block/io.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/io.c b/block/io.c index cf780c3cb0..b94740b8ff 100644 --- a/block/io.c +++ b/block/io.c @@ -330,6 +330,12 @@ void bdrv_drain_all_begin(void) BdrvNextIterator it;

[Qemu-devel] [PULL v3 17/35] block: Remove unused bdrv_requests_pending

2017-12-22 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- include/block/block_int.h | 1 - block/io.c| 18 -- 2 files changed, 19 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index a5482775ec..e107163594 100644 -

Re: [Qemu-devel] [PATCH v6 05/29] hw/dma: Replace fprintf(stderr, "*\n" with error_report()

2017-12-22 Thread Markus Armbruster
Alistair Francis writes: > Replace a large number of the fprintf(stderr, "*\n" calls with > error_report(). The functions were renamed with these commands and then > compiler issues where manually fixed. > > find ./* -type f -exec sed -i \ > 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, > "\(

[Qemu-devel] [PULL v3 16/35] block: Mention -drive cyls/heads/secs/trans/serial/addr in deprecation chapter

2017-12-22 Thread Kevin Wolf
From: Thomas Huth Looks like we forgot to announce the deprecation of these options in the corresponding chapter of the qemu-doc text, so let's do that now. Signed-off-by: Thomas Huth Reviewed-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf --- qemu-doc.texi | 15

[Qemu-devel] [PULL v3 14/35] block: Remove the obsolete -drive boot=on|off parameter

2017-12-22 Thread Kevin Wolf
From: Thomas Huth It's not working anymore since QEMU v1.3.0 - time to remove it now. Signed-off-by: Thomas Huth Reviewed-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf --- blockdev.c| 11 --- qemu-doc.texi | 6 -- 2 files changed, 17 deletions(-) d

[Qemu-devel] [PULL v3 15/35] block: Remove the deprecated -hdachs option

2017-12-22 Thread Kevin Wolf
From: Thomas Huth It's been marked as deprecated since QEMU v2.10.0, and so far nobody complained that we should keep it, so let's remove this legacy option now to simplify the code quite a bit. Signed-off-by: Thomas Huth Reviewed-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Ke

[Qemu-devel] [PULL v3 34/35] commit: Simplify reopen of base

2017-12-22 Thread Kevin Wolf
Since commit bde70715, base is the only node that is reopened in commit_start(). This means that the code, which still involves an explicit BlockReopenQueue, can now be simplified by using bdrv_reopen(). Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- block/commit.c | 8 +--- 1 file ch

[Qemu-devel] [PULL v3 11/35] block: Document that x-blockdev-change breaks quorum children list

2017-12-22 Thread Kevin Wolf
Removing a quorum child node with x-blockdev-change results in a quorum driver state that cannot be recreated with create options because it would require a list with gaps. This causes trouble in at least .bdrv_refresh_filename(). Document this problem so that we won't accidentally mark the comman

[Qemu-devel] [PULL v3 13/35] block: Open backing image in force share mode for size probe

2017-12-22 Thread Kevin Wolf
From: Fam Zheng Management tools create overlays of running guests with qemu-img: $ qemu-img create -b /image/in/use.qcow2 -f qcow2 /overlay/image.qcow2 but this doesn't work anymore due to image locking: qemu-img: /overlay/image.qcow2: Failed to get shared "write" lock Is another pr

[Qemu-devel] [PULL v3 10/35] qcow2: get rid of qcow2_backing_read1 routine

2017-12-22 Thread Kevin Wolf
From: Edgar Kaziakhmedov Since bdrv_co_preadv does all neccessary checks including reading after the end of the backing file, avoid duplication of verification before bdrv_co_preadv call. Signed-off-by: Edgar Kaziakhmedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Signe

[Qemu-devel] [PULL v3 35/35] block: Keep nodes drained between reopen_queue/multiple

2017-12-22 Thread Kevin Wolf
The bdrv_reopen*() implementation doesn't like it if the graph is changed between queuing nodes for reopen and actually reopening them (one of the reasons is that queuing can be recursive). So instead of draining the device only in bdrv_reopen_multiple(), require that callers already drained all a

[Qemu-devel] [PULL v3 05/35] test-bdrv-drain: Test BlockDriver callbacks for drain

2017-12-22 Thread Kevin Wolf
This adds a test case that the BlockDriver callbacks for drain are called in bdrv_drained_all_begin/end(), and that both of them are called exactly once. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake --- tests/test-bdrv-drain.c | 137 +++

[Qemu-devel] [PULL v3 09/35] block: Don't acquire AioContext in hmp_qemu_io()

2017-12-22 Thread Kevin Wolf
Commit 15afd94a047 added code to acquire and release the AioContext in qemuio_command(). This means that the lock is taken twice now in the call path from hmp_qemu_io(). This causes BDRV_POLL_WHILE() to hang for any requests issued to nodes in a non-mainloop AioContext. Dropping the first locking

[Qemu-devel] [PULL v3 06/35] block: bdrv_drain_recurse(): Remove unused begin parameter

2017-12-22 Thread Kevin Wolf
Now that the bdrv_drain_invoke() calls are pulled up to the callers of bdrv_drain_recurse(), the 'begin' parameter isn't needed any more. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/io.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/

[Qemu-devel] [PULL v3 12/35] nvme: Add tracing

2017-12-22 Thread Kevin Wolf
From: Doug Gale Add trace output for commands, errors, and undefined behavior. Add guest error log output for undefined behavior. Report invalid undefined accesses to MMIO. Annotate unlikely error checks with unlikely. Signed-off-by: Doug Gale Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: S

[Qemu-devel] [PULL v3 04/35] block: Call .drain_begin only once in bdrv_drain_all_begin()

2017-12-22 Thread Kevin Wolf
bdrv_drain_all_begin() used to call the .bdrv_co_drain_begin() driver callback inside its polling loop. This means that how many times it got called for each node depended on long it had to poll the event loop. This is obviously not right and results in nodes that stay drained even after bdrv_drai

[Qemu-devel] [PULL v3 08/35] block: Unify order in drain functions

2017-12-22 Thread Kevin Wolf
Drain requests are propagated to child nodes, parent nodes and directly to the AioContext. The order in which this happened was different between all combinations of drain/drain_all and begin/end. The correct order is to keep children only drained when their parents are also drained. This means th

[Qemu-devel] [PULL v3 03/35] block: Make bdrv_drain_invoke() recursive

2017-12-22 Thread Kevin Wolf
This change separates bdrv_drain_invoke(), which calls the BlockDriver drain callbacks, from bdrv_drain_recurse(). Instead, the function performs its own recursion now. One reason for this is that bdrv_drain_recurse() can be called multiple times by bdrv_drain_all_begin(), but the callbacks may on

[Qemu-devel] [PULL v3 00/35] Block layer patches

2017-12-22 Thread Kevin Wolf
The following changes since commit 281f327487c9c9b1599f93c589a408bbf4a651b8: Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging (2017-12-22 00:11:36 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

[Qemu-devel] [PULL v3 07/35] block: Don't wait for requests in bdrv_drain*_end()

2017-12-22 Thread Kevin Wolf
The device is drained, so there is no point in waiting for requests at the end of the drained section. Remove the bdrv_drain_recurse() calls there. The bdrv_drain_recurse() calls were introduced in commit 481cad48e5e in order to call the .bdrv_co_drain_end() driver callback. This is now done by a

[Qemu-devel] [PULL v3 02/35] iotests: fix 197 for vpc

2017-12-22 Thread Kevin Wolf
From: John Snow VPC has some difficulty creating geometries of particular size. However, we can indeed force it to use a literal one, so let's do that for the sake of test 197, which is testing some specific offsets. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi

[Qemu-devel] [PULL v3 01/35] block: Formats don't need CONSISTENT_READ with NO_IO

2017-12-22 Thread Kevin Wolf
Commit 1f4ad7d fixed 'qemu-img info' for raw images that are currently in use as a mirror target. It is not enough for image formats, though, as these still unconditionally request BLK_PERM_CONSISTENT_READ. As this permission is geared towards whether the guest-visible data is consistent, and has

  1   2   >