Re: [PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-11 Thread Sheng Yang
On Wednesday 12 May 2010 03:36:26 Marcelo Tosatti wrote: > On Tue, May 11, 2010 at 01:30:07PM +0800, Sheng Yang wrote: > > Only modifying some bits of CR0/CR4 needs paging mode switch. > > > > Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved > >

[PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-11 Thread Sheng Yang
Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 17 ++--- arch/x86/kvm/x86.c

[PATCH 1/4] KVM: x86: Check LMA bit before set_efer

2010-05-11 Thread Sheng Yang
kvm_x86_ops->set_efer() would execute vcpu->arch.efer = efer, so the checking of LMA bit didn't work. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cd8a6

[PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-11 Thread Sheng Yang
Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 17 ++--- arch/x86/kvm/x86.c

[PATCH 3/4] KVM: x86: Remove kvm_mmu_reset_context() in kvm_set_efer()

2010-05-11 Thread Sheng Yang
Modify EFER won't result in mode switch directly. After EFER.LME set, the following set CR0.PG would result in mode switch to IA32e. And the later action already covered by kvm_set_cr0(). Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |1 - 1 files changed, 0 insertions(+), 1 dele

[PATCH 2/4] KVM: Clean up duplicate assignment

2010-05-11 Thread Sheng Yang
mmu.free() already set root_hpa to INVALID_PAGE, no need to do it again in the destory_kvm_mmu(). kvm_x86_ops->set_cr4() and set_efer() already assign cr4/efer to vcpu->arch.cr4/efer, no need to do it again later. Signed-off-by: Sheng Yang --- arch/x86/kvm/mmu.c |5 ++--- arch/x86/k

Re: [PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Sheng Yang
On Wednesday 12 May 2010 14:59:14 Avi Kivity wrote: > On 05/12/2010 09:33 AM, Sheng Yang wrote: > > Only modifying some bits of CR0/CR4 needs paging mode switch. > > > > Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved > > bits. > > >

[PATCH][v2 0/3] Some MMU related fix/clean up

2010-05-12 Thread Sheng Yang
Sheng Yang (3): KVM: x86: Check LMA bit before set_efer KVM: Clean up duplicate assignment VMX: x86: Only reset MMU when necessary arch/x86/kvm/mmu.c |5 ++--- arch/x86/kvm/x86.c | 22 -- 2 files changed, 18 insertions(+), 9 deletions(-) -- To unsubscribe from

[PATCH][v2 1/3] KVM: x86: Check LMA bit before set_efer

2010-05-12 Thread Sheng Yang
kvm_x86_ops->set_efer() would execute vcpu->arch.efer = efer, so the checking of LMA bit didn't work. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cd8a6

[PATCH][v2 2/3] KVM: Clean up duplicate assignment

2010-05-12 Thread Sheng Yang
mmu.free() already set root_hpa to INVALID_PAGE, no need to do it again in the destory_kvm_mmu(). kvm_x86_ops->set_cr4() and set_efer() already assign cr4/efer to vcpu->arch.cr4/efer, no need to do it again later. Signed-off-by: Sheng Yang --- arch/x86/kvm/mmu.c |5 ++--- arch/x86/k

[PATCH][v2 3/3] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Sheng Yang
Only modifying some bits of CR0/CR4 needs paging mode switch. Modify EFER.NXE bit would result in reserved bit updates. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm

[PATCH 2/3] x86: Export FPU API for KVM use

2010-05-13 Thread Sheng Yang
Also add some more constants. Signed-off-by: Sheng Yang --- Do we need to rename "task_xstate_cachep"? It's not only for task struct now. arch/x86/include/asm/i387.h |2 ++ arch/x86/include/asm/xsave.h |3 +++ arch/x86/kernel/i387.c |3 ++- arch/x86/k

[PATCH 1/3] x86: Split fpu_save_init() to fpu_save() and fpu_clear()

2010-05-13 Thread Sheng Yang
fpu_save() would be used later by KVM. Signed-off-by: Sheng Yang --- arch/x86/include/asm/i387.h | 71 ++- 1 files changed, 43 insertions(+), 28 deletions(-) diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 1a8cca3..989d3b7

[PATCH 0/3] Convert KVM to use FPU API

2010-05-13 Thread Sheng Yang
This patchset based on Avi's FPU API patchset. Sheng Yang (3): x86: Split fpu_save_init() to fpu_save() and fpu_clear() x86: Export FPU API for KVM use KVM: x86: Use FPU API arch/x86/include/asm/i387.h | 73 --- arch/x86/include/asm/kvm_h

[PATCH 3/3] KVM: x86: Use FPU API

2010-05-13 Thread Sheng Yang
Convert KVM to use generic FPU API. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h | 18 +- arch/x86/kvm/x86.c | 73 --- 2 files changed, 23 insertions(+), 68 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b

[PATCH 3/3] KVM: x86: Use FPU API

2010-05-17 Thread Sheng Yang
Convert KVM to use generic FPU API. Signed-off-by: Sheng Yang --- Like this? (Drop patch 1) arch/x86/include/asm/kvm_host.h | 18 +- arch/x86/kvm/x86.c | 70 ++- 2 files changed, 19 insertions(+), 69 deletions(-) diff --git a/arch

Re: [PATCH 3/3] KVM: x86: Use FPU API

2010-05-17 Thread Sheng Yang
On Monday 17 May 2010 16:18:22 Avi Kivity wrote: > On 05/17/2010 11:09 AM, Sheng Yang wrote: > > Convert KVM to use generic FPU API. > > > > Signed-off-by: Sheng Yang > > --- > > Like this? (Drop patch 1) > > Will be more readable with a patch that converts

[PATCH][v2 0/3] Convert KVM to use FPU API

2010-05-17 Thread Sheng Yang
Change from v1: Use unlazy_fpu() to handle host FPU, avoiding save/restore of host FPU states. Sheng Yang (3): x86: Export FPU API for KVM use KVM: x86: Use unlazy_fpu() for host FPU KVM: x86: Use FPU API arch/x86/include/asm/i387.h |2 + arch/x86/include/asm/kvm_host.h | 18

[PATCH][v2 3/3] KVM: x86: Use FPU API

2010-05-17 Thread Sheng Yang
Convert KVM to use generic FPU API. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h | 17 + arch/x86/kvm/x86.c | 52 --- 2 files changed, 17 insertions(+), 52 deletions(-) diff --git a/arch/x86/include/asm

[PATCH][v2 1/3] x86: Export FPU API for KVM use

2010-05-17 Thread Sheng Yang
Also add some constants. Signed-off-by: Sheng Yang --- arch/x86/include/asm/i387.h |2 ++ arch/x86/include/asm/xsave.h |3 +++ arch/x86/kernel/i387.c |3 ++- arch/x86/kernel/process.c|1 + 4 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/x86/include

[PATCH][v2 2/3] KVM: x86: Use unlazy_fpu() for host FPU

2010-05-17 Thread Sheng Yang
We can avoid unnecessary fpu load when userspace process didn't use FPU frequently. Derived from Avi's idea. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |1 - arch/x86/kvm/x86.c | 18 ++ 2 files changed, 2 insertions(+), 17

Re: [PATCH][v2 1/3] x86: Export FPU API for KVM use

2010-05-17 Thread Sheng Yang
On Monday 17 May 2010 17:19:02 Avi Kivity wrote: > On 05/17/2010 12:08 PM, Sheng Yang wrote: > > Also add some constants. > > > > > > +++ b/arch/x86/kernel/process.c > > @@ -28,6 +28,7 @@ unsigned long idle_nomwait; > > > > EXPORT_SYMBOL(

[PATCH][v2 1/3] x86: Export FPU API for KVM use

2010-05-17 Thread Sheng Yang
Also add some constants. Signed-off-by: Sheng Yang --- arch/x86/include/asm/i387.h |2 ++ arch/x86/include/asm/xsave.h |3 +++ arch/x86/kernel/i387.c |3 ++- arch/x86/kernel/process.c|1 + 4 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/x86/include

[PATCH] qemu-kvm: Enable xsave related CPUID

2010-05-19 Thread Sheng Yang
Signed-off-by: Sheng Yang --- target-i386/cpuid.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index eebf038..21e94f3 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -1067,6

[PATCH v2] KVM: VMX: Enable XSAVE/XRSTORE for guest

2010-05-19 Thread Sheng Yang
From: Dexuan Cui Enable XSAVE/XRSTORE for guest. Change from V1: 1. Use FPU API. 2. Fix CPUID issue. 3. Save/restore all possible guest xstate fields when switching. Because we don't know which fields guest has already touched. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang ---

[PATCH][v3] KVM: VMX: Enable XSAVE/XRSTORE for guest

2010-05-20 Thread Sheng Yang
ff-by: Dexuan Cui Signed-off-by: Sheng Yang --- Avi, could you help to review this kernel patch first? Testcase and LM are in progress now. arch/x86/include/asm/kvm_host.h |1 + arch/x86/include/asm/vmx.h |1 + arch/x86/kvm/vmx.c | 28 arch/x86/kvm/

Re: [PATCH][v3] KVM: VMX: Enable XSAVE/XRSTORE for guest

2010-05-21 Thread Sheng Yang
On Thursday 20 May 2010 17:46:40 Avi Kivity wrote: > On 05/20/2010 12:16 PM, Sheng Yang wrote: > > From: Dexuan Cui > > > > Enable XSAVE/XRSTORE for guest. > > > > Change from V2: > > Addressed comments from Avi. > > > > Change from V1: >

[PATCH v4] KVM: VMX: Enable XSAVE/XRSTORE for guest

2010-05-24 Thread Sheng Yang
Fix CPUID issue. 3. Save/restore all possible guest xstate fields when switching. Because we don't know which fields guest has already touched. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang --- I am still not clear about why we need to reload guest xcr0 when cr4.osxsave set... arch/

Re: [PATCH v4] KVM: VMX: Enable XSAVE/XRSTORE for guest

2010-05-24 Thread Sheng Yang
On Monday 24 May 2010 21:36:12 Avi Kivity wrote: > On 05/24/2010 01:03 PM, Sheng Yang wrote: > > From: Dexuan Cui > > > > Enable XSAVE/XRSTORE for guest. > > > > Change from V3: > > 1. Enforced the assumption that host OS would use all available xstate >

[PATCH v5] KVM: VMX: Enable XSAVE/XRSTORE for guest

2010-05-26 Thread Sheng Yang
From: Dexuan Cui This patch enable guest to use XSAVE/XRSTORE instructions. We assume that host_xcr0 would use all possible bits that OS supported. And we loaded xcr0 in the same way we handled fpu - do it as late as we can. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang --- I've

[PATCH v6] KVM: x86: Enable XSAVE/XRSTOR for guest

2010-05-27 Thread Sheng Yang
From: Dexuan Cui This patch enable guest to use XSAVE/XRSTOR instructions. We assume that host_xcr0 would use all possible bits that OS supported. And we loaded xcr0 in the same way we handled fpu - do it as late as we can. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang --- arch/x86

[PATCH] KVM: x86: XSAVE/XRSTOR live migration support

2010-05-27 Thread Sheng Yang
This patch enable save/restore of xsave state. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm.h | 29 arch/x86/kvm/x86.c | 79 include/linux/kvm.h|6 +++ 3 files changed, 114 insertions(+), 0 deletions

[PATCH] qemu: Enable XSAVE related CPUID

2010-05-27 Thread Sheng Yang
We can support it in KVM now. The initial values are the minimal requirement of XSAVE capable processor. Signed-off-by: Sheng Yang --- target-i386/cpuid.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386

[PATCH] qemu: kvm: Enable XSAVE live migration support

2010-05-27 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu-kvm-x86.c| 77 + qemu-kvm.c| 12 +++ qemu-kvm.h| 14 + target-i386/cpu.h |5 +++ target-i386/machine.c | 20 + 5 files changed, 109

Re: [PATCH v6] KVM: x86: Enable XSAVE/XRSTOR for guest

2010-05-27 Thread Sheng Yang
On Thursday 27 May 2010 17:52:36 Avi Kivity wrote: > On 05/27/2010 12:47 PM, Sheng Yang wrote: > > From: Dexuan Cui > > > > This patch enable guest to use XSAVE/XRSTOR instructions. > > > > We assume that host_xcr0 would use all possible bits that OS supported. &

Re: [PATCH] KVM: x86: XSAVE/XRSTOR live migration support

2010-05-27 Thread Sheng Yang
On Thursday 27 May 2010 18:02:31 Avi Kivity wrote: > On 05/27/2010 12:48 PM, Sheng Yang wrote: > > This patch enable save/restore of xsave state. > > > > Signed-off-by: Sheng Yang > > --- > > > > arch/x86/include/asm/kvm.h | 29

Re: [PATCH] qemu: Enable XSAVE related CPUID

2010-05-27 Thread Sheng Yang
On Thursday 27 May 2010 20:56:17 Avi Kivity wrote: > On 05/27/2010 12:50 PM, Sheng Yang wrote: > > We can support it in KVM now. The initial values are the minimal > > requirement of XSAVE capable processor. > > > > Signed-off-by: Sheng Yang > > --- >

[PATCH] test: Add XSAVE unit test

2010-05-31 Thread Sheng Yang
Only test legal action so far, we can extend it later. Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |5 +- kvm/test/x86/xsave.c | 173 2 files changed, 177 insertions(+), 1 deletions(-) create mode 100644 kvm/test/x86

Re: [PATCH] KVM: x86: XSAVE/XRSTOR live migration support

2010-05-31 Thread Sheng Yang
On Thursday 27 May 2010 18:02:31 Avi Kivity wrote: > On 05/27/2010 12:48 PM, Sheng Yang wrote: > > This patch enable save/restore of xsave state. > > > > Signed-off-by: Sheng Yang > > --- > > > > arch/x86/include/asm/kvm.h | 29

[PATCH v7] KVM: VMX: Enable XSAVE/XRSTOR for guest

2010-05-31 Thread Sheng Yang
From: Dexuan Cui This patch enable guest to use XSAVE/XRSTOR instructions. We assume that host_xcr0 would use all possible bits that OS supported. And we loaded xcr0 in the same way we handled fpu - do it as late as we can. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang --- Change

[PATCH 1/2] qemu: kvm: Extend kvm_arch_get_supported_cpuid() to support index

2010-05-31 Thread Sheng Yang
Would use it later for XSAVE related CPUID. Signed-off-by: Sheng Yang --- kvm.h |2 +- qemu-kvm-x86.c|8 target-i386/kvm.c | 19 +++ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/kvm.h b/kvm.h index aab5118..16b06a4 100644

[PATCH 2/2] qemu: Enable XSAVE related CPUID

2010-05-31 Thread Sheng Yang
We can support it in KVM now. The 0xd leaf is queried from KVM. Signed-off-by: Sheng Yang --- target-i386/cpuid.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index eebf038..ec47950 100644 --- a/target

Re: [PATCH] test: Add XSAVE unit test

2010-06-01 Thread Sheng Yang
On Tuesday 01 June 2010 16:51:05 Avi Kivity wrote: > On 05/31/2010 02:17 PM, Sheng Yang wrote: > > Only test legal action so far, we can extend it later. > > The legal actions are tested by guests, so it's more important for unit > tests to check illegal (and potentially su

[PATCH] KVM: VMX: Enforce EPT pagetable level checking

2010-06-01 Thread Sheng Yang
We only support 4 levels EPT pagetable now. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 99ae513..d400fbb 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c

Re: [PATCH] KVM VMX: Make sure single type invvpid is supported before issuing this instruction

2010-06-03 Thread Sheng Yang
On Thursday 03 June 2010 16:44:34 Gui Jianfeng wrote: > According to SDM, we need check whether single-context INVVPID type is > supported before issuing invvpid instruction. > > Signed-off-by: Gui Jianfeng > --- > arch/x86/include/asm/vmx.h |2 ++ > arch/x86/kvm/vmx.c |8 +++

Re: [PATCH v2] KVM VMX: Make sure single type invvpid is supported before issuing invvpid instruction

2010-06-03 Thread Sheng Yang
On Thursday 03 June 2010 17:45:22 Gui Jianfeng wrote: > According to SDM, we need check whether single-context INVVPID type is > supported before issuing invvpid instruction. > > Signed-off-by: Gui Jianfeng > --- > arch/x86/include/asm/vmx.h |2 ++ > arch/x86/kvm/vmx.c | 14 +++

Re: [PATCH v3] KVM VMX: Make sure single type invvpid is supported before issuing invvpid instruction

2010-06-03 Thread Sheng Yang
On Friday 04 June 2010 08:51:39 Gui Jianfeng wrote: > According to SDM, we need check whether single-context INVVPID type is > supported before issuing invvpid instruction. > > Signed-off-by: Gui Jianfeng Reviewed-by: Sheng Yang -- regards Yang, Sheng > --- > arch/x86

[PATCH 2/2] KVM: x86: XSAVE/XRSTOR live migration support

2010-06-09 Thread Sheng Yang
This patch enable save/restore of xsave state. Signed-off-by: Sheng Yang --- Documentation/kvm/api.txt | 76 ++ arch/x86/include/asm/kvm.h | 24 ++ arch/x86/kvm/x86.c | 110 include/linux/kvm.h

[PATCH v8 1/2] KVM: VMX: Enable XSAVE/XRSTOR for guest

2010-06-09 Thread Sheng Yang
From: Dexuan Cui This patch enable guest to use XSAVE/XRSTOR instructions. We assume that host_xcr0 would use all possible bits that OS supported. And we loaded xcr0 in the same way we handled fpu - do it as late as we can. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang --- arch/x86

[PATCH 2/3] qemu: Enable XSAVE related CPUID

2010-06-09 Thread Sheng Yang
We can support it in KVM now. The 0xd leaf is queried from KVM. Signed-off-by: Sheng Yang --- target-i386/cpuid.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index fb78061..26e4054 100644 --- a/target

[PATCH 1/3] qemu: kvm: Extend kvm_arch_get_supported_cpuid() to support index

2010-06-09 Thread Sheng Yang
Would use it later for XSAVE related CPUID. Signed-off-by: Sheng Yang --- kvm.h |2 +- target-i386/kvm.c | 19 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kvm.h b/kvm.h index aab5118..16b06a4 100644 --- a/kvm.h +++ b/kvm.h @@ -152,7

[PATCH 3/3] qemu: kvm: Enable XSAVE live migration support

2010-06-09 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu-kvm-x86.c| 114 qemu-kvm.c| 24 ++ qemu-kvm.h| 28 target-i386/cpu.h |6 +++ target-i386/machine.c | 21 + 5 files changed, 174

[PATCH 2/2] test: Add XSAVE unit test

2010-06-09 Thread Sheng Yang
Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |2 + kvm/test/config-x86_64.mak |3 +- kvm/test/x86/xsave.c | 263 3 files changed, 267 insertions(+), 1 deletions(-) create mode 100644 kvm/test/x86/xsave.c diff --git

[PATCH 1/2] test: Add IDT framework

2010-06-09 Thread Sheng Yang
Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |2 + kvm/test/config-x86_64.mak |2 +- kvm/test/lib/x86/idt.h | 19 + kvm/test/x86/idt.c | 85 kvm/test/x86/idt_test.c| 48

Re: [PATCH 1/2] test: Add IDT framework

2010-06-10 Thread Sheng Yang
On Thursday 10 June 2010 17:49:16 Avi Kivity wrote: > On 06/10/2010 06:31 AM, Sheng Yang wrote: > > + > > +#define EXCEPTION_REGION_BEGIN(r, lb) \ > > +asm volatile("pushq $"lb"\n\t" \ > > + "mov $2, %0\n\t" \ > > +

[PATCH v3] KVM: x86: XSAVE/XRSTOR live migration support

2010-06-10 Thread Sheng Yang
This patch enable save/restore of xsave state. Signed-off-by: Sheng Yang --- Documentation/kvm/api.txt| 74 + arch/x86/include/asm/kvm.h | 22 ++ arch/x86/include/asm/xsave.h |7 ++- arch/x86/kvm/x86.c | 145

[PATCH v3] qemu: kvm: Enable XSAVE live migration support

2010-06-10 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu-kvm-x86.c| 109 - qemu-kvm.c| 24 +++ qemu-kvm.h| 28 + target-i386/cpu.h |5 ++ target-i386/kvm.c |2 + target-i386/machine.c | 20

[PATCH v3] test: Add XSAVE unit test

2010-06-11 Thread Sheng Yang
Based on IDT test framework. Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |2 + kvm/test/config-x86_64.mak |3 +- kvm/test/x86/xsave.c | 260 3 files changed, 264 insertions(+), 1 deletions(-) create mode 100644

Re: [PATCH v2] test: Add IDT framework

2010-06-11 Thread Sheng Yang
On Thursday 10 June 2010 21:30:14 Avi Kivity wrote: > Signed-off-by: Sheng Yang > Signed-off-by: Avi Kivity Really great work! > --- > kvm/test/config-x86-common.mak |2 + > kvm/test/config-x86_64.mak |2 +- > kvm/test/flat.lds |7 ++- > k

[PATCH v4] test: Add XSAVE unit test

2010-06-13 Thread Sheng Yang
Based on IDT test framework. Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |2 + kvm/test/config-x86_64.mak |3 +- kvm/test/x86/xsave.c | 262 3 files changed, 266 insertions(+), 1 deletions(-) create mode 100644

Re: [PATCH v4] test: Add XSAVE unit test

2010-06-13 Thread Sheng Yang
On Sunday 13 June 2010 16:43:42 Avi Kivity wrote: > On 06/13/2010 11:32 AM, Sheng Yang wrote: > > Based on IDT test framework. > > + > > +int main(void) > > +{ > > +setup_idt(); > > +if (check_cpuid_1_ecx(CPUID_1_ECX_XSAVE)) { >

[PATCH v4] test: Add XSAVE unit test

2010-06-13 Thread Sheng Yang
Based on IDT test framework. Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |2 + kvm/test/config-x86_64.mak |3 +- kvm/test/x86/xsave.c | 262 3 files changed, 266 insertions(+), 1 deletions(-) create mode 100644

Re: [PATCH v3] KVM: x86: XSAVE/XRSTOR live migration support

2010-06-13 Thread Sheng Yang
On Sunday 13 June 2010 16:26:18 Avi Kivity wrote: > On 06/11/2010 07:36 AM, Sheng Yang wrote: > > This patch enable save/restore of xsave state. > > > > +static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu, > > + st

[PATCH v4] KVM: x86: XSAVE/XRSTOR live migration support

2010-06-13 Thread Sheng Yang
This patch enable save/restore of xsave state. Signed-off-by: Sheng Yang --- Documentation/kvm/api.txt| 74 ++ arch/x86/include/asm/kvm.h | 22 +++ arch/x86/include/asm/xsave.h |7 ++- arch/x86/kvm/x86.c | 139

Re: [PATCH] KVM: MMU: Add shadow_accessed_shift

2008-08-29 Thread Sheng Yang
On Fri, Aug 29, 2008 at 02:49:38PM +0300, Avi Kivity wrote: > Yang, Sheng wrote: >> From: Sheng Yang <[EMAIL PROTECTED]> >> Date: Fri, 29 Aug 2008 14:02:29 +0800 >> Subject: [PATCH] KVM: MMU: Add shadow_accessed_shift >> > >> static u64 __

Re: [PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae

2008-09-01 Thread Sheng Yang
On Mon, Sep 01, 2008 at 12:40:04PM +0300, Avi Kivity wrote: > Yang, Sheng wrote: >> From: Sheng Yang <[EMAIL PROTECTED]> >> Date: Mon, 1 Sep 2008 17:28:59 +0800 >> Subject: [PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae >> >> EPT is 4

[PATCH] KVM: VMX: Add MTRR support for EPT

2008-09-08 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/mmu.c | 115 +++- arch/x86/kvm/svm.c |6 ++ arch/x86/kvm/vmx.c | 24 - arch/x86/kvm/x86.c |2 +- include/asm-x86/kvm_host.h |3 +- 5

[PATCH] KVM: VMX: Allocate MSR Bitmap for each vcpu

2008-09-08 Thread Sheng Yang
Separate msr_bitmap for each vcpu, prepared for guest PAT support. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c | 53 +-- 1 files changed, 30 insertions(+), 23 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x

[PATCH] KVM: Improve MTRR structure

2008-09-08 Thread Sheng Yang
Most structure copied from x86 MTRR. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/x86.c | 57 ++- include/asm-x86/kvm_host.h | 18 +- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/arch/x86/k

[PATCH] KVM: VMX: Add PAT support for EPT

2008-09-08 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c | 15 --- arch/x86/kvm/vmx.h |7 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 7f53fb7..b74b43f 100644 --- a/arch/x86/kvm/vmx.c

[PATCH 0/4] Memory type support for EPT

2008-09-08 Thread Sheng Yang
Hi, Avi This patchset add memory type support for EPT, including MTRR and PAT. The patch restruct the MTRR structure to make it easy to use, also take host kernel MTRR as a reference. The function guest_mtrr_type_lookup() is copied from host kernel rather than reuse, for I think it may be much m

[PATCH 2/3] KVM: VMX: Rename IA32_FEATURE_CONTROL bits

2008-09-11 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c | 18 +- arch/x86/kvm/vmx.h |4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 81c121c..7b41241 100644 --- a/arch/x86/kvm/vmx.c

[PATCH 0/3] Move VMX MSRs

2008-09-11 Thread Sheng Yang
Hi, Avi As Ingo suggested, I resubmit these patches to KVM. The first patch have been accepted by tip/x86, the latter two just a following clean up. Hope the thing goes on well when merge... Thanks! -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the b

[PATCH 3/3] x86: Move FEATURE_CONTROL bits to msr-index.h

2008-09-11 Thread Sheng Yang
For MSR_IA32_FEATURE_CONTROL is already there. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.h |3 --- include/asm-x86/msr-index.h |3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.h b/arch/x86/kvm/vmx.h index c

[PATCH 1/3] x86: Move VMX MSRs to msr-index.h

2008-09-11 Thread Sheng Yang
They are hardware specific MSRs, and we would use them in virtualization feature detection later. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.h | 15 --- include/asm-x86/msr-index.h | 16 2 files changed, 16 insertions(

[PATCH 1/4] Separate update irq to a single function

2008-09-25 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/x86.c | 78 1 files changed, 42 insertions(+), 36 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index b9d15f7..43fb049 100644 --- a/arch/x86/kvm/x86.c

[PATCH 0/4] Enable MSI support for KVM VT-d

2008-09-25 Thread Sheng Yang
Hi, Avi This patchset enable MSI support for KVM VT-d. And here are only kernel space ones. The third patch would go to also goto x86 upstream. The userspace code would looks like this: assigned_irq_data.guest_msi_addr = *(uint32_t *)(d->msi_cap + 4); assigned_irq_data.guest_msi_data = *(uint16

[PATCH 2/4] KVM: x86: Replace irq_requested with guest_intr_type

2008-09-25 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/x86.c |8 include/linux/kvm_host.h |3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 43fb049..4836323 100644 --- a/arch/x86/kvm/x86.c

[PATCH 3/4] x86: Add MSI delivery mode mask

2008-09-25 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/asm-x86/msidef.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/asm-x86/msidef.h b/include/asm-x86/msidef.h index 296f29c..fdeebbb 100644 --- a/include/asm-x86/msidef.h +++ b/include/asm-x86/ms

[PATCH 4/4] KVM: x86: Enable MSI for assigned device

2008-09-25 Thread Sheng Yang
As well as export ioapic_get_delivery_bitmask(). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/x86.c | 111 +++-- include/linux/kvm.h |4 ++ include/linux/kvm_host.h |3 + virt/kvm/ioapic.c|3 +- vi

Re: [PATCH 4/4] kvm: bios: switch MTRRs to cover only the PCI range and default to WB

2008-09-27 Thread Sheng Yang
On Saturday 27 September 2008 21:55:33 Zwane Mwaikambo wrote: > On Sat, 27 Sep 2008, Avi Kivity wrote: > > Yang, Sheng wrote: > > > I think we should do a little more than just write msr to update mtrr. > > > > > > Intel SDM 10.11.8 "MTRR consideration in MP Systems" define the > > > procedure to m

Re: installing kvm-76 on 2.6.24

2008-09-29 Thread Sheng Yang
On Mon, Sep 29, 2008 at 1:09 PM, Sterling Windmill <[EMAIL PROTECTED]> wrote: > I am running a custom compiled 2.6.24 kernel on a 64-bit Intel system and had > no issues compling and running kvm-75. > > I downloaded kvm-76 and compiled and installed it, but I cannot get the > modules to load prop

Re: kvm-76 won't load on x86_64 2.6.24 with openvz

2008-09-29 Thread Sheng Yang
Yeah, comfirmed that you enable CONFIG_DMAR. :) -- regards, Yang, Sheng On Mon, Sep 29, 2008 at 10:07 PM, Sterling Windmill <[EMAIL PROTECTED]> wrote: > I am attempting to use kvm-76 with a x86_64 2.6.24 kernel from openvz.org > > The kernel .rpm and src .rpm can be found here: > > http://wiki.o

Re: unhandled vm exit: 0x80000021 vcpu_id 0

2008-09-29 Thread Sheng Yang
On Mon, Sep 29, 2008 at 6:18 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I have successfully installed windows XP SP2 on kvm. After the > installation I have launched the setup of "Checkpoint - Pointsec" for > the entire disk encryption. Hi Pier Can you issue a bug for this? But sad

Re: installing kvm-76 on 2.6.24

2008-09-29 Thread Sheng Yang
uild file for this purpose? I can also > recompile my kernel, but that's a bit more difficult. Add vtd.c to kvm-userspace/kernel/x86/Kbuild kvm-objs item should get it done. -- regards, Yang, Sheng > > Thanks in advance, > Sterling Windmill > > ----- Original Message ---

Re: installing kvm-76 on 2.6.24

2008-09-29 Thread Sheng Yang
; CFLAGS_kvm_main.o = -DKVM_MAIN > > The modules do compile with this option specified. > > Unfortunately, the error inserting the modules still persists. > > Any other ideas? > > - Original Message - > From: "Sheng Yang" <[EMAIL PROTECTED]> >

Re: installing kvm-76 on 2.6.24

2008-09-29 Thread Sheng Yang
On Tue, Sep 30, 2008 at 12:37 AM, Amit Shah <[EMAIL PROTECTED]> wrote: > * On Monday 29 Sep 2008 20:59:56 Sheng Yang wrote: >> On Mon, Sep 29, 2008 at 11:18 PM, Sterling Windmill <[EMAIL PROTECTED]> > wrote: >> > It seems as though I need to insert vtd.o instead of

Re: [RFC][PATCH 0/2] Fix guest shared interrupt with in-kernel irqchip

2008-10-02 Thread Sheng Yang
On Thu, Oct 02, 2008 at 04:27:18PM +0300, Avi Kivity wrote: > Yang, Sheng wrote: >> To deal with guest shared interrupt bug in in-kernel irqchip, we should: >> >> 1. Identify each level trig interrupt source. >> 2. Implement logical OR on the same IRQ line for each interrupt source. >> >> Here I ch

Re: [RFC][PATCH 0/2] Fix guest shared interrupt with in-kernel irqchip

2008-10-02 Thread Sheng Yang
How about this one? Still untested. -- From: Sheng Yang <[EMAIL PROTECTED]> Date: Fri, 3 Oct 2008 00:07:20 +0800 Subject: [PATCH 1/1] KVM: Fix guest shared interrupt with in-kernel irqchip Derived from Avi's suggestion, now every call of kvm_set_irq() should offer a irq_source_i

Re: unhandled vm exit: 0x80000021 vcpu_id 0

2008-10-02 Thread Sheng Yang
n's patch make them slience). Is this the dmesg when the error was happening? -- regards Yang, Sheng > > thanks for your helpfulness. > > Regards. > > Sheng Yang wrote: > > On Mon, Sep 29, 2008 at 6:18 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED] > it> wrot

Re: [RFC][PATCH 0/2] Fix guest shared interrupt with in-kernel irqchip

2008-10-03 Thread Sheng Yang
On Fri, Oct 03, 2008 at 01:06:53PM +0530, Amit Shah wrote: > * On Thursday 02 Oct 2008 22:15:59 Sheng Yang wrote: > > > /* This should be called with the kvm->lock mutex held */ > > -void kvm_set_irq(struct kvm *kvm, int irq, int level) > > +void kvm_set_irq(struct k

Re: [RFC][PATCH 0/2] Fix guest shared interrupt with in-kernel irqchip

2008-10-05 Thread Sheng Yang
On Sat, 2008-10-04 at 11:47 +0300, Avi Kivity wrote: > Sheng Yang wrote: >> Derived from Avi's suggestion, now every call of kvm_set_irq() should offer >> a irq_source_id, which is allocated by kvm_allocate_irq_sources(). We based >> on irq_source_id to identify irq sourc

Re: [RFC][PATCH 0/2] Fix guest shared interrupt with in-kernel irqchip

2008-10-05 Thread Sheng Yang
On Mon, 2008-10-06 at 14:23 +0800, Sheng Yang wrote: > On Sat, 2008-10-04 at 11:47 +0300, Avi Kivity wrote: > > Sheng Yang wrote: > >> Derived from Avi's suggestion, now every call of kvm_set_irq() should offer > >> a irq_source_id, which is allocated by kvm_

Re: [PATCH 4/4] KVM: x86: Enable MSI for assigned device

2008-10-06 Thread Sheng Yang
On Monday 06 October 2008 11:36:08 Yang, Sheng wrote: > On Sunday 05 October 2008 18:27:20 Avi Kivity wrote: > > Sheng Yang wrote: > > > As well as export ioapic_get_delivery_bitmask(). > > > > > > @@ -132,8 +177,12 @@ static void > > > kvm_assigned_

Re: [PATCH 4/4] KVM: x86: Enable MSI for assigned device

2008-10-06 Thread Sheng Yang
Update according to the comments. Thanks! -- From: Sheng Yang <[EMAIL PROTECTED]> Date: Tue, 7 Oct 2008 14:04:24 +0800 Subject: [PATCH 4/4] KVM: x86: Enable MSI for assigned device As well as export ioapic_get_delivery_bitmask(). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> ---

Re: [PATCH 4/4] KVM: x86: Enable MSI for assigned device

2008-10-07 Thread Sheng Yang
On Tuesday 07 October 2008 21:42:41 Avi Kivity wrote: > Sheng Yang wrote: > > Seems we needn't tell userspace if MSI can be enabled. It's determined > > mostly by the device, and pci_enable_msi() checked that. > > > > So I think QEmu can expose MSI capability i

[PATCH 4/7] Export some definition of MTRR

2008-10-07 Thread Sheng Yang
For KVM can reuse the type define, and need them to support shadow MTRR. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kernel/cpu/mtrr/generic.c | 12 +++- arch/x86/kernel/cpu/mtrr/mtrr.h| 17 - include/asm-x86/mtrr.h

[PATCH 3/7] x86: Rename mtrr_state struct and macro names

2008-10-07 Thread Sheng Yang
Prepare for exporting them. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kernel/cpu/mtrr/generic.c |8 arch/x86/kernel/cpu/mtrr/main.c|4 ++-- arch/x86/kernel/cpu/mtrr/mtrr.h|7 --- 3 files changed, 10 insertions(+), 9 deletions(-) diff -

[PATCH 5/7] KVM: Improve MTRR structure

2008-10-07 Thread Sheng Yang
As well as reset mmu context when set MTRR. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/x86.c | 61 ++- include/asm-x86/kvm_host.h |5 +++- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm

[PATCH 0/7] Enable MTRR/PAT support for KVM EPT(v2)

2008-10-07 Thread Sheng Yang
Hi, Avi Here is the update patchset of enable MTRR/PAT support for KVM, and the last patch enabled EPT support. The shadow support would follow later, I am still doing some clean up work. The change from v1 including bug fix and rename of GUEST_PAT support according to the newly published spec. F

<    1   2   3   4   5   6   7   8   9   10   >