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

[Xen-devel] Re: [PATCH 3 of 4] Nested p2m: clarify logic in p2m_get_nest

To: Christoph Egger <Christoph.Egger@xxxxxxx>
Subject: [Xen-devel] Re: [PATCH 3 of 4] Nested p2m: clarify logic in p2m_get_nestedp2m()
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Fri, 24 Jun 2011 15:37:26 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 24 Jun 2011 07:40:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E049E64.9080908@xxxxxxx>
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.1308759026@xxxxxxxxxxxxxxxxxxxxxxx> <b265371addbbc8a58c95.1308759029@xxxxxxxxxxxxxxxxxxxxxxx> <4E049E64.9080908@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
At 15:25 +0100 on 24 Jun (1308929140), Christoph Egger wrote:
> > diff -r dcb8ae5e3eaf -r b265371addbb xen/arch/x86/mm/p2m.c
> > --- a/xen/arch/x86/mm/p2m.c Wed Jun 22 17:04:08 2011 +0100
> > +++ b/xen/arch/x86/mm/p2m.c Wed Jun 22 17:04:08 2011 +0100
> > @@ -1131,11 +1131,9 @@ p2m_get_nestedp2m(struct vcpu *v, uint64
> >
> >       d = v->domain;
> >       nestedp2m_lock(d);
> > -    for (i = 0; i<  MAX_NESTEDP2M; i++) {
> > -        p2m = d->arch.nested_p2m[i];
> > -        if ((p2m->cr3 != cr3&&  p2m->cr3 != CR3_EADDR) || (p2m != 
> > nv->nv_p2m))
> > -            continue;
> > -
> > +    p2m = nv->nv_p2m;
> > +    if ( p2m&&  (p2m->cr3 == cr3 || p2m->cr3 == CR3_EADDR) )
> > +    {
> >           nv->nv_flushp2m = 0;
> >           p2m_getlru_nestedp2m(d, p2m);
> >           nv->nv_p2m = p2m;
> >
> 
> 
> Ok, thanks.
> 
> In p2m_get_nestedp2m() replace this code hunk
> 
>      for (i = 0; i < MAX_NESTEDP2M; i++) {
>          p2m = p2m_getlru_nestedp2m(d, NULL);
>          p2m_flush_locked(p2m);
>      }
> 
> with
> 
>      p2m = p2m_getlru_nestedp2m(d, NULL);
>      p2m_flush_locked(p2m);

That seems like an improvement.  I'll put it into my queue.  

More generally, I think that you need to figure out exactly what
behaviour you want from this function.  For example in the current code
there's no way that two vcpus with the same ncr3 value can share a
nested-p2m.  Is that deliberate?

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>