[PATCH] Rename variable smep to cr4_smep

2014-03-31 Thread Feng Wu
This patch is based on the smap patchset Feng Wu (1): Rename variable smep to cr4_smep arch/x86/kvm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message

[PATCH v4 3/4] KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode

2014-03-31 Thread Feng Wu
SMAP is disabled if CPU is in non-paging mode in hardware. However KVM always uses paging mode to emulate guest non-paging mode with TDP. To emulate this behavior, SMAP needs to be manually disabled when guest switches to non-paging mode. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 11

[PATCH v4 1/4] KVM: Remove SMAP bit from CR4_RESERVED_BITS.

2014-03-31 Thread Feng Wu
This patch removes SMAP bit from CR4_RESERVED_BITS. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index fdf83af..4eeb049 100644 --- a/arch/x86

[PATCH v4 2/4] KVM: Add SMAP support when setting CR4

2014-03-31 Thread Feng Wu
This patch adds SMAP handling logic when setting CR4 for guests Thanks a lot to Paolo Bonzini for his suggestion to use the branchless way to detect SMAP violation. Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.h | 8 arch/x86/kvm/mmu.c | 34

[PATCH v4 4/4] KVM: expose SMAP feature to guest

2014-03-31 Thread Feng Wu
This patch exposes SMAP feature to guest Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index c697625..deb5f9b 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -303,7

[PATCH v4 0/4] KVM: enable Intel SMAP for KVM

2014-03-31 Thread Feng Wu
ess way suggested by Paolo Bonzini to detect SMAP violation in permission_fault(). Version 4: * Changes to some comments and code style. Feng Wu (4): KVM: Remove SMAP bit from CR4_RESERVED_BITS. KVM: Add SMAP support when setting CR4 KVM: Disable SMAP for guests in EPT realmode and

[PATCH v3 4/4] KVM: expose SMAP feature to guest

2014-03-31 Thread Feng Wu
This patch exposes SMAP feature to guest Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index c697625..deb5f9b 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -303,7

[PATCH v3 2/4] KVM: Add SMAP support when setting CR4

2014-03-31 Thread Feng Wu
This patch adds SMAP handling logic when setting CR4 for guests Thanks a lot to Paolo Bonzini for his suggestion to use the branchless way to detect SMAP violation. Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.h | 8 arch/x86/kvm/mmu.c | 35

[PATCH v3 3/4] KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode

2014-03-31 Thread Feng Wu
SMAP is disabled if CPU is in non-paging mode in hardware. However KVM always uses paging mode to emulate guest non-paging mode with TDP. To emulate this behavior, SMAP needs to be manually disabled when guest switches to non-paging mode. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 11

[PATCH v3 0/4] KVM: enable Intel SMAP for KVM

2014-03-31 Thread Feng Wu
ess way suggested by Paolo Bonzini to detect SMAP violation in permission_fault(). Feng Wu (4): KVM: Remove SMAP bit from CR4_RESERVED_BITS. KVM: Add SMAP support when setting CR4 KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode KVM: expose SMAP feature to guest arch/

[PATCH v3 1/4] KVM: Remove SMAP bit from CR4_RESERVED_BITS.

2014-03-31 Thread Feng Wu
This patch removes SMAP bit from CR4_RESERVED_BITS. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index fdf83af..4eeb049 100644 --- a/arch/x86

[PATCH 4/4] KVM: expose SMAP feature to guest

2014-03-28 Thread Feng Wu
This patch exposes SMAP feature to guest Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index c697625..deb5f9b 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -303,7

[PATCH 2/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Feng Wu
This patch adds SMAP handling logic when setting CR4 for guests Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.h | 8 arch/x86/kvm/mmu.c | 24 +--- arch/x86/kvm/mmu.h | 26 +++--- arch/x86/kvm/paging_tmpl.h | 2 +- arch/x86

[PATCH 3/4] KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode

2014-03-28 Thread Feng Wu
SMAP is disabled if CPU is in non-paging mode in hardware. However KVM always uses paging mode to emulate guest non-paging mode with TDP. To emulate this behavior, SMAP needs to be manually disabled when guest switches to non-paging mode. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 11

[PATCH 1/4] KVM: Remove SMAP bit from CR4_RESERVED_BITS.

2014-03-28 Thread Feng Wu
This patch removes SMAP bit from CR4_RESERVED_BITS. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index fdf83af..4eeb049 100644 --- a/arch/x86

[PATCH 0/4] KVM: enable Intel SMAP for KVM

2014-03-28 Thread Feng Wu
in EPT realmode and EPT unpaging mode * Expose SMAP feature to guest Version 1: * Change the logic of updatinng mmu permission bitmap for SMAP violation * Expose SMAP feature to guest in the last patch of this series. Feng Wu (4): KVM: Remove SMAP bit from CR4_RESERVED_BITS. KVM: Add S

[PATCH 0/4] KVM: enable Intel SMAP for KVM

2014-03-26 Thread Feng Wu
ode data accesses (these are implicit supervisor accesses) regardless of the value of EFLAGS.AC. This patchset pass-through SMAP feature to guests, and let guests benefit from it. Feng Wu (4): KVM: expose SMAP feature to guest KVM: Remove SMAP bit from CR4_RESERVED_BITS. KVM: Add SMAP supp

[PATCH 1/4] KVM: expose SMAP feature to guest

2014-03-26 Thread Feng Wu
This patch exposes SMAP feature to guest Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index c697625..deb5f9b 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -303,7

[PATCH 4/4] KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode

2014-03-26 Thread Feng Wu
SMAP is disabled if CPU is in non-paging mode in hardware. However KVM always uses paging mode to emulate guest non-paging mode with TDP. To emulate this behavior, SMAP needs to be manually disabled when guest switches to non-paging mode. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 10

[PATCH 3/4] KVM: Add SMAP support when setting CR4

2014-03-26 Thread Feng Wu
This patch adds SMAP handling logic when setting CR4 for guests Signed-off-by: Feng Wu --- arch/x86/kvm/cpuid.h | 8 arch/x86/kvm/mmu.c | 22 +++--- arch/x86/kvm/mmu.h | 2 ++ arch/x86/kvm/x86.c | 6 ++ 4 files changed, 35 insertions(+), 3 deletions

[PATCH 2/4] KVM: Remove SMAP bit from CR4_RESERVED_BITS.

2014-03-26 Thread Feng Wu
This patch removes SMAP bit from CR4_RESERVED_BITS. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index ae5d783..b673925 100644 --- a/arch/x86

<    1   2   3