Skip to content

Commit

Permalink
x86/paravirt: call paravirt_pagetable_setup_{start, done}
Browse files Browse the repository at this point in the history
Call paravirt_pagetable_setup_{start,done}

These paravirt_ops functions were not being called on x86_64.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Eduardo Habkost authored and Ingo Molnar committed Jul 16, 2008
1 parent 4515889 commit a312b37
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <asm/desc.h>
#include <asm/setup.h>
#include <asm/arch_hooks.h>
#include <asm/pgtable.h>
#include <asm/time.h>
#include <asm/pgalloc.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -373,6 +374,9 @@ struct pv_mmu_ops pv_mmu_ops = {
#ifndef CONFIG_X86_64
.pagetable_setup_start = native_pagetable_setup_start,
.pagetable_setup_done = native_pagetable_setup_done,
#else
.pagetable_setup_start = paravirt_nop,
.pagetable_setup_done = paravirt_nop,
#endif

.read_cr2 = native_read_cr2,
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,9 @@ void __init setup_arch(char **cmdline_p)
vmi_init();
#endif

paravirt_pagetable_setup_start(swapper_pg_dir);
paging_init();
paravirt_pagetable_setup_done(swapper_pg_dir);

#ifdef CONFIG_X86_64
map_vsyscall();
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)

static __init void xen_pagetable_setup_start(pgd_t *base)
{
#ifdef CONFIG_X86_32
pgd_t *xen_pgd = (pgd_t *)xen_start_info->pt_base;
int i;

Expand Down Expand Up @@ -886,6 +887,7 @@ static __init void xen_pagetable_setup_start(pgd_t *base)
/* Unpin initial Xen pagetable */
pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
PFN_DOWN(__pa(xen_start_info->pt_base)));
#endif /* CONFIG_X86_32 */
}

void xen_setup_shared_info(void)
Expand Down Expand Up @@ -927,9 +929,11 @@ static __init void xen_pagetable_setup_done(pgd_t *base)

xen_setup_shared_info();

#ifdef CONFIG_X86_32
/* Actually pin the pagetable down, but we can't set PG_pinned
yet because the page structures don't exist yet. */
pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(base)));
#endif
}

static __init void xen_post_allocator_init(void)
Expand Down
18 changes: 18 additions & 0 deletions include/asm-x86/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
/* Install a pte for a particular vaddr in kernel space. */
void set_pte_vaddr(unsigned long vaddr, pte_t pte);

#ifdef CONFIG_X86_32
extern void native_pagetable_setup_start(pgd_t *base);
extern void native_pagetable_setup_done(pgd_t *base);
#else
static inline void native_pagetable_setup_start(pgd_t *base) {}
static inline void native_pagetable_setup_done(pgd_t *base) {}
#endif

#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#else /* !CONFIG_PARAVIRT */
Expand Down Expand Up @@ -333,6 +341,16 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte);

#define pte_update(mm, addr, ptep) do { } while (0)
#define pte_update_defer(mm, addr, ptep) do { } while (0)

static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
{
native_pagetable_setup_start(base);
}

static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
{
native_pagetable_setup_done(base);
}
#endif /* CONFIG_PARAVIRT */

#endif /* __ASSEMBLY__ */
Expand Down
15 changes: 0 additions & 15 deletions include/asm-x86/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,6 @@ do { \
*/
#define update_mmu_cache(vma, address, pte) do { } while (0)

extern void native_pagetable_setup_start(pgd_t *base);
extern void native_pagetable_setup_done(pgd_t *base);

#ifndef CONFIG_PARAVIRT
static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
{
native_pagetable_setup_start(base);
}

static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
{
native_pagetable_setup_done(base);
}
#endif /* !CONFIG_PARAVIRT */

#endif /* !__ASSEMBLY__ */

/*
Expand Down

0 comments on commit a312b37

Please sign in to comment.