From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Re: Linux Stubdom Problem Date: Wed, 9 Nov 2011 12:05:38 -0500 Message-ID: <20111109170538.GA987@phenom.dumpdata.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: Jeremy Fitzhardinge , "xen-devel@lists.xensource.com" , Ian Campbell , "Tim (Xen.org)" , Anthony PERARD , Keir Fraser , Jiageng Yu , Samuel@rcsinet13.oracle.com, Thibault , Konrad@rcsinet13.oracle.com List-Id: xen-devel@lists.xenproject.org > The real fix should something along these lines: > > > > diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c > index 3dd53f9..f2fadfc 100644 > --- a/arch/x86/xen/mmu.c > +++ b/arch/x86/xen/mmu.c > @@ -422,7 +422,7 @@ static pteval_t xen_pte_val(pte_t pte) > pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT; > } > > - if (xen_initial_domain() && (pteval & _PAGE_IOMAP)) > + if (pteval & _PAGE_IOMAP) > return pteval; > > return pte_mfn_to_pfn(pteval); > @@ -483,8 +483,7 @@ static pte_t xen_make_pte(pteval_t pte) > * mappings are just dummy local mappings to keep other > * parts of the kernel happy. > */ > - if (unlikely(pte & _PAGE_IOMAP) && > - (xen_initial_domain() || addr >= ISA_END_ADDRESS)) { > + if (unlikely(pte & _PAGE_IOMAP)) { > pte = iomap_pte(pte); > } else { > pte &= ~_PAGE_IOMAP; > --- > > Could you please confirm whether this patch fixes your problem? > > Konrad, do you know if this could have any unintended consequences? > I don't think it can be a problem security wise because Xen is going to > do all the permission checks anyway. > The only problem I can see is if a domU is going to call xen_make_pte > with _PAGE_IOMAP and a pfn->mfn translation is supposed to happen. I am not sure. I think I tried this at some point but ran in some problems, but I can't recall which ones. Let me stick this in my #testing branch and see how it fares with Dom0/DomU/DomU PCI/ etc.