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] remove useless super page recomputing in ept_se

To: "Li, Xin" <xin.li@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] remove useless super page recomputing in ept_set_entry
From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Date: Wed, 30 Jun 2010 10:25:58 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 30 Jun 2010 02:26:59 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=0YmL1ogVcFppOXtV6rbrMSxtlaxIPG6Pu9sG24ua6HE=; b=PJSVdAkY9JVb+2NSsIXvXpIp6BirZ0HUHLkpR3hTryziWN1A+0/y/Avo3MOP/CbaaT ArfEGz8Wbs0hM1tstOrukQnrdHnIjNAqwS9Q9DjGv4IiAoZi54+anU63Xy6HeGivcyCq fIGdIfPSNj/vkJjS0/xnEETFaVHqNYJA82hSA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=DFqCHaJGV102Fltrvir/qKNKOh2D/j8E3o1RtGj2D3ApmPmXKwekfcVuPT/fciNqK8 cDYgYdquJA1t6p2Rt4TbWKTm5vruuL2+BhZLkzjj4JJMMJyn056mZ/cnQOv2zFkZJSWG l/Aj1bLVTmXg8gRURHXSMe9GjorsgXyanSapM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <FC2FB65B4D919844ADE4BE3C2BB739AD20A20A22@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <AcsXtcHWAxM4gOenTESzxelCuOCLZA==> <FC2FB65B4D919844ADE4BE3C2BB739AD20A20A22@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Would it make sense to turn this check on in DEBUG mode?  It can't be
that expensive if it's currently on all the time.

It's OK to code with assumptions about what some other part of the
code is doing, but it's always good to add checks (in DEBUG mode) to
catch problems if the assumptions change.

 -George

On Tue, Jun 29, 2010 at 7:06 PM, Li, Xin <xin.li@xxxxxxxxx> wrote:
> VMX: remove useless super page recomputing in ept_set_entry.
>
> Caller to ept_set_entry must give a valid order that hardware supports, see 
> set_p2m_entry in p2m.c.
>
> Signed-off-by: Xin Li <xin.li@xxxxxxxxx>
>
> diff -r a6d5b76abdcb xen/arch/x86/mm/hap/p2m-ept.c
> --- a/xen/arch/x86/mm/hap/p2m-ept.c Tue Jun 29 18:20:14 2010 +0100
> +++ b/xen/arch/x86/mm/hap/p2m-ept.c Wed Jun 30 09:59:40 2010 +0800
> @@ -307,18 +307,10 @@
>     }
>     else
>     {
> -        int num = order / EPT_TABLE_ORDER;
>         int level;
>         ept_entry_t *split_ept_entry;
>
> -        if ( (num >= 2) && hvm_hap_has_1gb(d) )
> -            num = 2;
> -        else if ( (num >= 1) && hvm_hap_has_2mb(d) )
> -            num = 1;
> -        else
> -            num = 0;
> -
> -        for ( level = split_level; level > num ; level-- )
> +        for ( level = split_level; level > walk_level ; level-- )
>         {
>             rv = ept_split_large_page(d, &table, &index, gfn, level);
>             if ( !rv )
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

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