ia64/xen-unstable

changeset 4684:a71203a12503

bitkeeper revision 1.1159.258.107 (4270fc89Gyl1f0UFludQff4kq09XvQ)

reboot.c, init.c, hypervisor.h, evtchn.h, tlbflush.h, pgtable-2level.h:
sync w/ unstable.
system.h:
Fix typo.
pgtable.h, fixup.c, irq.c, direct.c, timer_tsc.c, pci-dma.c, init.c, fault.c:
Cleanup whitespace.
page.h:
Turn __pte and __pgd into #define's like the original definitions.
Add casts to unsigned long for phys_to_machine_mapping and
machine_to_phys_mapping.
fixmap.h, Makefile:
gnttab is not used in 2.0.
.del-gnttab.c~4461d10e936c37ab:
Delete: linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c
.del-gnttab.h~974eaf5d22418ecd:
Delete: linux-2.6.11-xen-sparse/include/asm-xen/gnttab.h
setup.c:
Add panic notification handler.
Change phys_to_machine_mapping from unsigned long * to unsigned int *.
Whitespace cleanups.
page.h:
Change phys_to_machine_mapping from unsigned long * to unsigned int *.
process.c:
UTSNAME -> system_utsname.release as in plain Linux.
Disable preemption before reading smp_processor_id.
head.S:
sync w/ unstable for maintenance -- backport SMP-guest support bits.
Break __xen_guest definition up in several lines.
ldt.c, desc.h, common.c:
Move queue flush into load_LDT().
common.c:
g/c unused code.
Kconfig:
Fix whitespace for microcode option.
author cl349@firebug.cl.cam.ac.uk
date Thu Apr 28 15:08:57 2005 +0000 (2005-04-28)
parents 86510b27bbf0
children 0f620bc56828
files .rootkeys linux-2.6.11-xen-sparse/arch/xen/i386/Kconfig linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c linux-2.6.11-xen-sparse/arch/xen/i386/mm/fault.c linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.11-xen-sparse/arch/xen/i386/pci/direct.c linux-2.6.11-xen-sparse/arch/xen/i386/pci/irq.c linux-2.6.11-xen-sparse/arch/xen/kernel/Makefile linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/desc.h linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/fixmap.h linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/tlbflush.h linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h linux-2.6.11-xen-sparse/include/asm-xen/gnttab.h linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h
line diff
     1.1 --- a/.rootkeys	Sat Apr 23 16:00:42 2005 +0000
     1.2 +++ b/.rootkeys	Thu Apr 28 15:08:57 2005 +0000
     1.3 @@ -246,7 +246,6 @@ 40f56239bvOjuuuViZ0XMlNiREFC0A linux-2.6
     1.4  41ab6fa06JdF7jxUsuDcjN3UhuIAxg linux-2.6.11-xen-sparse/arch/xen/kernel/devmem.c
     1.5  40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c
     1.6  4110f478aeQWllIN7J4kouAHiAqrPw linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c
     1.7 -412dfae9eA3_6e6bCGUtg1mj8b56fQ linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c
     1.8  40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c
     1.9  414c113396tK1HTVeUalm3u-1DF16g linux-2.6.11-xen-sparse/arch/xen/kernel/skbuff.c
    1.10  3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.11-xen-sparse/arch/xen/kernel/xen_proc.c
    1.11 @@ -314,7 +313,6 @@ 41af4017PDMuSmMWtSRU5UC9Vylw5g linux-2.6
    1.12  40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.11-xen-sparse/include/asm-xen/ctrl_if.h
    1.13  40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h
    1.14  419b4e9367PjTEvdjwavWN12BeBBXg linux-2.6.11-xen-sparse/include/asm-xen/foreign_page.h
    1.15 -412dfaeazclyNDM0cpnp60Yo4xulpQ linux-2.6.11-xen-sparse/include/asm-xen/gnttab.h
    1.16  40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h
    1.17  3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h
    1.18  3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.6.11-xen-sparse/include/asm-xen/linux-public/suspend.h
     2.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/Kconfig	Sat Apr 23 16:00:42 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/Kconfig	Thu Apr 28 15:08:57 2005 +0000
     2.3 @@ -456,22 +456,22 @@ config PREEMPT_BKL
     2.4  #	   enters thermal throttling.
     2.5  
     2.6  config MICROCODE
     2.7 -	 tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
     2.8 +	tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
     2.9  	 depends on XEN_PRIVILEGED_GUEST
    2.10 -	 ---help---
    2.11 -	   If you say Y here and also to "/dev file system support" in the
    2.12 -	   'File systems' section, you will be able to update the microcode on
    2.13 -	   Intel processors in the IA32 family, e.g. Pentium Pro, Pentium II,
    2.14 -	   Pentium III, Pentium 4, Xeon etc.  You will obviously need the
    2.15 -	   actual microcode binary data itself which is not shipped with the
    2.16 -	   Linux kernel.
    2.17 +	---help---
    2.18 +	  If you say Y here and also to "/dev file system support" in the
    2.19 +	  'File systems' section, you will be able to update the microcode on
    2.20 +	  Intel processors in the IA32 family, e.g. Pentium Pro, Pentium II,
    2.21 +	  Pentium III, Pentium 4, Xeon etc.  You will obviously need the
    2.22 +	  actual microcode binary data itself which is not shipped with the
    2.23 +	  Linux kernel.
    2.24  
    2.25 -	   For latest news and information on obtaining all the required
    2.26 -	   ingredients for this driver, check:
    2.27 -	   <http://www.urbanmyth.org/microcode/>.
    2.28 +	  For latest news and information on obtaining all the required
    2.29 +	  ingredients for this driver, check:
    2.30 +	  <http://www.urbanmyth.org/microcode/>.
    2.31  
    2.32 -	   To compile this driver as a module, choose M here: the
    2.33 -	   module will be called microcode.
    2.34 +	  To compile this driver as a module, choose M here: the
    2.35 +	  module will be called microcode.
    2.36  
    2.37  #config X86_MSR
    2.38  #	 tristate "/dev/cpu/*/msr - Model-specific register support"
     3.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Sat Apr 23 16:00:42 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Thu Apr 28 15:08:57 2005 +0000
     3.3 @@ -598,21 +598,10 @@ void __init cpu_init (void)
     3.4  	}
     3.5  
     3.6  	/*
     3.7 -	 * Initialize the per-CPU GDT with the boot GDT,
     3.8 -	 * and set up the GDT descriptor:
     3.9 -	 */
    3.10 -	if (cpu) {
    3.11 -		cpu_gdt_descr[cpu].size = GDT_SIZE;
    3.12 -		cpu_gdt_descr[cpu].address = 0;	/* XXXcl alloc page */
    3.13 -		BUG();		/* XXXcl SMP */
    3.14 -		memcpy((void *)cpu_gdt_descr[cpu].address,
    3.15 -		    (void *)cpu_gdt_descr[0].address, GDT_SIZE);
    3.16 -	}
    3.17 -	/*
    3.18  	 * Set up the per-thread TLS descriptor cache:
    3.19  	 */
    3.20  	memcpy(thread->tls_array, &get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN],
    3.21 -	    GDT_ENTRY_TLS_ENTRIES * 8);
    3.22 +	       GDT_ENTRY_TLS_ENTRIES * 8);
    3.23  
    3.24  	cpu_gdt_init(&cpu_gdt_descr[cpu]);
    3.25  
    3.26 @@ -633,7 +622,6 @@ void __init cpu_init (void)
    3.27  	load_esp0(t, thread);
    3.28  
    3.29  	load_LDT(&init_mm.context);
    3.30 -	flush_page_update_queue();
    3.31  
    3.32  	/* Clear %fs and %gs. */
    3.33  	asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
     4.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S	Sat Apr 23 16:00:42 2005 +0000
     4.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S	Thu Apr 28 15:08:57 2005 +0000
     4.3 @@ -2,7 +2,9 @@
     4.4  #include <linux/config.h>
     4.5  
     4.6  .section __xen_guest
     4.7 -	.ascii	"GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=2.0,VIRT_BASE=0xC0000000"
     4.8 +	.ascii	"GUEST_OS=linux,GUEST_VER=2.6"
     4.9 +	.ascii	",XEN_VER=2.0"
    4.10 +	.ascii	",VIRT_BASE=0xC0000000"
    4.11  	.ascii	",LOADER=generic"
    4.12  	.ascii	",PT_MODE_WRITABLE"
    4.13  	.byte	0
    4.14 @@ -31,14 +33,19 @@
    4.15  ENTRY(startup_32)
    4.16  	cld
    4.17  
    4.18 -	/* Set up the stack pointer */
    4.19 -	lss stack_start,%esp
    4.20 -
    4.21  	/* Copy the necessary stuff from xen_start_info structure. */
    4.22  	mov  $xen_start_info_union,%edi
    4.23  	mov  $128,%ecx
    4.24  	rep movsl
    4.25  
    4.26 +#ifdef CONFIG_SMP
    4.27 +ENTRY(startup_32_smp)
    4.28 +	cld
    4.29 +#endif /* CONFIG_SMP */
    4.30 +
    4.31 +	/* Set up the stack pointer */
    4.32 +	lss stack_start,%esp
    4.33 +
    4.34  checkCPUtype:
    4.35  
    4.36  	/* get vendor info */
    4.37 @@ -61,11 +68,22 @@ checkCPUtype:
    4.38  	movb %cl,X86_MASK
    4.39  	movl %edx,X86_CAPABILITY
    4.40  
    4.41 -	xorl %eax,%eax		# Clear FS/GS and LDT
    4.42 +	incb ready
    4.43 +
    4.44 +	xorl %eax,%eax			# Clear FS/GS and LDT
    4.45  	movl %eax,%fs
    4.46  	movl %eax,%gs
    4.47 -	cld		# gcc2 wants the direction flag cleared at all times
    4.48 +	cld			# gcc2 wants the direction flag cleared at all times
    4.49  
    4.50 +#ifdef CONFIG_SMP
    4.51 +	movb ready, %cl	
    4.52 +	cmpb $1,%cl
    4.53 +	je 1f			# the first CPU calls start_kernel
    4.54 +				# all other CPUs call initialize_secondary
    4.55 +	call initialize_secondary
    4.56 +	jmp L6
    4.57 +1:
    4.58 +#endif /* CONFIG_SMP */
    4.59  	call start_kernel
    4.60  L6:
    4.61  	jmp L6			# main should never return here, but
    4.62 @@ -88,6 +106,8 @@ ENTRY(stack_start)
    4.63  	.long init_thread_union+THREAD_SIZE
    4.64  	.long __BOOT_DS
    4.65  
    4.66 +ready:	.byte 0
    4.67 +
    4.68  .globl idt_descr
    4.69  .globl cpu_gdt_descr
    4.70  
     5.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c	Sat Apr 23 16:00:42 2005 +0000
     5.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c	Thu Apr 28 15:08:57 2005 +0000
     5.3 @@ -22,10 +22,8 @@
     5.4  #ifdef CONFIG_SMP /* avoids "defined but not used" warnig */
     5.5  static void flush_ldt(void *null)
     5.6  {
     5.7 -	if (current->active_mm) {
     5.8 +	if (current->active_mm)
     5.9  		load_LDT(&current->active_mm->context);
    5.10 -		flush_page_update_queue();
    5.11 -	}
    5.12  }
    5.13  #endif
    5.14  
    5.15 @@ -64,7 +62,6 @@ static int alloc_ldt(mm_context_t *pc, i
    5.16  		make_pages_readonly(pc->ldt, (pc->size * LDT_ENTRY_SIZE) /
    5.17  				    PAGE_SIZE);
    5.18  		load_LDT(pc);
    5.19 -		flush_page_update_queue();
    5.20  #ifdef CONFIG_SMP
    5.21  		mask = cpumask_of_cpu(smp_processor_id());
    5.22  		if (!cpus_equal(current->mm->cpu_vm_mask, mask))
     6.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Sat Apr 23 16:00:42 2005 +0000
     6.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Thu Apr 28 15:08:57 2005 +0000
     6.3 @@ -49,11 +49,11 @@ xen_contig_memory(unsigned long vstart, 
     6.4  
     6.5  	/* 1. Zap current PTEs, giving away the underlying pages. */
     6.6  	for (i = 0; i < (1<<order); i++) {
     6.7 -		pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
     6.8 -		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
     6.9 -		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
    6.10 -		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
    6.11 -		pfn = pte->pte_low >> PAGE_SHIFT;
    6.12 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
    6.13 +		pud = pud_offset(pgd, vstart + (i*PAGE_SIZE));
    6.14 +		pmd = pmd_offset(pud, vstart + (i*PAGE_SIZE));
    6.15 +		pte = pte_offset_kernel(pmd, vstart + (i*PAGE_SIZE));
    6.16 +		pfn = pte_val_ma(*pte) >> PAGE_SHIFT;
    6.17  		queue_l1_entry_update(pte, 0);
    6.18  		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
    6.19  			INVALID_P2M_ENTRY;
    6.20 @@ -66,21 +66,19 @@ xen_contig_memory(unsigned long vstart, 
    6.21  				  &pfn, 1, order) != 1) BUG();
    6.22  	/* 3. Map the new extent in place of old pages. */
    6.23  	for (i = 0; i < (1<<order); i++) {
    6.24 -		pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
    6.25 -		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
    6.26 -		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
    6.27 -		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
    6.28 -		queue_l1_entry_update(
    6.29 -			pte, ((pfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL);
    6.30 -		queue_machphys_update(
    6.31 -			pfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
    6.32 -		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
    6.33 -			pfn+i;
    6.34 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
    6.35 +		pud = pud_offset(pgd, vstart + (i*PAGE_SIZE));
    6.36 +		pmd = pmd_offset(pud, vstart + (i*PAGE_SIZE));
    6.37 +		pte = pte_offset_kernel(pmd, vstart + (i*PAGE_SIZE));
    6.38 +		queue_l1_entry_update(pte,
    6.39 +				      ((pfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL);
    6.40 +		queue_machphys_update(pfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
    6.41 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = pfn+i;
    6.42  	}
    6.43  	/* Flush updates through and flush the TLB. */
    6.44  	xen_tlb_flush();
    6.45  
    6.46 -        balloon_unlock(flags);
    6.47 +	balloon_unlock(flags);
    6.48  }
    6.49  
    6.50  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    6.51 @@ -125,14 +123,13 @@ void *dma_alloc_coherent(struct device *
    6.52  
    6.53  	vstart = __get_free_pages(gfp, order);
    6.54  	ret = (void *)vstart;
    6.55 -	if (ret == NULL)
    6.56 -		return ret;
    6.57  
    6.58 -	xen_contig_memory(vstart, order);
    6.59 +	if (ret != NULL) {
    6.60 +		xen_contig_memory(vstart, order);
    6.61  
    6.62 -	memset(ret, 0, size);
    6.63 -	*dma_handle = virt_to_bus(ret);
    6.64 -
    6.65 +		memset(ret, 0, size);
    6.66 +		*dma_handle = virt_to_bus(ret);
    6.67 +	}
    6.68  	return ret;
    6.69  }
    6.70  
     7.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c	Sat Apr 23 16:00:42 2005 +0000
     7.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c	Thu Apr 28 15:08:57 2005 +0000
     7.3 @@ -94,10 +94,11 @@ EXPORT_SYMBOL(enable_hlt);
     7.4  extern int set_timeout_timer(void);
     7.5  void xen_idle(void)
     7.6  {
     7.7 -	int cpu = smp_processor_id();
     7.8 +	int cpu;
     7.9  
    7.10  	local_irq_disable();
    7.11  
    7.12 +	cpu = smp_processor_id();
    7.13  	if (rcu_pending(cpu))
    7.14  		rcu_check_callbacks(cpu, 0);
    7.15  
    7.16 @@ -167,7 +168,7 @@ void show_regs(struct pt_regs * regs)
    7.17  	if (regs->xcs & 2)
    7.18  		printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
    7.19  	printk(" EFLAGS: %08lx    %s  (%s)\n",
    7.20 -	       regs->eflags, print_tainted(),UTS_RELEASE);
    7.21 +	       regs->eflags, print_tainted(), system_utsname.release);
    7.22  	printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
    7.23  		regs->eax,regs->ebx,regs->ecx,regs->edx);
    7.24  	printk("ESI: %08lx EDI: %08lx EBP: %08lx",
     8.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c	Sat Apr 23 16:00:42 2005 +0000
     8.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c	Thu Apr 28 15:08:57 2005 +0000
     8.3 @@ -40,6 +40,8 @@
     8.4  #include <linux/efi.h>
     8.5  #include <linux/init.h>
     8.6  #include <linux/edd.h>
     8.7 +#include <linux/kernel.h>
     8.8 +#include <linux/notifier.h>
     8.9  #include <video/edid.h>
    8.10  #include <asm/e820.h>
    8.11  #include <asm/mpspec.h>
    8.12 @@ -56,6 +58,11 @@
    8.13  /* Allows setting of maximum possible memory size  */
    8.14  static unsigned long xen_override_max_pfn;
    8.15  
    8.16 +static int xen_panic_event(struct notifier_block *, unsigned long, void *);
    8.17 +static struct notifier_block xen_panic_block = {
    8.18 +	xen_panic_event, NULL, 0 /* try to go last */
    8.19 +};
    8.20 +
    8.21  int disable_pse __initdata = 0;
    8.22  
    8.23  /*
    8.24 @@ -347,7 +354,7 @@ static void __init probe_roms(void)
    8.25  shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
    8.26  EXPORT_SYMBOL(HYPERVISOR_shared_info);
    8.27  
    8.28 -unsigned long *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
    8.29 +unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
    8.30  EXPORT_SYMBOL(phys_to_machine_mapping);
    8.31  
    8.32  multicall_entry_t multicall_list[8];
    8.33 @@ -892,6 +899,7 @@ efi_find_max_pfn(unsigned long start, un
    8.34  	return 0;
    8.35  }
    8.36  
    8.37 +
    8.38  /*
    8.39   * Find the highest page frame number we have available
    8.40   */
    8.41 @@ -1151,7 +1159,7 @@ static unsigned long __init setup_memory
    8.42  	}
    8.43  #endif
    8.44  
    8.45 -	phys_to_machine_mapping = (unsigned long *)xen_start_info.mfn_list;
    8.46 +	phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list;
    8.47  
    8.48  	return max_low_pfn;
    8.49  }
    8.50 @@ -1388,17 +1396,18 @@ static void set_mca_bus(int x) { }
    8.51   */
    8.52  void __init setup_arch(char **cmdline_p)
    8.53  {
    8.54 -        int i,j;
    8.55 -
    8.56 -        unsigned long max_low_pfn;
    8.57 +	int i, j;
    8.58 +	unsigned long max_low_pfn;
    8.59  
    8.60  	/* Force a quick death if the kernel panics. */
    8.61  	extern int panic_timeout;
    8.62 -	if ( panic_timeout == 0 )
    8.63 +	if (panic_timeout == 0)
    8.64  		panic_timeout = 1;
    8.65  
    8.66 -	HYPERVISOR_vm_assist(VMASST_CMD_enable,
    8.67 -			     VMASST_TYPE_4gb_segments);
    8.68 +	/* Register a call for panic conditions. */
    8.69 +	notifier_chain_register(&panic_notifier_list, &xen_panic_block);
    8.70 +
    8.71 +	HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
    8.72  
    8.73  	memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
    8.74  	early_cpu_init();
    8.75 @@ -1464,7 +1473,8 @@ void __init setup_arch(char **cmdline_p)
    8.76  	init_mm.start_code = (unsigned long) _text;
    8.77  	init_mm.end_code = (unsigned long) _etext;
    8.78  	init_mm.end_data = (unsigned long) _edata;
    8.79 -	init_mm.brk = (PFN_UP(__pa(xen_start_info.pt_base)) + xen_start_info.nr_pt_frames) << PAGE_SHIFT;
    8.80 +	init_mm.brk = (PFN_UP(__pa(xen_start_info.pt_base)) +
    8.81 +		       xen_start_info.nr_pt_frames) << PAGE_SHIFT;
    8.82  
    8.83  	/* XEN: This is nonsense: kernel may not even be contiguous in RAM. */
    8.84  	/*code_resource.start = virt_to_phys(_text);*/
    8.85 @@ -1497,7 +1507,7 @@ void __init setup_arch(char **cmdline_p)
    8.86  			max_pfn * sizeof(unsigned long));
    8.87  
    8.88  		if (max_pfn > xen_start_info.nr_pages) {
    8.89 -			/* set to INVALID_P2M_ENTRY */                        
    8.90 +			/* set to INVALID_P2M_ENTRY */
    8.91  			memset(phys_to_machine_mapping, ~0,
    8.92  				max_pfn * sizeof(unsigned long));
    8.93  			memcpy(phys_to_machine_mapping,
    8.94 @@ -1610,6 +1620,14 @@ void __init setup_arch(char **cmdline_p)
    8.95  	}
    8.96  }
    8.97  
    8.98 +static int
    8.99 +xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
   8.100 +{
   8.101 +	HYPERVISOR_crash();    
   8.102 +	/* we're never actually going to get here... */
   8.103 +	return NOTIFY_DONE;
   8.104 +}
   8.105 +
   8.106  #include "setup_arch_post.h"
   8.107  /*
   8.108   * Local Variables:
     9.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c	Sat Apr 23 16:00:42 2005 +0000
     9.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c	Thu Apr 28 15:08:57 2005 +0000
     9.3 @@ -266,7 +266,7 @@ static unsigned long cpu_khz_ref = 0;
     9.4  
     9.5  static int
     9.6  time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
     9.7 -		      void *data)
     9.8 +		       void *data)
     9.9  {
    9.10  	struct cpufreq_freqs *freq = data;
    9.11  
    9.12 @@ -338,7 +338,7 @@ static int init_tsc(char* override)
    9.13  
    9.14  	/* (10^6 * 2^32) / cpu_hz = (10^3 * 2^32) / cpu_khz =
    9.15  	   (2^32 * 1 / (clocks/us)) */
    9.16 -	{	
    9.17 +	{
    9.18  		unsigned long eax=0, edx=1000;
    9.19  		__asm__("divl %2"
    9.20  		    :"=a" (fast_gettimeoffset_quotient), "=d" (edx)
    10.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/fault.c	Sat Apr 23 16:00:42 2005 +0000
    10.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/fault.c	Thu Apr 28 15:08:57 2005 +0000
    10.3 @@ -228,10 +228,10 @@ fastcall void do_page_fault(struct pt_re
    10.4  	error_code |= (regs->xcs & 2) << 1;
    10.5  	if (regs->eflags & X86_EFLAGS_VM)
    10.6  		error_code |= 4;
    10.7 -		
    10.8 - 	if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
    10.9 - 					SIGSEGV) == NOTIFY_STOP)
   10.10 - 		return;
   10.11 +
   10.12 +	if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
   10.13 +					SIGSEGV) == NOTIFY_STOP)
   10.14 +		return;
   10.15  #if 0
   10.16  	/* It's safe to allow irq's after cr2 has been saved */
   10.17  	if (regs->eflags & (X86_EFLAGS_IF|VM_MASK))
    11.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c	Sat Apr 23 16:00:42 2005 +0000
    11.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c	Thu Apr 28 15:08:57 2005 +0000
    11.3 @@ -195,7 +195,7 @@ static void __init kernel_physical_mappi
    11.4  			flush_page_update_queue();
    11.5  		}
    11.6  		pmd_idx = 0;
    11.7 -	}	
    11.8 +	}
    11.9  }
   11.10  
   11.11  static inline int page_kills_ppro(unsigned long pagenr)
   11.12 @@ -327,8 +327,8 @@ extern void __init remap_numa_kva(void);
   11.13  static void __init pagetable_init (void)
   11.14  {
   11.15  	unsigned long vaddr;
   11.16 +	pgd_t *pgd_base = swapper_pg_dir;
   11.17  	pgd_t *old_pgd = (pgd_t *)xen_start_info.pt_base;
   11.18 -	pgd_t *new_pgd = swapper_pg_dir;
   11.19  
   11.20  #ifdef CONFIG_X86_PAE
   11.21  	int i;
   11.22 @@ -354,17 +354,16 @@ static void __init pagetable_init (void)
   11.23  	 * page directory, write-protect the new page directory, then switch to
   11.24  	 * it. We clean up by write-enabling and then freeing the old page dir.
   11.25  	 */
   11.26 -	memcpy(new_pgd, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
   11.27 -	make_page_readonly(new_pgd);
   11.28 -	queue_pgd_pin(__pa(new_pgd));
   11.29 -	load_cr3(new_pgd);
   11.30 +	memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
   11.31 +	make_page_readonly(pgd_base);
   11.32 +	queue_pgd_pin(__pa(pgd_base));
   11.33 +	load_cr3(pgd_base);
   11.34  	queue_pgd_unpin(__pa(old_pgd));
   11.35 -	__flush_tlb_all(); /* implicit flush */
   11.36  	make_page_writable(old_pgd);
   11.37 -	flush_page_update_queue();
   11.38 +	__flush_tlb_all();
   11.39  	free_bootmem(__pa(old_pgd), PAGE_SIZE);
   11.40  
   11.41 -	kernel_physical_mapping_init(new_pgd);
   11.42 +	kernel_physical_mapping_init(pgd_base);
   11.43  	remap_numa_kva();
   11.44  
   11.45  	/*
   11.46 @@ -372,9 +371,9 @@ static void __init pagetable_init (void)
   11.47  	 * created - mappings will be set by set_fixmap():
   11.48  	 */
   11.49  	vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
   11.50 -	page_table_range_init(vaddr, 0, new_pgd);
   11.51 +	page_table_range_init(vaddr, 0, pgd_base);
   11.52  
   11.53 -	permanent_kmaps_init(new_pgd);
   11.54 +	permanent_kmaps_init(pgd_base);
   11.55  
   11.56  #ifdef CONFIG_X86_PAE
   11.57  	/*
   11.58 @@ -384,7 +383,7 @@ static void __init pagetable_init (void)
   11.59  	 * All user-space mappings are explicitly cleared after
   11.60  	 * SMP startup.
   11.61  	 */
   11.62 -	new_pgd[0] = new_pgd[USER_PTRS_PER_PGD];
   11.63 +	pgd_base[0] = pgd_base[USER_PTRS_PER_PGD];
   11.64  #endif
   11.65  }
   11.66  
    12.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/pci/direct.c	Sat Apr 23 16:00:42 2005 +0000
    12.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/pci/direct.c	Thu Apr 28 15:08:57 2005 +0000
    12.3 @@ -71,13 +71,11 @@ struct pci_raw_ops pci_direct_xen = {
    12.4  	.write =	pci_conf_write,
    12.5  };
    12.6  
    12.7 -
    12.8  static int __init pci_direct_init(void)
    12.9  {
   12.10 -
   12.11 -        printk(KERN_INFO "PCI: Using configuration type Xen\n");
   12.12 -        raw_pci_ops = &pci_direct_xen;
   12.13 -        return 0;
   12.14 +	printk(KERN_INFO "PCI: Using configuration type Xen\n");
   12.15 +	raw_pci_ops = &pci_direct_xen;
   12.16 +	return 0;
   12.17  }
   12.18  
   12.19  arch_initcall(pci_direct_init);
    13.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/pci/irq.c	Sat Apr 23 16:00:42 2005 +0000
    13.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/pci/irq.c	Thu Apr 28 15:08:57 2005 +0000
    13.3 @@ -93,7 +93,7 @@ void pcibios_penalize_isa_irq(int irq)
    13.4  static int pirq_enable_irq(struct pci_dev *dev)
    13.5  {
    13.6  	int err;
    13.7 -	u8  pin;
    13.8 +	u8 pin;
    13.9  	physdev_op_t op;
   13.10  
   13.11  	/* Inform Xen that we are going to use this device. */
    14.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/Makefile	Sat Apr 23 16:00:42 2005 +0000
    14.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/Makefile	Thu Apr 28 15:08:57 2005 +0000
    14.3 @@ -11,4 +11,4 @@ CPPFLAGS_vmlinux.lds += -U$(XENARCH)
    14.4  
    14.5  extra-y += vmlinux.lds
    14.6  
    14.7 -obj-y	:= ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o gnttab.o skbuff.o devmem.o
    14.8 +obj-y	:= ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o skbuff.o devmem.o
    15.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c	Sat Apr 23 16:00:42 2005 +0000
    15.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c	Thu Apr 28 15:08:57 2005 +0000
    15.3 @@ -77,8 +77,7 @@
    15.4  
    15.5  static int __init fixup_init(void)
    15.6  {
    15.7 -    HYPERVISOR_vm_assist(VMASST_CMD_enable,
    15.8 -                         VMASST_TYPE_4gb_segments_notify);
    15.9 +    HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
   15.10      return 0;
   15.11  }
   15.12  __initcall(fixup_init);
    16.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c	Sat Apr 23 16:00:42 2005 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,163 +0,0 @@
    16.4 -/******************************************************************************
    16.5 - * gnttab.c
    16.6 - * 
    16.7 - * Two sets of functionality:
    16.8 - * 1. Granting foreign access to our memory reservation.
    16.9 - * 2. Accessing others' memory reservations via grant references.
   16.10 - * (i.e., mechanisms for both sender and recipient of grant references)
   16.11 - * 
   16.12 - * Copyright (c) 2004, K A Fraser
   16.13 - */
   16.14 -
   16.15 -#include <linux/config.h>
   16.16 -#include <linux/module.h>
   16.17 -#include <linux/sched.h>
   16.18 -#include <asm/pgtable.h>
   16.19 -#include <asm/fixmap.h>
   16.20 -#include <asm-xen/gnttab.h>
   16.21 -
   16.22 -#ifndef set_fixmap_ma
   16.23 -#define set_fixmap_ma set_fixmap
   16.24 -#endif
   16.25 -
   16.26 -#if 1
   16.27 -#define ASSERT(_p) \
   16.28 -    if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \
   16.29 -    #_p , __LINE__, __FILE__); *(int*)0=0; }
   16.30 -#else
   16.31 -#define ASSERT(_p) ((void)0)
   16.32 -#endif
   16.33 -
   16.34 -EXPORT_SYMBOL(gnttab_grant_foreign_access);
   16.35 -EXPORT_SYMBOL(gnttab_end_foreign_access);
   16.36 -EXPORT_SYMBOL(gnttab_grant_foreign_transfer);
   16.37 -EXPORT_SYMBOL(gnttab_end_foreign_transfer);
   16.38 -
   16.39 -#define NR_GRANT_REFS 512
   16.40 -static grant_ref_t gnttab_free_list[NR_GRANT_REFS];
   16.41 -static grant_ref_t gnttab_free_head;
   16.42 -
   16.43 -static grant_entry_t *shared;
   16.44 -
   16.45 -/*
   16.46 - * Lock-free grant-entry allocator
   16.47 - */
   16.48 -
   16.49 -static inline int
   16.50 -get_free_entry(
   16.51 -    void)
   16.52 -{
   16.53 -    grant_ref_t fh, nfh = gnttab_free_head;
   16.54 -    do { if ( unlikely((fh = nfh) == NR_GRANT_REFS) ) return -1; }
   16.55 -    while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh,
   16.56 -                                    gnttab_free_list[fh])) != fh) );
   16.57 -    return fh;
   16.58 -}
   16.59 -
   16.60 -static inline void
   16.61 -put_free_entry(
   16.62 -    grant_ref_t ref)
   16.63 -{
   16.64 -    grant_ref_t fh, nfh = gnttab_free_head;
   16.65 -    do { gnttab_free_list[ref] = fh = nfh; wmb(); }
   16.66 -    while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh, ref)) != fh) );
   16.67 -}
   16.68 -
   16.69 -/*
   16.70 - * Public grant-issuing interface functions
   16.71 - */
   16.72 -
   16.73 -int
   16.74 -gnttab_grant_foreign_access(
   16.75 -    domid_t domid, unsigned long frame, int readonly)
   16.76 -{
   16.77 -    int ref;
   16.78 -    
   16.79 -    if ( unlikely((ref = get_free_entry()) == -1) )
   16.80 -        return -ENOSPC;
   16.81 -
   16.82 -    shared[ref].frame = frame;
   16.83 -    shared[ref].domid = domid;
   16.84 -    wmb();
   16.85 -    shared[ref].flags = GTF_permit_access | (readonly ? GTF_readonly : 0);
   16.86 -
   16.87 -    return ref;
   16.88 -}
   16.89 -
   16.90 -void
   16.91 -gnttab_end_foreign_access(
   16.92 -    grant_ref_t ref, int readonly)
   16.93 -{
   16.94 -    u16 flags, nflags;
   16.95 -
   16.96 -    nflags = shared[ref].flags;
   16.97 -    do {
   16.98 -        if ( (flags = nflags) & (GTF_reading|GTF_writing) )
   16.99 -            printk(KERN_ALERT "WARNING: g.e. still in use!\n");
  16.100 -    }
  16.101 -    while ( (nflags = cmpxchg(&shared[ref].flags, flags, 0)) != flags );
  16.102 -
  16.103 -    put_free_entry(ref);
  16.104 -}
  16.105 -
  16.106 -int
  16.107 -gnttab_grant_foreign_transfer(
  16.108 -    domid_t domid)
  16.109 -{
  16.110 -    int ref;
  16.111 -
  16.112 -    if ( unlikely((ref = get_free_entry()) == -1) )
  16.113 -        return -ENOSPC;
  16.114 -
  16.115 -    shared[ref].frame = 0;
  16.116 -    shared[ref].domid = domid;
  16.117 -    wmb();
  16.118 -    shared[ref].flags = GTF_accept_transfer;
  16.119 -
  16.120 -    return ref;
  16.121 -}
  16.122 -
  16.123 -unsigned long
  16.124 -gnttab_end_foreign_transfer(
  16.125 -    grant_ref_t ref)
  16.126 -{
  16.127 -    unsigned long frame = 0;
  16.128 -    u16           flags;
  16.129 -
  16.130 -    flags = shared[ref].flags;
  16.131 -    ASSERT(flags == (GTF_accept_transfer | GTF_transfer_committed));
  16.132 -
  16.133 -    /*
  16.134 -     * If a transfer is committed then wait for the frame address to appear.
  16.135 -     * Otherwise invalidate the grant entry against future use.
  16.136 -     */
  16.137 -    if ( likely(flags != GTF_accept_transfer) ||
  16.138 -         (cmpxchg(&shared[ref].flags, flags, 0) != GTF_accept_transfer) )
  16.139 -        while ( unlikely((frame = shared[ref].frame) == 0) )
  16.140 -            cpu_relax();
  16.141 -
  16.142 -    put_free_entry(ref);
  16.143 -
  16.144 -    return frame;
  16.145 -}
  16.146 -
  16.147 -void __init gnttab_init(void)
  16.148 -{
  16.149 -    gnttab_setup_table_t setup;
  16.150 -    unsigned long        frame;
  16.151 -    int                  i;
  16.152 -
  16.153 -    for ( i = 0; i < NR_GRANT_REFS; i++ )
  16.154 -        gnttab_free_list[i] = i + 1;
  16.155 -
  16.156 -    setup.dom        = DOMID_SELF;
  16.157 -    setup.nr_frames  = 1;
  16.158 -    setup.frame_list = &frame;
  16.159 -    if ( HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1) != 0 )
  16.160 -        BUG();
  16.161 -    if ( setup.status != 0 )
  16.162 -        BUG();
  16.163 -
  16.164 -    set_fixmap_ma(FIX_GNTTAB, frame << PAGE_SHIFT);
  16.165 -    shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB);
  16.166 -}
    17.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Sat Apr 23 16:00:42 2005 +0000
    17.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Thu Apr 28 15:08:57 2005 +0000
    17.3 @@ -80,7 +80,7 @@ static void __do_suspend(void)
    17.4      extern void time_suspend(void);
    17.5      extern void time_resume(void);
    17.6      extern unsigned long max_pfn;
    17.7 -    extern unsigned long *pfn_to_mfn_frame_list;
    17.8 +    extern unsigned int *pfn_to_mfn_frame_list;
    17.9  
   17.10      suspend_record = (suspend_record_t *)__get_free_page(GFP_KERNEL);
   17.11      if ( suspend_record == NULL )
   17.12 @@ -103,7 +103,8 @@ static void __do_suspend(void)
   17.13      HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
   17.14      clear_fixmap(FIX_SHARED_INFO);
   17.15  
   17.16 -    memcpy(&suspend_record->resume_info, &xen_start_info, sizeof(xen_start_info));
   17.17 +    memcpy(&suspend_record->resume_info, &xen_start_info,
   17.18 +	   sizeof(xen_start_info));
   17.19  
   17.20      HYPERVISOR_suspend(virt_to_machine(suspend_record) >> PAGE_SHIFT);
   17.21  
   17.22 @@ -116,7 +117,8 @@ static void __do_suspend(void)
   17.23  
   17.24      shutting_down = -1; 
   17.25  
   17.26 -    memcpy(&xen_start_info, &suspend_record->resume_info, sizeof(xen_start_info));
   17.27 +    memcpy(&xen_start_info, &suspend_record->resume_info,
   17.28 +	   sizeof(xen_start_info));
   17.29  
   17.30  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   17.31      set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info);
    18.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/desc.h	Sat Apr 23 16:00:42 2005 +0000
    18.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/desc.h	Thu Apr 28 15:08:57 2005 +0000
    18.3 @@ -125,6 +125,7 @@ static inline void load_LDT(mm_context_t
    18.4  {
    18.5  	int cpu = get_cpu();
    18.6  	load_LDT_nolock(pc, cpu);
    18.7 +	flush_page_update_queue();
    18.8  	put_cpu();
    18.9  }
   18.10  
    19.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/fixmap.h	Sat Apr 23 16:00:42 2005 +0000
    19.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/fixmap.h	Thu Apr 28 15:08:57 2005 +0000
    19.3 @@ -84,7 +84,6 @@ enum fixed_addresses {
    19.4  	FIX_PCIE_MCFG,
    19.5  #endif
    19.6  	FIX_SHARED_INFO,
    19.7 -	FIX_GNTTAB,
    19.8  #ifdef CONFIG_XEN_PHYSDEV_ACCESS
    19.9  #define NR_FIX_ISAMAPS	256
   19.10  	FIX_ISAMAP_END,
    20.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/page.h	Sat Apr 23 16:00:42 2005 +0000
    20.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/page.h	Thu Apr 28 15:08:57 2005 +0000
    20.3 @@ -58,9 +58,9 @@
    20.4  #define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
    20.5  
    20.6  /**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
    20.7 -extern unsigned long *phys_to_machine_mapping;
    20.8 -#define pfn_to_mfn(_pfn) (phys_to_machine_mapping[(_pfn)])
    20.9 -#define mfn_to_pfn(_mfn) (machine_to_phys_mapping[(_mfn)])
   20.10 +extern unsigned int *phys_to_machine_mapping;
   20.11 +#define pfn_to_mfn(_pfn) ((unsigned long)(phys_to_machine_mapping[(_pfn)]))
   20.12 +#define mfn_to_pfn(_mfn) ((unsigned long)(machine_to_phys_mapping[(_mfn)]))
   20.13  static inline unsigned long phys_to_machine(unsigned long phys)
   20.14  {
   20.15  	unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
   20.16 @@ -116,17 +116,11 @@ static inline unsigned long pgd_val(pgd_
   20.17  }
   20.18  #define pgprot_val(x)	((x).pgprot)
   20.19  
   20.20 -static inline pte_t __pte(unsigned long x)
   20.21 -{
   20.22 -	if (x & 1) x = phys_to_machine(x);
   20.23 -	return ((pte_t) { (x) });
   20.24 -}
   20.25 +#define __pte(x) ({ unsigned long _x = (x); \
   20.26 +    (((_x)&1) ? ((pte_t) {phys_to_machine(_x)}) : ((pte_t) {(_x)})); })
   20.27  #define __pte_ma(x)	((pte_t) { (x) } )
   20.28 -static inline pgd_t __pgd(unsigned long x)
   20.29 -{
   20.30 -	if ((x & 1)) x = phys_to_machine(x);
   20.31 -	return ((pgd_t) { (x) });
   20.32 -}
   20.33 +#define __pgd(x) ({ unsigned long _x = (x); \
   20.34 +    (((_x)&1) ? ((pgd_t) {phys_to_machine(_x)}) : ((pgd_t) {(_x)})); })
   20.35  #define __pgprot(x)	((pgprot_t) { (x) } )
   20.36  
   20.37  #endif /* !__ASSEMBLY__ */
    21.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Sat Apr 23 16:00:42 2005 +0000
    21.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Thu Apr 28 15:08:57 2005 +0000
    21.3 @@ -57,7 +57,7 @@ static inline pte_t ptep_get_and_clear(p
    21.4   *      require. In all the cases we care about, the high bit gets shifted out
    21.5   *      (e.g., phys_to_machine()) so behaviour there is correct.
    21.6   */
    21.7 -#define INVALID_P2M_ENTRY (~0UL)
    21.8 +#define INVALID_P2M_ENTRY (~0U)
    21.9  #define FOREIGN_FRAME(_m) ((_m) | (1UL<<((sizeof(unsigned long)*8)-1)))
   21.10  #define pte_pfn(_pte)							\
   21.11  ({									\
    22.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Sat Apr 23 16:00:42 2005 +0000
    22.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Thu Apr 28 15:08:57 2005 +0000
    22.3 @@ -416,7 +416,6 @@ extern void noexec_setup(const char *str
    22.4   */
    22.5  #define update_mmu_cache(vma,address,pte) do { } while (0)
    22.6  #define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
    22.7 -
    22.8  #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
    22.9  	do {								  \
   22.10  		if (__dirty) {						  \
    23.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/system.h	Sat Apr 23 16:00:42 2005 +0000
    23.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/system.h	Thu Apr 28 15:08:57 2005 +0000
    23.3 @@ -444,7 +444,7 @@ struct alt_instr {
    23.4  /* 
    23.5   * The use of 'barrier' in the following reflects their use as local-lock
    23.6   * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
    23.7 - * critical operations are executed. All critical operatiosn must complete
    23.8 + * critical operations are executed. All critical operations must complete
    23.9   * /before/ reentrancy is permitted (e.g., __sti()). Alpha architecture also
   23.10   * includes these barriers, for example.
   23.11   */
    24.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/tlbflush.h	Sat Apr 23 16:00:42 2005 +0000
    24.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/tlbflush.h	Thu Apr 28 15:08:57 2005 +0000
    24.3 @@ -6,11 +6,6 @@
    24.4  #include <asm/processor.h>
    24.5  
    24.6  #define __flush_tlb() xen_tlb_flush()
    24.7 -
    24.8 -/*
    24.9 - * Global pages have to be flushed a bit differently. Not a real
   24.10 - * performance problem because this does not happen often.
   24.11 - */
   24.12  #define __flush_tlb_global() xen_tlb_flush()
   24.13  
   24.14  extern unsigned long pgkern_mask;
    25.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h	Sat Apr 23 16:00:42 2005 +0000
    25.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h	Thu Apr 28 15:08:57 2005 +0000
    25.3 @@ -41,9 +41,6 @@
    25.4   * LOW-LEVEL DEFINITIONS
    25.5   */
    25.6  
    25.7 -/* Force a proper event-channel callback from Xen. */
    25.8 -void force_evtchn_callback(void);
    25.9 -
   25.10  /* Entry point for notifications into Linux subsystems. */
   25.11  asmlinkage void evtchn_do_upcall(struct pt_regs *regs);
   25.12  
    26.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/gnttab.h	Sat Apr 23 16:00:42 2005 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,35 +0,0 @@
    26.4 -/******************************************************************************
    26.5 - * gnttab.h
    26.6 - * 
    26.7 - * Two sets of functionality:
    26.8 - * 1. Granting foreign access to our memory reservation.
    26.9 - * 2. Accessing others' memory reservations via grant references.
   26.10 - * (i.e., mechanisms for both sender and recipient of grant references)
   26.11 - * 
   26.12 - * Copyright (c) 2004, K A Fraser
   26.13 - */
   26.14 -
   26.15 -#ifndef __ASM_GNTTAB_H__
   26.16 -#define __ASM_GNTTAB_H__
   26.17 -
   26.18 -#include <linux/config.h>
   26.19 -#include <asm-xen/hypervisor.h>
   26.20 -#include <asm-xen/xen-public/grant_table.h>
   26.21 -
   26.22 -int
   26.23 -gnttab_grant_foreign_access(
   26.24 -    domid_t domid, unsigned long frame, int readonly);
   26.25 -
   26.26 -void
   26.27 -gnttab_end_foreign_access(
   26.28 -    grant_ref_t ref, int readonly);
   26.29 -
   26.30 -int
   26.31 -gnttab_grant_foreign_transfer(
   26.32 -    domid_t domid);
   26.33 -
   26.34 -unsigned long
   26.35 -gnttab_end_foreign_transfer(
   26.36 -    grant_ref_t ref);
   26.37 -
   26.38 -#endif /* __ASM_GNTTAB_H__ */
    27.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h	Sat Apr 23 16:00:42 2005 +0000
    27.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h	Thu Apr 28 15:08:57 2005 +0000
    27.3 @@ -39,9 +39,11 @@
    27.4  #include <asm-xen/xen-public/io/domain_controller.h>
    27.5  #include <asm/ptrace.h>
    27.6  #include <asm/page.h>
    27.7 +#if defined(__i386__)
    27.8  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    27.9  #include <asm-generic/pgtable-nopmd.h>
   27.10  #endif
   27.11 +#endif
   27.12  
   27.13  /* arch/xen/i386/kernel/setup.c */
   27.14  union xen_start_info_union
   27.15 @@ -52,6 +54,10 @@ union xen_start_info_union
   27.16  extern union xen_start_info_union xen_start_info_union;
   27.17  #define xen_start_info (xen_start_info_union.xen_start_info)
   27.18  
   27.19 +/* arch/xen/kernel/evtchn.c */
   27.20 +/* Force a proper event-channel callback from Xen. */
   27.21 +void force_evtchn_callback(void);
   27.22 +
   27.23  /* arch/xen/kernel/process.c */
   27.24  void xen_cpu_idle (void);
   27.25