Re: [Qemu-devel] [PATCH 06/21] vl: add a tmp pointer so that a handler can delete the entry to which it belongs.

2010-12-08 Thread Yoshiaki Tamura
2010/12/8 Isaku Yamahata yamah...@valinux.co.jp: QLIST_FOREACH_SAFE? Thanks! So, it should be, QLIST_FOREACH_SAFE(e, vm_change_state_head, entries, ne) { e-cb(e-opaque, running, reason); } I'll put it in the next spin. Yoshi On Thu, Nov 25, 2010 at 03:06:45PM +0900, Yoshiaki Tamura

Re: [PATCH 07/15] ftrace: fix event alignment: kvm:kvm_hv_hypercall

2010-12-08 Thread Avi Kivity
On 12/07/2010 11:16 PM, David Sharp wrote: I don't understand this. Can you elaborate? What does 32-bit addressable mean? The ring buffer gives you space that is a multiple of 4 bytes in length, and 32-bit aligned. Therefore it is useless to attempt to align the structure beyond 32-bit

Re: [PATCH] KVM: Fix OSXSAVE after migration

2010-12-08 Thread Avi Kivity
On 12/08/2010 04:49 AM, Sheng Yang wrote: CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the CPUID after migration. Applied, thanks. @@ -5585,6 +5585,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, mmu_reset_needed |= kvm_read_cr4(vcpu) !=

Re: [PATCH] ceph/rbd block driver for qemu-kvm (v9)

2010-12-08 Thread Kevin Wolf
Am 06.12.2010 20:53, schrieb Christian Brunner: This is a new version of the rbd driver. The only difference from v8 is a check for a recent librados version in configure. If the librados version is too old, rbd support will be disabled. RBD is an block driver for the distributed file system

Re: [PATCH 2/2] KVM: SVM: Add xsetbv intercept

2010-12-08 Thread Avi Kivity
On 12/07/2010 06:15 PM, Joerg Roedel wrote: This patch implements the xsetbv intercept to the AMD part of KVM. This makes AVX usable in a save way for the guest on AVX capable AMD hardware. The patch is tested by using AVX in the guest and host in parallel and checking for data corruption. I

Re: [PATCH] kvm/x86: enlarge number of possible CPUID leaves

2010-12-08 Thread Andre Przywara
Avi, Marcello, can you please commit this simple fix? (turning 40 to 80?) Without it QEMU crashes reliably on our new CPUs (they return 46 leaves) and causes pain in our testing, because we have to manually apply this patch on each tree. Thanks! Andre. Currently the number of CPUID leaves

[PATCH] kvm: cleanup CR8 handling

2010-12-08 Thread Andre Przywara
The handling of CR8 writes in KVM is currently somewhat cumbersome. This patch makes it look like the other CR register handlers and fixes a possible issue in VMX, where the RIP would be incremented despite an injected #GP. Signed-off-by: Andre Przywara andre.przyw...@amd.com ---

[PATCHv8 03/16] Keep track of ISA ports ISA device is using in qdev.

2010-12-08 Thread Gleb Natapov
Store all io ports used by device in ISADevice structure. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/cs4231a.c |1 + hw/fdc.c |3 +++ hw/gus.c |4 hw/ide/isa.c |2 ++ hw/isa-bus.c | 25 + hw/isa.h |4

[PATCHv8 02/16] Introduce new BusInfo callback get_fw_dev_path.

2010-12-08 Thread Gleb Natapov
New get_fw_dev_path callback will be used for build device path usable by firmware in contrast to qdev qemu internal device path. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/qdev.h |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/hw/qdev.h b/hw/qdev.h index

[PATCHv8 16/16] Pass boot device list to firmware.

2010-12-08 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/fw_cfg.c | 14 ++ sysemu.h|1 + vl.c| 48 3 files changed, 63 insertions(+), 0 deletions(-) diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index 7b9434f..20a816f 100644

