xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tamas Lengyel <tamas.lengyel@zentific.com>
To: George Dunlap <george.dunlap@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2] xen/p2m: Fix p2m_flush_table for non-nested cases
Date: Wed, 8 Feb 2017 14:42:46 -0700	[thread overview]
Message-ID: <CABfawhmRfrKJ2nUjs9DCni_ASYKLv2V2gePOfKiSXRVq4J3mQg@mail.gmail.com> (raw)
In-Reply-To: <9e271c59-0d6c-8b53-1448-16afe64e3b2b@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 1955 bytes --]

On Wed, Feb 8, 2017 at 11:12 AM, George Dunlap <george.dunlap@citrix.com>
wrote:

> On 08/02/17 17:29, Tim Deegan wrote:
> > At 17:22 +0000 on 08 Feb (1486574546), George Dunlap wrote:
> >> Commit 71bb7304e7a7a35ea6df4b0cedebc35028e4c159 added flushing of
> >> nested p2m tables whenever the host p2m table changed.  Unfortunately
> >> in the process, it added a filter to p2m_flush_table() function so
> >> that the p2m would only be flushed if it was being used as a nested
> >> p2m.  This meant that the p2m was not being flushed at all for altp2m
> >> callers.
> >>
> >> Only check np2m_base if p2m_class is set to p2m_nested.
> >>
> >> NB that this is not a security issue: The only time this codepath is
> >> called is in cases where either nestedp2m or altp2m is enabled, and
> >> neither of them are in security support.
> >>
> >> Reported-by: Matt Leinhos <matt@starlab.io>
> >> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> >> CC: Tamas K Lengyel <tamas.lengyel@zentific.com>
> >> ---
> >>  xen/arch/x86/mm/p2m.c | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
> >> index 6548e9f..0af2ec1 100644
> >> --- a/xen/arch/x86/mm/p2m.c
> >> +++ b/xen/arch/x86/mm/p2m.c
> >> @@ -1627,7 +1627,9 @@ p2m_flush_table(struct p2m_domain *p2m)
> >>      ASSERT(page_list_empty(&p2m->pod.super));
> >>      ASSERT(page_list_empty(&p2m->pod.single));
> >>
> >> -    if ( p2m->np2m_base == P2M_BASE_EADDR )
> >> +    /* No need to flush if it's already empty */
> >> +    if ( p2m->p2m_class == p2m_nested &&
> >> +         p2m->np2m_base == P2M_BASE_EADDR )
> >
> > Looks like p2m_is_nestedp2m(p2m) is the usual idiom.  Either way:
> >
> > Reviewed-by: Tim Deegan <tim@xen.org>
>
> Right -- I'll change it to the usual idiom and check it in after I've
> gotten a test report (or waited a reasonable amount of time).


Tested-by: Tamas K Lengyel <tamas@tklengyel.com>

[-- Attachment #1.2: Type: text/html, Size: 2976 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

      reply	other threads:[~2017-02-08 21:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 17:22 [PATCH v2] xen/p2m: Fix p2m_flush_table for non-nested cases George Dunlap
2017-02-08 17:29 ` Tim Deegan
2017-02-08 18:12   ` George Dunlap
2017-02-08 21:42     ` Tamas Lengyel [this message]

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=CABfawhmRfrKJ2nUjs9DCni_ASYKLv2V2gePOfKiSXRVq4J3mQg@mail.gmail.com \
    --to=tamas.lengyel@zentific.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).