[PATCH v2] KVM: VMX: disable SMEP feature when guest is in non-paging mode

2013-02-03 Thread Dongxiao Xu
e the page table is set with USER flag. If SMEP is still enabled in this case, guest will meet unhandlable page fault and then crash. Signed-off-by: Dongxiao Xu Signed-off-by: Xiantao Zhang --- arch/x86/kvm/vmx.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/x8

[PATCH] KVM: VMX: disable SMEP feature when guest is in non-paging mode

2013-02-01 Thread Dongxiao Xu
unhandlable page fault and then crash. Signed-off-by: Dongxiao Xu Signed-off-by: Xiantao Zhang --- arch/x86/kvm/vmx.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9120ae1..e82f20d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch

[PATCH v2 0/4] nested vmx code clean up and restructure

2012-11-22 Thread Dongxiao Xu
handle_vmread() and handle_vmwrite() functions. Thanks, Dongxiao Dongxiao Xu (4): nested vmx: clean up for vmcs12 read and write nested vmx: clean up for nested_cpu_has_xxx functions nested vmx: use vmcs12_read/write() to operate VMCS fields nested vmx: use a list to store the launched vmcs12

[PATCH v2 2/4] nested vmx: clean up for nested_cpu_has_xxx functions

2012-11-22 Thread Dongxiao Xu
This is a preparation for the later change, which use vmcs12_read() and vmcs12_write() to replace the way to access vmcs12 fields. Since the above functions uses 'vcpu' as parameter, we also use 'vcpu' as the parameter in nested_cpu_has_xxx functions. Signed-off-by: Dongxi

[PATCH v2 3/4] nested vmx: use vmcs12_read/write() to operate VMCS fields

2012-11-22 Thread Dongxiao Xu
When referencing vmcs12 fields, the current approach is to use "struct.field" style. This commit replace all the current solution by calling vmcs12_read() and vmcs12_write() fucntions. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vm

[PATCH v2 1/4] nested vmx: clean up for vmcs12 read and write

2012-11-22 Thread Dongxiao Xu
abstract vmcs12_read and vmcs12_write functions to do the vmcs12 read/write operations. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 85 +--- 1 files changed, 41 insertions(+), 44 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86

[PATCH v2 4/4] nested vmx: use a list to store the launched vmcs12 for L1 VMM

2012-11-22 Thread Dongxiao Xu
The launch state is not a member in the VMCS area, use a separate variable (list) to store it instead. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 86 +--- 1 files changed, 81 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm

[PATCH 0/4] nested vmx code clean up and restructure

2012-11-21 Thread Dongxiao Xu
This patch series clean up and restructure part of the nested vmx code. The main purpose is to abstract the vmcs12_read() and vmcs12_write() functions. With this change, we have a unified API to get/set field values from/to vmcs12. Thanks, Dongxiao Dongxiao Xu (4): nested vmx: clean up for

[PATCH 4/4] nested vmx: use a list to store the launched vmcs12 for L1 VMM

2012-11-21 Thread Dongxiao Xu
The launch state is not a member in the VMCS area, use a separate variable (list) to store it instead. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 86 +--- 1 files changed, 81 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm

[PATCH 3/4] nested vmx: use vmcs12_read/write() to operate VMCS fields

2012-11-21 Thread Dongxiao Xu
When referencing vmcs12 fields, the current approach is to use "struct.field" style. This commit replace all the current solution by calling vmcs12_read() and vmcs12_write() fucntions. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vm

[PATCH 2/4] nested vmx: clean up for nested_cpu_has_xxx functions

2012-11-21 Thread Dongxiao Xu
This is a preparation for the later change, which use vmcs12_read() and vmcs12_write() to replace the way to access vmcs12 fields. Since the above functions uses 'vcpu' as parameter, we also use 'vcpu' as the parameter in nested_cpu_has_xxx functions. Signed-off-by: Dongxi

[PATCH 1/4] nested vmx: clean up for vmcs12 read and write

2012-11-21 Thread Dongxiao Xu
abstract vmcs12_read and vmcs12_write functions to do the vmcs12 read/write operations. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 86 +++- 1 files changed, 45 insertions(+), 41 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86