[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] Nested VMX: load current_vmcs only when it exists



It can happen if no domU vcpu has previously been scheduled on this hardware 
thread. 
________________________________________
From: Jan Beulich [JBeulich@xxxxxxxx]
Sent: Friday, May 09, 2014 2:46 AM
To: Zhang, Yang Z
Cc: keir.xen@xxxxxxxxx; White, Edmund H; Tian, Kevin; xen-devel
Subject: Re: [PATCH] Nested VMX: load current_vmcs only when it exists

>>> On 09.05.14 at 06:56, <yang.z.zhang@xxxxxxxxx> wrote:
> From: Yang Zhang <yang.z.zhang@xxxxxxxxx>
>
> There may not have valid vmcs on current CPU. So only load it when it
> exists.

Under what condition(s) might that happen?

> This original fixing is from Edmud <edmund.h.white@xxxxxxxxx>.

Rather than stating this here, the From: above should say so.

> Signed-off-by: Edmund H White <edmund.h.white@xxxxxxxxx>
> Signed-off-by: Yang Zhang <yang.z.zhang@xxxxxxxxx>
> ---
>  xen/arch/x86/hvm/vmx/vmcs.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> index cc84ca2..7564895 100644
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -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
>
> .




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.