Re: [Qemu-devel] [PATCH COLO-Frame v6 30/31] COLO: Implement shutdown checkpoint

2015-06-18 Thread Paolo Bonzini
On 18/06/2015 10:58, zhanghailiang wrote: > +void qemu_system_shutdown_request(void) > +{ > +trace_qemu_system_shutdown_request(); > +/* > +* if in colo mode, we need do some significant work before respond to the > +* shutdown request. > +*/ > +if (loadvm_in_colo_state())

Re: [Qemu-devel] linux-user crashes on clone(2) when run on ppc host

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 15:23, Emilio G. Cota wrote: > On Thu, Jun 18, 2015 at 08:42:40 +0100, Peter Maydell wrote: >> > What data structures are you referring to? Are they ppc-specific? >> >> None of the code generation data structures are locked at all -- >> if two threads try to generate code at the

Re: [Qemu-devel] [PATCH] s390x: Switch to s390-ccw machine as default

2015-06-18 Thread Christian Borntraeger
Am 16.06.2015 um 23:23 schrieb Aurelien Jarno: > On 2015-06-16 23:08, Alexander Graf wrote: >> We now finally have TCG support for the basic set of instructions necessary >> to run the s390-ccw machine. That means in any aspect possible that machine >> type is now superior to the legacy s390-virtio

Re: [Qemu-devel] How to trigger faults for missing peripherals?

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 15:30, Liviu Ionescu wrote: > >> On 18 Jun 2015, at 13:21, Peter Maydell wrote: >> >> ... "do_unassigned_access" is the QOM CPUClass hook for this, > > this hook seems associated with the "Trying to execute code outside > RAM or ROM at 0x" error, which is a bit different, I wan

[Qemu-devel] isa-fdc controller missing from q35 machine types

2015-06-18 Thread Ján Tomko
Hello, commit ea96bc629cbd52be98b2967a4b4f72e91dfc3ee4 i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted dropped the controller for older machine types too, despite the commit message. It seems the logic in the merged commit does not match the original patch: http://thre

Re: [Qemu-devel] [PATCH v3 2/2] vhost user: Add RARP injection for legacy guest

2015-06-18 Thread Thibaut Collet
On Tue, Jun 16, 2015 at 10:05 AM, Jason Wang wrote: > > > On 06/16/2015 03:24 PM, Thibaut Collet wrote: >> If my understanding is correct, on a resume operation, we have the >> following callback trace: >> 1. virtio_pci_restore function that calls all restore call back of >> virtio devices >> 2. v

Re: [Qemu-devel] [PATCH COLO-Block v6 06/16] Don't allow a disk use backing reference target

2015-06-18 Thread Wen Congyang
At 2015/6/18 20:47, Stefan Hajnoczi Wrote: On Thu, Jun 18, 2015 at 04:49:11PM +0800, Wen Congyang wrote: Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block.c b/block.c index d1ed227.

[Qemu-devel] [PATCH 0/2] target-i386: fix W10 bug and bring CPUID levels closer to reality

2015-06-18 Thread Radim Krčmář
The first patch uses CPUID levels from the internet, which has a nice side effect of making W10 insider preview bootable. The second patch is a traditional buggy bug fix. Radim Krčmář (2): target-i386: emulate CPUID level of real hardware target-i386: automatically raise cpuid level to 0xd

[Qemu-devel] [PATCH 1/2] target-i386: emulate CPUID level of real hardware

2015-06-18 Thread Radim Krčmář
W10 insider has a bug where it ignores CPUID level and interprets CPUID.(EAX=07H, ECX=0H) incorrectly, because CPUID in fact returned CPUID.(EAX=04H, ECX=0H); this resulted in execution of unsupported instructions. While it's a Windows bug, there is no reason to emulate incorrect level; and amend

[Qemu-devel] [PATCH 2/2] target-i386: automatically raise cpuid level to 0xd

2015-06-18 Thread Radim Krčmář
We already bump to level 7 if features there are requested, so do the same for 0xD. Signed-off-by: Radim Krčmář --- If we want this behavior, we should not do it by writing a case for every level. target-i386/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target-i386/cpu.c b/ta

Re: [Qemu-devel] [PATCH 1/2] target-i386: emulate CPUID level of real hardware

2015-06-18 Thread Paolo Bonzini
On 18/06/2015 17:24, Radim Krčmář wrote: > W10 insider has a bug where it ignores CPUID level and interprets > CPUID.(EAX=07H, ECX=0H) incorrectly, because CPUID in fact returned > CPUID.(EAX=04H, ECX=0H); this resulted in execution of unsupported > instructions. > > While it's a Windows bug, t

Re: [Qemu-devel] [PATCH v2 1/3] error: don't rely on pointer comparisons

2015-06-18 Thread Markus Armbruster
Eric Blake writes: > On 06/17/2015 01:24 AM, Michael S. Tsirkin wrote: >> makes it possible to copy error_abort pointers, >> not just pass them on directly. >> > >> @@ -168,7 +175,7 @@ void error_free(Error *err) >> >> void error_propagate(Error **dst_errp, Error *local_err) >> { >> -if

Re: [Qemu-devel] [PATCH 1/2] target-i386: emulate CPUID level of real hardware

2015-06-18 Thread Radim Krčmář
2015-06-18 17:29+0200, Paolo Bonzini: > On 18/06/2015 17:24, Radim Krčmář wrote: > > W10 insider has a bug where it ignores CPUID level and interprets > > CPUID.(EAX=07H, ECX=0H) incorrectly, because CPUID in fact returned > > CPUID.(EAX=04H, ECX=0H); this resulted in execution of unsupported > >

Re: [Qemu-devel] [PATCH v6 7/7] hw/pci-bridge: format SeaBIOS-compliant OFW device node for PXB

2015-06-18 Thread Laszlo Ersek
On 06/18/15 15:40, Michael S. Tsirkin wrote: > On Thu, Jun 18, 2015 at 03:22:59PM +0200, Laszlo Ersek wrote: >> On 06/17/15 23:50, Michael S. Tsirkin wrote: >>> On Wed, Jun 17, 2015 at 09:44:07PM +0200, Laszlo Ersek wrote: On 06/17/15 21:32, Michael S. Tsirkin wrote: > On Wed, Jun 17, 2015

Re: [Qemu-devel] [PATCH 1/2] target-i386: emulate CPUID level of real hardware

2015-06-18 Thread Paolo Bonzini
On 18/06/2015 17:40, Radim Krčmář wrote: > > This unfortunately has to be done only for new machine types. Old types > > will remain buggy forever. > > Ah, ok, which machine type should I target, 2.4? Yes. > And is patch 2 is only supposed to work with new machine types? I'm a bit undecided t

[Qemu-devel] [PATCH 1/2] exec: do not clamp accesses to MMIO regions

2015-06-18 Thread Paolo Bonzini
It is common for MMIO registers to overlap, for example a 4 byte register at 0xcf8 (totally random choice... :)) and a 1 byte register at 0xcf9. If these registers are implemented via separate MemoryRegions, it is wrong to clamp the accesses as the value written would be truncated. Hence for these

[Qemu-devel] [PATCH 0/2] exec: fixes for access clamping

2015-06-18 Thread Paolo Bonzini
The first patch fixes the remaining problems with Peter Crosthwaite's access clamping patch (which broke kvmvapic and hence Windows XP/2003). The second patch actually puts the clamping to good use: by fixing address_space_translate_internal, the MIPS rc4030 emulation does not need anymore the addr

[Qemu-devel] [PATCH 2/2] exec: clamp accesses against the MemoryRegionSection

2015-06-18 Thread Paolo Bonzini
Because the clamping was done against the MemoryRegion, address_space_rw was effectively broken if a write spanned multiple sections that are not linear in underlying memory (with the memory not being under an IOMMU). This is visible with the MIPS rc4030 IOMMU, which is implemented as a series of

Re: [Qemu-devel] [PULL 1/1] virtio-input: evdev passthrough

2015-06-18 Thread Gerd Hoffmann
Hi, > > +static Property virtio_input_host_pci_properties[] = { > > +DEFINE_VIRTIO_INPUT_PROPERTIES(VirtIOInputPCI, vdev.input), > > +DEFINE_PROP_STRING("evdev", VirtIOInputHostPCI, vdev.evdev), > > +DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), > > +DEFINE_PROP_END

[Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread fred . konrad
From: KONRAD Frederic This mechanism replaces the existing load/store exclusive mechanism which seems to be broken for multithread. It follows the intention of the existing mechanism and stores the target address and data values during a load operation and checks that they remain unchanged before

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread Paolo Bonzini
On 18/06/2015 17:44, fred.kon...@greensocs.com wrote: > +hwaddr len = 8 << size; Should be 1 << size, and likewise below in the "if". Paolo > +hwaddr paddr; > +target_ulong page_size; > +int prot; > + > +arm_exclusive_lock(); > + > +if (env->exclusive_addr != addr) { >

Re: [Qemu-devel] [PATCH 2/2] target-i386: automatically raise cpuid level to 0xd

2015-06-18 Thread Eduardo Habkost
On Thu, Jun 18, 2015 at 05:24:24PM +0200, Radim Krčmář wrote: > We already bump to level 7 if features there are requested, so do the > same for 0xD. > > Signed-off-by: Radim Krčmář This breaks guest ABI and live-migration, as CPUID data is not part of the migration stream (although we have cons

[Qemu-devel] [PATCH/RFC] s390x/ipl: Fix boot if no bootindex was specified

2015-06-18 Thread Christian Borntraeger
commit fa92e218df1d ("s390x/ipl: avoid sign extension") introduced a regression: qemu-system-s390x -drive file=/home/cborntra/image.zhyp409,format=qcow2 does not boot, the bios states "No virtio-blk device found!" adding bootindex=1 does boot. The reason is that the uint32_t as return value will

Re: [Qemu-devel] [PATCH v3 0/2] Fix slow startup with many disks

2015-06-18 Thread Stefan Hajnoczi
On Wed, Jun 17, 2015 at 01:37:18PM +0300, Alexander Yarygin wrote: > Changes in v3: >- Added aio_context_acquire/aio_context_release around blk_drain() in > "virtio-blk: Use blk_drain() to drain IO requests" + updated commit > description > > Please update Cc: qemu-stable@ if it nece

Re: [Qemu-devel] [RFC PATCH V3] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 16:44, wrote: > +uint64_t oldval, *p; > +p = address_space_map(cs->as, paddr, &len, true); > +if (len == 8 << size) { > +oldval = (uint64_t)env->exclusive_val; > +result = (atomic_cmpxchg(p, oldval, (uint64_t)newval) == oldval);

[Qemu-devel] [PATCH v5 2/2] semihosting: add --semihosting-config arg sub-argument

2015-06-18 Thread Leon Alrae
Add new "arg" sub-argument to the --semihosting-config allowing the user to pass multiple input arguments separately. It is required for example by UHI semihosting to construct argc and argv. Also, update ARM semihosting to support new option (at the moment it is the only target which cares about

[Qemu-devel] [PATCH v5 0/2] semihosting: clean up and add --semihosting-config arg

2015-06-18 Thread Leon Alrae
Just a rebase of v4 as there were changes in qemu_opt_foreach API. Regards, Leon v5: * rebase v4: * add semihosting_get_cmdline() and update arm-semi.c to support new option * for backward compatibility use -kernel/-append to initialize semihosting.argv * update qemu doc to describe the interact

[Qemu-devel] [PATCH v5 1/2] semihosting: create SemihostingConfig structure and semihost.h

2015-06-18 Thread Leon Alrae
Remove semihosting_enabled and semihosting_target and replace them with SemihostingConfig structure containing equivalent fields. The structure is defined in vl.c where it is actually set. Also introduce separate header file include/exec/semihost.h allowing to access semihosting config related stu

Re: [Qemu-devel] [PATCH] target-s390x: fix MOVE LONG instruction

2015-06-18 Thread Richard Henderson
On 06/16/2015 04:57 PM, Aurelien Jarno wrote: The MOVE LONG instruction should pad the destination operand with the byte from bit positions 32-39 of the source length (r2 + 1), not with the same byte in the source address. Cc: Alexander Graf Cc: Richard Henderson Signed-off-by: Aurelien Jarno --

Re: [Qemu-devel] [Qemu-block] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-18 Thread Stefan Hajnoczi
On Thu, Jun 18, 2015 at 10:36:39PM +0800, Wen Congyang wrote: > At 2015/6/18 20:55, Stefan Hajnoczi Wrote: > >On Thu, Jun 18, 2015 at 04:49:12PM +0800, Wen Congyang wrote: > >>+void bdrv_connect(BlockDriverState *bs, Error **errp) > >>+{ > >>+BlockDriver *drv = bs->drv; > >>+ > >>+if (drv &

Re: [Qemu-devel] [PATCH] vvfat: add a label option

2015-06-18 Thread Stefan Hajnoczi
On Thu, Jun 18, 2015 at 04:08:41PM +0200, Wolfgang Bumiller wrote: > Till now the vvfat filesystem's label was hardcoded to be > "QEMU VVFAT", now you can pass a file.label=labelname option > to the -drive to change it. > > Signed-off-by: Wolfgang Bumiller > --- > block/vvfat.c| 25 +

Re: [Qemu-devel] [PATCH v2 1/3] error: don't rely on pointer comparisons

2015-06-18 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > makes it possible to copy error_abort pointers, > not just pass them on directly. Humor me, and start your sentences with a capital letter :) > This is needed because follow-up patches add support for > Error *local_err = ...; > as a way to set an abort-on-err

[Qemu-devel] [PATCH for-2.4 00/12] pc: KVM support for SMRAM

2015-06-18 Thread Paolo Bonzini
These are the new patches for SMRAM support, using multiple address spaces and, thus, multiple KVMMemoryListeners. No more layering violations, yay! The meat is in patches 6 and 7, which parameterize KVM's memory listener so that: 1) each memory listener handles its own array of memory slots; 2)

Re: [Qemu-devel] [PATCH v5 0/6] arm: Steps towards EL2 support round 3

2015-06-18 Thread Peter Maydell
On 16 June 2015 at 02:51, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Hi, > > This is what is left of round 3 of our series towards support for EL2 for > AArch64. > > Comments welcome! Given that we're now in softfreeze, and these patches don't actually enable a new feature by thems

[Qemu-devel] [PATCH 03/12] kvm-all: put kvm_mem_flags to more work

2015-06-18 Thread Paolo Bonzini
From: Andrew Jones Currently kvm_mem_flags just translates bools to bits, let's make it also determine the bools first. This avoids its parameter list growing each time we add a flag. Signed-off-by: Andrew Jones Signed-off-by: Paolo Bonzini --- kvm-all.c | 42 -

[Qemu-devel] [PATCH 02/12] target-i386: add support for SMBASE MSR and SMIs

2015-06-18 Thread Paolo Bonzini
Apart from the MSR, the smi field of struct kvm_vcpu_events has to be translated into the corresponding CPUX86State fields. Also, memory transaction flags depend on SMM state, so pull it from struct kvm_run on every exit from KVM to userspace. Signed-off-by: Paolo Bonzini --- target-i386/cpu.h

[Qemu-devel] [PATCH 04/12] kvm-all: remove useless typedef

2015-06-18 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- kvm-all.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 195886d..abde1cf 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -69,8 +69,6 @@ typedef struct KVMSlot int flags; } KVMSlot; -typedef struct kvm_dirty_lo

Re: [Qemu-devel] [PULL 00/10] virtio, pci fixes, enhancements

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 12:14, Michael S. Tsirkin wrote: > On Thu, Jun 18, 2015 at 11:36:26AM +0100, Peter Maydell wrote: >> Hi. I'm afraid this fails to build for OSX: >> >> LINK arm-softmmu/qemu-system-arm >> Undefined symbols for architecture x86_64: >> "_tap_fd_set_vnet_be", referenced from: >

[Qemu-devel] [PATCH 05/12] kvm-all: move internal types to kvm_int.h

2015-06-18 Thread Paolo Bonzini
i386 code will have to define a different KVMMemoryListener. Create an internal header so that KVMSlot is not exposed outside. Signed-off-by: Paolo Bonzini --- include/sysemu/kvm_int.h | 30 ++ kvm-all.c| 18 +- 2 files changed, 31 ins

[Qemu-devel] [PATCH 01/12] piix4/ich9: do not raise SMI on ACPI enable/disable commands

2015-06-18 Thread Paolo Bonzini
These commands are handled entirely by QEMU. Do not raise an SMI when they happen, because Windows (at least 2008r2) expects these commands to work and (depending on the value of APMC_EN at startup) the firmware might not have installed an SMI handler. When this happens (e.g. the kernel supports

[Qemu-devel] [PATCH 08/12] kvm-all: kvm_irqchip_create is not expected to fail

2015-06-18 Thread Paolo Bonzini
KVM_CREATE_IRQCHIP should never fail, and so should its userspace wrapper kvm_irqchip_create. The function does not do anything if the irqchip capability is not available, as is the case for PPC. With this patch, kvm_arch_init can allocate memory and it will not be leaked. Signed-off-by: Paolo B

[Qemu-devel] [PATCH 07/12] kvm-all: add support for multiple address spaces

2015-06-18 Thread Paolo Bonzini
Make kvm_memory_listener_register public, and assign a kernel address space id to each KVMMemoryListener. Signed-off-by: Paolo Bonzini --- include/sysemu/kvm_int.h | 4 kvm-all.c| 13 ++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/syse

[Qemu-devel] [PATCH 10/12] pc_piix: rename kvm_enabled to smm_enabled

2015-06-18 Thread Paolo Bonzini
We will enable SMM even if KVM is in use. Rename the field and arguments. Signed-off-by: Paolo Bonzini --- hw/acpi/piix4.c | 10 +- hw/i386/pc_piix.c| 2 +- include/hw/i386/pc.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/p

[Qemu-devel] [PATCH 12/12] pc: add SMM property

2015-06-18 Thread Paolo Bonzini
The property can take values on, off or auto. The default is "off" for KVM and pre-2.4 machines, otherwise "auto" (which makes it available on TCG or on new-enough kernels). Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 51 +++ hw/i386/p

[Qemu-devel] [PATCH 11/12] ich9: add smm_enabled field and arguments

2015-06-18 Thread Paolo Bonzini
Q35's ACPI device is hard-coding SMM availability to KVM. Place the logic where the board is created instead, so that it will be possible to override it. Signed-off-by: Paolo Bonzini --- hw/acpi/ich9.c | 5 +++-- hw/i386/pc_q35.c | 2 +- hw/isa/lpc_ich9.c | 6 -- include/

Re: [Qemu-devel] [PATCH v2 0/3] error: allow local errors to trigger abort

2015-06-18 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > It's a common idiom: > > Error *local_err = NULL; > > foo(&local_err); > ... > if (local_err) { > error_propagate(errp, local_err); > return; > } > > Unfortunately it mean

[Qemu-devel] [PATCH 09/12] target-i386: register a separate KVM address space including SMRAM regions

2015-06-18 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target-i386/kvm.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 6ee5feb..3e7b26b 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -22,7 +22,7 @@

[Qemu-devel] [PATCH 06/12] kvm-all: make KVM's memory listener more generic

2015-06-18 Thread Paolo Bonzini
No semantic change, but s->slots moves into a new struct KVMMemoryListener. KVM's memory listener becomes a member of struct KVMState, and becomes of type KVMMemoryListener. Signed-off-by: Paolo Bonzini --- include/sysemu/kvm_int.h | 5 ++ kvm-all.c| 151 ++

[Qemu-devel] [PATCH v3 0/8] -audiodev option

2015-06-18 Thread Kővágó, Zoltán
This series of patches adds a new -audiodev command line option to specify audio subsytem parameters instead of environment variables. This will later allow us to specify multiple audio backends. The syntax is something like this: -audiodev driver_name,id=id,property=value,... like: -audiodev a

[Qemu-devel] [PATCH v3 2/8] qapi: convert NumaOptions into a flat union

2015-06-18 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- numa.c | 2 +- qapi-schema.json | 47 --- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/numa.c b/numa.c index d227ccc..822a22e 100644 --- a/numa.c +++ b/numa.c @@ -141,7 +141,7 @@ static in

[Qemu-devel] [PATCH v3 3/8] qapi: change Netdev and NetLegacy into a flat union

2015-06-18 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- hw/arm/musicpal.c| 2 +- hw/core/qdev-properties-system.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 2 +- hw/ne

[Qemu-devel] [PATCH v3 6/8] opts: produce valid command line in qemu_opts_print

2015-06-18 Thread Kővágó, Zoltán
This will let us print options in a format that the user would actually write it on the command line (foo=bar,baz=asd,etc=def), without prepending a spurious comma at the beginning of the list, or quoting values unnecessarily. This patch provides the following changes: * write and id=, if the opti

Re: [Qemu-devel] [RFC v10 10/19] vfio: improve vfio_get_group to support adding as is NULL.

2015-06-18 Thread Alex Williamson
On Tue, 2015-06-16 at 16:10 +0800, Chen Fan wrote: > Signed-off-by: Chen Fan > --- > hw/vfio/common.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/hw/vfio/common.c b/hw/vfio/common.c > index df3171d..15f19a2 100644 > --- a/hw/vfio/common.c > +++ b/hw/vfio/comm

[Qemu-devel] [PATCH v3 1/8] qapi: support implicit structs in OptsVisitor

2015-06-18 Thread Kővágó, Zoltán
They are required for flat unions (you still have to allocate the structs). Signed-off-by: Kővágó, Zoltán --- qapi/opts-visitor.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index f2ad6d7..f02059d 100644 --- a/qapi/opts-visitor.c

[Qemu-devel] [PATCH v3 4/8] qapi: qapi for audio backends

2015-06-18 Thread Kővágó, Zoltán
This patch adds structures into qapi to replace the existing configuration structures used by audio backends currently. This qapi will be the base of the -audiodev command line parameter (that replaces the old environment variables based config). This is not a 1:1 translation of the old options, I

[Qemu-devel] [PATCH v3 7/8] audio: use qapi AudioFormat instead of audfmt_e

2015-06-18 Thread Kővágó, Zoltán
I had to include an enum for audio sampling formats into qapi, but that meant duplicating the audfmt_e enum. This patch replaces audfmt_e and associated values with the qapi generated AudioFormat enum. This patch is mostly a search-and-replace, except for switches where the qapi generated AUDIO_F

[Qemu-devel] [PATCH v3 5/8] qapi: support nested structs in OptsVisitor

2015-06-18 Thread Kővágó, Zoltán
The current OptsVisitor flattens the whole structure, if there are same named fields under different paths (like `in' and `out' in `Audiodev'), the current visitor can't cope with them (for example setting `frequency=44100' will set the in's frequency to 44100 and leave out's frequency unspecified)

[Qemu-devel] [PATCH 2/9] main-loop: introduce qemu_mutex_iothread_locked

2015-06-18 Thread Paolo Bonzini
This function will be used to avoid recursive locking of the iothread lock whenever address_space_rw/ld*/st* are called with the BQL held, which is almost always the case. Tracking whether the iothread is owned is very cheap (just use a TLS variable) but requires some care because now the lock mus

[Qemu-devel] [PATCH v3 8/8] audio: -audiodev command line option

2015-06-18 Thread Kővágó, Zoltán
This patch adds an -audiodev command line option, and deprecates the QEMU_* environment variables for audio backend configuration. It's syntax is similar to existing options (-netdev, -device, etc): -audiodev driver_name,property=value,... Audio drivers now get an Audiodev * as config paramters,

[Qemu-devel] [PATCH 3/9] memory: Add global-locking property to memory regions

2015-06-18 Thread Paolo Bonzini
From: Jan Kiszka This introduces the memory region property "global_locking". It is true by default. By setting it to false, a device model can request BQL-free dispatching of region accesses to its r/w handlers. The actual BQL break-up will be provided in a separate patch. Signed-off-by: Jan Ki

[Qemu-devel] [PATCH for-2.4 0/9] KVM: Do I/O outside BQL whenever possible

2015-06-18 Thread Paolo Bonzini
This is the rebased and updated version of the patches I posted a couple months ago (well before soft freeze :)). This version introduces a qemu_mutex_iothread_locked() primitive in order to avoid recursive locking of the BQL. The previous attempts, which used functions such as address_space_rw_u

[Qemu-devel] [PATCH 4/9] exec: pull qemu_flush_coalesced_mmio_buffer() into address_space_rw/ld*/st*

2015-06-18 Thread Paolo Bonzini
As memory_region_read/write_accessor will now be run also without BQL held, we need to move coalesced MMIO flushing earlier in the dispatch process. Signed-off-by: Paolo Bonzini --- exec.c | 21 + memory.c | 6 -- 2 files changed, 21 insertions(+), 6 deletions(-) diff

[Qemu-devel] [PATCH 5/9] memory: let address_space_rw/ld*/st* run outside the BQL

2015-06-18 Thread Paolo Bonzini
From: Jan Kiszka The MMIO case is further broken up in two cases: if the caller does not hold the BQL on invocation, the unlocked one takes or avoids BQL depending on the locking strategy of the target memory region and its coalesced MMIO handling. In this case, the caller should not hold _any_

[Qemu-devel] [PATCH 1/9] main-loop: use qemu_mutex_lock_iothread consistently

2015-06-18 Thread Paolo Bonzini
The next patch will require the BQL to be always taken with qemu_mutex_lock_iothread(), while right now this isn't the case. Outside TCG mode this is not a problem. In TCG mode, we need to be careful and avoid the "prod out of compiled code" step if already in a VCPU thread. This is easily done

[Qemu-devel] [PATCH 7/9] kvm: Switch to unlocked PIO

2015-06-18 Thread Paolo Bonzini
From: Jan Kiszka Do not take the BQL before dispatching PIO requests of KVM VCPUs. Instead, address_space_rw will do it if necessary. This enables completely BQL-free PIO handling in KVM mode for upcoming devices with fine-grained locking. Signed-off-by: Jan Kiszka Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 8/9] acpi: mark PMTIMER as unlocked

2015-06-18 Thread Paolo Bonzini
Accessing QEMU_CLOCK_VIRTUAL is thread-safe. Signed-off-by: Paolo Bonzini --- hw/acpi/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 0f201d8..fe6215a 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -528,6 +528,7 @@ void acpi_pm_tmr_init(ACPIR

[Qemu-devel] [PATCH 6/9] kvm: First step to push iothread lock out of inner run loop

2015-06-18 Thread Paolo Bonzini
From: Jan Kiszka This opens the path to get rid of the iothread lock on vmexits in KVM mode. On x86, the in-kernel irqchips has to be used because we otherwise need to synchronize APIC and other per-cpu state accesses that could be changed concurrently. s390x and ARM should be fine without speci

Re: [Qemu-devel] [PATCH v2 0/3] error: allow local errors to trigger abort

2015-06-18 Thread Paolo Bonzini
On 18/06/2015 18:34, Markus Armbruster wrote: > Here's an utterly trivial way to get some of the gain for none of the > complexity: make error_setg() & friends store caller's __FILE__ and > __LINE__. Yes, please!! Paolo

[Qemu-devel] [PATCH 9/9] kvm: Switch to unlocked MMIO

2015-06-18 Thread Paolo Bonzini
Do not take the BQL before dispatching MMIO requests of KVM VCPUs. Instead, address_space_rw will do it if necessary. This enables completely BQL-free MMIO handling in KVM mode for upcoming devices with fine-grained locking. Signed-off-by: Paolo Bonzini --- kvm-all.c | 3 +-- 1 file changed, 3 d

[Qemu-devel] [PATCH] q35: Re-enable FDC on pc-q35-2.3 and older

2015-06-18 Thread Eduardo Habkost
commit ea96bc629cbd52be98b2967a4b4f72e91dfc3ee4 doesn't match the patch submitted by Laszlo to qemu-devel. We reuse pc_q35_2_4_machine_options() inside pc_q35_2_3_machine_options(), so we need to undo the no_floppy change in pc_q35_2_3_machine_options(). This restores the previous behavior where a

Re: [Qemu-devel] [PATCH v5 0/6] arm: Steps towards EL2 support round 3

2015-06-18 Thread Edgar E. Iglesias
On Thu, Jun 18, 2015 at 05:27:54PM +0100, Peter Maydell wrote: > On 16 June 2015 at 02:51, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Hi, > > > > This is what is left of round 3 of our series towards support for EL2 for > > AArch64. > > > > Comments welcome! > > Given that we

[Qemu-devel] [PATCH v3 00/10] Consolidate crypto APIs & implementations

2015-06-18 Thread Daniel P. Berrange
This small series covers the crypto consolidation patches I previously posted: RFC: https://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg02038.html v1: https://lists.nongnu.org/archive/html/qemu-devel/2015-05/msg04267.html v2: https://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg00

[Qemu-devel] [PATCH v3 01/10] crypto: introduce new module for computing hash digests

2015-06-18 Thread Daniel P. Berrange
Introduce a new crypto/ directory that will (eventually) contain all the cryptographic related code. This initially defines a wrapper for initializing gnutls and for computing hashes with gnutls. The former ensures that gnutls is guaranteed to be initialized exactly once in QEMU regardless of CLI a

[Qemu-devel] [PATCH v3 03/10] crypto: move built-in D3DES implementation into crypto/

2015-06-18 Thread Daniel P. Berrange
To prepare for a generic internal cipher API, move the built-in D3DES implementation into the crypto/ directory. This is not in fact a normal D3DES implementation, it is D3DES with double & triple length modes removed, and the key bytes in reversed bit order. IOW it is crippled specifically for th

[Qemu-devel] [PATCH v3 02/10] crypto: move built-in AES implementation into crypto/

2015-06-18 Thread Daniel P. Berrange
To prepare for a generic internal cipher API, move the built-in AES implementation into the crypto/ directory Signed-off-by: Daniel P. Berrange --- block/qcow.c | 2 +- block/qcow2.c | 1 - block/qcow2.h | 2 +- crypto/Makefile.objs |

[Qemu-devel] [PATCH v3 08/10] ui: convert VNC websockets to use crypto APIs

2015-06-18 Thread Daniel P. Berrange
Remove the direct use of gnutls for hash processing in the websockets code, in favour of using the crypto APIs. This allows the websockets code to be built unconditionally removing countless conditional checks from the VNC code. Signed-off-by: Daniel P. Berrange --- configure| 19 +--

[Qemu-devel] [PATCH v3 04/10] crypto: introduce generic cipher API & built-in implementation

2015-06-18 Thread Daniel P. Berrange
Introduce a generic cipher API and an implementation of it that supports only the built-in AES and DES-RFB algorithms. The test suite checks the supported algorithms + modes to validate that every backend implementation is actually correctly complying with the specs. Signed-off-by: Daniel P. Berr

[Qemu-devel] [PATCH v3 10/10] ui: convert VNC to use generic cipher API

2015-06-18 Thread Daniel P. Berrange
Switch the VNC server over to use the generic cipher API, this allows it to use the pluggable DES implementations, instead of being hardcoded to use QEMU's built-in impl. Signed-off-by: Daniel P. Berrange --- ui/vnc.c | 52 +--- 1 file changed, 41

[Qemu-devel] [PATCH v3 07/10] block: convert quorum blockdrv to use crypto APIs

2015-06-18 Thread Daniel P. Berrange
Get rid of direct use of gnutls APIs in quorum blockdrv in favour of using the crypto APIs. This avoids the need to do conditional compilation of the quorum driver. It can simply report an error at file open file instead if the required hash algorithm isn't supported by QEMU. Signed-off-by: Daniel

[Qemu-devel] [PATCH v3 05/10] crypto: add a gcrypt cipher implementation

2015-06-18 Thread Daniel P. Berrange
If we are linking to gnutls already and gnutls is built against gcrypt, then we should use gcrypt as a cipher backend in preference to our built-in backend. This will be used when linking against GNUTLS 1.x and many GNUTLS 2.x versions. Signed-off-by: Daniel P. Berrange --- configure

[Qemu-devel] [PATCH v3 09/10] block: convert qcow/qcow2 to use generic cipher API

2015-06-18 Thread Daniel P. Berrange
Switch the qcow/qcow2 block driver over to use the generic cipher API, this allows it to use the pluggable AES implementations, instead of being hardcoded to use QEMU's built-in impl. Signed-off-by: Daniel P. Berrange --- block/qcow.c | 102 +-

[Qemu-devel] [PATCH v3 06/10] crypto: add a nettle cipher implementation

2015-06-18 Thread Daniel P. Berrange
If we are linking to gnutls already and gnutls is built against nettle, then we should use nettle as a cipher backend in preference to our built-in backend. This will be used when linking against some GNUTLS 2.x versions and all GNUTLS 3.x versions. Signed-off-by: Daniel P. Berrange --- configu

Re: [Qemu-devel] [PATCH 2/2] target-i386: automatically raise cpuid level to 0xd

2015-06-18 Thread Bandan Das
Eduardo Habkost writes: > On Thu, Jun 18, 2015 at 05:24:24PM +0200, Radim Krčmář wrote: >> We already bump to level 7 if features there are requested, so do the >> same for 0xD. But doesn't bumping to 7 for feat[ebx] have the potential to break ABI too ? >> Signed-off-by: Radim Krčmář > > This

Re: [Qemu-devel] [PATCH v3 5/8] qapi: support nested structs in OptsVisitor

2015-06-18 Thread Laszlo Ersek
On 06/18/15 18:43, Kővágó, Zoltán wrote: > The current OptsVisitor flattens the whole structure, if there are same > named fields under different paths (like `in' and `out' in `Audiodev'), > the current visitor can't cope with them (for example setting > `frequency=44100' will set the in's frequenc

[Qemu-devel] [PATCH v3 5/8] gdbserver: _fork: Change fn to accept cpu instead of env

2015-06-18 Thread Peter Crosthwaite
All callsites to this function navigate the cpu->env_ptr only for the function to take the env ptr back to the original cpu ptr. Change the function to just pass in the CPU pointer instead. Removes a core code usage of ENV_GET_CPU (in gdbstub.c). Cc: Riku Voipio Reviewed-by: Andreas Färber Signe

[Qemu-devel] [PATCH v3 1/8] cpus: Add Error argument to cpu_exec_init()

2015-06-18 Thread Peter Crosthwaite
From: Bharata B Rao Add an Error argument to cpu_exec_init() to let users collect the error. This is in preparation to change the CPU enumeration logic in cpu_exec_init(). With the new enumeration logic, cpu_exec_init() can fail if cpu_index values corresponding to max_cpus have already been hand

[Qemu-devel] [PATCH v3 3/8] ppc: Move cpu_exec_init() call to realize function

2015-06-18 Thread Peter Crosthwaite
From: Bharata B Rao Move cpu_exec_init() call from instance_init to realize. This allows any failures from cpu_exec_init() to be handled appropriately. Also add corresponding cpu_exec_exit() call from unrealize. cpu_dt_id assignment from instance_init is no longer needed since correct assignment

[Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU()

2015-06-18 Thread Peter Crosthwaite
Remove un-needed usages of ENV_GET_CPU() by converting the APIs to use CPUState pointers and retrieving the env_ptr as minimally needed. Scripted conversion for target-* change: for I in target-*/cpu.h; do sed -i \ 's/\(^int cpu_[^_]*_exec(\)[^ ][^ ]* \*s);$/\1CPUState *cpu);/' \ $I;

[Qemu-devel] [PATCH v3 6/8] cpus: Change tcg_cpu_exec arg to cpu, not env

2015-06-18 Thread Peter Crosthwaite
The sole caller of this function navigates the cpu->env_ptr only for this function to take it back the cpu pointer straight away. Pass in cpu pointer instead and grab the env pointer locally in the function. Removes a core code usage of ENV_GET_CPU(). Reviewed-by: Andreas Färber Signed-off-by: Pe

[Qemu-devel] [PATCH v3 0/8] More core code ENV_GET_CPU removals

2015-06-18 Thread Peter Crosthwaite
Hi All, I'm moving towards the goal of having no core code usages of ENV_GET_CPU. This has two advantages: 1: It means we are closer to common-obj'ing core code like exec.c, cpus.c and friends. 2: Multi arch is easier if ENV_GET_CPU() stays arch specific. It means I don't need those patches where

[Qemu-devel] [PATCH v3 4/8] translate-all: Change tb_flush() env argument to cpu

2015-06-18 Thread Peter Crosthwaite
All of the core-code usages of this API have the cpu pointer handy so pass it in. There are only 3 architecture specific usages (2 of which are commented out) which can just use ENV_GET_CPU() locally to get the cpu pointer. The reduces core code usage of the CPU env, which brings us closer to commo

Re: [Qemu-devel] [PATCH 1/2] target-i386: emulate CPUID level of real hardware

2015-06-18 Thread Bandan Das
Paolo Bonzini writes: > On 18/06/2015 17:24, Radim Krčmář wrote: >> W10 insider has a bug where it ignores CPUID level and interprets >> CPUID.(EAX=07H, ECX=0H) incorrectly, because CPUID in fact returned >> CPUID.(EAX=04H, ECX=0H); this resulted in execution of unsupported >> instructions. >>

[Qemu-devel] [PATCH v3 7/8] cpus: Change exec_init() arg to cpu, not env

2015-06-18 Thread Peter Crosthwaite
The callers (most of them in target-foo/cpu.c) to this function all have the cpu pointer handy. Just pass it to avoid an ENV_GET_CPU() from core code (in exec.c). Cc: Paolo Bonzini Cc: Richard Henderson Cc: Peter Maydell Cc: "Edgar E. Iglesias" Cc: "Andreas Färber" Cc: Eduardo Habkost Cc: Mi

Re: [Qemu-devel] [PATCH/RFC] s390x/ipl: Fix boot if no bootindex was specified

2015-06-18 Thread Aurelien Jarno
On 2015-06-18 17:54, Christian Borntraeger wrote: > commit fa92e218df1d ("s390x/ipl: avoid sign extension") introduced > a regression: > > qemu-system-s390x -drive file=/home/cborntra/image.zhyp409,format=qcow2 > does not boot, the bios states > "No virtio-blk device found!" > > adding bootindex=

[Qemu-devel] [PATCH v3 2/8] cpus: Convert cpu_index into a bitmap

2015-06-18 Thread Peter Crosthwaite
From: Bharata B Rao Currently CPUState.cpu_index is monotonically increasing and a newly created CPU always gets the next higher index. The next available index is calculated by counting the existing number of CPUs. This is fine as long as we only add CPUs, but there are architectures which are s

Re: [Qemu-devel] [PATCH 2/2] target-i386: automatically raise cpuid level to 0xd

2015-06-18 Thread Eduardo Habkost
On Thu, Jun 18, 2015 at 01:12:32PM -0400, Bandan Das wrote: > Eduardo Habkost writes: > > > On Thu, Jun 18, 2015 at 05:24:24PM +0200, Radim Krčmář wrote: > >> We already bump to level 7 if features there are requested, so do the > >> same for 0xD. > > But doesn't bumping to 7 for feat[ebx] have

Re: [Qemu-devel] [PATCH v3 5/8] qapi: support nested structs in OptsVisitor

2015-06-18 Thread Kővágó Zoltán
2015-06-18 19:15 keltezéssel, Laszlo Ersek írta: On 06/18/15 18:43, Kővágó, Zoltán wrote: The current OptsVisitor flattens the whole structure, if there are same named fields under different paths (like `in' and `out' in `Audiodev'), the current visitor can't cope with them (for example setting

Re: [Qemu-devel] [PATCH v2 0/3] Fix exceptions handling for MIPS and i386

2015-06-18 Thread Aurelien Jarno
On 2015-06-18 12:02, Paolo Bonzini wrote: > > > On 18/06/2015 11:42, Aurelien Jarno wrote: > >> > QEMU could just always compute and store the restore_state information. > >> > TCG needs to help filling it in (a new TCG opcode?), but it should be > >> > easy. > > Yes, that was another approach

[Qemu-devel] [PATCH] hw/pxb: add chassis_nr property

2015-06-18 Thread Marcel Apfelbaum
Add a chassis_nr property Instead of using PXB bus number as internal bridge's chassis nr. Suggested-by: Michael S. Tsirkin Signed-off-by: Marcel Apfelbaum --- docs/pci_expander_bridge.txt| 7 +++ hw/pci-bridge/pci_expander_bridge.c | 5 - 2 files changed, 7 insertions(+), 5 del

Re: [Qemu-devel] [PATCH] q35: Re-enable FDC on pc-q35-2.3 and older

2015-06-18 Thread Laszlo Ersek
On 06/18/15 18:49, Eduardo Habkost wrote: > commit ea96bc629cbd52be98b2967a4b4f72e91dfc3ee4 doesn't match the patch > submitted by Laszlo to qemu-devel. We reuse pc_q35_2_4_machine_options() > inside pc_q35_2_3_machine_options(), so we need to undo the no_floppy > change in pc_q35_2_3_machine_optio

<    1   2   3   4   >