# HG changesets 15130+15170 patch # User Ian Campbell # Node ID a40967e39652fee1edebfddec4b533bdded923a1 # Parent f6928d6369999cd063edd361d592579c2483196b Subject: LINUX/x86_64: Ensure that the initial page tables allow userspace mappings of the vsyscall page. This matches native behaviour by setting the U bit on the L2-L4 page table entries and controlling access using the L1 entries. Signed-off-by: Ian Campbell LINUX/x86_64: Cleanup 15129:a40967e39652 by using __pgd rather than abusing mk_kernel_pgd. Also set the user bit on the vsyscall entry in the user pgd. Both changes suggested by Jan Beulich. Signed-off-by: Ian Campbell Acked-by: jbeulich@novell.com --- arch/x86_64/mm/init-xen.c | 2 +- include/asm-x86_64/mach-xen/asm/pgalloc.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/arch/x86_64/mm/init-xen.c 2007-08-27 14:01:25.000000000 -0400 +++ b/arch/x86_64/mm/init-xen.c 2007-08-27 14:02:03.000000000 -0400 @@ -580,7 +580,7 @@ void __init xen_init_pt(void) /* Construct mapping of initial pte page in our own directories. */ init_level4_pgt[pgd_index(__START_KERNEL_map)] = - mk_kernel_pgd(__pa_symbol(level3_kernel_pgt)); + __pgd(__pa_symbol(level3_kernel_pgt) | _PAGE_TABLE); level3_kernel_pgt[pud_index(__START_KERNEL_map)] = __pud(__pa_symbol(level2_kernel_pgt) | _KERNPG_TABLE); --- a/include/asm-x86_64/mach-xen/asm/pgalloc.h 2007-08-27 14:01:25.000000000 -0400 +++ b/include/asm-x86_64/mach-xen/asm/pgalloc.h 2007-08-27 14:01:58.000000000 -0400 @@ -146,8 +146,8 @@ static inline pgd_t *pgd_alloc(struct mm /* * Set level3_user_pgt for vsyscall area */ - set_pgd(__user_pgd(pgd) + pgd_index(VSYSCALL_START), - mk_kernel_pgd(__pa_symbol(level3_user_pgt))); + set_pgd(__user_pgd(pgd) + pgd_index(VSYSCALL_START), + __pgd(__pa_symbol(level3_user_pgt) | _PAGE_TABLE)); return pgd; }