Jeremy Fitzhardinge
2009-Feb-02 21:58 UTC
[Xen-devel] [PATCH] xen: fix 32-bit build resulting from mmu move
Moving the mmu code from enlighten.c to mmu.c inadvertently broke the 32-bit build. Fix it. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> --- arch/x86/xen/mmu.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) ==================================================================--- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1388,6 +1388,43 @@ #endif } +#ifdef CONFIG_HIGHPTE +static void *xen_kmap_atomic_pte(struct page *page, enum km_type type) +{ + pgprot_t prot = PAGE_KERNEL; + + if (PagePinned(page)) + prot = PAGE_KERNEL_RO; + + if (0 && PageHighMem(page)) + printk("mapping highpte %lx type %d prot %s\n", + page_to_pfn(page), type, + (unsigned long)pgprot_val(prot) & _PAGE_RW ? "WRITE" : "READ"); + + return kmap_atomic_prot(page, type, prot); +} +#endif + +#ifdef CONFIG_X86_32 +static __init pte_t mask_rw_pte(pte_t *ptep, pte_t pte) +{ + /* If there''s an existing pte, then don''t allow _PAGE_RW to be set */ + if (pte_val_ma(*ptep) & _PAGE_PRESENT) + pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) & + pte_val_ma(pte)); + + return pte; +} + +/* Init-time set_pte while constructing initial pagetables, which + doesn''t allow RO pagetable pages to be remapped RW */ +static __init void xen_set_pte_init(pte_t *ptep, pte_t pte) +{ + pte = mask_rw_pte(ptep, pte); + + xen_set_pte(ptep, pte); +} +#endif /* Early in boot, while setting up the initial pagetable, assume everything is pinned. */ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ingo Molnar
2009-Feb-03 12:21 UTC
[Xen-devel] Re: [PATCH] xen: fix 32-bit build resulting from mmu move
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:> Moving the mmu code from enlighten.c to mmu.c inadvertently broke the > 32-bit build. Fix it. > > Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> > --- > arch/x86/xen/mmu.c | 37 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+)that goes on top of the recent tip/x86/paravirt changes, right? No objections, i''m wondering why my testing didnt find any build breakage. Could you send me a .config that triggers the breakage? Ingo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Feb-03 17:14 UTC
[Xen-devel] Re: [PATCH] xen: fix 32-bit build resulting from mmu move
Ingo Molnar wrote:> * Jeremy Fitzhardinge <jeremy@goop.org> wrote: > > >> Moving the mmu code from enlighten.c to mmu.c inadvertently broke the >> 32-bit build. Fix it. >> >> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> >> --- >> arch/x86/xen/mmu.c | 37 +++++++++++++++++++++++++++++++++++++ >> 1 file changed, 37 insertions(+) >> > > that goes on top of the recent tip/x86/paravirt changes, right? No > objections, i''m wondering why my testing didnt find any build breakage. > Could you send me a .config that triggers the breakage? >Any x86-32 + Xen build would hit it. +highmem+highpte would break a bit more. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ingo Molnar
2009-Feb-03 17:36 UTC
[Xen-devel] Re: [PATCH] xen: fix 32-bit build resulting from mmu move
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:> Ingo Molnar wrote: >> * Jeremy Fitzhardinge <jeremy@goop.org> wrote: >> >> >>> Moving the mmu code from enlighten.c to mmu.c inadvertently broke the >>> 32-bit build. Fix it. >>> >>> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> >>> --- >>> arch/x86/xen/mmu.c | 37 +++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 37 insertions(+) >>> >> >> that goes on top of the recent tip/x86/paravirt changes, right? No >> objections, i''m wondering why my testing didnt find any build breakage. >> Could you send me a .config that triggers the breakage? > > Any x86-32 + Xen build would hit it. +highmem+highpte would break a bit > more.i have a lot of successful builds with that pattern, that''s why i asked for a specific config from you that definitely triggers it - i''d like to investigate how it escaped my testing procedures. Ingo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Feb-03 18:05 UTC
[Xen-devel] Re: [PATCH] xen: fix 32-bit build resulting from mmu move
Ingo Molnar wrote:> i have a lot of successful builds with that pattern, that''s why i asked for > a specific config from you that definitely triggers it - i''d like to > investigate how it escaped my testing procedures. >Hm, I don''t see how you could be; the functions are just outright missing. Without the patch, the attached config fails with: $ make ''ARCH=i386'' arch/x86/xen/mmu.o [...] CC arch/x86/xen/mmu.o /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1810: error: ''xen_kmap_atomic_pte'' undeclared here (not in a function) /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1816: error: ''xen_set_pte_init'' undeclared here (not in a function) /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1824: error: initializer element is not constant /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1824: error: (near initialization for ''xen_mmu_ops.pte_val'') /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1825: error: initializer element is not constant /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1825: error: (near initialization for ''xen_mmu_ops.pgd_val'') /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1827: error: initializer element is not constant /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1827: error: (near initialization for ''xen_mmu_ops.make_pte'') /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1828: error: initializer element is not constant /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1828: error: (near initialization for ''xen_mmu_ops.make_pgd'') /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1838: error: initializer element is not constant /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1838: error: (near initialization for ''xen_mmu_ops.make_pmd'') /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1839: error: initializer element is not constant /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1839: error: (near initialization for ''xen_mmu_ops.pmd_val'') make[3]: *** [arch/x86/xen/mmu.o] Error 1 make[2]: *** [arch/x86/xen/mmu.o] Error 2 make[1]: *** [sub-make] Error 2 make: *** [all] Error 2 (The errors from 1824 onwards seem to be spurious.) With the patch the file compiles properly. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ingo Molnar
2009-Feb-03 18:14 UTC
[Xen-devel] Re: [PATCH] xen: fix 32-bit build resulting from mmu move
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:> Ingo Molnar wrote: >> i have a lot of successful builds with that pattern, that''s why i asked >> for a specific config from you that definitely triggers it - i''d like >> to investigate how it escaped my testing procedures. >> > > Hm, I don''t see how you could be; the functions are just outright > missing. Without the patch, the attached config fails with: > > $ make ''ARCH=i386'' arch/x86/xen/mmu.o > [...] > CC arch/x86/xen/mmu.o > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1810: error: ''xen_kmap_atomic_pte'' undeclared here (not in a function) > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1816: error: ''xen_set_pte_init'' undeclared here (not in a function) > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1824: error: initializer element is not constant > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1824: error: (near initialization for ''xen_mmu_ops.pte_val'') > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1825: error: initializer element is not constant > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1825: error: (near initialization for ''xen_mmu_ops.pgd_val'') > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1827: error: initializer element is not constant > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1827: error: (near initialization for ''xen_mmu_ops.make_pte'') > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1828: error: initializer element is not constant > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1828: error: (near initialization for ''xen_mmu_ops.make_pgd'') > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1838: error: initializer element is not constant > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1838: error: (near initialization for ''xen_mmu_ops.make_pmd'') > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1839: error: initializer element is not constant > /home/jeremy/hg/xen/paravirt/linux/arch/x86/xen/mmu.c:1839: error: (near initialization for ''xen_mmu_ops.pmd_val'') > make[3]: *** [arch/x86/xen/mmu.o] Error 1 > make[2]: *** [arch/x86/xen/mmu.o] Error 2 > make[1]: *** [sub-make] Error 2 > make: *** [all] Error 2 >hm, it triggers here too. Maybe the count of 32-bit tests wasnt high enough yet to hit this. Ingo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel