WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: Linux Stubdom Problem

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: Linux Stubdom Problem
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Wed, 9 Nov 2011 12:05:38 -0500
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>, "Tim \(Xen.org\)" <tim@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxx>, Keir Fraser <keir.xen@xxxxxxxxx>, Jiageng Yu <yujiageng734@xxxxxxxxx>, Samuel@xxxxxxxxxxxxxxxxxxxx, Thibault <samuel.thibault@xxxxxxxxxxxx>, Konrad@xxxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 09 Nov 2011 12:54:38 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1111081412270.3519@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1109021401000.12963@kaball-desktop> <CA8694A1.20379%keir.xen@xxxxxxxxx> <CAJ0pt17eoZbEnmziLaSd1Cxi+sU90rJ-c8TSgt+ikE3wZj1jhA@xxxxxxxxxxxxxx> <alpine.DEB.2.00.1109151110020.12963@kaball-desktop> <CAJ0pt15daSuXGi_8T3NS53E2Xv0bYV90b94100Wi6ajt99gedQ@xxxxxxxxxxxxxx> <alpine.DEB.2.00.1111081412270.3519@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
> 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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel