All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: Tim Deegan <Tim.Deegan@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 3 of 4] Nested p2m: clarify logic in p2m_get_nestedp2m()
Date: Fri, 24 Jun 2011 16:25:40 +0200	[thread overview]
Message-ID: <4E049E64.9080908@amd.com> (raw)
In-Reply-To: <b265371addbbc8a58c95.1308759029@whitby.uk.xensource.com>

On 06/22/11 18:10, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan<Tim.Deegan@citrix.com>
> # Date 1308758648 -3600
> # Node ID b265371addbbc8a58c95a269fe3cd0fdc866aaa3
> # Parent  dcb8ae5e3eaf6516c889087dfb15efa41a1ac3e9
> Nested p2m: clarify logic in p2m_get_nestedp2m()
>
> This just makes the behaviour of this function a bit more explicit.  It
> may be that it also needs to be changed. :)
>
> Signed-off-by: Tim Deegan<Tim.Deegan@citrix.com>
>
> 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);

The 'i'' variable is unused then. This fixes an endless loop of
nested page faults I observe with SMP l2 guests.

The nested page fault loop happens in conjunction with the change
in patch 4 in nestedhap_fix_p2m().

Christoph


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

  reply	other threads:[~2011-06-24 14:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 16:10 [PATCH 0 of 4] RFC: Nested-p2m cleanups and locking changes Tim Deegan
2011-06-22 16:10 ` [PATCH 1 of 4] Nested p2m: implement "flush" as a first-class action Tim Deegan
2011-06-23 12:50   ` Christoph Egger
2011-06-23 12:56     ` Christoph Egger
2011-06-23 15:04       ` Christoph Egger
2011-06-23 15:21         ` Christoph Egger
2011-06-24  9:07           ` Tim Deegan
2011-06-22 16:10 ` [PATCH 2 of 4] Nested p2m: remove bogus check of CR3 value Tim Deegan
2011-06-22 16:10 ` [PATCH 3 of 4] Nested p2m: clarify logic in p2m_get_nestedp2m() Tim Deegan
2011-06-24 14:25   ` Christoph Egger [this message]
2011-06-24 14:37     ` Tim Deegan
2011-06-24 14:53       ` Christoph Egger
2011-06-24 15:05         ` Tim Deegan
2011-06-27  9:46           ` Christoph Egger
2011-06-22 16:10 ` [PATCH 4 of 4] Nested p2m: rework locking around nested-p2m flushes and updates Tim Deegan
2011-06-23 15:08   ` Christoph Egger
2011-06-24 10:45     ` Tim Deegan
2011-06-24 11:08       ` Christoph Egger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E049E64.9080908@amd.com \
    --to=christoph.egger@amd.com \
    --cc=Tim.Deegan@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.