ia64/xen-unstable

changeset 6351:a0b4156cc0ce

Ensure cur_pgd per-cpu variables are initialised early.
Secondary VCPUs can take page faults immediately after
booting, because of writable pagetable logic.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Aug 23 17:29:46 2005 +0000 (2005-08-23)
parents f80278e5e440
children 67a530b01542
files linux-2.6-xen-sparse/arch/xen/i386/mm/init.c linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Tue Aug 23 17:28:53 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Tue Aug 23 17:29:46 2005 +0000
     1.3 @@ -348,9 +348,12 @@ static void __init pagetable_init (void)
     1.4  {
     1.5  	unsigned long vaddr;
     1.6  	pgd_t *pgd_base = (pgd_t *)xen_start_info.pt_base;
     1.7 +	int i;
     1.8  
     1.9  	swapper_pg_dir = pgd_base;
    1.10  	init_mm.pgd    = pgd_base;
    1.11 +	for (i = 0; i < NR_CPUS; i++)
    1.12 +		per_cpu(cur_pgd, i) = pgd_base;
    1.13  
    1.14  	/* Enable PSE if available */
    1.15  	if (cpu_has_pse) {
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c	Tue Aug 23 17:28:53 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c	Tue Aug 23 17:29:46 2005 +0000
     2.3 @@ -559,6 +559,11 @@ static void xen_copy_pt(void)
     2.4  
     2.5  void __init xen_init_pt(void)
     2.6  {
     2.7 +	int i;
     2.8 +
     2.9 +	for (i = 0; i < NR_CPUS; i++)
    2.10 +		per_cpu(cur_pgd, i) = init_mm.pgd;
    2.11 +
    2.12  	memcpy((void *)init_level4_pgt, 
    2.13  	       (void *)xen_start_info.pt_base, PAGE_SIZE);
    2.14