[Qemu-devel] [PATCH v5 00/12] Add runnability info to query-cpu-definitions

2016-09-30 Thread Eduardo Habkost
This series extends query-cpu-definitions to include an extra field: "unavailable-features". The new field can be used to find out reasons that prevent the CPU model from running in the current host. This will return information based on the current machine and accelerator only. In the future we m

[Qemu-devel] [PATCH v5 06/12] target-i386: Remove underscores from feat_names arrays

2016-09-30 Thread Eduardo Habkost
Instead of translating the feature name entries when adding property names, store the actual property names in the feature name array. For reference, here is the full list of functions that use FeatureWordInfo::feat_names: * x86_cpu_get_migratable_flags(): not affected, as it just check for non

[Qemu-devel] [PATCH v5 03/12] target-i386: Disable VME by default with TCG

2016-09-30 Thread Eduardo Habkost
VME is already disabled automatically when using TCG. So, instead of pretending it is there when reporting CPU model data on query-cpu-* QMP commands (making every CPU model to be reported as not runnable), we can disable it by default on all CPU models when using TCG. Do that by adding a tcg_defa

[Qemu-devel] [PATCH v5 07/12] target-i386: Register properties for feature aliases manually

2016-09-30 Thread Eduardo Habkost
Instead of keeping the aliases inside the feature name arrays and require parsing the strings, just register alias properties manually. This simplifies the code for property registration and lookup. Signed-off-by: Eduardo Habkost --- Changes v4 -> v5: * Refresh after the previous patches were cha

[Qemu-devel] [PATCH v5 08/12] target-i386: xsave: Add FP and SSE bits to x86_ext_save_areas

2016-09-30 Thread Eduardo Habkost
Instead of treating the FP and SSE bits as special cases, add them to the x86_ext_save_areas array. This will simplify the code that calculates the supported xsave components and the size of the xsave area. Signed-off-by: Eduardo Habkost --- Changes series v3 -> v4: * New patch added to series --

[Qemu-devel] [PATCH v5 10/12] target-i386: x86_cpu_load_features() function

2016-09-30 Thread Eduardo Habkost
When probing for CPU model information, we need to reuse the code that initializes CPUID fields, but not the remaining side-effects of x86_cpu_realizefn(). Move that code to a separate function that can be reused later. Signed-off-by: Eduardo Habkost --- Changes v4 -> v5: * Fix typo on x86_cpu_lo

Re: [Qemu-devel] backup notifier fail policy

2016-09-30 Thread Vladimir Sementsov-Ogievskiy
On 30.09.2016 20:11, Vladimir Sementsov-Ogievskiy wrote: Hi all! Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing? I'm saying about this code:

[Qemu-devel] [PATCH v5 11/12] qmp: Add runnability information to query-cpu-definitions

2016-09-30 Thread Eduardo Habkost
Add a new optional field to query-cpu-definitions schema: "unavailable-features". It will contain a list of QOM properties that prevent the CPU model from running in the current host. Cc: David Hildenbrand Cc: Michael Mueller Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Jiri Denemark Cc: l

[Qemu-devel] [PATCH v5 12/12] target-i386: Return runnability information on query-cpu-definitions

2016-09-30 Thread Eduardo Habkost
Fill the "unavailable-features" field on the x86 implementation of query-cpu-definitions. Cc: Jiri Denemark Cc: libvir-l...@redhat.com Signed-off-by: Eduardo Habkost --- Changes v3 -> v4: * Handle missing XSAVE components cleanly, but looking up the original feature that required it * Use x86_

Re: [Qemu-devel] [RFC] Tracing guest register usage

2016-09-30 Thread Richard Henderson
On 09/30/2016 08:13 AM, Lluís Vilanova wrote: (2) an internal state change to DisasContext, reflected in INDEX_op_insn_start, with no changes to any TCG registers. So you'll not actually be tracking eflags at all. I don't follow what you mean. AFAIK INDEX_op_insn_start does not change the gues

Re: [Qemu-devel] [PATCH v14 00/21] QAPI/QOM work for non-scalar object properties

