Re: [PATCH v2 1/3] KVM: nVMX: Don't advertise single context invalidation for invept

2014-04-11 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: On 2014-04-11 02:27, Bandan Das wrote: Marcelo Tosatti mtosa...@redhat.com writes: On Mon, Mar 31, 2014 at 05:00:23PM -0400, Bandan Das wrote: For single context invalidation, we fall through to global invalidation in handle_invept() except for one

Re: [PATCH v2 1/3] KVM: nVMX: Don't advertise single context invalidation for invept

2014-04-11 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: On 2014-04-11 19:26, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: On 2014-04-11 02:27, Bandan Das wrote: Marcelo Tosatti mtosa...@redhat.com writes: On Mon, Mar 31, 2014 at 05:00:23PM -0400, Bandan Das wrote: For single context

Re: [PATCH v2 2/3] KVM: nVMX: Ack and write vector info to intr_info if L1 asks us to

2014-04-11 Thread Bandan Das
Marcelo Tosatti mtosa...@redhat.com writes: On Mon, Mar 31, 2014 at 05:00:24PM -0400, Bandan Das wrote: This feature emulates the Acknowledge interrupt on exit behavior. We can safely emulate it for L1 to run L2 even if L0 itself has it disabled (to run L1). Signed-off-by: Bandan Das b

Re: [PATCH v2 1/3] KVM: nVMX: Don't advertise single context invalidation for invept

2014-04-11 Thread Bandan Das
Marcelo Tosatti mtosa...@redhat.com writes: On Fri, Apr 11, 2014 at 08:22:13AM +0200, Jan Kiszka wrote: On 2014-04-11 02:27, Bandan Das wrote: Marcelo Tosatti mtosa...@redhat.com writes: On Mon, Mar 31, 2014 at 05:00:23PM -0400, Bandan Das wrote: For single context invalidation, we

Re: [PATCH v2 1/3] KVM: nVMX: Don't advertise single context invalidation for invept

2014-04-11 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: On 2014-04-11 20:35, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: On 2014-04-11 19:26, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: On 2014-04-11 02:27, Bandan Das wrote: Marcelo Tosatti mtosa...@redhat.com writes

[RFC PATCH v2 3/6] KVM: emulate: cleanup decode_rm

2014-04-10 Thread Bandan Das
Remove the if conditional - that will help us avoid an else initialize to 0 Also, rearrange operators for slightly better code. Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/emulate.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm

[RFC PATCH v2 6/6] KVM: emulate: remove memopp and rip_relative

2014-04-10 Thread Bandan Das
Move typecast on out of range value of mem.ea to decode_modrm. rip_relative is only set in decode_modrm, change it to a local var Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 2 -- arch/x86/kvm/emulate.c | 18 +++--- 2 files changed

[RFC PATCH v2 5/6] KVM: emulate: rework seg_override

2014-04-10 Thread Bandan Das
x86_decode_insn already sets a default for seg_override, so remove it from the zeroed area. Also replace set/get functions with direct access to the field. Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 3 +-- arch/x86/kvm/emulate.c | 41

[RFC PATCH v2 4/6] KVM: emulate: clean up initializations in init_decode_cache

2014-04-10 Thread Bandan Das
A lot of initializations are unnecessary as they get set to appropriate values before actually being used. Optimize placement of fields in x86_emulate_ctxt Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 20 +++- arch/x86/kvm/emulate.c

[RFC PATCH v2 0/6] Emulator speedups - avoid initializations where possible

2014-04-10 Thread Bandan Das
- 4/6 - remove else conditions from v1 and misc cleanups - 5/6 - new patch, remove seg_override and related fields and functions - 6/6 - new patch, remove memopp and move rip_relative to a local variable in decode_modrm Bandan Das (6): KVM: emulate: move init_decode_cache to emulate.c

[RFC PATCH v2 1/6] KVM: emulate: move init_decode_cache to emulate.c

2014-04-10 Thread Bandan Das
Core emulator functions all belong in emulator.c, x86 should have no knowledge of emulator internals Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 1 + arch/x86/kvm/emulate.c | 13 + arch/x86/kvm/x86.c | 13

[RFC PATCH v2 2/6] KVM: emulate: Remove ctxt-intercept and ctxt-check_perm checks

