WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 12 of 20] Add APIs to switch n1/n2 VMCS

To: Eddie Dong <eddie.dong@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 12 of 20] Add APIs to switch n1/n2 VMCS
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Thu, 2 Jun 2011 15:50:02 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 02 Jun 2011 07:50:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <62cc6c7516e010ef673c.1307005045@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1307005033@xxxxxxxxxxxxxxxxxxxx> <62cc6c7516e010ef673c.1307005045@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
At 16:57 +0800 on 02 Jun (1307033845), Eddie Dong wrote:
> diff -r 4631a9511200 -r 62cc6c7516e0 xen/arch/x86/hvm/vmx/vmcs.c
> --- a/xen/arch/x86/hvm/vmx/vmcs.c     Thu Jun 02 16:33:20 2011 +0800
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c     Thu Jun 02 16:33:21 2011 +0800
> @@ -669,6 +669,38 @@ void vmx_disable_intercept_for_msr(struc
>      }
>  }
>  
> +/*
> + * Switch VMCS between layer 1 & 2 guest
> + */
> +void vmx_vmcs_switch(struct vcpu *v,
> +                             struct vmcs_struct *from,
> +                             struct vmcs_struct *to)
> +{
> +    /* no foreign access */
> +    if ( unlikely(v != current) )
> +        return;
> +
> +    if ( unlikely(current->arch.hvm_vmx.vmcs != from) )
> +        return;

Do you really want this function to fail silently if called with v !=
current?  Use ASSERT(), or, even better, remove the first argument
entirely.

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>