2016-09-30 Thread Eric Blake
On 09/30/2016 10:45 AM, no-re...@ec2-52-6-146-230.compute-1.amazonaws.com wrote: > Hi, > > Your series failed automatic build test. Please find the testing commands and > their output below. If you have docker installed, you can probably reproduce > it > locally. > > CCqapi/string-output-

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-30 Thread Michael S. Tsirkin
On Fri, Sep 30, 2016 at 02:05:10PM +0200, Maxime Coquelin wrote: > > > On 09/29/2016 11:23 PM, Maxime Coquelin wrote: > > > > > > On 09/29/2016 10:21 PM, Michael S. Tsirkin wrote: > > > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > > > > > > > On 09/29/2016 07:5

Re: [Qemu-devel] [PATCH v4 03/12] block/nbd: Default port in nbd_refresh_filename()

2016-09-30 Thread Eric Blake
On 09/28/2016 03:55 PM, Max Reitz wrote: > Instead of not emitting the port in nbd_refresh_filename(), just set it > to the default if the user did not specify it. This makes the logic a > bit simpler. > > Signed-off-by: Max Reitz > --- > block/nbd.c | 19 ++- > 1 file changed, 6

[Qemu-devel] [PATCH v2 2/4] fdc: Add a floppy drive qdev

2016-09-30 Thread Kevin Wolf
Floppy controllers automatically create two floppy drive devices in qdev now. (They always created two drives, but managed them only internally.) Signed-off-by: Kevin Wolf --- hw/block/fdc.c | 151 + 1 file changed, 120 insertions(+), 31 de

[Qemu-devel] [PATCH v2 0/4] fdc: Use separate qdev device for drives

2016-09-30 Thread Kevin Wolf
We have been complaining for a long time about how the floppy controller and floppy drives are combined in a single qdev device and how this makes the device awkward to work with because it behaves different from all other block devices. The latest reason to complain was when I noticed that using

[Qemu-devel] [PATCH v2 1/4] fdc: Add a floppy qbus

2016-09-30 Thread Kevin Wolf
This adds a qbus to the floppy controller that should contain the floppy drives eventually. At the moment it just exists and is empty. Signed-off-by: Kevin Wolf --- hw/block/fdc.c | 40 +++- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/hw/blo

[Qemu-devel] [PATCH v2 3/4] fdc: Move qdev properties to FloppyDrive

2016-09-30 Thread Kevin Wolf
This makes the FloppyDrive qdev object actually useful: Now that it has all properties that don't belong to the controller, you can actually use '-device floppy' and get a working result. Command line semantics is consistent with CD-ROM drives: By default you get a single empty floppy drive. You c

[Qemu-devel] [PATCH v2 4/4] qemu-iotests: Test creating floppy drives

2016-09-30 Thread Kevin Wolf
This tests the different supported methods to create floppy drives and how they interact. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/172 | 242 + tests/qemu-iotests/172.out | 1205 tests/qemu-iotests/group |1 + 3 files change

Re: [Qemu-devel] [PATCH v14 11/21] qapi: add integer range support for QObjectInputVisitor

2016-09-30 Thread Eric Blake
On 09/30/2016 09:45 AM, Daniel P. Berrange wrote: > The traditional CLI arg syntax allows two ways to specify > integer lists, either one value per key, or a range of > values per key. eg the following are identical: > > -arg foo=5,foo=6,foo=7 > -arg foo=5-7 > > This extends the QObjectInputV

Re: [Qemu-devel] [libvirt] [PATCH v5 04/12] target-i386: Register aliases for feature names with underscores

2016-09-30 Thread Eric Blake
On 09/30/2016 01:49 PM, Eduardo Habkost wrote: > Registering the actual names containing underscores as aliases > will allow management software to be aware that the old > compatibility names are suported, and will make feat2prop() calls s/suported/supported/ > unnecessary when using feature name

Re: [Qemu-devel] [PATCH v14 12/21] option: allow qemu_opts_to_qdict to merge repeated options

2016-09-30 Thread Eric Blake
On 09/30/2016 09:45 AM, Daniel P. Berrange wrote: > If given an option string such as > > size=1024,nodes=10,nodes=4-5,nodes=1-2,policy=bind > > the qemu_opts_to_qdict() method will currently overwrite > the values for repeated option keys, so only the last > value is in the returned dict: > >

