[Qemu-devel] [PATCH memory v1 5/5] memory: Use canonical path component as the name

2014-08-14 Thread Peter Crosthwaite
Rather than having the name as separate state. This prepares support for creating a MemoryRegion dynamically (i.e. without memory_region_init() and friends) and the MemoryRegion still getting a usable name. Signed-off-by: Peter Crosthwaite --- include/exec/memory.h | 1 - memory.c

[Qemu-devel] [PATCH memory v1 3/5] memory: constify memory_region_name

2014-08-14 Thread Peter Crosthwaite
It doesn't change the MR and some prospective call sites will have const MRs at hand. Signed-off-by: Peter Crosthwaite --- include/exec/memory.h | 2 +- memory.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h ind

[Qemu-devel] [PATCH memory v1 4/5] memory: Use memory_region_name for name access

2014-08-14 Thread Peter Crosthwaite
Despite being local to memory.c, use the helper function. This prepares support for fully QOMifiying the name field of MR (which will remove this state from MR completely). Signed-off-by: Peter Crosthwaite --- memory.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/

[Qemu-devel] [PATCH memory v1 2/5] exec: Abstract away ref to memory region names

2014-08-14 Thread Peter Crosthwaite
Use the function provided rather than spying on the struct. Signed-off-by: Peter Crosthwaite --- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 765bd94..5f9857c 100644 --- a/exec.c +++ b/exec.c @@ -1044,7 +1044,7 @@ static void *file_ram_all

[Qemu-devel] [PATCH memory v1 1/5] loader: Abstract away ref to memory region names

2014-08-14 Thread Peter Crosthwaite
Use the function provided rather than spying on the struct. Signed-off-by: Peter Crosthwaite --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 2bf6b8f..1a53f0f 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @

[Qemu-devel] [PATCH memory v1 0/5] MemoryRegion Name QOMification

2014-08-14 Thread Peter Crosthwaite
Hi Paolo, Another piece to the Memory Region QOMification puzzle. This series gets rid of the name field of MemoryRegion and converts all users to the QOM managed Object name. Regards, Peter Peter Crosthwaite (5): loader: Abstract away ref to memory region names exec: Abstract away ref to m

[Qemu-devel] [Bug 1357175] [NEW] qemu fails to build on powerpc64

2014-08-14 Thread Justin Hibbits
Public bug reported: Qemu fails to build on powerpc64, ELFv1 ABI, since the introduction of the ELFv2 ABI support. On FreeBSD/powerpc64 I see the following error building HEAD from today (8/14/2014): In file included from /home/chmeee/qemu-git/tcg/tcg.c:264: /home/chmeee/qemu-git/tcg/ppc/tcg-tar

Re: [Qemu-devel] [RFC PATCH 06/10] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support

2014-08-14 Thread David Gibson
On Fri, Aug 15, 2014 at 03:27:42PM +1000, Alexey Kardashevskiy wrote: > On 08/15/2014 02:20 PM, David Gibson wrote: > > On Fri, Aug 15, 2014 at 01:09:20PM +1000, Alexey Kardashevskiy wrote: > >> On 08/15/2014 10:04 AM, David Gibson wrote: > >>> On Thu, Aug 14, 2014 at 06:29:50PM +1000, Alexey Karda

Re: [Qemu-devel] [v5][PATCH 4/4] xen:hw:i386:pc_piix: introduce new machine for IGD passthrough

2014-08-14 Thread Chen, Tiejun
On 2014/8/15 0:03, Michael S. Tsirkin wrote: On Tue, Aug 12, 2014 at 05:49:17PM +0800, Tiejun Chen wrote: Now we can introduce a new machine, xenigd, specific to IGD passthrough. This can avoid involving other common codes. Signed-off-by: Tiejun Chen This broke make check since the new machi

[Qemu-devel] [PATCH v2 14/14] sysbus: Use TYPE_DEVICE GPIO functionality

2014-08-14 Thread Peter Crosthwaite
Re-implement the Sysbus GPIOs to use the existing TYPE_DEVICE GPIO named framework. A constant string name is chosen to avoid conflicts with existing unnamed GPIOs. This unifies GPIOs are IRQs for sysbus devices and allows removal of all Sysbus state for GPIOs. Any existing and future-added funct

[Qemu-devel] [PATCH v2 11/14] qdev: gpio: delete NamedGPIOList::out

2014-08-14 Thread Peter Crosthwaite
All users of GPIO outputs are fully QOMified, using QOM properties to access the GPIO data. Delete. Signed-off-by: Peter Crosthwaite --- hw/core/qdev.c | 1 - include/hw/qdev-core.h | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d83e870..dbc4a

[Qemu-devel] [PATCH v2 13/14] qdev: gpio: Define qdev_pass_gpios()

2014-08-14 Thread Peter Crosthwaite
Allows a container to take ownership of GPIOs in a contained device and automatically connect them as GPIOs to the container. This prepares for deprecation of the SYSBUS IRQ functionality, which has this feature. We push it up to the device level instead of sysbus level. There's nothing sysbus spe

[Qemu-devel] [PATCH v2 09/14] qtest/irq: Rework IRQ interception

