Re: [Qemu-devel] [PATCH 3/9] hw/arm: QOM'ify integratorcp.c

2016-09-18 Thread Peter Maydell
On 7 March 2016 at 07:05, xiaoqiang zhao wrote: > * Drop the use of old SysBus init function and use instance_init > * Remove the empty 'icp_pic_class_init' from Typeinfo > > Signed-off-by: xiaoqiang zhao Hi Xiaoqiang; this commit has been reported as causing a regression: https://bugs.launchpad

[Qemu-devel] [PATCH 0/6] firmware-qemu_fw_cfg: Fine-tuning for four function implementations

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 14:43:21 +0200 Some update suggestions were taken into account from static source code analysis. Markus Elfring (6): Use kmalloc_array() in fw_cfg_register_dir_entries() Improve a size determination in fw_cfg_register_file() Rename jump labels in

[Qemu-devel] [PATCH 1/6] firmware-qemu_fw_cfg: Use kmalloc_array() in fw_cfg_register_dir_entries()

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 09:39:31 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by using the Coccinelle s

[Qemu-devel] [PATCH 2/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_register_file()

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 10:43:27 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Mar

[Qemu-devel] [PATCH 3/6] firmware-qemu_fw_cfg: Rename jump labels in fw_cfg_register_file()

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 11:23:46 +0200 Adjust jump labels according to the current Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/firmware/qemu_fw_cfg.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/q

[Qemu-devel] [PATCH 4/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_build_symlink()

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 14:02:02 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Mar

[Qemu-devel] [PATCH 5/6] firmware-qemu_fw_cfg: Rename jump labels in fw_cfg_sysfs_probe()

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 14:04:48 +0200 Adjust jump labels according to the current Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/firmware/qemu_fw_cfg.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/dri

[Qemu-devel] [PATCH 6/6] firmware-qemu_fw_cfg: Move a variable assignment in fw_cfg_sysfs_probe()

2016-09-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Sep 2016 14:25:55 +0200 One local variable was set to an error code before a concrete error situation was detected. Thus move the corresponding assignment into two if branches to indicate a software failure there. Signed-off-by: Markus Elfring --- drivers/fir

[Qemu-devel] [Bug 1624896] [NEW] [PPC] SegFault due to Stack Overflow in E500

2016-09-18 Thread Cláudio Silva
Public bug reported: I am getting a Segmentation Fault while simulating a PowerPC e500. I've tried to debug the problem and I've found that it occurs when you have a 0 value decrementer. The function trace is the following: 1) __cpu_ppc_store_decr (ppc.c) is called with value = 0 and raise_ex

Re: [Qemu-devel] [PATCH qemu v2] tap: Allow specifying a bridge

2016-09-18 Thread Alexey Kardashevskiy
On 15/09/16 07:04, Paolo Bonzini wrote: > > > On 13/09/2016 09:11, Alexey Kardashevskiy wrote: >> The tap backend is already using qemu-bridge-helper to attach tap >> interface to a bridge but (unlike the bridge backend) it always uses >> the default bridge name - br0. >> >> This adds a "br" prop

Re: [Qemu-devel] [PATCH v3 1/2] block: sync bdrv_co_get_block_status_above() with bdrv_is_allocated_above()

2016-09-18 Thread Fam Zheng
On Thu, 09/15 19:34, Denis V. Lunev wrote: > They should work very similar, covering same areas if backing store is > shorter than the image. This change is necessary for the followup patch > switching to bdrv_get_block_status_above() in mirror to avoid assert > in check_block. > > This change sho

[Qemu-devel] [PATCH] virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d

2016-09-18 Thread Li Qiang
From: Li Qiang In virtio gpu resource create dispatch, if the pixman format is zero it doesn't free the resource object allocated previously. Thus leading a host memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+)

Re: [Qemu-devel] [RFC Design Doc] Enable Shared Virtual Memory feature in pass-through scenarios

2016-09-18 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Wednesday, September 14, 2016 7:35 PM > > Hi, > > I'm sending this email for the enabling design of supporting SVM in > pass-through scenario. > Comments are welcome. Pls let me know anything that failed to make you clear. > And any > suggestions regards to the format

[Qemu-devel] [PATCH] usb: ehci: fix memory leak in ehci_process_itd

2016-09-18 Thread Li Qiang
From: Li Qiang While processing isochronous transfer descriptors(iTD), if the page select(PG) field value is out of bands it will return. In this situation the ehci's sg list doesn't be freed thus leading a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/usb/hcd-ehci.c

Re: [Qemu-devel] [PATCH v8 01/12] util: Add UUID API

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:21PM +0800, Fam Zheng wrote: > A number of different places across the code base use CONFIG_UUID. Some > of them are soft dependency, some are not built if libuuid is not > available, some come with dummy fallback, some throws runtime error. > > It is hard to maintain

Re: [Qemu-devel] [PATCH v8 02/12] uuid: Make null_uuid static

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:22PM +0800, Fam Zheng wrote: > So that it doesn't have to be zeroed at each call. > > Suggested-by: Eric Blake > Signed-off-by: Fam Zheng > --- > util/uuid.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/util/uuid.c b/util/uuid.c > index

Re: [Qemu-devel] [PATCH v8 06/12] crypto: Switch to QEMU UUID API

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:26PM +0800, Fam Zheng wrote: > The uuid generation doesn't return error, so update the function > signature and calling code accordingly. > > Signed-off-by: Fam Zheng > Reviewed-by: Eric Blake > --- > crypto/block-luks.c | 26 +++--- > 1 file ch

Re: [Qemu-devel] [PATCH v8 05/12] vpc: Use QEMU UUID API

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:25PM +0800, Fam Zheng wrote: > Previously we conditionally generated footer->uuid, when libuuid was > available. Now that we have a built-in implementation, we can switch to > it. > > Signed-off-by: Fam Zheng > Reviewed-by: Eric Blake > --- > block/vpc.c | 10 +++--

Re: [Qemu-devel] [PATCH v8 08/12] configure: Remove detection code for UUID

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:28PM +0800, Fam Zheng wrote: > All code now uses built-in UUID implementation. Remove the code of > libuuid and make --enable-uuid and --disable-uuid only print a message. > > Signed-off-by: Fam Zheng > Reviewed-by: Eric Blake > --- > configure | 43 ---

Re: [Qemu-devel] [PATCH v8 03/12] vhdx: Use QEMU UUID API

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:23PM +0800, Fam Zheng wrote: > This removes our dependency to libuuid, so that the driver can always be > built. > > Similar to how we handled data plane configure options, --enable-vhdx > and --disable-vhdx are also changed to a nop with a message saying it's > obsol

Re: [Qemu-devel] [PATCH v8 07/12] tests: No longer dependent on CONFIG_UUID

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:27PM +0800, Fam Zheng wrote: > crypto now uses built-in uuid implementation, so this check is not > needed. > > Signed-off-by: Fam Zheng > Reviewed-by: Eric Blake > --- > tests/test-crypto-block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --

Re: [Qemu-devel] [PATCH v8 04/12] vdi: Use QEMU UUID API

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:24PM +0800, Fam Zheng wrote: > The UUID operations we need from libuuid are fully supported by QEMU UUID > implementation. Use it, and remove the unused code. > > Signed-off-by: Fam Zheng > Reviewed-by: Eric Blake > --- > block/vdi.c | 73 > ++-

Re: [Qemu-devel] [PATCH v8 09/12] vl: Switch qemu_uuid to QemuUUID

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:29PM +0800, Fam Zheng wrote: > Update all qemu_uuid users as well, especially get rid of the duplicated > low level g_strdup_printf, sscanf and snprintf calls with QEMU UUID API. > > Since qemu_uuid_parse is quite tangled with qemu_uuid, its switching to > QemuUUID is

Re: [Qemu-devel] [PATCH qemu] spapr_pci: Add numa node id

2016-09-18 Thread Bharata B Rao
On Wed, Sep 14, 2016 at 07:39:10PM +1000, Alexey Kardashevskiy wrote: > On 14/09/16 09:29, Michael Roth wrote: > > Quoting Alexey Kardashevskiy (2016-07-27 03:03:38) > >> This adds a numa id property to a PHB to allow linking passed PCI device > >> to CPU/memory. It is up to the management stack to

Re: [Qemu-devel] [PATCH v8 10/12] uuid: Tighten uuid parse

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:30PM +0800, Fam Zheng wrote: > sscanf is relatively loose (tolerate) on some invalid formats that we > should fail instead of generating a wrong uuid structure, like with > whitespaces and short strings. > > Add and use a helper function to first check the format. >

Re: [Qemu-devel] [PATCH v8 11/12] tests: Add uuid tests

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:31PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > tests/Makefile.include | 2 + > tests/test-uuid.c | 177 > + > 2 files changed, 179 insertions(+) > create mode 100644 tests/test-uuid.c > > diff

Re: [Qemu-devel] [PATCH v8 12/12] Add UUID files to MAINTAINERS

2016-09-18 Thread Jeff Cody
On Sun, Sep 18, 2016 at 12:25:32PM +0800, Fam Zheng wrote: > I understand that we've been keeping eyes on the uncovered files. Since > I'm adding some more files I volunteer to look after them in the futuer. > > Signed-off-by: Fam Zheng > --- > MAINTAINERS | 6 ++ > 1 file changed, 6 inserti

Re: [Qemu-devel] [PATCH v3 1/2] block: sync bdrv_co_get_block_status_above() with bdrv_is_allocated_above()

2016-09-18 Thread Denis V. Lunev
On 09/19/2016 04:21 AM, Fam Zheng wrote: > On Thu, 09/15 19:34, Denis V. Lunev wrote: >> They should work very similar, covering same areas if backing store is >> shorter than the image. This change is necessary for the followup patch >> switching to bdrv_get_block_status_above() in mirror to avoid

Re: [Qemu-devel] [PATCH v2 0/5] spapr: convert SPAPR devices to trace framework

2016-09-18 Thread David Gibson
On Fri, Sep 16, 2016 at 02:39:06PM +0200, Laurent Vivier wrote: > Define and use trace_spapr_XXX functions instead of > DPRINTF to trace some SPAPR devices: spapr_vio, spapr_drc, spapr_rtas, > spapr_llan, spapr_vscsi. > > This allows to enable dynamically (instead of recompiling the source) > the

Re: [Qemu-devel] [PATCH 05/26] ppc: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)

