Re: [Qemu-devel] [PATCH] net: Forbid dealing with packets when VM is not running

2014-08-18 Thread zhanghailiang
On 2014/8/18 20:27, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: For all NICs(except virtio-net) emulated by qemu, Such as e1000, rtl8139, pcnet and ne2k_pci, Qemu can still receive packets when VM is not running. If this happened in *migration's* last PA

Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] block/vvfat: assert return value of fopen which may fail

2014-08-18 Thread zhanghailiang
On 2014/8/18 19:42, Michael Tokarev wrote: 18.08.2014 12:06, Peter Maydell wrote: On 18 August 2014 09:00, zhanghailiang wrote: From: Li Liu fopen() may return NULL which will cause setbuf() segmentfault Signed-off-by: zhanghailiang Signed-off-by: Li Liu --- block/vvfat.c | 1 + 1 file ch

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-18 Thread Gonglei (Arei)
> >> Subject: Re: [Question] Why doesn't PCIe hotplug work for Q35 machine? > >> > >> On Sun, 2014-08-17 at 13:00 +0200, Michael S. Tsirkin wrote: > >>> On Fri, Aug 15, 2014 at 07:33:29AM +, Gonglei (Arei) wrote: > Hi, > > I noticed that the qemu-2.1 release change log says > >>>

[Qemu-devel] [PATCH V3] spapr: Fix stale HTAB during live migration

2014-08-18 Thread Samuel Mendoza-Jonas
If a guest reboots during a running migration, changes to the hash page table are not necessarily updated on the destination. Opening a new file descriptor to the HTAB forces the migration handler to resend the entire table. Signed-off-by: Samuel Mendoza-Jonas --- Changes in v3: Pointed out by Da

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 22:50, Hulin, Patrick - 0559 - MITLL ha scritto: >> >Correct. Doesn¹t work. Haven¹t fully diagnosed why, but it doesn¹t seem >> >to ever hit the current_tb_modified passage if you invalidate beforehand. > Yeah - mem_io_pc doesn¹t get updated until we¹re inside io_write, so > tb_invali

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Jan Kiszka
On 2014-08-19 06:08, Knut Omang wrote: >> Are you depending on interrupt remapping? If not, my patches are a bit >> hacky and may cause their own issues if you are unlucky. > > It does not depend directly but interprets a NULL PciDevice pointer as > the special bus number (0xff) for non-pci devic

[Qemu-devel] [PATCH V3] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
commit a9f98bb5ebe6fb1869321dcc58e72041ae626ad8 vhost: multiqueue support changed the order of stopping the device. Previously vhost_dev_stop would disable backend and only afterwards, unset guest notifiers. We now unset guest notifiers while vhost is still active. This can lose interrupts causing

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Knut Omang
On Tue, 2014-08-19 at 06:08 +0200, Knut Omang wrote: > On Mon, 2014-08-18 at 20:50 +0200, Jan Kiszka wrote: > > On 2014-08-18 18:34, Knut Omang wrote: > > > On Sat, 2014-08-16 at 10:47 +0200, Jan Kiszka wrote: > > >> On 2014-08-16 10:45, Jan Kiszka wrote: > > >>> On 2014-08-16 09:54, Knut Omang wro

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Knut Omang
On Mon, 2014-08-18 at 20:50 +0200, Jan Kiszka wrote: > On 2014-08-18 18:34, Knut Omang wrote: > > On Sat, 2014-08-16 at 10:47 +0200, Jan Kiszka wrote: > >> On 2014-08-16 10:45, Jan Kiszka wrote: > >>> On 2014-08-16 09:54, Knut Omang wrote: > On Fri, 2014-08-15 at 19:37 +0800, Le Tan wrote: > >

Re: [Qemu-devel] [PATCH] target-arm: Fix resetting issues on ARMv7-M CPUs

2014-08-18 Thread Martin Galvan
Ping http://patchwork.ozlabs.org/patch/379134/ On Mon, Aug 11, 2014 at 1:50 PM, Martin Galvan < martin.gal...@tallertechnologies.com> wrote: > When calling qemu_system_reset after startup on a Cortex-M CPU, the > initial values of PC, MSP and the Thumb bit weren't set correctly. In > particular,

Re: [Qemu-devel] [PATCH V2] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
On 08/19/2014 11:02 AM, Jason Wang wrote: > commit a9f98bb5ebe6fb1869321dcc58e72041ae626ad8 vhost: multiqueue > support changed the order of stopping the device. Previously > vhost_dev_stop would disable backend and only afterwards, unset guest > notifiers. We now unset guest notifiers while vhost

Re: [Qemu-devel] vhost-net issue with multiples interfaces using MQ

2014-08-18 Thread Jason Wang
On 08/18/2014 07:42 PM, William Dauchy wrote: > Hello, > > Using qemu2.1.0, a linux v3.14.X x86_64 as host and a linux v3.12.X x86_64 as > guest > I'm starting a VM with these network interfaces: > > [netdev "vifA.0"] > type = "tap" > vhost = "on" > ifname = "vifA.0" > downscript = "no" >

