[Qemu-devel] [PATCH v12 00/27] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-07-13 Thread Peter Xu
This is v12 for Intel IR. Rebased to lastest master, with some tiny tweaks from v11. Please check changelog below. Michael, please choose either v11 or v12 if we are going to merge it. v12 is preferred though. Thanks! Online repo: https://github.com/xzpeter/qemu vtd-intr-v12 v12 changes

Re: [Qemu-devel] [RFC 02/13] migration: Allow the migrate command to work on file: urls

2016-07-13 Thread Hailiang Zhang
On 2016/7/14 0:12, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: Usage: (qemu) migrate file:/path/to/vm_statefile Signed-off-by: zhanghailiang Signed-off-by: Benoit Canet --- - With this patch, we

Re: [Qemu-devel] [RFC 1/6] target-ppc: Introduce Power9 family

2016-07-13 Thread Bharata B Rao
On Tue, Jul 12, 2016 at 11:33 PM, Nikunj A Dadhania wrote: > From: "Aneesh Kumar K.V" > > Signed-off-by: Aneesh Kumar K.V > [ rebased and added POWER9 alias ] > Signed-off-by: Nikunj A Dadhania

Re: [Qemu-devel] [PATCH v11 14/28] intel_iommu: Add support for PCI MSI remap

2016-07-13 Thread Peter Xu
On Wed, Jul 13, 2016 at 04:17:01PM +0300, David Kiarie wrote: [...] > > +static MemTxResult vtd_mem_ir_read(void *opaque, hwaddr addr, > > + uint64_t *data, unsigned size, > > + MemTxAttrs attrs) > > +{ > > +addr +=

Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: exit if compat mode is unknown

2016-07-13 Thread Greg Kurz
On Thu, 14 Jul 2016 12:05:42 +1000 David Gibson wrote: > On Wed, Jul 13, 2016 at 02:34:32PM +0200, Greg Kurz wrote: > > On Wed, 13 Jul 2016 11:10:21 +0200 > > Greg Kurz wrote: > > > > > Now that properties are set with -global, if we pass a bogus

[Qemu-devel] [PATCH v11 8/9] target-avr: instruction decoder generator

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/cpugen/CMakeLists.txt | 38 +++ target-avr/cpugen/README.md| 17 ++ target-avr/cpugen/cpu/avr.yaml | 214 ++ target-avr/cpugen/src/CMakeLists.txt | 63

[Qemu-devel] [PATCH v11 7/9] target-avr: adding instruction translation

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/Makefile.objs|2 +- target-avr/translate-inst.c | 2622 +++ target-avr/translate.h |1 + 3 files changed, 2624 insertions(+), 1 deletion(-) create mode 100644

[Qemu-devel] [PATCH v11 6/9] target-avr: adding helpers for IN, OUT, SLEEP, WBR & unsupported instructions

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/cpu.h | 13 ++- target-avr/helper.c| 284 ++--- target-avr/helper.h| 8 +- target-avr/translate.c | 9 ++ 4 files changed, 299 insertions(+), 15 deletions(-) diff --git

[Qemu-devel] [PATCH v11 3/9] target-avr: adding a sample AVR board

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- MAINTAINERS | 6 ++ hw/avr/Makefile.objs | 21 ++ hw/avr/sample-io.c | 176 +++ hw/avr/sample.c | 137 +++ 4 files changed, 340

[Qemu-devel] [PATCH v11 1/9] target-avr: AVR cores support is added.

2016-07-13 Thread Michael Rolnik
1. basic CPU structure 2. registers 3. no instructions 4. saving sreg, rampD, rampX, rampY, rampD, eind in HW representation Signed-off-by: Michael Rolnik --- arch_init.c | 2 + configure | 5 +

[Qemu-devel] [PATCH] qemu-img: add the 'dd' subcommand

2016-07-13 Thread Reda Sallahi
This patch adds a basic dd subcommand analogous to dd(1) to qemu-img. For the start, this implements the bs, if, of and count options and requires both if and of to be specified (no stdin/stdout if not specified) and doesn't support tty, pipes, etc. The image format must be specified with -O for

[Qemu-devel] [PATCH v11 9/9] target-avr: adding instruction decoder

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/Makefile.objs | 1 + target-avr/decode.c | 693 +++ target-avr/helper.c | 2 + target-avr/helper.h | 1 + target-avr/translate.c | 12 - 5 files changed, 697

[Qemu-devel] [PATCH v11 2/9] target-avr: adding AVR CPU features/flavors

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/cpu.c | 313 ++- target-avr/cpu.h | 48 target-avr/machine.c | 1 + 3 files changed, 361 insertions(+), 1 deletion(-) diff --git a/target-avr/cpu.c

[Qemu-devel] [PATCH v11 5/9] target-avr: adding AVR interrupt handling

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/helper.c | 59 - 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/target-avr/helper.c b/target-avr/helper.c index ffc9378..3e61193 100644 --- a/target-avr/helper.c +++

[Qemu-devel] [PATCH v11 4/9] target-avr: adding instructions encodings

2016-07-13 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/translate-inst.h | 805 1 file changed, 805 insertions(+) create mode 100644 target-avr/translate-inst.h diff --git a/target-avr/translate-inst.h b/target-avr/translate-inst.h new file

[Qemu-devel] [PATCH v11 0/9] 8bit AVR cores

2016-07-13 Thread Michael Rolnik
This series of patches adds 8bit AVR cores to QEMU. All instruction, except BREAK/DES/SPM/SPMX, are implemented. Not fully tested yet. However I was able to execute simple code with functions. e.g fibonacci calculation. This series of patches include a non real, sample board. No fuses support

Re: [Qemu-devel] [PATCH v7 4/7] qom: support arbitrary non-scalar properties with -object

2016-07-13 Thread Eric Blake
On 07/05/2016 07:11 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

[Qemu-devel] [PATCH v9 12/17] qapi: Change Netdev into a flat union

2016-07-13 Thread Eric Blake
This is a mostly-mechanical conversion that creates a new flat union 'Netdev' QAPI type that covers all the branches of the former 'NetClientOptions' simple union, where the branches are now listed in a new 'NetClientDriver' enum rather than generated from the simple union. The existence of a

[Qemu-devel] [PATCH v9 15/17] option: make parse_option_bool/number non-static

2016-07-13 Thread Eric Blake
From: "Daniel P. Berrange" The opts-visitor.c opts_type_bool() method has code for parsing a string to set a bool value, as does the qemu-option.c parse_option_bool() method, except it handles fewer cases. To enable consistency across the codebase, extend

[Qemu-devel] [PATCH v9 17/17] qapi: Restore autocast behavior in 'netdev_add'

2016-07-13 Thread Eric Blake
When we converted 'netdev_add' to a fully-introspectible QMP, we temporarily lost the ability to parse strings in place of integers, the way the old QemuOpts code had done. But now that we have autocast, we can restore that behavior, by adding a new 'autocast':true marker in QAPI. Signed-off-by:

[Qemu-devel] [PATCH v9 11/17] block: Simplify drive-mirror

2016-07-13 Thread Eric Blake
Now that we can support boxed commands, use it to greatly reduce the number of parameters (and likelihood of getting out of sync) when adjusting drive-mirror parameters. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v9: s/box/boxed/, trivial enough

[Qemu-devel] [PATCH v9 16/17] qapi: Tweak QmpInputVisitor to optionally do string conversion

2016-07-13 Thread Eric Blake
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 adds an alternative mode where a QString can also be parsed in place of the native type, by adding a parameter and

[Qemu-devel] [PATCH v9 13/17] net: Use correct type for bool flag

2016-07-13 Thread Eric Blake
is_netdev is only used as a bool, so make it one. Signed-off-by: Eric Blake --- v9: no change v8: no change v7: no change v6: rebase to latest context --- include/net/net.h| 2 +- hw/usb/dev-network.c | 2 +- net/net.c| 12 ++-- 3 files changed, 8

[Qemu-devel] [PATCH v9 06/17] qapi: Drop useless gen_err_check()

2016-07-13 Thread Eric Blake
Ever since commit 12f254f removed the last parameterization of gen_err_check(), it no longer makes sense to hide the three lines of generated C code behind a macro call. Just inline it into the remaining users. No change to generated code. Signed-off-by: Eric Blake --- v9:

[Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generator lower levels

2016-07-13 Thread Eric Blake
The next patch will add support for passing a qapi union type as the 'data' of a command. But to do that, the user function for implementing the command, as called by the generated marshal command, must take the corresponding C struct as a single boxed pointer, rather than a breakdown into one

[Qemu-devel] [PATCH v9 10/17] block: Simplify block_set_io_throttle

2016-07-13 Thread Eric Blake
Now that we can support boxed commands, use it to greatly reduce the number of parameters (and likelihood of getting out of sync) when adjusting throttle parameters. Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia --- v9: s/box/boxed/, trivial enough

[Qemu-devel] [PATCH v9 14/17] net: Complete qapi-fication of netdev_add

2016-07-13 Thread Eric Blake
We finally have all the required pieces for doing a type-safe representation of netdev_add as a flat union, where the discriminator 'type' now selects which additional members may appear in the "arguments" JSON object sent over QMP, and exposes those types through introspection, and without

[Qemu-devel] [PATCH v9 09/17] qapi: Implement boxed types for commands/events

2016-07-13 Thread Eric Blake
Turn on the ability to pass command and event arguments in a single boxed parameter, which must name a non-empty type (although the type can be a struct with all optional members). For structs, it makes it possible to pass a single qapi type instead of a breakout of all struct members (useful if

[Qemu-devel] [PATCH v9 07/17] qapi-event: Simplify visit of non-implicit data

2016-07-13 Thread Eric Blake
Commit 7ce106a9 documented why we don't generated a visit_type_FOO() for implicit types; and therefore events with an anonymous type for 'data' have to open-code a visit. Note that the open-coded visit in qapi-event.c is slightly different from what is done in qapi-visit.c for normal types, in

[Qemu-devel] [PATCH v9 04/17] qapi: Hide tag_name data member of variants

2016-07-13 Thread Eric Blake
Clean up the only remaining external use of the tag_name field of QAPISchemaObjectTypeVariants, by explicitly listing the generated 'type' tag for all variants in the testsuite (you can still tell simple unions by the -wrapper types). Then we can mark the tag_name field as private by adding a

[Qemu-devel] [PATCH for-2.7 v9 00/17] qapi netdev_add introspection (post-introspection cleanups subset F)

2016-07-13 Thread Eric Blake
It's time to expose QMP 'netdev_add' through introspection, and to add boxed commands/events so that we can drastically reduce the number of C parameters needed to implement a command that matches a large QAPI type. Prerequistes: Markus' qapi-next branch (weak; series also applies on master)

[Qemu-devel] [PATCH v9 01/17] net: use Netdev instead of NetClientOptions in client init

2016-07-13 Thread Eric Blake
From: Kővágó, Zoltán This way we no longer need NetClientOptions and can convert Netdev into a flat union. Signed-off-by: Kővágó, Zoltán Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PATCH v9 05/17] qapi: Add type.is_empty() helper

2016-07-13 Thread Eric Blake
In the near future, we want to lift our artificial restriction of no variants at the top level of an event, at which point the currently open-coded check for empty members will become insufficient. Factor it out into a new helper method is_empty() now, and future-proof it by checking variants,

[Qemu-devel] [PATCH v9 02/17] qapi: Require all branches of flat union enum to be covered

2016-07-13 Thread Eric Blake
We were previously enforcing that all flat union branches were found in the corresponding enum, but not that all enum values were covered by branches. The resulting generated code would abort() if the user passes the uncovered enum value. We don't automatically treat non-present branches in a

[Qemu-devel] [PATCH v9 03/17] qapi: Special case c_name() for empty type

2016-07-13 Thread Eric Blake
Commit 7ce106a rendered QAPISchemaObjectType.c_name() redundant, since it now does nothing more than delegate to its superclass. However, rather than deleting it, we can restore part of the assertion that was removed in that commit, to prove that we never emit the empty type directly in generated

Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: exit if compat mode is unknown

2016-07-13 Thread David Gibson
On Wed, Jul 13, 2016 at 02:34:32PM +0200, Greg Kurz wrote: > On Wed, 13 Jul 2016 11:10:21 +0200 > Greg Kurz wrote: > > > Now that properties are set with -global, if we pass a bogus value for > > compat mode, a warning is printed and the property is simply ignored. > > For

Re: [Qemu-devel] [PATCH] ppc: abort if compat property contains an unknown value

2016-07-13 Thread David Gibson
On Wed, Jul 13, 2016 at 12:00:17PM +0200, Greg Kurz wrote: > It is not possible to set the compat property to an unknown value with > powerpc_set_compat(). Something must have gone terribly wrong in QEMU, > if we detect an "Internal error" in powerpc_get_compat(). Let's abort then. > > This patch

Re: [Qemu-devel] [PATCH] vl: exit if a bad property value is passed to -global

2016-07-13 Thread David Gibson
On Wed, Jul 13, 2016 at 08:05:03PM +0200, Greg Kurz wrote: > When passing '-global driver=host-powerpc64-cpu,property=compat,value=foo' > on the command line, without this patch, we get the following warning per > device (which means many lines if the guests has many cpus): > > qemu-system-ppc64:

Re: [Qemu-devel] [PATCH v7 3/7] qapi: add a QmpInputVisitor that does string conversion

2016-07-13 Thread Eric Blake
On 07/05/2016 07:11 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 adds an alternative constructor for QmpInputVisitor >

Re: [Qemu-devel] [PATCH v7 2/7] option: make parse_option_bool/number non-static

2016-07-13 Thread Eric Blake
On 07/05/2016 07:11 AM, Daniel P. Berrange wrote: > The opts-visitor.c opts_type_bool() method has code for > parsing a string to set a bool value, as does the > qemu-option.c parse_option_bool() method, except it > handles fewer cases. > > To enable consistency across the codebase, extend >

Re: [Qemu-devel] [PATCH 1/1] spapr: Ensure CPU cores are added contiguously and removed in LIFO order

2016-07-13 Thread David Gibson
On Wed, Jul 13, 2016 at 12:20:20PM +0530, Bharata B Rao wrote: > If CPU core addition or removal is allowed in random order leading to > holes in the core id range (and hence in the cpu_index range), migration > can fail as migration with holes in cpu_index range isn't yet handled > correctly. >

Re: [Qemu-devel] [PATCH v3 10/19] pc: register created initial and hotpluged CPUs in one place pc_cpu_plug()

2016-07-13 Thread Bandan Das
Eduardo Habkost writes: > On Wed, Jul 13, 2016 at 06:59:21PM -0400, Bandan Das wrote: >> Eduardo Habkost writes: >> >> > On Wed, Jul 13, 2016 at 06:32:27PM -0400, Bandan Das wrote: >> >> Igor Mammedov writes: >> >> >> >> >

[Qemu-devel] [PATCH v9 8/8] docs: Add a generic loader explanation document

2016-07-13 Thread Alistair Francis
Signed-off-by: Alistair Francis --- V9: - Clarify the image loading options V8: - Improve documentation V6: - Fixup documentation V4: - Re-write to be more comprehensive docs/generic-loader.txt | 63 + 1 file

[Qemu-devel] [PATCH v9 4/8] loader: Add AddressSpace loading support to ELFs

2016-07-13 Thread Alistair Francis
Add a new function load_elf_as() that allows the caller to specify an AddressSpace to use when loading the ELF. The original load_elf() function doesn't have any change in functionality. Signed-off-by: Alistair Francis --- V8: - Introduce an RFC version of

Re: [Qemu-devel] [PATCH v3 12/19] apic: move MAX_APICS check to 'apic' class

2016-07-13 Thread Bandan Das
Eduardo Habkost writes: > On Wed, Jul 13, 2016 at 06:47:20PM -0400, Bandan Das wrote: >> Igor Mammedov writes: >> >> > MAX_APICS is only used by child 'apic' class and not >> > by its parent TYPE_APIC_COMMON or any other derived >> > class. >> > Move

[Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support to targphys

2016-07-13 Thread Alistair Francis
Add a new function load_image_targphys_as() that allows the caller to specify an AddressSpace to use when loading a targphys. The original load_image_targphys() function doesn't have any change in functionality. Signed-off-by: Alistair Francis --- hw/core/loader.c

[Qemu-devel] [PATCH v9 7/8] generic-loader: Add a generic loader

2016-07-13 Thread Alistair Francis
Add a generic loader to QEMU which can be used to load images or set memory values. Signed-off-by: Alistair Francis --- V9: - Fix error messages - Updated some incorrect logic - Add address space loading support for all image types - Explain why the reset is

[Qemu-devel] [PATCH v9 3/8] loader: Allow a custom AddressSpace when loading ROMs

2016-07-13 Thread Alistair Francis
When loading ROMs allow the caller to specify an AddressSpace to use for the load. Signed-off-by: Alistair Francis --- V9: - Fixup the ROM ordering - Don't allow address space and memory region to be specified V8: - Introduce an RFC version of AddressSpace loading

[Qemu-devel] [PATCH v9 5/8] loader: Add AddressSpace loading support to uImages

2016-07-13 Thread Alistair Francis
Add a new function load_uimage_as() that allows the caller to specify an AddressSpace to use when loading the uImage. The original load_uimage() function doesn't have any change in functionality. Signed-off-by: Alistair Francis --- hw/core/loader.c| 17

[Qemu-devel] [PATCH v9 2/8] loader: Use the specified MemoryRegion

2016-07-13 Thread Alistair Francis
Prevously the specified MemoryRegion was ignored during the rom register reset. This patch uses the rom MemoryRegion is avaliable. Signed-off-by: Alistair Francis --- hw/core/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [PATCH v9 0/8] Add a generic loader

2016-07-13 Thread Alistair Francis
This work is based on the original work by Li Guang with extra features added by Peter C and myself. The idea of this loader is to allow the user to load multiple images or values into QEMU at startup. Memory values can be loaded like this: -device

[Qemu-devel] [PATCH v9 1/8] loader: Allow ELF loader to auto-detect the ELF arch

2016-07-13 Thread Alistair Francis
If the caller didn't specify an architecture for the ELF machine the load_elf() function will auto detect it based on the ELF file. Signed-off-by: Alistair Francis --- V9: - Update documentation V8: - Move into load_elf64/load_elf32 V7: - Fix typo

Re: [Qemu-devel] [PATCH v3 12/19] apic: move MAX_APICS check to 'apic' class

2016-07-13 Thread Eduardo Habkost
On Wed, Jul 13, 2016 at 06:47:20PM -0400, Bandan Das wrote: > Igor Mammedov writes: > > > MAX_APICS is only used by child 'apic' class and not > > by its parent TYPE_APIC_COMMON or any other derived > > class. > > Move check into end user 'apic' class so it won't > > get in

Re: [Qemu-devel] [PATCH v3 10/19] pc: register created initial and hotpluged CPUs in one place pc_cpu_plug()

2016-07-13 Thread Eduardo Habkost
On Wed, Jul 13, 2016 at 06:59:21PM -0400, Bandan Das wrote: > Eduardo Habkost writes: > > > On Wed, Jul 13, 2016 at 06:32:27PM -0400, Bandan Das wrote: > >> Igor Mammedov writes: > >> > >> > consolidate possible_cpus array management in pc_cpu_plug() >

Re: [Qemu-devel] [PATCH v3 10/19] pc: register created initial and hotpluged CPUs in one place pc_cpu_plug()

2016-07-13 Thread Bandan Das
Eduardo Habkost writes: > On Wed, Jul 13, 2016 at 06:32:27PM -0400, Bandan Das wrote: >> Igor Mammedov writes: >> >> > consolidate possible_cpus array management in pc_cpu_plug() >> > for smp_cpus, coldplugged with -device and hotplugged with >> >

Re: [Qemu-devel] [PATCH v3 07/19] pc: set APIC ID based on socket/core/thread ids if it's not been set yet

2016-07-13 Thread Bandan Das
Eduardo Habkost writes: > On Wed, Jul 13, 2016 at 06:24:17PM -0400, Bandan Das wrote: >> Igor Mammedov writes: >> >> > CPU added with device_add help won't have APIC ID set, >> > so set it according to socket/core/thread ids provided >> > with

Re: [Qemu-devel] [PATCH v3 17/19] target-i386: fix apic object leak when CPU is deleted

2016-07-13 Thread Bandan Das
Igor Mammedov writes: > Signed-off-by: Igor Mammedov > --- > target-i386/cpu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 04c0b79..2fa445d 100644 > --- a/target-i386/cpu.c > +++

Re: [Qemu-devel] [PATCH v3 12/19] apic: move MAX_APICS check to 'apic' class

2016-07-13 Thread Bandan Das
Igor Mammedov writes: > MAX_APICS is only used by child 'apic' class and not > by its parent TYPE_APIC_COMMON or any other derived > class. > Move check into end user 'apic' class so it won't > get in the way of other APIC implementations > if they support more then

Re: [Qemu-devel] [PATCH v3 10/19] pc: register created initial and hotpluged CPUs in one place pc_cpu_plug()

2016-07-13 Thread Eduardo Habkost
On Wed, Jul 13, 2016 at 06:32:27PM -0400, Bandan Das wrote: > Igor Mammedov writes: > > > consolidate possible_cpus array management in pc_cpu_plug() > > for smp_cpus, coldplugged with -device and hotplugged with > > device_add. > > So, this takes care of the hotplug case

Re: [Qemu-devel] [PATCH v3 07/19] pc: set APIC ID based on socket/core/thread ids if it's not been set yet

2016-07-13 Thread Eduardo Habkost
On Wed, Jul 13, 2016 at 06:24:17PM -0400, Bandan Das wrote: > Igor Mammedov writes: > > > CPU added with device_add help won't have APIC ID set, > > so set it according to socket/core/thread ids provided > > with device_add command. > > > > Signed-off-by: Igor Mammedov

Re: [Qemu-devel] [PATCH v3 10/19] pc: register created initial and hotpluged CPUs in one place pc_cpu_plug()

2016-07-13 Thread Bandan Das
Igor Mammedov writes: > consolidate possible_cpus array management in pc_cpu_plug() > for smp_cpus, coldplugged with -device and hotplugged with > device_add. So, this takes care of the hotplug case and 09/19 took care of the coldplug case, right ? If yes, we should

Re: [Qemu-devel] [PATCH v3 07/19] pc: set APIC ID based on socket/core/thread ids if it's not been set yet

2016-07-13 Thread Bandan Das
Igor Mammedov writes: > CPU added with device_add help won't have APIC ID set, > so set it according to socket/core/thread ids provided > with device_add command. > > Signed-off-by: Igor Mammedov > --- > v3: > - use %u for printing topo ids > v2: > -

Re: [Qemu-devel] [PATCH v3 06/19] target-i386: add socket/core/thread properties to X86CPU

2016-07-13 Thread Bandan Das
Igor Mammedov writes: > these properties will be used by as address where to plug > CPU with help -device/device_add commands. > > Signed-off-by: Igor Mammedov > --- > v3: > - use %u for printing topo ids > - add to error message topo ids from set

Re: [Qemu-devel] [PATCH v8 4/5] generic-loader: Add a generic loader

2016-07-13 Thread Alistair Francis
On Wed, Jul 13, 2016 at 2:09 PM, Peter Maydell wrote: > On 13 July 2016 at 21:30, Alistair Francis > wrote: >> On Wed, Jul 13, 2016 at 12:44 PM, Peter Maydell >> wrote: >>> On 13 July 2016 at 18:45, Alistair

Re: [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity checks in pc_cpu_pre_plug()

2016-07-13 Thread Bandan Das
Igor Mammedov writes: > Machine code knows about all possible APIC IDs so use that > instead of hack which does O(n^2) complexity duplicate > checks, interating over global CPUs list. > As result duplicate check is done only once with O(log n) complexity. > > Signed-off-by:

Re: [Qemu-devel] [PATCH v3 01/19] target-i386: cpu: use uint32_t for X86CPU.apic_id

2016-07-13 Thread Bandan Das
I know some of these have already been pulled. I just have some minor questions/comments that shouldn't conflict. Igor Mammedov writes: > Redo 9886e834 (target-i386: Require APIC ID to be explicitly set before > CPU realize) in another way that doesn't use int64_t to

Re: [Qemu-devel] [PATCH v8 4/5] generic-loader: Add a generic loader

2016-07-13 Thread Peter Maydell
On 13 July 2016 at 21:30, Alistair Francis wrote: > On Wed, Jul 13, 2016 at 12:44 PM, Peter Maydell > wrote: >> On 13 July 2016 at 18:45, Alistair Francis >> wrote: >>> On Tue, Jul 12, 2016 at 9:39 AM, Peter

[Qemu-devel] [PATCH v3 12/12] tcg: Make tb_flush() thread safe

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov Use async_safe_run_on_cpu() to make tb_flush() thread safe. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- Changes in v3: - 'tb_flushed' removed Changes in v2: - stale comment about

[Qemu-devel] [PATCH v3 08/12] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick()

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- linux-user/main.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index

[Qemu-devel] [PATCH v3 09/12] linux-user: Support CPU work queue

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov Make CPU work core functions common between system and user-mode emulation. User-mode does not have BQL, so process_queued_cpu_work() is protected by 'exclusive_lock'. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov

[Qemu-devel] [PATCH v3 03/12] cpus: Move common code out of {async_, }run_on_cpu()

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov Move the code common between run_on_cpu() and async_run_on_cpu() into a new function queue_work_on_cpu(). Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée

Re: [Qemu-devel] [PATCH v8 11/16] qapi-event: Reduce chance of collision with event data

2016-07-13 Thread Eric Blake
On 07/07/2016 05:37 AM, Markus Armbruster wrote: > Eric Blake writes: > >> When an unboxed event has accompanying data, we are exposing all >> of its members alongside our local variables in the generated >> qapi_event_send_FOO() function. So far, we haven't hit a >>

[Qemu-devel] [PATCH v3 06/12] linux-user: Use QemuMutex and QemuCond

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov Convert pthread_mutex_t and pthread_cond_t to QemuMutex and QemuCond. This will allow to make some locks and conditional variables common between user and system mode emulation. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey

[Qemu-devel] [PATCH v3 05/12] cpus: Rename flush_queued_work()

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov To avoid possible confusion, rename flush_queued_work() to process_queued_cpu_work(). Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée ---

[Qemu-devel] [PATCH v3 07/12] linux-user: Rework exclusive operation mechanism

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov A single variable 'pending_cpus' was used for both counting currently running CPUs and for signalling the pending exclusive operation request. To prepare for supporting operations which requires a quiescent state, like translation buffer flush, it is

[Qemu-devel] [PATCH v3 11/12] cpu-exec-common: Introduce async_safe_run_on_cpu()

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov This patch is based on the ideas found in work of KONRAD Frederic [1], Alex Bennée [2], and Alvise Rigo [3]. This mechanism allows to perform an operation safely in a quiescent state. Quiescent state means: (1) no vCPU is running and (2) BQL in

[Qemu-devel] [PATCH v3 04/12] cpus: Wrap mutex used to protect CPU work

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov This will be useful to enable CPU work on user mode emulation. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée --- cpus.c | 7 ++- 1

[Qemu-devel] [PATCH v3 00/12] cpu-exec: Safe work in quiescent state

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov Hi, This is a v3 for the RFC series [1]. This is not RFC anymore because bsd-user is supported now. However I wasn't able to even compile-test bsd-user so some help on this would be really appreciated. This series is available at a public git

[Qemu-devel] [PATCH v3 02/12] cpus: pass CPUState to run_on_cpu helpers

2016-07-13 Thread Sergey Fedorov
From: Alex Bennée CPUState is a fairly common pointer to pass to these helpers. This means if you need other arguments for the async_run_on_cpu case you end up having to do a g_malloc to stuff additional data into the routine. For the current users this isn't a massive

[Qemu-devel] [PATCH v3 10/12] bsd-user: Support CPU work queue

2016-07-13 Thread Sergey Fedorov
From: Sergey Fedorov It is a minimalistic support because bsd-linux claims to be _not_ threadsafe. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- bsd-user/main.c | 15 +++ 1 file changed, 15

[Qemu-devel] [PATCH v3 01/12] atomic: introduce atomic_dec_fetch.

2016-07-13 Thread Sergey Fedorov
From: Alex Bennée Useful for counting down. Signed-off-by: Alex Bennée Signed-off-by: Sergey Fedorov --- include/qemu/atomic.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/atomic.h

Re: [Qemu-devel] [PATCH v8 4/5] generic-loader: Add a generic loader

2016-07-13 Thread Alistair Francis
On Wed, Jul 13, 2016 at 12:44 PM, Peter Maydell wrote: > On 13 July 2016 at 18:45, Alistair Francis > wrote: >> On Tue, Jul 12, 2016 at 9:39 AM, Peter Maydell >> wrote: >>> On 2 July 2016 at 02:07, Alistair

Re: [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip

2016-07-13 Thread Eduardo Habkost
On Wed, Jul 13, 2016 at 08:11:45PM +0200, Greg Kurz wrote: > We're not supposed to abort when the user passes a bogus value. > Since the ckecing is done in visit_type_OnOffSplit(), the call to > abort() is legitimate. Let's add a comment to make it explicit. > > Signed-off-by: Greg Kurz

Re: [Qemu-devel] [PATCH v8 4/5] generic-loader: Add a generic loader

2016-07-13 Thread Peter Maydell
On 13 July 2016 at 18:45, Alistair Francis wrote: > On Tue, Jul 12, 2016 at 9:39 AM, Peter Maydell > wrote: >> On 2 July 2016 at 02:07, Alistair Francis >> wrote: >>> Add a generic loader to QEMU which can be

Re: [Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip

2016-07-13 Thread Greg Kurz
On Wed, 13 Jul 2016 20:11:45 +0200 Greg Kurz wrote: > We're not supposed to abort when the user passes a bogus value. > Since the ckecing is done in visit_type_OnOffSplit(), the call to s/ckecing/checking :) > abort() is legitimate. Let's add a comment to make it explicit. > >

Re: [Qemu-devel] tests/ide-test hangs with gthread

2016-07-13 Thread John Snow
On 07/13/2016 12:30 PM, Marc-André Lureau wrote: > Hi, > > Since 4840f10 "memory: let address_space_rw/ld*/st* run outside the > BQL", the ide-test /x86_64/ide/bmdma/no_busmaster hangs when qemu is > compiled with gthread coroutine . Is this a known issue? > News to me. What's your configure

Re: [Qemu-devel] [RFC 00/13] Live memory snapshot based on userfaultfd

2016-07-13 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > For now, we still didn't support live memory snapshot, we have discussed > a scheme which based on userfaultfd long time ago. > You can find the discussion by the follow link: >

[Qemu-devel] [PATCH] vl: exit if a bad property value is passed to -global

2016-07-13 Thread Greg Kurz
When passing '-global driver=host-powerpc64-cpu,property=compat,value=foo' on the command line, without this patch, we get the following warning per device (which means many lines if the guests has many cpus): qemu-system-ppc64: Warning: can't apply global host-powerpc64-cpu.compat=foo:

[Qemu-devel] [PATCH] machine: add comment to abort path in machine_set_kernel_irqchip

2016-07-13 Thread Greg Kurz
We're not supposed to abort when the user passes a bogus value. Since the ckecing is done in visit_type_OnOffSplit(), the call to abort() is legitimate. Let's add a comment to make it explicit. Signed-off-by: Greg Kurz --- hw/core/machine.c |3 +++ 1 file changed, 3

Re: [Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path

2016-07-13 Thread Sergey Fedorov
On 13/07/16 10:39, Paolo Bonzini wrote: > If anything, for historical reasons one might rename tb_find_physical to > tb_find_slow and leave the tb_find_fast name, but I think the patch is > good as is. I think tb_find_htable() or tb_find_global_htable() could also be good options if we're going

Re: [Qemu-devel] [PATCH v3 01/11] util/qht: Document memory ordering assumptions

2016-07-13 Thread Sergey Fedorov
On 13/07/16 14:13, Paolo Bonzini wrote: > > On 12/07/2016 22:13, Sergey Fedorov wrote: >> diff --git a/include/qemu/qht.h b/include/qemu/qht.h >> index 70bfc68b8d67..5f633e5d8100 100644 >> --- a/include/qemu/qht.h >> +++ b/include/qemu/qht.h >> @@ -69,6 +69,9 @@ void qht_destroy(struct qht *ht);

Re: [Qemu-devel] [RFC 13/13] snapshot: Remove page's write-protect and copy the content during setup stage

2016-07-13 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > If we modify VM's RAM (pages) during setup stage after enable write-protect > notification in snapshot thread, the modification action will get stuck > because > we only remove the page's write-protect in savevm process, it blocked by >

Re: [Qemu-devel] [PATCH v3 01/11] util/qht: Document memory ordering assumptions

2016-07-13 Thread Sergey Fedorov
On 13/07/16 10:36, Paolo Bonzini wrote: > > On 13/07/2016 01:19, Emilio G. Cota wrote: >> I wouldn't put those comments in the source--seqlock callers should >> know what they're doing, and what barriers seqlocks imply. > In general I'd agree with you, however in this case the "begin" calls > are

Re: [Qemu-devel] [PATCH v8 5/5] docs: Add a generic loader explanation document

2016-07-13 Thread Alistair Francis
On Tue, Jul 12, 2016 at 9:31 AM, Peter Maydell wrote: > On 2 July 2016 at 02:07, Alistair Francis wrote: >> Signed-off-by: Alistair Francis >> --- >> V8: >> - Improve documentation >> V6: >> - Fixup

Re: [Qemu-devel] [PATCH v8 4/5] generic-loader: Add a generic loader

2016-07-13 Thread Alistair Francis
On Tue, Jul 12, 2016 at 9:39 AM, Peter Maydell wrote: > On 2 July 2016 at 02:07, Alistair Francis wrote: >> Add a generic loader to QEMU which can be used to load images or set >> memory values. >> >> Signed-off-by: Alistair Francis

Re: [Qemu-devel] [PATCH v5 02/10] HBitmap: Introduce "meta" bitmap to track bit changes

2016-07-13 Thread John Snow
On 06/22/2016 11:22 AM, Max Reitz wrote: > On 03.06.2016 06:32, Fam Zheng wrote: >> Upon each bit toggle, the corresponding bit in the meta bitmap will be >> set. >> >> Signed-off-by: Fam Zheng >> Reviewed-by: John Snow >> --- >> block/dirty-bitmap.c | 2

Re: [Qemu-devel] [PATCH v8 2/5] loader: All a custom SddressSpace when loading ROMs

2016-07-13 Thread Alistair Francis
On Tue, Jul 12, 2016 at 9:56 AM, Peter Maydell wrote: > On 2 July 2016 at 02:07, Alistair Francis wrote: >> When loading ROMs allow the caller to specify an AddressSpace to use for >> the load. >> >> Signed-off-by: Alistair Francis

Re: [Qemu-devel] [PATCH 6/9] Convert cpu_memory_rw_debug to use MMUAccessType

2016-07-13 Thread Andrey Smirnov
On Wed, Jul 13, 2016 at 2:52 AM, Peter Maydell wrote: > On 13 July 2016 at 01:54, David Gibson wrote: >> On Tue, Jul 12, 2016 at 09:05:24AM -0700, Andrey Smirnov wrote: >>> Please let me know how I should proceed with this series. >> >> My

Re: [Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path

2016-07-13 Thread Sergey Fedorov
On 13/07/16 10:39, Paolo Bonzini wrote: > On 12/07/2016 22:13, Sergey Fedorov wrote: >> From: Sergey Fedorov >> >> Hi, >> >> This is my respin of Alex's v2 series [1]. >> >> The first 8 patches are preparation for the patch 9, the subject matter >> of this series, which

Re: [Qemu-devel] [PULL] OpenBIOS: switch over to official OpenBIOS git repo

2016-07-13 Thread Peter Maydell
On 12 July 2016 at 19:17, Mark Cave-Ayland wrote: > Hi Peter, > > This commit simply updates the OpenBIOS submodule to point to the same HEAD > as the new official > repository hosted on github. Please pull. > > > ATB, > > Mark. > > > The following changes since

  1   2   3   >