Re: [Qemu-devel] [PATCH qemu v14 17/18] vfio/spapr: Use VFIO_SPAPR_TCE_v2_IOMMU

2016-03-21 Thread Alexey Kardashevskiy
On 03/22/2016 04:14 PM, David Gibson wrote: On Mon, Mar 21, 2016 at 06:47:05PM +1100, Alexey Kardashevskiy wrote: New VFIO_SPAPR_TCE_v2_IOMMU type supports dynamic DMA window management. This adds ability to VFIO common code to dynamically allocate/remove DMA windows in the host kernel when new

Re: [Qemu-devel] [PATCH v1] migration: skip sending ram pages released by virtio-balloon driver.

2016-03-21 Thread Jitendra Kolhe
On 3/18/2016 4:57 PM, Roman Kagan wrote: > [ Sorry I've lost this thread with email setup changes on my side; > catching up ] > > On Tue, Mar 15, 2016 at 06:50:45PM +0530, Jitendra Kolhe wrote: >> On 3/11/2016 8:09 PM, Jitendra Kolhe wrote: >>> Here is what >>> I tried, let’s say we have 3

Re: [Qemu-devel] [PATCH qemu v14 17/18] vfio/spapr: Use VFIO_SPAPR_TCE_v2_IOMMU

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:47:05PM +1100, Alexey Kardashevskiy wrote: > New VFIO_SPAPR_TCE_v2_IOMMU type supports dynamic DMA window management. > This adds ability to VFIO common code to dynamically allocate/remove > DMA windows in the host kernel when new VFIO container is added/removed. > >

Re: [Qemu-devel] [PATCH qemu v14 01/18] memory: Fix IOMMU replay base address

2016-03-21 Thread David Gibson
On Tue, Mar 22, 2016 at 03:28:52PM +1100, Alexey Kardashevskiy wrote: > On 03/22/2016 02:26 PM, David Gibson wrote: > >On Tue, Mar 22, 2016 at 02:12:30PM +1100, Alexey Kardashevskiy wrote: > >>On 03/22/2016 11:49 AM, David Gibson wrote: > >>>On Mon, Mar 21, 2016 at 06:46:49PM +1100, Alexey

Re: [Qemu-devel] [sheepdog] [PATCH v2] block/sheepdog: add error handling to sd_snapshot_delete()

2016-03-21 Thread Hitoshi Mitake
On Tue, Mar 22, 2016 at 1:33 PM, Takashi Menjo wrote: > Errors have been ignored or not propagated in some code paths > in sd_snapshot_delete(). This patch adds error handling. > > Cc: Hitoshi Mitake > Cc: Jeff Cody >

Re: [Qemu-devel] [PATCH qemu v14 16/18] spapr_iommu, vfio, memory: Notify IOMMU about starting/stopping being used by VFIO

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:47:04PM +1100, Alexey Kardashevskiy wrote: > The sPAPR TCE tables manage 2 copies when VFIO is using an IOMMU - > a guest view of the table and a hardware TCE table. If there is no VFIO > presense in the address space, then just the guest view is used, if > this is the

Re: [Qemu-devel] Query about BiteSizeTasks

2016-03-21 Thread haris iqbal
Hello, One more thing I noticed was that there is no function prototype for the function get_ticks_per_sec(). I was planning to use a script to change all the used of get_ticks_per_sec() to NANOSECONDS_PER_SECOND with an exception of the function definition itself in include/qemu/timer.h. SO

[Qemu-devel] [PATCH v2] block/sheepdog: add error handling to sd_snapshot_delete()

2016-03-21 Thread Takashi Menjo
Errors have been ignored or not propagated in some code paths in sd_snapshot_delete(). This patch adds error handling. Cc: Hitoshi Mitake Cc: Jeff Cody Cc: Vasiliy Tolstov Cc: sheep...@lists.wpkg.org Signed-off-by: Takashi

Re: [Qemu-devel] [PATCH qemu v14 01/18] memory: Fix IOMMU replay base address

2016-03-21 Thread Alexey Kardashevskiy
On 03/22/2016 02:26 PM, David Gibson wrote: On Tue, Mar 22, 2016 at 02:12:30PM +1100, Alexey Kardashevskiy wrote: On 03/22/2016 11:49 AM, David Gibson wrote: On Mon, Mar 21, 2016 at 06:46:49PM +1100, Alexey Kardashevskiy wrote: Since a788f227 "memory: Allow replay of IOMMU mapping

Re: [Qemu-devel] [PATCH v2 1/1] Introduce "xen-load-devices-state"

2016-03-21 Thread Changlong Xie
ping.. On 03/14/2016 04:03 PM, Changlong Xie wrote: From: Wen Congyang Introduce a "xen-load-devices-state" QAPI command that can be used to load the state of all devices, but not the RAM or the block devices of the VM. We only have hmp commands savevm/loadvm, and

Re: [Qemu-devel] [PATCH qemu v14 15/18] vfio: Add host side IOMMU capabilities

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:47:03PM +1100, Alexey Kardashevskiy wrote: > There are going to be multiple IOMMUs per a container. This moves > the single host IOMMU parameter set to a list of VFIOHostIOMMU. > > This should cause no behavioral change and will be used later by > the SPAPR TCE IOMMU v2

Re: [Qemu-devel] [PATCH qemu v14 13/18] vfio: spapr: Add SPAPR IOMMU v2 support (DMA memory preregistering)

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:47:01PM +1100, Alexey Kardashevskiy wrote: > This makes use of the new "memory registering" feature. The idea is > to provide the userspace ability to notify the host kernel about pages > which are going to be used for DMA. Having this information, the host > kernel can

Re: [Qemu-devel] [PATCH] block/sheepdog: add error handling to sd_snapshot_delete()

2016-03-21 Thread MENJO, Takashi
Thank you for your review, Jeff! I'll submit a patch v2 soon. In addition, I found that we also need to set errp below. This will be fixed in v2, too. | 2607switch (rsp->result) { | 2608case SD_RES_NO_VDI: | 2609error_report("%s was already deleted", s->name); Takashi >

Re: [Qemu-devel] [PATCH qemu v14 03/18] spapr_pci: Move DMA window enablement to a helper

2016-03-21 Thread David Gibson
On Tue, Mar 22, 2016 at 02:17:24PM +1100, Alexey Kardashevskiy wrote: > On 03/22/2016 12:02 PM, David Gibson wrote: > >On Mon, Mar 21, 2016 at 06:46:51PM +1100, Alexey Kardashevskiy wrote: > >>We are going to have multiple DMA windows soon so let's start preparing. > >> > >>This adds a new helper

Re: [Qemu-devel] [PATCH qemu v14 01/18] memory: Fix IOMMU replay base address

2016-03-21 Thread David Gibson
On Tue, Mar 22, 2016 at 02:12:30PM +1100, Alexey Kardashevskiy wrote: > On 03/22/2016 11:49 AM, David Gibson wrote: > >On Mon, Mar 21, 2016 at 06:46:49PM +1100, Alexey Kardashevskiy wrote: > >>Since a788f227 "memory: Allow replay of IOMMU mapping notifications" > >>when new VFIO listener is added,

Re: [Qemu-devel] [PATCH qemu v14 11/18] memory: Add reporting of supported page sizes

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:59PM +1100, Alexey Kardashevskiy wrote: > Every IOMMU has some granularity which MemoryRegionIOMMUOps::translate > uses when translating, however this information is not available outside > the translate context for various checks. > > This adds a get_page_sizes

Re: [Qemu-devel] [PATCH qemu v14 12/18] vfio: Check that IOMMU MR translates to system address space

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:47:00PM +1100, Alexey Kardashevskiy wrote: > At the moment IOMMU MR only translate to the system memory. > However if some new code changes this, we will need clear indication why > it is not working so here is the check. > > Signed-off-by: Alexey Kardashevskiy

Re: [Qemu-devel] [PATCH qemu v14 03/18] spapr_pci: Move DMA window enablement to a helper

2016-03-21 Thread Alexey Kardashevskiy
On 03/22/2016 12:02 PM, David Gibson wrote: On Mon, Mar 21, 2016 at 06:46:51PM +1100, Alexey Kardashevskiy wrote: We are going to have multiple DMA windows soon so let's start preparing. This adds a new helper to create a DMA window and makes use of it in sPAPRPHBState::realize().

Re: [Qemu-devel] [PATCH qemu v14 01/18] memory: Fix IOMMU replay base address

2016-03-21 Thread Alexey Kardashevskiy
On 03/22/2016 11:49 AM, David Gibson wrote: On Mon, Mar 21, 2016 at 06:46:49PM +1100, Alexey Kardashevskiy wrote: Since a788f227 "memory: Allow replay of IOMMU mapping notifications" when new VFIO listener is added, all existing IOMMU mappings are replayed. However there is a problem that the

Re: [Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Peter Xu
On Mon, Mar 21, 2016 at 06:00:50PM -0400, Bandan Das wrote: > > vfio_listener_region_add for a iommu mr results in > an overflow assert since emulated iommu memory region is initialized > with UINT64_MAX. Add a check just like memory_region_size() > does. Hi, Bandan, In case you missed this:

Re: [Qemu-devel] [PATCH qemu v14 06/18] spapr_iommu: Finish renaming vfio_accel to need_vfio

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:54PM +1100, Alexey Kardashevskiy wrote: > 6a81dd17 "spapr_iommu: Rename vfio_accel parameter" renamed vfio_accel > flag everywhere but one spot was missed. > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson

Re: [Qemu-devel] [PATCH qemu v14 07/18] spapr_iommu: Realloc table during migration

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:55PM +1100, Alexey Kardashevskiy wrote: > The source guest could have reallocated the default TCE table and > migrate bigger/smaller table. This adds reallocation in post_load() > if the default table size is different on source and destination. > > Signed-off-by:

Re: [Qemu-devel] [PATCH qemu v14 08/18] spapr_iommu: Migrate full state

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:56PM +1100, Alexey Kardashevskiy wrote: > This adds @bus_offset, @page_shift, @enabled members to migration stream. > These cannot change without dynamic DMA windows so no change in > behavior is expected. > > Signed-off-by: Alexey Kardashevskiy I

[Qemu-devel] [PATCH v2] qdict: fix unbounded stack warning for qdict_array_entries

2016-03-21 Thread Peter Xu
Here we use one g_strdup_printf() to replace the two stack allocated array, considering it's more convenient, safe, and as long as it's called rarely only when quorum device opens. This will remove the unbound stack warning when compiling with "-Wstack-usage=100". Reviewed-by: Eric Blake

Re: [Qemu-devel] [PATCH] qdict: fix unbounded stack for qdict_array_entries

2016-03-21 Thread Peter Xu
On Mon, Mar 21, 2016 at 02:58:25PM -0600, Eric Blake wrote: > On 03/09/2016 06:36 PM, Peter Xu wrote: > > Sorry to forgot CCing Eric/Markus/Kevin. > > > > This patch title is not correct, which should be: > > > > "Fix unbounded stack warning for qdict_array_entries" > > Keep the 'qdict:'

Re: [Qemu-devel] [PATCH v5 0/5] ARM: add query-gic-capabilities SMP command

2016-03-21 Thread Peter Xu
On Mon, Mar 21, 2016 at 04:56:07PM +0100, Andrea Bolognani wrote: > On Fri, 2016-03-18 at 11:27 +0800, Peter Xu wrote: > > v5 changes: > > - patch 2: moved to target-arm/monitor.c (from target-arm/machine.c) > >    [Peter] > > - patch 3: splitted into three patches: [all from Peter's

Re: [Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 21:54:48 -0400 Bandan Das wrote: > Alex Williamson writes: > > > On Mon, 21 Mar 2016 20:06:32 -0400 > > Bandan Das wrote: > > > >> Alex Williamson writes: > >> > >> > On Mon, 21

Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-21 Thread Peter Xu
On Mon, Mar 21, 2016 at 03:14:48PM -0600, Eric Blake wrote: > On 03/09/2016 06:46 PM, Peter Xu wrote: > > > > Is this a grammar btw? > > Yes, C has an ugly grammar, because [] is just syntactic sugar for > deferencing pointer addition with nicer operator precedence. Quoting > C99 6.5.2.1: > >

Re: [Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Bandan Das
Alex Williamson writes: > On Mon, 21 Mar 2016 20:06:32 -0400 > Bandan Das wrote: > >> Alex Williamson writes: >> >> > On Mon, 21 Mar 2016 18:00:50 -0400 >> > Bandan Das wrote: >> > >> >>

Re: [Qemu-devel] [PATCH qemu v14 05/18] spapr_iommu: Introduce "enabled" state for TCE table

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:53PM +1100, Alexey Kardashevskiy wrote: > Currently TCE tables are created once at start and their sizes never > change. We are going to change that by introducing a Dynamic DMA windows > support where DMA configuration may change during the guest execution. > > This

Re: [Qemu-devel] [PATCH qemu v14 03/18] spapr_pci: Move DMA window enablement to a helper

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:51PM +1100, Alexey Kardashevskiy wrote: > We are going to have multiple DMA windows soon so let's start preparing. > > This adds a new helper to create a DMA window and makes use of it in > sPAPRPHBState::realize(). > > Signed-off-by: Alexey Kardashevskiy

Re: [Qemu-devel] [PATCH qemu v14 01/18] memory: Fix IOMMU replay base address

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 06:46:49PM +1100, Alexey Kardashevskiy wrote: > Since a788f227 "memory: Allow replay of IOMMU mapping notifications" > when new VFIO listener is added, all existing IOMMU mappings are > replayed. However there is a problem that the base address of > an IOMMU memory region

Re: [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-21 Thread Fam Zheng
On Mon, 03/21 15:19, Cornelia Huck wrote: > On Mon, 21 Mar 2016 14:54:04 +0100 > Paolo Bonzini wrote: > > > On 21/03/2016 14:47, TU BO wrote: > > >> I'll see if I can produce something based on Conny's patches, which are > > >> already a start. Today I had a short day so I

Re: [Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 20:06:32 -0400 Bandan Das wrote: > Alex Williamson writes: > > > On Mon, 21 Mar 2016 18:00:50 -0400 > > Bandan Das wrote: > > > >> vfio_listener_region_add for a iommu mr results in > >> an overflow assert

Re: [Qemu-devel] [PATCH RFC 1/6] virtio-bus: common ioeventfd infrastructure

2016-03-21 Thread Fam Zheng
On Thu, 03/17 11:01, Cornelia Huck wrote: > Introduce a set of ioeventfd callbacks on the virtio-bus level > that can be implemented by the individual transports. At the > virtio-bus level, do common handling for host notifiers (which > is actually most of it). > > Two things of note: > - We

Re: [Qemu-devel] [RFC PATCH v2 0/9] Core based CPU hotplug for PowerPC sPAPR

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 11:43:34AM +0100, Igor Mammedov wrote: > On Mon, 21 Mar 2016 14:57:53 +1100 > David Gibson wrote: > > > On Fri, Mar 18, 2016 at 08:59:32AM +0530, Bharata B Rao wrote: > > > On Thu, Mar 17, 2016 at 09:03:43PM +1100, David Gibson wrote: > > >

Re: [Qemu-devel] [RFC PATCH 1/2] target-ppc: migrate interrupt vectors address for spapr VM

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 05:51:22PM +0100, Cédric Le Goater wrote: > On 03/21/2016 05:18 PM, Thomas Huth wrote: > > On 21.03.2016 15:02, Cédric Le Goater wrote: > >> This address is changed by the linux kernel using the H_SET_MODE hcall > >> and needs to be migrated in order to restart a spapr VM

Re: [Qemu-devel] [PATCH v2 0/3] hw/net/spapr_llan: Fix bad RX performance of the spapr-vlan device

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 05:25:21PM +0100, Thomas Huth wrote: > These patches fix the bad receive performance of the spapr-vlan device > by introducing proper receive buffer pools of different sizes. Details > can be found in the patch description of the second patch. Applied to ppc-for-2.6,

Re: [Qemu-devel] [RFC PATCH 2/2] target-ppc: fix interrupt vectors address migration

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 03:02:08PM +0100, Cédric Le Goater wrote: > commit 2360b6e84f78 ("target-ppc: force update of msr bits in > cpu_post_load") introduced a change to restore env->excp_prefix of a > guest which could have altered its MSR_EP. To do this, cpu_post_load() > invalidates msr and

Re: [Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Bandan Das
Alex Williamson writes: > On Mon, 21 Mar 2016 18:00:50 -0400 > Bandan Das wrote: > >> vfio_listener_region_add for a iommu mr results in >> an overflow assert since emulated iommu memory region is initialized >> with UINT64_MAX. Add a check just like

Re: [Qemu-devel] [PATCH v3 04/10] ppc: Create cpu_ppc_set_papr() helper

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 01:52:34PM +0100, Cédric Le Goater wrote: > From: Benjamin Herrenschmidt > > And move the code adjusting the MSR mask and calling kvmppc_set_papr() > to it. This allows us to add a few more things such as disabling setting > of MSR:HV and

Re: [Qemu-devel] [PATCH v3 00/10] ppc: preparing pnv landing

2016-03-21 Thread David Gibson
On Mon, Mar 21, 2016 at 01:52:30PM +0100, Cédric Le Goater wrote: > Hello, > > This is a first mini-serie of patches adding support for new ppc SPRs. > They were taken from Ben's larger patchset adding the ppc powernv > platform and they should already be useful for the pseries guest > migration.

Re: [Qemu-devel] [RFC v1 01/11] tcg: move tb_find_fast outside the tb_lock critical section

2016-03-21 Thread Emilio G. Cota
On Mon, Mar 21, 2016 at 22:08:06 +, Peter Maydell wrote: > It is not _necessary_, but it is a performance optimization to > speed up the "missed in the TLB" case. (A TLB flush will wipe > the tb_jmp_cache table.) From the thread where the move-to-front-of-list > behaviour was added in 2010,

Re: [Qemu-devel] [PATCH] slirp: Allow to disable IPv4 or IPv6

2016-03-21 Thread Samuel Thibault
Markus Armbruster, on Mon 21 Mar 2016 08:33:52 +0100, wrote: > Samuel Thibault writes: > > Make net=0.0.0.0 disable IPv4 and ip6-net=:: disable IPv6, so the user can > > setup IPv4-only and IPv6-only network environments. > > Do "net=" and "ip6-net=" mean anything

[Qemu-devel] How to determine Q-id in VHOST_USER_SET_LOG_BASE in a Multi-Q setup ?

2016-03-21 Thread shesha Sreenivasamurthy (shesha)
Hi All, I'm implementing VM migration support for open-VPP, an open source Vector Packet Processing (VPP) technology (https://wiki.fd.io/view/VPP) - A Linux foundation project. In lieu of it, I have hit an issue and I need some clarification. In Qemu's vhost-user implementation, each queue is

Re: [Qemu-devel] [PULL] slirp: Fix memory leak on small incoming ipv4 packet

2016-03-21 Thread Samuel Thibault
Hello, Peter Maydell, on Mon 21 Mar 2016 09:48:48 +, wrote: > Generally the > process for QEMU is that first patches are sent as normal [PATCH] mails, > for code review. Patches should only be put into pull requests once > they've been through the review process. (And then you can batch them

[Qemu-devel] [PATCH] slirp: send icmp6 errors when UDP send failed

2016-03-21 Thread Samuel Thibault
Signed-off-by: Samuel Thibault --- slirp/udp6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slirp/udp6.c b/slirp/udp6.c index 60a91c9..a23026f 100644 --- a/slirp/udp6.c +++ b/slirp/udp6.c @@ -113,8 +113,7 @@ void udp6_input(struct mbuf *m)

[Qemu-devel] [PATCH] slirp: Fix memory leak on small incoming ipv4 packet

2016-03-21 Thread Samuel Thibault
Signed-off-by: Samuel Thibault --- slirp/ip_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/ip_input.c b/slirp/ip_input.c index 12f173d..b464f6b 100644 --- a/slirp/ip_input.c +++ b/slirp/ip_input.c @@ -85,7 +85,7 @@ ip_input(struct

Re: [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-21 Thread Fam Zheng
On Mon, 03/21 14:02, Cornelia Huck wrote: > On Mon, 21 Mar 2016 20:45:27 +0800 > Fam Zheng wrote: > > > On Mon, 03/21 12:15, Cornelia Huck wrote: > > > On Mon, 21 Mar 2016 18:57:18 +0800 > > > Fam Zheng wrote: > > > > > > > diff --git a/hw/virtio/virtio.c

Re: [Qemu-devel] [PATCH v3 1/2] QMP: add query-hotpluggable-cpus

2016-03-21 Thread David Gibson
On Mon, 21 Mar 2016 11:53:23 +0100 Igor Mammedov wrote: > On Fri, 18 Mar 2016 16:26:28 -0300 > Eduardo Habkost wrote: > > > On Tue, Mar 15, 2016 at 02:24:07PM +0100, Igor Mammedov wrote: > > [...] > > > diff --git

Re: [Qemu-devel] [PATCH v3 03/10] qom: support arbitrary non-scalar properties with -object

2016-03-21 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > The current -object command line syntax only allows for > creation of objects with scalar properties, or a list > with a fixed scalar element type. Objects which have > properties that are represented as structs in the QAPI > schema cannot be

Re: [Qemu-devel] [PATCH v3 02/10] qapi: allow QmpInputVisitor to auto-cast types

2016-03-21 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > Currently the QmpInputVisitor assumes that all scalar > values are directly represented as their final types. > ie it assumes an 'int' is using QInt, and a 'bool' is > using QBool. > > This extends it so that QString is optionally permitted >

Re: [Qemu-devel] [PATCH v3 01/10] qdict: implement a qdict_crumple method for un-flattening a dict

2016-03-21 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > The qdict_flatten() method will take a dict whose elements are > further nested dicts/lists and flatten them by concatenating > keys. > > The qdict_crumple() method aims to do the reverse, taking a flat > qdict, and turning it into a set of

Re: [Qemu-devel] [PATCH 06/22] hbitmap: load/store

2016-03-21 Thread John Snow
On 03/15/2016 04:04 PM, Vladimir Sementsov-Ogievskiy wrote: > Add functions for load/store HBitmap to BDS, using clusters table: > Last level of the bitmap is splitted into chunks of 'cluster_size' > size. Each cell of the table contains offset in bds, to load/store > corresponding chunk. > >

Re: [Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 18:00:50 -0400 Bandan Das wrote: > vfio_listener_region_add for a iommu mr results in > an overflow assert since emulated iommu memory region is initialized > with UINT64_MAX. Add a check just like memory_region_size() > does. > > Signed-off-by: Bandan Das

Re: [Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held

2016-03-21 Thread Paolo Bonzini
On 21/03/2016 22:50, Emilio G. Cota wrote: > The problem with this approach is that the "point TCG to second buffer" > is not just a question of pointing code_gen_buffer to a new address; > we'd have to create a new tcg_ctx struct, since tcg_ctx has quite a few > elements that are dependent on

Re: [Qemu-devel] [RFC v1 01/11] tcg: move tb_find_fast outside the tb_lock critical section

2016-03-21 Thread Peter Maydell
On 21 March 2016 at 21:50, Emilio G. Cota wrote: > This function, as is, doesn't really just "find"; two concurrent "finders" > could race here by *writing* to the head of the list at the same time. > > The fix is to get rid of this write entirely; moving the just-found TB to >

[Qemu-devel] [PATCH] vfio: add check for memory region overflow condition

2016-03-21 Thread Bandan Das
vfio_listener_region_add for a iommu mr results in an overflow assert since emulated iommu memory region is initialized with UINT64_MAX. Add a check just like memory_region_size() does. Signed-off-by: Bandan Das --- hw/vfio/common.c | 7 ++- 1 file changed, 6

Re: [Qemu-devel] [PATCH] block: Remove bdrv_make_anon()

2016-03-21 Thread Eric Blake
On 03/18/2016 04:31 AM, Kevin Wolf wrote: > The call in hmp_drive_del() is dead code because blk_remove_bs() is > called a few lines above. The only other remaining user is > bdrv_delete(), which only abuses bdrv_make_anon() to remove it from the > named nodes list. This path inlines the list

Re: [Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held

2016-03-21 Thread Emilio G. Cota
On Fri, Mar 18, 2016 at 17:59:46 +0100, Paolo Bonzini wrote: > On 18/03/2016 17:18, Alex Bennée wrote: > > + > > +/* Protected by tb_lock. */ > > Only writes are protected by tb_lock. Read happen outside the lock. > > Reads are not quite thread safe yet, because of tb_flush. In order to >

Re: [Qemu-devel] [RFC v1 01/11] tcg: move tb_find_fast outside the tb_lock critical section

2016-03-21 Thread Emilio G. Cota
On Fri, Mar 18, 2016 at 16:18:42 +, Alex Bennée wrote: > From: KONRAD Frederic > > Signed-off-by: KONRAD Frederic > Signed-off-by: Paolo Bonzini > [AJB: minor checkpatch fixes] > Signed-off-by: Alex Bennée

Re: [Qemu-devel] [PATCH v4 07/10] vfio: add check aer functionality for hotplug device

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 18:08:43 +0800 Cao jin wrote: > From: Chen Fan > > because we make the vfio functions are combined > in the same way as on the host for aer, so we can > do the aer check when the function 0 was hotplugged. Suggestion:

Re: [Qemu-devel] [PATCH v4 08/10] vfio: vote the function 0 to do host bus reset when aer occurred

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 18:08:44 +0800 Cao jin wrote: > From: Chen Fan > > Due to all devices assigned to VM on the same way as host if enable > aer, so we can easily do the hot reset by selecting the function #0 > to do the hot reset. > >

Re: [Qemu-devel] [PATCH v4 05/10] vfio: extending function vfio_pci_host_match to support mask func number

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 18:08:41 +0800 Cao jin wrote: > From: Chen Fan > > Signed-off-by: Chen Fan > --- > hw/vfio/pci.c | 29 - > 1 file changed, 20 insertions(+), 9 deletions(-) >

Re: [Qemu-devel] [PATCH v4 06/10] vfio: add check host bus reset is support or not

2016-03-21 Thread Alex Williamson
On Mon, 21 Mar 2016 18:08:42 +0800 Cao jin wrote: > From: Chen Fan > > when boot up a VM that assigning vfio devices with aer enabled, we > must check the vfio device whether support host bus reset. because > when one error occur. OS

Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-21 Thread Eric Blake
On 03/09/2016 06:46 PM, Peter Xu wrote: > On Wed, Mar 09, 2016 at 03:14:03PM -0700, Eric Blake wrote: >>> +func_fprintf(f, "%*s[%i]:%c", indentation * 4, "", i, >>> + composite ? '\n' : ' '); >> >> [The nerd in me wants to point out that you could avoid the ternary by

Re: [Qemu-devel] (no subject)

2016-03-21 Thread Peter Maydell
On 21 March 2016 at 18:00, John Snow wrote: > Looks like one of your libraries is outdated, for me > 'IBV_LINK_LAYER_INFINIBAND' is defined in > /usr/include/infiniband/verbs.h; provided by > libibverbs-devel-1.1.8-3.fc22.x86_64. > > Maybe your libibverbs is too old. We should

[Qemu-devel] [PULL v2 26/40] ivshmem: Propagate errors through ivshmem_recv_setup()

2016-03-21 Thread Markus Armbruster
This kills off the funny state described in the previous commit. Simplify ivshmem_io_read() accordingly, and update documentation. Signed-off-by: Markus Armbruster Message-Id: <1458066895-20632-27-git-send-email-arm...@redhat.com> Reviewed-by: Marc-André Lureau

[Qemu-devel] [PULL v2 10/40] ivshmem: Rewrite specification document

2016-03-21 Thread Markus Armbruster
This started as an attempt to update ivshmem_device_spec.txt for clarity, accuracy and completeness while working on its code, and quickly became a full rewrite. Since the diff would be useless anyway, I'm using the opportunity to rename the file to ivshmem-spec.txt. I tried hard to ensure the

[Qemu-devel] [PULL v2 33/40] ivshmem: Inline check_shm_size() into its only caller

2016-03-21 Thread Markus Armbruster
Improve the error messages while there. Signed-off-by: Markus Armbruster Message-Id: <1458066895-20632-34-git-send-email-arm...@redhat.com> Reviewed-by: Marc-André Lureau --- hw/misc/ivshmem.c | 37 +++-- 1 file

[Qemu-devel] [PULL v2 31/40] ivshmem: Implement shm=... with a memory backend

2016-03-21 Thread Markus Armbruster
ivshmem has its very own code to create and map shared memory. Replace that with an implicitly created memory backend. Reduces the number of ways we create BAR 2 from three to two. The memory-backend-file is currently available only with CONFIG_LINUX, so this adds a second Linuxism to ivshmem

Re: [Qemu-devel] [PATCH] qdict: fix unbounded stack for qdict_array_entries

2016-03-21 Thread Eric Blake
On 03/09/2016 06:36 PM, Peter Xu wrote: > Sorry to forgot CCing Eric/Markus/Kevin. > > This patch title is not correct, which should be: > > "Fix unbounded stack warning for qdict_array_entries" Keep the 'qdict:' prefix, but yes, adding "warning" helps the commit message. > > Do I need to

[Qemu-devel] [PULL v2 34/40] qdev: New DEFINE_PROP_ON_OFF_AUTO

2016-03-21 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-35-git-send-email-arm...@redhat.com> --- hw/core/qdev-properties.c| 10 ++ include/hw/qdev-properties.h | 3 +++ 2 files changed, 13

[Qemu-devel] [PULL v2 36/40] ivshmem: Split ivshmem-plain, ivshmem-doorbell off ivshmem

2016-03-21 Thread Markus Armbruster
ivshmem can be configured with and without interrupt capability (a.k.a. "doorbell"). The two configurations have largely disjoint options, which makes for a confusing (and badly checked) user interface. Moreover, the device can't tell the guest whether its doorbell is enabled. Create two new

[Qemu-devel] [PULL v2 16/40] ivshmem: Fix harmless misuse of Error

2016-03-21 Thread Markus Armbruster
We reuse errp after passing it host_memory_backend_get_memory(). If both host_memory_backend_get_memory() and the reuse set an error, the reuse will fail the assertion in error_setv(). Fortunately, host_memory_backend_get_memory() can't fail. Pass it _abort to make our assumption explicit, and

[Qemu-devel] [PULL v2 27/40] ivshmem: Rely on server sending the ID right after the version

2016-03-21 Thread Markus Armbruster
The protocol specification (ivshmem-spec.txt, formerly ivshmem_device_spec.txt) has always required the ID message to be sent right at the beginning, and ivshmem-server has always complied. The device, however, accepts it out of order. If an interrupt setup arrived before it, though, it would be

[Qemu-devel] [PULL v2 37/40] ivshmem: Clean up after the previous commit

2016-03-21 Thread Markus Armbruster
Move code to more sensible places. Use the opportunity to reorder and document IVShmemState members. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-38-git-send-email-arm...@redhat.com> ---

[Qemu-devel] [PULL v2 40/40] contrib/ivshmem-server: Print "not for production" warning

2016-03-21 Thread Markus Armbruster
The code is okay for illustrating how things work and for testing, but its error handling make it unfit for production use. Print a warning to protect the innocent. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id:

[Qemu-devel] [PULL v2 35/40] ivshmem: Replace int role_val by OnOffAuto master

2016-03-21 Thread Markus Armbruster
In preparation of making it a qdev property. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-36-git-send-email-arm...@redhat.com> --- hw/misc/ivshmem.c | 31 +++ 1 file

[Qemu-devel] [PULL v2 38/40] ivshmem: Drop ivshmem property x-memdev

2016-03-21 Thread Markus Armbruster
Use ivshmem-plain instead. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-39-git-send-email-arm...@redhat.com> --- hw/misc/ivshmem.c | 23 +++ 1 file changed, 3 insertions(+), 20

[Qemu-devel] [PULL v2 21/40] ivshmem: Assert interrupts are set up once

2016-03-21 Thread Markus Armbruster
An interrupt is set up when the interrupt's file descriptor is received. Each message applies to the next interrupt vector. Therefore, each vector cannot be set up more than once. ivshmem_add_kvm_msi_virq() half-heartedly tries not to rely on this by doing nothing then, but that's not going to

[Qemu-devel] [PULL v2 32/40] ivshmem: Simplify memory regions for BAR 2 (shared memory)

2016-03-21 Thread Markus Armbruster
ivshmem_realize() puts the shared memory region in a container region. Used to be necessary to permit delayed mapping of the shared memory. However, we recently moved to synchronous mapping, in "ivshmem: Receive shared memory synchronously in realize()" and the commit following it. The container

[Qemu-devel] [PULL v2 25/40] ivshmem: Receive shared memory synchronously in realize()

2016-03-21 Thread Markus Armbruster
When configured for interrupts (property "chardev" given), we receive the shared memory from an ivshmem server. We do so asynchronously after realize() completes, by setting up callbacks with qemu_chr_add_handlers(). Keeping server I/O out of realize() that way avoids delays due to a slow

[Qemu-devel] [PULL v2 24/40] ivshmem: Plug leaks on unplug, fix peer disconnect

2016-03-21 Thread Markus Armbruster
close_peer_eventfds() cleans up three things: ioeventfd triggers if they exist, eventfds, and the array to store them. Commit 98609cd (v1.2.0) fixed it not to clean up ioeventfd triggers when they don't exist (property ioeventfd=off, which is the default). Unfortunately, the fix also made it skip

[Qemu-devel] [PULL v2 29/40] ivshmem: Simplify how we cope with short reads from server

2016-03-21 Thread Markus Armbruster
Short reads from a UNIX domain sockets are exceedingly unlikely when the other side always sends eight bytes and we always read eight bytes. We cope with them anyway. However, the code doing that is rather convoluted. Dumb it down radically. Signed-off-by: Markus Armbruster

[Qemu-devel] [PULL v2 20/40] ivshmem: Leave INTx alone when using MSI-X

2016-03-21 Thread Markus Armbruster
The ivshmem device can either use MSI-X or legacy INTx for interrupts. With MSI-X enabled, peer interrupt events trigger an MSI as they should. But software can still raise INTx via interrupt status and mask register in BAR 0. This is explicitly prohibited by PCI Local Bus Specification

[Qemu-devel] [PULL v2 39/40] ivshmem: Require master to have ID zero

2016-03-21 Thread Markus Armbruster
Migration with ivshmem needs to be carefully orchestrated to work. Exactly one peer (the "master") migrates to the destination, all other peers need to unplug (and disconnect), migrate, plug back (and reconnect). This is sort of documented in qemu-doc. If peers connect on the destination before

[Qemu-devel] [PULL v2 23/40] ivshmem: Disentangle ivshmem_read()

2016-03-21 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-24-git-send-email-arm...@redhat.com> --- hw/misc/ivshmem.c | 173 +++--- 1 file changed, 87

[Qemu-devel] [PULL v2 28/40] ivshmem: Drop the hackish test for UNIX domain chardev

2016-03-21 Thread Markus Armbruster
The chardev must be capable of transmitting SCM_RIGHTS ancillary messages. We check it by comparing CharDriverState member filename to "unix:". That's almost as brittle as it is disgusting. When the actual transmission all happened asynchronously, this check was all we could do in realize(),

[Qemu-devel] [PULL v2 15/40] ivshmem: Don't destroy the chardev on version mismatch

2016-03-21 Thread Markus Armbruster
Yes, the chardev is commonly useless after we read a bad version from it, but destroying it is inappropriate anyway: the user created it, so the user should be able to hold on to it as long as he likes. We don't destroy it on other errors. Screwed up in commit 5105b1d. Stop reading instead.

[Qemu-devel] [PULL v2 22/40] ivshmem: Simplify rejection of invalid peer ID from server

2016-03-21 Thread Markus Armbruster
ivshmem_read() processes server messages. These are 64 bit signed integers. -1 is shared memory setup, 16 bit unsigned is a peer ID, anything else is invalid. ivshmem_read() rejects invalid negative messages right away, silently. Invalid positive messages get rejected only in resize_peers(),

[Qemu-devel] [PULL v2 30/40] ivshmem: Tighten check of property "size"

2016-03-21 Thread Markus Armbruster
If size_t is narrower than 64 bits, passing uint64_t ivshmem_size to mmap() truncates. Reject such sizes. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-31-git-send-email-arm...@redhat.com> ---

[Qemu-devel] [PULL v2 18/40] ivshmem: Clean up register callbacks

2016-03-21 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-19-git-send-email-arm...@redhat.com> --- hw/misc/ivshmem.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git

[Qemu-devel] [PULL v2 04/40] qemu-doc: Fix ivshmem huge page example

2016-03-21 Thread Markus Armbruster
Option parameter "share" is missing. Without it, you get a *private* mmap(), which defeats ivshmem's purpose pretty thoroughly ;) While there, switch to the conventional mountpoint of hugetlbfs /dev/hugepages. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau

[Qemu-devel] [PULL v2 06/40] tests/libqos/pci-pc: Fix qpci_pc_iomap() to map BARs aligned

2016-03-21 Thread Markus Armbruster
qpci_pc_iomap() maps BARs one after the other, without padding. This is wrong. PCI Local Bus Specification Revision 3.0, 6.2.5.1. Address Maps: "all address spaces used are a power of two in size and are naturally aligned". That's because the size of a BAR is given by the number of address bits

[Qemu-devel] [PULL v2 08/40] ivshmem-test: Clean up wait for devices to become operational

2016-03-21 Thread Markus Armbruster
test_ivshmem_server() waits until the first byte in BAR 2 contains the 0x42 we put into shared memory. Works because the byte reads zero until the device maps the shared memory gotten from the server. Check the IVPosition register instead: it's initially -1, and becomes non-negative right when

[Qemu-devel] [PULL v2 19/40] ivshmem: Clean up MSI-X conditions

2016-03-21 Thread Markus Armbruster
There are three predicates related to MSI-X: * ivshmem_has_feature(s, IVSHMEM_MSI) is true unless the non-MSI-X variant of the device is selected with msi=off. * msix_present() is true when the device has the PCI capability MSI-X. It's initially false, and becomes true during successful

[Qemu-devel] [PULL v2 11/40] ivshmem: Add missing newlines to debug printfs

2016-03-21 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <1458066895-20632-12-git-send-email-arm...@redhat.com> --- hw/misc/ivshmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c

[Qemu-devel] [PULL v2 17/40] ivshmem: Failed realize() can leave migration blocker behind

2016-03-21 Thread Markus Armbruster
If pci_ivshmem_realize() fails after it created its migration blocker, the blocker is left in place. Fix that by creating it last. Likewise, if it fails after it called fifo8_create(), it leaks fifo memory. Fix that the same way. Signed-off-by: Markus Armbruster

[Qemu-devel] [PULL v2 00/40] ivshmem: Fixes, cleanups, device model split

2016-03-21 Thread Markus Armbruster
Major issues addressed by this series: * The specification document is incomplete and vague. Rewritten. * When a peer goes away, and its ID gets reused for another one, interrupts don't work. * When configured for interrupts, we receive shared memory from the server some time after

  1   2   3   4   >