[Qemu-devel] [PATCH V2] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
commit a9f98bb5ebe6fb1869321dcc58e72041ae626ad8 vhost: multiqueue support changed the order of stopping the device. Previously vhost_dev_stop would disable backend and only afterwards, unset guest notifiers. We now unset guest notifiers while vhost is still active. This can lose interrupts causing

Re: [Qemu-devel] [PATCH] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
On 08/19/2014 03:53 AM, Michael S. Tsirkin wrote: > On Mon, Aug 18, 2014 at 05:51:31PM +0800, Jason Wang wrote: >> > commit a9f98bb5ebe6fb1869321dcc58e72041ae626ad8 vhost: multiqueue >> > support changed the order of stopping the device. Previously >> > vhost_dev_stop would disable backend and only

Re: [Qemu-devel] [PATCH] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
On 08/18/2014 09:20 PM, William Dauchy wrote: > On Mon, Aug 18, 2014 at 11:51 AM, Jason Wang wrote: >> err: >> @@ -254,16 +254,16 @@ void vhost_net_stop(VirtIODevice *dev, NetClientState >> *ncs, >> VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus); >> int i, r; >> >> +for (i = 0; i <

Re: [Qemu-devel] [PATCH] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
On 08/18/2014 08:11 PM, Zhangjie (HZ) wrote: > On 2014/8/18 17:51, Jason Wang wrote: >> commit a9f98bb5ebe6fb1869321dcc58e72041ae626ad8 vhost: multiqueue >> support changed the order of stopping the device. Previously >> vhost_dev_stop would disable backend and only afterwards, unset guest >> notif

[Qemu-devel] [PATCH] configure: no need to mkdir QMP

2014-08-18 Thread Liming Wang
commit 7537fe04 QMP: QMP/ -> docs/qmp/ Above commit has moved last QMP files to docs/qmp and it's not necessary to create QMP directory. So remove it from configure. Signed-off-by: Liming Wang --- configure | 4 1 file changed, 4 deletions(-) diff --git a/configure b/configure index 283c7

[Qemu-devel] [PATCH v2 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Tang Chen
If user doesn't specify numa options, nb_numa_nodes will be 0. But PCDIMMDevice->node is also initialized to 0. As a result, the following check will fail: pc_dimm_realize() { .. if (dimm->node >= nb_numa_nodes) { error_setg(errp, "'DIMM property " PC_DIMM_NODE_PRO

Re: [Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread tangchen
Hi Michael, Paolo Thanks for the advices. Will send a v2 patch soon. Thanks. On 08/19/2014 04:04 AM, Michael S. Tsirkin wrote: On Mon, Aug 18, 2014 at 03:58:33PM +0200, Paolo Bonzini wrote: Il 18/08/2014 15:56, Michael S. Tsirkin ha scritto: +/* Initialize PCDIMMDevice->node to -1 so that ev

Re: [Qemu-devel] [RFC PATCH 00/10] cpu: add device_add foo-x86_64-cpu and i386 cpu hot remove support

2014-08-18 Thread Gu Zheng
Hi Igor, Andreas, Could you please help to review this series? Any comment is welcome. Regards, Gu On 08/07/2014 12:53 PM, Gu Zheng wrote: > This series is based on the previous patchset from Chen Fan: > https://lists.nongnu.org/archive/html/qemu-devel/2014-05/msg02360.html > https://lists.nongnu

Re: [Qemu-devel] How to create PCH to support those existing driver

2014-08-18 Thread Chen, Tiejun
On 2014/8/18 17:58, Michael S. Tsirkin wrote: On Mon, Aug 18, 2014 at 05:01:25PM +0800, Chen, Tiejun wrote: On 2014/8/18 16:21, Michael S. Tsirkin wrote: On Mon, Aug 18, 2014 at 11:06:29AM +0800, Chen, Tiejun wrote: On 2014/8/17 18:32, Michael S. Tsirkin wrote: On Fri, Aug 15, 2014 at 09:58

[Qemu-devel] [RFC v1 2/2] arm: boot: Add EL jump-down code for Linux

2014-08-18 Thread Peter Crosthwaite
Linux should boot in EL2 or EL1. If in EL3, jump down before handing off to Linux. Signed-off-by: Peter Crosthwaite --- hw/arm/boot.c | 21 + 1 file changed, 21 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 840f5da..f1f6365 100644 --- a/hw/arm/boot.c +++ b/

[Qemu-devel] [RFC v1 1/2] arm: boot: Add partial machine code fixup

2014-08-18 Thread Peter Crosthwaite
Allow a fixup to be used to deposit a field in a machine-code instruction. The option shift and length fixup fields indicate the field being deposited by the fixup. Signed-off-by: Peter Crosthwaite --- hw/arm/boot.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/a

[Qemu-devel] [RFC v1 0/2] EL3 support for AArch64 Linux bootloader

2014-08-18 Thread Peter Crosthwaite
Hi Peter, Edgar, These patches add bootloader support for Edgars upcomming EL2/3 work. This allows for Linux boot from EL3 without a bootloader or wrapper. Regards, Peter Peter Crosthwaite (2): arm: boot: Add partial machine code fixup arm: boot: Add EL jump-down code for Linux hw/arm/boo

[Qemu-devel] [PATCH target-arm v1 1/1] arm: translate-a64: Add CPU number to Debug info

2014-08-18 Thread Peter Crosthwaite
It's very useful when debugging SMP to know who disassembly or a CPU state dump is being done on behalf of. Signed-off-by: Peter Crosthwaite --- target-arm/translate-a64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-

Re: [Qemu-devel] [RFC PATCH v2 05/13] spapr_pci: Introduce a liobn number generating macros

2014-08-18 Thread David Gibson
On Fri, Aug 15, 2014 at 08:12:27PM +1000, Alexey Kardashevskiy wrote: > We are going to have multiple DMA windows per PHB and we want them to > migrate so we need a predictable way of assigning LIOBNs. > > This introduces a macro which makes up a LIOBN from fixed prefix, > PHB index (unique PHB id

Re: [Qemu-devel] [RFC PATCH v2 02/13] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows

2014-08-18 Thread David Gibson
On Fri, Aug 15, 2014 at 08:12:24PM +1000, Alexey Kardashevskiy wrote: > The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max. > We are going to add huge DMA windows support so this will create small > window and unexpectedly fail later. > > This disables KVM_CREATE_SPAPR_TCE for win

Re: [Qemu-devel] [RFC PATCH v2 01/13] qom: Make object_child_foreach safe for objects removal

2014-08-18 Thread David Gibson
On Fri, Aug 15, 2014 at 08:12:23PM +1000, Alexey Kardashevskiy wrote: > Current object_child_foreach() uses QTAILQ_FOREACH() to walk > through children and that makes children removal from the callback > impossible. > > This makes object_child_foreach() use QTAILQ_FOREACH_SAFE(). > > Signed-off-b

[Qemu-devel] [PATCH 12/12] spapr_pci: emit hotplug add/remove events during hotplug

2014-08-18 Thread Michael Roth
From: Tyrel Datwyler This uses extension of existing EPOW interrupt/event mechanism to notify userspace tools like librtas/drmgr to handle in-guest configuration/cleanup operations in response to device_add/device_del. Userspace tools that don't implement this extension will need to be run manua

[Qemu-devel] [PATCH 03/12] spapr: add helper to retrieve a PHB/device DrcEntry

2014-08-18 Thread Michael Roth
Signed-off-by: Michael Roth --- hw/ppc/spapr.c | 23 +++ include/hw/ppc/spapr.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 90b25b3..39cb0bb 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -309,6 +309,29 @@ sPAPRDrc

[Qemu-devel] [PATCH 01/12] spapr: populate DRC entries for root dt node

2014-08-18 Thread Michael Roth
From: Nathan Fontenot This add entries to the root OF node to advertise our PHBs as being DR-capable in according with PAPR specification. Each PHB is given a name of PHB, advertised as a PHB type, and associated with a power domain of -1 (indicating to guests that power management is handled au

[Qemu-devel] [PATCH 10/12] spapr_events: re-use EPOW event infrastructure for hotplug events

2014-08-18 Thread Michael Roth
From: Nathan Fontenot This extends the data structures currently used to report EPOW events to gets via the check-exception RTAS interfaces to also include event types for hotplug/unplug events. This is currently undocumented and being finalized for inclusion in PAPR specification, but we implem

[Qemu-devel] [PATCH 05/12] spapr_pci: add get/set-power-level RTAS interfaces

2014-08-18 Thread Michael Roth
From: Nathan Fontenot Signed-off-by: Nathan Fontenot Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 25 + 1 file changed, 25 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 23a3477..f007dd6 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spa

[Qemu-devel] [PATCH 08/12] pci: allow 0 address for PCI IO regions

2014-08-18 Thread Michael Roth
Some kernels program a 0 address for io regions. PCI 3.0 spec section 6.2.5.1 doesn't seem to disallow this. Signed-off-by: Michael Roth --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 351d320..9578749 100644 --- a/hw/pci/pci

[Qemu-devel] [PATCH 11/12] spapr_events: event-scan RTAS interface

2014-08-18 Thread Michael Roth
From: Tyrel Datwyler We don't actually rely on this interface to surface hotplug events, and instead rely on the similar-but-interrupt-driven check-exception RTAS interface used for EPOW events. However, the existence of this interface is needed to ensure guest kernels initialize the event-report

[Qemu-devel] [PATCH 06/12] spapr_pci: add get-sensor-state RTAS interface

2014-08-18 Thread Michael Roth
From: Mike Day Signed-off-by: Mike Day Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 76 ++ 1 file changed, 76 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index f007dd6..8d1351d 100644 --- a/hw/ppc/spapr_pci.c +

[Qemu-devel] [PATCH 09/12] spapr_pci: enable basic hotplug operations

2014-08-18 Thread Michael Roth
This enables hotplug for PHB bridges. Upon hotplug we generate the OF-nodes required by PAPR specification and IEEE 1275-1994 "PCI Bus Binding to Open Firmware" for the device. We associate the corresponding FDT for these nodes with the DrcEntry corresponding to the slot, which will be fetched via

[Qemu-devel] [PATCH 07/12] spapr_pci: add ibm, configure-connector RTAS interface

2014-08-18 Thread Michael Roth
Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 111 + 1 file changed, 111 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 8d1351d..96a57be 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -606,6 +606,11

[Qemu-devel] [PATCH 04/12] spapr_pci: add set-indicator RTAS interface

2014-08-18 Thread Michael Roth
From: Mike Day Signed-off-by: Mike Day Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 119 + include/hw/ppc/spapr.h | 3 ++ 2 files changed, 122 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 924d488..23a347

[Qemu-devel] [PATCH v3 00/12] spapr: add support for pci hotplug

2014-08-18 Thread Michael Roth
These patches are based on ppc-next, and can also be obtained from: https://github.com/mdroth/qemu/commits/spapr-pci-hotplug-v3-ppc-next v3: * dropped emulation of firmware-managed BAR allocation. this will be introduced via a follow-up series via a -machine flag and tied to a separate hot

[Qemu-devel] [PATCH 02/12] spapr_pci: populate DRC dt entries for PHBs

2014-08-18 Thread Michael Roth
Reserve 32 entries of type PCI in each PHB's initial FDT. This advertises to guests that each PHB is DR-capable device with physical hotpluggable slots. This is necessary for allowing hotplugging of devices to it later via bus rescan or guest rpaphp hotplug module. Each entry is assigned a name of

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-18 Thread Joel Schopp
On 08/18/2014 05:11 PM, Peter Maydell wrote: > On 18 August 2014 22:54, Joel Schopp wrote: >> +static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) >> +{ >> +PlatformDevtreeData *data = opaque; >> +void *fdt = data->fdt; >> +const char *parent_node = data->node; >>

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-18 Thread Peter Maydell
On 18 August 2014 22:54, Joel Schopp wrote: > > +static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) > +{ > +PlatformDevtreeData *data = opaque; > +void *fdt = data->fdt; > +const char *parent_node = data->node; > +int compat_str_len; > +char *nodename; > +

[Qemu-devel] [RFC 3/4] ide: update ide_drive_get to work with both PCI-IDE and AHCI interfaces

2014-08-18 Thread John Snow
Signed-off-by: John Snow --- hw/i386/pc_piix.c | 2 +- hw/ide/core.c | 11 +++ include/hw/ide.h | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 47ac1b5..9da6f0e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix

[Qemu-devel] [RFC 2/4] blockdev: add IF_AHCI to support -cdrom and -hd[a-d]

2014-08-18 Thread John Snow
Signed-off-by: John Snow --- blockdev.c| 9 ++--- include/sysemu/blockdev.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index 58da77f..a9efe1f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -57,6 +57,7 @@ static const char *const

[Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35

2014-08-18 Thread John Snow
Currently, the drive definitions created by drive_new() when using the -drive file=...[,if=ide] or -cdrom or -hd[abcd] options are not picked up by the Q35 initialization routine. To fix this, we have to add hooks to search for these drives using something like pc_piix's ide_drive_get and then add

[Qemu-devel] [RFC 4/4] ahci: implement -cdrom and -hd[a-d]

2014-08-18 Thread John Snow
Signed-off-by: John Snow --- hw/i386/pc_q35.c | 4 hw/ide/ahci.c| 17 + hw/ide/ahci.h| 2 ++ 3 files changed, 23 insertions(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4b5a274..4613565 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -86,6 +86,

[Qemu-devel] [RFC 1/4] blockdev: add if_get_max_devs

2014-08-18 Thread John Snow
Signed-off-by: John Snow --- blockdev.c| 9 + include/sysemu/blockdev.h | 1 + 2 files changed, 10 insertions(+) diff --git a/blockdev.c b/blockdev.c index 48bd9a3..58da77f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -110,6 +110,15 @@ void blockdev_auto_del(BlockDriverSta

[Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements

2014-08-18 Thread Maria Kustova
Signed-off-by: Maria Kustova --- tests/image-fuzzer/qcow2/fuzz.py | 15 ++-- tests/image-fuzzer/runner.py | 51 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/tests/image-fuzzer/qcow2/fuzz.py b/tests/image-fuzzer/qcow2/fuzz.py

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-18 Thread Joel Schopp
+static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) +{ +PlatformDevtreeData *data = opaque; +void *fdt = data->fdt; +const char *parent_node = data->node; +int compat_str_len; +char *nodename; +int i, ret; +uint32_t *irq_attr; +uint64_t *reg_att

[Qemu-devel] [PATCH 2/2] fuzz: Make fuzzing functions and values relevant to the qemu implementation

2014-08-18 Thread Maria Kustova
Heuristic values were added to fuzzing constraints and vectors. Signed-off-by: Maria Kustova --- tests/image-fuzzer/qcow2/fuzz.py | 71 +--- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/tests/image-fuzzer/qcow2/fuzz.py b/tests/image-fuzzer/q

[Qemu-devel] [PATCH 1/2] runner: Expand the list of default test commands

2014-08-18 Thread Maria Kustova
Additional commands were added to the default runner list to cover all qcow2 related code. This qcow2 specificity is selected to reduce number of non-relevant tests. After implementation of a fuzzer for a new format the default list should be updated. Signed-off-by: Maria Kustova --- tests/image

[Qemu-devel] [PATCH 0/2] image-fuzzer: Extend test coverage

2014-08-18 Thread Maria Kustova
This patch series contains changes improving test coverage. Maria Kustova (2): runner: Expand the list of default test commands fuzz: Make fuzzing functions and values relevant to the qemu implementation tests/image-fuzzer/qcow2/fuzz.py | 71 +++-- tests/i

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 19:47, Hulin, Patrick - 0559 - MITLL ha scritto: >> We'll have done the page for the first byte at the top of >> helper_{le,be}_{ld,st}_name. When we discover it's an unaligned >> access, we should load and check the pte for the second page. We >> might have to shuffle those two te

Re: [Qemu-devel] [ARM - FCVT inst] : Difference in calculated value

2014-08-18 Thread Peter Maydell
On 18 August 2014 22:04, Gaurav Sharma wrote: > Hi Peter, > I cross checked it with a AFM model, and the results are indeed different. > The problem I think lies in how we treat de-normalized numbers which are too > small to represent in half precision. > In case of qemu >>> if(exp < -10) >>> retu

Re: [Qemu-devel] [ARM - FCVT inst] : Difference in calculated value

2014-08-18 Thread Gaurav Sharma
Hi Peter, I cross checked it with a AFM model, and the results are indeed different. The problem I think lies in how we treat de-normalized numbers which are too small to represent in half precision. In case of qemu >> if(exp < -10) >> return signed/unsigned zero. However, in case rounding is set,

Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] tests/bios-tables-test: check the value returned by fopen()

2014-08-18 Thread Peter Maydell
On 18 August 2014 20:36, Michael S. Tsirkin wrote: > Does test fail if this path is triggered? If our test harness doesn't report failure when a test binary returns with a non-zero exit code then the harness is broken, because there are other test binaries that rely on that. thanks -- PMM

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Hulin, Patrick - 0559 - MITLL
On 8/18/14, 1:47 PM, "Hulin, Patrick - 0559 - MITLL" wrote: >On Aug 18, 2014, at 1:37 PM, Richard Henderson wrote: > >>On 08/16/2014 10:21 PM, Paolo Bonzini wrote: >Would it work to just call tb_invalidate_phys_page_range before the >helper_ret_stb loop? >>I doubt it. > >Correct. Doesn¹

Re: [Qemu-devel] [PATCH 3/4] qcow2: Add runtime options for cache sizes

2014-08-18 Thread Max Reitz
On 18.08.2014 22:24, Max Reitz wrote: On 18.08.2014 22:18, Eric Blake wrote: On 08/18/2014 02:00 PM, Max Reitz wrote: Add options for specifying the size of the metadata caches. This can either be done directly for each cache (if only one is given, the other will be derived according to a defau

Re: [Qemu-devel] [PATCH 3/4] qcow2: Add runtime options for cache sizes

2014-08-18 Thread Max Reitz
On 18.08.2014 22:18, Eric Blake wrote: On 08/18/2014 02:00 PM, Max Reitz wrote: Add options for specifying the size of the metadata caches. This can either be done directly for each cache (if only one is given, the other will be derived according to a default ratio) or combined for both. Signed

Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] slirp/misc: Use g_malloc() instead of malloc()

2014-08-18 Thread Jeff Cody
On Mon, Aug 18, 2014 at 03:32:21PM +0400, Michael Tokarev wrote: > 18.08.2014 11:51, zhanghailiang пишет: > > Here we don't check the return value of malloc() which may fail. > > Use the g_malloc() instead, which will abort the program when > > there is not enough memory. > > > > Signed-off-by: zh

Re: [Qemu-devel] [PATCH 3/4] qcow2: Add runtime options for cache sizes

2014-08-18 Thread Eric Blake
On 08/18/2014 02:00 PM, Max Reitz wrote: > Add options for specifying the size of the metadata caches. This can > either be done directly for each cache (if only one is given, the other > will be derived according to a default ratio) or combined for both. > > Signed-off-by: Max Reitz > --- > blo

Re: [Qemu-devel] [PATCH v6 07/10] linux-user: check return value of malloc()

2014-08-18 Thread Michael S. Tsirkin
On Thu, Aug 14, 2014 at 04:31:35PM +0300, Riku Voipio wrote: > On Thu, Aug 14, 2014 at 03:29:18PM +0800, zhanghailiang wrote: > > Signed-off-by: zhanghailiang > > Acked-by: Riku Voipio > > Applied to linux-user as Michael seemed wary of passing these via > trivial. > > Riku Pls remember to add

Re: [Qemu-devel] [Qemu-trivial] [PATCH v6 03/10] virtio-blk: fix reference a pointer which might be freed

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 03:49:22PM +0400, Michael Tokarev wrote: > 14.08.2014 11:29, zhanghailiang wrote: > > In function virtio_blk_handle_request, it may freed memory pointed by req, > > So do not access member of req after calling this function. > > > > Reviewed-by: Stefan Hajnoczi > > Signed-

[Qemu-devel] [PATCH v2 3/4] qcow2: Add runtime options for cache sizes

2014-08-18 Thread Max Reitz
Add options for specifying the size of the metadata caches. This can either be done directly for each cache (if only one is given, the other will be derived according to a default ratio) or combined for both. Signed-off-by: Max Reitz --- block/qcow2.c | 112 ++

[Qemu-devel] [PATCH v2 4/4] iotests: Add test for qcow2's cache options

2014-08-18 Thread Max Reitz
Add a test which tests various combinations of qcow2's cache options (some of which are valid, some of which are not). Signed-off-by: Max Reitz --- tests/qemu-iotests/103 | 99 ++ tests/qemu-iotests/103.out | 29 ++ tests/qemu-iotests/g

[Qemu-devel] [PATCH v2 1/4] qcow2: Constant cache size in bytes

2014-08-18 Thread Max Reitz
Specifying the metadata cache sizes in clusters results in less clusters (and much less bytes) covered for small cluster sizes and vice versa. Using a constant byte size reduces this difference, and makes it possible to manually specify the cache size in an easily comprehensible unit. Signed-off-b

[Qemu-devel] [PATCH v2 2/4] qcow2: Use g_try_new0() for cache array

2014-08-18 Thread Max Reitz
With a variable cache size, the number given to qcow2_cache_create() may be huge. Therefore, use g_try_new0(). While at it, use g_new0() instead of g_malloc0() for allocating the Qcow2Cache object. Signed-off-by: Max Reitz --- block/qcow2-cache.c | 13 + 1 file changed, 9 insertions

[Qemu-devel] [PATCH v2 0/4] qcow2: Allow runtime specification of cache sizes

2014-08-18 Thread Max Reitz
Currently, the metadata cache size is only tunable on compile time through macros. However, some users may want to use the minimal cache size (for whatever reason) and others may want to increase the cache size because they have enough memory and want to increase performance. This series adds runt

Re: [Qemu-devel] [PATCH v2 4/4] block: Drop some superfluous casts from void *

2014-08-18 Thread Jeff Cody
On Mon, Aug 18, 2014 at 06:10:43PM +0200, Markus Armbruster wrote: > They clutter the code. Unfortunately, I can't figure out how to make > Coccinelle drop all of them, so I have to settle for common special > cases: > > @@ > type T; > T *pt; > void *pv; > @@ > - pt = (T *

Re: [Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 03:58:33PM +0200, Paolo Bonzini wrote: > Il 18/08/2014 15:56, Michael S. Tsirkin ha scritto: > > > +/* Initialize PCDIMMDevice->node to -1 so that even if user doesn't > > > specify > > > + * any numa option, PCDIMMDevice->node won't be 0, which indicates node0. > > > + * I

[Qemu-devel] [PATCH V2 0/2] runner: Control test duration

2014-08-18 Thread Maria Kustova
The first patch adds the '--duration SECONDS' argument. After the specified duration the runner allows to end the current test and then exits. The second patch adds forced termination of a program under test, if the test execution takes more than 10 minutes to indicate program freezes. If a progr

Re: [Qemu-devel] [PATCH] monitor: fix use after free

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 02:05:46PM -0400, Luiz Capitulino wrote: > On Sun, 17 Aug 2014 11:45:17 +0200 > "Michael S. Tsirkin" wrote: > > > The function monitor_fdset_dup_fd_find_remove() references member of > > 'mon_fdset' which - when remove flag is set - may be freed in function > > monitor_fds

[Qemu-devel] [PATCH V2 1/2] runner: Add an argument for test duration

2014-08-18 Thread Maria Kustova
After the specified duration the runner stops executing new tests, but it doesn't interrupt running ones. Reviewed-by: Fam Zheng Signed-off-by: Maria Kustova --- tests/image-fuzzer/runner.py | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/image-f

[Qemu-devel] [PATCH V2 2/2] runner: Kill a program under test by time-out

2014-08-18 Thread Maria Kustova
If a program under test get frozen, the test should finish and report about its failure. In such cases the runner waits for 10 minutes until the program ends its execution. After this time-out the program will be terminated and the test will be marked as failed. For current limitation of test imag

[Qemu-devel] [PATCH 4/4] iotests: Add test for qcow2's cache options

2014-08-18 Thread Max Reitz
Add a test which tests various combinations of qcow2's cache options (some of which are valid, some of which are not). Signed-off-by: Max Reitz --- tests/qemu-iotests/103 | 99 ++ tests/qemu-iotests/103.out | 29 ++ tests/qemu-iotests/g

Re: [Qemu-devel] [PATCH 2/4] qcow2: Use g_try_new0() for cache array

2014-08-18 Thread Max Reitz
On 18.08.2014 22:00, Max Reitz wrote: With a variable cache size, the number given to qcow2_cache_create() may be huge. Therefore, use g_try_new0(). While at it, use g_new0() instead of g_malloc0() for allocating the Qcow2Cache object. Signed-off-by: Max Reitz --- block/qcow2-cache.c | 7 +++

[Qemu-devel] [PATCH 3/4] qcow2: Add runtime options for cache sizes

2014-08-18 Thread Max Reitz
Add options for specifying the size of the metadata caches. This can either be done directly for each cache (if only one is given, the other will be derived according to a default ratio) or combined for both. Signed-off-by: Max Reitz --- block/qcow2.c | 112 ++

[Qemu-devel] [PATCH 0/4] qcow2: Allow runtime specification of cache sizes

2014-08-18 Thread Max Reitz
Currently, the metadata cache size is only tunable on compile time through macros. However, some users may want to use the minimal cache size (for whatever reason) and others may want to increase the cache size because they have enough memory and want to increase performance. This series adds runt

[Qemu-devel] [PATCH 2/4] qcow2: Use g_try_new0() for cache array

2014-08-18 Thread Max Reitz
With a variable cache size, the number given to qcow2_cache_create() may be huge. Therefore, use g_try_new0(). While at it, use g_new0() instead of g_malloc0() for allocating the Qcow2Cache object. Signed-off-by: Max Reitz --- block/qcow2-cache.c | 7 +-- 1 file changed, 5 insertions(+), 2

[Qemu-devel] [PATCH 1/4] qcow2: Constant cache size in bytes

2014-08-18 Thread Max Reitz
Specifying the metadata cache sizes in clusters results in less clusters (and much less bytes) covered for small cluster sizes and vice versa. Using a constant byte size reduces this difference, and makes it possible to manually specify the cache size in an easily comprehensible unit. Signed-off-b

Re: [Qemu-devel] [PATCH v2 3/4] qemu-io-cmds: g_renew() can't fail, bury dead error handling

2014-08-18 Thread Jeff Cody
On Mon, Aug 18, 2014 at 06:10:42PM +0200, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qemu-io-cmds.c | 11 +-- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > index afd8867..b224ede 100644 > --- a/qemu-io-cmds.c

Re: [Qemu-devel] [PATCH v2 2/4] block: Use g_new() & friends to avoid multiplying sizes

2014-08-18 Thread Jeff Cody
On Mon, Aug 18, 2014 at 06:10:41PM +0200, Markus Armbruster wrote: > g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons. > One, it catches multiplication overflowing size_t. Two, it returns > T * rather than void *, which lets the compiler catch more type > errors. > > Perhaps a c

Re: [Qemu-devel] [PATCH] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 05:51:31PM +0800, Jason Wang wrote: > commit a9f98bb5ebe6fb1869321dcc58e72041ae626ad8 vhost: multiqueue > support changed the order of stopping the device. Previously > vhost_dev_stop would disable backend and only afterwards, unset guest > notifiers. We now unset guest noti

Re: [Qemu-devel] [PATCH 3/8] target-ppc: Bug Fix: rlwimi

2014-08-18 Thread Tom Musta
On 8/15/2014 3:05 PM, Richard Henderson wrote: > On 08/11/2014 09:23 AM, Tom Musta wrote: >> Also fix the special case of MB=31 and ME=0 to copy the entire contents >> of the source GPR. > > Err, that's not what you did. > >> if (likely(sh == 0 && mb == 0 && me == 31)) { >> +#if defined(TARG

Re: [Qemu-devel] [PATCH v2 1/4] block: Use g_new() & friends where that makes obvious sense

2014-08-18 Thread Jeff Cody
On Mon, Aug 18, 2014 at 06:10:40PM +0200, Markus Armbruster wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type error

Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] tests/bios-tables-test: check the value returned by fopen()

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 06:24:02PM +0400, Michael Tokarev wrote: > 18.08.2014 17:44, Michael S. Tsirkin wrote: > > On Mon, Aug 18, 2014 at 03:38:12PM +0400, Michael Tokarev wrote: > >> 18.08.2014 11:54, zhanghailiang wrote: > >>> The function fopen() may fail, so check its return value. > >>> > >>>

[Qemu-devel] [PULL 1/3] monitor: Remove hardcoded watchdog event names

2014-08-18 Thread Luiz Capitulino
From: Hani Benhabiles Signed-off-by: Hani Benhabiles Signed-off-by: Luiz Capitulino --- monitor.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index cdbaa60..48f0fdc 100644 --- a/monitor.c +++ b/monitor.c @@ -4521,16 +4521,15 @@ void net

[Qemu-devel] [PULL 2/3] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-18 Thread Luiz Capitulino
From: Chen Gang In dump_init(), when failure occurs, need notice about 'fd' and memory mapping. So call dump_cleanup() for it (need let all initializations at front). Also simplify dump_cleanup(): remove redundant 'ret' and redundant 'fd' checking. Signed-off-by: Chen Gang Reviewed-by: Laszlo

[Qemu-devel] [PULL 0/3] QMP queue

2014-08-18 Thread Luiz Capitulino
Three little birds. The following changes since commit 08ab59770da57648bfb8fc9be37f0ef7fb50b0f9: Merge remote-tracking branch 'remotes/mcayland/qemu-sparc' into staging (2014-08-18 12:55:02 +0100) are available in the git repository at: git://repo.or.cz/qemu/qmp-unstable.git queue/qmp fo

[Qemu-devel] [PULL 3/3] monitor: fix use after free

2014-08-18 Thread Luiz Capitulino
From: "Michael S. Tsirkin" The function monitor_fdset_dup_fd_find_remove() references member of 'mon_fdset' which - when remove flag is set - may be freed in function monitor_fdset_cleanup(). remove is set by monitor_fdset_dup_fd_remove which in practice does not need the returned value, so make

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Jan Kiszka
On 2014-08-18 18:34, Knut Omang wrote: > On Sat, 2014-08-16 at 10:47 +0200, Jan Kiszka wrote: >> On 2014-08-16 10:45, Jan Kiszka wrote: >>> On 2014-08-16 09:54, Knut Omang wrote: On Fri, 2014-08-15 at 19:37 +0800, Le Tan wrote: > Hi Knut, > > 2014-08-15 19:15 GMT+08:00 Knut Omang :

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Hulin, Patrick - 0559 - MITLL
On 8/18/14, 1:47 PM, "Hulin, Patrick - 0559 - MITLL" wrote: >On Aug 17, 2014, at 1:21 AM, Paolo Bonzini wrote: > >> Il 15/08/2014 23:49, Hulin, Patrick - 0559 - MITLL ha scritto: > In this case, the write is 8 bytes and unaligned, so it gets split > into 8 single-byte writes. In stock QE

Re: [Qemu-devel] [PATCH] monitor: fix use after free

2014-08-18 Thread Luiz Capitulino
On Sun, 17 Aug 2014 11:45:17 +0200 "Michael S. Tsirkin" wrote: > The function monitor_fdset_dup_fd_find_remove() references member of > 'mon_fdset' which - when remove flag is set - may be freed in function > monitor_fdset_cleanup(). > remove is set by monitor_fdset_dup_fd_remove which in practic

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Hulin, Patrick - 0559 - MITLL
On Aug 17, 2014, at 1:21 AM, Paolo Bonzini wrote: > Il 15/08/2014 23:49, Hulin, Patrick - 0559 - MITLL ha scritto: In this case, the write is 8 bytes and unaligned, so it gets split into 8 single-byte writes. In stock QEMU, these writes are done in reverse order (see the loop in so

Re: [Qemu-devel] [PATCH v5 2/7] tests: Add virtio device initialization

2014-08-18 Thread Marc Marí
>El Mon, 18 Aug 2014 14:46:07 +0200 >Marc Marí escribió: > +void qvirtio_pci_device_enable(QVirtioPCIDevice *d) > +{ > +qpci_device_enable(d->pdev); > +d->addr = qpci_iomap(d->pdev, 0); > +g_assert(d->addr != NULL); > +} > + qpci_iomap changed its prototype in one of the lastest pull

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Hulin, Patrick - 0559 - MITLL
On Aug 18, 2014, at 1:37 PM, Richard Henderson wrote: > On 08/16/2014 10:21 PM, Paolo Bonzini wrote: Would it work to just call tb_invalidate_phys_page_range before the helper_ret_stb loop? > > I doubt it. Correct. Doesn’t work. Haven’t fully diagnosed why, but it doesn’t seem to eve

Re: [Qemu-devel] [PATCH v5 6/7] libqos: Added MSI-X support

2014-08-18 Thread Marc Marí
>El Mon, 18 Aug 2014 14:46:11 +0200 >Marc Marí escribió: > +void qpci_msix_enable(QPCIDevice *dev) > +{ > +uint8_t addr; > +uint16_t val; > +uint32_t table; > +uint8_t bir_table; > +uint8_t bir_pba; > +void *offset; > + > +addr = qpci_find_capability(dev, PCI_CAP_ID_MSI

Re: [Qemu-devel] [RFC PATCH v2 10/13] linux headers update for DDW

2014-08-18 Thread Alex Williamson
On Fri, 2014-08-15 at 20:12 +1000, Alexey Kardashevskiy wrote: > Since the changes are not in upstream yet, no tag or branch is specified here. > > Signed-off-by: Alexey Kardashevskiy > --- > linux-headers/linux/vfio.h | 37 - > 1 file changed, 36 insertions(+

Re: [Qemu-devel] QEMU, self-modifying code, and Windows 7 64-bit (no KVM)

2014-08-18 Thread Richard Henderson
On 08/16/2014 10:21 PM, Paolo Bonzini wrote: >>> Would it work to just call tb_invalidate_phys_page_range before the >>> helper_ret_stb loop? I doubt it. >> Maybe. I think there’s another issue, which is that QEMU’s ending up >> in the I/O read/write code instead of the normal memory RW. This cou

  1   2   3   >