[PATCH] Fix SMEP issues

2011-08-09 Thread Yang, Wei Y
This patch fix kvm-unit-tests hanging and incorrect PT_ACCESSED_MASK bit set in the case of SMEP fault. Signed-off-by: Yang, Wei wei.y.y...@intel.com --- arch/x86/kvm/paging_tmpl.h | 22 +- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git

RE: [PATCH kvm-unit-tests v2] access: check SMEP on prefetch pte path

2011-07-04 Thread Yang, Wei Y
-Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Xiao Guangrong Sent: Friday, July 01, 2011 4:06 PM To: Yang, Wei Y Cc: a...@redhat.com; kvm@vger.kernel.org Subject: Re: [PATCH kvm-unit-tests v2] access: check SMEP on prefetch pte

RE: [PATCH kvm-unit-tests] access: check SMEP on prefetch pte path

2011-06-24 Thread Yang, Wei Y
+void set_cr4_smep(int smep) +{ +unsigned long cr4 = read_cr4(); + +cr4 = ~CR4_SMEP_MASK; +if (smep) + cr4 |= CR4_SMEP_MASK; +write_cr4(cr4); +} + It can work if the box does not support SMEP? It will report unhandled exception 13 in access.out which we

[PATCH] Enable DRNG feature support for KVM

2011-06-13 Thread Yang, Wei Y
This patch exposes DRNG feature to KVM guests. The RDRAND instruction can provide software with sequences of random numbers generated from white noise. Signed-off-by: Yang, Wei wei.y.y...@intel.com --- arch/x86/kvm/x86.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH v8 1/4] Remove SMEP bit from CR4_RESERVED_BITS

2011-06-02 Thread Yang, Wei Y
This patch removes SMEP bit from CR4_RESERVED_BITS. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/include/asm/kvm_host.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH v8 3/4] Mask function7 ebx against host capability word9

2011-06-02 Thread Yang, Wei Y
This patch masks CPUID leaf 7 ebx against host capability word9. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 20 +++- 1 files changed, 19 insertions(+), 1

[PATCH v8 0/4] Enable SMEP feature support for KVM

2011-06-02 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. This patchset is based on Fenghua's SMEP patch series, as

[PATCH v8 2/4] Add SMEP support when setting CR4

2011-06-02 Thread Yang, Wei Y
This patch adds SMEP handling when setting CR4. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff

[PATCH v8 4/4] Add instruction fetch checking when walking guest page table

2011-06-02 Thread Yang, Wei Y
This patch adds instruction fetch checking when walking guest page table. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/paging_tmpl.h |9 - 1 files changed, 8

[PATCH v7 0/4] Enable SMEP feature support for KVM

2011-06-01 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. This patchset is based on Fenghua's SMEP patch series, as

[PATCH v7 1/4] Remove SMEP bit from CR4_RESERVED_BITS

2011-06-01 Thread Yang, Wei Y
This patch removes SMEP bit from CR4_RESERVED_BITS. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/include/asm/kvm_host.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH v7 2/4] Add SMEP support when setting CR4

2011-06-01 Thread Yang, Wei Y
This patch adds SMEP handling when setting CR4. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff

[PATCH v7 3/4] Mask function7 ebx against host capability word9

2011-06-01 Thread Yang, Wei Y
This patch masks CPUID leaf 7 ebx against host capability word9. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 21 - 1 files changed, 20 insertions(+), 1

[PATCH v7 4/4] Add instruction fetch checking when walking guest page table

2011-06-01 Thread Yang, Wei Y
This patch adds instruction fetch checking when walking guest page table. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/paging_tmpl.h |9 - 1 files changed, 8

[PATCH v7] Enable CPU SMEP feature for QEMU-KVM

2011-06-01 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. SMEP is identified by CPUID leaf 7 EBX[7], which is 0

[PATCH v6 3/4] Mask function7 ebx against host capability word9

2011-05-30 Thread Yang, Wei Y
This patch masks CPUID leaf 7 ebx against host capability word9. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 15 ++- 1 files changed, 14 insertions(+), 1

[PATCH v6 2/4] Add SMEP support when setting CR4

2011-05-30 Thread Yang, Wei Y
This patch adds SMEP handling when setting CR4. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git

[PATCH v6 4/4] Add instruction fetch checking when walking guest page table

2011-05-30 Thread Yang, Wei Y
This patch adds instruction fetch checking when walking guest page table. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/paging_tmpl.h |9 - 1 files changed, 8 insertions(+),

[PATCH v6] Enable CPU SMEP feature for QEMU-KVM

2011-05-30 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. SMEP is identified by CPUID leaf 7 EBX[7], which is 0

[PATCH v6 0/4] Enable SMEP feature support for KVM

2011-05-30 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. This patchset is based on Fenghua's SMEP patch series, as

[PATCH v6 1/4] Remove SMEP bit from CR4_RESERVED_BITS