Re: [Qemu-devel] [libvirt] [PATCH v5 04/12] target-i386: Register aliases for feature names with underscores

2016-09-30 Thread Eduardo Habkost
On Fri, Sep 30, 2016 at 02:56:42PM -0500, Eric Blake wrote: > On 09/30/2016 01:49 PM, Eduardo Habkost wrote: > > Registering the actual names containing underscores as aliases > > will allow management software to be aware that the old > > compatibility names are suported, and will make feat2prop()

Re: [Qemu-devel] [PATCH v4 01/11] tests: Add test case for x86 feature parsing compatibility

2016-09-30 Thread Paolo Bonzini
On 30/09/2016 20:33, Eduardo Habkost wrote: > On Fri, Sep 30, 2016 at 09:55:33AM +0200, Paolo Bonzini wrote: >> >> >> On 29/09/2016 23:14, Eduardo Habkost wrote: >>> + * "-foo" overrides "+foo" >>> + * "[+-]foo" overrides "foo=..." >> >> Is this something that people are actually using?

[Qemu-devel] [PATCH v3 04/15] tcg/optimize: move default return out of if statement

2016-09-30 Thread Alex Bennée
This is to appease sanitizer builds which complain that: "error: control reaches end of non-void function" Signed-off-by: Alex Bennée Reviewed-by: Marc-André Lureau --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index

[Qemu-devel] [PATCH v3 06/15] qom/object: update class cache atomically

2016-09-30 Thread Alex Bennée
The idiom CPU_GET_CLASS(cpu) is fairly extensively used in various threads and trips of ThreadSanitizer due to the fact it updates obj->class->object_cast_cache behind the scenes. As this is just a fast-path cache there is no need to lock updates. However to ensure defined C11 behaviour across thr

[Qemu-devel] [PATCH v3 10/15] linux-user/syscall: extend lock around cpu-list

2016-09-30 Thread Alex Bennée
There is a potential race if several threads exit at once. To serialise the exits extend the lock above the initial checking of the CPU list. Signed-off-by: Alex Bennée --- linux-user/syscall.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux

[Qemu-devel] [PATCH v3 01/15] atomic.h: fix __SANITIZE_THREAD__ build

2016-09-30 Thread Alex Bennée
Only very modern GCC's actually set this define when building with the ThreadSanitizer so this little typo slipped though. Signed-off-by: Alex Bennée --- include/qemu/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index

[Qemu-devel] [PATCH v3 15/15] translate-all: mark updates to PageDesc as atomic

2016-09-30 Thread Alex Bennée
Updates to the internal page table are protected by the mmap_lock. However for defined C11 semantics things that are access across threads need to accessed using at least relaxed atomics. Signed-off-by: Alex Bennée --- translate-all.c | 67 +---

[Qemu-devel] [PATCH v3 08/15] cpu: atomically modify cpu->exit_request

2016-09-30 Thread Alex Bennée
ThreadSanitizer picks up potential races although we already use barriers to ensure things are in the correct order when processing exit requests. For true C11 defined behaviour across threads we need to use relaxed atomic_set/atomic_read semantics to reassure tsan. Signed-off-by: Alex Bennée ---

[Qemu-devel] [PATCH v3 03/15] exec-all.h: revert tb_page_addr_t to target_ulong

2016-09-30 Thread Alex Bennée
Commit b480d9b74 converted tb_page_addr_t to abi_ulong which while the right size imposes additional alignment restrictions on the type. This gets in the way of using atomic accesses on certain guest platforms which allow finer alignments. As tb_page_addr_t isn't actually visible to the guest we ca

[Qemu-devel] [PATCH v3 00/15] A number of fixes for ThreadSanitizer