[PATCHv8 04/16] Add get_fw_dev_path callback to ISA bus in qdev.

2010-12-08 Thread Gleb Natapov
Use device ioports to create unique device path. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/isa-bus.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index c0ac7e9..c423c1b 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c

[PATCHv8 11/16] Add get_fw_dev_path callback to scsi bus.

2010-12-08 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/scsi-bus.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 93f0e9a..7febb86 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -5,9 +5,12 @@ #include qdev.h

[PATCHv8 10/16] Add get_fw_dev_path callback for usb bus.

2010-12-08 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/usb-bus.c | 42 ++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/hw/usb-bus.c b/hw/usb-bus.c index 256b881..8b4583c 100644 --- a/hw/usb-bus.c +++ b/hw/usb-bus.c @@ -5,11 +5,13 @@

[PATCHv8 01/16] Introduce fw_name field to DeviceInfo structure.

2010-12-08 Thread Gleb Natapov
Add fw_name to DeviceInfo to use in device path building. In contrast to name fw_name should refer to functionality device provides instead of particular device model like name does. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/fdc.c|1 + hw/ide/isa.c|1 + hw/ide/qdev.c

[PATCHv8 07/16] Add get_fw_dev_path callback for system bus.

2010-12-08 Thread Gleb Natapov
Prints out mmio or pio used to access child device. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/pci_host.c |2 ++ hw/sysbus.c | 30 ++ hw/sysbus.h |4 3 files changed, 36 insertions(+), 0 deletions(-) diff --git a/hw/pci_host.c

[PATCHv8 13/16] Change fw_cfg_add_file() to get full file path as a parameter.

2010-12-08 Thread Gleb Natapov
Change fw_cfg_add_file() to get full file path as a parameter instead of building one internally. Two reasons for that. First caller may need to know how file is named. Second this moves policy of file naming out from fw_cfg. Platform may want to use more then two levels of directories for

[PATCHv8 12/16] Add bootindex parameter to net/block/fd device

2010-12-08 Thread Gleb Natapov
If bootindex is specified on command line a string that describes device in firmware readable way is added into sorted list. Later this list will be passed into firmware to control boot order. Signed-off-by: Gleb Natapov g...@redhat.com --- block_int.h |4 +++- hw/e1000.c |4

[PATCHv8 09/16] Record which USBDevice USBPort belongs too.

2010-12-08 Thread Gleb Natapov
Ports on root hub will have NULL here. This is needed to reconstruct path from device to its root hub to build device path. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/usb-bus.c |3 ++- hw/usb-hub.c |2 +- hw/usb-musb.c |2 +- hw/usb-ohci.c |2 +- hw/usb-uhci.c |2 +-

[PATCHv8 08/16] Add get_fw_dev_path callback for pci bus.

2010-12-08 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/pci.c | 108 - 1 files changed, 85 insertions(+), 23 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 0c15b13..e7ea907 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -43,6 +43,7 @@

[PATCHv8 05/16] Store IDE bus id in IDEBus structure for easy access.

2010-12-08 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/ide/cmd646.c |4 ++-- hw/ide/internal.h |3 ++- hw/ide/isa.c |2 +- hw/ide/piix.c |4 ++-- hw/ide/qdev.c |3 ++- hw/ide/via.c |4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git

[PATCHv8 06/16] Add get_fw_dev_path callback to IDE bus.

2010-12-08 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/ide/qdev.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 88ff657..01a181b 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -24,9 +24,12 @@ /*

[PATCHv8 14/16] Add bootindex for option roms.

2010-12-08 Thread Gleb Natapov
Extend -option-rom command to have additional parameter ,bootindex=. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/loader.c| 16 +++- hw/loader.h|8 hw/multiboot.c |3 ++- hw/ne2000.c|2 +- hw/nseries.c |4 ++-- hw/palm.c |6

[PATCHv8 00/16] boot order specification

2010-12-08 Thread Gleb Natapov
Forget to save a couple of buffers before sending version 7 :( Anthony, Blue can this be applied now? Gleb Natapov (16): Introduce fw_name field to DeviceInfo structure. Introduce new BusInfo callback get_fw_dev_path. Keep track of ISA ports ISA device is using in qdev. Add

[PATCHv8 15/16] Add notifier that will be called when machine is fully created.

2010-12-08 Thread Gleb Natapov
Action that depends on fully initialized device model should register with this notifier chain. Signed-off-by: Gleb Natapov g...@redhat.com --- sysemu.h |2 ++ vl.c | 15 +++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/sysemu.h b/sysemu.h index

Re: [PATCH] kvm/x86: enlarge number of possible CPUID leaves

2010-12-08 Thread Avi Kivity
On 12/08/2010 01:13 PM, Andre Przywara wrote: Avi, Marcello, can you please commit this simple fix? (turning 40 to 80?) Without it QEMU crashes reliably on our new CPUs (they return 46 leaves) and causes pain in our testing, because we have to manually apply this patch on each tree. Sorry

Re: [PATCH] kvm/x86: enlarge number of possible CPUID leaves

2010-12-08 Thread Avi Kivity
On 12/01/2010 02:55 PM, Andre Przywara wrote: Avi Kivity wrote: On 12/01/2010 01:17 PM, Andre Przywara wrote: Currently the number of CPUID leaves KVM handles is limited to 40. My desktop machine (AthlonII) already has 35 and future CPUs will expand this well beyond the limit. Extend the limit

Re: [Qemu-devel] [PATCH 06/21] vl: add a tmp pointer so that a handler can delete the entry to which it belongs.

2010-12-08 Thread Anthony Liguori
On 12/08/2010 02:11 AM, Yoshiaki Tamura wrote: 2010/12/8 Isaku Yamahatayamah...@valinux.co.jp: QLIST_FOREACH_SAFE? Thanks! So, it should be, QLIST_FOREACH_SAFE(e,vm_change_state_head, entries, ne) { e-cb(e-opaque, running, reason); } I'll put it in the next spin. This is

[PATCH] KVM: Fix build error on s390 due to missing tlbs_dirty

2010-12-08 Thread Avi Kivity
Make it available for all archs. Signed-off-by: Avi Kivity a...@redhat.com --- include/linux/kvm_host.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bd0da8f..b5021db 100644 --- a/include/linux/kvm_host.h +++

[PATCH 0/28] nVMX: Nested VMX, v7

2010-12-08 Thread Nadav Har'El
Hi, This is the seventh iteration of the nested VMX patch set. It fixes a bunch of bugs in the previous iteration, and in particular it now works correctly with EPT in the L0 hypervisor, so ept=0 no longer needs to be specified. This new set of patches should apply to the current KVM trunk (I

[PATCH 01/28] nVMX: Add nested module option to vmx.c

2010-12-08 Thread Nadav Har'El
This patch adds a module option nested to vmx.c, which controls whether the guest can use VMX instructions, i.e., whether we allow nested virtualization. A similar, but separate, option already exists for the SVM module. This option currently defaults to 0, meaning that nested VMX must be

[PATCH 02/28] nVMX: Add VMX and SVM to list of supported cpuid features

2010-12-08 Thread Nadav Har'El
If the nested module option is enabled, add the VMX CPU feature to the list of CPU features KVM advertises with the KVM_GET_SUPPORTED_CPUID ioctl. Qemu uses this ioctl, and intersects KVM's list with its own list of desired cpu features (depending on the -cpu option given to qemu) to determine

[PATCH 03/28] nVMX: Implement VMXON and VMXOFF

2010-12-08 Thread Nadav Har'El
This patch allows a guest to use the VMXON and VMXOFF instructions, and emulates them accordingly. Basically this amounts to checking some prerequisites, and then remembering whether the guest has enabled or disabled VMX operation. Signed-off-by: Nadav Har'El n...@il.ibm.com ---

[PATCH 04/28] nVMX: Allow setting the VMXE bit in CR4

2010-12-08 Thread Nadav Har'El
This patch allows the guest to enable the VMXE bit in CR4, which is a prerequisite to running VMXON. Whether to allow setting the VMXE bit now depends on the architecture (svm or vmx), so its checking has moved to kvm_x86_ops-set_cr4(). This function now returns an int: If kvm_x86_ops-set_cr4()

[PATCH 05/28] nVMX: Introduce vmcs12: a VMCS structure for L1

2010-12-08 Thread Nadav Har'El
An implementation of VMX needs to define a VMCS structure. This structure is kept in guest memory, but is opaque to the guest (who can only read or write it with VMX instructions). This patch starts to define the VMCS structure which our nested VMX implementation will present to L1. We call it

[PATCH 06/28] nVMX: Implement reading and writing of VMX MSRs

2010-12-08 Thread Nadav Har'El
When the guest can use VMX instructions (when the nested module option is on), it should also be able to read and write VMX MSRs, e.g., to query about VMX capabilities. This patch adds this support. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 117

[PATCH 07/28] nVMX: Decoding memory operands of VMX instructions

2010-12-08 Thread Nadav Har'El
This patch includes a utility function for decoding pointer operands of VMX instructions issued by L1 (a guest hypervisor) Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 59 +++ arch/x86/kvm/x86.c |3 +- arch/x86/kvm/x86.h |

[PATCH 08/28] nVMX: Hold a vmcs02 for each vmcs12

2010-12-08 Thread Nadav Har'El
In this patch we add a list of L0 (hardware) VMCSs, which we'll use to hold a hardware VMCS for each active vmcs12 (i.e., for each L2 guest). We call each of these L0 VMCSs a vmcs02, as it is the VMCS that L0 uses to run its nested guest L2. Signed-off-by: Nadav Har'El n...@il.ibm.com ---

[PATCH 11/28] nVMX: Implement VMCLEAR

2010-12-08 Thread Nadav Har'El
This patch implements the VMCLEAR instruction. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 60 ++- 1 file changed, 59 insertions(+), 1 deletion(-) --- .before/arch/x86/kvm/vmx.c 2010-12-08 18:56:50.0 +0200 +++

[PATCH 12/28] nVMX: Implement VMPTRLD

2010-12-08 Thread Nadav Har'El
This patch implements the VMPTRLD instruction. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 61 ++- 1 file changed, 60 insertions(+), 1 deletion(-) --- .before/arch/x86/kvm/vmx.c 2010-12-08 18:56:50.0 +0200 +++

[PATCH 13/28] nVMX: Implement VMPTRST

2010-12-08 Thread Nadav Har'El
This patch implements the VMPTRST instruction. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 27 ++- arch/x86/kvm/x86.c |3 ++- arch/x86/kvm/x86.h |3 +++ 3 files changed, 31 insertions(+), 2 deletions(-) --- .before/arch/x86/kvm/x86.c

[PATCH 15/28] nVMX: Prepare vmcs02 from vmcs01 and vmcs12

2010-12-08 Thread Nadav Har'El
This patch contains code to prepare the VMCS which can be used to actually run the L2 guest, vmcs02. prepare_vmcs02 appropriately merges the information in vmcs12 (the vmcs that L1 built for L2) and in vmcs01 (the vmcs that we built for L1). VMREAD/WRITE can only access one VMCS at a time (the

[PATCH 16/28] nVMX: Move register-syncing to a function

2010-12-08 Thread Nadav Har'El
Move code that syncs dirty RSP and RIP registers back to the VMCS, into a function. We will need to call this function from additional places in the next patch. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 15 ++- 1 file changed, 10 insertions(+), 5

[PATCH 17/28] nVMX: Implement VMLAUNCH and VMRESUME

2010-12-08 Thread Nadav Har'El
Implement the VMLAUNCH and VMRESUME instructions, allowing a guest hypervisor to run its own guests. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 235 ++- 1 file changed, 232 insertions(+), 3 deletions(-) ---

[PATCH 19/28] nVMX: Exiting from L2 to L1

2010-12-08 Thread Nadav Har'El
This patch implements nested_vmx_vmexit(), called when the nested L2 guest exits and we want to run its L1 parent and let it handle this exit. Note that this will not necessarily be called on every L2 exit. L0 may decide to handle a particular exit on its own, without L1's involvement; In that

[PATCH 21/28] nVMX: Correct handling of interrupt injection

2010-12-08 Thread Nadav Har'El
When KVM wants to inject an interrupt, the guest should think a real interrupt has happened. Normally (in the non-nested case) this means checking that the guest doesn't block interrupts (and if it does, inject when it doesn't - using the interrupt window VMX mechanism), and setting up the

[PATCH 22/28] nVMX: Correct handling of exception injection

2010-12-08 Thread Nadav Har'El
Similar to the previous patch, but concerning injection of exceptions rather than external interrupts. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) --- .before/arch/x86/kvm/vmx.c 2010-12-08

[PATCH 23/28] nVMX: Correct handling of idt vectoring info

2010-12-08 Thread Nadav Har'El
This patch adds correct handling of IDT_VECTORING_INFO_FIELD for the nested case. When a guest exits while handling an interrupt or exception, we get this information in IDT_VECTORING_INFO_FIELD in the VMCS. When L2 exits to L1, there's nothing we need to do, because L1 will see this field in

[PATCH 24/28] nVMX: Handling of CR0 and CR4 modifying instructions

2010-12-08 Thread Nadav Har'El
When L2 tries to modify CR0 or CR4 (with mov or clts), and modifies a bit which L1 asked to shadow (via CR[04]_GUEST_HOST_MASK), we already do the right thing: we let L1 handle the trap (see nested_vmx_exit_handled_cr() in a previous patch). When L2 modifies bits that L1 doesn't care about, we let

[PATCH 25/28] nVMX: Further fixes for lazy FPU loading

2010-12-08 Thread Nadav Har'El
KVM's Lazy FPU loading means that sometimes L0 needs to set CR0.TS, even if a guest didn't set it. Moreover, L0 must also trap CR0.TS changes and NM exceptions, even if we have a guest hypervisor (L1) who didn't want these traps. And of course, conversely: If L1 wanted to trap these events, we

[PATCH 26/28] nVMX: Additional TSC-offset handling

2010-12-08 Thread Nadav Har'El
In the unlikely case that L1 does not capture MSR_IA32_TSC, L0 needs to emulate this MSR write by L2 by modifying vmcs02.tsc_offset. We also need to set vmcs12.tsc_offset, for this change to survive the next nested entry (see prepare_vmcs02()). Signed-off-by: Nadav Har'El n...@il.ibm.com ---

[PATCH 27/28] nVMX: Miscellenous small corrections

2010-12-08 Thread Nadav Har'El
Small corrections of KVM (spelling, etc.) not directly related to nested VMX. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- .before/arch/x86/kvm/vmx.c 2010-12-08 18:56:52.0 +0200 +++

[PATCH 28/28] nVMX: Documentation

2010-12-08 Thread Nadav Har'El
This patch includes a brief introduction to the nested vmx feature in the Documentation/kvm directory. The document also includes a copy of the vmcs12 structure, as requested by Avi Kivity. Signed-off-by: Nadav Har'El n...@il.ibm.com --- Documentation/kvm/nested-vmx.txt | 237

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-08 Thread Rik van Riel
On 12/03/2010 08:23 AM, Peter Zijlstra wrote: On Thu, 2010-12-02 at 14:44 -0500, Rik van Riel wrote: unsigned long clone_flags); + +#ifdef CONFIG_SCHED_HRTICK +extern u64 slice_remain(struct task_struct *); +extern void yield_to(struct task_struct *); +#else

kvm hangs on mkfs

2010-12-08 Thread Hanno Böck
Hi, I tried a relatively simple task with qemu-kvm. I have two qcow hd images and try to create filesystems on them using a gentoo installation disk. Starting qemu with: qemu -m 512 -cdrom install-x86-minimal-20101116.iso -hda hda.img -hdb hdb.img However, mkfs always hangs indefinitely.

Re: [PATCH v2 1/2] Do not register kvmclock savevm section if kvmclock is disabled.

2010-12-08 Thread Marcelo Tosatti
On Tue, Dec 07, 2010 at 03:12:36PM -0200, Glauber Costa wrote: On Mon, 2010-12-06 at 19:04 -0200, Marcelo Tosatti wrote: On Mon, Dec 06, 2010 at 09:03:46AM -0500, Glauber Costa wrote: Usually nobody usually thinks about that scenario (me included and specially), but kvmclock can be

Re: [RFC PATCH] KVM: Fix missing lock for kvm_io_bus_unregister_dev()

2010-12-08 Thread Marcelo Tosatti
On Wed, Dec 08, 2010 at 01:45:06AM +0900, Takuya Yoshikawa wrote: Memo: - kvm_io_bus_register_dev() was protected as far as I checked. - kvm_create_pit() was commented like Caller must hold slots_lock but kvm_free_pit() was not. So I don't know if I should protect the whole

Re: kvm hangs on mkfs

2010-12-08 Thread Brian Jackson
On Wednesday, December 08, 2010 01:09:25 pm Hanno Böck wrote: Hi, I tried a relatively simple task with qemu-kvm. I have two qcow hd images and try to create filesystems on them using a gentoo installation disk. qcow2 (I hope you are using that vs just qcow) is known to be a tad on the

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-08 Thread Peter Zijlstra
On Wed, 2010-12-08 at 12:55 -0500, Rik van Riel wrote: Right, so another approach might be to simply swap the vruntime between curr and p. Doesn't that run into the same scale issue you described above? Not really, but its tricky on SMP because vruntime only has meaning within a

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-08 Thread Peter Zijlstra
On Wed, 2010-12-08 at 21:00 +0100, Peter Zijlstra wrote: + lag0 = avg_vruntime(cfs_rq_of(se)); + p_lag0 = avg_vruntime(cfs_rq_of(p_se)); + + lag = se-vruntime - avg_vruntime(cfs_rq); + p_lag = p_se-vruntime - avg_vruntime(p_cfs_rq); + + if (p_lag lag) { /* if

Re: Memory leaks in virtio drivers?

2010-12-08 Thread Freddie Cash
On Wed, Dec 1, 2010 at 10:16 AM, Freddie Cash fjwc...@gmail.com wrote: Just an update on this.  We made the change over the weekend to enable cache=off for all the VMs, including the libvirt managed ones (turns out, libvirtd only reads the .xml files at startup); and enabeld KSM on the host.

Re: kvm hangs on mkfs

2010-12-08 Thread Hanno Böck
Am Wednesday 08 December 2010 schrieb Brian Jackson: qcow2 (I hope you are using that vs just qcow) is known to be a tad on the slow side on metadata heavy operations (i.e. mkfs, installing lots of files, etc.). One trick some of us use is to use the -drive syntax (vs -hda) and set the cache

Re: [RFC PATCH 3/3] kvm: use yield_to instead of sleep in kvm_vcpu_on_spin

2010-12-08 Thread Rik van Riel
On 12/05/2010 07:56 AM, Avi Kivity wrote: + if (vcpu == me) + continue; + if (vcpu-spinning) + continue; You may well want to wake up a spinner. Suppose A takes a lock B preempts A B grabs a ticket, starts spinning, yields to A A releases lock A grabs ticket, starts spinning at this point,

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-08 Thread Rik van Riel
On 12/08/2010 03:00 PM, Peter Zijlstra wrote: Anyway, complete untested and such.. Looks very promising. I've been making a few changes in the same direction (except for the fancy CFS bits) and have one way to solve the one problem you pointed out in your patch. +void yield_to(struct

Unittests failure for latest upstream kvm.git + qemu-kvm.git + kvm-unit-tests.git

2010-12-08 Thread Lucas Meneghel Rodrigues
' -monitor unix:'/tmp/monitor-humanmonitor1-20101208-191729-GpeV',server,nowait -serial unix:'/tmp/serial-20101208-191729-GpeV',server,nowait -m 512 -smp 2 -kernel '/usr/local/autotest/tests/kvm/unittests/vmexit.flat' -vnc :0 -chardev file,id=testlog,path=/tmp/testlog-20101208-191729-GpeV

[PATCH] [qemu-kvm-next-tree] fix compile error of hw/device-assignment.c

2010-12-08 Thread Wei Yongjun
Fix the following compile error in next tree: CCx86_64-softmmu/device-assignment.o hw/device-assignment.c: In function ‘assigned_device_pci_cap_init’: hw/device-assignment.c:1463: error: ‘PCI_PM_CTRL_NO_SOFT_RST’ undeclared (first use in this function) hw/device-assignment.c:1463: error:

[PATCH 1/6] qemu,kvm: Enable NMI support for user space irqchip

2010-12-08 Thread Lai Jiangshan
Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the user space APIC emulation or some other source raised them. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 7dfc357..c4ebe28 100644 --- a/target-i386/kvm.c +++

[PATCH 2/6] qemu,qmp: convert do_inject_nmi() to QObject

2010-12-08 Thread Lai Jiangshan
Convert do_inject_nmi() to QObject, we need to use it(via libvirt). It is trivial, as it never fails, doesn't have output nor return any data. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/hmp-commands.hx b/hmp-commands.hx index 7a49b74..2e6b034 100644 ---

[PATCH 3/6] qumu,qmp: QError: New QERR_INVALID_KEY

2010-12-08 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/qerror.c b/qerror.c index ac2cdaf..a7ef758 100644 --- a/qerror.c +++ b/qerror.c @@ -117,6 +117,10 @@ static const QErrorStringTable qerror_table[] = { .desc = Invalid block format '%(name)', }, { +

[PATCH 4/6] qemu,qmp: QError: New QERR_TOO_MANY_KEYS

2010-12-08 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/qerror.c b/qerror.c index a7ef758..fd66d2a 100644 --- a/qerror.c +++ b/qerror.c @@ -197,6 +197,10 @@ static const QErrorStringTable qerror_table[] = { .desc = Too many open files, }, { +.error_fmt =

[PATCH 5/6] qemu,qmp: QError: New QERR_UNKNOWN_KEY

2010-12-08 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/qerror.c b/qerror.c index fd66d2a..07b4cfc 100644 --- a/qerror.c +++ b/qerror.c @@ -205,6 +205,10 @@ static const QErrorStringTable qerror_table[] = { .desc = An undefined error has ocurred, }, { +

[PATCH 6/6] qemu,qmp: Convert do_sendkey() to QObject,QError

2010-12-08 Thread Lai Jiangshan
Convert do_sendkey() to QObject,QError, we need to use it.(via libvirt) It is a trivial conversion, carefully converted the error reports. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/hmp-commands.hx b/hmp-commands.hx index 23024ba..7a49b74 100644 --- a/hmp-commands.hx +++

Re: [PATCH 1/6] qemu,kvm: Enable NMI support for user space irqchip

2010-12-08 Thread Jan Kiszka
Am 09.12.2010 07:58, Lai Jiangshan wrote: Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the user space APIC emulation or some other source raised them. In that light, the subject is not absolutely correct. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff