All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Keir Fraser <keir@xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@eu.citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	Jan Beulich <JBeulich@novell.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>
Subject: Re: [PATCH 6/8] xen/debug: WARN_ON when 1-1 but no _PAGE_IOMAP flag set.
Date: Thu, 6 Jan 2011 16:59:52 -0500	[thread overview]
Message-ID: <20110106215952.GB18722@dumpdata.com> (raw)
In-Reply-To: <C94BD3E2.11441%keir@xen.org>

On Thu, Jan 06, 2011 at 08:17:38PM +0000, Keir Fraser wrote:
> On 06/01/2011 19:50, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>
> wrote:
> 
> >> Perhaps this ties in with the m2p overlay which Stefano+Jeremy have been
> >> working on to deal with granted foreign pages? I/O pages are a bit like
> >> foreign memory (if you squint enough)...
> >  
> > In theory the m2p overlay could be used for this purpose but in practice
> > the current m2p overlay API needs a struct page, also it might end up
> > stressing the hashtable too much.
> > 
> > Besides I think Konrad's solution might be simpler: if the m2p returns
> > one of the two special values we just return mfn from pte_mfn_to_pfn.
> > 
> > Keir, could you confirm that the m2p entries of DOM_IO pages are always
> > 0xffffff or 0x55555?
> 
> Always 0x55...55 (for m2p entries that exist), else page fault on access to
> the non-existent m2p entry (m2p entries only guaranteed to exist for ram).
> Perhaps the 0xff...ff values come from Linux's own fixup code handling a
> faulting read access of the m2p array? If so you could return 0x55...55
> instead and avoid checking for 0xff...ff. I really don't know how you could
> get 0xff...ff for non-RAM pages from Xen itself.

The non-RAM pages are assinged to a DOMID_IO (arch_init_memory), for example:

 298     /* First 1MB of RAM is historically marked as I/O. */
 299     for ( i = 0; i < 0x100; i++ )
 300         share_xen_page_with_guest(mfn_to_page(i), dom_io, XENSHARE_writable);

and share_xen_page.. sets that page to INVALID_M2P_ENTRY.

But I could also be reading the code wrongly?

> 
>  -- Keir
> 

  reply	other threads:[~2011-01-06 22:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30 19:48 [PATCH RFC v2] Consider E820 non-RAM and E820 gaps as 1-1 mappings Konrad Rzeszutek Wilk
2010-12-30 19:48 ` Konrad Rzeszutek Wilk
2010-12-30 19:48 ` [PATCH 1/8] xen: Mark all initial reserved pages for the balloon as INVALID_P2M_ENTRY Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2011-01-04 16:34   ` Ian Campbell
2011-01-04 16:34     ` Ian Campbell
2011-01-04 16:45     ` Konrad Rzeszutek Wilk
2010-12-30 19:48 ` [PATCH 2/8] xen/mmu: Add the notion of identity (1-1) mapping Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2011-01-04 16:53   ` Ian Campbell
2011-01-04 16:59     ` Ian Campbell
2011-01-04 17:20       ` [Xen-devel] " Ian Campbell
2011-01-04 19:24     ` Konrad Rzeszutek Wilk
2011-01-05 14:03       ` Ian Campbell
2010-12-30 19:48 ` [PATCH 3/8] xen/setup: Set identity mapping for non-RAM E820 and E820 gaps Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2011-01-04 17:18   ` Ian Campbell
2011-01-04 17:18     ` Ian Campbell
2011-01-04 18:38     ` Konrad Rzeszutek Wilk
2011-01-04 19:27       ` Ian Campbell
2011-01-04 21:28         ` Konrad Rzeszutek Wilk
2011-01-04 21:28           ` Konrad Rzeszutek Wilk
2010-12-30 19:48 ` [PATCH 4/8] xen/mmu: Warn against races Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2010-12-30 19:48 ` [PATCH 5/8] xen/debug: Print out all pages in the P2M Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2010-12-30 19:48 ` [PATCH 6/8] xen/debug: WARN_ON when 1-1 but no _PAGE_IOMAP flag set Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2011-01-04 17:24   ` Ian Campbell
2011-01-04 18:46     ` Konrad Rzeszutek Wilk
2011-01-04 19:20       ` Ian Campbell
2011-01-06 19:50         ` Stefano Stabellini
2011-01-06 20:17           ` Keir Fraser
2011-01-06 21:59             ` Konrad Rzeszutek Wilk [this message]
2011-01-06 22:17               ` Keir Fraser
2010-12-30 19:48 ` [PATCH 7/8] xen/mmu: Introduce IDENTITY_FRAME_BIT Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk
2011-01-04 16:26   ` Ian Campbell
2011-01-04 16:45     ` Konrad Rzeszutek Wilk
2010-12-30 19:48 ` [PATCH 8/8] xen/mmu: Set _PAGE_IOMAP if PFN is in identity P2M Konrad Rzeszutek Wilk
2010-12-30 19:48   ` Konrad Rzeszutek Wilk

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=20110106215952.GB18722@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=JBeulich@novell.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=keir@xen.org \
    --cc=konrad@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.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.