Re: [Qemu-devel] [PATCH 2/2] migration/virtio: Remove simple .get/.put use

2016-01-17 Thread Cornelia Huck
On Fri, 15 Jan 2016 12:01:44 + "Dr. David Alan Gilbert" wrote: > I misunderstood the vmstate macro definition when > I reworked the virtio .get/.put - but I can't > get it to break for me, which suggests I'm perhaps > not managing to get that structure into being > sent in my tests. The firs

[Qemu-devel] [PATCH] misc: zynq-xadc: Fix off-by-one

2016-01-17 Thread Peter Crosthwaite
This bounds check was off-by-one. Fix. Reported-by: Paolo Bonzini Signed-off-by: Peter Crosthwaite --- hw/misc/zynq-xadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/zynq-xadc.c b/hw/misc/zynq-xadc.c index 1a32595..d160ff2 100644 --- a/hw/misc/zynq-xadc.c +++ b/

[Qemu-devel] [PATCH v1 12/17] target-arm: implement SCTLR.B, drop bswap_code

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini bswap_code is a CPU property of sorts ("is the iside endianness the opposite way round to TARGET_WORDS_BIGENDIAN?") but it is not the actual CPU state involved here which is SCTLR.B (set for BE32 binaries, clear for BE8). Replace bswap_code with SCTLR.B, and pass that to arm_

[Qemu-devel] [PATCH v1 13/17] arm: linux-user: don't set CPSR.E in BE32 mode

2016-01-17 Thread Peter Crosthwaite
Don't set CPSR.E for BE32 linux-user mode. As linux-user mode models BE32, using normal BE (and system mode will not), a special case is needed for user-mode where if sctlr.b is set, the CPU identifies as BE. Signed-off-by: Peter Crosthwaite --- linux-user/main.c | 2 -- target-arm/cpu.h | 12

[Qemu-devel] [PATCH v1 16/17] loader: Add data swap option to load-elf

2016-01-17 Thread Peter Crosthwaite
Some CPUs are of an opposite data-endianness to other components in the system. Sometimes elfs have the data sections layed out with this CPU data-endianess accounting for when loaded via the CPU, byte swaps (relative to other system components) will occur. The leading example, is ARM's BE32 mode,

[Qemu-devel] [PATCH v1 08/17] target-arm: cpu: Move cpu_is_big_endian to header

2016-01-17 Thread Peter Crosthwaite
From: Peter Crosthwaite There is a CPU data endianness test that is used to drive the virtio_big_endian test. Move this up to the header so it can be more generally used for endian tests. The KVM specific cpu_syncronize_state call is left behind in the virtio specific function. Signed-off-by: P

[Qemu-devel] [PATCH v1 09/17] target-arm: introduce tbflag for endianness

2016-01-17 Thread Peter Crosthwaite
From: Peter Crosthwaite Introduce a tbflags for endianness, set based upon the CPUs current endianness. This in turn propagates through to the disas endianness flag. Signed-off-by: Peter Crosthwaite --- target-arm/cpu.h | 7 +++ target-arm/translate-a64.c | 2 +- target-arm/tran

[Qemu-devel] [PATCH v1 15/17] loader: add API to load elf header

2016-01-17 Thread Peter Crosthwaite
Add an API to load an elf header header from a file. Populates a buffer with the header contents, as well as a boolean for whether the elf is 64b or not. Both arguments are optional. Signed-off-by: Peter Crosthwaite --- hw/core/loader.c| 48

[Qemu-devel] [PATCH v1 11/17] linux-user: arm: pass env to get_user_code_*

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini This matches the idiom used by get_user_data_* later in the series, and will help when bswap_code will be replaced by SCTLR.B. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini Signed-off-by: Peter Crosthwaite --- linux-user/main.c | 20 +--- 1 file

[Qemu-devel] [PATCH v1 17/17] arm: boot: Support big-endian elfs

2016-01-17 Thread Peter Crosthwaite
Support ARM big-endian ELF files in system-mode emulation. When loading an elf, determine the endianness mode expected by the elf, and set the relevant CPU state accordingly. With this, big-endian modes are now fully supported via system-mode LE, so there is no need to restrict the elf loading to

[Qemu-devel] [PATCH v1 14/17] target-arm: implement BE32 mode in system emulation

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini System emulation only has a little-endian target; BE32 mode is implemented by adjusting the low bits of the address for every byte and halfword load and store. 64-bit accesses flip the low and high words. Signed-off-by: Paolo Bonzini [PC changes: * rebased against master

[Qemu-devel] [PATCH v1 05/17] target-arm: pass DisasContext to gen_aa32_ld*/st*

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini We'll need the DisasContext in the next patch to retrieve the desired endianness, so pass it as a whole to gen_aa32_ld*/st*. Unfortunately we cannot let those functions call get_mem_index, because of user-mode load/store instructions. Signed-off-by: Paolo Bonzini [ PC chang

[Qemu-devel] [PATCH v1 03/17] linux-user: arm: handle CPSR.E correctly in strex emulation

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini Now that CPSR.E is set correctly, prepare for when setend will be able to change it; bswap data in and out of strex manually by comparing SCTLR.B, CPSR.E and TARGET_WORDS_BIGENDIAN (we do not have the luxury of using TCGMemOps). Reviewed-by: Peter Maydell Signed-off-by: Paol

[Qemu-devel] [PATCH v1 06/17] target-arm: introduce disas flag for endianness

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini Introduce a disas flag for setting the CPU data endianness. This allows control of the endianness from the CPU state rather than hard-coding it to TARGET_WORDS_BIGENDIAN. Signed-off-by: Paolo Bonzini [ PC changes: * Split off as new patch from original: "target-arm

[Qemu-devel] [PATCH v1 10/17] target-arm: implement setend

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini Since this is not a high-performance path, just use a helper to flip the E bit and force a lookup in the hash table since the flags have changed. Signed-off-by: Paolo Bonzini Signed-off-by: Peter Crosthwaite --- target-arm/helper.h| 1 + target-arm/op_helper.c | 5 +

[Qemu-devel] [PATCH v1 07/17] target-arm: a64: Add endianness support

2016-01-17 Thread Peter Crosthwaite
From: Peter Crosthwaite Set the dc->mo_endianness flag for AA64 and use it in all ldst ops. Signed-off-by: Peter Crosthwaite --- target-arm/translate-a64.c | 49 -- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/target-arm/translate

[Qemu-devel] [PATCH v1 04/17] target-arm: implement SCTLR.EE

2016-01-17 Thread Peter Crosthwaite
From: Peter Crosthwaite Implement SCTLR.EE bit which controls data endianess for exceptions and page table translations. SCTLR.EE is mirrored to the CPSR.E bit on exception entry. Signed-off-by: Peter Crosthwaite --- target-arm/helper.c | 42 -- 1 file

[Qemu-devel] [PATCH v1 01/17] linux-user: arm: fix coding style for some linux-user signal functions

2016-01-17 Thread Peter Crosthwaite
From: Paolo Bonzini Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini Signed-off-by: Peter Crosthwaite --- linux-user/signal.c | 110 ++-- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/linux-user/signal.c b/linux-user/si

[Qemu-devel] [PATCH v1 02/17] linux-user: arm: set CPSR.E/SCTLR.E0E correctly for BE mode

2016-01-17 Thread Peter Crosthwaite
From: Peter Crosthwaite If doing big-endian linux-user mode, set both the CPSR.E and SCTLR.E0E bits. This sets big-endian mode for data accesses in AA32 and AA64 resp. Signed-off-by: Peter Crosthwaite --- linux-user/main.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mai

[Qemu-devel] [PATCH v1 00/17] ARM big-endian and setend support

2016-01-17 Thread Peter Crosthwaite
Hi All, This patch series adds system-mode big-endian support for ARM. It also implements the setend instruction, and loading of BE binaries even in LE emulation mode. Based on Paolo's original work. I have moved all the BE32 related work to the back of the series. Multiple parties are interested

Re: [Qemu-devel] [RFC PATCH v2 01/10] Init colo-proxy object based on netfilter

2016-01-17 Thread Zhang Chen
On 01/16/2016 02:21 AM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: From: zhangchen add colo-proxy to vl.c and qemu-options.hx add trace-colo-proxy relation Signed-off-by: zhangchen Signed-off-by: zhanghailiang --- qemu-options.hx | 6 ++ trace

Re: [Qemu-devel] [RFC PATCH v2 00/10] Add colo-proxy based on netfilter

2016-01-17 Thread Zhang Chen
On 01/06/2016 01:16 PM, Jason Wang wrote: On 01/04/2016 07:17 PM, Zhang Chen wrote: On 01/04/2016 05:46 PM, Jason Wang wrote: On 01/04/2016 04:16 PM, Zhang Chen wrote: On 01/04/2016 01:37 PM, Jason Wang wrote: On 12/31/2015 04:40 PM, Zhang Chen wrote: On 12/31/2015 10:36 AM, Jason Wang w

Re: [Qemu-devel] [PATCH] cadence_gem: fix buffer overflow

2016-01-17 Thread Peter Crosthwaite
On Sun, Jan 17, 2016 at 10:50 PM, Jason Wang wrote: > > > On 01/14/2016 05:43 PM, Michael S. Tsirkin wrote: >> gem_receive copies a packet received from network into an rxbuf[2048] >> array on stack, with size limited by descriptor length set by guest. If >> guest is malicious and specifies a des

Re: [Qemu-devel] [PATCH] cadence_gem: fix buffer overflow

2016-01-17 Thread Jason Wang
On 01/14/2016 05:43 PM, Michael S. Tsirkin wrote: > gem_receive copies a packet received from network into an rxbuf[2048] > array on stack, with size limited by descriptor length set by guest. If > guest is malicious and specifies a descriptor length that is too large, > and should packet size e

Re: [Qemu-devel] [PATCH] net: cadence_gem: check packet size in gem_recieve

2016-01-17 Thread Jason Wang
On 01/18/2016 01:34 PM, P J P wrote: > +-- On Mon, 18 Jan 2016, Jason Wang wrote --+ > | > +if (size > sizeof(rxbuf) - sizeof(crc_val)) { > | > +size = sizeof(rxbuf) - sizeof(crc_val); > | > +} > | > +bytes_to_copy = size; > | > + > | > | We probably need more

[Qemu-devel] [PATCH] linux-user: add option to intercept execve() syscalls

2016-01-17 Thread Petros Angelatos
From: Petros Angelatos In order for one to use QEMU user mode emulation under a chroot, it is required to use binfmt_misc. This can be avoided by QEMU never doing a raw execve() to the host system. Introduce a new option, -execve=path, that sets the absolute path to the QEMU interpreter and enab

Re: [Qemu-devel] [PATCH RFC 0/4] ARM SMMUv3 Emulation

2016-01-17 Thread Prem (Premachandra) Mallappa
> Edgar has done all of the SMMU work for Xilinx, he knows it the best. > I'll let him comment on it. > > For anyone interested you can see our implementation at: > https://github.com/Xilinx/qemu/blob/master/hw/misc/arm-smmu.c. It does > use the register API that we have been trying to upstream. >

Re: [Qemu-devel] [PATCH 03/10] pseries: Clean up hash page table allocation error handling

2016-01-17 Thread Alexey Kardashevskiy
On 01/18/2016 04:35 PM, David Gibson wrote: On Mon, Jan 18, 2016 at 04:17:08PM +1100, Alexey Kardashevskiy wrote: On 01/18/2016 03:42 PM, David Gibson wrote: On Mon, Jan 18, 2016 at 01:44:00PM +1100, Alexey Kardashevskiy wrote: On 01/15/2016 11:00 PM, David Gibson wrote: The spapr_alloc_htab(

Re: [Qemu-devel] [PATCH] Propagate OEM ID info into other tables when using SLIC

2016-01-17 Thread Xiao Guangrong
Hi, Is this you wanted? https://www.mail-archive.com/qemu-devel@nongnu.org/msg345911.html On 01/16/2016 04:19 AM, Steven Newbury wrote: In order to support Windows 7 "Activation", the OEM ID info must match in SLIC and RSDT, and for UEFI, FACP. The OEM ID from the SLIC is only applied when oe

[Qemu-devel] [RFC 1/3] pseries: Stub hypercalls for HPT resizing

2016-01-17 Thread David Gibson
This introduces stub implementations of the H_RESIZE_HPT_PREPARE and H_RESIZE_HPT_COMMIT hypercalls which we hope to add in a PAPR extension to allow run time resizing of a guest's hash page table. Signed-off-by: David Gibson --- hw/ppc/spapr_hcall.c | 29 + include

Re: [Qemu-devel] [RFC 0/3] Draft implementation of HPT resizing (qemu side)

2016-01-17 Thread David Gibson
On Mon, Jan 18, 2016 at 04:44:38PM +1100, David Gibson wrote: 1;2802;0c> Here is a draft qemu implementation of my proposed PAPR extension for > allowing runtime resizing of a KVM/ppc64 guest's hash page table. > That in turn will allow for more flexible memory hotplug. > > This should work with t

[Qemu-devel] [RFC 3/3] pseries: Advertise HPT resize capability

2016-01-17 Thread David Gibson
This adds a new string to the hypertas property in the device tree, advertising to the guest the availability of the HPT resizing hypercalls. This is a tentative suggested value, and would need to be standardized by PAPR before being merged. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 3 +++

[Qemu-devel] [RFC 0/3] Draft implementation of HPT resizing (qemu side)

2016-01-17 Thread David Gibson
Here is a draft qemu implementation of my proposed PAPR extension for allowing runtime resizing of a KVM/ppc64 guest's hash page table. That in turn will allow for more flexible memory hotplug. This should work with the guest kernel side patches I also posted recently [1]. Still required to make

[Qemu-devel] [RFC 2/3] pseries: Implement HPT resizing

2016-01-17 Thread David Gibson
This patch implements hypercalls allowing a PAPR guest to resize its own hash page table. This will eventually allow for more flexible memory hotplug. The implementation is partially asynchronous, handled in a special thread running the hpt_prepare_thread() function. The state of a pending resiz

Re: [Qemu-devel] [PATCH] net: cadence_gem: check packet size in gem_recieve

2016-01-17 Thread P J P
+-- On Mon, 18 Jan 2016, Jason Wang wrote --+ | > +if (size > sizeof(rxbuf) - sizeof(crc_val)) { | > +size = sizeof(rxbuf) - sizeof(crc_val); | > +} | > +bytes_to_copy = size; | > + | | We probably need more check, is there any guarantee that size <= 2048? | If

Re: [Qemu-devel] [PATCH 03/10] pseries: Clean up hash page table allocation error handling

2016-01-17 Thread David Gibson
On Mon, Jan 18, 2016 at 04:17:08PM +1100, Alexey Kardashevskiy wrote: > On 01/18/2016 03:42 PM, David Gibson wrote: > >On Mon, Jan 18, 2016 at 01:44:00PM +1100, Alexey Kardashevskiy wrote: > >>On 01/15/2016 11:00 PM, David Gibson wrote: > >>>The spapr_alloc_htab() and spapr_reset_htab() functions c

Re: [Qemu-devel] [PATCH 03/10] pseries: Clean up hash page table allocation error handling

2016-01-17 Thread Alexey Kardashevskiy
On 01/18/2016 03:42 PM, David Gibson wrote: On Mon, Jan 18, 2016 at 01:44:00PM +1100, Alexey Kardashevskiy wrote: On 01/15/2016 11:00 PM, David Gibson wrote: The spapr_alloc_htab() and spapr_reset_htab() functions currently handle all errors with error_setg(&error_abort, ...). But really, the

Re: [Qemu-devel] [PATCH 4/4] target-ppc: ensure we include the decrementer value during migration

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 05:46:10PM +, Mark Cave-Ayland wrote: > On 12/01/16 02:44, David Gibson wrote: > > >>> In other words, isn't this just skipping the decrementer interrupts at > >>> the qemu level rather than the guest level? > >>> > >>> It seems that instead we should be reconstructing

Re: [Qemu-devel] [PATCH 03/10] pseries: Clean up hash page table allocation error handling

2016-01-17 Thread David Gibson
On Mon, Jan 18, 2016 at 01:44:00PM +1100, Alexey Kardashevskiy wrote: > On 01/15/2016 11:00 PM, David Gibson wrote: > >The spapr_alloc_htab() and spapr_reset_htab() functions currently handle > >all errors with error_setg(&error_abort, ...). > > > >But really, the callers are really better placed t

Re: [Qemu-devel] VFIO based vGPU(was Re: [Announcement] 2015-Q3 release of XenGT - a Mediated ...)

2016-01-17 Thread Alex Williamson
Hi Jike, On Mon, 2016-01-18 at 10:39 +0800, Jike Song wrote: > Hi Alex, let's continue with a new thread :) > > Basically we agree with you: exposing vGPU via VFIO can make > QEMU share as much code as possible with pcidev(PF or VF) assignment. > And yes, different vGPU vendors can share quite a

[Qemu-devel] [PATCHv3 8/9] pseries: Clean up error reporting in ppc_spapr_init()

2016-01-17 Thread David Gibson
This function includes a number of explicit fprintf()s for errors. Change these to use error_report() instead. Also replace the single exit(EXIT_FAILURE) with an explicit exit(1), since the latter is the more usual idiom in qemu by a large margin. Signed-off-by: David Gibson --- hw/ppc/spapr.c

[Qemu-devel] [PATCHv3 9/9] pseries: Clean up error reporting in htab migration functions

2016-01-17 Thread David Gibson
The functions for migrating the hash page table on pseries machine type (htab_save_setup() and htab_load()) can report some errors with an explicit fprintf() before returning an appropriate error code. Change these to use error_report() instead. Signed-off-by: David Gibson Reviewed-by: Thomas Hu

[Qemu-devel] [PATCHv3 5/9] pseries: Cleanup error handling in spapr_vga_init()

2016-01-17 Thread David Gibson
Use error_setg() to return an error rather than an explicit exit(). Previously it was an exit(0) instead of a non-zero exit code, which was simply a bug. Also improve the error message. While we're at it change the type of spapr_vga_init() to bool since that's how we're using it anyway. Signed-o

[Qemu-devel] [PATCHv3 1/9] ppc: Cleanup error handling in ppc_set_compat()

2016-01-17 Thread David Gibson
Current ppc_set_compat() returns -1 for errors, and also (unconditionally) reports an error message. The caller in h_client_architecture_support() may then report it again using an outdated fprintf(). Clean this up by using the modern error reporting mechanisms. Also add strerror(errno) to the e

[Qemu-devel] [PATCHv3 2/9] pseries: Cleanup error handling of spapr_cpu_init()

2016-01-17 Thread David Gibson
Currently spapr_cpu_init() is hardcoded to handle any errors as fatal. That works for now, since it's only called from initial setup where an error here means we really can't proceed. However, we'll want to handle this more flexibly for cpu hotplug in future so generalize this using the error repo

[Qemu-devel] [PATCHv3 4/9] pseries: Clean up error handling in spapr_validate_node_memory()

2016-01-17 Thread David Gibson
Use error_setg() and return an error, rather than using an explicit exit(). Also improve messages, and be more explicit about which constraint failed. Signed-off-by: David Gibson Reviewed-by: Bharata B Rao --- hw/ppc/spapr.c | 37 ++--- 1 file changed, 22 insert

[Qemu-devel] [PATCHv3 7/9] pseries: Clean up error handling in xics_system_init()

2016-01-17 Thread David Gibson
Use the error handling infrastructure to pass an error out from try_create_xics() instead of assuming &error_abort - the caller is in a better position to decide on error handling policy. Also change the error handling from an &error_abort to &error_fatal, since this occurs during the initial mach

[Qemu-devel] [PATCHv3 0/9] Cleanups to error reporting on ppc and spapr

2016-01-17 Thread David Gibson
Another spin of my patches to clean up a bunch of error reporting in the pseries machine type and target-ppc code, to better use the error API. Once reviewed, I hope to merge this into ppc-for-2.6 shortly. Changes in v3: * Adjusted a commit message for accuracy (suggest by Markus) * Dropped a p

[Qemu-devel] [PATCHv3 3/9] pseries: Clean up hash page table allocation error handling

2016-01-17 Thread David Gibson
The spapr_alloc_htab() and spapr_reset_htab() functions currently handle all errors with error_setg(&error_abort, ...). But really, the callers are really better placed to decide on the error handling. So, instead make the functions use the error propagation infrastructure. In the callers we cha

[Qemu-devel] [PATCHv3 6/9] pseries: Clean up error handling in spapr_rtas_register()

2016-01-17 Thread David Gibson
The errors detected in this function necessarily indicate bugs in the rest of the qemu code, rather than an external or configuration problem. So, a simple assert() is more appropriate than any more complex error reporting. Signed-off-by: David Gibson --- hw/ppc/spapr_rtas.c | 12 +++-

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/4] target-ppc: use cpu_write_xer() helper in cpu_post_load

2016-01-17 Thread David Gibson
On Fri, Jan 08, 2016 at 01:25:32PM +1100, Alexey Kardashevskiy wrote: > On 01/07/2016 05:22 AM, Mark Cave-Ayland wrote: > >Otherwise some internal xer variables fail to get set post-migration. > > > >Signed-off-by: Mark Cave-Ayland > >--- > > target-ppc/machine.c |2 +- > > 1 file changed, 1

[Qemu-devel] Regarding Intel IGD passthru support for QEMU/KVM

2016-01-17 Thread Raghavan Santhanam
Hi, Based on the Intel IGD passthru support that has been added to Qemu/Xen code base, is there any way to use/reuse the same logic currently to have a successful passthru of an Intel IGD with Qemu/KVM on a Linux host(Ubuntu x86_64) or will that require some more work in addition to what Xen code

Re: [Qemu-devel] [Qemu-arm] [PATCH] cadence_gem: fix buffer overflow

2016-01-17 Thread Jason Wang
On 01/15/2016 02:19 PM, Peter Crosthwaite wrote: > On Thu, Jan 14, 2016 at 2:03 AM, Peter Maydell > wrote: >> On 14 January 2016 at 09:43, Michael S. Tsirkin wrote: >>> gem_receive copies a packet received from network into an rxbuf[2048] >>> array on stack, with size limited by descriptor len

Re: [Qemu-devel] [PATCH] net: cadence_gem: check packet size in gem_recieve

2016-01-17 Thread Jason Wang
On 01/15/2016 03:00 PM, P J P wrote: > From: Prasad J Pandit > > While receiving packets in 'gem_receive' routine, if Frame Check > Sequence(FCS) is enabled, it copies the packet into a local > buffer without checking its size. Add check to validate packet > length against the buffer size to avo

Re: [Qemu-devel] [PATCH 06/10] pseries: Improve error handling in find_unknown_sysbus_device()

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 04:40:24PM +0100, Markus Armbruster wrote: > David Gibson writes: > > > Use error_setg() to return an error instead of using an explicit exit(). > > > > Signed-off-by: David Gibson > > --- > > hw/ppc/spapr.c | 10 ++ > > 1 file changed, 6 insertions(+), 4 deletio

Re: [Qemu-devel] [PATCH 03/10] pseries: Clean up hash page table allocation error handling

2016-01-17 Thread Alexey Kardashevskiy
On 01/15/2016 11:00 PM, David Gibson wrote: The spapr_alloc_htab() and spapr_reset_htab() functions currently handle all errors with error_setg(&error_abort, ...). But really, the callers are really better placed to decide on the error handling. So, instead make the functions use the error prop

[Qemu-devel] VFIO based vGPU(was Re: [Announcement] 2015-Q3 release of XenGT - a Mediated ...)

2016-01-17 Thread Jike Song
Hi Alex, let's continue with a new thread :) Basically we agree with you: exposing vGPU via VFIO can make QEMU share as much code as possible with pcidev(PF or VF) assignment. And yes, different vGPU vendors can share quite a lot of the QEMU part, which will do good for upper layers such as libvir

Re: [Qemu-devel] [PATCH 1/7] target-ppc: kvm: fix floating point registers sync on little-endian hosts

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 04:00:12PM +0100, Greg Kurz wrote: > On VSX capable CPUs, the 32 FP registers are mapped to the high-bits > of the 32 first VSX registers. So if you have: > > VSR31 = (uint128) 0x0102030405060708090a0b0c0d0e0f00 > > then > > FPR31 = (uint64) 0x0102030405060708 > > The ke

Re: [Qemu-devel] [PATCH 5/7] target-ppc: gdbstub: fix altivec registers for little-endian guests

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 04:00:38PM +0100, Greg Kurz wrote: > Altivec registers are 128-bit wide. They are stored in memory as two > 64-bit values that must be byteswapped when the guest is little-endian. > Let's reuse the ppc_maybe_bswap_register() helper for this. > > We also need to fix the orde

Re: [Qemu-devel] [PATCHv3 2/4] Split serial-isa into its own config option

2016-01-17 Thread David Gibson
On Sat, Jan 16, 2016 at 01:37:57PM +0100, Thomas Huth wrote: > On 15.01.2016 13:21, David Gibson wrote: > > At present, the core device model code for 8250-like serial ports > > (serial.c) and the code for serial ports attached to ISA-style legacy IO > > (serial-isa.c) are both controlled by the CO

Re: [Qemu-devel] [PATCHv3 0/4] Start allowing ISA to be configured out

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 11:21:20PM +1100, David Gibson wrote: > Finally got around to respinning this series I last sent out ~6 months > ago. > > At the moment isa-bus.c is compiled unconditionally for all targets. > However, some targets have never used legacy ISA devices. Many more > targets ha

Re: [Qemu-devel] [PATCH 0/3] Reduce abuse of rtas_st / rtas_ld

2016-01-17 Thread David Gibson
On Mon, Jan 18, 2016 at 10:51:51AM +1100, Alexey Kardashevskiy wrote: > On 01/16/2016 12:14 PM, David Gibson wrote: > >The rtas_ld() and rtas_st() helpers were designed for loading RTAS > >arguments and storing RTAS returns which are in a simple, common array > >format. > > > >However, a number of

Re: [Qemu-devel] [PATCH v9 0/3] qapi: child add/delete support

2016-01-17 Thread Wen Congyang
Ping... On 12/25/2015 05:22 PM, Changlong Xie wrote: > If quorum's child is broken, we can use mirror job to replace it. > But sometimes, the user only need to remove the broken child, and > add it later when the problem is fixed. > > ChangLog: > v9: > 1. Rebase to the newest codes > 2. Remove re

Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-17 Thread Fam Zheng
On Fri, 01/15 15:28, Kevin Wolf wrote: > Am 15.01.2016 um 03:09 hat Fam Zheng geschrieben: > > The implicit casting from unsigned int to double changes negative values > > into large positive numbers and accepts them. We should instead print > > an error. > > > > Check the number range so this ca

Re: [Qemu-devel] [PATCH 00/10] Cleanups to error reporting on ppc and spapr (v2)

2016-01-17 Thread Alexey Kardashevskiy
On 01/16/2016 02:47 AM, Markus Armbruster wrote: David Gibson writes: Here's a new spin of my patches to clean up a bunch of error reporting in the pseries machine type and target-ppc code, to better use the error API. Once reviewed, I hope to merge this into ppc-for-2.6 shortly. There's an

Re: [Qemu-devel] [PATCH 0/3] Reduce abuse of rtas_st / rtas_ld

2016-01-17 Thread Alexey Kardashevskiy
On 01/16/2016 12:14 PM, David Gibson wrote: The rtas_ld() and rtas_st() helpers were designed for loading RTAS arguments and storing RTAS returns which are in a simple, common array format. However, a number of RTAS routines - and even non-RTAS routines - have started using these for accessing o

Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X

2016-01-17 Thread Programmingkid
On Jan 17, 2016, at 6:22 PM, Paolo Bonzini wrote: > > > On 17/01/2016 23:23, Programmingkid wrote: >> When compiling under Xcode, the program does compile and run. It prints "GCC >> version = 4.2.1". >> >> When I try to compile it under gcc 4.2.1 using just the terminal, I see this >> error

Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X

2016-01-17 Thread Paolo Bonzini
On 17/01/2016 23:23, Programmingkid wrote: > When compiling under Xcode, the program does compile and run. It prints "GCC > version = 4.2.1". > > When I try to compile it under gcc 4.2.1 using just the terminal, I see this > error message: > main.cpp: In function ‘int main(int, char* const*)’:

[Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X

2016-01-17 Thread Programmingkid
I was wondering if you had problems compiling QEMU on Mac OS X recently. On my system, the channel-socket.c file causes this error: io/channel-socket.c: In function 'qio_channel_socket_writev': io/channel-socket.c:497:18: error: variable-sized object may not be initialized char control[CMSG_

[Qemu-devel] Using directory as initrd

2016-01-17 Thread Kasper Dupont
I would like to use a directory as initrd file without having to write it to an initrd file each time I have changed anything in that directory. I have written code to pipe an initrd directly from cpio to qemu. Do you have any feedback on the attached patch? -- Kasper Dupont -- Rigtige mænd skri

[Qemu-devel] ping: [PATCH v12] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2016-01-17 Thread Programmingkid
https://patchwork.ozlabs.org/patch/555945/ > Mac OS X can be picky when it comes to allowing the user > to use physical devices in QEMU. Most mounted volumes > appear to be off limits to QEMU. If an issue is detected, > a message is displayed showing the user how to unmount a > volume. > > Signed

Re: [Qemu-devel] [PATCH RESEND] softfloat: fix return type of roundAndPackFloat16

2016-01-17 Thread Aurelien Jarno
On 2016-01-15 14:21, Peter Maydell wrote: > On 13 January 2016 at 16:03, Aurelien Jarno wrote: > > The roundAndPackFloat16 function should return a float16 value, not a > > float32 one. Fix that. > > > > Cc: Peter Maydell > > Signed-off-by: Aurelien Jarno > > --- > > fpu/softfloat.c | 2 +- > >

Re: [Qemu-devel] [PATCH 5/8] ipmi: add ACPI power and GUID commands

2016-01-17 Thread Michael S. Tsirkin
On Sun, Jan 17, 2016 at 02:04:32PM +0200, Marcel Apfelbaum wrote: > On 01/05/2016 07:29 PM, Cédric Le Goater wrote: > >Signed-off-by: Cédric Le Goater > >--- > > hw/ipmi/ipmi_bmc_sim.c | 55 > > ++ > > 1 file changed, 55 insertions(+) > > > >diff -

Re: [Qemu-devel] [V3 4/4] hw/pci-host: Emulate AMD IO MMU

2016-01-17 Thread Marcel Apfelbaum
On 01/14/2016 10:04 AM, David Kiarie wrote: Support AMD IO MMU emulation in q35 and piix chipsets Signed-off-by: David Kiarie --- hw/pci-host/piix.c | 11 +++ hw/pci-host/q35.c | 16 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/piix.c

Re: [Qemu-devel] [V3 2/4] hw/core: Add AMD IO MMU to machine properties

2016-01-17 Thread Marcel Apfelbaum
On 01/14/2016 10:04 AM, David Kiarie wrote: Add IO MMU as a string to machine properties which is used to control whether and they type of IO MMU to emulate Signed-off-by: David Kiarie --- hw/core/machine.c | 17 + include/hw/boards.h | 3 ++- qemu-options.hx | 6 +++

Re: [Qemu-devel] [PATCH v4 2/2] change type of pci_bridge_initfn() to void

2016-01-17 Thread Marcel Apfelbaum
On 01/15/2016 04:23 AM, Cao jin wrote: Since it can`t fail. Also modify the callers. Signed-off-by: Cao jin Reviewed-by: Markus Armbruster --- hw/pci-bridge/i82801b11.c | 5 + hw/pci-bridge/ioh3420.c| 6 +- hw/pci-bridge/pci_bridge_dev.c | 8 +++- hw/p

Re: [Qemu-devel] [PATCH v16 05/14] vfio: add pcie extanded capability support

2016-01-17 Thread Marcel Apfelbaum
On 01/12/2016 04:43 AM, Cao jin wrote: From: Chen Fan Hi, I noticed a type in the subject, extanded -> extended For vfio pcie device, we could expose the extended capability on PCIE bus. in order to avoid config space broken, we introduce a copy config for parsing extended caps. and rebuil

Re: [Qemu-devel] [PATCH v16 02/14] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-01-17 Thread Marcel Apfelbaum
On 01/12/2016 04:43 AM, Cao jin wrote: From: Chen Fan squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) dif

Re: [Qemu-devel] [PATCH v16 01/14] vfio: extract vfio_get_hot_reset_info as a single function

2016-01-17 Thread Marcel Apfelbaum
On 01/12/2016 04:43 AM, Cao jin wrote: From: Chen Fan the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 ins

Re: [Qemu-devel] [PATCH v16 04/14] vfio: make the 4 bytes aligned for capability size

2016-01-17 Thread Marcel Apfelbaum
On 01/12/2016 04:43 AM, Cao jin wrote: From: Chen Fan this function search the capability from the end, the last size should 0x100 - pos, not 0xff - pos. Indeed, "next" should be the first address of the next capability. Reviewed-by: Marcel Apfelbaum Signed-off-by: Chen Fan --- hw/vf

Re: [Qemu-devel] [PATCH 01/10] ppc: Cleanup error handling in ppc_set_compat()

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 04:19:18PM +0100, Markus Armbruster wrote: > David Gibson writes: > > > Current ppc_set_compat() returns -1 for errors, and also (unconditionally) > > reports an error message. The caller in h_client_architecture_support() > > may then report it again using an outdated fp

[Qemu-devel] [PATCH v6 5/6] Add Error **errp for xen_pt_config_init()

2016-01-17 Thread Cao jin
To catch the error message. Also modify the caller Signed-off-by: Cao jin Reviewed-by: Eric Blake --- hw/xen/xen_pt.c | 8 --- hw/xen/xen_pt.h | 2 +- hw/xen/xen_pt_config_init.c | 51 - 3 files changed, 33 insertions(+),

[Qemu-devel] [PATCH v6 1/6] Change xen_host_pci_sysfs_path() to return void

2016-01-17 Thread Cao jin
And assert the snprintf() error, because user can do nothing in case of snprintf() fail. Signed-off-by: Cao jin --- hw/xen/xen-host-pci-device.c | 35 +++ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-hos

[Qemu-devel] [PATCH v6 6/6] Xen PCI passthru: convert to realize()

2016-01-17 Thread Cao jin
Signed-off-by: Cao jin Reviewed-by: Eric Blake --- hw/xen/xen_pt.c | 53 - 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 9eef3df..d33221b 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt

[Qemu-devel] [PATCH v6 0/6] Xen PCI passthru: Convert to realize()

2016-01-17 Thread Cao jin
v6 changelog: 1. split modification of xen_host_pci_sysfs_path() into a separate new patch as 1/6 shows. 2. 'bug' fix of qemu_strtoul(), in patch 2/6 & 3/6 3. Grammar fix in patch 4/6 4. 'msg' --> 'message' in commit message. Cao jin (6): Change xen_host_pci_sysfs_path() to return void Xen:

[Qemu-devel] [PATCH v6 4/6] Add Error **errp for xen_pt_setup_vga()

2016-01-17 Thread Cao jin
To catch the error message. Also modify the caller Signed-off-by: Cao jin Reviewed-by: Eric Blake --- hw/xen/xen_pt.c | 7 +-- hw/xen/xen_pt.h | 3 ++- hw/xen/xen_pt_graphics.c | 11 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/xen/xen_p

[Qemu-devel] [PATCH v6 3/6] Add Error **errp for xen_host_pci_device_get()

2016-01-17 Thread Cao jin
To catch the error message. Also modify the caller Signed-off-by: Cao jin --- hw/xen/xen-host-pci-device.c | 102 --- hw/xen/xen-host-pci-device.h | 5 ++- hw/xen/xen_pt.c | 13 +++--- 3 files changed, 68 insertions(+), 52 deletions(-) dif

[Qemu-devel] [PATCH v6 2/6] Xen: use qemu_strtoul instead of strtol

2016-01-17 Thread Cao jin
No need to roll our own (with slightly incorrect handling of errno), when we can use the common version. Change signed parsing to unsigned, because what it read are values in PCI config space, which are non-negative. Signed-off-by: Cao jin --- hw/xen/xen-host-pci-device.c | 12 1 f

Re: [Qemu-devel] [PATCH 5/8] ipmi: add ACPI power and GUID commands

2016-01-17 Thread Marcel Apfelbaum
On 01/17/2016 02:04 PM, Marcel Apfelbaum wrote: On 01/05/2016 07:29 PM, Cédric Le Goater wrote: Signed-off-by: Cédric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/

Re: [Qemu-devel] [PATCH 5/8] ipmi: add ACPI power and GUID commands

2016-01-17 Thread Marcel Apfelbaum
On 01/05/2016 07:29 PM, Cédric Le Goater wrote: Signed-off-by: Cédric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 60586a67104e..c3a06d0ac7e4 1

Re: [Qemu-devel] [PATCH] vhost-user: Slave crashes as Master unmaps vrings during guest reboot

2016-01-17 Thread Michael S. Tsirkin
On Fri, Jan 15, 2016 at 12:12:44PM -0800, Shesha Sreenivasamurthy wrote: > Send VHOST_USER_RESET_OWNER when the device is stopped. > > Signed-off-by: Shesha Sreenivasamurthy That's a bad commit log. A good one should describe why changes are made, not what they are (that can be seen from the ch

Re: [Qemu-devel] [PATCH] vhost-user: Slave crashes as Master unmaps vrings during guest reboot

2016-01-17 Thread Michael S. Tsirkin
On Fri, Jan 15, 2016 at 12:12:43PM -0800, Shesha Sreenivasamurthy wrote: > Problem: > > If a guest has vhost-user enabled, then on reboot vhost_virtqueue_stop > is invoked. This unmaps vring memory mappings. However, it will not give > any indication to the underlying DPDK slave applicatio

Re: [Qemu-devel] [PATCH v5 2/5] Add Error **errp for xen_host_pci_device_get()

2016-01-17 Thread Cao jin
On 01/16/2016 12:41 AM, Eric Blake wrote: On 01/14/2016 08:11 PM, Cao jin wrote: buf[rc] = 0; -rc = qemu_strtoul(buf, &endptr, base, &value); -if (!rc) { -*pvalue = value; +rc = qemu_strtoul(buf, &endptr, base, (unsigned long *)pvalue); Ouch. Casting unsigned int

Re: [Qemu-devel] [PATCH v5 0/5] Xen PCI passthru: Convert to realize()

2016-01-17 Thread Cao jin
On 01/15/2016 10:16 PM, Stefano Stabellini wrote: On Thu, 14 Jan 2016, Eric Blake wrote: On 01/14/2016 09:50 AM, Stefano Stabellini wrote: Eric, I'll wait for your reviewed-by on the whole series before committing. Found a bug in 2/5, up to you if you want to fix that or wait for a v6. I

[Qemu-devel] [PATCH 25/51] paaudio: fix playback glitches

2016-01-17 Thread Volker Rümelin
Hi, a better way to fix the playback glitches is to use a bigger playback buffer on pulseaudio server side. I suggest you replace your patch with a patch like this one: diff --git a/audio/paaudio.c b/audio/paaudio.c index fea6071..8bd5b91 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -554

Re: [Qemu-devel] [PATCH 00/10] Cleanups to error reporting on ppc and spapr (v2)

2016-01-17 Thread David Gibson
On Fri, Jan 15, 2016 at 04:47:53PM +0100, Markus Armbruster wrote: > David Gibson writes: > > > Here's a new spin of my patches to clean up a bunch of error reporting > > in the pseries machine type and target-ppc code, to better use the > > error API. > > > > Once reviewed, I hope to merge this