Re: [Xen-devel] Re: [PATCH 04/10] xen/mmu: For 1-1 mapping,automatically set _PAGE_IOMAP.

From: Ian Campbell
Date: Wed Dec 22 2010 - 11:28:27 EST


On Wed, 2010-12-22 at 15:02 +0000, Konrad Rzeszutek Wilk wrote:
> On Tue, Dec 21, 2010 at 02:29:31PM -0800, Jeremy Fitzhardinge wrote:
> > On 12/21/2010 01:37 PM, Konrad Rzeszutek Wilk wrote:
> > > @@ -832,6 +832,9 @@ static pteval_t pte_pfn_to_mfn(pteval_t val)
> > > pteval_t flags = val & PTE_FLAGS_MASK;
> > > unsigned long mfn = pfn_to_mfn(pfn);
> > >
> > > + if (mfn == pfn)
> > > + flags |= _PAGE_IOMAP;
> >
> > Why? Does it really make sense to set _PAGE_IOMAP if they just happen
> > to be the same value?
>
> Yes. Without this, user applications, such as 'dmidecode' cannot get
> data.

I think Jeremy's point is that the "mfn == pfn" here has false
positives, since it is possible that a normal RAM page has identical mfn
and pfn by pure chance.

Ian.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/