xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Keir Fraser <keir.xen@gmail.com>,
	"Tim Deegan (3P)" <Tim.Deegan@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: HYBRID: max_mapped_pfn in ept_set_entry()
Date: Thu, 29 Mar 2012 10:56:14 +0100	[thread overview]
Message-ID: <20120329095614.GA72859@ocelot.phlegethon.org> (raw)
In-Reply-To: <1333013354.18810.54.camel@zakaz.uk.xensource.com>

At 10:29 +0100 on 29 Mar (1333016954), Ian Campbell wrote:
> On Thu, 2012-03-29 at 01:08 +0100, Mukesh Rathor wrote:
> > I'm trying to figure the right thing to do here. Should I just change
> > the "gfn > p2m->max_mapped_pfn" in ept_get_entry() to check for
> > INVALID_MFN? I really shouldn't be adjusting max_mapped_pfn for MMIO
> > pages, right?
> 
> I'm no expert on the p2m side of things but ept_get_entry says:
>     /* This pfn is higher than the highest the p2m map currently holds */
>     if ( gfn > p2m->max_mapped_pfn )
>         goto out;
> 
> which suggests to me that this is just an optimisation (skipping a
> lookup which can never succeed) and therefore it is appropriate to
> update max_mapped_pfn. After all a 1-1 mapped pfn is still a pfn.

Yes, you should adjust max_mapped_pfn, in ept_set_entry() and in
p2m_set_entry() (p2m-pt.c) so we don't get the same bug reappearing
on AMD.  Instead of checking mfn_valid(), they should check 
(p2mt != p2m_invalid && p2mt != p2m_mmio_dm).

> Other places, like ept_walk_table seem to make a similar optimisation. 
> 
> Unless there is some reason to assume that these functions will never be
> passed an MMIO pfn?

No - it's just that this check predates anything other than RAM and
emulated MMIO.

Tim.

      reply	other threads:[~2012-03-29  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  0:08 HYBRID: max_mapped_pfn in ept_set_entry() Mukesh Rathor
2012-03-29  9:29 ` Ian Campbell
2012-03-29  9:56   ` Tim Deegan [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=20120329095614.GA72859@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=Tim.Deegan@citrix.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=keir.xen@gmail.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 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).