2016-09-18 Thread David Gibson
On Fri, Sep 16, 2016 at 03:55:56PM +0200, Laurent Vivier wrote: > This patch is the result of coccinelle script > scripts/coccinelle/exit.cocci > > Signed-off-by: Laurent Vivier > CC: David Gibson Reviewed-by: David Gibson > --- > device_tree.c | 18 > hw/intc/

Re: [Qemu-devel] [PATCH RFC] pci: call PCIDeviceClass->exit on its .realize failure

2016-09-18 Thread Cao jin
Hi, sorry for replying late(was in vacation). On 09/14/2016 07:59 PM, Marcel Apfelbaum wrote: On 09/14/2016 12:14 PM, Cao jin wrote: It cannot guarantee all pci devices will free the allocated resource in its .realize function on realize failure. CC: Michael S. Tsirkin CC: Marcel Apfelbau

[Qemu-devel] [PATCH v5 0/3] ppc: handle broadcast tlb flush

2016-09-18 Thread Nikunj A Dadhania
PowerPC failed to handle broadcast TLB flush operations. Executing instructions that are defined architecturally as synchronizing global TLB should have a global effect. * tlbie on BookS * tlbivax on BookE * H_CALLs (H_REMOVE, H_BULK_REMOVE and H_PROTECT) in case of pseries, since they contai

