Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-25 Thread Michael S. Tsirkin
On Wed, May 25, 2011 at 11:05:04AM +0930, Rusty Russell wrote: On Mon, 23 May 2011 14:19:00 +0300, Michael S. Tsirkin m...@redhat.com wrote: I do understand how it seems a waste to leave direct space in the ring while we might in practice have space due to indirect. Didn't come up with a

Re: Restoring saved guest causes guest to reboot

2011-05-25 Thread Markus Schade
On 05/24/2011 03:42 PM, Avi Kivity wrote: On 05/24/2011 04:37 PM, Markus Schade wrote: On Tue, 24 May 2011, Avi Kivity wrote: Hmm, only 19 patches between .37 and .38 touch vmx.c. Avi, any idea which of those patches could cause this? Might be several. Markus, can you try a bisect? The

RE: [PATCH 21/31] nVMX: vmcs12 checks on nested entry

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El [mailto:n...@math.technion.ac.il] Sent: Wednesday, May 25, 2011 1:38 PM On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 21/31] nVMX: vmcs12 checks on nested entry: + if (vmcs12-launch_state == launch) { + nested_vmx_failValid(vcpu, +

RE: [PATCH 22/31] nVMX: Deciding if L0 or L1 should handle an L2 exit

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Tuesday, May 17, 2011 3:55 AM This patch contains the logic of whether an L2 exit should be handled by L0 and then L2 should be resumed, or whether L1 should be run to handle this exit (using the nested_vmx_vmexit() function of the previous patch). The basic idea

RE: [PATCH 18/31] nVMX: Implement VMLAUNCH and VMRESUME

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Tuesday, May 17, 2011 3:53 AM Implement the VMLAUNCH and VMRESUME instructions, allowing a guest hypervisor to run its own guests. This patch does not include some of the necessary validity checks on vmcs12 fields before the entry. These will appear in a separate

Re: [PATCH 20/31] nVMX: Exiting from L2 to L1

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 20/31] nVMX: Exiting from L2 to L1: IOW, I disagree that if L0/L1 set same bit in cr0_guest_host_mask, then the bit is identical in vmcs02.guest_cr0 and vmcs12.guest_cr0 because L1 has no permission to set its bit effectively in this

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Paolo Bonzini
On 05/24/2011 09:40 PM, Ingo Molnar wrote: Ah, forgot about this. Given_why_ this happens (for static libraries, the linker omits object modules that are not required to fulfill undefined references in previous objects), I'd be surprised if explicit section tricks do not have the same

RE: [PATCH 20/31] nVMX: Exiting from L2 to L1

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El [mailto:n...@math.technion.ac.il] Sent: Wednesday, May 25, 2011 4:06 PM On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 20/31] nVMX: Exiting from L2 to L1: IOW, I disagree that if L0/L1 set same bit in cr0_guest_host_mask, then the bit is identical in

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Ingo Molnar
* Paolo Bonzini pbonz...@redhat.com wrote: In that sense ((section)) is way more robust: there's not really that many ways to screw that up. Fiddling with the ((constructor)) environment on the other hand ... Sorry, this is textbook FUD. I specifically cited the problem of

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Ingo Molnar
* Paolo Bonzini pbonz...@redhat.com wrote: ((constructor)) has showstopper properties: - We don't have access to the program arguments - stdio is probably not set up yet (this is undefined AFAICS) As I said, you can do this even better by doing only minimal work in the constructor.

RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Tuesday, May 17, 2011 3:56 AM The code in this patch correctly emulates external-interrupt injection while a nested guest L2 is running. Because of this code's relative un-obviousness, I include here a longer-than- usual justification for what it does - much

RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Tian, Kevin
From: Tian, Kevin Sent: Wednesday, May 25, 2011 4:40 PM If L1 turns on VM_EXIT_ACK_INTR_ON_EXIT (again, no hypervisor that I know does), things look very different from the description above: L1 expects Type-1 bare metal hypervisor may enable this bit, such as Xen. This bit is really

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Paolo Bonzini
On 05/25/2011 10:32 AM, Ingo Molnar wrote: * Paolo Bonzinipbonz...@redhat.com wrote: In that sense ((section)) is way more robust: there's not really that many ways to screw that up. Fiddling with the ((constructor)) environment on the other hand ... Sorry, this is textbook FUD.

RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Tuesday, May 17, 2011 3:56 AM The code in this patch correctly emulates external-interrupt injection while a nested guest L2 is running. Because of this code's relative un-obviousness, I include here a longer-than- usual justification for what it does - much

[PATCH 1/2] KVM Test: Add a new kvm subtest multi_disk.

2011-05-25 Thread fyang
From: Feng Yang fy...@redhat.com This case test multi disk suport in kvm guest os. It can work on Linux and Windows guest. Signed-off-by: Feng Yang fy...@redhat.com --- client/tests/kvm/tests/multi_disk.py | 127 ++ 1 files changed, 127 insertions(+), 0

[PATCH 2/2] KVM Test: sample configure for multi_disk test case.

2011-05-25 Thread fyang
From: Feng Yang fy...@redhat.com Test this configure with nic_mode = tap Signed-off-by: Feng Yang fy...@redhat.com --- client/tests/kvm/tests_base.cfg.sample | 91 +++- 1 files changed, 89 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Ingo Molnar
* Paolo Bonzini pbonz...@redhat.com wrote: So you claim that ((section)) is 'not portable' but concede that it does in fact not port to one of the most widely used compilers. Can you please avoid trimming messages? I said the differences between MSVC and GCC can easily be

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Ingo Molnar
* Paolo Bonzini pbonz...@redhat.com wrote: On 05/25/2011 10:32 AM, Ingo Molnar wrote: * Paolo Bonzinipbonz...@redhat.com wrote: In that sense ((section)) is way more robust: there's not really that many ways to screw that up. Fiddling with the ((constructor)) environment on

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Paolo Bonzini
On 05/25/2011 11:36 AM, Ingo Molnar wrote: So can other portability problems be solved, such as linker scripts can be written for non-ELF targets (should that ever become necessary) I know that's not going to be the case, and I mentioned that in my first message---portability is not relevant

RE: [PATCH 25/31] nVMX: Correct handling of idt vectoring info

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Tuesday, May 17, 2011 3:57 AM This patch adds correct handling of IDT_VECTORING_INFO_FIELD for the nested case. When a guest exits while delivering an interrupt or exception, we get this information in IDT_VECTORING_INFO_FIELD in the VMCS. When L2 exits to L1,

Re: [PATCH 25/31] nVMX: Correct handling of idt vectoring info

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 25/31] nVMX: Correct handling of idt vectoring info: Here got one question. How about L2 has interrupt exiting disabled? That way You are right, this is a bug in my code. It's a known bug - listed on my private bugzilla - but I didn't get

migrating a vm from old qemu-kvm 0.12.5 to new qemu-kvm 0.14.1

2011-05-25 Thread Jason Krieg
Hi, restoring a memory dump created with an old version qemu-kvm 0.12.5 to new 0.14.0 or 0.14.1 does not work for me looking at the code this is supposed to work vmstate_load() runs through the various sections without errors and the vm is up and running but the guest seems to be crashed

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Ingo Molnar
* Paolo Bonzini pbonz...@redhat.com wrote: so what's your point? Using this kind of trick makes it harder to share code with other libraries that may require a higher standard of portability (not better or worse, just higher). [...] That's an complication but should be fixable, should

RE: [PATCH 25/31] nVMX: Correct handling of idt vectoring info

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Wednesday, May 25, 2011 6:14 PM On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 25/31] nVMX: Correct handling of idt vectoring info: Here got one question. How about L2 has interrupt exiting disabled? That way You are right, this is a bug in my code.

