Nested VMX: load current_vmcs only when it exists
PATCH 1/1 Nested VMX: load current_vmcs only when it exists
From: Yang Zhang <[email protected]>
There may not have valid vmcs on current CPU. So only load it when it exists.
This original fixing is from Edmud <[email protected]>.
--- xen/arch/x86/hvm/vmx/vmcs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
xen/arch/x86/hvm/vmx/vmcs.c +5 -1
@@ -824,8 +824,12 @@ void virtual_vmcs_enter(void *vvmcs)void virtual_vmcs_exit (void *vvmcs) { +struct vmcs_struct *cur =this_cpu (current_vmcs); +__vmpclear (pfn_to_paddr (domain_page_map_to_mfn (vvmcs))); -__vmptrld (virt_to_maddr (this_cpu (current_vmcs))); +if ( cur ) +__vmptrld (virt_to_maddr (cur)); + }u64 virtual_vmcs_vmread (void *vvmcs,u32 vmcs_encoding)
Signature · 1 line
1.7.1
Quoted 11 lines
From: Zhang, Yang Z
Sent: Friday, May 09, 2014 12:56 PMFrom: Yang Zhang <[email protected]>
There may not have valid vmcs on current CPU. So only load it when it exists.
This original fixing is from Edmud <[email protected]>.
Signed-off-by Edmund H White <[email protected]>Signed-off-by Yang Zhang <[email protected]>
Quoted 24 lines
--- xen/arch/x86/hvm/vmx/vmcs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)xen/arch/x86/hvm/vmx/vmcs.c +5
-2@@ -824,8 +824,12 @@ void virtual_vmcs_enter(void *vvmcs)void virtual_vmcs_exit (void *vvmcs) { +struct vmcs_struct *cur =this_cpu (current_vmcs); +__vmpclear (pfn_to_paddr (domain_page_map_to_mfn (vvmcs))); -__vmptrld (virt_to_maddr (this_cpu (current_vmcs))); +if ( cur ) +__vmptrld (virt_to_maddr (cur)); + }u64 virtual_vmcs_vmread (void *vvmcs,u32 vmcs_encoding) --1.7.1
Andrew Cooper
Reviewed-byQuoted 5 lines · Kevin
Quoted 5 lines
From: Zhang, Yang Z
Sent: Friday, May 09, 2014 12:56 PMFrom: Yang Zhang <[email protected]>
Quoted 7 lines
Quoted 6 lines
There may not have valid vmcs on current CPU. So only load it when it exists.
This original fixing is from Edmud <[email protected]>.
Signed-off-by Edmund H White <[email protected]>Signed-off-by Yang Zhang <[email protected]>Acked-by Kevin Tian <[email protected]>
Quoted 30 lines
Quoted 24 lines
--- xen/arch/x86/hvm/vmx/vmcs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)xen/arch/x86/hvm/vmx/vmcs.c +5
-2@@ -824,8 +824,12 @@ void virtual_vmcs_enter(void *vvmcs)void virtual_vmcs_exit (void *vvmcs) { +struct vmcs_struct *cur =this_cpu (current_vmcs); +__vmpclear (pfn_to_paddr (domain_page_map_to_mfn (vvmcs))); -__vmptrld (virt_to_maddr (this_cpu (current_vmcs))); +if ( cur ) +__vmptrld (virt_to_maddr (cur)); + }u64 virtual_vmcs_vmread (void *vvmcs,u32 vmcs_encoding) --Quoted 1 line
1.7.1
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 09.05.14 at 06:56, <[email protected]> wrote:
From: Yang Zhang <[email protected]>
There may not have valid vmcs on current CPU. So only load it when it exists.
Under what condition(s) might that happen?
Quoted 1 line
This original fixing is from Edmud <[email protected]>.
Rather than stating this here, the From: above should say so.
Quoted 28 lines
Signed-off-by Edmund H White <[email protected]>Signed-off-by Yang Zhang <[email protected]>--- xen/arch/x86/hvm/vmx/vmcs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)xen/arch/x86/hvm/vmx/vmcs.c +5
-1@@ -824,8 +824,12 @@ void virtual_vmcs_enter(void *vvmcs)void virtual_vmcs_exit (void *vvmcs) { +struct vmcs_struct *cur =this_cpu (current_vmcs); +__vmpclear (pfn_to_paddr (domain_page_map_to_mfn (vvmcs))); -__vmptrld (virt_to_maddr (this_cpu (current_vmcs))); +if ( cur ) +__vmptrld (virt_to_maddr (cur)); + }u64 virtual_vmcs_vmread (void *vvmcs,u32 vmcs_encoding)Signature · 3 lines
1.7.1 .
It can happen if no domU vcpu has previously been scheduled on this hardware thread.
________________________________________
From: Jan Beulich [[email protected]]
Sent: Friday, May 09, 2014 2:46 AM
To: Zhang, Yang Z
Cc: [email protected]; White, Edmund H; Tian, Kevin; xen-devel
Subject: Re: [PATCH] Nested VMX: load current_vmcs only when it exists
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 09.05.14 at 06:56, <[email protected]> wrote:
From: Yang Zhang <[email protected]>
There may not have valid vmcs on current CPU. So only load it when it exists.
Under what condition(s) might that happen?
Quoted 1 line
This original fixing is from Edmud <[email protected]>.
Rather than stating this here, the From: above should say so.
Quoted 28 lines
Signed-off-by Edmund H White <[email protected]>Signed-off-by Yang Zhang <[email protected]>--- xen/arch/x86/hvm/vmx/vmcs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)xen/arch/x86/hvm/vmx/vmcs.c +5
-2@@ -824,8 +824,12 @@ void virtual_vmcs_enter(void *vvmcs)void virtual_vmcs_exit (void *vvmcs) { +struct vmcs_struct *cur =this_cpu (current_vmcs); +__vmpclear (pfn_to_paddr (domain_page_map_to_mfn (vvmcs))); -__vmptrld (virt_to_maddr (this_cpu (current_vmcs))); +if ( cur ) +__vmptrld (virt_to_maddr (cur)); + }u64 virtual_vmcs_vmread (void *vvmcs,u32 vmcs_encoding) --1.7.1
.