Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

2017-06-28 Thread Suraj Jitindar Singh
On Thu, 2017-06-29 at 15:37 +1000, Suraj Jitindar Singh wrote: > On Wed, 2017-06-28 at 18:41 +0200, Greg Kurz wrote: > > On Wed, 28 Jun 2017 18:18:06 +0200 > > Laurent Vivier wrote: > > > > > On 28/06/2017 13:59, Greg Kurz wrote: > > > > On Wed, 28 Jun 2017 12:23:06 +0200 > >

Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

2017-06-28 Thread Suraj Jitindar Singh
On Wed, 2017-06-28 at 18:41 +0200, Greg Kurz wrote: > On Wed, 28 Jun 2017 18:18:06 +0200 > Laurent Vivier wrote: > > > On 28/06/2017 13:59, Greg Kurz wrote: > > > On Wed, 28 Jun 2017 12:23:06 +0200 > > > Cédric Le Goater wrote: > > >    > > > > On 06/28/2017

[Qemu-devel] [PATCH] target/ppc: Only set PCR in kvm if actually in a compat mode

2017-06-28 Thread Suraj Jitindar Singh
The Processor Compatibility Register (PCR) I used to set the compatibility mode of the processor using the SET_ONE_REG ioctl on KVM_REG_PPC_ARCH_COMPAT. Previously this was only called when a compat mode was actually in use, however a recent patch made it unconditional. Calling this in KVM_PR

[Qemu-devel] [PATCH] intel_iommu: fix migration breakage on mr switch

2017-06-28 Thread Peter Xu
Migration is broken after the vfio integration work: qemu-kvm: AHCI: Failed to start FIS receive engine: bad FIS receive buffer address qemu-kvm: Failed to load ich9_ahci:ahci qemu-kvm: error while loading state for instance 0x0 of device ':00:1f.2/ich9_ahci' qemu-kvm: load of migration

Re: [Qemu-devel] [PATCH v6 3/3] migration: add bitmap for received page

2017-06-28 Thread Peter Xu
On Wed, Jun 28, 2017 at 08:49:32AM -0400, Alexey Perevalov wrote: [...] > @@ -2324,8 +2352,14 @@ static int ram_load_setup(QEMUFile *f, void *opaque) [1] > > static int ram_load_cleanup(void *opaque) > { > +RAMBlock *rb; > xbzrle_load_cleanup(); >

Re: [Qemu-devel] [PATCH v6 1/4] net/socket: Don't treat odd socket type as SOCK_STREAM

2017-06-28 Thread Mao Zhongyi
Hi, Eric On 06/28/2017 10:23 PM, Eric Blake wrote: On 06/28/2017 08:18 AM, Daniel P. Berrange wrote: On Wed, Jun 28, 2017 at 09:08:47PM +0800, Mao Zhongyi wrote: In net_socket_fd_init(), the 'default' case is odd: it warns, then continues as if the socket type was SOCK_STREAM. The comment

Re: [Qemu-devel] [PATCH v6 11/10] migration: add comment for TYPE_MIGRATE

2017-06-28 Thread Peter Xu
On Wed, Jun 28, 2017 at 12:37:04PM -0300, Eduardo Habkost wrote: > On Wed, Jun 28, 2017 at 03:15:44PM +0800, Peter Xu wrote: > > It'll be strange that the migration object inherits TYPE_DEVICE. Add > > some explanations to it. > > > > Signed-off-by: Peter Xu > > --- > >

Re: [Qemu-devel] [PATCH v6 4/4] net/socket: Improve -net socket error reporting

2017-06-28 Thread Mao Zhongyi
Hi, Daniel On 06/28/2017 09:27 PM, Daniel P. Berrange wrote: On Wed, Jun 28, 2017 at 09:08:50PM +0800, Mao Zhongyi wrote: When -net socket fails, it first reports a specific error, then a generic one, like this: $ qemu-system-x86_64 -net socket, qemu-system-x86_64: -net socket:

Re: [Qemu-devel] [PATCH v6 3/4] net/net: Convert parse_host_port() to Error

2017-06-28 Thread Mao Zhongyi
Hi, Daniel On 06/28/2017 09:23 PM, Daniel P. Berrange wrote: On Wed, Jun 28, 2017 at 09:08:49PM +0800, Mao Zhongyi wrote: diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 5c326db..78e2b30 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h if

Re: [Qemu-devel] [PATCH v6 09/10] migration: merge enforce_config_section somewhat

2017-06-28 Thread Peter Xu
On Thu, Jun 29, 2017 at 12:42:56AM +0200, Juan Quintela wrote: > Eduardo Habkost wrote: > > > > > So, this is a case where a user-provided config option (-machine > > enforce-config-section) should trigger a different default in another > > class

Re: [Qemu-devel] [PATCH v6 06/10] migration: move only_migratable to MigrationState

2017-06-28 Thread Peter Xu
On Wed, Jun 28, 2017 at 04:13:57PM -0300, Eduardo Habkost wrote: > On Tue, Jun 27, 2017 at 12:10:15PM +0800, Peter Xu wrote: > > One less global variable, and it does only matter with migration. > > > > We keep the old "--only-migratable" option, but also now we support: > > > > -global

Re: [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring.

2017-06-28 Thread sochin.jiang
Oh,I got it, thanks. Sochin On 2017/6/29 6:33, Max Reitz wrote: > On 2017-06-26 13:04, sochin.jiang wrote: >> From: "sochin.jiang" >> >> mirror_complete opens the backings, BDSs of the new open backings should >> have a >> same AioContext with the top when using

[Qemu-devel] [RFC PATCH 8/8] travis: remove tcg/tci job

2017-06-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27a2d9cfb3..d10ee5ed79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,9 +74,6 @@ matrix: - env: CONFIG="--enable-gprof

[Qemu-devel] [PATCH 4/8] MAINTAINERS: update TCI entry

2017-06-28 Thread Philippe Mathieu-Daudé
moved in 244f1441 to tcg/ Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 530293044b..9bad523060 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1654,7 +1654,7 @@ TCI target

[Qemu-devel] [RFC PATCH 7/8] tcg/tci: time to remove it :(

2017-06-28 Thread Philippe Mathieu-Daudé
"./configure --disable-tcg-interpreter" generates a warning: ./configure: --disable-tcg-interpreter is obsolete, Experimental TCG interpreter has been removed" "./configure --enable-tcg-interpreter" generates an error: Experimental TCG interpreter has been removed Signed-off-by: Philippe

[Qemu-devel] [PATCH 3/8] MAINTAINERS: update Xen entry

2017-06-28 Thread Philippe Mathieu-Daudé
moved in 56e2cd24..28b99f47 to accel/ Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 86a08c5aac..530293044b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -323,7 +323,6 @@ M: Stefano

[Qemu-devel] [PATCH RESEND 5/8] tcg/tci: enable bswap16_i64

2017-06-28 Thread Philippe Mathieu-Daudé
remove some copy/paste leftover, code seems sane. while running Alex Bennée's image aarch64-linux-3.15rc2-buildroot.img: Trace 0x7fa1904b0890 [0: ffc00036cd04] IN: 0xffc00036cd24: 5ac00694 rev16 w20, w20 OP: ffc00036cd24

[Qemu-devel] [PATCH 6/8] tcg/tci: disable MTTCG if TCI is enabled

2017-06-28 Thread Philippe Mathieu-Daudé
TCI + MTTCG cause strange errors... $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img qemu-system-arm: Guest expects a stronger memory ordering than the host provides This may cause strange/hard to debug errors Segmentation

[Qemu-devel] [PATCH 2/8] MAINTAINERS: update KVM entries

2017-06-28 Thread Philippe Mathieu-Daudé
moved in 92229a57 to accel/ Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 06006fc7df..86a08c5aac 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -273,8 +273,8 @@ Overall

[Qemu-devel] [RFC PATCH 0/8] removal of tci (tcg interpreter)

2017-06-28 Thread Philippe Mathieu-Daudé
There have been some comments on the ML about the usefulness of tci. https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04551.html Peter Maydell> I'd prefer we just got rid of it. https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04296.html Richard Henderson> Is it time

[Qemu-devel] [PATCH 1/8] MAINTAINERS: update TCG entries

2017-06-28 Thread Philippe Mathieu-Daudé
moved in a9ded601..244f1441 to accel/ Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 839f7ca063..06006fc7df 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -84,14

[Qemu-devel] [RFC PATCH 4/5] qemu: hotplug: unbind VFIO devices as a group

2017-06-28 Thread Michael Roth
Currently we bind a managed hostdev back to the host driver (or "unbind" from the perspective of the stub driver) immediately upon receiving a DEVICE_DELETED event from QEMU. In cases where we have more one device from the group attached to a guest, this runs the risk of putting the group in a

[Qemu-devel] [RFC PATCH 2/5] qemu_hotplug: squash qemuDomainRemovePCIHostDevice into caller

2017-06-28 Thread Michael Roth
It's only called from one place, and only takes the extra step of freeing the device alias after reattach. Since another path through qemuDomainRemoveHostDevice introduced in a subsequent patch will also need to free the device alias, it'll be more readable to just start calling it directly.

[Qemu-devel] [RFC PATCH 1/5] virhostdev: factor release out from reattach and export it for use later

2017-06-28 Thread Michael Roth
Signed-off-by: Michael Roth --- src/libvirt_private.syms | 1 + src/util/virhostdev.c| 83 src/util/virhostdev.h| 8 + 3 files changed, 78 insertions(+), 14 deletions(-) diff --git

[Qemu-devel] [RFC PATCH 5/5] qemu: hotplug: wait for VFIO group FD close before unbind

2017-06-28 Thread Michael Roth
QEMU emits DEVICE_DELETED events during a device's "unparent" callback, but some additional cleanup occurs afterward via "finalize". In most cases libvirt can ignore the latter, but in the case of VFIO the closing of a device's group FD happens here, which is something libvirt needs to wait for

[Qemu-devel] [RFC PATCH 3/5] virpci: introduce virPCIIOMMUGroupIterate()

2017-06-28 Thread Michael Roth
This serves a similar purpose to virPCIDeviceAddressIOMMUGroupIterate, but uses the iommu group number to find matches instead of a device within the group. We refactor the code to use this new function and also export it for use in subsequent patches. Signed-off-by: Michael Roth

[Qemu-devel] [RFC PATCH 0/5] hotplug: fix premature rebinding of VFIO devices to host

2017-06-28 Thread Michael Roth
Hi everyone. Hoping to get some feedback on this approach, or some alternatives proposed below, to the following issue: Currently libvirt immediately attempts to rebind a managed device back to the host driver when it receives a DEVICE_DELETED event from QEMU. This is problematic for 2 reasons:

Re: [Qemu-devel] [Qemu-block] [PATCH v3 1/3] block: add bdrv_get_format_alloc_stat format interface

2017-06-28 Thread John Snow
On 06/28/2017 11:59 AM, Vladimir Sementsov-Ogievskiy wrote: > 27.06.2017 02:19, John Snow wrote: >> >> On 06/06/2017 12:26 PM, Vladimir Sementsov-Ogievskiy wrote: >>> The function should collect statistics, about used/unused by top-level >>> format driver space (in its .file) and allocation

Re: [Qemu-devel] [RFC 5/5] vifo: introduce new VFIO ioctl VFIO_DEVICE_PCI_GET_DIRTY_BITMAP

2017-06-28 Thread Tian, Kevin
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, June 29, 2017 12:00 AM > > On Wed, 28 Jun 2017 06:04:10 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > > Sent: Wednesday, June 28, 2017 3:45 AM

Re: [Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-28 Thread Max Reitz
On 2017-06-28 17:31, Pavel Butsykin wrote: > On 28.06.2017 16:59, Max Reitz wrote: >> On 2017-06-27 17:06, Pavel Butsykin wrote: >>> On 26.06.2017 20:47, Max Reitz wrote: On 2017-06-26 17:23, Pavel Butsykin wrote: >>> [] > > Is there any guarantee that in the future this will not

[Qemu-devel] [PATCH] iotests: Add test for dataplane mirroring

2017-06-28 Thread Max Reitz
Signed-off-by: Max Reitz --- Depends on Stefan's "virtio: use ioeventfd in TCG and qtest mode" series to work at all, and on "mirror: Fix inconsistent backing AioContext for after mirroring" (in my block branch) so it does not fail. --- tests/qemu-iotests/106 | 97

Re: [Qemu-devel] [PATCH v9 0/7] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches

2017-06-28 Thread Emilio G. Cota
On Wed, Jun 28, 2017 at 14:21:29 +0300, Lluís Vilanova wrote: > Emilio G Cota writes: > > I wanted to save you some time and sent a v9 yesterday with these > > same changes -- although I see some changes in my v8 didn't make it > > to your v9. For this iteration I only added more perf numbers to

Re: [Qemu-devel] [PATCH v5 5/5] 9pfs: handle transport errors in pdu_complete()

2017-06-28 Thread Stefano Stabellini
On Wed, 28 Jun 2017, Greg Kurz wrote: > Contrary to what is written in the comment, a buggy guest can misconfigure > the transport buffers and pdu_marshal() may return an error. If this ever > happens, it is up to the transport layer to handle the situation (9P is > transport agnostic). > > This

Re: [Qemu-devel] [PATCH v6 09/10] migration: merge enforce_config_section somewhat

2017-06-28 Thread Juan Quintela
Eduardo Habkost wrote: > > So, this is a case where a user-provided config option (-machine > enforce-config-section) should trigger a different default in another > class (migration.send-configuration). > > Also, the new default triggered by -machine has a very specific >

Re: [Qemu-devel] [PATCH v5 2/5] virtio-9p: message header is 7-byte long

2017-06-28 Thread Stefano Stabellini
On Wed, 28 Jun 2017, Greg Kurz wrote: > The 9p spec at http://man.cat-v.org/plan_9/5/intro reads: > > "Each 9P message begins with a four-byte size field specify- > ing the length in bytes of the complete message including > the four bytes of the size field itself. The next byte is > the

Re: [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring.

2017-06-28 Thread Max Reitz
On 2017-06-26 13:04, sochin.jiang wrote: > From: "sochin.jiang" > > mirror_complete opens the backings, BDSs of the new open backings should > have a > same AioContext with the top when using iothreads, fix the code to guarantee > this, > also avoiding unexpected

Re: [Qemu-devel] TPM status

2017-06-28 Thread Laszlo Ersek
On 06/28/17 22:57, Stefan Berger wrote: > On 06/28/2017 12:44 PM, Laszlo Ersek wrote: >> On 06/28/17 17:22, Peter Jones wrote: >>> On Tue, Jun 27, 2017 at 12:12:50PM -0400, Stefan Berger wrote: On 06/14/2017 09:51 AM, Laszlo Ersek wrote: > Hi Stefan, > > the MAINTAINERS file

Re: [Qemu-devel] [PATCH] vhost: Fix use-after-free in vhost_log_put()

2017-06-28 Thread Marc-André Lureau
Hi On Fri, Jun 23, 2017 at 6:28 AM Jia-Shiun Li wrote: > In commit 9e0bc24f dev->log_size was reset to zero too early before > syncing vhost log. It causes syncing to be skipped. > > ooch, I guess I didn't realize it was also accessing dev->log_size when taking dev->log in

Re: [Qemu-devel] TPM status

2017-06-28 Thread Stefan Berger
On 06/28/2017 12:44 PM, Laszlo Ersek wrote: On 06/28/17 17:22, Peter Jones wrote: On Tue, Jun 27, 2017 at 12:12:50PM -0400, Stefan Berger wrote: On 06/14/2017 09:51 AM, Laszlo Ersek wrote: Hi Stefan, the MAINTAINERS file doesn't seem to cover any of the TPM-related files in the tree:

Re: [Qemu-devel] [PATCH v5 6/6] target-m68k, linux-user: manage FP registers in ucontext

2017-06-28 Thread Laurent Vivier
Riku, could you ACK this patch, so I will add it in my next pull request for m68k? Thanks, Laurent Le 20/06/2017 à 22:51, Laurent Vivier a écrit : > Signed-off-by: Laurent Vivier > --- > linux-user/signal.c | 41 + > 1 file changed,

[Qemu-devel] [PATCH v5 5/5] 9pfs: handle transport errors in pdu_complete()

2017-06-28 Thread Greg Kurz
Contrary to what is written in the comment, a buggy guest can misconfigure the transport buffers and pdu_marshal() may return an error. If this ever happens, it is up to the transport layer to handle the situation (9P is transport agnostic). This fixes Coverity issue CID1348518. Signed-off-by:

[Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type

2017-06-28 Thread Khem Raj
The ucontext_t type had a tag struct ucontext until now but newer glibc will drop it so we need to adjust and use the exposed type instead Signed-off-by: Khem Raj Cc: Kamil Rytarowski Cc: Riku Voipio Cc: Laurent Vivier

[Qemu-devel] [PATCH v5 3/5] virtio-9p: break device if buffers are misconfigured

2017-06-28 Thread Greg Kurz
The 9P protocol is transport agnostic: if the guest misconfigured the buffers, the best we can do is to set the broken flag on the device. Since virtio_pdu_vmarshal() may be called by several active PDUs, we check if the transport isn't broken already to avoid printing extra error messages.

[Qemu-devel] [PATCH v5 1/5] virtio-9p: record element after sanity checks

2017-06-28 Thread Greg Kurz
If the guest sends a malformed request, we end up with a dangling pointer in V9fsVirtioState. This doesn't seem to cause any bug, but let's remove this side effect anyway. Signed-off-by: Greg Kurz Reviewed-by: Michael S. Tsirkin --- hw/9pfs/virtio-9p-device.c |

[Qemu-devel] [PATCH v5 2/5] virtio-9p: message header is 7-byte long

2017-06-28 Thread Greg Kurz
The 9p spec at http://man.cat-v.org/plan_9/5/intro reads: "Each 9P message begins with a four-byte size field specify- ing the length in bytes of the complete message including the four bytes of the size field itself. The next byte is the message type, one of the constants in the

[Qemu-devel] [PATCH v4 7/7] target/m68k: add fmovem

2017-06-28 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/fpu_helper.c | 120 +++ target/m68k/helper.h | 6 +++ target/m68k/translate.c | 93 3 files

[Qemu-devel] [PATCH v5 0/5] 9pfs: handle transport errors

2017-06-28 Thread Greg Kurz
The 9p protocol relies on a reliable transport, but the current code treats transport errors (ie, failure to marshal or unmarshal) as if they were coming from the backend. This doesn't make sense: if the transport failed, we should notify the guest that the transport is broken and needs to be

[Qemu-devel] [PATCH v4 4/7] softfloat: define floatx80_round()

2017-06-28 Thread Laurent Vivier
Add a function to round a floatx80 to the defined precision (floatx80_rounding_precision) Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Aurelien Jarno --- fpu/softfloat.c | 16

[Qemu-devel] [PATCH v5 4/5] xen-9pfs: disconnect if buffers are misconfigured

2017-06-28 Thread Greg Kurz
From: Stefano Stabellini Implement xen_9pfs_disconnect by unbinding the event channels. On xen_9pfs_free, call disconnect if any event channels haven't been disconnected. If the frontend misconfigured the buffers set the backend to "Closing" and disconnect it.

[Qemu-devel] [PATCH v4 6/7] target/m68k: add explicit single and double precision operations (part 2)

2017-06-28 Thread Laurent Vivier
Add fsabs, fdabs, fsneg, fdneg, fsmove and fdmove. The value is converted using the new floatx80_round() function. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/fpu_helper.c | 48

[Qemu-devel] [PATCH v4 1/7] target/m68k: add fscc.

2017-06-28 Thread Laurent Vivier
use DisasCompare with FPU conditions in fscc and fbcc. Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 210 ++-- 1 file changed, 131 insertions(+), 79 deletions(-) diff --git a/target/m68k/translate.c

[Qemu-devel] [PATCH v4 3/7] target/m68k: add explicit single and double precision operations

2017-06-28 Thread Laurent Vivier
Add fssqrt, fdsqrt, fsadd, fdadd, fssub, fdsub, fsmul, fdmul, fsdiv, fddiv. The precision is managed using set_floatx80_rounding_precision(). Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/fpu_helper.c | 80

[Qemu-devel] [PATCH v4 2/7] target/m68k: add fmovecr

2017-06-28 Thread Laurent Vivier
fmovecr moves a floating point constant from the FPU ROM to a floating point register. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/fpu_helper.c | 34

[Qemu-devel] [PATCH v4 5/7] target/m68k: add fsglmul and fsgldiv

2017-06-28 Thread Laurent Vivier
fsglmul and fsgldiv truncate data to single precision before computing results. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/fpu_helper.c | 28 target/m68k/helper.h | 2 ++

[Qemu-devel] [PATCH v4 0/7] target/m68k: implement 680x0 FPU (part 2)

2017-06-28 Thread Laurent Vivier
Second part of patches submitted in the v3. This series adds a subset of single precision and double precision instructions using set_floatx80_rounding_precision() to round the result. For some other instructions, we introduce a new function, floatx80_round(), to round them manually. It also

Re: [Qemu-devel] [Qemu-block] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-28 Thread Eric Blake
On 06/28/2017 03:15 PM, Alberto Garcia wrote: > On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: >> This patch documents (including their QMP invocations) all the four >> major kinds of live block operations: >> >> - `block-stream` >> - `block-commit` >> - `drive-mirror` (&

Re: [Qemu-devel] [Qemu-block] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-28 Thread Alberto Garcia
On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: > This patch documents (including their QMP invocations) all the four > major kinds of live block operations: > > - `block-stream` > - `block-commit` > - `drive-mirror` (& `blockdev-mirror`) > - `drive-backup` (&

Re: [Qemu-devel] [PATCH v3 1/7] target/m68k: add fscc.

2017-06-28 Thread Laurent Vivier
Le 27/06/2017 à 22:00, Richard Henderson a écrit : > On 06/27/2017 12:12 PM, Laurent Vivier wrote: >> case 3: /* Ordered Greater than or Equal Z || !(A || N) */ >> case 19: /* Greater than or Equal Z || !(A || N) */ >> +g_assert(FPSR_CC_A == (FPSR_CC_N >> 3)); >> +

Re: [Qemu-devel] [PATCH v4 3/4] virtio-9p: break device if buffers are misconfigured

2017-06-28 Thread Stefano Stabellini
On Wed, 28 Jun 2017, Greg Kurz wrote: > On Wed, 28 Jun 2017 11:54:28 -0700 (PDT) > Stefano Stabellini wrote: > [...] > > > > @@ -125,10 +127,19 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu, > > > > Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev,

Re: [Qemu-devel] [PATCH v4 3/4] virtio-9p: break device if buffers are misconfigured

2017-06-28 Thread Greg Kurz
On Wed, 28 Jun 2017 11:54:28 -0700 (PDT) Stefano Stabellini wrote: [...] > > > @@ -125,10 +127,19 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu, > > > Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state); > > > struct iovec in_sg[2]; > > >

[Qemu-devel] [PATCH] hw/ppc/spapr.c: do not adjust rma_size with KVM RADIX in ppc_spapr_init

2017-06-28 Thread Daniel Henrique Barboza
In ppc_spapr_init when setting rma_size we have the following verification: if (rma_alloc_size && (rma_alloc_size < node0_size)) { spapr->rma_size = rma_alloc_size; } else { spapr->rma_size = node0_size; /* With KVM, we don't actually know whether KVM supports an

Re: [Qemu-devel] [PATCH 0/6] virtio: use ioeventfd in TCG and qtest mode

2017-06-28 Thread Eric Blake
On 06/28/2017 01:47 PM, Stefan Hajnoczi wrote: > This patch series fixes qemu-iotests 068. Since commit > ea4f3cebc4e0224605ab9dd9724aa4e7768fe372 ("qemu-iotests: 068: test iothread > mode") the test case has attempted to use dataplane without -M accel=kvm. > Although QEMU is capable of running

[Qemu-devel] [PATCH] ui/cocoa.m: Fix compatibility issue with Mac OS 10.9 and under

2017-06-28 Thread Programmingkid
The [NSEvent modifierFlags] method returns an NSEventModifierFlags type value in Mac OS 10.10. It use to be of type NSUInteger. Replacing NSEventModifierFlags with NSUInteger allows for the cooca.m file to be compiled on older versions of Mac OS. This patch was been tested on Mac OS 10.6 and

Re: [Qemu-devel] [PATCH v6 06/10] migration: move only_migratable to MigrationState

2017-06-28 Thread Eduardo Habkost
On Tue, Jun 27, 2017 at 12:10:15PM +0800, Peter Xu wrote: > One less global variable, and it does only matter with migration. > > We keep the old "--only-migratable" option, but also now we support: > > -global migration.only-migratable=true > > Currently still keep the old interface. > >

[Qemu-devel] [RFC 28/29] postcopy: Allow shared memory

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Now that we have the mechanisms in here, allow shared memory in a postcopy. Signed-off-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 6 -- 1 file changed, 6 deletions(-) diff --git

[Qemu-devel] [RFC 29/29] vhost-user: Claim support for postcopy

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Tell QEMU we understand the protocol features needed for postcopy. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [RFC 24/29] vhost+postcopy: Lock around set_mem_table

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" **HACK - better solution needed ** We have the situation where: qemu bridge send set_mem_table map memory a) mark area with UFD

[Qemu-devel] [RFC 27/29] vhost+postcopy: Wire up POSTCOPY_END notify

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Wire up a call to VHOST_USER_POSTCOPY_END message to the vhost clients right before we ask the listener thread to shutdown. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/trace-events | 2 ++

[Qemu-devel] [RFC 23/29] vub+postcopy: madvises

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Clear the area and turn off THP. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [RFC 25/29] vhu: enable = false on get_vring_base

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When we receive a GET_VRING_BASE message set enable = false to stop any new received packets modifying the ring. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 1 + 1 file changed, 1

[Qemu-devel] [RFC 19/29] postcopy: wake shared

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Send a 'wake' request on a userfaultfd for a shared process. The address in the clients address space is specified together with the RAMBlock it was resolved to. Signed-off-by: Dr. David Alan Gilbert ---

[Qemu-devel] [RFC 22/29] vhost+postcopy: Call wakeups

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Cause the vhost-user client to be woken up whenever: a) We place a page in postcopy mode b) We get a fault and the page has already been received Signed-off-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c |

[Qemu-devel] [RFC 15/29] vhost+postcopy: Send address back to qemu

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We need a better way, but at the moment we need the address of the mappings sent back to qemu so it can interpret the messages on the userfaultfd it reads. Signed-off-by: Dr. David Alan Gilbert ---

[Qemu-devel] [RFC 21/29] vhost+postcopy: Add vhost waker

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Register a waker function in vhost-user code to be notified when pages arrive or requests to previously mapped pages get requested. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/trace-events | 3 +++

[Qemu-devel] [RFC 18/29] vhost+postcopy: Resolve client address

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Resolve fault addresses read off the clients UFD into RAMBlock and offset, and call back to the postcopy code to ask for the page. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/trace-events | 3 +++

[Qemu-devel] [RFC 14/29] vhost+postcopy: Register new regions with the ufd

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When new regions are sent to the client using SET_MEM_TABLE, register them with the userfaultfd. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 33 + 1

[Qemu-devel] [RFC 20/29] postcopy: postcopy_notify_shared_wake

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a hook to allow a client userfaultfd to be 'woken' when a page arrives, and a walker that calls that hook for relevant clients given a RAMBlock and offset. Signed-off-by: Dr. David Alan Gilbert ---

[Qemu-devel] [RFC 17/29] vhost+postcopy: Send requests to source for shared pages

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Send requests back to the source for shared page requests. Signed-off-by: Dr. David Alan Gilbert --- migration/migration.h| 2 ++ migration/postcopy-ram.c | 31 ---

[Qemu-devel] [RFC 12/29] vhost+postcopy: Register shared ufd with postcopy

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Register the UFD that comes in as the response to the 'advise' method with the postcopy code. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/vhost-user.c | 23 ++- migration/postcopy-ram.h | 2

[Qemu-devel] [RFC 16/29] vhost+postcopy: Stash RAMBlock and offset

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Stash the RAMBlock and offset for later use looking up addresses. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/trace-events | 1 + hw/virtio/vhost-user.c | 11 +++ 2 files changed, 12 insertions(+) diff

[Qemu-devel] [RFC 09/29] vhub: Support sending fds back to qemu

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow replies with fds (for postcopy) Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git

Re: [Qemu-devel] [PATCH v6 09/10] migration: merge enforce_config_section somewhat

2017-06-28 Thread Eduardo Habkost
On Tue, Jun 27, 2017 at 12:10:18PM +0800, Peter Xu wrote: > These two parameters: > > - MachineState::enforce_config_section > - MigrationState::send_configuration > > are playing similar role here. This patch merges the first one into > second, then we'll have a single place to reference

[Qemu-devel] [RFC 11/29] postcopy: Allow registering of fd handler

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow other userfaultfd's to be registered into the fault thread so that handlers for shared memory can get responses. Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c| 3 + migration/migration.h

[Qemu-devel] [RFC 13/29] vhost+postcopy: Transmit 'listen' to client

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Notify the vhost-user client on reception of the 'postcopy-listen' event from the source. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 16

[Qemu-devel] [RFC 05/29] postcopy: use UFFDIO_ZEROPAGE only when available

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Use the recently added migration flag to hold whether each RAMBlock has the UFFDIO_ZEROPAGE capability, use it when it's available. This allows the use of postcopy on tmpfs as well as hugepage backed files. Signed-off-by: Dr. David Alan

[Qemu-devel] [RFC 26/29] vhost: Add VHOST_USER_POSTCOPY_END message

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This message is sent just before the end of postcopy to get the client to stop using userfault since we wont respond to any more requests. It should close userfaultfd so that any other pages get mapped to the backing file automatically by the

[Qemu-devel] [RFC 10/29] vhub: Open userfaultfd

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Open a userfaultfd (on a postcopy_advise) and send it back in the reply to the qemu for it to monitor. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.c | 24 +---

[Qemu-devel] [RFC 08/29] vhost-user: Add 'VHOST_USER_POSTCOPY_ADVISE' message

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Wire up a notifier to send a VHOST_USER_POSTCOPY_ADVISE message on an incoming advise. Later patches will fill in the behaviour/contents of the message. Signed-off-by: Dr. David Alan Gilbert ---

[Qemu-devel] [RFC 03/29] qemu_ram_block_host_offset

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Utility to give the offset of a host pointer within a RAMBlock (assuming we already know it's in that RAMBlock) Signed-off-by: Dr. David Alan Gilbert --- exec.c| 6 ++ include/exec/cpu-common.h |

[Qemu-devel] [RFC 07/29] postcopy: Add vhost-user flag for postcopy and check it

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a vhost feature flag for postcopy support, and use the postcopy notifier to check it before allowing postcopy. Signed-off-by: Dr. David Alan Gilbert --- contrib/libvhost-user/libvhost-user.h | 1 +

[Qemu-devel] [RFC 06/29] postcopy: Add notifier chain

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a notifier chain for postcopy with a 'reason' flag and an opportunity for a notifier member to return an error. Call it when enabling postcopy. This will initially used to enable devices to declare they're unable to postcopy and later to

[Qemu-devel] [RFC 04/29] migration/ram: ramblock_recv_bitmap_test_byte_offset

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Utility for testing the map when you already know the offset in the RAMBlock. Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 5 + migration/ram.h | 1 + 2 files changed, 6 insertions(+) diff --git

[Qemu-devel] [RFC 02/29] migrate: Update ram_block_discard_range for shared

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The choice of call to discard a block is getting more complicated for other cases. We use fallocate PUNCH_HOLE in any file cases; it works for both hugepage and for tmpfs. We use the DONTNEED for non-hugepage cases either where they're

[Qemu-devel] [RFC 00/29] postcopy+vhost-user/shared ram

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is a RFC/WIP series that enables postcopy migration with shared memory to a vhost-user process. It's based off current-head + Juan's load_cleanup series, and Alexey's bitmap series (v4). It's very lightly tested and seems to work,

[Qemu-devel] [RFC 01/29] RAMBlock/migration: Add migration flags

2017-06-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a migration flags field to each RAMBlock so that the migration code can hold a set of private flags on the RAMBlock. Add accessors. Signed-off-by: Dr. David Alan Gilbert --- exec.c| 10 ++

[Qemu-devel] [PATCH] vfio/pci: Fixup v0 PCIe capabilities

2017-06-28 Thread Alex Williamson
Intel 82599 VFs report a PCIe capability version of 0, which is invalid. The earliest version of the PCIe spec used version 1. This causes Windows to fail startup on the device and it will be disabled with error code 10. Our choices are either to drop the PCIe cap on such devices, which has the

Re: [Qemu-devel] [PATCH v4 3/4] virtio-9p: break device if buffers are misconfigured

2017-06-28 Thread Stefano Stabellini
On Wed, 28 Jun 2017, Greg Kurz wrote: > On Tue, 27 Jun 2017 16:34:51 -0700 (PDT) > Stefano Stabellini wrote: > > > On Tue, 27 Jun 2017, Greg Kurz wrote: > > > On Mon, 26 Jun 2017 16:22:23 -0700 (PDT) > > > Stefano Stabellini wrote: > > > > > >

[Qemu-devel] [PATCH 5/6] tests: fix virtio-net-test ISR dependence

2017-06-28 Thread Stefan Hajnoczi
Use the new used ring APIs instead of assuming ISR being set means the request has completed. Signed-off-by: Stefan Hajnoczi --- tests/virtio-net-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/virtio-net-test.c

[Qemu-devel] [PATCH 3/6] tests: fix virtio-scsi-test ISR dependence

2017-06-28 Thread Stefan Hajnoczi
Use the new used ring APIs instead of assuming ISR being set means the request has completed. Signed-off-by: Stefan Hajnoczi --- tests/virtio-scsi-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c

[Qemu-devel] [PATCH 6/6] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-28 Thread Stefan Hajnoczi
Old kvm.ko versions only supported a tiny number of ioeventfds so virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. Do not check kvm_has_many_ioeventfds() when KVM is disabled since it always returns 0. Since commit 8c56c1a592b5092d91da8d8943c1d6462a6f ("memory: emulate

  1   2   3   4   >