2014-04-10 Thread Bandan Das
The same information can be gleaned from ctxt-d and avoids having to zero/NULL initialize intercept and check_perm Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/emulate.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86

Re: [PATCH v2 1/3] KVM: nVMX: Don't advertise single context invalidation for invept

2014-04-10 Thread Bandan Das
Marcelo Tosatti mtosa...@redhat.com writes: On Mon, Mar 31, 2014 at 05:00:23PM -0400, Bandan Das wrote: For single context invalidation, we fall through to global invalidation in handle_invept() except for one case - when the operand supplied by L1 is different from what we have in vmcs12

[RFC PATCH 1/2] KVM: emulate: move init_decode_cache to emulate.c

2014-04-03 Thread Bandan Das
Core emulator functions all belong in emulator.c, x86 should have no knowledge of emulator internals Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 1 + arch/x86/kvm/emulate.c | 13 + arch/x86/kvm/x86.c | 13

[RFC PATCH 2/2] KVM: emulate: clean up initializations in init_decode_cache

2014-04-03 Thread Bandan Das
A lot of initializations are unnecessary as they get set to appropriate values before actually being used. Remove some of them and rework some others if the conditions that set them are not true Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 16

[RFC PATCH 0/2] Emulator speedups - avoid initializations where possible

2014-04-03 Thread Bandan Das
/emulated memory RMW instruction After: 639 cycles/emulated jump instruction 786 cycles/emulated move instruction 802 cycles/emulated arithmetic instruction 936 cycles/emulated memory load instruction 970 cycles/emulated memory store instruction 1000 cycles/emulated memory RMW instruction Bandan Das (2

[PATCH v2 0/3] nVMX: Fixes to run Xen as L1

2014-03-31 Thread Bandan Das
KVM: nVMX: Advertise support for interrupt acknowledgement and nVMX: Ack and write vector info to intr_info if L1 asks us to * Add commit description to 2/3 and change comment for nested_exit_intr_ack_set Jan, I will send a separate unit-test patch Bandan Das (3): KVM: nVMX: Don't advertise

[PATCH v2 1/3] KVM: nVMX: Don't advertise single context invalidation for invept

2014-03-31 Thread Bandan Das
be true. Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/vmx.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3927528..3e7f60c 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2331,12

[PATCH v2 2/3] KVM: nVMX: Ack and write vector info to intr_info if L1 asks us to

2014-03-31 Thread Bandan Das
This feature emulates the Acknowledge interrupt on exit behavior. We can safely emulate it for L1 to run L2 even if L0 itself has it disabled (to run L1). Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/irq.c | 1 + arch/x86/kvm/vmx.c | 19 +++ 2 files changed, 20

[PATCH v2 3/3] KVM: nVMX: Advertise support for interrupt acknowledgement

2014-03-31 Thread Bandan Das
Some Type 1 hypervisors such as XEN won't enable VMX without it present Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e864b7a..a2a03c5 100644 --- a/arch/x86/kvm

Re: [PATCH 3/3] KVM: nVMX: check for null vmcs12 when L1 does invept

2014-03-27 Thread Bandan Das
Jan Kiszka jan.kis...@web.de writes: On 2014-03-26 21:22, Bandan Das wrote: Jan Kiszka jan.kis...@web.de writes: On 2014-03-22 17:43, Bandan Das wrote: Jan Kiszka jan.kis...@web.de writes: On 2014-03-20 21:58, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: On 2014-03-20 04

Re: [PATCH 3/3] KVM: nVMX: check for null vmcs12 when L1 does invept

2014-03-26 Thread Bandan Das
Jan Kiszka jan.kis...@web.de writes: On 2014-03-22 17:43, Bandan Das wrote: Jan Kiszka jan.kis...@web.de writes: On 2014-03-20 21:58, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: On 2014-03-20 04:28, Bandan Das wrote: Some L1 hypervisors such as Xen seem to be calling

Re: [PATCH 3/3] KVM: nVMX: check for null vmcs12 when L1 does invept

2014-03-22 Thread Bandan Das
Jan Kiszka jan.kis...@web.de writes: On 2014-03-20 21:58, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: On 2014-03-20 04:28, Bandan Das wrote: Some L1 hypervisors such as Xen seem to be calling invept after vmclear or before vmptrld on L2. In this case, proceed with falling

Re: [PATCH 1/3] KVM: nVMX: Advertise support for interrupt acknowledgement

2014-03-20 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: On 2014-03-20 04:28, Bandan Das wrote: Some Type 1 hypervisors such as XEN won't enable VMX without it present Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 2/3] KVM: nVMX: Ack and write vector info to intr_info if L1 asks us to

2014-03-20 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: Commit description is missing. On 2014-03-20 04:28, Bandan Das wrote: Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/irq.c | 1 + arch/x86/kvm/vmx.c | 17 + 2 files changed, 18 insertions(+) diff --git a/arch/x86

Re: [PATCH 3/3] KVM: nVMX: check for null vmcs12 when L1 does invept

2014-03-20 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: On 2014-03-20 04:28, Bandan Das wrote: Some L1 hypervisors such as Xen seem to be calling invept after vmclear or before vmptrld on L2. In this case, proceed with falling through and syncing roots as a case where context wide invalidation can't

Re: [PATCH 3/3] KVM: nVMX: check for null vmcs12 when L1 does invept

2014-03-20 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: Il 20/03/2014 04:28, Bandan Das ha scritto: Some L1 hypervisors such as Xen seem to be calling invept after vmclear or before vmptrld on L2. In this case, proceed with falling through and syncing roots as a case where context wide invalidation can't

[PATCH 1/3] KVM: nVMX: Advertise support for interrupt acknowledgement

2014-03-19 Thread Bandan Das
Some Type 1 hypervisors such as XEN won't enable VMX without it present Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3927528..26c1d38 100644 --- a/arch/x86/kvm

[PATCH 2/3] KVM: nVMX: Ack and write vector info to intr_info if L1 asks us to

2014-03-19 Thread Bandan Das
Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/irq.c | 1 + arch/x86/kvm/vmx.c | 17 + 2 files changed, 18 insertions(+) diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c index 484bc87..bd0da43 100644 --- a/arch/x86/kvm/irq.c +++ b/arch/x86/kvm/irq.c @@ -113,6

[PATCH 0/3] nVMX: Fixes to run Xen as L1

2014-03-19 Thread Bandan Das
Minor changes to enable Xen as a L1 hypervisor. Tested with a Haswell host, Xen-4.3 L1 and debian6 L2 Bandan Das (3): KVM: nVMX: Advertise support for interrupt acknowledgement KVM: nVMX: Ack and write vector info to intr_info if L1 asks us to KVM: nVMX: check for null vmcs12 when L1 does

[PATCH 3/3] KVM: nVMX: check for null vmcs12 when L1 does invept

2014-03-19 Thread Bandan Das
Some L1 hypervisors such as Xen seem to be calling invept after vmclear or before vmptrld on L2. In this case, proceed with falling through and syncing roots as a case where context wide invalidation can't be supported Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/kvm/vmx.c | 5 +++-- 1

[PATCH] vfio: Set PCI_DEV_FLAGS_ASSIGNED when assigning device to guest

2014-01-30 Thread Bandan Das
Some drivers such as ixgbe rely on pci_vfs_assigned() to prevent disabling sr-iov when vfs are still assigned during hotplug event or module removal. Set and unset PCI_DEV_FLAGS_ASSIGNED appropriately Signed-off-by: Bandan Das b...@redhat.com --- drivers/vfio/pci/vfio_pci.c | 2 ++ 1 file

Re: [PATCH] vfio: Set PCI_DEV_FLAGS_ASSIGNED when assigning device to guest

2014-01-30 Thread Bandan Das
Alex Williamson alex.william...@redhat.com writes: [cc +linux-pci] On Thu, 2014-01-30 at 10:33 -0700, Alex Williamson wrote: On Thu, 2014-01-30 at 22:54 +0530, Bandan Das wrote: Some drivers such as ixgbe rely on pci_vfs_assigned() to prevent disabling sr-iov when vfs are still assigned

Re: [PATCH] vfio: Set PCI_DEV_FLAGS_ASSIGNED when assigning device to guest

2014-01-30 Thread Bandan Das
Alex Williamson alex.william...@redhat.com writes: On Thu, 2014-01-30 at 23:36 +0530, Bandan Das wrote: Alex Williamson alex.william...@redhat.com writes: [cc +linux-pci] On Thu, 2014-01-30 at 10:33 -0700, Alex Williamson wrote: On Thu, 2014-01-30 at 22:54 +0530, Bandan Das wrote

Re: Elvis upstreaming plan

2013-11-26 Thread Bandan Das
Razya Ladelsky ra...@il.ibm.com writes: Hi all, I am Razya Ladelsky, I work at IBM Haifa virtualization team, which developed Elvis, presented by Abel Gordon at the last KVM forum: ELVIS video: https://www.youtube.com/watch?v=9EyweibHfEs ELVIS slides:

[RFC PATCH v2 0/1] Workqueue based vhost work scheduling

2013-10-13 Thread Bandan Das
9994.11 I had already discussed my results with Michael privately, so sorry for the duplicate information, Michael! [1] http://www.mail-archive.com/kvm@vger.kernel.org/msg69868.html [2] Documentation/workqueue.txt Bandan Das (1): Workqueue based vhost workers drivers/vhost

[RFC PATCH v2 1/1] Workqueue based vhost workers

2013-10-13 Thread Bandan Das
Signed-off-by: Bandan Das b...@makefile.in --- drivers/vhost/net.c | 25 +++ drivers/vhost/vhost.c | 115 +++--- drivers/vhost/vhost.h | 6 +++ 3 files changed, 130 insertions(+), 16 deletions(-) diff --git a/drivers/vhost/net.c b/drivers

Re: [PATCH v2] kvm-unit-tests : Basic architecture of VMX nested test case

2013-07-25 Thread Bandan Das
Arthur Chunqi Li yzt...@gmail.com writes: This is the first version of VMX nested environment. It contains the basic VMX instructions test cases, including VMXON/VMXOFF/VMXPTRLD/ VMXPTRST/VMCLEAR/VMLAUNCH/VMRESUME/VMCALL. This patchalso tests the basic execution routine in VMX nested

Re: IA32_FEATURE_CONTROL MSR in nested virt

2013-07-03 Thread Bandan Das
Gleb Natapov g...@redhat.com writes: On Wed, Jul 03, 2013 at 04:24:33PM +0800, Arthur Chunqi Li wrote: Hi Gleb and Paolo, When I write test cases for nested virt and found that reading/writing IA32_FEATURE_CONTROL will be simply ignored or return 0 (in arch/x86/kvm/vmx.c) in VM. Checking

[PATCH v3 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO

2013-06-21 Thread Bandan Das
- Sandra and vTune. v3: Some more minor corrections v2: Addressed suggested changes Bandan Das (2): kvm: make vendor_intel a generic function kvm: x86: emulate MSR_PLATFORM_INFO arch/x86/include/asm/kvm_emulate.h| 13 -- arch/x86/include/asm/kvm_host.h | 20 +++ arch

[PATCH v3 2/2] kvm: x86: emulate MSR_PLATFORM_INFO

2013-06-21 Thread Bandan Das
Prog TDC-TDP Limit for Turbo (29) - 0 Signed-off-by: Bandan Das b...@redhat.com --- v3: Change bclk to base_clock_khz v2: Change function name to kvm_cpuid_get_intel_model and call the new vendor_intel() arch/x86/include/uapi/asm/msr-index.h | 2 ++ arch/x86/kvm/cpuid.c | 19

[PATCH v3 1/2] kvm: make vendor_intel a generic function

2013-06-21 Thread Bandan Das
Make vendor_intel generic so that functions in x86.c can use it. Signed-off-by: Bandan Das b...@redhat.com --- v2: Change vendor_intel function signature because the emulator shouldn't be dealing with struct vcpu arch/x86/include/asm/kvm_emulate.h | 13 - arch/x86/include/asm

Re: [PATCH v2 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO

2013-06-19 Thread Bandan Das
Gleb Natapov g...@redhat.com writes: On Tue, Jun 18, 2013 at 11:29:27AM -0400, Bandan Das wrote: Gleb Natapov g...@redhat.com writes: On Tue, Jun 18, 2013 at 04:05:08PM +0200, Paolo Bonzini wrote: Il 05/06/2013 10:42, Gleb Natapov ha scritto: These patches add an emulated

Re: [PATCH v2 2/2] kvm: x86: emulate MSR_PLATFORM_INFO

2013-06-18 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: Il 04/06/2013 18:02, Bandan Das ha scritto: +static u64 kvm_get_platform_info(struct kvm_vcpu *vcpu) +{ +u8 cpumodel; +u32 bclk; + +/* + * Programmable Ratio Limit for Turbo Mode (bit 28): 0 + * Programmable TDC-TDP Limit

Re: [PATCH v2 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO

2013-06-18 Thread Bandan Das
Gleb Natapov g...@redhat.com writes: On Tue, Jun 18, 2013 at 04:05:08PM +0200, Paolo Bonzini wrote: Il 05/06/2013 10:42, Gleb Natapov ha scritto: These patches add an emulated MSR_PLATFORM_INFO that kvm guests can read as described in section 14.3.2.4 of the Intel SDM. The relevant

[PATCH v2 2/2] kvm: x86: emulate MSR_PLATFORM_INFO

2013-06-04 Thread Bandan Das
Prog TDC-TDP Limit for Turbo (29) - 0 v2: Change function name to kvm_cpuid_get_intel_model and call the new vendor_intel() Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/uapi/asm/msr-index.h | 2 ++ arch/x86/kvm/cpuid.c | 19 ++ arch/x86/kvm/cpuid.h

[PATCH v2 1/2] kvm: make vendor_intel a generic function

2013-06-04 Thread Bandan Das
Make vendor_intel generic so that functions in x86.c can use it. v2: Change vendor_intel function signature because the emulator shouldn't be dealing with struct vcpu Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 13 - arch/x86/include/asm

[PATCH v2 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO

2013-06-04 Thread Bandan Das
- Sandra and vTune. v2: Addressed suggested changes Bandan Das (2): kvm: make vendor_intel a generic function kvm: x86: emulate MSR_PLATFORM_INFO arch/x86/include/asm/kvm_emulate.h| 13 -- arch/x86/include/asm/kvm_host.h | 20 +++ arch/x86/include/uapi/asm/msr-index.h

Re: [PATCH 1/2] kvm: make vendor_intel a generic function

2013-06-04 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: Il 30/05/2013 08:07, Gleb Natapov ha scritto: Unfortunately, this is not acceptable. The emulator is not supposed to know about the vcpu. Everything has to go through the context; in principle, the emulator should be usable outside of KVM. I

[PATCH 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO

2013-05-29 Thread Bandan Das
- Sandra and vTune. Bandan Das (2): kvm: make vendor_intel a generic function kvm: x86: emulate MSR_PLATFORM_INFO arch/x86/include/asm/kvm_emulate.h| 13 - arch/x86/include/asm/kvm_host.h | 28 +++ arch/x86/include/uapi/asm/msr-index.h | 2 ++ arch/x86/kvm/cpuid.c

[PATCH 1/2] kvm: make vendor_intel a generic function

2013-05-29 Thread Bandan Das
Make vendor_intel generic so that functions in x86.c can use it. Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 13 - arch/x86/include/asm/kvm_host.h| 28 arch/x86/kvm/emulate.c | 15

[PATCH 2/2] kvm: x86: emulate MSR_PLATFORM_INFO

2013-05-29 Thread Bandan Das
Prog TDC-TDP Limit for Turbo (29) - 0 Signed-off-by: Bandan Das b...@redhat.com --- arch/x86/include/uapi/asm/msr-index.h | 2 ++ arch/x86/kvm/cpuid.c | 18 + arch/x86/kvm/cpuid.h | 16 arch/x86/kvm/x86.c| 48

Re: [PATCH 0/3] Nested TSC handling

2011-08-02 Thread Bandan Das
On 0, Nadav Har'El n...@il.ibm.com wrote: The following are patches I propose for fixing the bug discovered by Bandan Das and discussed in the Nested VMX - L1 hangs on running L2 thread. The first patch should fix the originally-reported bug, as explained in the aforementioned thread: A new

Nested VMX - L1 hangs on running L2

2011-07-08 Thread Bandan Das
I have already discussed this a bit with Nadav but hoping someone else has any other ideas/clues/suggestions/comments. With recent versions of the kernel (The last I tried is 3.0-rc5 with nVMX patches already merged), my L1 guest always hangs when I start L2. My setup : The host, L1 and L2

<    1   2   3