Re: [Qemu-devel] [PATCH v3 00/10] Clock framework API.

2017-06-27 Thread KONRAD Frederic
Le 06/23/2017 à 03:58 PM, Peter Maydell a écrit : On 23 June 2017 at 14:07, KONRAD Frederic wrote: Le 06/23/2017 à 02:47 PM, Peter Maydell a écrit : Each device "owns" its output clock objects, but input clocks are just pointers to the clock object owned by the device at the other end. In th

Re: [Qemu-devel] [PATCH v5 2/4] net/socket: Convert error message to Error

2017-06-27 Thread Markus Armbruster
Suggest "net/socket: Convert several helper functions to Error". Mao Zhongyi writes: > Currently, net_socket_mcast_create(), net_socket_fd_init_dgram() and > net_socket_fd_init() use the function such as fprintf(), perror() to > report an error message. > > Now, convert these functions to Error.

Re: [Qemu-devel] [PATCH v6 6/8] vmdk: New functions to assist allocating multiple clusters

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > +/* > + * vmdk_handle_alloc > + * > + * Allocate new clusters for an area that either is yet unallocated or needs > a > + * copy on write. If *cluster_offset is non_zero, clusters are only > allocated if > + * the new allocation can match the specifi

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

2017-06-27 Thread Markus Armbruster
Mao Zhongyi writes: > Cc: berra...@redhat.com > Cc: kra...@redhat.com > Cc: pbonz...@redhat.com > Cc: jasow...@redhat.com > Cc: arm...@redhat.com > Signed-off-by: Mao Zhongyi > --- > include/qemu/sockets.h | 3 ++- > net/net.c | 22 +- > net/socket.c

Re: [Qemu-devel] [PATCH v6 7/8] vmdk: Update metadata for multiple clusters

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > @@ -1876,6 +1942,13 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_t > offset, > offset += n_bytes; > bytes_done += n_bytes; > > +while (m_data->next != NULL) { If you do while (m_data) { > +

Re: [Qemu-devel] [RFC PATCH 0/4] travis: run all coccinelle scripts

2017-06-27 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Another item from my 'automated testing' list: use travis-ci to run coccinelle > scripts. This series is more of a PoC. The idea would be to run it once a day > only on /master. > > Patch 1 is here only to speedup travis testing. > > Patch 3 add a script which run

Re: [Qemu-devel] [RFC 1/5] vfio: introduce a new VFIO region for migration support

2017-06-27 Thread Zhang, Yulei
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Tuesday, June 27, 2017 4:19 AM > To: Zhang, Yulei > Cc: qemu-devel@nongnu.org; Tian, Kevin ; > joonas.lahti...@linux.intel.com; zhen...@linux.intel.com; Zheng, Xiao > ; Wang, Zhi A > Subject: Re: [Q

Re: [Qemu-devel] [PATCH v6 7/8] vmdk: Update metadata for multiple clusters

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > Include a next pointer in VmdkMetaData struct to point to the previous > allocated L2 table. Modify vmdk_L2update to start updating metadata for > allocation of multiple clusters at once. > > Signed-off-by: Ashijeet Acharya > --- > block/vmdk.c | 12

Re: [Qemu-devel] [PATCH v6 8/8] vmdk: Make vmdk_get_cluster_offset() return cluster offset only

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > vmdk_alloc_clusters() introduced earlier now handles the task of > allocating clusters and performing COW when needed. Thus we can change > vmdk_get_cluster_offset() to stick to the sole purpose of returning > cluster offset using sector number. Update

Re: [Qemu-devel] [PATCH v4 2/3] Add memfd based hostmem

2017-06-27 Thread Marc-André Lureau
Hi Eduardo On Fri, Jun 23, 2017 at 11:09 PM Eduardo Habkost wrote: > On Wed, Jun 21, 2017 at 04:02:18PM +0200, Marc-André Lureau wrote: > > Add a new memory backend, similar to hostmem-file, except that it > > doesn't need to create files. It also enforces memory sealing. > > > > This backend is

Re: [Qemu-devel] [RFC PATCH 0/2] Enhance block status when crossing EOF

2017-06-27 Thread Fam Zheng
On Thu, 05/04 21:14, Eric Blake wrote: > Thus, this is a followup to that series, but I'm also okay if we > think it is too much maintenance compared to the potential gains, > and decide to drop it after all. The comments are good enough and I like how this makes the function interface a bit more

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

2017-06-27 Thread Alexey
On Tue, Jun 27, 2017 at 12:03:10PM +0800, Peter Xu wrote: > On Mon, Jun 26, 2017 at 11:35:20AM +0300, Alexey Perevalov wrote: > > This patch adds ability to track down already received > > pages, it's necessary for calculation vCPU block time in > > postcopy migration feature, maybe for restore aft

Re: [Qemu-devel] [Qemu-arm] [PATCH 0/4] cpu: Implement cpu_generic_new()

2017-06-27 Thread Igor Mammedov
On Mon, 26 Jun 2017 23:33:48 -0300 Eduardo Habkost wrote: > On Mon, Jun 26, 2017 at 02:28:13PM +0100, Alex Bennée wrote: > > > > Peter Maydell writes: > > > > > This patchset adds a new function cpu_generic_new() > > > which is similar to cpu_generic_init() except that it > > > does not real

Re: [Qemu-devel] [PATCH 06/16] tcg: Add temp_global bit to TCGTemp

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > This avoids needing to test the index of a temp against nb_globals. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 15 --- > tcg/tcg.c | 11 --- > tcg/tcg.h | 12 > 3 files changed, 24 insertions(+), 14 delet

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

2017-06-27 Thread Fam Zheng
On Thu, 06/15 17:38, Stefan Hajnoczi wrote: > 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 8c56c1

Re: [Qemu-devel] [RFC 3/5] vfio: introduce new VFIO ioctl VFIO_DEVICE_PCI_STATUS_SET

2017-06-27 Thread Zhang, Yulei
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Tuesday, June 27, 2017 4:19 AM > To: Zhang, Yulei > Cc: qemu-devel@nongnu.org; Tian, Kevin ; > joonas.lahti...@linux.intel.com; zhen...@linux.intel.com; Zheng, Xiao > ; Wang, Zhi A > Subject: Re: [Q

Re: [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device

2017-06-27 Thread Will Deacon
Hi Eric, On Tue, Jun 27, 2017 at 08:38:48AM +0200, Auger Eric wrote: > On 26/06/2017 18:13, Jean-Philippe Brucker wrote: > > On 26/06/17 09:22, Auger Eric wrote: > >> On 19/06/2017 12:15, Jean-Philippe Brucker wrote: > >>> On 19/06/17 08:54, Bharat Bhushan wrote: > I started added replay in v

Re: [Qemu-devel] [PATCH 07/16] tcg: Return NULL temp for TCG_CALL_DUMMY_ARG

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > Signed-off-by: Richard Henderson > --- > tcg/tcg.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tcg/tcg.h b/tcg/tcg.h > index 3b35344..6c357e7 100644 > --- a/tcg/tcg.h > +++ b/tcg/tcg.h > @@ -730,7 +730,7 @@ extern bool parallel_cpus; > >

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

2017-06-27 Thread Zhang, Yulei
> -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+yulei.zhang=intel@nongnu.org] On Behalf Of Alex Williamson > Sent: Tuesday, June 27, 2017 4:19 AM > To: Zhang, Yulei > Cc: Tian, Kevin ; joonas.lahti...@linux.intel.com; > qemu-devel@nongnu.org; zhen...@linux.intel

Re: [Qemu-devel] [PATCH 09/16] tcg: Use per-temp state data in liveness

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > This avoids having to allocate external memory for each temporary. > > Signed-off-by: Richard Henderson > --- > tcg/tcg.c | 232 > ++ > tcg/tcg.h | 6 ++ > 2 files changed, 120 insertions(+), 118 deletio

Re: [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device

2017-06-27 Thread Auger Eric
Hi, On 27/06/2017 10:46, Will Deacon wrote: > Hi Eric, > > On Tue, Jun 27, 2017 at 08:38:48AM +0200, Auger Eric wrote: >> On 26/06/2017 18:13, Jean-Philippe Brucker wrote: >>> On 26/06/17 09:22, Auger Eric wrote: On 19/06/2017 12:15, Jean-Philippe Brucker wrote: > On 19/06/17 08:54, Bhar

Re: [Qemu-devel] [PATCH 10/16] tcg: Avoid loops against variable bounds

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > Copy s->nb_globals or s->nb_temps to a local variable for the purposes > of iteration. This should allow the compiler to use low-overhead > looping constructs on some hosts. > > Signed-off-by: Richard Henderson > --- > tcg/tcg.c | 27 ++- >

[Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools

2017-06-27 Thread Peter Xu
Patch 1: fixes a very rare PT path issue on iova value. It didn't break anything since it's merely not touched (only if when IOMMU enabled, then set one device to PT), but still better fix it. Patch 2-5: added "info iommu" hmp command, and implemented for VT-d. Meanwhile, added some statistics for

[Qemu-devel] [PATCH 2/8] hmp: add info iommu

2017-06-27 Thread Peter Xu
Introducing a new HMP interface "info iommu" to dump IOMMU information. This command will be only used for developers' debugging purpose, and no possible use for users. So QMP interface will not be implemented. This patch only implements the stub one. We can provide arch-dependent status dump in

[Qemu-devel] [PATCH 1/8] intel_iommu: fix VTD_PAGE_MASK

2017-06-27 Thread Peter Xu
IOMMUTLBEntry.iova is returned incorrectly in one PT path (though mostly we cannot really trigger this path, even if we do, we are mostly disgarding this value, so it didn't break anything). Fix it by converting the VTD_PAGE_MASK into normal definition (normally it should be pfn mask, not offset ma

[Qemu-devel] [PATCH 6/8] intel_iommu: let iotlb size tunable

2017-06-27 Thread Peter Xu
We were having static IOTLB size as 1024. Let it be a tunable. We can also turns IOTLB off if we want, by specify the size as zero. The tunable is named as "x-iotlb-size" since that should not really be something used by user yet, but mostly for debugging purpose now. Signed-off-by: Peter Xu ---

[Qemu-devel] [PATCH 3/8] intel_iommu: support "info iommu"

2017-06-27 Thread Peter Xu
Dump critical information for VT-d. Sample output: (qemu) info iommu Version: 1 Cap: 0x12008c22260286 Extended Cap: 0xf00f5a DMAR: enabled, root=0x7435f000 (extended=0) IR: enabled, root=0x17a40, size=0x1 (eim=1) QI: enabled, root=0x17aadf000, head=156, tail=156, size=256 Caching-mode: ena

[Qemu-devel] [PATCH 5/8] intel_iommu: hmp: allow "-c" for "info iommu"

2017-06-27 Thread Peter Xu
New parameter "-c" for it to clear statistics. Other platforms can selectively support this (though none yet). Signed-off-by: Peter Xu --- hmp-commands-info.hx | 4 ++-- hw/i386/intel_iommu.c | 5 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hmp-commands-info.hx b/hmp-co

[Qemu-devel] [PATCH 8/8] intel_iommu: implement mru list for iotlb

2017-06-27 Thread Peter Xu
It is not wise to disgard all the IOTLB cache when cache size reaches max, but that's what we do now. A slightly better (but still simple) way to do this is, we just throw away the least recent used cache entry. This patch implemented MRU list algorithm for VT-d IOTLB. The main logic is to maintai

[Qemu-devel] [PATCH 4/8] intel_iommu: add iotlb/context cache statistics

2017-06-27 Thread Peter Xu
Add statistics for the VT-d IOMMU DMA remapping. Now "info iommu" shows us this for extra: Statistics: iotlb=26.35% (6689/25388), context=99.99% (18697/18699) Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 21 + include/hw/i386/intel_iommu.h | 10 ++ 2

[Qemu-devel] [PATCH 7/8] intel_iommu: use access_flags for iotlb

2017-06-27 Thread Peter Xu
It was cached by read/write separately. Let's merge them. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 15 +++ include/hw/i386/intel_iommu.h | 3 +-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index fc

Re: [Qemu-devel] [PATCH 16/19] block: protect modification of dirty bitmaps with a mutex

2017-06-27 Thread Vladimir Sementsov-Ogievskiy
26.06.2017 19:54, Paolo Bonzini wrote: On 26/06/2017 18:07, Vladimir Sementsov-Ogievskiy wrote: HI! One question here, should not 'bdrv_undo_clear_dirty_bitmap' be under lock too? Any call to dirty bitmap functions between bdrv_clear_dirty_bitmap and bdrv_undo_clear_dirty_bitmap is problemati

Re: [Qemu-devel] [PATCH v6 2/6] queue: Add macro for incremental traversal

2017-06-27 Thread Lluís Vilanova
Richard Henderson writes: > On 06/26/2017 05:33 AM, Lluís Vilanova wrote: >> Richard Henderson writes: >> >>> On 06/12/2017 07:54 AM, Lluís Vilanova wrote: Adds macro QTAILQ_FOREACH_CONTINUE to support incremental list traversal. Signed-off-by: Lluís Vilanova --- i

Re: [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools

2017-06-27 Thread Peter Xu
On Tue, Jun 27, 2017 at 05:03:31PM +0800, Peter Xu wrote: > Patch 1: fixes a very rare PT path issue on iova value. It didn't > break anything since it's merely not touched (only if when IOMMU > enabled, then set one device to PT), but still better fix it. > > Patch 2-5: added "info iommu" hmp com

Re: [Qemu-devel] [PATCH v9 04/26] target: [tcg] Add generic translation framework

2017-06-27 Thread Peter Maydell
On 27 June 2017 at 04:22, Richard Henderson wrote: > On 06/26/2017 11:21 AM, Peter Maydell wrote: >> >> x86 definitely gets this totally wrong. I would be unsurprised >> to find that other variable-length-insn targets do too. > > > For x86, doing this optimally is difficult. We *could* fix it sim

Re: [Qemu-devel] [PATCH 16/19] block: protect modification of dirty bitmaps with a mutex

2017-06-27 Thread Paolo Bonzini
On 27/06/2017 11:07, Vladimir Sementsov-Ogievskiy wrote: > 26.06.2017 19:54, Paolo Bonzini wrote: >> >> On 26/06/2017 18:07, Vladimir Sementsov-Ogievskiy wrote: >>> HI! >>> >>> One question here, should not 'bdrv_undo_clear_dirty_bitmap' be under >>> lock too? >> Any call to dirty bitmap function

Re: [Qemu-devel] [PATCH v3 00/10] Clock framework API.

2017-06-27 Thread Peter Maydell
On 27 June 2017 at 08:04, KONRAD Frederic wrote: > Le 06/23/2017 à 03:58 PM, Peter Maydell a écrit : >> The pointer is for your clock inputs -- when would you >> want to start a refresh from that? I would expect >> refreshes to only ever go downstream -- you update >> the config of your clock outp

Re: [Qemu-devel] [PATCH 12/16] tcg: Remove unused TCG_CALL_DUMMY_TCGV

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > tcg/tcg.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/tcg/tcg.h b/tcg/tcg.h > index 1eeeca5..4f69d0c 100644 > --- a/tcg/tcg.h > +++ b/tcg/tcg.h > @@ -503,7 +503,6 @@ static inline intpt

Re: [Qemu-devel] [PATCH v4 5/5] tests: add functional test validating ipv4/ipv6 address flag handling

2017-06-27 Thread Daniel P. Berrange
On Mon, Jun 26, 2017 at 09:30:38PM -0500, Eric Blake wrote: > On 06/26/2017 09:10 PM, Eric Blake wrote: > > On 06/16/2017 05:12 AM, Daniel P. Berrange wrote: > >> The semantics around handling ipv4=on|off & ipv6=on|off are quite > >> subtle to understand in combination with the various hostname add

Re: [Qemu-devel] [PATCH 13/16] tcg: Export temp_idx

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > At the same time, drop the TCGContext argument and use tcg_ctx instead. > > Signed-off-by: Richard Henderson > --- > tcg/tcg.c | 15 --- > tcg/tcg.h | 7 ++- > 2 files changed, 10 insertions(+), 12 deletions(-) > > diff --git a/tcg/tcg.c b/tcg/tcg.c

Re: [Qemu-devel] [PATCH 16/19] block: protect modification of dirty bitmaps with a mutex

2017-06-27 Thread Vladimir Sementsov-Ogievskiy
27.06.2017 12:27, Paolo Bonzini wrote: On 27/06/2017 11:07, Vladimir Sementsov-Ogievskiy wrote: 26.06.2017 19:54, Paolo Bonzini wrote: On 26/06/2017 18:07, Vladimir Sementsov-Ogievskiy wrote: HI! One question here, should not 'bdrv_undo_clear_dirty_bitmap' be under lock too? Any call to dir

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

2017-06-27 Thread Lluís Vilanova
Optimizes tracing of events with the 'tcg' and 'vcpu' properties (e.g., memory accesses), making it feasible to statically enable them by default on all QEMU builds. Some quick'n'dirty numbers with 400.perlbench (SPECcpu2006) on the train input (medium size - suns.pl) and the guest_mem_before even

[Qemu-devel] [PATCH v5 0/3] Add bitmap for received pages in postcopy migration

2017-06-27 Thread Alexey Perevalov
This is 5th version of [PATCH v1 0/2] Add bitmap for copied pages in postcopy migration cover message from there This is a separate patch set, it derived from https://www.mail-archive.com/qemu-devel@nongnu.org/msg456004.html There are several possible use cases: 1. solve issue with postcopy live

[Qemu-devel] [PATCH v5 2/3] migration: introduce qemu_ufd_copy_ioctl helper

2017-06-27 Thread Alexey Perevalov
Just for placing auxilary operations inside helper, auxilary operations like: track received pages, notify about copying operation in futher patches. Reviewed-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Alexey Perevalov --- migration/postcopy-ram

[Qemu-devel] [PATCH v5 1/3] migration: postcopy_place_page factoring out

2017-06-27 Thread Alexey Perevalov
Need to mark copied pages as closer as possible to the place where it tracks down. That will be necessary in futher patch. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13 +++-- migr

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

2017-06-27 Thread Alexey Perevalov
This patch adds ability to track down already received pages, it's necessary for calculation vCPU block time in postcopy migration feature, maybe for restore after postcopy migration failure. Also it's necessary to solve shared memory issue in postcopy livemigration. Information about received page

[Qemu-devel] [PATCH v9 1/7] exec: [tcg] Refactor flush of per-CPU virtual TB cache

2017-06-27 Thread Lluís Vilanova
The function is reused in later patches. Signed-off-by: Lluís Vilanova Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c|2 +- accel/tcg/translate-all.c | 15 ++- include/exec/exec-all.h |6 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git

Re: [Qemu-devel] [PATCH 14/16] tcg: Use per-temp state data in optimize

2017-06-27 Thread Alex Bennée
Richard Henderson writes: > While we're touching many of the lines anyway, adjust the naming > of the functions to better distinguish when "TCGArg" vs "TCGTemp" > should be used. Could we add definitions of TCGArg and TCGTemp into tcg/README? > > Signed-off-by: Richard Henderson > --- > tcg/

[Qemu-devel] [PATCH v9 2/7] trace: Allocate cpu->trace_dstate in place

2017-06-27 Thread Lluís Vilanova
There's little point in dynamically allocating the bitmap if we know at compile-time the max number of events we want to support. Thus, make room in the struct for the bitmap, which will make things easier later: this paves the way for upcoming changes, in which we'll use a u32 to fully capture cpu

[Qemu-devel] [PATCH v9 3/7] trace: [tcg] Delay changes to dynamic state when translating

2017-06-27 Thread Lluís Vilanova
This keeps consistency across all decisions taken during translation when the dynamic state of a vCPU is changed in the middle of translating some guest code. Signed-off-by: Lluís Vilanova Reviewed-by: Richard Henderson --- include/qom/cpu.h |3 +++ trace/control-target.c | 20 ++

[Qemu-devel] [PATCH v9 4/7] exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state

2017-06-27 Thread Lluís Vilanova
Every vCPU now uses a separate set of TBs for each set of dynamic tracing event state values. Each set of TBs can be used by any number of vCPUs to maximize TB reuse when vCPUs have the same tracing state. This feature is later used by tracetool to optimize tracing of guest code events. The maxim

[Qemu-devel] [PATCH v9 5/7] trace: [tcg] Do not generate TCG code to trace dinamically-disabled events

2017-06-27 Thread Lluís Vilanova
If an event is dynamically disabled, the TCG code that calls the execution-time tracer is not generated. Removes the overheads of execution-time tracers for dynamically disabled events. As a bonus, also avoids checking the event state when the execution-time tracer is called from TCG-generated cod

[Qemu-devel] [PATCH v9 6/7] trace: [tcg, trivial] Re-align generated code

2017-06-27 Thread Lluís Vilanova
Last patch removed a nesting level in generated code. Re-align all code generated by backends to be 4-column aligned. Signed-off-by: Lluís Vilanova --- scripts/tracetool/backend/dtrace.py |4 ++-- scripts/tracetool/backend/ftrace.py | 20 ++-- scripts/tracetool/backend/log.

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

2017-06-27 Thread Peter Xu
On Tue, Jun 27, 2017 at 05:50:27AM -0400, Alexey Perevalov wrote: [...] > @@ -60,6 +62,14 @@ static inline void *ramblock_ptr(RAMBlock *block, > ram_addr_t offset) > return (char *)block->host + offset; > } > > +static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,

[Qemu-devel] [PATCH v9 7/7] trace: [trivial] Statically enable all guest events

2017-06-27 Thread Lluís Vilanova
The optimizations of this series makes it feasible to have them available on all builds. Some quick'n'dirty numbers with 400.perlbench (SPECcpu2006) on the train input (medium size - suns.pl) and the guest_mem_before event: * vanilla, statically disabled real0m2,259s user0m2,252s sys

Re: [Qemu-devel] [RFC 0/5] vfio: Introduce Live migration capability to vfio_mdev device

2017-06-27 Thread Dr. David Alan Gilbert
* Yulei Zhang (yulei.zh...@intel.com) wrote: > Summary > > This series RFC would like to introduce the live migration capability > to vfio_mdev device. > > As currently vfio_mdev device don't support migration, we introduce a > device flag VFIO_DEVICE_FLAGS_MIGRATABLE to help determine whether t

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

2017-06-27 Thread Alexey
On Tue, Jun 27, 2017 at 06:17:40PM +0800, Peter Xu wrote: > On Tue, Jun 27, 2017 at 05:50:27AM -0400, Alexey Perevalov wrote: > > [...] > > > @@ -60,6 +62,14 @@ static inline void *ramblock_ptr(RAMBlock *block, > > ram_addr_t offset) > > return (char *)block->host + offset; > > } > > > >

Re: [Qemu-devel] [RFC 4/5] vfio: use vfio_device_put/vfio_device_get for device status save/restore

2017-06-27 Thread Dr. David Alan Gilbert
* Yulei Zhang (yulei.zh...@intel.com) wrote: > For VFIO pci device status migrate, on the source side with > funtion vfio_device_put to save the following states > 1. pci configuration space addr0~addr5 > 2. pci configuration space msi_addr msi_data > 3. pci device status fetch from device driver >

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

2017-06-27 Thread Juan Quintela
Peter Xu wrote: > On Tue, Jun 27, 2017 at 05:50:27AM -0400, Alexey Perevalov wrote: > > [...] > >> @@ -60,6 +62,14 @@ static inline void *ramblock_ptr(RAMBlock *block, >> ram_addr_t offset) >> return (char *)block->host + offset; >> } >> >> +static inline unsigned long int ramblock_recv_b

Re: [Qemu-devel] [Qemu-block] [PATCH] docs: add qemu-block-drivers(7) man page

2017-06-27 Thread Stefan Hajnoczi
On Mon, Jun 26, 2017 at 04:40:58PM -0400, John Snow wrote: > > > On 06/22/2017 08:17 AM, Stefan Hajnoczi wrote: > > Block driver documentation is available in qemu-doc.html. It would be > > convenient to have documentation for formats, protocols, and filter > > drivers in a man page. > > > > Ex

Re: [Qemu-devel] [Intel-gfx][RFC 9/9] drm/i915/gvt: Add support to VFIO region VFIO_PCI_DEVICE_STATE_REGION_INDEX

2017-06-27 Thread Dr. David Alan Gilbert
* Yulei Zhang (yulei.zh...@intel.com) wrote: > Add new VFIO region VFIO_PCI_DEVICE_STATE_REGION_INDEX support in vGPU, > through > this new region it can fetch the status from mdev device for migration, on > the target side it can retrieve the device status and reconfigure the device > to > conti

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

2017-06-27 Thread Kevin Wolf
Am 27.06.2017 um 10:43 hat Fam Zheng geschrieben: > On Thu, 06/15 17:38, Stefan Hajnoczi wrote: > > 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 i

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

2017-06-27 Thread Eric Blake
On 06/26/2017 11:10 PM, 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 Does command line introspection work to see that this new spelling is

Re: [Qemu-devel] [PATCH v9 04/26] target: [tcg] Add generic translation framework

2017-06-27 Thread Lluís Vilanova
Emilio G Cota writes: > On Sun, Jun 25, 2017 at 11:59:54 +0300, Lluís Vilanova wrote: >> Signed-off-by: Lluís Vilanova >> --- >> Makefile.target|1 >> include/exec/gen-icount.h |2 >> include/exec/translate-block.h | 125 +++ >> include/qom/cpu

Re: [Qemu-devel] [PATCH 3/5] qemu-iotests: 068: extract _qemu() function

2017-06-27 Thread Eric Blake
On 06/15/2017 11:38 AM, Stefan Hajnoczi wrote: > Avoid duplicating the QEMU command-line. > > Signed-off-by: Stefan Hajnoczi > --- > tests/qemu-iotests/068 | 13 - > 1 file changed, 8 insertions(+), 5 deletions(-) > > +# Give qemu some time to boot before saving the VM state > +bas

Re: [Qemu-devel] [PATCH 3/5] qemu-iotests: 068: extract _qemu() function

2017-06-27 Thread Eric Blake
On 06/27/2017 06:40 AM, Eric Blake wrote: > On 06/15/2017 11:38 AM, Stefan Hajnoczi wrote: >> Avoid duplicating the QEMU command-line. >> >> Signed-off-by: Stefan Hajnoczi >> --- >> tests/qemu-iotests/068 | 13 - >> 1 file changed, 8 insertions(+), 5 deletions(-) >> > >> +# Give qemu

[Qemu-devel] [RFC PATCH 02/14] pc-bios/s390-ccw: Start using the libc from SLOF

2017-06-27 Thread Thomas Huth
Change the Makefiles to make the libc compilable within the s390-ccw firmware build system, link it and start using it by switching the implementations of the memset() and memcpy() functions to the ones from the libc. Signed-off-by: Thomas Huth --- configure | 5

[Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS

2017-06-27 Thread Thomas Huth
It's already possible to do a network boot of an s390x guest with an external netboot image (based on a Linux installation), but it would be much more convenient if the s390-ccw firmware supported network booting right out of the box, without the need to assemble such an external image first. This

[Qemu-devel] [RFC PATCH 08/14] libnet: Refactor some code of netload() into a separate function

2017-06-27 Thread Thomas Huth
netload() is a huge function, it's easy to lose track here. So let's refactor the TFTP-related loading and error printing code into a separate function instead. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/libnet/netload.c | 177 -- 1 file changed, 93 inser

[Qemu-devel] [RFC PATCH 06/14] libnet: Remove remainders of netsave code

2017-06-27 Thread Thomas Huth
The code does not exist in the repository, so it does not make sense to keep the prototypes and the Forth wrapper around. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/libnet/netapps.h | 1 - pc-bios/s390-ccw/libnet/tftp.h| 2 -- 2 files changed, 3 deletions(-) diff --git a/pc-bios/s390-c

[Qemu-devel] [RFC PATCH 03/14] pc-bios/s390-ccw: Add a write() function for stdio

2017-06-27 Thread Thomas Huth
The stdio functions from the SLOF libc need a write() function for printing text to stdout/stderr. Let's implement this function by refactoring the code from sclp_print(). Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/sclp.c | 32 ++-- 1 file changed, 14 insertions(

[Qemu-devel] [RFC PATCH 01/14] pc-bios/s390-ccw: Add the libc from the SLOF firmware

2017-06-27 Thread Thomas Huth
To be able to use some more advanced libc functions in the s390-ccw firmware, like printf() and malloc(), we need a better libc here. This patch adds the C library from the SLOF firmware (taken from the SLOF commit ID 62674aabe20612a9786fa03e87cf6916ba97a99a). The files are copied without modificat

[Qemu-devel] [RFC PATCH 04/14] pc-bios/s390-ccw: Add implementation of sbrk()

2017-06-27 Thread Thomas Huth
To be able to use malloc() and friends from the SLOF libc, we need to provide an implementation of the sbrk() function. This patch adds such an implemenation, which has been taken from the SLOF firmware, too. Since the sbrk() function uses a big array as the heap, we now also have got to lower the

[Qemu-devel] [RFC PATCH 07/14] libnet: Rework error message printing

2017-06-27 Thread Thomas Huth
There is a repetive pattern of code in netload.c to print out error message: snprintf(buf, ...) + bootmsg_error() + write_mm_log(). The code can be simplified / shortened quite a bit by consolidating this pattern in a helper function. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/libnet/netloa

[Qemu-devel] [RFC PATCH 13/14] pc-bios/s390-ccw: Allow loading to address 0

2017-06-27 Thread Thomas Huth
Kernels are normally loaded to address 0, so the check for NULL in the TFTP code has to be replaced. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/libnet/tftp.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pc-bios/s390-ccw/libnet/tftp.c b/pc-bios/s390-ccw/lib

[Qemu-devel] [RFC PATCH 10/14] pc-bios/s390-ccw: Add timer code for the libnet

2017-06-27 Thread Thomas Huth
The libnet expects certain timer functions to exist, so that it is able to deal with timeouts etc. This patch implements these timer functions via the STORE CLOCK (stck) CPU instruction. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/libnet/Makefile | 2 +- pc-bios/s390-ccw/libnet/timer.c | 4

[Qemu-devel] [RFC PATCH 09/14] pc-bios/s390-ccw: Make the basic libnet code compilable

2017-06-27 Thread Thomas Huth
Adjust the Makefiles, remove non-required code and fix some spots that generated compiler warnings / errors with the s390-ccw firmware CFLAGS. Signed-off-by: Thomas Huth --- configure | 3 +- pc-bios/s390-ccw/Makefile | 6 +- pc-bios/s390-ccw/libnet/Makefile

[Qemu-devel] [RFC PATCH 11/14] pc-bios/s390-ccw: Add virtio-net driver code

2017-06-27 Thread Thomas Huth
This virtio-net driver contains the recv() and send() functions that are required by libnet to receive and send packets. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/virtio-net.c | 125 ++ pc-bios/s390-ccw/virtio.

[Qemu-devel] [RFC PATCH 12/14] pc-bios/s390-ccw: Load file via an intermediate .INS file

2017-06-27 Thread Thomas Huth
We need to know which files have to be loaded at which address. Normally you need at least two files, a kernel image and an initrd image. Since the normal DHCP information only provides one file, we now load an intermediate .INS file first which has to contain the information about the other files.

[Qemu-devel] [RFC PATCH 14/14] pc-bios/s390-ccw: Wire up the netload code

2017-06-27 Thread Thomas Huth
Link the libnet.a to the s390-ccw.elf file, call netload() instead of the external network boot image, and jump to loaded kernel at address 0, so that we can finally do a full network boot with the s390-ccw firmware now. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/Makefile | 2 +- pc-bios/

Re: [Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember

2017-06-27 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:53 PM CEST, Manos Pitsidianakis wrote: > This commit gathers ThrottleGroup membership details from > BlockBackendPublic into ThrottleGroupMember and refactors existing code > to use the structure. > > Signed-off-by: Manos Pitsidianakis Hey Manos, thanks for the patch. It

Re: [Qemu-devel] [PATCH 0/3] hw/core: minor fixups

2017-06-27 Thread Philippe Mathieu-Daudé
Hi Eduardo, On 06/23/2017 04:45 PM, Eduardo Habkost wrote: Do you have a simple way to trigger the error paths addressed by patches 1/3 and 2/3? For 1/3 "elf-loader: warn about invalid endianess": $ wget -q https://people.debian.org/~aurel32/qemu/mips/vmlinux-3.2.0-4-4kc-malta $ file vmlin

Re: [Qemu-devel] [RFC PATCH v9 00/26] translate: [tcg] Generic translation framework

2017-06-27 Thread Lluís Vilanova
Eric Blake writes: > On 06/25/2017 03:43 AM, Lluís Vilanova wrote: >> This series proposes a generic (target-agnostic) instruction translation >> framework. >> >> It basically provides a generic main loop for instruction disassembly, which >> calls target-specific functions when necessary. This g

Re: [Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember

2017-06-27 Thread Manos Pitsidianakis
On Tue, Jun 27, 2017 at 02:08:54PM +0200, Alberto Garcia wrote: On Fri 23 Jun 2017 02:46:53 PM CEST, Manos Pitsidianakis wrote: This commit gathers ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactors existing code to use the structure. Signed-off-by:

[Qemu-devel] [PATCH 3/4] block/qcow2: add lzo compression algorithm

2017-06-27 Thread Peter Lieven
Signed-off-by: Peter Lieven --- block/qcow2-cluster.c | 65 +++--- block/qcow2.c | 72 ++- block/qcow2.h | 1 + configure | 2 +- qemu-img.texi | 1 + 5 files changed, 95

[Qemu-devel] [PATCH 2/4] block/qcow2: optimize qcow2_co_pwritev_compressed

2017-06-27 Thread Peter Lieven
if we specify exactly one iov of s->cluster_size bytes we can avoid the bounce buffer. Signed-off-by: Peter Lieven --- block/qcow2.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 893b145..c91eb1f 100644 --- a/block/qcow2.c ++

[Qemu-devel] [PATCH 0/4] block/qcow2: add compression_algorithm create option

2017-06-27 Thread Peter Lieven
this adds a create option for QCOW2 images to specify the compression algorithm for compressed clusters. The series adds 3 algorithms to choose from: zlib (default), zlib-fast and lzo. zlib-fast optimizes the zlib parameters without the need for an additional compression library. lzo is choosen as

Re: [Qemu-devel] BUG: KASAN: use-after-free in free_old_xmit_skbs

2017-06-27 Thread Jean-Philippe Menil
On 06/27/2017 04:13 AM, Jason Wang wrote: On 2017年06月26日 15:35, Jean-Philippe Menil wrote: On 06/26/2017 04:50 AM, Jason Wang wrote: On 2017年06月24日 06:32, Cong Wang wrote: On Fri, Jun 23, 2017 at 1:43 AM, Jason Wang wrote: On 2017年06月23日 02:53, Michael S. Tsirkin wrote: On Thu, Jun 22,

[Qemu-devel] [PATCH 1/4] block/qcow2: add compression_algorithm create option

2017-06-27 Thread Peter Lieven
this patch adds a new compression_algorithm option when creating qcow2 images. The current default for the compresison algorithm is zlib and zlib will be used when this option is omitted (like before). If the option is specified e.g. with: qemu-img create -f qcow2 -o compression_algorithm=zlib i

[Qemu-devel] [PATCH 4/4] block/qcow2: add zlib-fast compression algorithm

2017-06-27 Thread Peter Lieven
this adds support for optimized zlib settings which almost tripples the compression speed while maintaining about the same compressed size. Signed-off-by: Peter Lieven --- block/qcow2-cluster.c | 3 ++- block/qcow2.c | 11 +-- block/qcow2.h | 1 + qemu-img.texi

Re: [Qemu-devel] [PATCH] ARM: KVM: Enable in-kernel timers with user space gic

2017-06-27 Thread Andrew Jones
On Mon, Jun 26, 2017 at 11:30:56PM +0200, Alexander Graf wrote: > When running with KVM enabled, you can choose between emulating the > gic in kernel or user space. If the kernel supports in-kernel virtualization > of the interrupt controller, it will default to that. If not, if will > default to u

Re: [Qemu-devel] [PATCH v2] main_loop: Make main_loop_wait() return void

2017-06-27 Thread Stefan Hajnoczi
On Mon, Jun 26, 2017 at 03:28:00PM +0100, Peter Maydell wrote: > In commit e330c118f2a5a the last usage of main_loop_wait() that cared > about the return value was changed to no longer use it. Drop the > now-useless return value and make the function return void. > > We avoid the awkwardness of if

Re: [Qemu-devel] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-27 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:54 PM CEST, Manos Pitsidianakis wrote: > timer_cb() needs to know about the current Aio context of the throttle > request that is woken up. In order to make ThrottleGroupMember backend > agnostic, this information is stored in an aio_context field instead of > accessing it

Re: [Qemu-devel] [PATCH RFC v2 2/2] ARM: KVM: Enable in-kernel timers with user space gic

2017-06-27 Thread Andrew Jones
On Mon, Jun 26, 2017 at 11:32:10PM +0200, Alexander Graf wrote: > On 06/26/2017 05:03 PM, Andrew Jones wrote: > > On Tue, Dec 13, 2016 at 01:20:50PM +, Peter Maydell wrote: > > > On 14 November 2016 at 14:32, Alexander Graf wrote: > > > > When running with KVM enabled, you can choose between e

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-27 Thread Stefan Hajnoczi
On Mon, Jun 26, 2017 at 07:01:18PM +0300, Manos Pitsidianakis wrote: > On Mon, Jun 26, 2017 at 03:30:55PM +0100, Stefan Hajnoczi wrote: > > > +static BlockDriver bdrv_throttle = { > > > +.format_name= "throttle", > > > +.protocol_name = "thro

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-27 Thread Stefan Hajnoczi
On Mon, Jun 26, 2017 at 07:26:41PM +0300, Manos Pitsidianakis wrote: > On Mon, Jun 26, 2017 at 03:30:55PM +0100, Stefan Hajnoczi wrote: > > > +bs->file = bdrv_open_child(NULL, options, "file", > > > +bs, &child_file, false, &local_err); > > > + > > > +if

Re: [Qemu-devel] [PATCH 1/4] block/qcow2: add compression_algorithm create option

2017-06-27 Thread Eric Blake
On 06/27/2017 07:34 AM, Peter Lieven wrote: > this patch adds a new compression_algorithm option when creating qcow2 images. > The current default for the compresison algorithm is zlib and zlib will be s/compresison/compression/ > used when this option is omitted (like before). > > If the option

Re: [Qemu-devel] [PATCH 16/19] block: protect modification of dirty bitmaps with a mutex

2017-06-27 Thread Paolo Bonzini
On 27/06/2017 11:47, Vladimir Sementsov-Ogievskiy wrote: > bdrv_enable_dirty_bitmap - writes to the list, it changes 'disabled' > field. So it requires both BQL and dirty_bitmap_mutex? But the comment > says only about BQL. This one is interesting. There could be a concurrent call to bdrv_set_d

Re: [Qemu-devel] [PATCH 4/4] block/qcow2: add zlib-fast compression algorithm

2017-06-27 Thread Eric Blake
On 06/27/2017 07:34 AM, Peter Lieven wrote: > this adds support for optimized zlib settings which almost Start sentences with a capital. > tripples the compression speed while maintaining about s/tripples/triples/ > the same compressed size. > > Signed-off-by: Peter Lieven > --- > block/qcow

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM

2017-06-27 Thread Stefan Hajnoczi
On Mon, Jun 26, 2017 at 06:24:09PM +0300, Manos Pitsidianakis wrote: > On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: > > > +static void throttle_group_set(Object *obj, Visitor *v, const char * > > > name, > > > +void *opaque, Error **errp) > > > + > > > +{ > > > +Thr

  1   2   3   4   >