2011-05-30 Thread Yang, Wei Y
This patch removes SMEP bit from CR4_RESERVED_BITS. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/include/asm/kvm_host.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[Patch v4 0/4] Enable SMEP feature support for kvm

2011-05-29 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. This patchset is based on Fenghua's SMEP patch series, as

[Patch v4 1/4] Add SMEP bit to CR4_RESERVED_BITS

2011-05-29 Thread Yang, Wei Y
This patch adds SMEP bit to CR4_RESERVED_BITS. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/include/asm/kvm_host.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[Patch v4 3/4] Mask function7 ebx against host capability word9

2011-05-29 Thread Yang, Wei Y
This patch masks CPUID leaf 7 ebx against host capability word9. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-)

[Patch v4 2/4] Add SMEP handling when setting CR4

2011-05-29 Thread Yang, Wei Y
This patch adds SMEP handling when setting CR4. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff

[PATCH v4] Enable CPU SMEP feature support for QEMU-KVM

2011-05-29 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. SMEP is identified by CPUID leaf 7 EBX[7], which is 0

[Patch v4 4/4] Add instruction fetch checking when walking guest page table

2011-05-29 Thread Yang, Wei Y
This patch adds instruction fetch checking when walking guest page table. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/paging_tmpl.h |9 - 1 files changed, 8 insertions(+),

[Patch v5 0/4] Enable SMEP feature support for kvm

2011-05-29 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. This patchset is based on Fenghua's SMEP patch series, as

[Patch v5 1/4] Remove SMEP bit from CR4_RESERVED_BITS

2011-05-29 Thread Yang, Wei Y
This patch removes SMEP bit from CR4_RESERVED_BITS. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/include/asm/kvm_host.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[Patch v5 2/4] Add SMEP handling when setting CR4

2011-05-29 Thread Yang, Wei Y
This patch adds SMEP handling when setting CR4. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff

[Patch v5 3/4] Mask function7 ebx against host capability word9

2011-05-29 Thread Yang, Wei Y
This patch masks CPUID leaf 7 ebx against host capability word9. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/x86.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-)

[Patch v5 4/4] Add instruction fetch checking when walking guest page table

2011-05-29 Thread Yang, Wei Y
This patch adds instruction fetch checking when walking guest page table. Signed-off-by: Yang, Wei wei.y.y...@intel.com Signed-off-by: Shan, Haitao haitao.s...@intel.com Signed-off-by: Li, Xin xin...@intel.com --- arch/x86/kvm/paging_tmpl.h |9 - 1 files changed, 8

[PATCH v5] Enable CPU SMEP feature support for QEMU-KVM

2011-05-29 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. SMEP is identified by CPUID leaf 7 EBX[7], which is 0

[Patch v3] Enable CPU SMEP feature for KVM

2011-05-26 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. This patchset is based on Fenghua's SMEP patch series, as

[PATCH v3] Enable CPU SMEP feature support for QEMU-KVM

2011-05-26 Thread Yang, Wei Y
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. SMEP is identified by CPUID leaf 7 EBX[7], which is 0

RE: [PATCH v2] Enable CPU SMEP feature for KVM

2011-05-22 Thread Yang, Wei Y
This patch matches with [PATCH v2] Enable CPU SMEP feature support for QEMU-KVM, no changes since v1. Enable newly documented SMEP (Supervisor Mode Execution Protection) CPU feature in KVM module. Intel new CPU supports SMEP (Supervisor Mode Execution Protection). SMEP prevents kernel

[PATCH v2] Enable CPU SMEP feature for KVM

2011-05-21 Thread Yang, Wei Y
This patch matches with [PATCH v2] Enable CPU SMEP feature support for QEMU-KVM, no changes since v1. Enable newly documented SMEP (Supervisor Mode Execution Protection) CPU feature in KVM module. Intel new CPU supports SMEP (Supervisor Mode Execution Protection). SMEP prevents kernel from

[PATCH] Enable CPU SMEP feature support for QEMU-KVM

2011-05-20 Thread Yang, Wei Y
Enable newly documented SMEP (Supervisor Mode Execution Protection) CPU feature for QEMU-KVM. Intel new CPU supports SMEP (Supervisor Mode Execution Protection). SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published

[PATCH] Enable CPU SMEP feature for KVM

2011-05-20 Thread Yang, Wei Y
Enable newly documented SMEP (Supervisor Mode Execution Protection) CPU feature in KVM module. Intel new CPU supports SMEP (Supervisor Mode Execution Protection). SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published

[PATCH v2] Enable CPU SMEP feature support for QEMU-KVM

2011-05-20 Thread Yang, Wei Y
Enable newly documented SMEP (Supervisor Mode Execution Protection) CPU feature for QEMU-KVM. Intel new CPU supports SMEP (Supervisor Mode Execution Protection). SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be