[Qemu-devel] [PATCH v5 1/3] target-ppc: add TLB_NEED_LOCAL_FLUSH flag

2016-09-18 Thread Nikunj A Dadhania
Introduces bit-flag in CPUPPCState::tlb_need_flush: TLB_NEED_LOCAL_FLUSH (0x1) - Flush local tlb This would indicate a pending local tlb flush (isync instructions, interrupts, ...) Signed-off-by: Nikunj A Dadhania --- target-ppc/cpu.h | 1 + target-ppc/helper_regs.h | 4 ++-- target-

Re: [Qemu-devel] [PATCH] Add resolutions via the command-line

2016-09-18 Thread Benjamin Herrenschmidt
On Sat, 2016-09-17 at 23:31 -0400, G 3 wrote: > Add the ability to add resolutions from the command-line. This > patch   > works by > looking for a property called 'resolutions' in the options node of   > OpenBIOS. > If it is found all the resolutions are parsed and loaded. > > Example command-lin

[Qemu-devel] [PATCH v5 2/3] target-ppc: add flag in chech_tlb_flush()

2016-09-18 Thread Nikunj A Dadhania
We flush the qemu TLB lazily. check_tlb_flush is called whenever we hit a context synchronizing event or instruction that requires a pending flush to be performed. However, we fail to handle broadcast TLB flush operations. In order to fix that efficiently, we want to differenciate whether check_tl

[Qemu-devel] [PATCH v5 3/3] target-ppc: tlbie/tlbivax should have global effect

