xen-devel
[Xen-devel] Re: [PATCH 2/4] x86,xen: introduce x86_init.mapping.pagetabl
To: |
Yinghai Lu <yinghai@xxxxxxxxxx> |
Subject: |
[Xen-devel] Re: [PATCH 2/4] x86,xen: introduce x86_init.mapping.pagetable_reserve |
From: |
Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> |
Date: |
Wed, 13 Apr 2011 11:35:25 +0100 |
Cc: |
"jeremy@xxxxxxxx" <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, "mingo@xxxxxxx" <mingo@xxxxxxx>, "hpa@xxxxxxxxxxxxxxx" <hpa@xxxxxxxxxxxxxxx> |
Delivery-date: |
Wed, 13 Apr 2011 03:35:30 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<4DA48EA9.70109@xxxxxxxxxx> |
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.1104121149280.22672@kaball-desktop> <1302607192-21355-2-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <4DA48EA9.70109@xxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Tue, 12 Apr 2011, Yinghai Lu wrote:
> > diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> > index 6b833db..fec8680 100644
> > --- a/arch/x86/xen/mmu.c
> > +++ b/arch/x86/xen/mmu.c
> > @@ -1275,6 +1275,20 @@ static __init void xen_pagetable_setup_start(pgd_t
> > *base)
> > {
> > }
> >
> > +static __init void xen_mapping_pagetable_reserve(u64 start, u64 end)
> > +{
> > + /* reserve the range used */
> > + memblock_x86_reserve_range(start, end, "PGTABLE");
> > +
> > + /* set as RW the rest */
> > + printk(KERN_DEBUG "xen: setting RW the range %llx - %llx\n", end,
> > + PFN_PHYS(pgt_buf_top));
> > + while (end< PFN_PHYS(pgt_buf_top)) {
> > + make_lowmem_page_readwrite(__va(end));
> > + end += PAGE_SIZE;
> > + }
> > +}
> > +
>
> it would be more cleaner to xen code if you make mark start/end to RO, and
> not make them all before as RO.
Yes, that would be ideal, but we cannot do that because we don't know
exactly where is pgt_buf_end before allocating the pagetable pages and
the pagetable pages need to be marked RO before being hooked into the
pagetable. This is why we mark the whole range RO and after the
pagetable allocation when we know for sure where is pgt_buf_end we
modify the range pgt_buf_end-pgt_buf_top to RW.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
[Xen-devel] [PATCH 2/4] x86, xen: introduce x86_init.mapping.pagetable_reserve, stefano . stabellini
[Xen-devel] Re: [PATCH 2/4] x86,xen: introduce x86_init.mapping.pagetable_reserve, Konrad Rzeszutek Wilk
[Xen-devel] Re: [PATCH 2/4] x86, xen: introduce x86_init.mapping.pagetable_reserve, H. Peter Anvin
[Xen-devel] Re: [PATCH 2/4] x86,xen: introduce x86_init.mapping.pagetable_reserve, Konrad Rzeszutek Wilk
[Xen-devel] Re: [PATCH 2/4] x86, xen: introduce x86_init.mapping.pagetable_reserve, H. Peter Anvin
|
|
|