RE: [PATCH 31/31] nVMX: Documentation

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Tuesday, May 17, 2011 4:00 AM 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

RE: [PATCH] new version of loaded_vmcs patch

2011-05-25 Thread Tian, Kevin
From: Avi Kivity Sent: Tuesday, May 24, 2011 9:57 PM On 05/24/2011 04:14 PM, Avi Kivity wrote: On 05/24/2011 03:26 PM, Nadav Har'El wrote: Hi Avi, here is a updated version of the loaded_vmcs patch which you asked me to send before the rest of the nvmx patches. Please let me know

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Paolo Bonzini
On 05/25/2011 12:17 PM, Ingo Molnar wrote: Also it's not clear why ((constructor)) was written in the way it was: why apparently no access is given to the array of init functions It is accessible---glibc uses it. and why it's not possible to turn the auto-execution off but still have the

Re: [PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection: If L1 turns on VM_EXIT_ACK_INTR_ON_EXIT (again, no hypervisor that I know does), things look very different from the description above: L1 expects Type-1 bare metal hypervisor may

Re: [PATCH 31/31] nVMX: Documentation

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 31/31] nVMX: Documentation: +On Intel processors, KVM uses Intel's VMX (Virtual-Machine eXtensions) +to easily and efficiently run guest operating systems. Normally, these guests +*cannot* themselves be hypervisors running their

RE: [PATCH 31/31] nVMX: Documentation

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Wednesday, May 25, 2011 7:55 PM On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 31/31] nVMX: Documentation: +On Intel processors, KVM uses Intel's VMX (Virtual-Machine eXtensions) +to easily and efficiently run guest operating systems. Normally, these

Re: [PATCH 31/31] nVMX: Documentation

2011-05-25 Thread Muli Ben-Yehuda
On Wed, May 25, 2011 at 06:33:30PM +0800, Tian, Kevin wrote: +Known limitations +- + +The current code supports running Linux guests under KVM guests. +Only 64-bit guest hypervisors are supported. + +Additional patches for running Windows under guest KVM, and Linux

