[Qemu-devel] [PATCH v4 20/26] tcg: Save insn data and use it in cpu_restore_state_from_tb

2015-09-30 Thread Richard Henderson
We can now restore state without retranslation. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1 + tcg/tcg.c | 40 - tcg/tcg.h | 4 +- translate-all.c | 150

Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/spapr: Allow VIRTIO_VGA

2015-09-30 Thread David Gibson
On Wed, Sep 16, 2015 at 08:52:23AM +0200, Gerd Hoffmann wrote: > On Mi, 2015-09-16 at 07:08 +1000, Benjamin Herrenschmidt wrote: > > On Tue, 2015-09-15 at 11:19 +0200, Gerd Hoffmann wrote: > > > On Di, 2015-09-15 at 15:51 +1000, Benjamin Herrenschmidt wrote: > > > > It works fine with the Linux dri

[Qemu-devel] [PATCH v4 14/26] target-sparc: Remove gen_opc_jump_pc

2015-09-30 Thread Richard Henderson
Since jump_pc[1] is always npc + 4, we can infer after incrementing that jump_pc[1] == pc + 4. Because of that, we can encode the branch destination into a single word, and store that in npc. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-sp

[Qemu-devel] [PATCH v4 16/26] tcg: Merge cpu_gen_code into tb_gen_code

2015-09-30 Thread Richard Henderson
As it's only caller, this tidies things a bit. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 2 - translate-all.c | 131 ++-- 2 files changed, 59 insertions(+), 74 dele

[Qemu-devel] [PATCH v4 13/26] target-sparc: Split out gen_branch_n

2015-09-30 Thread Richard Henderson
Unify three copies of this code from different branch types. Fix the case when npc == DYNAMIC_PC, i.e. a branch within a delay slot. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-sparc/translate.c | 55 --

[Qemu-devel] [PATCH v4 06/26] target-arm: Add condexec state to insn_start

2015-09-30 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-arm/cpu.h | 1 + target-arm/translate-a64.c | 2 +- target-arm/translate.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h

Re: [Qemu-devel] [Qemu-ppc] [PATCH] s/cpu_get_real_ticks/cpu_get_host_ticks/

2015-09-30 Thread David Gibson
On Fri, Sep 25, 2015 at 10:42:21AM -0400, Christopher Covington wrote: > This should help clarify the purpose of the function that returns > the host system's CPU cycle count. > > Signed-off-by: Christopher Covington ppc portion Acked-by: David Gibson > --- > bsd-user/main.c | 2 +

[Qemu-devel] [PATCH v4 15/26] target-sparc: Add npc state to insn_start

2015-09-30 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-sparc/cpu.h | 1 + target-sparc/translate.c | 7 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 053edd5..c68e480 100644 -

[Qemu-devel] [PATCH v4 11/26] target-cris: Mirror gen_opc_pc into insn_start

2015-09-30 Thread Richard Henderson
This perhaps isn't ideal in terms of (ab)using the "pc" field to encode both pc and ppc + delay branch state, as one has to be aware of this when examining opcode dumps. But it preserves existing logic, which will be good for bisection, and it certainly does save storage space. Reviewed-by: Aurel

[Qemu-devel] [PATCH v4 08/26] target-mips: Add delayed branch state to insn_start

2015-09-30 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-mips/cpu.h | 1 + target-mips/translate.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target-mips/cpu.h b/target-mips/cpu.h index ec5f991..532b39e 100644 --- a/tar

[Qemu-devel] [PATCH v4 17/26] target-*: Drop cpu_gen_code define

2015-09-30 Thread Richard Henderson
This symbol no longer exists. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-alpha/cpu.h | 1 - target-arm/cpu.h| 1 - target-cris/cpu.h | 1 - target-i386/cpu.h | 1 - target-lm32/cpu.h | 1 - target-m68k/cpu.h

[Qemu-devel] [PATCH v4 05/26] tcg: Allow extra data to be attached to insn_start

2015-09-30 Thread Richard Henderson
With an eye toward having this data replace the gen_opc_* arrays that each target collects in order to enable restore_state_from_tb. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/tcg-op.h | 52 --

[Qemu-devel] [PATCH v4 10/26] target-sh4: Add flags state to insn_start

2015-09-30 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-sh4/cpu.h | 1 + target-sh4/translate.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index 6fb6321..145e5df 100644 --- a/target-s

[Qemu-devel] [PATCH v4 12/26] target-sparc: Tidy gen_branch_a interface

2015-09-30 Thread Richard Henderson
We always pass pc2 == dc->npc and r_cond == cpu_cond, and always set is_br afterward. Infer all of that. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-sparc/translate.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deleti

[Qemu-devel] [PATCH v4 03/26] target-*: Increment num_insns immediately after tcg_gen_insn_start

2015-09-30 Thread Richard Henderson
This does tidy the icount test common to all targets. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-alpha/translate.c | 4 ++-- target-arm/translate-a64.c| 6 +++--- target-arm/translate.c| 7 --- target-cris/translate.c

[Qemu-devel] [PATCH v4 04/26] target-*: Introduce and use cpu_breakpoint_test

2015-09-30 Thread Richard Henderson
Reduce the boilerplate required for each target. At the same time, move the test for breakpoint after calling tcg_gen_insn_start. Note that arm and aarch64 do not use cpu_breakpoint_test, but still move the inline test down after tcg_gen_insn_start. Reviewed-by: Peter Maydell Signed-off-by: Ric

[Qemu-devel] [PATCH v4 07/26] target-i386: Add cc_op state to insn_start

2015-09-30 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-i386/cpu.h | 1 + target-i386/translate.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 034fab6..c10b673 100644 --- a/targ

[Qemu-devel] [PATCH v4 00/26] Do away with TB retranslation

2015-09-30 Thread Richard Henderson
Version 4: * Typos noticed by pmm during round 3. * RB's collected during round 3. * Reduce the number of TBs allocated. I believe the only patch left without an RB is 24; and of course 26 which is new. r~ Richard Henderson (26): tcg: Rename debug_insn_start to insn_start target-*: U

[Qemu-devel] [PATCH v4 02/26] target-*: Unconditionally emit tcg_gen_insn_start

2015-09-30 Thread Richard Henderson
While we're at it, emit the opcode adjacent to where we currently record data for search_pc. This puts gen_io_start et al on the "correct" side of the marker. Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-alpha/translate.c | 6 ++

[Qemu-devel] [PATCH v4 09/26] target-s390x: Add cc_op state to insn_start

2015-09-30 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-s390x/cpu.h | 1 + target-s390x/translate.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 5acd54c..b927c66 100644 --- a/

Re: [Qemu-devel] feature idea: allow user to run custom scripts

2015-09-30 Thread Paolo Bonzini
On 29/09/2015 15:23, Dr. David Alan Gilbert wrote: > Yeh, I'm not sure how easily that'll be to glue into the monitor, > because the monitor has a parser that's fed somehow from the chardev. See how qmp_human_monitor_command is implemented. It basically bypasses the chardev part of the monitor.

Re: [Qemu-devel] qemu-system-alpha -nographic does not work

2015-09-30 Thread Dennis Luehring
Am 30.09.2015 um 04:40 schrieb Richard Henderson: On 09/27/2015 05:02 PM, Dennis Luehring wrote: > git master clone from 09/27/2015, 8:07 > git rev-parse HEAD > 9e071429e649346c14b2dc76902f84f8352d2333 > > if i try to start qemu-system-alpha with option -nographic while installing > debian lenny

[Qemu-devel] [PATCHv3 3/7] vfio: Check guest IOVA ranges against host IOMMU capabilities

2015-09-30 Thread David Gibson
The current vfio core code assumes that the host IOMMU is capable of mapping any IOVA the guest wants to use to where we need. However, real IOMMUs generally only support translating a certain range of IOVAs (the "DMA window") not a full 64-bit address space. The common x86 IOMMUs support a wide

[Qemu-devel] [PATCH 3/4] spapr_iommu: Provide a function to switch a TCE table to allowing VFIO

2015-09-30 Thread David Gibson
Because of the way non-VFIO guest IOMMU operations are KVM accelerated, not all TCE tables (guest IOMMU contexts) can support VFIO devices. Currently, this is decided at creation time. To support hotplug of VFIO devices, we need to allow a TCE table which previously didn't allow VFIO devices to b

[Qemu-devel] [RFC PATCH] qapi: Use callback to determine visit filtering

2015-09-30 Thread Eric Blake
Previously, qapi-types and qapi-visit filtered an object visit to bypass implicit types by inspecting whether 'info' was passed in (since implicit objects do not [yet] have associated info); meanwhile qapi-introspect filtered by returning a python type from visit_begin() in order to exclude all typ

Re: [Qemu-devel] [RFC v5 2/6] softmmu: Add new TLB_EXCL flag

2015-09-30 Thread Richard Henderson
On 09/24/2015 06:32 PM, Alvise Rigo wrote: +if (unlikely(!(te->addr_write & TLB_MMIO) && (te->addr_write & TLB_EXCL))) { +/* We are removing an exclusive entry, set the page to dirty. This + * is not be necessary if the vCPU has performed both SC and LL. */ +hwaddr hw

Re: [Qemu-devel] [RFC v5 3/6] softmmu: Add helpers for a new slowpath

2015-09-30 Thread Richard Henderson
On 09/24/2015 06:32 PM, Alvise Rigo wrote: The new helpers rely on the legacy ones to perform the actual read/write. The LoadLink helper (helper_ldlink_name) prepares the way for the following SC operation. It sets the linked address and the size of the access. These helper also update the TLB e

[Qemu-devel] [PATCH 0/4] Allow VFIO devices on spapr-pci-host-bridge

2015-09-30 Thread David Gibson
At present, VFIO PCI devices attached to an spapr-pci-host-bridge device (the regular PCI host bridge for the pseries machine type) won't quite work properly. I've recently posted some extensions to VFIO that are almost enough to allow these to work - this series contains the final necessary chang

[Qemu-devel] [PATCHv3 7/7] vfio: Expose a VFIO PCI device's group for EEH

2015-09-30 Thread David Gibson
The Enhanced Error Handling (EEH) interface in PAPR operates on units of a Partitionable Endpoint (PE). For VFIO devices, the PE boundaries the guest sees must match the PE (i.e. IOMMU group) boundaries on the host. To implement this it will need to discover from VFIO which group a given device b

[Qemu-devel] [PATCHv3 1/7] vfio: Remove unneeded union from VFIOContainer

2015-09-30 Thread David Gibson
Currently the VFIOContainer iommu_data field contains a union with different information for different host iommu types. However: * It only actually contains information for the x86-like "Type1" iommu * Because we have a common listener the Type1 fields are actually used on all IOMMU types,

[Qemu-devel] [PATCH v1 0/3] Connect the SPI devices to ZynqMP

2015-09-30 Thread Alistair Francis
Connect the SPI devices to Xilinx's ZynqMP. I also need to make some changes to the actual SPI device to imporove the fuctionality, but for the time being this works. Alistair Francis (3): ssi: Move ssi.h into a seperate directory xilinx_spips: Seperate the state struct into a header xlnx-z

[Qemu-devel] [PATCHv3 2/7] vfio: Generalize vfio_listener_region_add failure path

2015-09-30 Thread David Gibson
If a DMA mapping operation fails in vfio_listener_region_add() it checks to see if we've already completed initial setup of the container. If so it reports an error so the setup code can fail gracefully, otherwise throws a hw_error(). There are other potential failure cases in vfio_listener_regio

Re: [Qemu-devel] Loading image/elf to cpu that has different not system memory address space

2015-09-30 Thread Peter Maydell
On 29 September 2015 at 23:40, Alistair Francis wrote: > On Thu, Sep 24, 2015 at 11:58 AM, mar.krzeminski > wrote: >> >> >> W dniu 24.09.2015 o 20:38, Peter Crosthwaite pisze: >> >>> On Thu, Sep 24, 2015 at 10:14 AM, mar.krzeminski >>> wrote: Today I stacked on other interesting think - and

Re: [Qemu-devel] [PATCH] handle_aiocb_rw() can't distinguish betweenan error and 0 bytes transferred

2015-09-30 Thread Guangmu Zhu
Hi, Thank you so much for your reply. Yes, I cannot use gmail directly for it's blocked by the GFW, and I used the Tencent mail(@qq.com) to receive mails in gmail. It's my first time to send a patch, I will read the link you provide and improve my future patches. As for BOOL and bool, are som

Re: [Qemu-devel] [PATCH] configure: Require Python 2.6

2015-09-30 Thread Peter Maydell
On 29 September 2015 at 22:35, Eric Blake wrote: > ping > > On 09/04/2015 04:44 PM, Peter Maydell wrote: >> On 4 September 2015 at 20:53, Markus Armbruster wrote: >>> RHEL-6 and SLES-11 provide Python 2.6. It'll also work on OS X back >>> to 10.6. >>> >>> Signed-off-by: Markus Armbruster >> >>

[Qemu-devel] [PATCH v7 16/18] qapi: Share gen_visit_fields()

2015-09-30 Thread Eric Blake
Consolidate the code between visit, command marshalling, and event generation that iterates over the members of a struct. It reduces code duplication in the generator, so that a future patch can reduce the size of generated code while touching only one instead of three locations. There are no chan

[Qemu-devel] [PATCH v1 1/3] ssi: Move ssi.h into a seperate directory

2015-09-30 Thread Alistair Francis
Move the ssi.h include file into the ssi directory. Signed-off-by: Alistair Francis --- hw/arm/pxa2xx.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stellaris.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/tosa.c

Re: [Qemu-devel] [PATCH v4 2/2] spapr: generate DT node names

2015-09-30 Thread David Gibson
On Tue, Sep 29, 2015 at 10:37:31AM +0200, Laurent Vivier wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > > On 29/09/2015 07:18, David Gibson wrote: > > On Thu, Sep 24, 2015 at 12:27:39PM +0200, Laurent Vivier wrote: > >> When DT node names for PCI devices are generated by SLOF,

[Qemu-devel] [PATCH v7 12/18] qapi: Consistent generated code: prefer common labels

2015-09-30 Thread Eric Blake
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. This is one patch of a series to clean up these differences. This patch names the goto labels 'out' (not '

Re: [Qemu-devel] [PATCH v2] Add argument filters to the seccomp sandbox

2015-09-30 Thread Paul Moore
On Monday, September 28, 2015 11:14:42 PM Namsun Ch'o wrote: > > My understanding of the config file you proposed is that it would allow > > the > > configuration of a whitelist, so changes to the config very could result > > in > > *less* strict of a filter, not always more. > > No. Any time an a

Re: [Qemu-devel] Loading image/elf to cpu that has different not system memory address space

2015-09-30 Thread Alistair Francis
On Thu, Sep 24, 2015 at 11:58 AM, mar.krzeminski wrote: > > > W dniu 24.09.2015 o 20:38, Peter Crosthwaite pisze: > >> On Thu, Sep 24, 2015 at 10:14 AM, mar.krzeminski >> wrote: >>> >>> >>> W dniu 24.09.2015 o 05:07, Peter Crosthwaite pisze: >>> >>> On Wed, Sep 23, 2015 at 8:06 PM, Peter Crosthwa

Re: [Qemu-devel] [RFC v5 4/6] target-arm: Create new runtime helpers for excl accesses

2015-09-30 Thread Richard Henderson
On 09/24/2015 06:32 PM, Alvise Rigo wrote: Introduce a set of new runtime helpers do handle exclusive instructions. This helpers are used as hooks to call the respective LL/SC helpers in softmmu_llsc_template.h from TCG code. Suggested-by: Jani Kokkonen Suggested-by: Claudio Fontana Signed-off

[Qemu-devel] [PATCH v7 14/18] qapi: Consistent generated code: minimize push_indent() usage

2015-09-30 Thread Eric Blake
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. This is one patch of a series to clean up these differences. This patch reduces the number of push_indent(

[Qemu-devel] [PATCH 4/4] spapr_pci: Allow VFIO devices to work on the normal PCI host bridge

2015-09-30 Thread David Gibson
The core VFIO infrastructure more or less allows VFIO devices to work on any normal guest PCI host bridge (PHB) without extra logic. However, the "spapr-pci-host-bridge" device (as opposed to the special "spapr-pci-vfio-host-bridge" device) breaks this by using a partially KVM accelerated implement

[Qemu-devel] [PATCH v7 11/18] qapi: Consistent generated code: prefer visitor 'v'

2015-09-30 Thread Eric Blake
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. This is one patch of a series to clean up these differences. This patch names the local visitor variable '

Re: [Qemu-devel] [RFC v5 0/6] Slow-path for atomic instruction translation

2015-09-30 Thread Paolo Bonzini
On 24/09/2015 10:32, Alvise Rigo wrote: > The implementation heavily uses the software TLB together with a new > bitmap that has been added to the ram_list structure which flags, on a > per-CPU basis, all the memory pages that are in the middle of a LoadLink > (LL), StoreConditional (SC) operatio

[Qemu-devel] [PATCH 1/4] spapr_pci: Allow PCI host bridge DMA window to be configured

2015-09-30 Thread David Gibson
At present the PCI host bridge (PHB) for the pseries machine type has a fixed DMA window from 0..1GB (in PCI address space) which is mapped to real memory via the PAPR paravirtualized IOMMU. For better support of VFIO devices, we're going to want to allow for different configurations of the DMA wi

Re: [Qemu-devel] [RFC v5 5/6] configure: Use slow-path for atomic only when the softmmu is enabled

2015-09-30 Thread Richard Henderson
On 09/24/2015 06:32 PM, Alvise Rigo wrote: Use the new slow path for atomic instruction translation when the softmmu is enabled. Um... why? TCG_USE_LDST_EXCL would appear to be 100% redundant with SOFTMMU. r~

[Qemu-devel] [PATCH v7 05/18] qapi: Test for various name collisions

2015-09-30 Thread Eric Blake
Expose some weaknesses in the generator: we don't always forbid the generation of structs that contain multiple members that map to the same C or QMP name. This has already been marked FIXME in qapi.py in commit d90675f, but having more tests will make sure future patches produce desired behavior;

Re: [Qemu-devel] qemu-system-alpha -nographic does not work

2015-09-30 Thread Richard Henderson
On 09/27/2015 05:02 PM, Dennis Luehring wrote: git master clone from 09/27/2015, 8:07 git rev-parse HEAD 9e071429e649346c14b2dc76902f84f8352d2333 if i try to start qemu-system-alpha with option -nographic while installing debian lenny 5.0.10 for alpha i get this output and qemu hangs - without u

[Qemu-devel] [PATCH 2/4] spapr_iommu: Rename vfio_accel parameter

2015-09-30 Thread David Gibson
The vfio_accel parameter used when creating a new TCE table (guest IOMMU context) has a confusing name. What it really means is whether we need the TCE table created to be able to support VFIO devices. VFIO is relevant, because when available we use in-kernel acceleration of the TCE table, but th

[Qemu-devel] [PATCH v7 10/18] qapi: Consistent generated code: prefer error 'err'

2015-09-30 Thread Eric Blake
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. This is one patch of a series to clean up these differences. This patch consistently names the local error

[Qemu-devel] [PATCH 1/2] target-i386: Use 1UL for bit shift

2015-09-30 Thread Eduardo Habkost
Fix undefined behavior detected by clang runtime check: qemu/target-i386/cpu.c:1494:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' While doing that, add extra parenthesis for clarity. Reported-by: Peter Maydell Signed-off-by: Eduardo Habkost --- targ

Re: [Qemu-devel] [PATCH 5/7] memory: Allow replay of IOMMU mapping notifications

2015-09-30 Thread David Gibson
On Tue, Sep 29, 2015 at 09:15:58AM +0200, Paolo Bonzini wrote: > > > On 29/09/2015 05:30, David Gibson wrote: > >> Maybe... The only issue is the "granularity" argument, which is > >> not in memory_region_register_iommu_notifier. That makes me > >> wonder if the replay and registration make se

[Qemu-devel] [PATCH v7 08/18] qapi: Test use of 'number' within alternates

2015-09-30 Thread Eric Blake
Add some testsuite exposure for use of a 'number' as part of an alternate. The current state of the tree has a few bugs exposed by this: our input parser depends on the ordering of how the qapi schema declared the alternate, and the parser does not accept integers for a 'number' in an alternate ev

[Qemu-devel] [PATCHv3 0/7] VFIO extensions to allow VFIO devices on spapr-pci-host-bridge

2015-09-30 Thread David Gibson
Hi Alex, Here are the parts of my recent series to allow VFIO devices on the spapr-pci-host-bridge device which affect the core VFIO code. They've been revised according to the comments from yourself and others. There's also one patch for the memory subsystem. Note that while these are motivate

[Qemu-devel] [PATCHv3 5/7] memory: Allow replay of IOMMU mapping notifications

2015-09-30 Thread David Gibson
When we have guest visible IOMMUs, we allow notifiers to be registered which will be informed of all changes to IOMMU mappings. This is used by vfio to keep the host IOMMU mappings in sync with guest IOMMU mappings. However, unlike with a memory region listener, an iommu notifier won't be told ab

[Qemu-devel] [PATCH v7 03/18] qapi: Invoke exception superclass initializer

2015-09-30 Thread Eric Blake
pylint recommends that every exception class should explicitly invoke the superclass __init__, even though things seem to work fine without it. Signed-off-by: Eric Blake --- v6: split off of 2/26 --- scripts/qapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qapi.py b/scripts

[Qemu-devel] [PATCH 0/2] target-i386: Fix undefined behavior on bit shifts

2015-09-30 Thread Eduardo Habkost
This fixes two errors detected by clang: target-i386/cpu.c:1494:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' target-i386/translate.c:2423:26: runtime error: left shift of negative value -8 Eduardo Habkost (2): target-i386: Use 1UL for bit shift tar

[Qemu-devel] [PATCHv3 4/7] vfio: Record host IOMMU's available IO page sizes

2015-09-30 Thread David Gibson
Depending on the host IOMMU type we determine and record the available page sizes for IOMMU translation. We'll need this for other validation in future patches. Signed-off-by: David Gibson Reviewed-by: Thomas Huth Reviewed-by: Laurent Vivier --- hw/vfio/common.c | 13

Re: [Qemu-devel] [PATCH 1/3] target-i386: add a subsection of vcpu's TSC rate in vmstate_x86_cpu

2015-09-30 Thread Haozhong Zhang
On Tue, Sep 29, 2015 at 08:00:13PM +0100, Dr. David Alan Gilbert wrote: > * Haozhong Zhang (haozhong.zh...@intel.com) wrote: > > The newly added subsection 'vmstate_tsc_khz' in this patch results in > > vcpu's TSC rate being saved on the source machine and loaded on the > > target machine during th

[Qemu-devel] [PATCH] migration: disallow migrate_add_blocker during migration

2015-09-30 Thread John Snow
If a migration is already in progress and somebody attempts to add a migration blocker, this should rightly fail. Add an errp parameter and a retcode return value to migrate_add_blocker. This is part one of two for a solution to prohibit e.g. block jobs from running concurrently with migration.

[Qemu-devel] [PATCHv3 6/7] vfio: Allow hotplug of containers onto existing guest IOMMU mappings

2015-09-30 Thread David Gibson
At present the memory listener used by vfio to keep host IOMMU mappings in sync with the guest memory image assumes that if a guest IOMMU appears, then it has no existing mappings. This may not be true if a VFIO device is hotplugged onto a guest bus which didn't previously include a VFIO device, a

[Qemu-devel] [PATCH] target-tilegx: Fix a typo for mnemonic about "ld_add"

2015-09-30 Thread gang . chen . 5i5j
From: Chen Gang Signed-off-by: Chen Gang --- target-tilegx/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-tilegx/translate.c b/target-tilegx/translate.c index d2b2b6e..251b254 100644 --- a/target-tilegx/translate.c +++ b/target-tilegx/translate.c @@ -1500

Re: [Qemu-devel] [PATCH v4 3/5] acpi: pc: add fw_cfg device node to ssdt

2015-09-30 Thread Gabriel L. Somlo
On Tue, Sep 29, 2015 at 07:28:39PM +0200, Laszlo Ersek wrote: > On 09/29/15 19:19, Gabriel L. Somlo wrote: > > On Tue, Sep 29, 2015 at 06:55:01PM +0200, Laszlo Ersek wrote: > >> On 09/29/15 18:46, Gabriel L. Somlo wrote: > >>> On Tue, Sep 29, 2015 at 12:33:40PM +0200, Laszlo Ersek wrote: > On

Re: [Qemu-devel] [PULL 0/7] X86 queue, 2015-09-28

2015-09-30 Thread Eduardo Habkost
On Tue, Sep 29, 2015 at 08:21:49PM +0100, Peter Maydell wrote: > On 29 September 2015 at 19:22, Eduardo Habkost wrote: > > On Tue, Sep 29, 2015 at 12:28:15PM +0100, Peter Maydell wrote: > >> I get a bunch of new warnings in the course of 'make check' now: > >> > >> warning: TCG doesn't support req

Re: [Qemu-devel] [PATCH] configure: Require Python 2.6

2015-09-30 Thread Eric Blake
ping On 09/04/2015 04:44 PM, Peter Maydell wrote: > On 4 September 2015 at 20:53, Markus Armbruster wrote: >> RHEL-6 and SLES-11 provide Python 2.6. It'll also work on OS X back >> to 10.6. >> >> Signed-off-by: Markus Armbruster > > Reviewed-by: Peter Maydell > > I wonder if we're ever going

[Qemu-devel] [PATCH v7 15/18] qapi: Share gen_err_check()

2015-09-30 Thread Eric Blake
qapi-commands has a nice helper gen_err_check(), but did not use it everywhere. In fact, using it in more places makes it easier to reduce the lines of code used for generating error checks. This in turn will make it easier for later patches to consolidate another common pattern among the generato

[Qemu-devel] [PATCH v7 13/18] qapi: Consistent generated code: prefer common indentation

2015-09-30 Thread Eric Blake
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. This is one patch of a series to clean up these differences. This patch adjusts gen_visit_union() to use t

Re: [Qemu-devel] [PATCH 3/3] target-xtensa: xtfpga: support noMMU cores

2015-09-30 Thread Peter Maydell
On 29 September 2015 at 11:34, Max Filippov wrote: > On Mon, Sep 28, 2015 at 12:59 AM, Peter Crosthwaite > wrote: >> On Sun, Sep 27, 2015 at 2:48 PM, Max Filippov wrote: >>> On Mon, Sep 28, 2015 at 12:28 AM, Peter Crosthwaite >>> wrote: To clarify, can you tell me the QEMU command line dif

Re: [Qemu-devel] [PATCH 3/3] kvm-all: notice KVM of vcpu's TSC rate after migration

2015-09-30 Thread Haozhong Zhang
On Tue, Sep 29, 2015 at 03:02:07PM -0300, Eduardo Habkost wrote: > On Tue, Sep 29, 2015 at 11:43:34AM +0800, Haozhong Zhang wrote: > > On Mon, Sep 28, 2015 at 01:37:34PM -0300, Eduardo Habkost wrote: > > > On Mon, Sep 28, 2015 at 01:38:31PM +0800, Haozhong Zhang wrote: > [...] > > > > static void

[Qemu-devel] [PATCH v7 07/18] qapi: Add tests for empty unions

2015-09-30 Thread Eric Blake
The documentation claims that alternates are useful for allowing two or more types, although nothing enforces this. Meanwhile, it is silent on whether empty unions are allowed. In practice, the generated code will compile, in part because we have a 'void *data' branch; but attempting to visit such

[Qemu-devel] [PATCH v1 2/3] xilinx_spips: Seperate the state struct into a header

2015-09-30 Thread Alistair Francis
Seperate out the XilinxSPIPS struct into a seperate header file. Signed-off-by: Alistair Francis --- hw/ssi/xilinx_spips.c | 104 +--- include/hw/ssi/xilinx_spips.h | 134 ++ 2 files changed, 135 insertions(+), 103 dele

[Qemu-devel] [PATCH v7 06/18] qapi: Avoid assertion failure on union 'type' collision

2015-09-30 Thread Eric Blake
The previous commit added two tests that triggered an assertion failure. It's fairly straightforward to avoid the failure by just outright forbidding the collision between a union's tag values and its discriminator name (including the implicit name 'kind' supplied for simple unions [*]). Ultimatel

Re: [Qemu-devel] [PATCH v8 23/54] Add migration-capability boolean for postcopy-ram.

2015-09-30 Thread Eric Blake
On 09/29/2015 02:37 AM, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The 'postcopy ram' capability allows postcopy migration of RAM; > note that the migration starts off in precopy mode until > postcopy mode is triggered (see the migrate_start_postcopy > patch later in

Re: [Qemu-devel] [PATCH v4 4/5] acpi: arm: add fw_cfg device node to dsdt

2015-09-30 Thread Gabriel L. Somlo
On Tue, Sep 29, 2015 at 12:40:16PM +0200, Laszlo Ersek wrote: > On 09/27/15 23:29, Gabriel L. Somlo wrote: > > Add a fw_cfg device node to the ACPI DSDT. This is mostly > > informational, as the authoritative fw_cfg MMIO region(s) > > are listed in the Device Tree. However, since we are building >

[Qemu-devel] [PATCH v7 00/18] post-introspection cleanups, subset A

2015-09-30 Thread Eric Blake
Patch 17 is marked RFC because it has a prerequisite: https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg01277.html Patch 18 is marked RFC because it is probably worth discarding. Otherwise, this series addresses the review comments on v6. Also available as a tag at this location: git fetch

[Qemu-devel] [RFC PATCH v7 18/18] qapi: Use gen_err_check() in more places

2015-09-30 Thread Eric Blake
Controversial: find all remaining patterns that generate a goto statement due to 'err', and convert them to use gen_err_check(). The bulk of these replacements actually lead to code duplication (extra mcgen() calls with common parameterization), so I will probably drop this patch. Signed-off-by:

Re: [Qemu-devel] [PATCH 3/3] target-xtensa: xtfpga: support noMMU cores

2015-09-30 Thread Peter Crosthwaite
On Tue, Sep 29, 2015 at 3:34 AM, Max Filippov wrote: > On Mon, Sep 28, 2015 at 12:59 AM, Peter Crosthwaite > wrote: >> On Sun, Sep 27, 2015 at 2:48 PM, Max Filippov wrote: >>> On Mon, Sep 28, 2015 at 12:28 AM, Peter Crosthwaite >>> wrote: To clarify, can you tell me the QEMU command line d

Re: [Qemu-devel] [PULL 0/7] X86 queue, 2015-09-28

2015-09-30 Thread Eduardo Habkost
On Tue, Sep 29, 2015 at 12:28:15PM +0100, Peter Maydell wrote: > On 28 September 2015 at 18:31, Eduardo Habkost wrote: > > The following changes since commit 9e071429e649346c14b2dc76902f84f8352d2333: > > > > Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into > > staging (2015

[Qemu-devel] [RFC PATCH v7 17/18] qapi: Simplify gen_visit_fields() error handling

2015-09-30 Thread Eric Blake
Since we have consolidated all generated code to use 'err' as the name of the local variable for error detection, we can simplify the decision on whether to skip error detection (useful for deallocation paths) to be a boolean. This requires the python 2.5 ternary syntax. Signed-off-by: Eric Blake

Re: [Qemu-devel] [PATCH v4 0/5] add ACPI node for fw_cfg on pc and arm

2015-09-30 Thread Laszlo Ersek
On 09/29/15 21:04, Gabriel L. Somlo wrote: > On Tue, Sep 29, 2015 at 05:15:25PM +0300, Michael S. Tsirkin wrote: >> On Tue, Sep 29, 2015 at 03:59:28PM +0200, Laszlo Ersek wrote: >>> On 09/29/15 12:27, Michael S. Tsirkin wrote: On Sun, Sep 27, 2015 at 05:28:57PM -0400, Gabriel L. Somlo wrote: >

[Qemu-devel] [PATCH v7 01/18] qapi: Sort qapi-schema tests

2015-09-30 Thread Eric Blake
Recent changes to qapi have provided quite a bit of churn in the makefile, because we are inconsistent on what order test names appear in, and on whether to re-wrap the list of tests or just add arbitrary line lengths. Writing the list in a sorted fashion, one test per line, will make future patch

Re: [Qemu-devel] [PATCH] ui/cocoa.m: run custom script menu item

2015-09-30 Thread Programmingkid
On Sep 29, 2015, at 2:00 PM, Peter Maydell wrote: > On 29 September 2015 at 18:53, Programmingkid > wrote: >> >> On Sep 29, 2015, at 1:18 PM, Peter Maydell wrote: >> >>> On 29 September 2015 at 18:03, Programmingkid >>> wrote: Allow the user the ability to run a custom script file. >>>

[Qemu-devel] [PATCH v7 09/18] qapi: Reuse code for flat union base validation

2015-09-30 Thread Eric Blake
Rather than open-code the check for a valid base type, we should reuse the common functionality. This allows for consistent error messages, and also makes it easier for a later patch to turn on support for inline anonymous base structures. Test flat-union-inline is updated to test only one feature

Re: [Qemu-devel] [PATCH] ui/cocoa.m: run custom script menu item

2015-09-30 Thread Peter Maydell
On 29 September 2015 at 18:53, Programmingkid wrote: > > On Sep 29, 2015, at 1:18 PM, Peter Maydell wrote: > >> On 29 September 2015 at 18:03, Programmingkid >> wrote: >>> Allow the user the ability to run a custom script file. >>> This patch adds a menu item called "Run Custom Script". >>> When

Re: [Qemu-devel] [PATCH v4 0/5] add ACPI node for fw_cfg on pc and arm

2015-09-30 Thread Gabriel L. Somlo
On Tue, Sep 29, 2015 at 05:15:25PM +0300, Michael S. Tsirkin wrote: > On Tue, Sep 29, 2015 at 03:59:28PM +0200, Laszlo Ersek wrote: > > On 09/29/15 12:27, Michael S. Tsirkin wrote: > > > On Sun, Sep 27, 2015 at 05:28:57PM -0400, Gabriel L. Somlo wrote: > > >> New since v3: > > >> > > >> - rebased

[Qemu-devel] [PATCH v7 04/18] qapi: Clean up qapi.py per pep8

2015-09-30 Thread Eric Blake
Silence pep8, and make pylint a bit happier. Just style cleanups, plus killing a useless comment in camel_to_upper(); no semantic changes. Signed-off-by: Eric Blake --- v7: drop useless (), avoid non-mechanical conversion of lookup within two sets v6: split off non-style changes, add in ordered

[Qemu-devel] [PATCH 2/2] target-i386: Don't left shift negative constant

2015-09-30 Thread Eduardo Habkost
Left shift of negative values is undefined behavior. Detected by clang: qemu/target-i386/translate.c:2423:26: runtime error: left shift of negative value -8 This changes the code to reverse the sign after the left shift. Signed-off-by: Eduardo Habkost --- target-i386/translate.c | 2 +- 1

Re: [Qemu-devel] [PATCH v6 15/16] qapi: Share gen_err_check()

2015-09-30 Thread Eric Blake
On 09/29/2015 08:31 AM, Markus Armbruster wrote: > > To really cut the verbosity, I figure we'd have to do something more > radical, like having cgen() recognize a (short!) pattern and replace it > with a full-blown error check. Not sure that's actually a good idea, > though :) Another radical i

[Qemu-devel] [PATCH v7 02/18] qapi: Improve 'include' error message

2015-09-30 Thread Eric Blake
Use of '"...%s" % include' to print non-strings can lead to ugly messages, such as this (if the .json change is applied without the qapi.py change): Expected a file name (string), got: OrderedDict() Better is to just omit the actual non-string value in the message. Signed-off-by: Eric Blake --

Re: [Qemu-devel] [PATCH v4 0/5] add ACPI node for fw_cfg on pc and arm

2015-09-30 Thread Gabriel L. Somlo
On Tue, Sep 29, 2015 at 03:59:28PM +0200, Laszlo Ersek wrote: > On 09/29/15 12:27, Michael S. Tsirkin wrote: > > On Sun, Sep 27, 2015 at 05:28:57PM -0400, Gabriel L. Somlo wrote: > >> New since v3: > >> > >>- rebased to work on top of 87e896ab (introducing pc-*-25 classes), > >> inserting

Re: [Qemu-devel] [PATCH v4 0/5] add ACPI node for fw_cfg on pc and arm

2015-09-30 Thread Gabriel L. Somlo
On Tue, Sep 29, 2015 at 01:27:38PM +0300, Michael S. Tsirkin wrote: > On Sun, Sep 27, 2015 at 05:28:57PM -0400, Gabriel L. Somlo wrote: > > New since v3: > > > > - rebased to work on top of 87e896ab (introducing pc-*-25 classes), > > inserting fw_cfg acpi node only for machines >= 2.5. >

Re: [Qemu-devel] [PATCH v4 3/5] acpi: pc: add fw_cfg device node to ssdt

2015-09-30 Thread Gabriel L. Somlo
On Tue, Sep 29, 2015 at 06:55:01PM +0200, Laszlo Ersek wrote: > On 09/29/15 18:46, Gabriel L. Somlo wrote: > > On Tue, Sep 29, 2015 at 12:33:40PM +0200, Laszlo Ersek wrote: > >> On 09/27/15 23:29, Gabriel L. Somlo wrote: > >>> Add a fw_cfg device node to the ACPI SSDT, on machine types > >>> pc-*-2

Re: [Qemu-devel] [PATCH] target-tilegx: Support iret instruction and related special registers

2015-09-30 Thread Chen Gang
On 9/29/15 14:34, Richard Henderson wrote: > On 09/28/2015 03:06 PM, gang.chen.5...@gmail.com wrote: >> From: Chen Gang >> >> Acording to the __longjmp tilegx libc implementation, and reference from >> tilegx ISA document, we can left iret instruction empty. The related >> code is below: >> >>

Re: [Qemu-devel] [PATCH 1/3] target-i386: add a subsection of vcpu's TSC rate in vmstate_x86_cpu

2015-09-30 Thread Dr. David Alan Gilbert
* Haozhong Zhang (haozhong.zh...@intel.com) wrote: > The newly added subsection 'vmstate_tsc_khz' in this patch results in > vcpu's TSC rate being saved on the source machine and loaded on the > target machine during the migration. > > Signed-off-by: Haozhong Zhang Hi, I'd appreciate it if you

Re: [Qemu-devel] [PATCH] ui/cocoa.m: run custom script menu item

2015-09-30 Thread Peter Maydell
On 29 September 2015 at 18:03, Programmingkid wrote: > Allow the user the ability to run a custom script file. > This patch adds a menu item called "Run Custom Script". > When the user selects it, a open-file dialog has the > user select a text file with the custom scripts to run. > This allows fo

Re: [Qemu-devel] [PATCH v6 08/16] qapi: Test use of 'number' within alternates

2015-09-30 Thread Eric Blake
On 09/29/2015 07:38 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Add some testsuite exposure for use of a 'number' as part of >> an alternate. The current state of the tree has a few bugs >> exposed by this: our input parser depends on the ordering of >> how the qapi schema declared th

Re: [Qemu-devel] [PATCH v4 3/5] acpi: pc: add fw_cfg device node to ssdt

2015-09-30 Thread Laszlo Ersek
On 09/29/15 18:46, Gabriel L. Somlo wrote: > On Tue, Sep 29, 2015 at 12:33:40PM +0200, Laszlo Ersek wrote: >> On 09/27/15 23:29, Gabriel L. Somlo wrote: >>> Add a fw_cfg device node to the ACPI SSDT, on machine types >>> pc-*-2.5 and up. While the guest-side BIOS can't utilize >>> this information

Re: [Qemu-devel] [PATCH] target-arm: Add MDCR_EL2

2015-09-30 Thread Sergey Fedorov
On 29.09.2015 20:19, Peter Maydell wrote: > On 29 September 2015 at 18:14, Sergey Fedorov wrote: >> On 29.09.2015 12:33, Peter Maydell wrote: >>> On 28 September 2015 at 11:37, Sergey Fedorov wrote: >>> This field should be named mdcr_el2 if we have it, but: >>> the reset value for this register

<    1   2   3   >