2016-09-30 Thread Alex Bennée
Hi, This is v3 of the ThreadSanitizer fixes. Changes from the last version: - added some more review tags - made clear C11 undefined behaviour is the main issue - added two minor fixes to atomic.h - change type of tb_page_addr_t back to target_ulong - dropped ui/vnc-enc-tight patch (alr

[Qemu-devel] [PATCH v3 09/15] util/qht: atomically set b->hashes

2016-09-30 Thread Alex Bennée
ThreadSanitizer detects a possible race between reading/writing the hashes. The ordering semantics are already documented for QHT however for true C11 compliance we should use relaxed atomic primitives for accesses that are done across threads. On x86 this slightly changes to the code to not do a l

[Qemu-devel] [PATCH v3 02/15] atomic.h: comment on use of atomic_read/set

2016-09-30 Thread Alex Bennée
Add some notes on the use of the relaxed atomic access helpers and their importance for defined behaviour in C11's multi-threaded memory model. Signed-off-by: Alex Bennée --- include/qemu/atomic.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/qemu/atomic.h b/include/qemu/atom

[Qemu-devel] [PATCH v3 07/15] qom/cpu: atomically clear the tb_jmp_cache

2016-09-30 Thread Alex Bennée
The ThreadSanitizer rightly complains that something initialised with a normal access is later updated and read atomically. Signed-off-by: Alex Bennée --- qom/cpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qom/cpu.c b/qom/cpu.c index 484c493..ef905da 100644 --- a/

Re: [Qemu-devel] [PATCH v2 0/9] A couple of fixes for ThreadSanitizer

2016-09-30 Thread Alex Bennée
Paolo Bonzini writes: > On 22/09/2016 12:13, Alex Bennée wrote: >> Hi, >> > > Queued patches 2-8 (1 is already in and 9 is outside my knowledge), thanks. Actually could you take them from the v3 I've just posted? I've cleaned up a bunch of the commit messages and dropped the blacklist patch.

[Qemu-devel] [PATCH v3 11/15] qga/command: use QEMU atomic primitives

2016-09-30 Thread Alex Bennée
The guest client's use of the glib's g_atomic primitives causes newer GCC's to barf when built on Travis. As QEMU has its own primitives with well understood semantics we might as well use them. The use of atomics was a little inconsistent so I've also ensure the values are correctly set with atom

[Qemu-devel] [PATCH v3 05/15] seqlock: use atomic writes for the sequence

2016-09-30 Thread Alex Bennée
From: Paolo Bonzini There is a data race if the sequence is written concurrently to the read. In C11 this has undefined behavior. Use atomic_set; the read side is already using atomic_read. Reported-by: Alex Bennée Signed-off-by: Paolo Bonzini Signed-off-by: Alex Bennée --- include/qemu/se

[Qemu-devel] [PATCH v3 12/15] .travis.yml: add gcc sanitizer build

2016-09-30 Thread Alex Bennée
As it seems easy to break the ThreadSanitizer build we should defend it to ensure that fixes get applied when it breaks. We use the Ubuntu GCC PPA to get the latest GCC goodness. As we need to use the -fuse-ld=gold work around we have to disable the linux-user targets as these trip up the linker.

[Qemu-devel] [PATCH v3 13/15] tcg: ensure cpu_tb_exec/tb_gen_code use atomic_read/write

2016-09-30 Thread Alex Bennée
To meet C11 semantics for shared data access we need to use relaxed atomic accesses. While the completion of data writes w.r.t reads is ensured by QHT's explicit barriers when a newly generated TB is inserted ThreadSanitizer will still complain. By using the relaxed accesses the same code gets gene

[Qemu-devel] [PATCH v3 14/15] tcg: update remaining TranslationBuffer fields atomically

2016-09-30 Thread Alex Bennée
The TranslationBuffer is one of those heavily accessed across threads. To meet defined C11 behaviour across threads we update the accesses to use the relaxed atomic helpers. Care is still taken with locking and barriers for when flags are updated and when newly generated buffers are made visible to

Re: [Qemu-devel] [PATCH 0/3] tareget-arm: Handle tagged addresses when loading PC

2016-09-30 Thread Tom Hanson
On 09/29/2016 07:37 PM, Peter Maydell wrote: On 16 September 2016 at 10:34, Thomas Hanson wrote: If tagged addresses are enabled, then addresses being loaded into the PC must be cleaned up by overwriting the tag bits with either all 0's or all 1's as specified in the ARM ARM spec

Re: [Qemu-devel] [PATCH v3 00/15] A number of fixes for ThreadSanitizer

2016-09-30 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20160930213106.20186-1-alex.ben...@linaro.org Subject: [Qemu-devel] [PATCH v3 00/15] A number of fixes for ThreadSanitizer === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=

[Qemu-devel] [PATCH v2 01/11] blockjob: fix dead pointer in txn list

2016-09-30 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Though it is not intended to be reached through normal circumstances, if we do not gracefully deconstruct the transaction QLIST, we may wind up with stale pointers in the list. The rest of this series attempts to address the underlying issues, but this should f

[Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-09-30 Thread John Snow
There's no reason to leave this to blockdev; we can do it in blockjobs directly and get rid of an extra callback for most users. Signed-off-by: John Snow --- blockdev.c | 37 ++--- blockjob.c | 16 ++-- 2 files changed, 20 insertions(+), 33 deletions(-

[Qemu-devel] [PATCH v2 09/11] blockjob: add block_job_start

2016-09-30 Thread John Snow
Instead of automatically starting jobs at creation time via backup_start et al, we'd like to return a job object pointer that can be started manually at later point in time. For now, add the block_job_start mechanism and start the jobs automatically as we have been doing, with conversions job-by-j

[Qemu-devel] [PATCH v2 11/11] iotests: add transactional failure race test

2016-09-30 Thread John Snow
Add a regression test for the case found by Vladimir. Reported-by: Vladimir Sementsov-Ogievskiy Signed-off-by: John Snow --- tests/qemu-iotests/124 | 91 ++ tests/qemu-iotests/124.out | 4 +- 2 files changed, 93 insertions(+), 2 deletions(-) dif

[Qemu-devel] [PATCH v2 03/11] Blockjobs: Internalize user_pause logic

2016-09-30 Thread John Snow
BlockJobs will begin hiding their state in preparation for some refactorings anyway, so let's internalize the user_pause mechanism instead of leaving it to callers to correctly manage. Signed-off-by: John Snow --- block/io.c | 2 +- blockdev.c | 10 -- blockj

Re: [Qemu-devel] [PATCH 0/3] tareget-arm: Handle tagged addresses when loading PC

2016-09-30 Thread Peter Maydell
On 30 September 2016 at 14:48, Tom Hanson wrote: > On 09/29/2016 07:37 PM, Peter Maydell wrote: >> >> On 16 September 2016 at 10:34, Thomas Hanson >> wrote: >>> >>> If tagged addresses are enabled, then addresses being loaded into >>> the >>> PC must be cleaned up by overwriting the tag

[Qemu-devel] [PATCH v2 00/11] blockjobs: Fix transactional race condition

2016-09-30 Thread John Snow
There are a few problems with transactional job completion right now. First, if jobs complete so quickly they complete before remaining jobs get a chance to join the transaction, the completion mode can leave well known state and the QLIST can get corrupted and the transactional jobs can complete

[Qemu-devel] [PATCH v2 04/11] blockjobs: Always use block_job_get_aio_context

2016-09-30 Thread John Snow
There are a few places where we're fishing it out for ourselves. Let's not do that and instead use the helper. Signed-off-by: John Snow --- block/io.c | 4 ++-- blockdev.c | 4 ++-- blockjob.c | 2 +- include/block/blockjob.h | 9 + qemu-img.c

[Qemu-devel] [PATCH v2 06/11] blockjobs: fix documentation

2016-09-30 Thread John Snow
Wrong function names in documentation. Signed-off-by: John Snow --- include/block/blockjob_int.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 0a2d41e..c6da7e4 100644 --- a/include/block/blockjob_int.h

[Qemu-devel] [PATCH] fixup! tcg: ensure cpu_tb_exec/tb_gen_code use atomic_read/write

2016-09-30 Thread Alex Bennée
--- cpu-exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu-exec.c b/cpu-exec.c index 0e6b3d3..8b8be25 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -291,7 +291,8 @@ static inline TranslationBlock *tb_find(CPUState *cpu, is executed. */ cpu_get_tb_cpu_state(

<    1   2   3   4