Re: [PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection: static void enable_irq_window(struct kvm_vcpu *vcpu) { u32 cpu_based_vm_exec_control; + if (is_guest_mode(vcpu) nested_exit_on_intr(vcpu)) + /* We can get

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Ingo Molnar
* Paolo Bonzini pbonz...@redhat.com wrote: On 05/25/2011 12:17 PM, Ingo Molnar wrote: Also it's not clear why ((constructor)) was written in the way it was: why apparently no access is given to the array of init functions It is accessible---glibc uses it. and why it's not

RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El [mailto:n...@math.technion.ac.il] Sent: Wednesday, May 25, 2011 8:34 PM On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection: static void enable_irq_window(struct kvm_vcpu *vcpu) { u32

Re: [PATCH 20/31] nVMX: Exiting from L2 to L1

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 20/31] nVMX: Exiting from L2 to L1: How about SYSENTER and PERF_GLOBAL_CTRL MSRs? At least a TODO comment here make the whole load process complete. :-) Also isn't it more sane to update vmcs01's guest segment info based on vmcs12's

Re: [PATCH 18/31] nVMX: Implement VMLAUNCH and VMRESUME

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 18/31] nVMX: Implement VMLAUNCH and VMRESUME: + if (!saved_vmcs02) + return -ENOMEM; + we shouldn't return error after the guest mode is updated. Or else move enter_guest_mode to a later place... I moved things

Re: [PATCH 22/31] nVMX: Deciding if L0 or L1 should handle an L2 exit

2011-05-25 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 22/31] nVMX: Deciding if L0 or L1 should handle an L2 exit: +static inline bool nested_cpu_has_virtual_nmis(struct kvm_vcpu *vcpu) +{ + return is_guest_mode(vcpu) + (get_vmcs12(vcpu)-pin_based_vm_exec_control +

[PATCH 1/9] kvm tools: Add optional parameter used in ioport callbacks

2011-05-25 Thread Sasha Levin
Allow specifying an optional parameter when registering an ioport range. The callback functions provided by the registering module will be called with the same parameter. This may be used to keep context during callbacks on IO operations. Signed-off-by: Sasha Levin levinsasha...@gmail.com ---

[PATCH 2/9] kvm tools: Add basic ioport dynamic allocation

2011-05-25 Thread Sasha Levin
Add a very simple allocation of ioports. This prevents the need to coordinate ioports between different modules. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/include/kvm/ioport.h |5 + tools/kvm/ioport.c |7 +++ 2 files changed, 12 insertions(+),

[PATCH 3/9] kvm tools: Use ioport context to control blk devices

2011-05-25 Thread Sasha Levin
Since ioports now has the ability to pass context to its callbacks, we can implement multiple blk devices more efficiently. We can get a ptr to the 'current' blk dev on each ioport call, which means that we don't need to keep track of the blk device allocation and ioport distribution within the

[PATCH 6/9] kvm tools: Use dynamic IO port allocation in 9p driver

2011-05-25 Thread Sasha Levin
Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/virtio/9p.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index e307592..f8cb96d 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@

[PATCH 4/9] kvm tools: Add support for multiple virtio-rng devices

2011-05-25 Thread Sasha Levin
Since multiple hardware rng devices of the same type are currently unsupported by the kernel, this serves more as an example of a basic virtio driver under kvm tools and can be used to debug the PCI layer. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/include/kvm/ioport.h

[PATCH 7/9] kvm tools: Use dynamic IO port allocation in virtio-console driver

2011-05-25 Thread Sasha Levin
Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/virtio/console.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/kvm/virtio/console.c b/tools/kvm/virtio/console.c index a0b..eeb5dc9 100644 --- a/tools/kvm/virtio/console.c +++

[PATCH 8/9] kvm tools: Use dynamic IO port allocation in virtio-net driver

2011-05-25 Thread Sasha Levin
Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/virtio/net.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c index 649bc0f..765ae56d 100644 --- a/tools/kvm/virtio/net.c +++

[PATCH 9/9] kvm tools: Remove static ioport allocations

2011-05-25 Thread Sasha Levin
Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/include/kvm/ioport.h |9 - 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/tools/kvm/include/kvm/ioport.h b/tools/kvm/include/kvm/ioport.h index 709e18e..cc57cdd 100644 --- a/tools/kvm/include/kvm/ioport.h

[PATCH 5/9] kvm tools: Use dynamic IO port allocation in vesa driver

2011-05-25 Thread Sasha Levin
Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/hw/vesa.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/kvm/hw/vesa.c b/tools/kvm/hw/vesa.c index 6ab07ee..eb3ee65 100644 --- a/tools/kvm/hw/vesa.c +++ b/tools/kvm/hw/vesa.c @@ -49,7 +49,6 @@

Re: [PATCH 2/9] kvm tools: Add basic ioport dynamic allocation

2011-05-25 Thread Ingo Molnar
* Sasha Levin levinsasha...@gmail.com wrote: +u16 ioport__find_free_range(void) +{ + static u16 cur_loc; Please don't put statics inside function bodies! (even if they are only used within a single function) I had to look three times to discover that it's really a global variable.

Re: [PATCH 7/9] kvm tools: Use dynamic IO port allocation in virtio-console driver

2011-05-25 Thread Ingo Molnar
* Sasha Levin levinsasha...@gmail.com wrote: void virtio_console__init(struct kvm *kvm) { u8 dev, line, pin; + u16 console_base_addr; if (irq__register_device(VIRTIO_ID_CONSOLE, dev, pin, line) 0) return; virtio_console_pci_device.irq_pin

Re: [PATCH 9/9] kvm tools: Remove static ioport allocations

2011-05-25 Thread Ingo Molnar
* Sasha Levin levinsasha...@gmail.com wrote: Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/include/kvm/ioport.h |9 - 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/tools/kvm/include/kvm/ioport.h b/tools/kvm/include/kvm/ioport.h index

Re: [PATCH 7/9] kvm tools: Use dynamic IO port allocation in virtio-console driver

2011-05-25 Thread Sasha Levin
On Wed, 2011-05-25 at 16:42 +0200, Ingo Molnar wrote: * Sasha Levin levinsasha...@gmail.com wrote: void virtio_console__init(struct kvm *kvm) { u8 dev, line, pin; + u16 console_base_addr; if (irq__register_device(VIRTIO_ID_CONSOLE, dev, pin, line) 0)

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-25 Thread Paolo Bonzini
On 05/25/2011 02:53 PM, Ingo Molnar wrote: Obviously the compiler did not provide this feature into a vacuum, it expected the C library to execute constructors, right? So the above dodges my question of why there is no method (in glibc) to turn auto-execution off and let the app do it. Well,

[PATCH 4/4] treewide: Remove asmlinkage from printk

2011-05-25 Thread Joe Perches
Remove the now unnecessary asmlinkage attribute from the various printk prototypes and uses. Signed-off-by: Joe Perches j...@perches.com --- arch/arm/kernel/early_printk.c |2 +- arch/ia64/kvm/vmm.c|2 +- arch/x86/kernel/early_printk.c |2 +- include/linux/printk.h

[PATCH 0/4] printk: cleanups of direct includes

2011-05-25 Thread Joe Perches
printk.h is a subfile of kernel.h, do not allow it to be included directly. Joe Perches (4): treewide: Remove direct includes of printk.h staging: Remove direct includes of printk.h printk: Don't allow direct inclusion treewide: Remove asmlinkage from printk

KVM: x86: use proper port value when checking io instruction permission (v2)

2011-05-25 Thread Marcelo Tosatti
Commit fa4491a6b667304 moved the permission check for io instructions to the -check_perm callback. It failed to copy the port value from RDX register for string and in,out ax,dx instructions. Fix it by reading RDX register at decode stage when appropriate. Fixes FC8.32 installation.

Re: [Qemu-devel] [PATCH v4 1/4] rbd: use the higher level librbd instead of just librados

2011-05-25 Thread Christian Brunner
Apart from two cosmetic issues (see below), I think this patch is ready to replace the old rbd driver. You can add: Reviewed-by: Christian Brunner c...@muc.de Regards Christian 2011/5/24 Josh Durgin josh.dur...@dreamhost.com: librbd stacks on top of librados to provide access to rbd images.

Re: [Qemu-devel] [PATCH v4 2/4] rbd: allow configuration of rados from the rbd filename

2011-05-25 Thread Christian Brunner
Looks good to me: Reviewed-by: Christian Brunner c...@muc.de 2011/5/24 Josh Durgin josh.dur...@dreamhost.com: The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]] Each option is used to configure rados, and may be any Ceph option, or conf. The conf option

Re: [Qemu-devel] [PATCH v4 3/4] rbd: check return values when scheduling aio

2011-05-25 Thread Christian Brunner
We should not leave this out: Reviewed-by: Christian Brunner c...@muc.de 2011/5/24 Josh Durgin josh.dur...@dreamhost.com: If scheduling fails, the number of outstanding I/Os must be correct, or there will be a hang when waiting for everything to be flushed. Reported-by: Stefan Hajnoczi

Re: [Qemu-devel] [PATCH v4 4/4] rbd: Add bdrv_truncate implementation

2011-05-25 Thread Christian Brunner
Looks good to me: Reviewed-by: Christian Brunner c...@muc.de 2011/5/24 Josh Durgin josh.dur...@dreamhost.com: Signed-off-by: Josh Durgin josh.dur...@dreamhost.com ---  block/rbd.c |   15 +++  1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/block/rbd.c

[PATCH 0/31] nVMX: Nested VMX, v11

2011-05-25 Thread Nadav Har'El
Hi, This is the eleventh iteration of the nested VMX patch set, and hopefully the last in this format. Improvements in this version over the previous one include: * Overhauled vmcs, cpu, and launched handling (new loaded_vmcs structure and per-cpu linked-list replacing old vcpu

[PATCH 01/31] nVMX: Keep list of loaded VMCSs, instead of vcpus.

2011-05-25 Thread Nadav Har'El
In VMX, before we bring down a CPU we must VMCLEAR all VMCSs loaded on it because (at least in theory) the processor might not have written all of its content back to memory. Since a patch from June 26, 2008, this is done using a per-cpu vcpus_on_cpu linked list of vcpus loaded on each CPU. The

[PATCH 02/31] nVMX: Add nested module option to kvm_intel

2011-05-25 Thread Nadav Har'El
This patch adds to kvm_intel a module option nested. This option 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

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

2011-05-25 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/31] nVMX: Allow setting the VMXE bit in CR4

2011-05-25 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/31] nVMX: Introduce vmcs12: a VMCS structure for L1

2011-05-25 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/31] nVMX: Implement reading and writing of VMX MSRs

2011-05-25 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/include/asm/msr-index.h | 12 +

[PATCH 08/31] nVMX: Introduce vmcs02: VMCS used to run L2

2011-05-25 Thread Nadav Har'El
We saw in a previous patch that L1 controls its L2 guest with a vcms12. L0 needs to create a real VMCS for running L2. We call that vmcs02. A later patch will contain the code, prepare_vmcs02(), for filling the vmcs02 fields. This patch only contains code for allocating vmcs02. In this version,

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

2011-05-25 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 | 53 +++ arch/x86/kvm/x86.c |3 +- arch/x86/kvm/x86.h |

[PATCH 09/31] nVMX: Add VMCS fields to the vmcs12

2011-05-25 Thread Nadav Har'El
In this patch we add to vmcs12 (the VMCS that L1 keeps for L2) all the standard VMCS fields. Later patches will enable L1 to read and write these fields using VMREAD/ VMWRITE, and they will be used during a VMLAUNCH/VMRESUME in preparing vmcs02, a hardware VMCS for running L2. Signed-off-by:

[PATCH 10/31] nVMX: Success/failure of VMX instructions.

2011-05-25 Thread Nadav Har'El
VMX instructions specify success or failure by setting certain RFLAGS bits. This patch contains common functions to do this, and they will be used in the following patches which emulate the various VMX instructions. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/include/asm/vmx.h |

[PATCH 11/31] nVMX: Implement VMCLEAR

2011-05-25 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 | 65 ++- arch/x86/kvm/x86.c |1 2 files changed, 65 insertions(+), 1 deletion(-) --- .before/arch/x86/kvm/x86.c 2011-05-25

[PATCH 12/31] nVMX: Implement VMPTRLD

2011-05-25 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 | 62 ++- 1 file changed, 61 insertions(+), 1 deletion(-) --- .before/arch/x86/kvm/vmx.c 2011-05-25 22:40:57.0 +0300 +++

Re: [Autotest] [PATCH 2/2] KVM-test: kvm_vm.py: Add quotation marks for appended arguments

2011-05-25 Thread Lucas Meneghel Rodrigues
On Tue, May 24, 2011 at 11:24 PM, Amos Kong ak...@redhat.com wrote: Appended kernel cmdline should be involved by quotation marks. -append 'root=/dev/vda ro ..' Applied, thanks! Reported-by: Cong Wang amw...@redhat.com Signed-off-by: Amos Kong ak...@redhat.com ---  client/virt/kvm_vm.py |  

[PATCH 13/31] nVMX: Implement VMPTRST

2011-05-25 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 | 28 +++- arch/x86/kvm/x86.c |3 ++- arch/x86/kvm/x86.h |4 3 files changed, 33 insertions(+), 2 deletions(-) --- .before/arch/x86/kvm/x86.c

[PATCH 14/31] nVMX: Implement VMREAD and VMWRITE

2011-05-25 Thread Nadav Har'El
Implement the VMREAD and VMWRITE instructions. With these instructions, L1 can read and write to the VMCS it is holding. The values are read or written to the fields of the vmcs12 structure introduced in a previous patch. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 193

[PATCH 15/31] nVMX: Move host-state field setup to a function

2011-05-25 Thread Nadav Har'El
Move the setting of constant host-state fields (fields that do not change throughout the life of the guest) from vmx_vcpu_setup to a new common function vmx_set_constant_host_state(). This function will also be used to set the host state when running L2 guests. Signed-off-by: Nadav Har'El

[PATCH 16/31] nVMX: Move control field setup to functions

2011-05-25 Thread Nadav Har'El
Move some of the control field setup to common functions. These functions will also be needed for running L2 guests - L0's desires (expressed in these functions) will be appropriately merged with L1's desires. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 80

[PATCH 17/31] nVMX: Prepare vmcs02 from vmcs01 and vmcs12

2011-05-25 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 (our desires for our own guests). Signed-off-by: Nadav Har'El n...@il.ibm.com ---

[PATCH 18/31] nVMX: Implement VMLAUNCH and VMRESUME

2011-05-25 Thread Nadav Har'El
Implement the VMLAUNCH and VMRESUME instructions, allowing a guest hypervisor to run its own guests. This patch does not include some of the necessary validity checks on vmcs12 fields before the entry. These will appear in a separate patch below. Signed-off-by: Nadav Har'El n...@il.ibm.com ---

[PATCH 19/31] nVMX: No need for handle_vmx_insn function any more

2011-05-25 Thread Nadav Har'El
Before nested VMX support, the exit handler for a guest executing a VMX instruction (vmclear, vmlaunch, vmptrld, vmptrst, vmread, vmread, vmresume, vmwrite, vmon, vmoff), was handle_vmx_insn(). This handler simply threw a #UD exception. Now that all these exit reasons are properly handled (and

[PATCH 20/31] nVMX: Exiting from L2 to L1

2011-05-25 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/31] nVMX: vmcs12 checks on nested entry

2011-05-25 Thread Nadav Har'El
This patch adds a bunch of tests of the validity of the vmcs12 fields, according to what the VMX spec and our implementation allows. If fields we cannot (or don't want to) honor are discovered, an entry failure is emulated. According to the spec, there are two types of entry failures: If the

[PATCH 22/31] nVMX: Deciding if L0 or L1 should handle an L2 exit

2011-05-25 Thread Nadav Har'El
This patch contains the logic of whether an L2 exit should be handled by L0 and then L2 should be resumed, or whether L1 should be run to handle this exit (using the nested_vmx_vmexit() function of the previous patch). The basic idea is to let L1 handle the exit only if it actually asked to trap

[PATCH 23/31] nVMX: Correct handling of interrupt injection

2011-05-25 Thread Nadav Har'El
The code in this patch correctly emulates external-interrupt injection while a nested guest L2 is running. Because of this code's relative un-obviousness, I include here a longer-than- usual justification for what it does - much longer than the code itself ;-) To understand how to correctly

[PATCH 24/31] nVMX: Correct handling of exception injection

2011-05-25 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 2011-05-25

[PATCH 25/31] nVMX: Correct handling of idt vectoring info

2011-05-25 Thread Nadav Har'El
This patch adds correct handling of IDT_VECTORING_INFO_FIELD for the nested case. When a guest exits while delivering 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 26/31] nVMX: Handling of CR0 and CR4 modifying instructions

2011-05-25 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 27/31] nVMX: Further fixes for lazy FPU loading

2011-05-25 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 28/31] nVMX: Additional TSC-offset handling

2011-05-25 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()). Additionally, we also need to modify

[PATCH 29/31] nVMX: Add VMX to list of supported cpuid features

2011-05-25 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 30/31] nVMX: Miscellenous small corrections

2011-05-25 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 2011-05-25 22:41:14.0 +0300 +++

[PATCH 31/31] nVMX: Documentation

2011-05-25 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 | 251

[PATCH v5 0/4] rbd improvements

2011-05-25 Thread Josh Durgin
This patchset moves the complexity of the rbd format into librbd and adds truncation support. Changes since v4: * fixed cosmetic issues pointed out by Christian Brunner Changes since v3: * trivially rebased * updated copyright header Changes since v2: * return values are checked in

[PATCH v5 1/4] rbd: use the higher level librbd instead of just librados

2011-05-25 Thread Josh Durgin
librbd stacks on top of librados to provide access to rbd images. Using librbd simplifies the qemu code, and allows qemu to use new versions of the rbd format with few (if any) changes. Signed-off-by: Josh Durgin josh.dur...@dreamhost.com Signed-off-by: Yehuda Sadeh yeh...@hq.newdream.net ---

[PATCH v5 3/4] rbd: check return values when scheduling aio

2011-05-25 Thread Josh Durgin
If scheduling fails, the number of outstanding I/Os must be correct, or there will be a hang when waiting for everything to be flushed. Reported-by: Stefan Hajnoczi stefa...@gmail.com Signed-off-by: Josh Durgin josh.dur...@dreamhost.com --- block/rbd.c | 24 1 files

[PATCH v5 2/4] rbd: allow configuration of rados from the rbd filename

2011-05-25 Thread Josh Durgin
The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]] Each option is used to configure rados, and may be any Ceph option, or conf. The conf option specifies a Ceph configuration file to read. This allows rbd volumes from more than one Ceph cluster to be used by

[PATCH v5 4/4] rbd: Add bdrv_truncate implementation

2011-05-25 Thread Josh Durgin
Signed-off-by: Josh Durgin josh.dur...@dreamhost.com --- block/rbd.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index a44d160..b95b1eb 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -688,6 +688,20 @@ static int64_t

Re: [Qemu-devel] [PATCH v4 1/4] rbd: use the higher level librbd instead of just librados

2011-05-25 Thread Josh Durgin
On 05/25/2011 12:18 PM, Christian Brunner wrote: Apart from two cosmetic issues (see below), I think this patch is ready to replace the old rbd driver. You can add: Reviewed-by: Christian Brunnerc...@muc.de Regards Christian Thanks, I fixed these in v5. Josh 2011/5/24 Josh

Re: FreeBSD startup timer hangs on boot

2011-05-25 Thread Nikita A Menkovich
Problem solved by upgrading to 2.6.39 kernel from 2.6.38, at another server I use 2.6.38 kernel, but there is no such problem Seems some problem between newer versions of qemu-kvm and kvm kernel version and also result of fixing KVM: fix kvmclock regression due to missing clock update On 24 May

Re: [PATCH V5 2/6 net-next] netdevice.h: Add zero-copy flag in netdevice

2011-05-25 Thread Shirley Ma
On Fri, 2011-05-20 at 02:41 +0300, Michael S. Tsirkin wrote: So the requirements are - data must be released in a timely fashion (e.g. unlike virtio-net tun or bridge) The current patch doesn't enable tun zero-copy. tun will copy data It's not an issue now. We can disallow macvtap attach to

RE: [PATCH 20/31] nVMX: Exiting from L2 to L1

2011-05-25 Thread Tian, Kevin
From: Nadav Har'El Sent: Wednesday, May 25, 2011 9:21 PM On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 20/31] nVMX: Exiting from L2 to L1: How about SYSENTER and PERF_GLOBAL_CTRL MSRs? At least a TODO comment here make the whole load process complete. :-) Also isn't it

  1   2   >