2014-08-14 Thread Peter Crosthwaite
Change the qtest intercept handler to accept just the individual IRQ being intercepted as opaque. n is still expected to be correctly set as for the original intercepted irq. qemu_intercept_irq_in is updated accordingly. Then covert the qemu_irq_intercept_out call to use qdev intercept version. Th

[Qemu-devel] [PATCH v2 12/14] qdev: gpio: Remove qdev_init_gpio_out x1 restriction

2014-08-14 Thread Peter Crosthwaite
Previously this was restricted to a single call per-dev/per-name. With the conversion of the GPIO output state to QOM the implementation can now handle repeated calls. Remove the restriction. Signed-off-by: Peter Crosthwaite --- hw/core/qdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletion

[Qemu-devel] [PATCH v2 10/14] irq: Remove qemu_irq_intercept_out

2014-08-14 Thread Peter Crosthwaite
No more users left and obsoleted by qdev_intercept_gpio_out. Signed-off-by: Peter Crosthwaite --- hw/core/irq.c| 6 -- include/hw/irq.h | 1 - 2 files changed, 7 deletions(-) diff --git a/hw/core/irq.c b/hw/core/irq.c index 4a580a2..8a62a36 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.

[Qemu-devel] [PATCH v2 08/14] qdev: gpio: Add API for intercepting a GPIO

2014-08-14 Thread Peter Crosthwaite
To replace the old qemu_irq intercept API (which had users reaching into qdev private state for GPIOs). Signed-off-by: Peter Crosthwaite --- changed since v1 (Alex review): Accept an alredy inited qemu_irq as arg and return the disconnected (allow arbitrary opaque setting). s/irq/gpio in commit m

[Qemu-devel] [PATCH v2 07/14] qdev: gpio: Re-impement qdev_connect_gpio QOM style

2014-08-14 Thread Peter Crosthwaite
Re-implement as a link setter. This should allow the QOM framework to keep track of ref counts properly etc. We need to add a default parent for the connecting input incase it's coming from a non-qdev source. We simply parent the IRQ to the machine in this case. Signed-off-by: Peter Crosthwaite

[Qemu-devel] [PATCH v2 06/14] qom: Demote already-has-a-parent to a regular error

2014-08-14 Thread Peter Crosthwaite
Rather than an abort(). This allows callers to decide whether parenting an already-parented object is a fatal error condition. Useful for providing a default value for an object's parent in the case where you want to set one iff it doesn't already have one. Signed-off-by: Peter Crosthwaite ---

[Qemu-devel] [PATCH v2 05/14] qom: Allow clearing of a Link property

2014-08-14 Thread Peter Crosthwaite
By passing in NULL to object_property_set_link. The lead user of this is the QDEV GPIO framework which will implement GPIO disconnects via an "unlink". Signed-off-by: Peter Crosthwaite --- qom/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qom/object.c b/qom/o

[Qemu-devel] [PATCH v2 04/14] qmp: qstring: Handle NULL strings

2014-08-14 Thread Peter Crosthwaite
Create a valid qobject even if the input string is null. qstring->string will be NULL and length will be 0. This prepares support for clearing of QOM Link properties where NULL canonical path string will be passes through this API. Signed-off-by: Peter Crosthwaite --- qobject/qstring.c | 12 ++

[Qemu-devel] [PATCH v2 03/14] qdev: gpio: Register GPIO outputs as QOM links

2014-08-14 Thread Peter Crosthwaite
Within the object that contains the GPIO output. This allows for connecting GPIO outputs via setting of a Link property. Also clear the link value to zero. This catch-alls the case where a device improperly inits a gpio_out (malloc instead of malloc0). Signed-off-by: Peter Crosthwaite --- Change

[Qemu-devel] [PATCH v2 02/14] qdev: gpio: Register GPIO inputs as child objects

2014-08-14 Thread Peter Crosthwaite
To the device that contains them. This will allow for referencing a GPIO input from it's canonical path (exciting for dynamic machine generation!) Signed-off-by: Peter Crosthwaite --- Define propname variable at start of function. hw/core/qdev.c | 9 + 1 file changed, 9 insertions(+) d

[Qemu-devel] [PATCH v2 01/14] qdev: gpio: Don't allow name share between I and O

2014-08-14 Thread Peter Crosthwaite
Only allow a GPIO name to be one or the other. Inputs and outputs are functionally different and should be in different namespaces. Prepares support for the QOMification of IRQs as Links or Child objects. The alternative is to munge names .e.g. with "-in" or "-out" suffixes when giving QOM names.

[Qemu-devel] [PATCH v2 00/14] GPIO/IRQ QOMification: Phase 2 - Getting rid of SYSBUS IRQs

2014-08-14 Thread Peter Crosthwaite
Hi All, So phase one was the QOMification of qemu_irq. This is the next step. We start to setup GPIOs as proper QOM objects. Inputs are child objects of their device. Outputs are settable Links and connection is made via proper setting of a QOM link. We then cleanup Sysbus to simply re-use devic

Re: [Qemu-devel] [RFC PATCH 06/10] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support

2014-08-14 Thread Alexey Kardashevskiy
On 08/15/2014 02:20 PM, David Gibson wrote: > On Fri, Aug 15, 2014 at 01:09:20PM +1000, Alexey Kardashevskiy wrote: >> On 08/15/2014 10:04 AM, David Gibson wrote: >>> On Thu, Aug 14, 2014 at 06:29:50PM +1000, Alexey Kardashevskiy wrote: On 08/13/2014 01:27 PM, David Gibson wrote: > On Tue,

Re: [Qemu-devel] [PATCH v1 13/16] qdev: gpio: Define qdev_pass_gpios()

2014-08-14 Thread Peter Crosthwaite
On Tue, Aug 12, 2014 at 8:55 PM, Alexander Graf wrote: > > On 12.08.14 12:48, Peter Crosthwaite wrote: >> >> On Tue, Aug 12, 2014 at 7:24 PM, Alexander Graf wrote: >>> >>> On 04.08.14 03:58, Peter Crosthwaite wrote: Allows a container to take ownership of GPIOs in a contained devic

Re: [Qemu-devel] [PATCH v1 15/16] ppc: convert g_new(qemu_irq usages to g_new0

2014-08-14 Thread Peter Crosthwaite
On Tue, Aug 12, 2014 at 7:26 PM, Alexander Graf wrote: > > On 04.08.14 03:59, Peter Crosthwaite wrote: >> >> To indicate the IRQs are initially disconnected. >> >> Signed-off-by: Peter Crosthwaite > > > I suppose you want to convert this one too? > > hw/intc/i8259.c:475:irq_set = g_malloc(I

[Qemu-devel] [PATCH v5 1/2] qapi: add read-pattern enum for quorum

2014-08-14 Thread Liu Yuan
Cc: Eric Blake Reviewed-by: Eric Blake Signed-off-by: Liu Yuan --- qapi/block-core.json | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index e378653..42033d9 100644 --- a/qapi/block-core.json +++ b/qapi/block-

[Qemu-devel] [PATCH v5 2/2] block/quorum: add simple read pattern support

2014-08-14 Thread Liu Yuan
This patch adds single read pattern to quorum driver and quorum vote is default pattern. For now we do a quorum vote on all the reads, it is designed for unreliable underlying storage such as non-redundant NFS to make sure data integrity at the cost of the read performance. For some use cases as

[Qemu-devel] [PATCH v5 0/2] add read-pattern for block qourum

2014-08-14 Thread Liu Yuan
v5: - simplify a for loop in quorum_aio_finalize() v4: - swap the patch order - update comment for fifo pattern in qaip - use qapi enumeration in quorum driver instead of manual parsing v3: - separate patch into two, one for quorum and one for qapi for easier review - add enumeration for qu

Re: [Qemu-devel] [PATCH v4 2/2] block/quorum: add simple read pattern support

2014-08-14 Thread Liu Yuan
On Thu, Aug 14, 2014 at 01:09:32PM +0200, Benoît Canet wrote: > The Thursday 17 Jul 2014 à 13:18:56 (+0800), Liu Yuan wrote : > > This patch adds single read pattern to quorum driver and quorum vote is > > default > > pattern. > > > > For now we do a quorum vote on all the reads, it is designed f

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

2014-08-14 Thread Knut Omang
On Thu, 2014-08-14 at 14:10 +0200, Jan Kiszka wrote: > On 2014-08-14 13:15, Michael S. Tsirkin wrote: > > On Mon, Aug 11, 2014 at 03:04:57PM +0800, Le Tan wrote: > >> Hi, > >> > >> These patches are intended to introduce Intel IOMMU (VT-d) emulation to q35 > >> chipset. The major job in these patch

Re: [Qemu-devel] [RFC PATCH 06/10] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support

2014-08-14 Thread David Gibson
On Fri, Aug 15, 2014 at 01:09:20PM +1000, Alexey Kardashevskiy wrote: > On 08/15/2014 10:04 AM, David Gibson wrote: > > On Thu, Aug 14, 2014 at 06:29:50PM +1000, Alexey Kardashevskiy wrote: > >> On 08/13/2014 01:27 PM, David Gibson wrote: > >>> On Tue, Aug 12, 2014 at 05:25:29PM +1000, Alexey Karda

Re: [Qemu-devel] [RFC PATCH 09/10] spapr_pci_vfio: Enable DDW

2014-08-14 Thread Alexey Kardashevskiy
On 08/15/2014 10:09 AM, David Gibson wrote: > On Thu, Aug 14, 2014 at 03:38:45PM +0200, Alexander Graf wrote: >> >> On 13.08.14 02:18, Alexey Kardashevskiy wrote: >>> On 08/13/2014 01:28 AM, Alexander Graf wrote: On 12.08.14 17:10, Alexey Kardashevskiy wrote: > On 08/12/2014 07:37 PM, Alex

Re: [Qemu-devel] [RFC PATCH 09/10] spapr_pci_vfio: Enable DDW

2014-08-14 Thread Alexey Kardashevskiy
On 08/14/2014 11:38 PM, Alexander Graf wrote: > > On 13.08.14 02:18, Alexey Kardashevskiy wrote: >> On 08/13/2014 01:28 AM, Alexander Graf wrote: >>> On 12.08.14 17:10, Alexey Kardashevskiy wrote: On 08/12/2014 07:37 PM, Alexander Graf wrote: > On 12.08.14 02:03, Alexey Kardashevskiy wrot

Re: [Qemu-devel] [RFC PATCH 06/10] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support

2014-08-14 Thread Alexey Kardashevskiy
On 08/15/2014 10:04 AM, David Gibson wrote: > On Thu, Aug 14, 2014 at 06:29:50PM +1000, Alexey Kardashevskiy wrote: >> On 08/13/2014 01:27 PM, David Gibson wrote: >>> On Tue, Aug 12, 2014 at 05:25:29PM +1000, Alexey Kardashevskiy wrote: On 08/12/2014 11:45 AM, David Gibson wrote: > On Thu,

Re: [Qemu-devel] The status about vhost-net on kvm-arm?

2014-08-14 Thread Li Liu
Hi Ying-Shiuan Pan, I don't know why for missing your mail in mailbox. Sorry about that. The results of vhost-net performance have been attached in another mail. Do you have a plan to renew your patchset to support irqfd. If not, we will try to finish it based on yours. On 2014/8/14 11:50, Li Li

Re: [Qemu-devel] Microcheckpointing: Memory-VCPU / Disk State consistency

2014-08-14 Thread Michael R. Hines
On 08/14/2014 06:58 PM, Dr. David Alan Gilbert wrote: cc'ing in a couple of the COLOers. Thanks, David. Glad to see their patches in last month - I need to take a look at them. The 2013 paper says: 'COLO modifies the guest OS’s TCP/IP stack in order to make the behavior more deterministic.

Re: [Qemu-devel] [RFC PATCH 06/10] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support

2014-08-14 Thread David Gibson
On Thu, Aug 14, 2014 at 06:29:50PM +1000, Alexey Kardashevskiy wrote: > On 08/13/2014 01:27 PM, David Gibson wrote: > > On Tue, Aug 12, 2014 at 05:25:29PM +1000, Alexey Kardashevskiy wrote: > >> On 08/12/2014 11:45 AM, David Gibson wrote: > >>> On Thu, Jul 31, 2014 at 07:34:10PM +1000, Alexey Karda

Re: [Qemu-devel] [RFC PATCH 09/10] spapr_pci_vfio: Enable DDW

2014-08-14 Thread David Gibson
On Thu, Aug 14, 2014 at 03:38:45PM +0200, Alexander Graf wrote: > > On 13.08.14 02:18, Alexey Kardashevskiy wrote: > >On 08/13/2014 01:28 AM, Alexander Graf wrote: > >>On 12.08.14 17:10, Alexey Kardashevskiy wrote: > >>>On 08/12/2014 07:37 PM, Alexander Graf wrote: > On 12.08.14 02:03, Alexey

Re: [Qemu-devel] [PATCH v4 33/33] piix: Move pc_xen_hvm_init() closer to xenfv_machine_class_init()

2014-08-14 Thread Eduardo Habkost
On Thu, Aug 14, 2014 at 10:03:49PM +0200, Michael S. Tsirkin wrote: > On Thu, Aug 14, 2014 at 04:26:02PM -0300, Eduardo Habkost wrote: > > Put all the Xen code in a single place. > > > > Signed-off-by: Eduardo Habkost > > Would apply to the new igd passthrough machine type as well? Yes, but the

Re: [Qemu-devel] [PATCH v4 31/33] pc: Add default KVM features fields to PCMachineClass

2014-08-14 Thread Eduardo Habkost
On Thu, Aug 14, 2014 at 11:09:59PM +0200, Michael S. Tsirkin wrote: > On Thu, Aug 14, 2014 at 04:26:00PM -0300, Eduardo Habkost wrote: > > With the new fields, the x86_cpu_compat_disable_kvm_features() calls on > > pc_compat_*() functions can be replace > > be replaced Thanks. Will be fixed on t

Re: [Qemu-devel] [PATCH v4 27/33] target-i386: Register X86CPU "feat-kvmclock" feature

2014-08-14 Thread Eduardo Habkost
On Thu, Aug 14, 2014 at 11:08:30PM +0200, Michael S. Tsirkin wrote: > On Thu, Aug 14, 2014 at 04:25:56PM -0300, Eduardo Habkost wrote: > > The "kvmclock" feature is special because it affects two bits in the KVM > > CPUID leaf, so it has to be handled differently from the other feature > > properti

Re: [Qemu-devel] [PATCH v3 2/3] x86: kvm: Add MTRR support for kvm_get|put_msrs()

2014-08-14 Thread Laszlo Ersek
On 08/14/14 23:39, Alex Williamson wrote: > The MTRR state in KVM currently runs completely independent of the > QEMU state in CPUX86State.mtrr_*. This means that on migration, the > target loses MTRR state from the source. Generally that's ok though > because KVM ignores it and maps everything a

Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-14 Thread Chen Gang
On 08/15/2014 04:49 AM, Luiz Capitulino wrote: > On Sun, 03 Aug 2014 23:28:56 +0800 > Chen Gang wrote: > >> > 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 d

[Qemu-devel] [PATCH v3 0/3] Sync MTRRs with KVM and disable on reset

2014-08-14 Thread Alex Williamson
v3: - Fix off-by-one identified by Laszlo in 2/3 - Add R-b in 1 & 3 It turns out that not only do we not follow the SDM guidelines for reseting MTRR state on vCPU reset, but we really don't even attempt to keep KVM MTRR state synchronized with QEMU, which affects not only reset, but migration.

[Qemu-devel] [PATCH v3 3/3] x86: Clear MTRRs on vCPU reset

2014-08-14 Thread Alex Williamson
The SDM specifies (June 2014 Vol3 11.11.5): On a hardware reset, the P6 and more recent processors clear the valid flags in variable-range MTRRs and clear the E flag in the IA32_MTRR_DEF_TYPE MSR to disable all MTRRs. All other bits in the MTRRs are undefined. We currently do none

[Qemu-devel] [PATCH v3 2/3] x86: kvm: Add MTRR support for kvm_get|put_msrs()

2014-08-14 Thread Alex Williamson
The MTRR state in KVM currently runs completely independent of the QEMU state in CPUX86State.mtrr_*. This means that on migration, the target loses MTRR state from the source. Generally that's ok though because KVM ignores it and maps everything as write-back anyway. The exception to this rule i

[Qemu-devel] [PATCH v3 1/3] x86: Use common variable range MTRR counts

2014-08-14 Thread Alex Williamson
We currently define the number of variable range MTRR registers as 8 in the CPUX86State structure and vmstate, but use MSR_MTRRcap_VCNT (also 8) to report to guests the number available. Change this to use MSR_MTRRcap_VCNT consistently. Signed-off-by: Alex Williamson Reviewed-by: Laszlo Ersek C

Re: [Qemu-devel] [PATCH v2 2/3] x86: kvm: Add MTRR support for kvm_get|put_msrs()

2014-08-14 Thread Alex Williamson
On Thu, 2014-08-14 at 23:20 +0200, Laszlo Ersek wrote: > You're going to use my name in contexts that I won't wish to be privy > to. :) I like everything about this patch except: > > > +case MSR_MTRRphysBase(0) ... MSR_MTRRphysMask(MSR_MTRRcap_VCNT): > > ... the off-by-one in this case ra

Re: [Qemu-devel] [PATCH v2 2/3] x86: kvm: Add MTRR support for kvm_get|put_msrs()

2014-08-14 Thread Laszlo Ersek
On 08/14/14 21:24, Alex Williamson wrote: > The MTRR state in KVM currently runs completely independent of the > QEMU state in CPUX86State.mtrr_*. This means that on migration, the > target loses MTRR state from the source. Generally that's ok though > because KVM ignores it and maps everything a

Re: [Qemu-devel] [PATCH v2 3/3] x86: Clear MTRRs on vCPU reset

2014-08-14 Thread Laszlo Ersek
On 08/14/14 21:24, Alex Williamson wrote: > The SDM specifies (June 2014 Vol3 11.11.5): > > On a hardware reset, the P6 and more recent processors clear the > valid flags in variable-range MTRRs and clear the E flag in the > IA32_MTRR_DEF_TYPE MSR to disable all MTRRs. All other bits i

Re: [Qemu-devel] [PATCH v2 2/3] x86: kvm: Add MTRR support for kvm_get|put_msrs()

2014-08-14 Thread Laszlo Ersek
You're going to use my name in contexts that I won't wish to be privy to. :) I like everything about this patch except: On 08/14/14 21:24, Alex Williamson wrote: > The MTRR state in KVM currently runs completely independent of the > QEMU state in CPUX86State.mtrr_*. This means that on migration,

Re: [Qemu-devel] [PATCH v4 31/33] pc: Add default KVM features fields to PCMachineClass

2014-08-14 Thread Michael S. Tsirkin
On Thu, Aug 14, 2014 at 04:26:00PM -0300, Eduardo Habkost wrote: > With the new fields, the x86_cpu_compat_disable_kvm_features() calls on > pc_compat_*() functions can be replace be replaced > by simple field initialization on > class_init functions. This gets us one step closer to eliminating

Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-14 Thread Luiz Capitulino
On Sun, 03 Aug 2014 23:28:56 +0800 Chen Gang wrote: > 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.

Re: [Qemu-devel] [PATCH v4 27/33] target-i386: Register X86CPU "feat-kvmclock" feature

2014-08-14 Thread Michael S. Tsirkin
On Thu, Aug 14, 2014 at 04:25:56PM -0300, Eduardo Habkost wrote: > The "kvmclock" feature is special because it affects two bits in the KVM > CPUID leaf, so it has to be handled differently from the other feature > properties that will be added. > > Signed-off-by: Eduardo Habkost > --- > target-

[Qemu-devel] [PATCH v3] ide: Add resize callback to ide/core

2014-08-14 Thread John Snow
Currently, if the block device backing the IDE drive is resized, the information about the device as cached inside of the IDEState structure is not updated, thus when a guest OS re-queries the drive, it is unable to see the expanded size. This patch adds a resize callback that updates the IDENTIFY

Re: [Qemu-devel] disk image: self-organized format or raw file

2014-08-14 Thread Xingbo Wu
>> >> The main trick of QED was to introduce a dirty flag, which allowed to >> >> call fdatasync() less often because it was okay for image metadata to >> >> become inconsistent. After a crash, you have to repair the image then. >> >> >> > >> > I'm very curious about this dirty flag trick. I was su

Re: [Qemu-devel] [PATCH v2 1/3] x86: Use common variable range MTRR counts

2014-08-14 Thread Laszlo Ersek
On 08/14/14 21:24, Alex Williamson wrote: > We currently define the number of variable range MTRR registers as 8 > in the CPUX86State structure and vmstate, but use MSR_MTRRcap_VCNT > (also 8) to report to guests the number available. Change this to > use MSR_MTRRcap_VCNT consistently. > > Signed

Re: [Qemu-devel] [PATCH v2] ide: Add resize callback to ide/core

2014-08-14 Thread Markus Armbruster
John Snow writes: > On 08/14/2014 03:12 AM, Markus Armbruster wrote: >> >> I'd prefer if (s->drive_kind == IDE_CFATA) ... else ..., because it >> avoids the double negative. > > OK. This is how cmd_identify delegates. For matters of style I usually > try to defer to nearby code. > >> >> Your code

[Qemu-devel] IF_AHCI RFC (Was Re: Are -cdrom/-hda (or -drive if=ide) supposed to work in q35?)

2014-08-14 Thread John Snow
On 06/12/2014 05:03 AM, Markus Armbruster wrote: I've always argued for SATA, because for me if=ide does *not* imply a specific kind of HBA any more than if=scsi does, and the "natural" HBA for Q35 is AHCI in SATA mode. Kevin (cc'ed) has argued for a way to make it connect in l

Re: [Qemu-devel] [PATCH V3] layout: Reduce number of generator functions in __init__

2014-08-14 Thread Stefan Hajnoczi
On Mon, Aug 11, 2014 at 03:27:46PM +0400, Maria Kustova wrote: > Some issues can be found only when a fuzzed image has a partial structure, > e.g. has L1/L2 tables but no refcount ones. Generation of an entirely > defined image limits these cases. Now the Image constructor creates only > a header a

Re: [Qemu-devel] [PATCH v4 33/33] piix: Move pc_xen_hvm_init() closer to xenfv_machine_class_init()

2014-08-14 Thread Michael S. Tsirkin
On Thu, Aug 14, 2014 at 04:26:02PM -0300, Eduardo Habkost wrote: > Put all the Xen code in a single place. > > Signed-off-by: Eduardo Habkost Would apply to the new igd passthrough machine type as well? > --- > hw/i386/pc_piix.c | 26 -- > 1 file changed, 12 insertions(

Re: [Qemu-devel] [PATCH V4 0/3] image-fuzzer: Support L1/L2 tables in the qcow2 image generator

2014-08-14 Thread Stefan Hajnoczi
On Mon, Aug 11, 2014 at 03:01:07PM +0400, Maria Kustova wrote: > This patch series adds support of L1/L2 tables to the qcow2 image generator. > > This patch series was created for the 'block-next' branch and based on the > next > series: > [PATCH V6 0/5] tests: Add the image fuzzer with

Re: [Qemu-devel] [PATCH V4 3/3] layout: Add generators of L1/L2 tables

2014-08-14 Thread Stefan Hajnoczi
On Mon, Aug 11, 2014 at 03:01:10PM +0400, Maria Kustova wrote: > @@ -126,63 +187,59 @@ class Image(object): > ['>I', 96, 4, 'refcount_order'], > ['>I', 100, 0, 'header_length'] > ] > -v_header = FieldsList(meta_header) > +self.header = FieldsList(m

Re: [Qemu-devel] [PATCH V6 0/5] tests: Add the image fuzzer with qcow2 support

2014-08-14 Thread Stefan Hajnoczi
On Mon, Aug 11, 2014 at 02:33:57PM +0400, Maria Kustova wrote: > This patch series introduces the image fuzzer, a tool for stability and > reliability testing. > Its approach is to run large amount of tests in background. During every test > a > program (e.g. qemu-img) is called to read or modify

[Qemu-devel] [PATCH v4 32/33] pc: Eliminate pc_compat_*() functions

2014-08-14 Thread Eduardo Habkost
The pc_compat_*() functions are finally empty, and we can use the same init function for all piix and q35 subclasses. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 108 +- hw/i386/pc_q35.c | 61 +- 2 files

[Qemu-devel] [PATCH v4 31/33] pc: Add default KVM features fields to PCMachineClass

2014-08-14 Thread Eduardo Habkost
With the new fields, the x86_cpu_compat_disable_kvm_features() calls on pc_compat_*() functions can be replace by simple field initialization on class_init functions. This gets us one step closer to eliminating all pc_compat_*() functions. Those new fields may eventually become simple compat_props

Re: [Qemu-devel] [PATCH v4 26/33] target-i386: Renove underscores from feature names

2014-08-14 Thread Eduardo Habkost
On Thu, Aug 14, 2014 at 09:31:46PM +0200, Michael S. Tsirkin wrote: > s/Renove/Remove/ ? > > not that it matters ... Thanks. I will fix it in the next version. -- Eduardo

[Qemu-devel] [PATCH v4 26/33] target-i386: Renove underscores from feature names

2014-08-14 Thread Eduardo Habkost
The underscores will be translated by x86_cpu_parse_featurestr(). Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index c093168..b005b0d 100644 --- a/target-

[Qemu-devel] [PATCH v4 33/33] piix: Move pc_xen_hvm_init() closer to xenfv_machine_class_init()

2014-08-14 Thread Eduardo Habkost
Put all the Xen code in a single place. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 293422b..89ecb54 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/

[Qemu-devel] [PATCH v4 28/33] target-i386: set [+-]feature using QOM properties

2014-08-14 Thread Eduardo Habkost
From: Igor Mammedov * Define properties for cpuid feature bits * property names of CPUID feature bits are changed to have "feat-" prefix, so that it would be easy to distinguish them from other properties. * Convert [+-]cpuid_features to a set(QDict) of key, value pairs, where

[Qemu-devel] [PATCH v4 29/33] pc: Use compat_props for CPUID compat bits

2014-08-14 Thread Eduardo Habkost
x86_cpu_compat_set_features() is not necessary anymore, as now we can simply use compat_props. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 2 -- hw/i386/pc_q35.c | 2 -- include/hw/i386/pc.h | 8 target-i386/cpu.c| 26 -- target-i386/cpu.

[Qemu-devel] [PATCH v4 22/33] pc: Move globals to PCMachineClass

2014-08-14 Thread Eduardo Habkost
Move pci_enabled, has_acpi_build, legacy_acpi_table_size, smbios_defaults, smbios_legacy_mode, gigabyte_align, has_reserved_memory, and kvmclock_enabled to PCMachineClass, so they can be configured on class_init instead of requiring a separate PC init function. Signed-off-by: Eduardo Habkost ---

[Qemu-devel] [PATCH v4 27/33] target-i386: Register X86CPU "feat-kvmclock" feature

2014-08-14 Thread Eduardo Habkost
The "kvmclock" feature is special because it affects two bits in the KVM CPUID leaf, so it has to be handled differently from the other feature properties that will be added. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 61 +++ 1 file

Re: [Qemu-devel] [PATCH v4 26/33] target-i386: Renove underscores from feature names

2014-08-14 Thread Michael S. Tsirkin
s/Renove/Remove/ ? not that it matters ... On Thu, Aug 14, 2014 at 04:25:55PM -0300, Eduardo Habkost wrote: > The underscores will be translated by x86_cpu_parse_featurestr(). > > Signed-off-by: Eduardo Habkost > --- > target-i386/cpu.c | 25 - > 1 file changed, 12 inse

[Qemu-devel] [PATCH v4 18/33] machine: Eliminate QEMUMachine.compat_props

2014-08-14 Thread Eduardo Habkost
The only user of QEMUMachine.compat_props was the PC code, that was already converted to QOM. We don't need that field anymore. Signed-off-by: Eduardo Habkost --- include/hw/boards.h | 1 - vl.c| 3 --- 2 files changed, 4 deletions(-) diff --git a/include/hw/boards.h b/include/h

[Qemu-devel] [PATCH v4 21/33] machine: Add MachineClass.default_cpu_model field

2014-08-14 Thread Eduardo Habkost
Instead of making the machine-specific init code set a default CPU model, make the generic machine init code set cpu_model to a class-specific default if it is not set. Signed-off-by: Eduardo Habkost --- hw/i386/pc.c| 12 +--- hw/i386/pc_piix.c | 4 +--- include/hw/boards.h |

[Qemu-devel] [PATCH v4 25/33] target-i386: Move error handling to end of x86_cpu_parse_featurestr()

2014-08-14 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 6d008ab..c093168 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1822,8 +1822,7 @@ static void x86_cpu_parse_feat

[Qemu-devel] [PATCH v4 16/33] q35: Eliminate pc_q35_1_4_machine_options()

2014-08-14 Thread Eduardo Habkost
The function was used only in a single place. Signed-off-by: Eduardo Habkost --- hw/i386/pc_q35.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 2aa1c43..c3456ab 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -452,11 +

[Qemu-devel] [PATCH v4 30/33] target-i386: Move some declarations to hw/i386/cpu.h

2014-08-14 Thread Eduardo Habkost
This will allow the PC machine declarations (which must not depend on target-specific cpu.h because pc.h is included from target-independent code) to use i386-specific types. Signed-off-by: Eduardo Habkost --- include/hw/i386/cpu.h | 564 ++ target

[Qemu-devel] [PATCH v4 19/33] pc: Rename pc_machine variable to pcms

2014-08-14 Thread Eduardo Habkost
"pcms" being the initials of "PCMachineState". The variable will be used a lot, so it's better to make it short. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 10 +- hw/i386/pc_q35.c | 10 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/i386/pc_pi

[Qemu-devel] [PATCH v4 24/33] pc: Add PCMachineClass.compat_apic_id_mode field

2014-08-14 Thread Eduardo Habkost
This way we can move the enable_compat_apic_id_mode() calls from pc_compat_*() to pc_init1(). Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 9 +++-- include/hw/i386/pc.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c in

[Qemu-devel] [PATCH v4 15/33] q35: Eliminate pc_q35_machine_options()

2014-08-14 Thread Eduardo Habkost
Instead of calling it on every q35 class_init function, just register a common parent class for all q35 machine-types. Signed-off-by: Eduardo Habkost --- hw/i386/pc_q35.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/i386/pc_q35.c b/h

[Qemu-devel] [PATCH v4 20/33] pc: Pass PCMachineState argument to pc_cpus_init()

2014-08-14 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 13 +++-- hw/i386/pc_piix.c| 2 +- hw/i386/pc_q35.c | 2 +- include/hw/i386/pc.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 53c39cb..b42ff69 100644 --- a/hw/

[Qemu-devel] [PATCH v4 10/33] machine: Make compat_props a linked list

2014-08-14 Thread Eduardo Habkost
This will make it easier to write reusable class_init code which adds properties to MachineClass.compat_props. Use GList instead of reusing GlobalProperty.next, because the same GlobalProperty can appear on multiple machine subclasses. Signed-off-by: Eduardo Habkost --- Changes v3 -> v4: * Use G

[Qemu-devel] [PATCH v4 23/33] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass

2014-08-14 Thread Eduardo Habkost
This way, these settings can be simply set on the class_init function, instead of requiring a separate machine init function just to set global variables. Signed-off-by: Eduardo Habkost --- hw/core/loader.c| 12 +++- hw/core/machine.c | 1 + hw/i386/pc_piix.c | 8 hw/i

[Qemu-devel] [PATCH v4 17/33] pc: Eliminate all *_machine_options() functions

2014-08-14 Thread Eduardo Habkost
Finally eliminate all *_machine_options() functions, and make the class_init functions for older machine-types simply reuse the class_init functions from newer machine-types. To allow compat_props reuse, the the PC_COMPAT_* macros were changed to not nest within the older PC_COMPAT_* macros anymor

[Qemu-devel] [PATCH v4 12/33] pc: Eliminate pc_common_machine_options()

2014-08-14 Thread Eduardo Habkost
The TYPE_PC_MACHINE parent class can initialize the common options for all PC machines. Reviewed-by: Andreas Färber Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 2 -- include/hw/i386/pc.h | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff

[Qemu-devel] [PATCH v4 08/33] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13

2014-08-14 Thread Eduardo Habkost
The VGA and vmware-svga rombar compat properties were added by commit 281a26b15b4adcecb8604216738975abd754bea8, but only to pc-0.13 and pc-0.12. This breaks the PC_COMPAT_* nesting pattern we currently follow. The new variables will now be inherited by pc-0.11 and older, but pc-0.11 and pc-0.10 al

[Qemu-devel] [PATCH v4 13/33] pc: Eliminate pc_default_machine_options()

2014-08-14 Thread Eduardo Habkost
The only PC machines that didn't call pc_default_machine_options() were isaps and xenfv. Both were already overwriting max_cpus, and only isapc was not overwriting hot_add_cpu. After making isapc set hot_add_cpu to NULL, we can move the pc_default_machine_options() code the PC common class_init.

[Qemu-devel] [PATCH v4 09/33] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11

2014-08-14 Thread Eduardo Habkost
The current code setting ide-drive.ver and scsi-disk.ver on pc-0.11 breaks the PC_COMPAT_* nesting pattern we currently use. As those variables are overwritten in pc-0.10 too, they can be inherited by pc-0.10 with no side-effects at all. Signed-off-by: Eduardo Habkost Cc: Gerd Hoffmann --- hw/

[Qemu-devel] [PATCH v4 07/33] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13

2014-08-14 Thread Eduardo Habkost
The compat property was added by commit 9dbcca5aa13cb9ab40788ac4c56bc227d94ca920, and the pc-0.12 and older machine-types were not changed because virtio-9p-pci was introduced on QEMU 0.13 (commit 9f10751365b26b13b8a9b67e0e90536ae3d282df). The only problem is that this breaks the PC_COMPAT_* nestin

[Qemu-devel] [PATCH v4 14/33] piix: Eliminate pc_i440fx_machine_options()

2014-08-14 Thread Eduardo Habkost
Instead of calling it on every i440fx class_init function, just register a common parent class for all i440fx machine-types. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 55 +-- 1 file changed, 29 insertions(+), 26 deletions(-) diff

[Qemu-devel] [PATCH v4 05/33] piix: Eliminate pc_init_pci()

2014-08-14 Thread Eduardo Habkost
Now we can use pc_init1() directly. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 02c99a4..ff75ca1 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_pi

[Qemu-devel] [PATCH v4 03/33] pc: Eliminate has_pci_info global variable

2014-08-14 Thread Eduardo Habkost
The variable is always set to false and never changed, so we simply don't need it. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 5 + hw/i386/pc_q35.c | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 4f22be8..5287a

[Qemu-devel] [PATCH v4 06/33] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14

2014-08-14 Thread Eduardo Habkost
Those properties were introduced by commit 3827cdb1c3aa17a792d1658161195b9d7173c26b. They were not duplicated into pc-0.13 and older because 0.14 was the first QEMU version supporting qxl. The only problem is that this breaks the PC_COMPAT_* nesting pattern we currently use. So, move the propertie

[Qemu-devel] [PATCH v4 11/33] pc: Register machine classes directly instead of using QEMUMachine

2014-08-14 Thread Eduardo Habkost
This is a (mostly) blind and mechanical conversion of the PC QEMUMachine definitions to corresponding class registration code. Existing duplication and unnecessary complexity on macro/function reuse is being kept, to keep the conversion simple to review. The complexity and duplication will be grad

[Qemu-devel] [PATCH v4 04/33] piix: Add kvmclock_enabled, pci_enabled globals

2014-08-14 Thread Eduardo Habkost
This looks like a step backwards, but it will allow pc-0.1[0123] and isapc to follow the same compat+init pattern used by the other machine-types, making it easier to convert them to QOM and reduce duplicated code. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 22 +++---

[Qemu-devel] [PATCH v4 01/33] pc: Replace tabs with spaces on pc.h

2014-08-14 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 863eefb..9fb7144 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -446,23 +446,23 @@ bool e820_

  1   2   3   >