Re: [Qemu-devel] [PATCH v4 2/2] QOM: object_property_add() performance improvement

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 08:45, Pavel Fedin wrote: > I can try to reengineer this and see what happens. If it works fine, will > such rework be accepted? [*] expansion would still be slow, but we could > deprecate it. > > I have just done a search of "[*]" across all *.c files, and here is what i > ca

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Cornelia Huck
On Mon, 27 Jul 2015 17:33:37 +0100 Stefan Hajnoczi wrote: > See Patch 2 for details on the deadlock after two aio_context_acquire() calls > race. This caused dataplane to hang on startup. > > Patch 1 is a memory leak fix for AioContext that's needed by Patch 2. > > Stefan Hajnoczi (2): > Aio

[Qemu-devel] [PATCH] memory: Add function pointers checks to memory_region_read/write()

2015-07-28 Thread Salva Peiró
The memory.c file directly calls the function pointers provided in the MemoryRegionOps to handle read and write operations for memory regions. The function pointers are called without checking if the function pointers are initialised, therefore, leading to QEMU SIGSEGV when the operations are not i

[Qemu-devel] memory: Add function pointers checks to memory_region_read/write()

2015-07-28 Thread Salva Peiró
The situation where QEMU crashes while attempting to call to a NULL function pointer from a non-initialised field in the MemoryRegionOps struct happens for the majority of emulated devices: One approach for solving this is to correct it for each device. The other approach is to correct the memory

Re: [Qemu-devel] [PATCH v2 33/45] ivshmem-server: fix hugetlbfs support

2015-07-28 Thread Andrew Jones
On Tue, Jul 28, 2015 at 02:32:45AM +0200, Marc-André Lureau wrote: > From: Marc-André Lureau > > As pointed out on the ML by Andrew Jones, glibc no longer permits > creating POSIX shm on hugetlbfs directly. When given a hugetlbfs path, > create a shareable file there. > > Signed-off-by: Marc-And

Re: [Qemu-devel] [PATCH RFC v2 29/47] qapi: Replace dirty is_c_ptr() by method c_null()

2015-07-28 Thread Markus Armbruster
Eric Blake writes: > On 07/01/2015 02:22 PM, Markus Armbruster wrote: >> is_c_ptr() looks whether the end of the C text for the type looks like >> a pointer. Works, but is fragile. >> >> We now have a better tool: use QAPISchemaType method c_null(). The >> initializers for non-pointers become

Re: [Qemu-devel] [PATCH v2 42/45] ivshmem: add hostmem backend

2015-07-28 Thread Andrew Jones
On Tue, Jul 28, 2015 at 02:32:54AM +0200, Marc-André Lureau wrote: > From: Marc-André Lureau > > Instead of handling allocation, teach ivshmem to use a memory backend. > This allows to use hugetlbfs backed memory now. > > Signed-off-by: Marc-André Lureau > --- > hw/misc/ivshmem.c| 85 > ++

Re: [Qemu-devel] [PATCH v12 00/15] vfio-pci: pass the aer error to guest

2015-07-28 Thread Chen, Hanxiao
Hi, Alex > -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > To: Chen, Hanxiao > Cc: qemu-devel@nongnu.org; Chen, Fan > Subject: Re: [Qemu-devel] [PATCH v12 00/15] vfio-pci: pass the aer error to > guest > > On Thu, 2015-07-16 at 12:00 +0800, Chen Hanxiao w

Re: [Qemu-devel] [PATCH] qmp-shell: add documentation

2015-07-28 Thread Kashyap Chamarthy
On Wed, Jul 01, 2015 at 02:25:49PM -0400, John Snow wrote: > I should probably document the changes that were made. > > Signed-off-by: John Snow > --- > scripts/qmp/qmp-shell | 35 +++ > 1 file changed, 35 insertions(+) Since I did some tests[1] when you wrote th

[Qemu-devel] Debian 7.8.0 SPARC64 on qemu - anything i can do to speedup the emulation?

2015-07-28 Thread Dennis Luehring
(i've posted the question already on qemu-disc...@nongnu.org but was toled to better use this mailing list) i've prepared an Debian 7.8.0 image for SPARC64/qemu emulation for C/C++ development before-real-hardware big-endian/unaligned tests i've benchmarked compiling of single pugixml.cpp (htt

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Cornelia Huck
On Tue, 28 Jul 2015 09:07:00 +0200 Cornelia Huck wrote: > On Mon, 27 Jul 2015 17:33:37 +0100 > Stefan Hajnoczi wrote: > > > See Patch 2 for details on the deadlock after two aio_context_acquire() > > calls > > race. This caused dataplane to hang on startup. > > > > Patch 1 is a memory leak f

[Qemu-devel] [PULL 4/4] memory: do not add a reference to the owner of aliased regions

2015-07-28 Thread Paolo Bonzini
Very often the owner of the aliased region is the same as the owner of the alias region itself. When this happens, the reference count can never go back to 0 and the owner is leaked. This is for example breaking hot-unplug of virtio-pci devices (the device cannot be plugged back again with the s

[Qemu-devel] [PULL 3/4] megasas: Add write function to handle write access to PCI BAR 3

2015-07-28 Thread Paolo Bonzini
From: Salva Peiró This patch fixes a QEMU SEGFAULT when a write operation is performed on the memory region of the PCI BAR 3 (base address space). When a writeb(0xe000) is performed the .write function is invoked to handle the write access, however, since the .write is not initialised, the ca

[Qemu-devel] [PULL 0/4] Fixes for 2.4.0-rc3

2015-07-28 Thread Paolo Bonzini
The following changes since commit f793d97e454a56d17e404004867985622ca1a63b: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-24 13:07:10 +0100) are available in the git repository at: git://github.com/bonzini/qemu.git tags/for-upstream for you to fetc

[Qemu-devel] [PULL 2/4] crypto: extend unit tests to cover decryption too

2015-07-28 Thread Paolo Bonzini
From: "Daniel P. Berrange" The current unit test only verifies the encryption API, resulting in us missing a recently introduced bug in the decryption API from commit d3462e3. It was fortunately later discovered & fixed by commit bd09594, thanks to the QEMU I/O tests for qcow2 encryption, but we

[Qemu-devel] [PULL 1/4] crypto: fix built-in AES decrypt function

2015-07-28 Thread Paolo Bonzini
From: "Daniel P. Berrange" The qcrypto_cipher_decrypt_aes method was using the wrong key material, and passing the wrong mode. This caused it to incorrectly decrypt ciphertext. Signed-off-by: Daniel P. Berrange Message-Id: <1437740634-6261-1-git-send-email-berra...@redhat.com> Signed-off-by: Pa

Re: [Qemu-devel] [PATCH RFC 2/6] posix: add linux-only memfd fallback

2015-07-28 Thread Paolo Bonzini
On 23/07/2015 17:25, Michael S. Tsirkin wrote: > > +#ifdef CONFIG_LINUX > > + > > +#ifndef F_LINUX_SPECIFIC_BASE > > +#define F_LINUX_SPECIFIC_BASE 1024 > > +#endif > > + > > +#ifndef F_ADD_SEALS > > +#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) > > +#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE

Re: [Qemu-devel] [PATCH v2] exec: use macro ROUND_UP for alignment

2015-07-28 Thread Chen, Hanxiao
> -Original Message- > From: qemu-devel-bounces+chenhanxiao=cn.fujitsu@nongnu.org > [mailto:qemu-devel-bounces+chenhanxiao=cn.fujitsu@nongnu.org] On Behalf Of > Chen Hanxiao > Sent: Friday, July 24, 2015 11:12 AM > To: Paolo Bonzini > Cc: qemu-devel@nongnu.org > Subject: [Qemu-deve

Re: [Qemu-devel] [PATCH v2] exec: use macro ROUND_UP for alignment

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 10:11, Chen, Hanxiao wrote: > >> -Original Message- >> From: qemu-devel-bounces+chenhanxiao=cn.fujitsu@nongnu.org >> [mailto:qemu-devel-bounces+chenhanxiao=cn.fujitsu@nongnu.org] On Behalf >> Of >> Chen Hanxiao >> Sent: Friday, July 24, 2015 11:12 AM >> To: Paolo B

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 10:02:26AM +0200, Cornelia Huck wrote: > On Tue, 28 Jul 2015 09:07:00 +0200 > Cornelia Huck wrote: > > > On Mon, 27 Jul 2015 17:33:37 +0100 > > Stefan Hajnoczi wrote: > > > > > See Patch 2 for details on the deadlock after two aio_context_acquire() > > > calls > > > rac

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: serialize requests to overwrapping area

2015-07-28 Thread Liu Yuan
On Sat, Jul 18, 2015 at 01:44:24AM +0900, Hitoshi Mitake wrote: > Current sheepdog driver only serializes create requests in oid > unit. This mechanism isn't enough for handling requests to > overwrapping area spanning multiple oids, so it can result bugs like > below: > https://bugs.launchpad.net/

Re: [Qemu-devel] [PULL 18/19] macio: move unaligned DMA write code into separate pmac_dma_write() function

2015-07-28 Thread Mark Cave-Ayland
On 27/07/15 23:00, Aurelien Jarno wrote: > On 2015-05-22 15:59, John Snow wrote: >> From: Mark Cave-Ayland >> >> Similarly switch the macio IDE routines over to use the new function and >> tidy-up the remaining code as required. >> >> [Maintainer edit: printf format codes adjusted for 32/64bit. -

Re: [Qemu-devel] [PATCH] RFC/net: Add a net filter

2015-07-28 Thread Yang Hongyang
On 07/28/2015 12:00 PM, Yang Hongyang wrote: On 07/28/2015 11:28 AM, Jason Wang wrote: On 07/27/2015 06:03 PM, Yang Hongyang wrote: On 07/27/2015 05:16 PM, Jason Wang wrote: [...] I think this won't work for the buffer case? If we want the buffer case to work under this, we should modify the g

Re: [Qemu-devel] [PATCH v7 42/42] Inhibit ballooning during postcopy

2015-07-28 Thread Dr. David Alan Gilbert
* Amit Shah (amit.s...@redhat.com) wrote: > On (Tue) 16 Jun 2015 [11:26:55], Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Postcopy detects accesses to pages that haven't been transferred yet > > using userfaultfd, and it causes exceptions on pages that are 'not >

Re: [Qemu-devel] [PATCH] RFC/net: Add a net filter

2015-07-28 Thread Yang Hongyang
On 07/28/2015 12:00 PM, Yang Hongyang wrote: On 07/28/2015 11:28 AM, Jason Wang wrote: On 07/27/2015 06:03 PM, Yang Hongyang wrote: On 07/27/2015 05:16 PM, Jason Wang wrote: [...] I think this won't work for the buffer case? If we want the buffer case to work under this, we should modify the g

[Qemu-devel] [PATCH for-2.4 v2] xen: Drop net_rx_ok

2015-07-28 Thread Fam Zheng
Let net_rx_packet() (which checks the same conditions) drops the packet if the device is not ready. Drop net_xen_info.can_receive and update the return value for the buffer full case. We rely on the qemu_flush_queued_packets() in net_event() to wake up the peer when the buffer becomes available ag

Re: [Qemu-devel] [PATCH] RFC/net: Add a net filter

2015-07-28 Thread Jason Wang
On 07/28/2015 05:19 PM, Yang Hongyang wrote: > On 07/28/2015 12:00 PM, Yang Hongyang wrote: >> On 07/28/2015 11:28 AM, Jason Wang wrote: >>> On 07/27/2015 06:03 PM, Yang Hongyang wrote: On 07/27/2015 05:16 PM, Jason Wang wrote: [...] >> I think this won't work for the buffer cas

Re: [Qemu-devel] [PATCH for-2.4 v2] xen: Drop net_rx_ok

2015-07-28 Thread Wen Congyang
On 07/28/2015 05:25 PM, Fam Zheng wrote: > Let net_rx_packet() (which checks the same conditions) drops the packet > if the device is not ready. Drop net_xen_info.can_receive and update the > return value for the buffer full case. > > We rely on the qemu_flush_queued_packets() in net_event() to wa

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: serialize requests to overwrapping area

2015-07-28 Thread Liu Yuan
On Tue, Jul 28, 2015 at 04:50:08PM +0800, Liu Yuan wrote: > On Sat, Jul 18, 2015 at 01:44:24AM +0900, Hitoshi Mitake wrote: > > Current sheepdog driver only serializes create requests in oid > > unit. This mechanism isn't enough for handling requests to > > overwrapping area spanning multiple oids,

Re: [Qemu-devel] [PATCH] RFC/net: Add a net filter

2015-07-28 Thread Yang Hongyang
On 07/28/2015 05:30 PM, Jason Wang wrote: On 07/28/2015 05:19 PM, Yang Hongyang wrote: On 07/28/2015 12:00 PM, Yang Hongyang wrote: On 07/28/2015 11:28 AM, Jason Wang wrote: On 07/27/2015 06:03 PM, Yang Hongyang wrote: On 07/27/2015 05:16 PM, Jason Wang wrote: [...] I think this won't work f

Re: [Qemu-devel] [PATCH for-2.4 v2] xen: Drop net_rx_ok

2015-07-28 Thread Fam Zheng
On Tue, 07/28 17:32, Wen Congyang wrote: > On 07/28/2015 05:25 PM, Fam Zheng wrote: > > Let net_rx_packet() (which checks the same conditions) drops the packet > > if the device is not ready. Drop net_xen_info.can_receive and update the > > return value for the buffer full case. > > > > We rely on

[Qemu-devel] [PATCH for-2.4 v3] xen: Drop net_rx_ok

2015-07-28 Thread Fam Zheng
Let net_rx_packet() (which checks the same conditions) drops the packet if the device is not ready. Drop net_xen_info.can_receive and update the return value for the buffer full case. We rely on the qemu_flush_queued_packets() in net_event() to wake up the peer when the buffer becomes available ag

Re: [Qemu-devel] Debian 7.8.0 SPARC64 on qemu - anything i can do to speedup the emulation?

2015-07-28 Thread Artyom Tarasenko
On Tue, Jul 28, 2015 at 9:52 AM, Dennis Luehring wrote: > (i've posted the question already on qemu-disc...@nongnu.org but was toled > to better use this mailing list) > > i've prepared an Debian 7.8.0 image for SPARC64/qemu emulation for C/C++ > development before-real-hardware big-endian/unalign

[Qemu-devel] [PULL 02/10] virtio-serial: fix ANY_LAYOUT

2015-07-28 Thread Michael S. Tsirkin
Don't assume a specific layout for control messages. Required by virtio 1. Signed-off-by: Michael S. Tsirkin Reviewed-by: Amit Shah Reviewed-by: Jason Wang --- hw/char/virtio-serial-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/cha

[Qemu-devel] [PULL 04/10] virtio: set any_layout in virtio core

2015-07-28 Thread Michael S. Tsirkin
Exceptions: - virtio-blk - compat machine types Signed-off-by: Michael S. Tsirkin --- include/hw/compat.h| 22 +- include/hw/virtio/virtio.h | 4 +++- hw/block/virtio-blk.c | 1 + hw/net/virtio-net.c| 2 -- hw/scsi/virtio-scsi.c | 2 -- 5

[Qemu-devel] [PULL 00/10] virtio fixes for 2.4

2015-07-28 Thread Michael S. Tsirkin
The following changes since commit b69b30532e0a80e25449244c01b0cbed000c99a3: Update version for v2.4.0-rc2 release (2015-07-22 18:17:19 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream for you to fetch changes up to c147b515

[Qemu-devel] [PULL 07/10] virtio-blk: fail get_features when both scsi and 1.0 were set

2015-07-28 Thread Michael S. Tsirkin
From: Jason Wang SCSI passthrough was no longer supported in virtio 1.0, so this patch fail the get_features() when both 1.0 and scsi is set. And also only advertise VIRTIO_BLK_F_SCSI for legacy virtio-blk device. Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael

[Qemu-devel] [PULL 01/10] virtio: hide legacy features from modern guests

2015-07-28 Thread Michael S. Tsirkin
NOTIFY_ON_EMPTY, ANY_LAYOUT and BAD are only valid on the legacy interface. Hide them from modern guests. Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 4 hw/virtio/virtio-pci.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hw/virti

[Qemu-devel] [PULL 03/10] virtio-9p: fix any_layout

2015-07-28 Thread Michael S. Tsirkin
virtio pci allows any device to have a modern interface, this in turn requires ANY_LAYOUT support. Fix up ANY_LAYOUT for virtio-9p. Reported-by: Jason Wang Signed-off-by: Michael S. Tsirkin Reviewed-by: Jason Wang --- hw/9pfs/virtio-9p.c | 23 +-- 1 file changed, 17 inserti

[Qemu-devel] [PULL 06/10] virtio: get_features() can fail

2015-07-28 Thread Michael S. Tsirkin
From: Jason Wang Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Paolo Bonzini --- include/hw/virtio/virtio.h | 4 +++- hw/9pfs/virtio-9p-device.c | 3 ++- hw/block/virtio-blk.c | 3 ++- hw/char/virtio-serial-bus.c | 3 ++- hw/dis

[Qemu-devel] [PULL 05/10] virtio-pci: fix memory MR cleanup for modern

2015-07-28 Thread Michael S. Tsirkin
Each memory_region_add_subregion must be paired with memory_region_del_subregion. Signed-off-by: Michael S. Tsirkin Reviewed-by: Paolo Bonzini --- hw/virtio/virtio-pci.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index db

[Qemu-devel] [PULL 08/10] virtio-blk: only clear VIRTIO_F_ANY_LAYOUT for legacy device

2015-07-28 Thread Michael S. Tsirkin
From: Jason Wang Chapter 6.3 of spec said " Transitional devices MUST offer, and if offered by the device transitional drivers MUST accept the following: VIRTIO_F_ANY_LAYOUT (27) " So this patch only clear VIRTIO_F_LAYOUT for legacy device. Cc: Stefan Hajnoczi Cc: Kevin Wolf Cc: qemu-bl...@

Re: [Qemu-devel] [PATCH v2 for-2.5] rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

2015-07-28 Thread Wen Congyang
On 07/28/2015 05:59 PM, Paolo Bonzini wrote: > > > On 28/07/2015 04:26, Wen Congyang wrote: >> If rcu_(un)register_thread() is called together with synchronize_rcu(), >> it will wait for the synchronize_rcu() to finish. But when synchronize_rcu() >> waits for some events, we can modify the list r

[Qemu-devel] [PULL 09/10] acpi: fix pvpanic device is not shown in ui

2015-07-28 Thread Michael S. Tsirkin
From: Gal Hammer Commit 2332333c added a _STA method that hides the device. The fact that the device is not shown in the gui make it harder to install its Windows' device. https://bugzilla.redhat.com/show_bug.cgi?id=1238141 Signed-off-by: Gal Hammer Reviewed-by: Michael S. Tsirkin Signed-off-

Re: [Qemu-devel] [PATCH v2 for-2.5] rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 04:26, Wen Congyang wrote: > If rcu_(un)register_thread() is called together with synchronize_rcu(), > it will wait for the synchronize_rcu() to finish. But when synchronize_rcu() > waits for some events, we can modify the list registry. > We also use the lock rcu_gp_lock to assume

[Qemu-devel] [PULL 10/10] virtio: minor cleanup

2015-07-28 Thread Michael S. Tsirkin
There's no need for blk to set ANY_LAYOUT, it's done by virtio core as necessary. Signed-off-by: Michael S. Tsirkin --- hw/block/virtio-blk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 44f9b8e..1556c9c 100644 --- a/hw/block/virtio-blk.c

[Qemu-devel] [PULL 4/5] net/dp8393x: remove check of runt packets

2015-07-28 Thread Leon Alrae
From: Hervé Poussineau Ethernet requires that messages are at least 64 bytes on the wire. This limitation does not exist on emulation (no wire message), so remove the check. Netcard is now able to receive small network packets. Signed-off-by: Hervé Poussineau Reviewed-by: Aurelien Jarno Signed

[Qemu-devel] [PULL 5/5] net/dp8393x: do not use memory_region_init_rom_device with NULL

2015-07-28 Thread Leon Alrae
From: Hervé Poussineau Replace memory_region_init_rom_device() with memory_region_init_ram() and memory_region_set_readonly(). This fixes a guest-triggerable QEMU crash when guest tries to write to PROM. Signed-off-by: Hervé Poussineau [leon.al...@imgtec.com: shorten subject length] Signed-off-

[Qemu-devel] [PULL 1/5] target-mips: fix passing incompatible pointer type in machine.c

2015-07-28 Thread Leon Alrae
Reported-by: Peter Maydell Signed-off-by: Leon Alrae --- target-mips/machine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target-mips/machine.c b/target-mips/machine.c index 8fa755c..b15c43a 100644 --- a/target-mips/machine.c +++ b/target-mips/machine.c @@ -153,6 +153,

[Qemu-devel] [PULL 0/5] target-mips queue for 2.4

2015-07-28 Thread Leon Alrae
27;remotes/rth/tags/pull-tcg-20150727' into staging (2015-07-27 19:37:09 +0100) are available in the git repository at: git://github.com/lalrae/qemu.git tags/mips-20150728 for you to fetch changes up to 52579c681cb12bf64de793e85edc50d990f4d42f: net/dp8393x: do not use memory_region_

[Qemu-devel] [PULL 3/5] net/dp8393x: disable user creation

2015-07-28 Thread Leon Alrae
From: Hervé Poussineau Netcard needs an address space to write data to, which can't be specified on command line. This fixes a crash when user starts QEMU with "-device dp8393x" Signed-off-by: Hervé Poussineau Reviewed-by: Aurelien Jarno Signed-off-by: Leon Alrae --- hw/net/dp8393x.c | 2 ++

[Qemu-devel] [PULL 2/5] target-mips: fix offset calculation for Interrupts

2015-07-28 Thread Leon Alrae
From: Yongbok Kim Correct computation of vector offsets for EXCP_EXT_INTERRUPT. For instance, if Cause.IV is 0 the vector offset should be 0x180. Simplify the finding vector number logic for the Vectored Interrupts. Signed-off-by: Yongbok Kim Reviewed-by: Leon Alrae [leon.al...@imgtec.com: co

Re: [Qemu-devel] [PATCH RFC 4/6] vhost: alloc shareable log

2015-07-28 Thread Michael S. Tsirkin
On Tue, Jul 28, 2015 at 01:28:05PM +0800, Jason Wang wrote: > > > On 07/23/2015 09:36 AM, Marc-André Lureau wrote: > > If the backend is of type VHOST_BACKEND_TYPE_USER, allocate > > shareable memory. > > > > Note: vhost_log_get() can use a global "vhost_log" that can be shared by > > several vho

Re: [Qemu-devel] [PATCH v7 42/42] Inhibit ballooning during postcopy

2015-07-28 Thread Amit Shah
On (Tue) 28 Jul 2015 [10:08:15], Dr. David Alan Gilbert wrote: > * Amit Shah (amit.s...@redhat.com) wrote: > > On (Tue) 16 Jun 2015 [11:26:55], Dr. David Alan Gilbert (git) wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > Postcopy detects accesses to pages that haven't been transferred yet

Re: [Qemu-devel] [PATCH v2 for-2.5] rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 12:02, Wen Congyang wrote: > I have a question about rcu: while do we call wait_for_readers() > twice for 32-bit host? Because there is a very small but non-zero probability of the counter going up by exactly 2^31 periods (periods are stored in bits 1-31 so you lose one bit) while

Re: [Qemu-devel] [PATCH] raw-posix.c: Make GetBSDPath() handle caching options

2015-07-28 Thread Stefan Hajnoczi
On Mon, Jul 27, 2015 at 12:28:03PM -0400, Programmingkid wrote: > Add support for caching options that can be specified from > the command line. Please squash this into the commit message when merging: The CD-ROM raw char device bypasses the host page cache and therefore has alignment requiremen

Re: [Qemu-devel] [PATCH v5] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-07-28 Thread Stefan Hajnoczi
On Mon, Jul 27, 2015 at 01:05:15PM -0400, Programmingkid wrote: > Mac OS X can be picky when it comes to allowing the user to use physical > devices > in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is > detected, a message is displayed showing the user how to unmount a

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Cornelia Huck
On Tue, 28 Jul 2015 09:34:46 +0100 Stefan Hajnoczi wrote: > On Tue, Jul 28, 2015 at 10:02:26AM +0200, Cornelia Huck wrote: > > On Tue, 28 Jul 2015 09:07:00 +0200 > > Cornelia Huck wrote: > > > > > On Mon, 27 Jul 2015 17:33:37 +0100 > > > Stefan Hajnoczi wrote: > > > > > > > See Patch 2 for de

Re: [Qemu-devel] [PULL 0/2] Block layer patches for 2.4.0-rc3

2015-07-28 Thread Peter Maydell
On 27 July 2015 at 16:46, Kevin Wolf wrote: > The following changes since commit 122e7dab8ac549c8c5a9e1e13aa2464190e888de: > > Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into > staging (2015-07-27 14:53:42 +0100) > > are available in the git repository at: > > > git

Re: [Qemu-devel] [PATCH] hw/net: handle flow control in mcf_fec driver receiver

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 11:02:54AM +1000, Greg Ungerer wrote: > The network mcf_fec driver emulated receive side method is not dealing > with network queue flow control properly. > > Modify the receive side to check if we have enough space in the > descriptors to store the current packet. If not w

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 11:26 AM, Cornelia Huck wrote: > On Tue, 28 Jul 2015 09:34:46 +0100 > Stefan Hajnoczi wrote: > >> On Tue, Jul 28, 2015 at 10:02:26AM +0200, Cornelia Huck wrote: >> > On Tue, 28 Jul 2015 09:07:00 +0200 >> > Cornelia Huck wrote: >> > >> > > On Mon, 27 Jul 2015 17:33:37 +010

Re: [Qemu-devel] [PATCH v2 for-2.5] rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

2015-07-28 Thread Wen Congyang
On 07/28/2015 06:18 PM, Paolo Bonzini wrote: > > > On 28/07/2015 12:02, Wen Congyang wrote: >> I have a question about rcu: while do we call wait_for_readers() >> twice for 32-bit host? > > Because there is a very small but non-zero probability of the counter > going up by exactly 2^31 periods (

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 11:31 AM, Stefan Hajnoczi wrote: > On Tue, Jul 28, 2015 at 11:26 AM, Cornelia Huck > wrote: >> On Tue, 28 Jul 2015 09:34:46 +0100 >> Stefan Hajnoczi wrote: >> >>> On Tue, Jul 28, 2015 at 10:02:26AM +0200, Cornelia Huck wrote: >>> > On Tue, 28 Jul 2015 09:07:00 +0200 >>> >

Re: [Qemu-devel] [PATCH for-2.4 v3] xen: Drop net_rx_ok

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 05:52:56PM +0800, Fam Zheng wrote: > Let net_rx_packet() (which checks the same conditions) drops the packet > if the device is not ready. Drop net_xen_info.can_receive and update the > return value for the buffer full case. > > We rely on the qemu_flush_queued_packets() in

Re: [Qemu-devel] [PULL 00/10] virtio fixes for 2.4

2015-07-28 Thread Cornelia Huck
On Tue, 28 Jul 2015 12:57:29 +0300 "Michael S. Tsirkin" wrote: > > virtio fixes for 2.4 > > Mostly virtio 1 spec compliance fixes. > We are unlikely to make it perfectly compliant in > the first release, but it seems worth it to tr

Re: [Qemu-devel] [PATCH RFC 2/6] posix: add linux-only memfd fallback

2015-07-28 Thread Marc-André Lureau
Hi On Tue, Jul 28, 2015 at 10:11 AM, Paolo Bonzini wrote: >> >> What's defining all these macros? > > They're in asm/unistd.h. > > I think that, instead of making qemu/osdep.h the new qemu-common.h, the > wrappers added by patch 3 should be declared in a new header > qemu/memfd.h. The implementa

[Qemu-devel] [PATCH v2] gdbstub: Implement Xfer:auxv:read

2015-07-28 Thread Bhushan Attarde
Implementation of "Xfer:auxv:read" to provide auxiliary vector information to clients which relies on it. For example: AT_ENTRY in auxiliary vector provides the entry point information. Client can use this information to compare it with entry point mentioned in executable to calculate load offset

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Cornelia Huck
On Tue, 28 Jul 2015 11:34:18 +0100 Stefan Hajnoczi wrote: > On Tue, Jul 28, 2015 at 11:31 AM, Stefan Hajnoczi wrote: > > On Tue, Jul 28, 2015 at 11:26 AM, Cornelia Huck > > wrote: > >> On Tue, 28 Jul 2015 09:34:46 +0100 > >> Stefan Hajnoczi wrote: > >> > >>> On Tue, Jul 28, 2015 at 10:02:26AM

Re: [Qemu-devel] [PATCH v7 42/42] Inhibit ballooning during postcopy

2015-07-28 Thread Dr. David Alan Gilbert
* Amit Shah (amit.s...@redhat.com) wrote: > On (Tue) 28 Jul 2015 [10:08:15], Dr. David Alan Gilbert wrote: > > * Amit Shah (amit.s...@redhat.com) wrote: > > > On (Tue) 16 Jun 2015 [11:26:55], Dr. David Alan Gilbert (git) wrote: > > > > From: "Dr. David Alan Gilbert" > > > > > > > > Postcopy detec

Re: [Qemu-devel] [PATCH v2] gdbstub: Implement Xfer:auxv:read

2015-07-28 Thread Peter Maydell
On 28 July 2015 at 11:58, Bhushan Attarde wrote: > Implementation of "Xfer:auxv:read" to provide auxiliary vector information > to clients which relies on it. > > For example: AT_ENTRY in auxiliary vector provides the entry point > information. > Client can use this information to compare it with

Re: [Qemu-devel] [PATCH v2 6/7] error: Revamp interface documentation

2015-07-28 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > include/qapi/error.h | 177 > --- > 1 file changed, 127 insertions(+), 50 deletions(-) > > diff --git a/include/qapi/error.h b/inc

Re: [Qemu-devel] [PATCH v7 41/42] Disable mlock around incoming postcopy

2015-07-28 Thread Juan Quintela
Amit Shah wrote: > On (Tue) 14 Jul 2015 [17:22:13], Juan Quintela wrote: >> "Dr. David Alan Gilbert (git)" wrote: > >> > +if (enable_mlock) { >> > +if (os_mlock() < 0) { >> > +error_report("mlock: %s", strerror(errno)); >> > +/* >> > + * It doesn't

Re: [Qemu-devel] [PATCH v2 for-2.5] rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 12:33, Wen Congyang wrote: > On 07/28/2015 06:18 PM, Paolo Bonzini wrote: >> >> >> On 28/07/2015 12:02, Wen Congyang wrote: >>> I have a question about rcu: while do we call wait_for_readers() >>> twice for 32-bit host? >> >> Because there is a very small but non-zero probability of

Re: [Qemu-devel] [PATCH RFC 2/6] posix: add linux-only memfd fallback

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 12:58, Marc-André Lureau wrote: > Hi > > On Tue, Jul 28, 2015 at 10:11 AM, Paolo Bonzini wrote: >>> >>> What's defining all these macros? >> >> They're in asm/unistd.h. >> >> I think that, instead of making qemu/osdep.h the new qemu-common.h, the >> wrappers added by patch 3 shoul

[Qemu-devel] [PATCH v2 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Stefan Hajnoczi
v2: * Free BHs after thread_pool_free(), which calls qemu_bh_delete() [Cornelia] * Remove assert for leaked BHs since we don't know how many existing cases there are yet and QEMU 2.4-rc3 is a poor time to risk assertion failures See Patch 2 for details on the deadlock after two aio_context_ac

[Qemu-devel] [PATCH v2 2/2] AioContext: force event loop iteration using BH

2015-07-28 Thread Stefan Hajnoczi
The notify_me optimization introduced in commit eabc97797310 ("AioContext: fix broken ctx->dispatching optimization") skips event_notifier_set() calls when the event loop thread is not blocked in ppoll(2). This optimization causes a deadlock if two aio_context_acquire() calls race. notify_me = 0

[Qemu-devel] [PATCH v2 1/2] AioContext: avoid leaking deleted BHs on cleanup

2015-07-28 Thread Stefan Hajnoczi
BHs are freed during aio_bh_poll(). This leads to memory leaks if there is no aio_bh_poll() between qemu_bh_delete() and aio_ctx_finalize(). Suggested-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- async.c | 13 + 1 file changed, 13 insertions(+) diff --git a/async.c b/async

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 12:58, Cornelia Huck wrote: > > > Thanks. I understand how to reproduce it now: use -drive aio=threads > > > and do I/O during managedsave. > > > > > > I suspect there are more cases of this. We need to clean it up during > > > QEMU 2.5. > > > > > > For now let's continue leaking

Re: [Qemu-devel] [PULL for-2.4 00/10] Trivial patches for 2015-07-27

2015-07-28 Thread Peter Maydell
On 27 July 2015 at 20:54, Michael Tokarev wrote: > There are a few patches from the trivial queue which are, I think, > suitable for 2.4. These are fixing or adding docs/comments, are > minor/trivial cleanups, or small bugfixes. > > Please consider applying for 2.4. > > The rest of the trivial tr

[Qemu-devel] [PULL for-2.4 0/2] Net patches

2015-07-28 Thread Stefan Hajnoczi
The following changes since commit f8787f8723eaca1be99e3b1873e54de163fffa93: Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20150727' into staging (2015-07-27 19:37:09 +0100) are available in the git repository at: git://github.com/stefanha/qemu.git tags/net-pull-request for you t

[Qemu-devel] [PULL for-2.4 2/2] xen: Drop net_rx_ok

2015-07-28 Thread Stefan Hajnoczi
From: Fam Zheng Let net_rx_packet() (which checks the same conditions) drops the packet if the device is not ready. Drop net_xen_info.can_receive and update the return value for the buffer full case. We rely on the qemu_flush_queued_packets() in net_event() to wake up the peer when the buffer be

[Qemu-devel] [PULL for-2.4 1/2] hw/net: handle flow control in mcf_fec driver receiver

2015-07-28 Thread Stefan Hajnoczi
From: Greg Ungerer The network mcf_fec driver emulated receive side method is not dealing with network queue flow control properly. Modify the receive side to check if we have enough space in the descriptors to store the current packet. If not we process none of it and return 0. When the guest f

Re: [Qemu-devel] [PATCH for-2.4 v3] xen: Drop net_rx_ok

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 05:52:56PM +0800, Fam Zheng wrote: > Let net_rx_packet() (which checks the same conditions) drops the packet > if the device is not ready. Drop net_xen_info.can_receive and update the > return value for the buffer full case. > > We rely on the qemu_flush_queued_packets() in

[Qemu-devel] [PATCH for-2.4] block: delete bottom halves before the AioContext is freed

2015-07-28 Thread Paolo Bonzini
Other uses of aio_bh_new are safe as long as all scheduled bottom halves are run before an iothread is destroy, which bdrv_drain will ensure: - ctx->notify_dummy_bh: cleared by aio_ctx_finalize - archipelago_finish_aiocb: BH deletes itself - inject_error: BH deletes itself - blkverify_aio_bh: B

Re: [Qemu-devel] [PATCH v3] opts: produce valid command line in qemu_opts_print

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 7, 2015 at 3:42 PM, Kővágó, Zoltán wrote: > This will let us print options in a format that the user would actually > write it on the command line (foo=bar,baz=asd,etc=def), without > prepending a spurious comma at the beginning of the list, or quoting > values unnecessarily. This pat

Re: [Qemu-devel] [PATCH] qemu-nbd: remove unnecessary qemu_notify_event()

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 06:09, Fam Zheng wrote: > On Mon, 07/27 13:54, Paolo Bonzini wrote: >> This was needed when qemu-nbd was using qemu_set_fd_handler2. It is >> not needed anymore now that nbd_update_server_fd_handler is called >> whenever nbd_can_accept() can change from false to true. >> nbd_update

Re: [Qemu-devel] [PATCH for-2.4] block: delete bottom halves before the AioContext is freed

2015-07-28 Thread Cornelia Huck
On Tue, 28 Jul 2015 14:30:28 +0200 Paolo Bonzini wrote: > diff --git a/async.c b/async.c > index 9ca7095..efce14b 100644 > --- a/async.c > +++ b/async.c > @@ -233,6 +233,7 @@ aio_ctx_finalize(GSource *source) > AioContext *ctx = (AioContext *) source; > > qemu_bh_delete(ctx->notify

Re: [Qemu-devel] [PULL for-2.4 0/2] block patches for 2.4-rc3

2015-07-28 Thread Peter Maydell
On 28 July 2015 at 05:23, Jeff Cody wrote: > The following changes since commit f8787f8723eaca1be99e3b1873e54de163fffa93: > > Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20150727' into > staging (2015-07-27 19:37:09 +0100) > > are available in the git repository at: > > > g...@git

[Qemu-devel] Live migration hangs after migration to remote host

2015-07-28 Thread Eduardo Otubo
Hello all, I'm facing a weird behavior on my tests: I am able to live migrate between two virtual machines on my localhost, but not to another machine, both using tcp. * I am using the same arguments on the command line; * Both virtual machines uses the same qcow2 file visible through NFS; * Both

[Qemu-devel] [PATCH 5/5] hw/intc/arm_gic: Actually set the active bits for active interrupts

2015-07-28 Thread Peter Maydell
Although we were correctly handling interrupts becoming active and then inactive, we weren't actually exposing this to the guest by setting the 'active' flag for the interrupt, so reads of GICD_ICACTIVERn and GICD_ISACTIVERn would generally incorrectly return zeroes. Correct this oversight. Signed

[Qemu-devel] [PATCH 1/5] armv7m_nvic: Implement ICSR without using internal GIC state

2015-07-28 Thread Peter Maydell
Change the implementation of the Interrupt Control and State Register in the v7M NVIC to not use the running_irq and last_active internal state fields in the GIC. These fields don't correspond to state in a real GIC and will be removed soon. The changes to the ICSR are: * the VECTACTIVE field is d

[Qemu-devel] [PATCH 2/5] hw/intc/arm_gic: Running priority is group priority, not full priority

2015-07-28 Thread Peter Maydell
Priority values for the GIC are divided into a "group priority" and a "subpriority" (with the division being determined by the binary point register). The running priority is only determined by the group priority of the active interrupts, not the subpriority. In particular, this means that there ca

[Qemu-devel] [PATCH 0/5] arm_gic: Drop running_irq and last_active arrays

2015-07-28 Thread Peter Maydell
This patchset is a bit of cleanup to our GIC implementation that I've wanted to do for ages. Our current GIC code uses a couple of arrays (running_irq and last_active) to track currently active interrupts so that it can correctly determine the running priority as potentially nested interrupts are

[Qemu-devel] [PATCH 4/5] hw/intc/arm_gic: Drop running_irq and last_active arrays

2015-07-28 Thread Peter Maydell
The running_irq and last_active arrays represent state which doesn't exist in a real hardware GIC. The only thing we use them for is updating the running priority when an interrupt is completed, but in fact we can use the active-priority registers to do this. The running priority is always the prio

[Qemu-devel] [PATCH 3/5] hw/intc/arm_gic: Fix handling of GICC_APR, GICC_NSAPR registers

2015-07-28 Thread Peter Maydell
A GICv2 has both GICC_APR and GICC_NSAPR registers, with the latter holding the active priority bits for Group 1 interrupts (usually Nonsecure interrupts), and the Nonsecure view of the GICC_APR is the second half of the GICC_NSAPR registers. Turn our half-hearted implementation of APR into a prope

Re: [Qemu-devel] [PATCH v2 for-2.5] rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

2015-07-28 Thread Wen Congyang
At 2015/7/28 19:46, Paolo Bonzini Wrote: On 28/07/2015 12:33, Wen Congyang wrote: On 07/28/2015 06:18 PM, Paolo Bonzini wrote: On 28/07/2015 12:02, Wen Congyang wrote: I have a question about rcu: while do we call wait_for_readers() twice for 32-bit host? Because there is a very small bu

[Qemu-devel] [PATCH] migration: yet more possible state transitions

2015-07-28 Thread Juan Quintela
On destination, we move from INMIGRATE to FINISH_MIGRATE. Add that to the list of allowed states. Signed-off-by: Juan Quintela --- vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vl.c b/vl.c index 0adbbd6..45eb9ea 100644 --- a/vl.c +++ b/vl.c @@ -582,6 +582,7 @@ static const RunStateTr

Re: [Qemu-devel] [PATCH for-2.4 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 1:18 PM, Paolo Bonzini wrote: > I would prefer to fix them all in 2.4 and risk regressions, because the > bugs are use-after-frees, i.e. pretty bad. There may be existing use-after-free bugs but keep in mind there are other common cases: 1. Never touch the QEMUBH again. S

Re: [Qemu-devel] [PATCH for-2.4] block: delete bottom halves before the AioContext is freed

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 2:11 PM, Cornelia Huck wrote: > On Tue, 28 Jul 2015 14:30:28 +0200 > Paolo Bonzini wrote: > >> diff --git a/async.c b/async.c >> index 9ca7095..efce14b 100644 >> --- a/async.c >> +++ b/async.c >> @@ -233,6 +233,7 @@ aio_ctx_finalize(GSource *source) >> AioContext

Re: [Qemu-devel] [PATCH v2 0/2] AioContext: fix deadlock after aio_context_acquire() race

2015-07-28 Thread Stefan Hajnoczi
On Tue, Jul 28, 2015 at 1:12 PM, Stefan Hajnoczi wrote: > v2: > * Free BHs after thread_pool_free(), which calls qemu_bh_delete() [Cornelia] > * Remove assert for leaked BHs since we don't know how many existing cases >there are yet and QEMU 2.4-rc3 is a poor time to risk assertion failures

  1   2   3   >