2016-09-18 Thread Nikunj A Dadhania
tlbie (BookS) and tlbivax (BookE) plus the H_CALLs(pseries) should have a global effect. Introduces TLB_NEED_GLOBAL_FLUSH flag. During lazy tlb flush, after taking care of pending local flushes, check broadcast flush(at context synchronizing event ptesync/tlbsync, etc) is needed. Depending on the

[Qemu-devel] [PATCH v4 0/9] sPAPR xics rework/cleanup

2016-09-18 Thread Nikunj A Dadhania
sPAPR xics related changes required for powernv platform. This brings infrastructure to get the xics native mode for powernv. Tested pseries guests in KVM and TCG mode. These are the pending patches of the original set. Changelog v3: * Added ICP_Native and XICSNative in "native" implementation *

[Qemu-devel] [PATCH v4 4/9] ppc/xics: An ICS with offset 0 is assumed to be uninitialized

2016-09-18 Thread Nikunj A Dadhania
From: Benjamin Herrenschmidt This will make life easier for dealing with dynamically configured ICSes such as PHB3 Signed-off-by: Benjamin Herrenschmidt Reviewed-by: David Gibson Signed-off-by: Nikunj A Dadhania --- include/hw/ppc/xics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Qemu-devel] [PATCH v4 1/9] ppc/xics: account correct irq status

2016-09-18 Thread Nikunj A Dadhania
Fix inconsistent irq status, because of this in the trace logs, for e.g. LSI status was 0x7, i.e. XICS_STATUS_ASSERTED, XICS_STATUS_SENT and XICS_STATUS_REJECTED all set, which did not make sense. So the REJECTED would have been set in earlier interrupt cycle, and then asserted and sent in this cur

[Qemu-devel] [PATCH v4 2/9] ppc/xics: Fix migration failure with kernel-irqchip=off

2016-09-18 Thread Nikunj A Dadhania
With a single cpu VM running with kernel-irqchip=off and a flood ping running in the guest. Migration fails once in few times. Found that whenever there is an interrupt (in this case lsi int 3 from e1000), we raise an interrupt using qemu_irq_pulse() and also see that the kvm ioctl is complete. 6

[Qemu-devel] [PATCH v4 3/9] ppc/xics: Make the ICSState a list

2016-09-18 Thread Nikunj A Dadhania
From: Benjamin Herrenschmidt Instead of an array of fixed sized blocks, use a list, as we will need to have sources with variable number of interrupts. SPAPR only uses a single entry. Native will create more. If performance becomes an issue we can add some hashed lookup but for now this will do f

[Qemu-devel] [PATCH v4 5/9] ppc/xics: Use a helper to add a new ICS

2016-09-18 Thread Nikunj A Dadhania
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt [Move object allocation and adding child to the helper] Signed-off-by: Nikunj A Dadhania Reviewed-by: David Gibson --- hw/intc/xics.c| 10 ++ hw/intc/xics_spapr.c | 6 +- include/hw/ppc/xics.h | 1 + 3 f

[Qemu-devel] [PATCH v4 7/9] ppc/xics: Add "native" XICS subclass

2016-09-18 Thread Nikunj A Dadhania
From: Benjamin Herrenschmidt This provides MMIO based ICP access as found on POWER8 Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Nikunj A Dadhania --- default-configs/ppc64-softmmu.mak | 3 +- hw/intc/Makefile.objs | 1 + hw/intc/xics_native.c | 295 +++

[Qemu-devel] [PATCH v4 8/9] ppc/xics: Add xics to the monitor "info pic" command

2016-09-18 Thread Nikunj A Dadhania
From: Benjamin Herrenschmidt Useful to debug interrupt problems. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Nikunj A Dadhania --- hmp-commands-info.hx | 2 ++ hw/intc/xics.c| 38 ++ hw/ppc/ppc.c | 14 ++ include/hw/p

[Qemu-devel] [PATCH v4 6/9] ppc/xics: Split ICS into ics-base and ics class

2016-09-18 Thread Nikunj A Dadhania
From: Benjamin Herrenschmidt The existing implementation remains same and ics-base is introduced. The type name "ics" is retained, and all the related functions renamed as ics_simple_* This will allow different implementations for the source controllers such as the MSI support of PHB3 on Power8

[Qemu-devel] [PATCH v4 9/9] ppc/xics: move set_nr_{irqs, servers} to xics.c

2016-09-18 Thread Nikunj A Dadhania
Get this duplicate code in the base implementation. Signed-off-by: Nikunj A Dadhania --- hw/intc/xics.c| 74 --- hw/intc/xics_kvm.c| 34 +++ hw/intc/xics_native.c | 51 +-- hw/intc/xic