[kernel] r7465 - in dists/trunk/linux-2.6/debian/patches: features/all/xen series

Bastian Blank waldi at costa.debian.org
Wed Sep 20 12:03:25 UTC 2006


Author: waldi
Date: Wed Sep 20 12:03:12 2006
New Revision: 7465

Added:
   dists/trunk/linux-2.6/debian/patches/features/all/xen/upstream-35844.patch
      - copied, changed from r7464, /dists/trunk/linux-2.6/debian/patches/features/all/xen/fedora-35901.patch
Removed:
   dists/trunk/linux-2.6/debian/patches/features/all/xen/fedora-35901.patch
Modified:
   dists/trunk/linux-2.6/debian/patches/series/1-extra

Log:
* debian/patches/features/all/xen/upstream-35844.patch: Add.
* debian/patches/series/1-extra: Replace xen patch.


Copied: dists/trunk/linux-2.6/debian/patches/features/all/xen/upstream-35844.patch (from r7464, /dists/trunk/linux-2.6/debian/patches/features/all/xen/fedora-35901.patch)
==============================================================================
--- /dists/trunk/linux-2.6/debian/patches/features/all/xen/fedora-35901.patch	(original)
+++ dists/trunk/linux-2.6/debian/patches/features/all/xen/upstream-35844.patch	Wed Sep 20 12:03:12 2006
@@ -1,6 +1,6 @@
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/boot-xen/Makefile linux-2.6.18-rc6-xen/arch/i386/boot-xen/Makefile
---- linux-2.6.18-rc6/arch/i386/boot-xen/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/boot-xen/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/boot-xen/Makefile linux-2.6.18-xen/arch/i386/boot-xen/Makefile
+--- linux-2.6.18/arch/i386/boot-xen/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/boot-xen/Makefile	2006-05-26 22:00:00.000000000 +0200
 @@ -0,0 +1,21 @@
 +
 +OBJCOPYFLAGS := -g --strip-unneeded
@@ -23,18 +23,10 @@
 +	install -m0664 .config $(INSTALL_ROOT)/boot/config-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
 +	install -m0664 System.map $(INSTALL_ROOT)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
 +	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/Kconfig linux-2.6.18-rc6-xen/arch/i386/Kconfig
---- linux-2.6.18-rc6/arch/i386/Kconfig	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/Kconfig	2006-09-04 16:31:00.000000000 +0200
-@@ -16,6 +16,7 @@
- 
- config GENERIC_TIME
- 	bool
-+	depends on !X86_XEN
- 	default y
- 
- config LOCKDEP_SUPPORT
-@@ -103,6 +104,15 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/Kconfig linux-2.6.18-xen/arch/i386/Kconfig
+--- linux-2.6.18/arch/i386/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/Kconfig	2006-09-17 17:44:46.000000000 +0200
+@@ -103,6 +103,15 @@
  	help
  	  Choose this option if your computer is a standard PC or compatible.
  
@@ -50,7 +42,7 @@
  config X86_ELAN
  	bool "AMD Elan"
  	help
-@@ -213,6 +223,7 @@
+@@ -213,6 +222,7 @@
  
  config HPET_TIMER
  	bool "HPET Timer Support"
@@ -58,7 +50,7 @@
  	help
  	  This enables the use of the HPET for the kernel's internal timer.
  	  HPET is the next generation timer replacing legacy 8254s.
-@@ -263,7 +274,7 @@
+@@ -263,7 +273,7 @@
  
  config X86_UP_APIC
  	bool "Local APIC support on uniprocessors"
@@ -67,7 +59,7 @@
  	help
  	  A local APIC (Advanced Programmable Interrupt Controller) is an
  	  integrated interrupt controller in the CPU. If you have a single-CPU
-@@ -288,12 +299,12 @@
+@@ -288,12 +298,12 @@
  
  config X86_LOCAL_APIC
  	bool
@@ -82,8 +74,15 @@
  	default y
  
  config X86_VISWS_APIC
-@@ -303,7 +314,7 @@
+@@ -301,9 +311,14 @@
+ 	depends on X86_VISWS
+ 	default y
  
++config X86_TSC
++	bool
++	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ && !X86_XEN
++	default y
++
  config X86_MCE
  	bool "Machine Check Exception"
 -	depends on !X86_VOYAGER
@@ -91,7 +90,7 @@
  	---help---
  	  Machine Check Exception support allows the processor to notify the
  	  kernel if it detects a problem (e.g. overheating, component failure).
-@@ -402,6 +413,7 @@
+@@ -402,6 +417,7 @@
  
  config MICROCODE
  	tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
@@ -99,7 +98,7 @@
  	---help---
  	  If you say Y here and also to "/dev file system support" in the
  	  'File systems' section, you will be able to update the microcode on
-@@ -419,6 +431,7 @@
+@@ -419,6 +435,7 @@
  
  config X86_MSR
  	tristate "/dev/cpu/*/msr - Model-specific register support"
@@ -107,7 +106,7 @@
  	help
  	  This device gives privileged processes access to the x86
  	  Model-Specific Registers (MSRs).  It is a character device with
-@@ -434,6 +447,10 @@
+@@ -434,6 +451,10 @@
  	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
  	  /dev/cpu/31/cpuid.
  
@@ -118,7 +117,7 @@
  source "drivers/firmware/Kconfig"
  
  choice
-@@ -607,7 +624,7 @@
+@@ -607,7 +628,7 @@
  
  config HIGHPTE
  	bool "Allocate 3rd-level pagetables from highmem"
@@ -127,7 +126,7 @@
  	help
  	  The VM uses one page table entry for each page of physical memory.
  	  For systems with a lot of RAM, this can be wasteful of precious
-@@ -616,6 +633,7 @@
+@@ -616,6 +637,7 @@
  
  config MATH_EMULATION
  	bool "Math emulation"
@@ -135,7 +134,7 @@
  	---help---
  	  Linux can emulate a math coprocessor (used for floating point
  	  operations) if you don't have one. 486DX and Pentium processors have
-@@ -641,6 +659,8 @@
+@@ -641,6 +663,8 @@
  
  config MTRR
  	bool "MTRR (Memory Type Range Register) support"
@@ -144,7 +143,7 @@
  	---help---
  	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
  	  the Memory Type Range Registers (MTRRs) may be used to control
-@@ -675,7 +695,7 @@
+@@ -675,7 +699,7 @@
  
  config EFI
  	bool "Boot from EFI support"
@@ -153,7 +152,7 @@
  	default n
  	---help---
  	This enables the the kernel to boot on EFI platforms using
-@@ -693,7 +713,7 @@
+@@ -693,7 +717,7 @@
  
  config IRQBALANCE
   	bool "Enable kernel irq balancing"
@@ -162,7 +161,7 @@
  	default y
  	help
   	  The default yes will allow the kernel to do irq load balancing.
-@@ -741,7 +761,7 @@
+@@ -741,7 +765,7 @@
  
  config KEXEC
  	bool "kexec system call (EXPERIMENTAL)"
@@ -171,15 +170,7 @@
  	help
  	  kexec is a system call that implements the ability to shutdown your
  	  current kernel, and to start another kernel.  It is like a reboot
-@@ -794,6 +814,7 @@
- config COMPAT_VDSO
- 	bool "Compat VDSO support"
- 	default y
-+	depends on !X86_XEN
- 	help
- 	  Map the VDSO to the predictable old-style address too.
- 	---help---
-@@ -810,18 +831,20 @@
+@@ -810,18 +834,20 @@
  	depends on HIGHMEM
  
  menu "Power management options (ACPI, APM)"
@@ -203,7 +194,7 @@
  	---help---
  	  APM is a BIOS specification for saving power using several different
  	  techniques. This is mostly useful for battery powered laptops with
-@@ -1006,6 +1029,7 @@
+@@ -1006,6 +1032,7 @@
  
  config PCI_GOBIOS
  	bool "BIOS"
@@ -211,7 +202,7 @@
  
  config PCI_GOMMCONFIG
  	bool "MMConfig"
-@@ -1013,6 +1037,13 @@
+@@ -1013,6 +1040,13 @@
  config PCI_GODIRECT
  	bool "Direct"
  
@@ -225,7 +216,7 @@
  config PCI_GOANY
  	bool "Any"
  
-@@ -1020,7 +1051,7 @@
+@@ -1020,7 +1054,7 @@
  
  config PCI_BIOS
  	bool
@@ -234,7 +225,7 @@
  	default y
  
  config PCI_DIRECT
-@@ -1033,6 +1064,18 @@
+@@ -1033,6 +1067,18 @@
  	depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
  	default y
  
@@ -253,7 +244,7 @@
  source "drivers/pci/pcie/Kconfig"
  
  source "drivers/pci/Kconfig"
-@@ -1043,7 +1086,7 @@
+@@ -1043,7 +1089,7 @@
  
  config ISA
  	bool "ISA support"
@@ -262,7 +253,7 @@
  	help
  	  Find out whether you have ISA slots on your motherboard.  ISA is the
  	  name of a bus system, i.e. the way the CPU talks to the other stuff
-@@ -1070,7 +1113,7 @@
+@@ -1070,7 +1116,7 @@
  source "drivers/eisa/Kconfig"
  
  config MCA
@@ -271,7 +262,7 @@
  	default y if X86_VOYAGER
  	help
  	  MicroChannel Architecture is found in some IBM PS/2 machines and
-@@ -1146,6 +1189,8 @@
+@@ -1146,6 +1192,8 @@
  
  source "crypto/Kconfig"
  
@@ -280,7 +271,7 @@
  source "lib/Kconfig"
  
  #
-@@ -1171,7 +1216,7 @@
+@@ -1171,7 +1219,7 @@
  
  config X86_HT
  	bool
@@ -289,7 +280,7 @@
  	default y
  
  config X86_BIOS_REBOOT
-@@ -1184,6 +1229,16 @@
+@@ -1184,6 +1232,16 @@
  	depends on X86_SMP || (X86_VOYAGER && SMP)
  	default y
  
@@ -306,9 +297,9 @@
  config KTIME_SCALAR
  	bool
  	default y
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/Kconfig.cpu linux-2.6.18-rc6-xen/arch/i386/Kconfig.cpu
---- linux-2.6.18-rc6/arch/i386/Kconfig.cpu	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/Kconfig.cpu	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/Kconfig.cpu linux-2.6.18-xen/arch/i386/Kconfig.cpu
+--- linux-2.6.18/arch/i386/Kconfig.cpu	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/Kconfig.cpu	2006-08-15 13:03:12.000000000 +0200
 @@ -251,7 +251,7 @@
  
  config X86_F00F_BUG
@@ -318,16 +309,9 @@
  	default y
  
  config X86_WP_WORKS_OK
-@@ -311,5 +311,5 @@
- 
- config X86_TSC
- 	bool
--	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1 || MGEODE_LX) && !X86_NUMAQ
-+	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1 || MGEODE_LX) && !X86_NUMAQ && !X86_XEN
- 	default y
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/Kconfig.debug linux-2.6.18-rc6-xen/arch/i386/Kconfig.debug
---- linux-2.6.18-rc6/arch/i386/Kconfig.debug	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/Kconfig.debug	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/Kconfig.debug linux-2.6.18-xen/arch/i386/Kconfig.debug
+--- linux-2.6.18/arch/i386/Kconfig.debug	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/Kconfig.debug	2006-08-15 13:03:12.000000000 +0200
 @@ -79,6 +79,7 @@
  config DOUBLEFAULT
  	default y
@@ -336,9 +320,9 @@
  	help
            This option allows trapping of rare doublefault exceptions that
            would otherwise cause a system to silently reboot. Disabling this
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/acpi/boot-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/acpi/boot-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/acpi/boot-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/acpi/boot-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/acpi/boot-xen.c linux-2.6.18-xen/arch/i386/kernel/acpi/boot-xen.c
+--- linux-2.6.18/arch/i386/kernel/acpi/boot-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/acpi/boot-xen.c	2006-09-17 17:44:46.000000000 +0200
 @@ -0,0 +1,1168 @@
 +/*
 + *  boot.c - Architecture-Specific Low-Level ACPI Boot Support
@@ -1508,9 +1492,9 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/acpi/Makefile linux-2.6.18-rc6-xen/arch/i386/kernel/acpi/Makefile
---- linux-2.6.18-rc6/arch/i386/kernel/acpi/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/acpi/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/acpi/Makefile linux-2.6.18-xen/arch/i386/kernel/acpi/Makefile
+--- linux-2.6.18/arch/i386/kernel/acpi/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/acpi/Makefile	2006-05-26 22:00:00.000000000 +0200
 @@ -6,3 +6,7 @@
  obj-y				+= cstate.o processor.o
  endif
@@ -1519,36 +1503,25 @@
 +include $(srctree)/scripts/Makefile.xen
 +obj-y := $(call cherrypickxen, $(obj-y), $(src))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/alternative.c linux-2.6.18-rc6-xen/arch/i386/kernel/alternative.c
---- linux-2.6.18-rc6/arch/i386/kernel/alternative.c	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/alternative.c	2006-09-04 16:31:00.000000000 +0200
-@@ -4,7 +4,11 @@
- #include <asm/alternative.h>
- #include <asm/sections.h>
- 
-+#ifdef CONFIG_X86_64_XEN
-+static int no_replacement    = 1;
-+#else
- static int no_replacement    = 0;
-+#endif
- static int smp_alt_once      = 0;
- static int debug_alternative = 0;
- 
-@@ -151,7 +155,11 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/alternative.c linux-2.6.18-xen/arch/i386/kernel/alternative.c
+--- linux-2.6.18/arch/i386/kernel/alternative.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/alternative.c	2006-09-17 17:44:46.000000000 +0200
+@@ -151,7 +151,11 @@
  #ifdef CONFIG_X86_64
  		/* vsyscall code is not mapped yet. resolve it manually. */
  		if (instr >= (u8 *)VSYSCALL_START && instr < (u8*)VSYSCALL_END) {
-+#ifdef CONFIG_XEN
-+			instr = __va(instr - (u8*)VSYSCALL_START + (u8*)phys_to_machine(__pa_symbol(&__vsyscall_0)));
+-			instr = __va(instr - (u8*)VSYSCALL_START + (u8*)__pa_symbol(&__vsyscall_0));
++#ifndef CONFIG_XEN
++			instr = __va(instr - (u8*)VSYSCALL_START + (u8*)(__pa_symbol(&__vsyscall_0)));
 +#else
- 			instr = __va(instr - (u8*)VSYSCALL_START + (u8*)__pa_symbol(&__vsyscall_0));
++			instr = __va(instr - (u8*)VSYSCALL_START + (u8*)phys_to_machine(__pa_symbol(&__vsyscall_0)));
 +#endif
  			DPRINTK("%s: vsyscall fixup: %p => %p\n",
  				__FUNCTION__, a->instr, instr);
  		}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/apic-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/apic-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/apic-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/apic-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/apic-xen.c linux-2.6.18-xen/arch/i386/kernel/apic-xen.c
+--- linux-2.6.18/arch/i386/kernel/apic-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/apic-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,160 @@
 +/*
 + *	Local APIC handling, local APIC timers
@@ -1710,9 +1683,9 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/asm-offsets.c linux-2.6.18-rc6-xen/arch/i386/kernel/asm-offsets.c
---- linux-2.6.18-rc6/arch/i386/kernel/asm-offsets.c	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/asm-offsets.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/asm-offsets.c linux-2.6.18-xen/arch/i386/kernel/asm-offsets.c
+--- linux-2.6.18/arch/i386/kernel/asm-offsets.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/asm-offsets.c	2006-08-15 13:03:12.000000000 +0200
 @@ -66,9 +66,14 @@
  	OFFSET(pbe_orig_address, pbe, orig_address);
  	OFFSET(pbe_next, pbe, next);
@@ -1729,9 +1702,9 @@
  
  	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
  	DEFINE(VDSO_PRELINK, VDSO_PRELINK);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/cpu/common-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/common-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/cpu/common-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/common-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/cpu/common-xen.c linux-2.6.18-xen/arch/i386/kernel/cpu/common-xen.c
+--- linux-2.6.18/arch/i386/kernel/cpu/common-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/cpu/common-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,739 @@
 +#include <linux/init.h>
 +#include <linux/string.h>
@@ -2360,7 +2333,7 @@
 +	}
 +	printk(KERN_INFO "Initializing CPU#%d\n", cpu);
 +
-+	if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
++	if (cpu_has_vme || cpu_has_de)
 +		clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
 +	if (tsc_disable && cpu_has_tsc) {
 +		printk(KERN_NOTICE "Disabling TSC...\n");
@@ -2472,9 +2445,9 @@
 +	per_cpu(cpu_tlbstate, cpu).active_mm = &init_mm;
 +}
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/cpu/Makefile linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/Makefile
---- linux-2.6.18-rc6/arch/i386/kernel/cpu/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/cpu/Makefile linux-2.6.18-xen/arch/i386/kernel/cpu/Makefile
+--- linux-2.6.18/arch/i386/kernel/cpu/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/cpu/Makefile	2006-05-26 22:00:00.000000000 +0200
 @@ -17,3 +17,8 @@
  
  obj-$(CONFIG_MTRR)	+= 	mtrr/
@@ -2484,9 +2457,9 @@
 +include $(srctree)/scripts/Makefile.xen
 +obj-y := $(call cherrypickxen, $(obj-y), $(src))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/cpu/mtrr/main-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/mtrr/main-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/cpu/mtrr/main-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/mtrr/main-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/cpu/mtrr/main-xen.c linux-2.6.18-xen/arch/i386/kernel/cpu/mtrr/main-xen.c
+--- linux-2.6.18/arch/i386/kernel/cpu/mtrr/main-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/cpu/mtrr/main-xen.c	2006-09-17 17:44:46.000000000 +0200
 @@ -0,0 +1,197 @@
 +#include <linux/init.h>
 +#include <linux/proc_fs.h>
@@ -2685,9 +2658,9 @@
 +}
 +
 +subsys_initcall(mtrr_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/cpu/mtrr/Makefile linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/mtrr/Makefile
---- linux-2.6.18-rc6/arch/i386/kernel/cpu/mtrr/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/cpu/mtrr/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/cpu/mtrr/Makefile linux-2.6.18-xen/arch/i386/kernel/cpu/mtrr/Makefile
+--- linux-2.6.18/arch/i386/kernel/cpu/mtrr/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/cpu/mtrr/Makefile	2006-05-26 22:00:01.000000000 +0200
 @@ -3,3 +3,10 @@
  obj-y		+= cyrix.o
  obj-y		+= centaur.o
@@ -2699,16 +2672,16 @@
 +obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
 +obj-y := $(call cherrypickxen, $(obj-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/early_printk-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/early_printk-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/early_printk-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/early_printk-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/early_printk-xen.c linux-2.6.18-xen/arch/i386/kernel/early_printk-xen.c
+--- linux-2.6.18/arch/i386/kernel/early_printk-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/early_printk-xen.c	2006-05-26 22:00:01.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +#include "../../x86_64/kernel/early_printk-xen.c"
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/entry.S linux-2.6.18-rc6-xen/arch/i386/kernel/entry.S
---- linux-2.6.18-rc6/arch/i386/kernel/entry.S	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/entry.S	2006-09-04 16:31:00.000000000 +0200
-@@ -265,7 +265,7 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/entry.S linux-2.6.18-xen/arch/i386/kernel/entry.S
+--- linux-2.6.18/arch/i386/kernel/entry.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/entry.S	2006-09-20 13:58:38.000000000 +0200
+@@ -269,7 +269,7 @@
  	CFI_STARTPROC simple
  	CFI_DEF_CFA esp, 0
  	CFI_REGISTER esp, ebp
@@ -2717,7 +2690,7 @@
  sysenter_past_esp:
  	/*
  	 * No need to follow this irqs on/off section: the syscall
-@@ -685,7 +685,7 @@
+@@ -689,7 +689,7 @@
   * that sets up the real kernel stack. Check here, since we can't
   * allow the wrong stack to be used.
   *
@@ -2726,7 +2699,7 @@
   * already pushed 3 words if it hits on the sysenter instruction:
   * eflags, cs and eip.
   *
-@@ -697,7 +697,7 @@
+@@ -701,7 +701,7 @@
  	cmpw $__KERNEL_CS,4(%esp);		\
  	jne ok;					\
  label:						\
@@ -2735,10 +2708,10 @@
  	pushfl;					\
  	pushl $__KERNEL_CS;			\
  	pushl $sysenter_past_esp
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/entry-xen.S linux-2.6.18-rc6-xen/arch/i386/kernel/entry-xen.S
---- linux-2.6.18-rc6/arch/i386/kernel/entry-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/entry-xen.S	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,1209 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/entry-xen.S linux-2.6.18-xen/arch/i386/kernel/entry-xen.S
+--- linux-2.6.18/arch/i386/kernel/entry-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/entry-xen.S	2006-09-20 13:58:38.000000000 +0200
+@@ -0,0 +1,1201 @@
 +/*
 + *  linux/arch/i386/entry.S
 + *
@@ -2980,6 +2953,10 @@
 +	GET_THREAD_INFO(%ebp)
 +	popl %eax
 +	CFI_ADJUST_CFA_OFFSET -4
++	pushl $0x0202			# Reset kernel eflags
++	CFI_ADJUST_CFA_OFFSET 4
++	popfl
++	CFI_ADJUST_CFA_OFFSET -4
 +	jmp syscall_exit
 +	CFI_ENDPROC
 +
@@ -3096,27 +3073,26 @@
 +	movl EIP(%esp), %edx
 +	movl OLDESP(%esp), %ecx
 +	xorl %ebp,%ebp
-+	TRACE_IRQS_ON
 +#ifdef CONFIG_XEN
++	TRACE_IRQS_ON
 +	__ENABLE_INTERRUPTS
 +sysexit_scrit:	/**** START OF SYSEXIT CRITICAL REGION ****/
 +	__TEST_PENDING
 +	jnz  14f			# process more events if necessary...
 +	movl ESI(%esp), %esi
 +	sysexit
++	CFI_ENDPROC
 +14:	__DISABLE_INTERRUPTS
 +sysexit_ecrit:	/**** END OF SYSEXIT CRITICAL REGION ****/
 +	push %esp
-+	CFI_ADJUST_CFA_OFFSET 4
 +	call evtchn_do_upcall
 +	add  $4,%esp
-+	CFI_ADJUST_CFA_OFFSET -4
 +	jmp  ret_from_intr
 +#else
 +	sti
 +	sysexit
-+#endif /* !CONFIG_XEN */
 +	CFI_ENDPROC
++#endif /* !CONFIG_XEN */
 +
 +
 +	# system call handler stub
@@ -3158,8 +3134,11 @@
 +	movb CS(%esp), %al
 +	andl $(VM_MASK | (4 << 8) | 3), %eax
 +	cmpl $((4 << 8) | 3), %eax
++	CFI_REMEMBER_STATE
 +	je ldt_ss			# returning to user-space with LDT SS
 +restore_nocheck:
++	TRACE_IRQS_IRET
++restore_nocheck_notrace:
 +#else
 +restore_nocheck:
 +	movl EFLAGS(%esp), %eax
@@ -3170,10 +3149,8 @@
 +	andb evtchn_upcall_mask(%esi),%al
 +	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
 +	jnz restore_all_enable_events	#        != 0 => enable event delivery
-+#endif
 +	TRACE_IRQS_IRET
-+	CFI_REMEMBER_STATE
-+restore_nocheck_notrace:
++#endif
 +	RESTORE_REGS
 +	addl $4, %esp
 +	CFI_ADJUST_CFA_OFFSET -4
@@ -3193,8 +3170,8 @@
 +	.long 1b,iret_exc
 +.previous
 +
-+	CFI_RESTORE_STATE
 +#ifndef CONFIG_XEN
++	CFI_RESTORE_STATE
 +ldt_ss:
 +	larl OLDSS(%esp), %eax
 +	jnz restore_nocheck
@@ -3223,14 +3200,16 @@
 +	.align 4
 +	.long 1b,iret_exc
 +.previous
++	CFI_ENDPROC
 +#else
 +hypervisor_iret:
 +	andl $~NMI_MASK, EFLAGS(%esp)
 +	RESTORE_REGS
 +	addl $4, %esp
++	CFI_ADJUST_CFA_OFFSET -4
 +	jmp  hypercall_page + (__HYPERVISOR_iret * 32)
-+#endif
 +	CFI_ENDPROC
++#endif
 +
 +	# perform work that needs to be done immediately before resumption
 +	ALIGN
@@ -3359,7 +3338,7 @@
 +.rept NR_IRQS
 +	ALIGN
 + .if vector
-+	CFI_ADJUST_CFA_OFFSET -4
++ 	CFI_ADJUST_CFA_OFFSET -4
 + .endif
 +1:	pushl $~(vector)
 +	CFI_ADJUST_CFA_OFFSET 4
@@ -3385,11 +3364,10 @@
 +
 +#define BUILD_INTERRUPT(name, nr)	\
 +ENTRY(name)				\
-+	SAVE_ALL			\
 +	RING0_INT_FRAME;		\
 +	pushl $~(nr);			\
 +	CFI_ADJUST_CFA_OFFSET 4;	\
-+	SAVE_ALL;			\
++	SAVE_ALL			\
 +	TRACE_IRQS_OFF			\
 +	movl %esp,%eax;			\
 +	call smp_/**/name;		\
@@ -3488,16 +3466,15 @@
 +	jb   11f
 +	cmpl $sysexit_ecrit,%eax
 +	ja   11f
-+	# interrupted in sysexit critical
 +	addl $0x34,%esp			# Remove cs...ebx from stack frame.
-+	# this popped off new frame to reuse the old one, therefore no 
-+	# CFI_ADJUST_CFA_OFFSET here
++	CFI_ADJUST_CFA_OFFSET -52
 +11:	push %esp
 +	CFI_ADJUST_CFA_OFFSET 4
 +	call evtchn_do_upcall
 +	add  $4,%esp
 +	CFI_ADJUST_CFA_OFFSET -4
 +	jmp  ret_from_intr
++	CFI_ENDPROC
 +
 +        ALIGN
 +restore_all_enable_events:
@@ -3543,10 +3520,7 @@
 +	movl %eax,(%edi)
 +	loop 16b
 +17:	movl %edi,%esp			# final %edi is top of merged stack
-+	# this popped off new frame to reuse the old one, therefore no 
-+	# CFI_DEF_CFA_OFFSET here
 +	jmp  11b
-+	CFI_ENDPROC
 +
 +critical_fixup_table:
 +	.byte 0xff,0xff,0xff		# testb $0xff,(%esi) = __TEST_PENDING
@@ -3576,9 +3550,7 @@
 +# to pop the stack frame we end up in an infinite loop of failsafe callbacks.
 +# We distinguish between categories by maintaining a status value in EAX.
 +ENTRY(failsafe_callback)
-+	RING0_INT_FRAME
 +	pushl %eax
-+	CFI_ADJUST_CFA_OFFSET 4
 +	movl $1,%eax
 +1:	mov 4(%esp),%ds
 +2:	mov 8(%esp),%es
@@ -3586,16 +3558,11 @@
 +4:	mov 16(%esp),%gs
 +	testl %eax,%eax
 +	popl %eax
-+	CFI_ADJUST_CFA_OFFSET -4
 +	jz 5f
 +	addl $16,%esp		# EAX != 0 => Category 2 (Bad IRET)
-+	CFI_ADJUST_CFA_OFFSET -16
 +	jmp iret_exc
-+	CFI_ADJUST_CFA_OFFSET 16
 +5:	addl $16,%esp		# EAX == 0 => Category 1 (Bad segment)
-+	CFI_ADJUST_CFA_OFFSET -16
 +	pushl $0
-+	CFI_ADJUST_CFA_OFFSET 4
 +	SAVE_ALL
 +	jmp ret_from_exception
 +.section .fixup,"ax";		\
@@ -3619,7 +3586,6 @@
 +	.long 3b,8b;		\
 +	.long 4b,9b;		\
 +.previous
-+	CFI_ENDPROC
 +#endif
 +
 +ENTRY(coprocessor_error)
@@ -3655,6 +3621,7 @@
 +	addl $4, %esp
 +	CFI_ADJUST_CFA_OFFSET -4
 +	jmp ret_from_exception
++	CFI_ENDPROC
 +device_available_emulate:
 +#endif
 +	preempt_stop
@@ -3778,7 +3745,7 @@
 +	CFI_ADJUST_CFA_OFFSET 4
 +	SAVE_ALL
 +	FIXUP_ESPFIX_STACK		# %eax == %esp
-+	CFI_ADJUST_CFA_OFFSET -20	# the frame has now moved
++	CFI_ADJUST_CFA_OFFSET -20
 +	xorl %edx,%edx			# zero error code
 +	call do_nmi
 +	RESTORE_REGS
@@ -3789,18 +3756,16 @@
 +	.align 4
 +	.long 1b,iret_exc
 +.previous
++	CFI_ENDPROC
 +#else
 +ENTRY(nmi)
-+	RING0_INT_FRAME
 +	pushl %eax
-+	CFI_ADJUST_CFA_OFFSET 4
 +	SAVE_ALL
 +	xorl %edx,%edx		# zero error code
 +	movl %esp,%eax		# pt_regs pointer
 +	call do_nmi
 +	orl  $NMI_MASK, EFLAGS(%esp)
 +	jmp restore_all
-+	CFI_ENDPROC
 +#endif
 +
 +KPROBE_ENTRY(int3)
@@ -3948,10 +3913,10 @@
 +#include "syscall_table.S"
 +
 +syscall_table_size=(.-sys_call_table)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/fixup.c linux-2.6.18-rc6-xen/arch/i386/kernel/fixup.c
---- linux-2.6.18-rc6/arch/i386/kernel/fixup.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/fixup.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,92 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/fixup.c linux-2.6.18-xen/arch/i386/kernel/fixup.c
+--- linux-2.6.18/arch/i386/kernel/fixup.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/fixup.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,85 @@
 +/******************************************************************************
 + * fixup.c
 + * 
@@ -3992,7 +3957,6 @@
 +
 +fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
 +{
-+#if 0
 +	static unsigned long printed = 0;
 +	char info[100];
 +	int i;
@@ -4029,12 +3993,6 @@
 +	}
 +
 +	printk("Continuing...\n\n");
-+#else
-+	if (printk_ratelimit())
-+		printk(KERN_WARNING
-+		       "4gb seg fixup, process %s (pid %d), cs:ip %02x:%08lx\n",
-+		       current->comm, current->tgid, regs->xcs, regs->eip);
-+#endif
 +}
 +
 +static int __init fixup_init(void)
@@ -4044,14 +4002,13 @@
 +	return 0;
 +}
 +__initcall(fixup_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/head-xen.S linux-2.6.18-rc6-xen/arch/i386/kernel/head-xen.S
---- linux-2.6.18-rc6/arch/i386/kernel/head-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/head-xen.S	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,200 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/head-xen.S linux-2.6.18-xen/arch/i386/kernel/head-xen.S
+--- linux-2.6.18/arch/i386/kernel/head-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/head-xen.S	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,181 @@
 +
 +
 +.text
-+#include <linux/elfnote.h>
 +#include <linux/threads.h>
 +#include <linux/linkage.h>
 +#include <asm/segment.h>
@@ -4059,7 +4016,6 @@
 +#include <asm/thread_info.h>
 +#include <asm/asm-offsets.h>
 +#include <xen/interface/arch-x86_32.h>
-+#include <xen/interface/elfnote.h>
 +
 +/*
 + * References to members of the new_cpu_data structure.
@@ -4110,7 +4066,8 @@
 +	movl %eax,%gs
 +	cld			# gcc2 wants the direction flag cleared at all times
 +
-+	call start_kernel
++	pushl %eax		# fake return address
++	jmp start_kernel
 +L6:
 +	jmp L6			# main should never return here, but
 +				# just in case, we know what happens.
@@ -4189,7 +4146,6 @@
 +	.quad 0x0000000000000000	/* 0xf0 - unused */
 +	.quad 0x0000000000000000	/* 0xf8 - GDT entry 31: double-fault TSS */
 +
-+#ifdef CONFIG_XEN_COMPAT_030002
 +/*
 + * __xen_guest information
 + */
@@ -4209,8 +4165,12 @@
 +	.ascii	",XEN_VER=xen-3.0"
 +	.ascii	",VIRT_BASE=0x"
 +		utoa __PAGE_OFFSET
++#ifdef CONFIG_XEN_COMPAT_030002
 +	.ascii	",ELF_PADDR_OFFSET=0x"
 +		utoa __PAGE_OFFSET
++#else
++	.ascii	",ELF_PADDR_OFFSET=0x0"
++#endif /* !CONFIG_XEN_COMPAT_030002 */
 +	.ascii	",VIRT_ENTRY=0x"
 +		utoa (__PAGE_OFFSET + __PHYSICAL_START + VIRT_ENTRY_OFFSET)
 +	.ascii	",HYPERCALL_PAGE=0x"
@@ -4227,30 +4187,9 @@
 +#endif
 +	.ascii	",LOADER=generic"
 +	.byte	0
-+#endif /* CONFIG_XEN_COMPAT_030002 */
-+
-+
-+	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz, "linux")	
-+	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz, "2.6")
-+	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz, "xen-3.0")
-+	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .long,  __PAGE_OFFSET)
-+#ifdef CONFIG_XEN_COMPAT_030002
-+	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .long,  __PAGE_OFFSET)
-+#else
-+	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .long,  0)
-+#endif /* !CONFIG_XEN_COMPAT_030002 */
-+	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .long,  startup_32)
-+	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long,  hypercall_page)
-+	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
-+#ifdef CONFIG_X86_PAE
-+	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
-+#else
-+	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "no")
-+#endif
-+	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/init_task-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/init_task-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/init_task-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/init_task-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/init_task-xen.c linux-2.6.18-xen/arch/i386/kernel/init_task-xen.c
+--- linux-2.6.18/arch/i386/kernel/init_task-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/init_task-xen.c	2006-05-26 22:00:01.000000000 +0200
 @@ -0,0 +1,51 @@
 +#include <linux/mm.h>
 +#include <linux/module.h>
@@ -4303,10 +4242,10 @@
 +DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_internodealigned_in_smp = INIT_TSS;
 +#endif
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/io_apic-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/io_apic-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/io_apic-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/io_apic-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,2771 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/io_apic-xen.c linux-2.6.18-xen/arch/i386/kernel/io_apic-xen.c
+--- linux-2.6.18/arch/i386/kernel/io_apic-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/io_apic-xen.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,2768 @@
 +/*
 + *	Intel IO-APIC support for multi-Pentium hosts.
 + *
@@ -4890,8 +4829,8 @@
 +	}
 +
 +	cpus_and(allowed_mask,
-+		 cpu_online_map,
-+		 balance_irq_affinity[selected_irq]);
++		cpu_online_map,
++		balance_irq_affinity[selected_irq]);
 +	target_cpu_mask = cpumask_of_cpu(min_loaded);
 +	cpus_and(tmp, target_cpu_mask, allowed_mask);
 +
@@ -4932,7 +4871,7 @@
 +	
 +	/* push everything to CPU 0 to give us a starting point.  */
 +	for (i = 0 ; i < NR_IRQS ; i++) {
-+		irq_desc[i].pending_mask[i] = cpumask_of_cpu(0);
++		irq_desc[i].pending_mask = cpumask_of_cpu(0);
 +		set_pending_irq(i, cpumask_of_cpu(0));
 +	}
 +
@@ -5520,15 +5459,13 @@
 +{
 +	struct physdev_irq irq_op;
 +	unsigned long flags;
++	int vector;
 +
 +	BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS);
 +
-+	spin_lock_irqsave(&vector_lock, flags);
-+
-+	if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0) {
-+		spin_unlock_irqrestore(&vector_lock, flags);
++	if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0)
 +		return IO_APIC_VECTOR(irq);
-+	}
++
 +	irq_op.irq = irq;
 +	if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op))
 +		return -ENOSPC;
@@ -5537,8 +5474,6 @@
 +	if (irq != AUTO_ASSIGN)
 +		IO_APIC_VECTOR(irq) = irq_op.vector;
 +
-+	spin_unlock_irqrestore(&vector_lock, flags);
-+
 +	return irq_op.vector;
 +}
 +
@@ -6624,9 +6559,9 @@
 +	io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry0) + 0));
 +	spin_unlock_irqrestore(&ioapic_lock, flags);
 +}
-+#endif /* CONFIG_XEN */
++
 +int timer_uses_ioapic_pin_0;
-+#ifdef CONFI_XEN
++
 +/*
 + * This code may look a bit paranoid, but it's supposed to cooperate with
 + * a wide range of boards and BIOS bugs.  Fortunately only the timer IRQ
@@ -6751,6 +6686,7 @@
 +		"report.  Then try booting with the 'noapic' option");
 +}
 +#else
++int timer_uses_ioapic_pin_0;
 +#define check_timer() ((void)0)
 +#endif
 +
@@ -7078,10 +7014,10 @@
 +}
 +
 +#endif /* CONFIG_ACPI */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/ioport-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/ioport-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/ioport-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/ioport-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,121 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/ioport-xen.c linux-2.6.18-xen/arch/i386/kernel/ioport-xen.c
+--- linux-2.6.18/arch/i386/kernel/ioport-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/ioport-xen.c	2006-08-15 13:03:12.000000000 +0200
+@@ -0,0 +1,122 @@
 +/*
 + *	linux/arch/i386/kernel/ioport.c
 + *
@@ -7163,6 +7099,7 @@
 +
 +		memset(bitmap, 0xff, IO_BITMAP_BYTES);
 +		t->io_bitmap_ptr = bitmap;
++		set_thread_flag(TIF_IO_BITMAP);
 +
 +		set_iobitmap.bitmap   = (char *)bitmap;
 +		set_iobitmap.nr_ports = IO_BITMAP_BITS;
@@ -7203,9 +7140,9 @@
 +	set_iopl_mask(t->iopl);
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/irq-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/irq-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/irq-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/irq-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/irq-xen.c linux-2.6.18-xen/arch/i386/kernel/irq-xen.c
+--- linux-2.6.18/arch/i386/kernel/irq-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/irq-xen.c	2006-09-17 17:44:46.000000000 +0200
 @@ -0,0 +1,324 @@
 +/*
 + *	linux/arch/i386/kernel/irq.c
@@ -7316,7 +7253,7 @@
 +		 */
 +		irqctx->tinfo.preempt_count =
 +			(irqctx->tinfo.preempt_count & ~SOFTIRQ_MASK) |
-+			 (curctx->tinfo.preempt_count & SOFTIRQ_MASK);
++			(curctx->tinfo.preempt_count & SOFTIRQ_MASK);
 +
 +		asm volatile(
 +			"       xchgl   %%ebx,%%esp      \n"
@@ -7446,7 +7383,7 @@
 +	if (i == 0) {
 +		seq_printf(p, "           ");
 +		for_each_online_cpu(j)
-+			seq_printf(p, "CPU%-8d       ",j);
++			seq_printf(p, "CPU%-8d",j);
 +		seq_putc(p, '\n');
 +	}
 +
@@ -7531,9 +7468,9 @@
 +}
 +#endif
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/ldt-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/ldt-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/ldt-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/ldt-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/ldt-xen.c linux-2.6.18-xen/arch/i386/kernel/ldt-xen.c
+--- linux-2.6.18/arch/i386/kernel/ldt-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/ldt-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,270 @@
 +/*
 + * linux/kernel/ldt.c
@@ -7805,10 +7742,10 @@
 +	}
 +	return ret;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/Makefile linux-2.6.18-rc6-xen/arch/i386/kernel/Makefile
---- linux-2.6.18-rc6/arch/i386/kernel/Makefile	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/Makefile	2006-09-04 16:31:00.000000000 +0200
-@@ -45,6 +45,12 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/Makefile linux-2.6.18-xen/arch/i386/kernel/Makefile
+--- linux-2.6.18/arch/i386/kernel/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/Makefile	2006-09-20 13:58:38.000000000 +0200
+@@ -44,6 +44,12 @@
  
  obj-$(CONFIG_SCx200)		+= scx200.o
  
@@ -7821,7 +7758,7 @@
  # vsyscall.o contains the vsyscall DSO images as __initdata.
  # We must build both images before we can assemble it.
  # Note: kbuild does not track this dependency due to usage of .incbin
-@@ -66,7 +72,7 @@
+@@ -65,7 +71,7 @@
  
  $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
  $(obj)/vsyscall-%.so: $(src)/vsyscall.lds \
@@ -7830,7 +7767,7 @@
  	$(call if_changed,syscall)
  
  # We also create a special relocatable object that should mirror the symbol
-@@ -78,8 +84,19 @@
+@@ -77,8 +83,20 @@
  
  SYSCFLAGS_vsyscall-syms.o = -r
  $(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
@@ -7838,8 +7775,6 @@
 +			$(obj)/vsyscall-sysenter.o $(obj)/$(vsyscall_note) FORCE
  	$(call if_changed,syscall)
  
- k8-y                      += ../../x86_64/kernel/k8.o
- 
 +ifdef CONFIG_XEN
 +include $(srctree)/scripts/Makefile.xen
 +
@@ -7851,10 +7786,13 @@
 +obj-y := $(call cherrypickxen, $(obj-y))
 +extra-y := $(call cherrypickxen, $(extra-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/microcode-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/microcode-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/microcode-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/microcode-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,147 @@
++
+ k8-y                      += ../../x86_64/kernel/k8.o
+ 
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/microcode-xen.c linux-2.6.18-xen/arch/i386/kernel/microcode-xen.c
+--- linux-2.6.18/arch/i386/kernel/microcode-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/microcode-xen.c	2006-08-15 13:03:12.000000000 +0200
+@@ -0,0 +1,150 @@
 +/*
 + *	Intel CPU Microcode Update Driver for Linux
 + *
@@ -7899,8 +7837,11 @@
 +MODULE_DESCRIPTION("Intel CPU (IA-32) Microcode Update Driver");
 +MODULE_AUTHOR("Tigran Aivazian <tigran at veritas.com>");
 +MODULE_LICENSE("GPL");
++  
++static int verbose;
++module_param(verbose, int, 0644);
 +
-+#define MICROCODE_VERSION 	"1.14-xen"
++#define MICROCODE_VERSION 	"1.14a-xen"
 +
 +#define DEFAULT_UCODE_DATASIZE 	(2000) 	  /* 2000 bytes */
 +#define MC_HEADER_SIZE		(sizeof (microcode_header_t))  	  /* 48 bytes */
@@ -8002,9 +7943,9 @@
 +module_init(microcode_init)
 +module_exit(microcode_exit)
 +MODULE_ALIAS_MISCDEV(MICROCODE_MINOR);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/mpparse-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/mpparse-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/mpparse-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/mpparse-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/mpparse-xen.c linux-2.6.18-xen/arch/i386/kernel/mpparse-xen.c
+--- linux-2.6.18/arch/i386/kernel/mpparse-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/mpparse-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,1185 @@
 +/*
 + *	Intel Multiprocessor Specification 1.1 and 1.4
@@ -9191,10 +9132,10 @@
 +
 +#endif /* CONFIG_X86_IO_APIC */
 +#endif /* CONFIG_ACPI */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/pci-dma-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/pci-dma-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/pci-dma-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/pci-dma-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,379 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/pci-dma-xen.c linux-2.6.18-xen/arch/i386/kernel/pci-dma-xen.c
+--- linux-2.6.18/arch/i386/kernel/pci-dma-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/pci-dma-xen.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,377 @@
 +/*
 + * Dynamic DMA mapping support.
 + *
@@ -9243,6 +9184,10 @@
 +/* Set this to 1 if there is a HW IOMMU in the system */
 +int iommu_detected __read_mostly = 0;
 +
++__init int iommu_setup(char *p)
++{
++    return 1;
++}
 +void __init pci_iommu_alloc(void)
 +{
 +	/*
@@ -9254,7 +9199,6 @@
 +#endif
 +
 +#ifdef CONFIG_CALGARY_IOMMU
-+#include <asm/calgary.h>
 +	detect_calgary();
 +#endif
 +
@@ -9262,11 +9206,6 @@
 +	pci_swiotlb_init();
 +#endif
 +}
-+
-+__init int iommu_setup(char *p)
-+{
-+    return 1;
-+}
 +#endif
 +
 +struct dma_coherent_mem {
@@ -9574,9 +9513,9 @@
 +		swiotlb_sync_single_for_device(dev, dma_handle, size, direction);
 +}
 +EXPORT_SYMBOL(dma_sync_single_for_device);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/process-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/process-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/process-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/process-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/process-xen.c linux-2.6.18-xen/arch/i386/kernel/process-xen.c
+--- linux-2.6.18/arch/i386/kernel/process-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/process-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,812 @@
 +/*
 + *  linux/arch/i386/kernel/process.c
@@ -9640,6 +9579,9 @@
 +#include <asm/tlbflush.h>
 +#include <asm/cpu.h>
 +
++#include <asm/tlbflush.h>
++#include <asm/cpu.h>
++
 +asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 +
 +static int hlt_counter;
@@ -9724,7 +9666,6 @@
 +
 +	current_thread_info()->status |= TS_POLLING;
 +
-+
 +	/* endless idle loop with no priority at all */
 +	while (1) {
 +		while (!need_resched()) {
@@ -9857,12 +9798,10 @@
 +	if (unlikely(test_thread_flag(TIF_IO_BITMAP))) {
 +		struct task_struct *tsk = current;
 +		struct thread_struct *t = &tsk->thread;
-+
 +		struct physdev_set_iobitmap set_iobitmap = { 0 };
 +		HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap);
 +		kfree(t->io_bitmap_ptr);
 +		t->io_bitmap_ptr = NULL;
-+		clear_thread_flag(TIF_IO_BITMAP);
 +	}
 +}
 +
@@ -10165,7 +10104,7 @@
 +	/*
 +	 * Now maybe reload the debug registers
 +	 */
-+	if (unlikely(next->debugreg[7])) {
++	if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
 +		set_debugreg(next->debugreg[0], 0);
 +		set_debugreg(next->debugreg[1], 1);
 +		set_debugreg(next->debugreg[2], 2);
@@ -10390,9 +10329,9 @@
 +		sp -= get_random_int() % 8192;
 +	return sp & ~0xf;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/quirks-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/quirks-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/quirks-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/quirks-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/quirks-xen.c linux-2.6.18-xen/arch/i386/kernel/quirks-xen.c
+--- linux-2.6.18/arch/i386/kernel/quirks-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/quirks-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,47 @@
 +/*
 + * This file contains work-arounds for x86 and x86_64 platform bugs.
@@ -10441,10 +10380,10 @@
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7525_MCH,	quirk_intel_irqbalance);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7520_MCH,	quirk_intel_irqbalance);
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/setup-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/setup-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/setup-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/setup-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,1815 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/setup-xen.c linux-2.6.18-xen/arch/i386/kernel/setup-xen.c
+--- linux-2.6.18/arch/i386/kernel/setup-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/setup-xen.c	2006-09-20 13:58:38.000000000 +0200
+@@ -0,0 +1,1850 @@
 +/*
 + *  linux/arch/i386/kernel/setup.c
 + *
@@ -10490,6 +10429,9 @@
 +#include <linux/init.h>
 +#include <linux/edd.h>
 +#include <linux/nodemask.h>
++#include <linux/kernel.h>
++#include <linux/percpu.h>
++#include <linux/notifier.h>
 +#include <linux/kexec.h>
 +#include <linux/crash_dump.h>
 +#include <linux/dmi.h>
@@ -10510,7 +10452,7 @@
 +#include <xen/interface/physdev.h>
 +#include <xen/interface/memory.h>
 +#include <xen/features.h>
-+#include "setup_arch.h"
++#include <setup_arch.h>
 +#include <bios_ebda.h>
 +
 +/* Forward Declaration. */
@@ -10781,6 +10723,8 @@
 +		/* if checksum okay, trust length byte */
 +		if (length && romchecksum(rom, length))
 +			video_rom_resource.end = start + length - 1;
++
++		request_resource(&iomem_resource, &video_rom_resource);
 +		break;
 +	}
 +
@@ -10839,7 +10783,7 @@
 +EXPORT_SYMBOL(xen_start_info);
 +
 +void __init add_memory_region(unsigned long long start,
-+                                  unsigned long long size, int type)
++			      unsigned long long size, int type)
 +{
 +	int x;
 +
@@ -11452,6 +11396,38 @@
 +	return 0;
 +}
 +
++ /*
++  * This function checks if the entire range <start,end> is mapped with type.
++  *
++  * Note: this function only works correct if the e820 table is sorted and
++  * not-overlapping, which is the case
++  */
++int __init
++e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
++{
++	u64 start = s;
++	u64 end = e;
++	int i;
++	for (i = 0; i < e820.nr_map; i++) {
++		struct e820entry *ei = &e820.map[i];
++		if (type && ei->type != type)
++			continue;
++		/* is the region (part) in overlap with the current region ?*/
++		if (ei->addr >= end || ei->addr + ei->size <= start)
++			continue;
++		/* if the region is at the beginning of <start,end> we move
++		 * start to the end of the region since it's ok until there
++		 */
++		if (ei->addr <= start)
++			start = ei->addr + ei->size;
++		/* if start is now at or beyond end, we're done, full
++		 * coverage */
++		if (start >= end)
++			return 1; /* we're done */
++	}
++	return 0;
++}
++
 +/*
 + * Find the highest page frame number we have available
 + */
@@ -11811,8 +11787,10 @@
 +
 +	for (i = 0; i < nr_map; i++) {
 +		struct resource *res;
++#ifndef CONFIG_RESOURCES_64BIT
 +		if (map[i].addr + map[i].size > 0x100000000ULL)
 +			continue;
++#endif
 +		res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
 +		switch (map[i].type) {
 +		case E820_RAM:	res->name = "System RAM"; break;
@@ -11833,10 +11811,8 @@
 +			 *  so we try it repeatedly and let the resource manager
 +			 *  test it.
 +			 */
-+#ifndef CONFIG_XEN
 +			request_resource(res, code_resource);
 +			request_resource(res, data_resource);
-+#endif
 +#ifdef CONFIG_KEXEC
 +			request_resource(res, &crashk_res);
 +#endif
@@ -12223,9 +12199,7 @@
 +		extern int console_use_vt;
 +		console_use_vt = 0;
 +	}
-+#ifdef CONFIG_X86_TSC
 +	tsc_init();
-+#endif
 +}
 +
 +static int
@@ -12260,9 +12234,9 @@
 + * c-basic-offset:8
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/smp-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/smp-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/smp-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/smp-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/smp-xen.c linux-2.6.18-xen/arch/i386/kernel/smp-xen.c
+--- linux-2.6.18/arch/i386/kernel/smp-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/smp-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,624 @@
 +/*
 + *	Intel SMP support routines.
@@ -12888,9 +12862,9 @@
 +	return IRQ_HANDLED;
 +}
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/swiotlb.c linux-2.6.18-rc6-xen/arch/i386/kernel/swiotlb.c
---- linux-2.6.18-rc6/arch/i386/kernel/swiotlb.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/swiotlb.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/swiotlb.c linux-2.6.18-xen/arch/i386/kernel/swiotlb.c
+--- linux-2.6.18/arch/i386/kernel/swiotlb.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/swiotlb.c	2006-09-17 17:44:46.000000000 +0200
 @@ -0,0 +1,672 @@
 +/*
 + * Dynamic DMA mapping support.
@@ -13564,9 +13538,9 @@
 +EXPORT_SYMBOL(swiotlb_unmap_page);
 +EXPORT_SYMBOL(swiotlb_dma_mapping_error);
 +EXPORT_SYMBOL(swiotlb_dma_supported);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/sysenter.c linux-2.6.18-rc6-xen/arch/i386/kernel/sysenter.c
---- linux-2.6.18-rc6/arch/i386/kernel/sysenter.c	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/sysenter.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/sysenter.c linux-2.6.18-xen/arch/i386/kernel/sysenter.c
+--- linux-2.6.18/arch/i386/kernel/sysenter.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/sysenter.c	2006-08-15 13:03:12.000000000 +0200
 @@ -23,6 +23,10 @@
  #include <asm/pgtable.h>
  #include <asm/unistd.h>
@@ -13626,10 +13600,10 @@
  
  	if (!boot_cpu_has(X86_FEATURE_SEP)) {
  		memcpy(syscall_page,
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/time-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/time-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/time-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/time-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,1101 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/time-xen.c linux-2.6.18-xen/arch/i386/kernel/time-xen.c
+--- linux-2.6.18/arch/i386/kernel/time-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/time-xen.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,1118 @@
 +/*
 + *  linux/arch/i386/kernel/time.c
 + *
@@ -13720,13 +13694,6 @@
 +struct timezone __sys_tz __section_sys_tz;
 +#endif
 +
-+#define USEC_PER_TICK (USEC_PER_SEC / HZ)
-+#define NSEC_PER_TICK (NSEC_PER_SEC / HZ)
-+#define FSEC_PER_TICK (FSEC_PER_SEC / HZ)
-+
-+#define NS_SCALE	10 /* 2^10, carefully chosen */
-+#define US_SCALE	32 /* 2^32, arbitralrily chosen */
-+
 +unsigned int cpu_khz;	/* Detected as we calibrate the TSC */
 +EXPORT_SYMBOL(cpu_khz);
 +
@@ -13735,9 +13702,19 @@
 +DEFINE_SPINLOCK(rtc_lock);
 +EXPORT_SYMBOL(rtc_lock);
 +
++#if 0
++#if defined (__i386__)
++#include <asm/i8253.h>
++#endif
++
++DEFINE_SPINLOCK(i8253_lock);
++EXPORT_SYMBOL(i8253_lock);
++
 +extern struct init_timer_opts timer_tsc_init;
 +extern struct timer_opts timer_tsc;
 +#define timer_none timer_tsc
++struct timer_opts *cur_timer __read_mostly = &timer_tsc;
++#endif
 +
 +/* These are peridically updated in shared_info, and then copied here. */
 +struct shadow_time_info {
@@ -13796,7 +13773,7 @@
 +}
 +__setup("permitted_clock_jitter=", __permitted_clock_jitter);
 +
-+#ifndef CONFIG_X86
++#if 0
 +int tsc_disable __devinitdata = 0;
 +#endif
 +
@@ -13811,10 +13788,12 @@
 +	} while ((now - bclock) < loops);
 +}
 +
++#if 0
 +struct timer_opts timer_tsc = {
 +	.name = "tsc",
 +	.delay = delay_tsc,
 +};
++#endif
 +
 +/*
 + * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
@@ -13842,7 +13821,7 @@
 +		"add  %4,%%eax ; "
 +		"adc  %5,%%edx ; "
 +		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
-+		: "a" ((u32)delta), "1" ((u32)(delta >> US_SCALE)), "2" (mul_frac) );
++		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
 +#else
 +	__asm__ (
 +		"mul %%rdx ; shrd $32,%%rdx,%%rax"
@@ -13852,6 +13831,7 @@
 +	return product;
 +}
 +
++#if 0
 +#if defined (__i386__)
 +int read_current_timer(unsigned long *timer_val)
 +{
@@ -13859,10 +13839,11 @@
 +	return 0;
 +}
 +#endif
++#endif
 +
 +void init_cpu_khz(void)
 +{
-+	u64 __cpu_khz = 1000000ULL << US_SCALE;
++	u64 __cpu_khz = 1000000ULL << 32;
 +	struct vcpu_time_info *info;
 +	info = &HYPERVISOR_shared_info->vcpu_info[0].time;
 +	do_div(__cpu_khz, info->tsc_to_system_mul);
@@ -14001,6 +13982,7 @@
 + * This version of gettimeofday has microsecond resolution
 + * and better than microsecond precision on fast x86 machines with TSC.
 + */
++#ifdef __x86_64__
 +void do_gettimeofday(struct timeval *tv)
 +{
 +	unsigned long seq;
@@ -14124,6 +14106,7 @@
 +}
 +
 +EXPORT_SYMBOL(do_settimeofday);
++#endif
 +
 +static void sync_xen_wallclock(unsigned long dummy);
 +static DEFINE_TIMER(sync_xen_wallclock_timer, sync_xen_wallclock, 0, 0);
@@ -14159,18 +14142,19 @@
 +static int set_rtc_mmss(unsigned long nowtime)
 +{
 +	int retval;
-+	unsigned long flags;
++
++	WARN_ON(irqs_disabled());
 +
 +	if (independent_wallclock || !is_initial_xendomain())
 +		return 0;
 +
 +	/* gets recalled with irq locally disabled */
-+	spin_lock_irqsave(&rtc_lock, flags);
++	spin_lock_irq(&rtc_lock);
 +	if (efi_enabled)
 +		retval = efi_set_rtc_mmss(nowtime);
 +	else
 +		retval = mach_set_rtc_mmss(nowtime);
-+	spin_unlock_irqrestore(&rtc_lock, flags);
++	spin_unlock_irq(&rtc_lock);
 +
 +	return retval;
 +}
@@ -14201,10 +14185,12 @@
 +}
 +EXPORT_SYMBOL(monotonic_clock);
 +
++#ifdef __x86_64__
 +unsigned long long sched_clock(void)
 +{
 +	return monotonic_clock();
 +}
++#endif
 +
 +#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
 +unsigned long profile_pc(struct pt_regs *regs)
@@ -14218,7 +14204,7 @@
 +	   is just accounted to the spinlock function.
 +	   Better would be to write these functions in assembler again
 +	   and check exactly. */
-+	if (!user_mode_vm(regs) && in_lock_functions(pc)) {
++	if (!user_mode(regs) && in_lock_functions(pc)) {
 +		char *v = *(char **)regs->rsp;
 +		if ((v >= _stext && v <= _etext) ||
 +			(v >= _sinittext && v <= _einittext) ||
@@ -14439,6 +14425,7 @@
 +
 +static long clock_cmos_diff, sleep_start;
 +
++static struct timer_opts *last_timer;
 +static int timer_suspend(struct sys_device *dev, pm_message_t state)
 +{
 +	/*
@@ -14508,6 +14495,10 @@
 +	if ((hpet_enable() >= 0) && hpet_use_timer) {
 +		printk("Using HPET for base-timer\n");
 +	}
++
++	cur_timer = select_timer();
++	printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);
++
 +	time_init_hook();
 +}
 +#endif
@@ -14555,8 +14546,8 @@
 +
 +#if defined(__x86_64__)
 +	vxtime.mode = VXTIME_TSC;
-+	vxtime.quot = (1000000L << US_SCALE) / vxtime_hz;
-+	vxtime.tsc_quot = (1000L << US_SCALE) / cpu_khz;
++	vxtime.quot = (1000000L << 32) / vxtime_hz;
++	vxtime.tsc_quot = (1000L << 32) / cpu_khz;
 +	sync_core();
 +	rdtscll(vxtime.last_tsc);
 +#endif
@@ -14731,9 +14722,9 @@
 +	return 0;
 +}
 +__initcall(xen_sysctl_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/traps.c linux-2.6.18-rc6-xen/arch/i386/kernel/traps.c
---- linux-2.6.18-rc6/arch/i386/kernel/traps.c	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/traps.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/traps.c linux-2.6.18-xen/arch/i386/kernel/traps.c
+--- linux-2.6.18/arch/i386/kernel/traps.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/traps.c	2006-09-17 17:44:46.000000000 +0200
 @@ -642,18 +642,11 @@
  
  static void io_check_error(unsigned char reason, struct pt_regs * regs)
@@ -14754,10 +14745,10 @@
  }
  
  static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/traps-xen.c linux-2.6.18-rc6-xen/arch/i386/kernel/traps-xen.c
---- linux-2.6.18-rc6/arch/i386/kernel/traps-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/traps-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,1184 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/traps-xen.c linux-2.6.18-xen/arch/i386/kernel/traps-xen.c
+--- linux-2.6.18/arch/i386/kernel/traps-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/traps-xen.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,1186 @@
 +/*
 + *  linux/arch/i386/traps.c
 + *
@@ -14968,8 +14959,9 @@
 +					printk("Full inexact backtrace again:\n");
 +			} else if (call_trace >= 1)
 +				return;
-+		} else
++			else
 +				printk("Full inexact backtrace again:\n");
++		} else
 +			printk("Inexact backtrace:\n");
 +	}
 +
@@ -15114,6 +15106,7 @@
 +		return;
 +
 +	printk(KERN_EMERG "------------[ cut here ]------------\n");
++
 +#ifdef CONFIG_DEBUG_BUGVERBOSE
 +	do {
 +		unsigned short line;
@@ -15942,28 +15935,9 @@
 +}
 +__setup("call_trace=", call_trace_setup);
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/tsc.c linux-2.6.18-rc6-xen/arch/i386/kernel/tsc.c
---- linux-2.6.18-rc6/arch/i386/kernel/tsc.c	2006-09-05 10:53:00.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/tsc.c	2006-09-04 16:31:00.000000000 +0200
-@@ -101,6 +101,7 @@
- 	return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
- }
- 
-+#ifndef CONFIG_XEN
- /*
-  * Scheduler clock - returns current time in nanosec units.
-  */
-@@ -124,6 +125,7 @@
- 	/* return the value in ns */
- 	return cycles_2_ns(this_offset);
- }
-+#endif
- 
- static unsigned long calculate_cpu_khz(void)
- {
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/vm86.c linux-2.6.18-rc6-xen/arch/i386/kernel/vm86.c
---- linux-2.6.18-rc6/arch/i386/kernel/vm86.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/vm86.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/vm86.c linux-2.6.18-xen/arch/i386/kernel/vm86.c
+--- linux-2.6.18/arch/i386/kernel/vm86.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/kernel/vm86.c	2006-08-15 13:03:12.000000000 +0200
 @@ -97,7 +97,9 @@
  struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs));
  struct pt_regs * fastcall save_v86_state(struct kernel_vm86_regs * regs)
@@ -16018,50 +15992,9 @@
  
  	tsk->thread.screen_bitmap = info->screen_bitmap;
  	if (info->flags & VM86_SCREEN_BITMAP)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/vmlinux.lds.S linux-2.6.18-rc6-xen/arch/i386/kernel/vmlinux.lds.S
---- linux-2.6.18-rc6/arch/i386/kernel/vmlinux.lds.S	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/vmlinux.lds.S	2006-09-04 16:31:00.000000000 +0200
-@@ -13,6 +13,12 @@
- OUTPUT_ARCH(i386)
- ENTRY(phys_startup_32)
- jiffies = jiffies_64;
-+
-+PHDRS {
-+	text PT_LOAD FLAGS(5);	/* R_E */
-+	data PT_LOAD FLAGS(7);	/* RWE */
-+	note PT_NOTE FLAGS(4);	/* R__ */
-+}
- SECTIONS
- {
-   . = __KERNEL_START;
-@@ -26,7 +32,7 @@
- 	KPROBES_TEXT
- 	*(.fixup)
- 	*(.gnu.warning)
--	} = 0x9090
-+	} :text = 0x9090
- 
-   _etext = .;			/* End of text section */
- 
-@@ -48,7 +54,7 @@
-   .data : AT(ADDR(.data) - LOAD_OFFSET) {	/* Data */
- 	*(.data)
- 	CONSTRUCTORS
--	}
-+	} :data
- 
-   . = ALIGN(4096);
-   __nosave_begin = .;
-@@ -184,4 +190,6 @@
-   STABS_DEBUG
- 
-   DWARF_DEBUG
-+
-+  NOTES
- }
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/kernel/vsyscall-note-xen.S linux-2.6.18-rc6-xen/arch/i386/kernel/vsyscall-note-xen.S
---- linux-2.6.18-rc6/arch/i386/kernel/vsyscall-note-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/kernel/vsyscall-note-xen.S	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/kernel/vsyscall-note-xen.S linux-2.6.18-xen/arch/i386/kernel/vsyscall-note-xen.S
+--- linux-2.6.18/arch/i386/kernel/vsyscall-note-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/kernel/vsyscall-note-xen.S	2006-05-26 22:00:01.000000000 +0200
 @@ -0,0 +1,32 @@
 +/*
 + * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text.
@@ -16095,29 +16028,9 @@
 +NOTE_KERNELCAP_BEGIN(1, 1)
 +NOTE_KERNELCAP(1, "nosegneg")  /* Change 1 back to 0 when glibc is fixed! */
 +NOTE_KERNELCAP_END
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/lib/delay.c linux-2.6.18-rc6-xen/arch/i386/lib/delay.c
---- linux-2.6.18-rc6/arch/i386/lib/delay.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/lib/delay.c	2006-09-04 16:31:00.000000000 +0200
-@@ -61,6 +61,7 @@
- 	delay_fn = delay_tsc;
- }
- 
-+#ifndef CONFIG_X86_XEN
- int read_current_timer(unsigned long *timer_val)
- {
- 	if (delay_fn == delay_tsc) {
-@@ -69,7 +70,7 @@
- 	}
- 	return -1;
- }
--
-+#endif
- void __delay(unsigned long loops)
- {
- 	delay_fn(loops);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mach-xen/irqflags.c linux-2.6.18-rc6-xen/arch/i386/mach-xen/irqflags.c
---- linux-2.6.18-rc6/arch/i386/mach-xen/irqflags.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mach-xen/irqflags.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mach-xen/irqflags.c linux-2.6.18-xen/arch/i386/mach-xen/irqflags.c
+--- linux-2.6.18/arch/i386/mach-xen/irqflags.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mach-xen/irqflags.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,99 @@
 +#include <linux/module.h>
 +#include <linux/smp.h>
@@ -16218,32 +16131,31 @@
 +	return flags;
 +}
 +EXPORT_SYMBOL(__raw_local_irq_save);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mach-xen/Makefile linux-2.6.18-rc6-xen/arch/i386/mach-xen/Makefile
---- linux-2.6.18-rc6/arch/i386/mach-xen/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mach-xen/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mach-xen/Makefile linux-2.6.18-xen/arch/i386/mach-xen/Makefile
+--- linux-2.6.18/arch/i386/mach-xen/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mach-xen/Makefile	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,5 @@
 +#
 +# Makefile for the linux kernel.
 +#
 +
 +obj-y				:= setup.o irqflags.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mach-xen/setup.c linux-2.6.18-rc6-xen/arch/i386/mach-xen/setup.c
---- linux-2.6.18-rc6/arch/i386/mach-xen/setup.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mach-xen/setup.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,153 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mach-xen/setup.c linux-2.6.18-xen/arch/i386/mach-xen/setup.c
+--- linux-2.6.18/arch/i386/mach-xen/setup.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mach-xen/setup.c	2006-08-15 13:03:12.000000000 +0200
+@@ -0,0 +1,144 @@
 +/*
 + *	Machine specific setup for generic
 + */
 +
++#include <linux/module.h>
 +#include <linux/smp.h>
 +#include <linux/init.h>
 +#include <linux/interrupt.h>
-+#include <linux/module.h>
 +#include <asm/acpi.h>
 +#include <asm/arch_hooks.h>
 +#include <asm/e820.h>
 +#include <asm/setup.h>
-+
 +#include <xen/interface/callback.h>
 +#include <xen/interface/memory.h>
 +
@@ -16275,12 +16187,16 @@
 +late_initcall(print_ipi_mode);
 +
 +/**
-+ * machine_specific_memory_setup - Hook for machine specific memory setup.
++ * pre_setup_arch_hook - hook called prior to any setup_arch() execution
 + *
 + * Description:
-+ *	This is included late in kernel/setup.c so that it can make
-+ *	use of all of the static functions.
++ *	generally used to activate any machine specific identification
++ *	routines that may be needed before setup_arch() runs.  On VISWS
++ *	this is used to get the board revision and type.
 + **/
++void __init pre_setup_arch_hook(void)
++{
++}
 +
 +char * __init machine_specific_memory_setup(void)
 +{
@@ -16372,21 +16288,9 @@
 +	while ((1UL << machine_to_phys_order) < machine_to_phys_nr_ents )
 +		machine_to_phys_order++;
 +}
-+
-+/**
-+ * pre_setup_arch_hook - hook called prior to any setup_arch() execution
-+ *
-+ * Description:
-+ *	generally used to activate any machine specific identification
-+ *	routines that may be needed before setup_arch() runs.  On VISWS
-+ *	this is used to get the board revision and type.
-+ **/
-+void __init pre_setup_arch_hook(void)
-+{
-+}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/Makefile linux-2.6.18-rc6-xen/arch/i386/Makefile
---- linux-2.6.18-rc6/arch/i386/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/Makefile linux-2.6.18-xen/arch/i386/Makefile
+--- linux-2.6.18/arch/i386/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/Makefile	2006-05-26 22:00:00.000000000 +0200
 @@ -48,6 +48,11 @@
  
  CFLAGS += $(cflags-y)
@@ -16443,10 +16347,10 @@
  	       arch/$(ARCH)/boot/image.iso \
  	       arch/$(ARCH)/boot/mtools.conf
 +CLEAN_FILES += vmlinuz vmlinux-stripped
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/fault-xen.c linux-2.6.18-rc6-xen/arch/i386/mm/fault-xen.c
---- linux-2.6.18-rc6/arch/i386/mm/fault-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/fault-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,770 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/fault-xen.c linux-2.6.18-xen/arch/i386/mm/fault-xen.c
+--- linux-2.6.18/arch/i386/mm/fault-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mm/fault-xen.c	2006-08-15 13:03:12.000000000 +0200
+@@ -0,0 +1,771 @@
 +/*
 + *  linux/arch/i386/mm/fault.c
 + *
@@ -16512,6 +16416,7 @@
 +}
 +#endif
 +
++
 +/*
 + * Unlock any spinlocks which will prevent us from getting the
 + * message out 
@@ -16559,6 +16464,9 @@
 +	unsigned seg = regs->xcs & 0xffff;
 +	u32 seg_ar, seg_limit, base, *desc;
 +
++	/* The standard kernel/user address space limit. */
++	*eip_limit = (seg & 2) ? USER_DS.seg : KERNEL_DS.seg;
++
 +	/* Unlikely, but must come before segment checks. */
 +	if (unlikely(regs->eflags & VM_MASK)) {
 +		base = seg << 4;
@@ -16566,9 +16474,6 @@
 +		return base + (eip & 0xffff);
 +	}
 +
-+	/* The standard kernel/user address space limit. */
-+	*eip_limit = (seg & 2) ? USER_DS.seg : KERNEL_DS.seg;
-+
 +	/* By far the most common cases. */
 +	if (likely(seg == __USER_CS || seg == GET_KERNEL_CS()))
 +		return eip;
@@ -17217,9 +17122,9 @@
 +	}
 +}
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/highmem-xen.c linux-2.6.18-rc6-xen/arch/i386/mm/highmem-xen.c
---- linux-2.6.18-rc6/arch/i386/mm/highmem-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/highmem-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/highmem-xen.c linux-2.6.18-xen/arch/i386/mm/highmem-xen.c
+--- linux-2.6.18/arch/i386/mm/highmem-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mm/highmem-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,133 @@
 +#include <linux/highmem.h>
 +#include <linux/module.h>
@@ -17354,9 +17259,9 @@
 +EXPORT_SYMBOL(kmap_atomic);
 +EXPORT_SYMBOL(kunmap_atomic);
 +EXPORT_SYMBOL(kmap_atomic_to_page);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/hypervisor.c linux-2.6.18-rc6-xen/arch/i386/mm/hypervisor.c
---- linux-2.6.18-rc6/arch/i386/mm/hypervisor.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/hypervisor.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/hypervisor.c linux-2.6.18-xen/arch/i386/mm/hypervisor.c
+--- linux-2.6.18/arch/i386/mm/hypervisor.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mm/hypervisor.c	2006-09-17 17:44:46.000000000 +0200
 @@ -0,0 +1,457 @@
 +/******************************************************************************
 + * mm/hypervisor.c
@@ -17815,10 +17720,10 @@
 +		mach_lp, (u64)entry_a | ((u64)entry_b<<32));
 +}
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/init-xen.c linux-2.6.18-rc6-xen/arch/i386/mm/init-xen.c
---- linux-2.6.18-rc6/arch/i386/mm/init-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/init-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,851 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/init-xen.c linux-2.6.18-xen/arch/i386/mm/init-xen.c
+--- linux-2.6.18/arch/i386/mm/init-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mm/init-xen.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,850 @@
 +/*
 + *  linux/arch/i386/mm/init.c
 + *
@@ -18545,7 +18450,7 @@
 + */
 +#ifdef CONFIG_MEMORY_HOTPLUG
 +#ifndef CONFIG_NEED_MULTIPLE_NODES
-+int arch_add_memory(u64 start, u64 size)
++int arch_add_memory(int nid, u64 start, u64 size)
 +{
 +	struct pglist_data *pgdata = &contig_page_data;
 +	struct zone *zone = pgdata->node_zones + MAX_NR_ZONES-1;
@@ -18631,7 +18536,6 @@
 +	printk("Write protecting the kernel read-only data: %uk\n",
 +			(__end_rodata - __start_rodata) >> 10);
 +
-+
 +	/*
 +	 * change_page_attr() requires a global_flush_tlb() call after it.
 +	 * We do this after the printk so that if something went wrong in the
@@ -18670,10 +18574,10 @@
 +}
 +#endif
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/ioremap-xen.c linux-2.6.18-rc6-xen/arch/i386/mm/ioremap-xen.c
---- linux-2.6.18-rc6/arch/i386/mm/ioremap-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/ioremap-xen.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,439 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/ioremap-xen.c linux-2.6.18-xen/arch/i386/mm/ioremap-xen.c
+--- linux-2.6.18/arch/i386/mm/ioremap-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mm/ioremap-xen.c	2006-09-17 17:44:46.000000000 +0200
+@@ -0,0 +1,478 @@
 +/*
 + * arch/i386/mm/ioremap.c
 + *
@@ -18698,6 +18602,15 @@
 +#define ISA_START_ADDRESS	0x0
 +#define ISA_END_ADDRESS		0x100000
 +
++#if 0 /* not PAE safe */
++/* These hacky macros avoid phys->machine translations. */
++#define __direct_pte(x) ((pte_t) { (x) } )
++#define __direct_mk_pte(page_nr,pgprot) \
++  __direct_pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
++#define direct_mk_pte_phys(physpage, pgprot) \
++  __direct_mk_pte((physpage) >> PAGE_SHIFT, pgprot)
++#endif
++
 +static int direct_remap_area_pte_fn(pte_t *pte, 
 +				    struct page *pmd_page,
 +				    unsigned long address, 
@@ -18733,16 +18646,17 @@
 +
 +	for (i = 0; i < size; i += PAGE_SIZE) {
 +		if ((v - u) == (PAGE_SIZE / sizeof(mmu_update_t))) {
-+			/* Flush a full batch after filling in the PTE ptrs. */
++			/* Fill in the PTE pointers. */
 +			rc = apply_to_page_range(mm, start_address, 
 +						 address - start_address,
 +						 direct_remap_area_pte_fn, &w);
 +			if (rc)
 +				goto out;
++			w = u;
 +			rc = -EFAULT;
 +			if (HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0)
 +				goto out;
-+			v = w = u;
++			v = u;
 +			start_address = address;
 +		}
 +
@@ -18758,7 +18672,7 @@
 +	}
 +
 +	if (v != u) {
-+		/* Final batch. */
++		/* get the ptep's filled in */
 +		rc = apply_to_page_range(mm, start_address,
 +					 address - start_address,
 +					 direct_remap_area_pte_fn, &w);
@@ -18845,6 +18759,32 @@
 +
 +EXPORT_SYMBOL(touch_pte_range);
 +
++void *vm_map_xen_pages (unsigned long maddr, int vm_size, pgprot_t prot)
++{
++	int error;
++       
++	struct vm_struct *vma;
++	vma = get_vm_area (vm_size, VM_IOREMAP);
++      
++	if (vma == NULL) {
++		printk ("ioremap.c,vm_map_xen_pages(): "
++			"Failed to get VMA area\n");
++		return NULL;
++	}
++
++	error = direct_kernel_remap_pfn_range((unsigned long) vma->addr,
++					      maddr >> PAGE_SHIFT, vm_size,
++					      prot, DOMID_SELF );
++	if (error == 0) {
++		return vma->addr;
++	} else {
++		printk ("ioremap.c,vm_map_xen_pages(): "
++			"Failed to map xen shared pages into kernel space\n");
++		return NULL;
++	}
++}
++EXPORT_SYMBOL(vm_map_xen_pages);
++
 +/*
 + * Does @address reside within a non-highmem page that is local to this virtual
 + * machine (i.e., not an I/O page, nor a memory page belonging to another VM).
@@ -18922,6 +18862,9 @@
 +	area->phys_addr = phys_addr;
 +	addr = (void __iomem *) area->addr;
 +	flags |= _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED;
++#ifdef __x86_64__
++	flags |= _PAGE_USER;
++#endif
 +	if (__direct_remap_pfn_range(&init_mm, (unsigned long)addr,
 +				     phys_addr>>PAGE_SHIFT,
 +				     size, __pgprot(flags), domid)) {
@@ -19113,9 +19056,9 @@
 +		--nrpages;
 +	}
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/Makefile linux-2.6.18-rc6-xen/arch/i386/mm/Makefile
---- linux-2.6.18-rc6/arch/i386/mm/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/Makefile linux-2.6.18-xen/arch/i386/mm/Makefile
+--- linux-2.6.18/arch/i386/mm/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/mm/Makefile	2006-05-26 22:00:01.000000000 +0200
 @@ -8,3 +8,11 @@
  obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
  obj-$(CONFIG_HIGHMEM) += highmem.o
@@ -19128,9 +19071,9 @@
 +
 +obj-y := $(call cherrypickxen, $(obj-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/pageattr.c linux-2.6.18-rc6-xen/arch/i386/mm/pageattr.c
---- linux-2.6.18-rc6/arch/i386/mm/pageattr.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/pageattr.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/pageattr.c linux-2.6.18-xen/arch/i386/mm/pageattr.c
+--- linux-2.6.18/arch/i386/mm/pageattr.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/mm/pageattr.c	2006-08-15 13:03:12.000000000 +0200
 @@ -84,7 +84,7 @@
  	unsigned long flags;
  
@@ -19140,9 +19083,9 @@
  		return;
  
  	spin_lock_irqsave(&pgd_lock, flags);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/pgtable.c linux-2.6.18-rc6-xen/arch/i386/mm/pgtable.c
---- linux-2.6.18-rc6/arch/i386/mm/pgtable.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/pgtable.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/pgtable.c linux-2.6.18-xen/arch/i386/mm/pgtable.c
+--- linux-2.6.18/arch/i386/mm/pgtable.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/mm/pgtable.c	2006-08-15 13:03:12.000000000 +0200
 @@ -12,6 +12,7 @@
  #include <linux/slab.h>
  #include <linux/pagemap.h>
@@ -19176,9 +19119,9 @@
  }
  
  pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/mm/pgtable-xen.c linux-2.6.18-rc6-xen/arch/i386/mm/pgtable-xen.c
---- linux-2.6.18-rc6/arch/i386/mm/pgtable-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/mm/pgtable-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/mm/pgtable-xen.c linux-2.6.18-xen/arch/i386/mm/pgtable-xen.c
+--- linux-2.6.18/arch/i386/mm/pgtable-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/mm/pgtable-xen.c	2006-08-15 13:03:12.000000000 +0200
 @@ -0,0 +1,699 @@
 +/*
 + *  linux/arch/i386/mm/pgtable.c
@@ -19879,9 +19822,9 @@
 +	    !mm->context.has_foreign_mappings)
 +		mm_unpin(mm);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/oprofile/Makefile linux-2.6.18-rc6-xen/arch/i386/oprofile/Makefile
---- linux-2.6.18-rc6/arch/i386/oprofile/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/oprofile/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/oprofile/Makefile linux-2.6.18-xen/arch/i386/oprofile/Makefile
+--- linux-2.6.18/arch/i386/oprofile/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/oprofile/Makefile	2006-05-26 22:00:01.000000000 +0200
 @@ -6,7 +6,11 @@
  		oprofilefs.o oprofile_stats.o  \
  		timer_int.o )
@@ -19894,10 +19837,10 @@
  					   op_model_ppro.o op_model_p4.o
  oprofile-$(CONFIG_X86_IO_APIC)		+= nmi_timer_int.o
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/oprofile/xenoprof.c linux-2.6.18-rc6-xen/arch/i386/oprofile/xenoprof.c
---- linux-2.6.18-rc6/arch/i386/oprofile/xenoprof.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/oprofile/xenoprof.c	2006-09-04 16:31:00.000000000 +0200
-@@ -0,0 +1,570 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/oprofile/xenoprof.c linux-2.6.18-xen/arch/i386/oprofile/xenoprof.c
+--- linux-2.6.18/arch/i386/oprofile/xenoprof.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/oprofile/xenoprof.c	2006-08-15 13:03:12.000000000 +0200
+@@ -0,0 +1,555 @@
 +/**
 + * @file xenoprof.c
 + *
@@ -19934,6 +19877,8 @@
 +static int xenoprof_start(void);
 +static void xenoprof_stop(void);
 +
++void * vm_map_xen_pages(unsigned long maddr, int vm_size, pgprot_t prot);
++
 +static int xenoprof_enabled = 0;
 +static unsigned int num_events = 0;
 +static int is_primary = 0;
@@ -20099,7 +20044,7 @@
 +{
 +	int i;
 +
-+	for_each_possible_cpu(i) {
++	for_each_online_cpu(i) {
 +		if (ovf_irq[i] >= 0) {
 +			unbind_from_irqhandler(ovf_irq[i], NULL);
 +			ovf_irq[i] = -1;
@@ -20112,7 +20057,7 @@
 +{
 +	int i, result;
 +
-+	for_each_possible_cpu(i) {
++	for_each_online_cpu(i) {
 +		result = bind_virq_to_irqhandler(VIRQ_XENOPROF,
 +						 i,
 +						 xenoprof_ovf_interrupt,
@@ -20271,9 +20216,9 @@
 +{
 +	int ret;
 +	int i, j;
++	int vm_size;
 +	int npages;
 +	struct xenoprof_buf *buf;
-+	struct vm_struct *area;
 +	pgprot_t prot = __pgprot(_KERNPG_TABLE);
 +
 +	if (!is_primary)
@@ -20289,30 +20234,20 @@
 +	for (i = 0; i < pdoms; i++) {
 +		passive_domains[i].domain_id = p_domains[i];
 +		passive_domains[i].max_samples = 2048;
-+		ret = HYPERVISOR_xenoprof_op(XENOPROF_set_passive,
-+					     &passive_domains[i]);
++		ret = HYPERVISOR_xenoprof_op(XENOPROF_set_passive, &passive_domains[i]);
 +		if (ret)
-+			goto out;
++			return ret;
 +
 +		npages = (passive_domains[i].bufsize * passive_domains[i].nbuf - 1) / PAGE_SIZE + 1;
++		vm_size = npages * PAGE_SIZE;
 +
-+		area = get_vm_area(npages * PAGE_SIZE, VM_IOREMAP);
-+		if (area == NULL) {
++		p_shared_buffer[i] = (char *)vm_map_xen_pages(passive_domains[i].buf_maddr,
++							      vm_size, prot);
++		if (!p_shared_buffer[i]) {
 +			ret = -ENOMEM;
 +			goto out;
 +		}
 +
-+		ret = direct_kernel_remap_pfn_range(
-+			(unsigned long)area->addr,
-+			passive_domains[i].buf_maddr >> PAGE_SHIFT,
-+			npages * PAGE_SIZE, prot, DOMID_SELF);
-+		if (ret) {
-+			vunmap(area->addr);
-+			goto out;
-+		}
-+
-+		p_shared_buffer[i] = area->addr;
-+
 +		for (j = 0; j < passive_domains[i].nbuf; j++) {
 +			buf = (struct xenoprof_buf *)
 +				&p_shared_buffer[i][j * passive_domains[i].bufsize];
@@ -20381,9 +20316,11 @@
 +int __init oprofile_arch_init(struct oprofile_operations * ops)
 +{
 +	struct xenoprof_init init;
-+	struct xenoprof_buf *buf;
-+	int npages, ret, i;
-+	struct vm_struct *area;
++	struct xenoprof_buf * buf;
++	int vm_size;
++	int npages;
++	int ret;
++	int i;
 +
 +	init.max_samples = 16;
 +	ret = HYPERVISOR_xenoprof_op(XENOPROF_init, &init);
@@ -20401,24 +20338,15 @@
 +			num_events = OP_MAX_COUNTER;
 +
 +		npages = (init.bufsize * nbuf - 1) / PAGE_SIZE + 1;
++		vm_size = npages * PAGE_SIZE;
 +
-+		area = get_vm_area(npages * PAGE_SIZE, VM_IOREMAP);
-+		if (area == NULL) {
++		shared_buffer = (char *)vm_map_xen_pages(init.buf_maddr,
++							 vm_size, prot);
++		if (!shared_buffer) {
 +			ret = -ENOMEM;
 +			goto out;
 +		}
 +
-+		ret = direct_kernel_remap_pfn_range(
-+			(unsigned long)area->addr,
-+			init.buf_maddr >> PAGE_SHIFT,
-+			npages * PAGE_SIZE, prot, DOMID_SELF);
-+		if (ret) {
-+			vunmap(area->addr);
-+			goto out;
-+		}
-+
-+		shared_buffer = area->addr;
-+
 +		for (i=0; i< nbuf; i++) {
 +			buf = (struct xenoprof_buf*) 
 +				&shared_buffer[i * init.bufsize];
@@ -20468,9 +20396,9 @@
 +        }
 +
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/pci/irq-xen.c linux-2.6.18-rc6-xen/arch/i386/pci/irq-xen.c
---- linux-2.6.18-rc6/arch/i386/pci/irq-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/pci/irq-xen.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/pci/irq-xen.c linux-2.6.18-xen/arch/i386/pci/irq-xen.c
+--- linux-2.6.18/arch/i386/pci/irq-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/pci/irq-xen.c	2006-09-17 17:44:46.000000000 +0200
 @@ -0,0 +1,1206 @@
 +/*
 + *	Low-Level PCI Support for PC -- Routing of Interrupts
@@ -21678,9 +21606,9 @@
 +
 +	return count;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/pci/Makefile linux-2.6.18-rc6-xen/arch/i386/pci/Makefile
---- linux-2.6.18-rc6/arch/i386/pci/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/pci/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/pci/Makefile linux-2.6.18-xen/arch/i386/pci/Makefile
+--- linux-2.6.18/arch/i386/pci/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/pci/Makefile	2006-05-26 22:00:01.000000000 +0200
 @@ -4,6 +4,10 @@
  obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig.o direct.o
  obj-$(CONFIG_PCI_DIRECT)	+= direct.o
@@ -21701,9 +21629,9 @@
 +include $(srctree)/scripts/Makefile.xen
 +obj-y := $(call cherrypickxen, $(obj-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/pci/pcifront.c linux-2.6.18-rc6-xen/arch/i386/pci/pcifront.c
---- linux-2.6.18-rc6/arch/i386/pci/pcifront.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/i386/pci/pcifront.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/pci/pcifront.c linux-2.6.18-xen/arch/i386/pci/pcifront.c
+--- linux-2.6.18/arch/i386/pci/pcifront.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/i386/pci/pcifront.c	2006-05-26 22:00:01.000000000 +0200
 @@ -0,0 +1,55 @@
 +/*
 + * PCI Frontend Stub - puts some "dummy" functions in to the Linux x86 PCI core
@@ -21760,24 +21688,24 @@
 +}
 +
 +arch_initcall(pcifront_x86_stub_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/i386/power/Makefile linux-2.6.18-rc6-xen/arch/i386/power/Makefile
---- linux-2.6.18-rc6/arch/i386/power/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/i386/power/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/i386/power/Makefile linux-2.6.18-xen/arch/i386/power/Makefile
+--- linux-2.6.18/arch/i386/power/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/i386/power/Makefile	2006-05-26 22:00:01.000000000 +0200
 @@ -1,2 +1,4 @@
 -obj-$(CONFIG_PM)		+= cpu.o
 +obj-$(CONFIG_PM_LEGACY)		+= cpu.o
 +obj-$(CONFIG_SOFTWARE_SUSPEND)	+= cpu.o
 +obj-$(CONFIG_ACPI_SLEEP)	+= cpu.o
  obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/dig/setup.c linux-2.6.18-rc6-xen/arch/ia64/dig/setup.c
---- linux-2.6.18-rc6/arch/ia64/dig/setup.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/dig/setup.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/dig/setup.c linux-2.6.18-xen/arch/ia64/dig/setup.c
+--- linux-2.6.18/arch/ia64/dig/setup.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/dig/setup.c	2006-09-17 17:44:47.000000000 +0200
 @@ -67,4 +67,38 @@
  	screen_info.orig_video_mode = 3;	/* XXX fake */
  	screen_info.orig_video_isVGA = 1;	/* XXX fake */
  	screen_info.orig_video_ega_bx = 3;	/* XXX fake */
 +#ifdef CONFIG_XEN
-+	if (!is_running_on_xen() || !is_initial_xendomain())
++	if (!is_running_on_xen())
 +		return;
 +
 +	if (xen_start_info->console.dom0.info_size >=
@@ -21811,18 +21739,18 @@
 +	xen_start_info->console.domU.evtchn = 0;
 +#endif
  }
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/hp/sim/Makefile linux-2.6.18-rc6-xen/arch/ia64/hp/sim/Makefile
---- linux-2.6.18-rc6/arch/ia64/hp/sim/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/hp/sim/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/hp/sim/Makefile linux-2.6.18-xen/arch/ia64/hp/sim/Makefile
+--- linux-2.6.18/arch/ia64/hp/sim/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/hp/sim/Makefile	2006-05-26 22:00:01.000000000 +0200
 @@ -14,3 +14,5 @@
  obj-$(CONFIG_HP_SIMSERIAL) += simserial.o
  obj-$(CONFIG_HP_SIMSERIAL_CONSOLE) += hpsim_console.o
  obj-$(CONFIG_HP_SIMSCSI) += simscsi.o
 +obj-$(CONFIG_XEN) += simserial.o
 +obj-$(CONFIG_XEN) += hpsim_console.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/Kconfig linux-2.6.18-rc6-xen/arch/ia64/Kconfig
---- linux-2.6.18-rc6/arch/ia64/Kconfig	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/Kconfig	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/Kconfig linux-2.6.18-xen/arch/ia64/Kconfig
+--- linux-2.6.18/arch/ia64/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/Kconfig	2006-09-20 13:58:38.000000000 +0200
 @@ -58,6 +58,20 @@
  	bool
  	default y
@@ -21844,7 +21772,7 @@
  config SCHED_NO_NO_OMIT_FRAME_POINTER
  	bool
  	default y
-@@ -461,6 +475,21 @@
+@@ -465,6 +479,21 @@
  	bool
  	default PCI
  
@@ -21866,7 +21794,7 @@
  source "drivers/pci/pcie/Kconfig"
  
  source "drivers/pci/Kconfig"
-@@ -524,3 +553,40 @@
+@@ -528,3 +557,40 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
@@ -21907,9 +21835,9 @@
 +endif
 +
 +source "drivers/xen/Kconfig"
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/asm-offsets.c linux-2.6.18-rc6-xen/arch/ia64/kernel/asm-offsets.c
---- linux-2.6.18-rc6/arch/ia64/kernel/asm-offsets.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/asm-offsets.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/asm-offsets.c linux-2.6.18-xen/arch/ia64/kernel/asm-offsets.c
+--- linux-2.6.18/arch/ia64/kernel/asm-offsets.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/asm-offsets.c	2006-08-15 13:03:13.000000000 +0200
 @@ -268,4 +268,29 @@
  	DEFINE(IA64_TIME_SOURCE_MMIO64, TIME_SOURCE_MMIO64);
  	DEFINE(IA64_TIME_SOURCE_MMIO32, TIME_SOURCE_MMIO32);
@@ -21940,9 +21868,9 @@
 +	DEFINE_MAPPED_REG_OFS(XSI_BANK1_R16_OFS, bank1_regs[0]);
 +#endif /* CONFIG_XEN */
  }
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/entry.S linux-2.6.18-rc6-xen/arch/ia64/kernel/entry.S
---- linux-2.6.18-rc6/arch/ia64/kernel/entry.S	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/entry.S	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/entry.S linux-2.6.18-xen/arch/ia64/kernel/entry.S
+--- linux-2.6.18/arch/ia64/kernel/entry.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/entry.S	2006-09-20 13:58:38.000000000 +0200
 @@ -180,7 +180,7 @@
   *	called.  The code starting at .map relies on this.  The rest of the code
   *	doesn't care about the interrupt masking status.
@@ -22062,9 +21990,9 @@
  	;;
  	mov ar.unat=r9
  	br.many b7
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/gate.lds.S linux-2.6.18-rc6-xen/arch/ia64/kernel/gate.lds.S
---- linux-2.6.18-rc6/arch/ia64/kernel/gate.lds.S	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/gate.lds.S	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/gate.lds.S linux-2.6.18-xen/arch/ia64/kernel/gate.lds.S
+--- linux-2.6.18/arch/ia64/kernel/gate.lds.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/gate.lds.S	2006-09-17 17:44:47.000000000 +0200
 @@ -43,6 +43,28 @@
  				    __start_gate_brl_fsys_bubble_down_patchlist = .;
  				    *(.data.patch.brl_fsys_bubble_down)
@@ -22094,17 +22022,18 @@
    }									:readable
    .IA_64.unwind_info		: { *(.IA_64.unwind_info*) }
    .IA_64.unwind			: { *(.IA_64.unwind*) }			:readable :unwind
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/gate.S linux-2.6.18-rc6-xen/arch/ia64/kernel/gate.S
---- linux-2.6.18-rc6/arch/ia64/kernel/gate.S	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/gate.S	2006-09-04 16:31:00.000000000 +0200
-@@ -6,13 +6,15 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/gate.S linux-2.6.18-xen/arch/ia64/kernel/gate.S
+--- linux-2.6.18/arch/ia64/kernel/gate.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/gate.S	2006-09-17 17:44:47.000000000 +0200
+@@ -6,6 +6,7 @@
   * 	David Mosberger-Tang <davidm at hpl.hp.com>
   */
  
--
++#include <linux/config.h>
+ 
  #include <asm/asmmacro.h>
  #include <asm/errno.h>
- #include <asm/asm-offsets.h>
+@@ -13,6 +14,9 @@
  #include <asm/sigcontext.h>
  #include <asm/system.h>
  #include <asm/unistd.h>
@@ -22114,7 +22043,7 @@
  
  /*
   * We can't easily refer to symbols inside the kernel.  To avoid full runtime relocation,
-@@ -32,6 +34,52 @@
+@@ -32,6 +36,52 @@
  [1:](pr)brl.cond.sptk 0;				\
  	.xdata4 ".data.patch.brl_fsys_bubble_down", 1b-.
  
@@ -22167,7 +22096,7 @@
  GLOBAL_ENTRY(__kernel_syscall_via_break)
  	.prologue
  	.altrp b6
-@@ -76,7 +124,39 @@
+@@ -76,7 +126,39 @@
  	epc					// B	causes split-issue
  }
  	;;
@@ -22207,7 +22136,7 @@
  	LOAD_FSYSCALL_TABLE(r14)		// X
  	;;
  	mov r16=IA64_KR(CURRENT)		// M2 (12 cyc)
-@@ -84,7 +164,14 @@
+@@ -84,7 +166,14 @@
  	mov r19=NR_syscalls-1			// A
  	;;
  	lfetch [r18]				// M0|1
@@ -22222,7 +22151,7 @@
  	// If r17 is a NaT, p6 will be zero
  	cmp.geu p6,p7=r19,r17			// A    (sysnr > 0 && sysnr < 1024+NR_syscalls)?
  	;;
-@@ -98,9 +185,21 @@
+@@ -98,9 +187,21 @@
  	;;
  	nop.m 0
  (p6)	tbit.z.unc p8,p0=r18,0			// I0 (dual-issues with "mov b7=r18"!)
@@ -22244,7 +22173,7 @@
  (p6)	mov b7=r18				// I0
  (p8)	br.dptk.many b7				// B
  
-@@ -121,9 +220,21 @@
+@@ -121,9 +222,21 @@
  #else
  	BRL_COND_FSYS_BUBBLE_DOWN(p6)
  #endif
@@ -22266,10 +22195,10 @@
  (p9)	mov r8=ENOSYS
  	FSYS_RETURN
  END(__kernel_syscall_via_epc)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/head.S linux-2.6.18-rc6-xen/arch/ia64/kernel/head.S
---- linux-2.6.18-rc6/arch/ia64/kernel/head.S	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/head.S	2006-09-04 16:31:00.000000000 +0200
-@@ -362,6 +362,12 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/head.S linux-2.6.18-xen/arch/ia64/kernel/head.S
+--- linux-2.6.18/arch/ia64/kernel/head.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/head.S	2006-09-20 13:58:38.000000000 +0200
+@@ -367,6 +367,12 @@
  	;;
  (isBP)	st8 [r2]=r28		// save the address of the boot param area passed by the bootloader
  
@@ -22282,9 +22211,9 @@
  #ifdef CONFIG_SMP
  (isAP)	br.call.sptk.many rp=start_secondary
  .ret0:
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/iosapic.c linux-2.6.18-rc6-xen/arch/ia64/kernel/iosapic.c
---- linux-2.6.18-rc6/arch/ia64/kernel/iosapic.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/iosapic.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/iosapic.c linux-2.6.18-xen/arch/ia64/kernel/iosapic.c
+--- linux-2.6.18/arch/ia64/kernel/iosapic.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/iosapic.c	2006-08-15 13:03:13.000000000 +0200
 @@ -159,6 +159,65 @@
  static int iosapic_kmalloc_ok;
  static LIST_HEAD(free_rte_list);
@@ -22371,9 +22300,9 @@
  	if (pcat_compat) {
  		/*
  		 * Disable the compatibility mode interrupts (8259 style),
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/irq_ia64.c linux-2.6.18-rc6-xen/arch/ia64/kernel/irq_ia64.c
---- linux-2.6.18-rc6/arch/ia64/kernel/irq_ia64.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/irq_ia64.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/irq_ia64.c linux-2.6.18-xen/arch/ia64/kernel/irq_ia64.c
+--- linux-2.6.18/arch/ia64/kernel/irq_ia64.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/irq_ia64.c	2006-08-15 13:03:13.000000000 +0200
 @@ -30,6 +30,9 @@
  #include <linux/smp_lock.h>
  #include <linux/threads.h>
@@ -22398,7 +22327,7 @@
   again:
  	pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
  	vector = IA64_FIRST_DEVICE_VECTOR + pos;
-@@ -240,14 +250,215 @@
+@@ -240,12 +250,209 @@
  };
  #endif
  
@@ -22607,14 +22536,8 @@
 +
  	for (irq = 0; irq < NR_IRQS; ++irq)
  		if (irq_to_vector(irq) == vec) {
-+#ifdef CONFIG_XEN
-+			if (is_running_on_xen())
-+				return xen_register_percpu_irq(vec, action, 1);
-+#endif
  			desc = irq_desc + irq;
- 			desc->status |= IRQ_PER_CPU;
- 			desc->chip = &irq_type_ia64_lsapic;
-@@ -259,6 +470,21 @@
+@@ -259,6 +466,21 @@
  void __init
  init_IRQ (void)
  {
@@ -22636,7 +22559,7 @@
  	register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL);
  #ifdef CONFIG_SMP
  	register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction);
-@@ -276,6 +502,39 @@
+@@ -276,6 +498,39 @@
  	unsigned long ipi_data;
  	unsigned long phys_cpu_id;
  
@@ -22676,9 +22599,9 @@
  #ifdef CONFIG_SMP
  	phys_cpu_id = cpu_physical_id(cpu);
  #else
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/pal.S linux-2.6.18-rc6-xen/arch/ia64/kernel/pal.S
---- linux-2.6.18-rc6/arch/ia64/kernel/pal.S	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/pal.S	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/pal.S linux-2.6.18-xen/arch/ia64/kernel/pal.S
+--- linux-2.6.18/arch/ia64/kernel/pal.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/pal.S	2006-09-17 17:44:47.000000000 +0200
 @@ -16,6 +16,7 @@
  #include <asm/processor.h>
  
@@ -22705,9 +22628,9 @@
  
  /*
   * Make a PAL call using the stacked registers calling convention.
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/patch.c linux-2.6.18-rc6-xen/arch/ia64/kernel/patch.c
---- linux-2.6.18-rc6/arch/ia64/kernel/patch.c	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/patch.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/patch.c linux-2.6.18-xen/arch/ia64/kernel/patch.c
+--- linux-2.6.18/arch/ia64/kernel/patch.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/patch.c	2006-08-15 13:03:13.000000000 +0200
 @@ -184,6 +184,73 @@
  	ia64_srlz_i();
  }
@@ -22716,7 +22639,7 @@
 +extern char __start_gate_running_on_xen_patchlist[];
 +extern char __end_gate_running_on_xen_patchlist[];
 +
-+void __init
++void
 +patch_running_on_xen(unsigned long start, unsigned long end)
 +{
 +	extern int running_on_xen;
@@ -22733,7 +22656,7 @@
 +	ia64_srlz_i();
 +}
 +
-+static void __init
++static void
 +patch_brl_symaddr(unsigned long start, unsigned long end,
 +                  unsigned long symaddr)
 +{
@@ -22761,7 +22684,7 @@
 +	                  (unsigned long)__end_gate_brl_##name##_patchlist,   \
 +	                  (unsigned long)name)
 +
-+static void __init
++static void
 +patch_brl_in_vdso(void)
 +{
 +	EXTERN_PATCHLIST(xen_rsm_be_i);
@@ -22793,9 +22716,9 @@
  	ia64_patch_vtop(START(vtop), END(vtop));
  	ia64_patch_mckinley_e9(START(mckinley_e9), END(mckinley_e9));
  }
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/kernel/setup.c linux-2.6.18-rc6-xen/arch/ia64/kernel/setup.c
---- linux-2.6.18-rc6/arch/ia64/kernel/setup.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/kernel/setup.c	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/kernel/setup.c linux-2.6.18-xen/arch/ia64/kernel/setup.c
+--- linux-2.6.18/arch/ia64/kernel/setup.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/kernel/setup.c	2006-09-17 17:44:47.000000000 +0200
 @@ -60,6 +60,10 @@
  #include <asm/system.h>
  #include <asm/unistd.h>
@@ -22807,7 +22730,7 @@
  
  #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
  # error "struct cpuinfo_ia64 too big!"
-@@ -70,6 +74,22 @@
+@@ -70,6 +74,20 @@
  EXPORT_SYMBOL(__per_cpu_offset);
  #endif
  
@@ -22821,88 +22744,14 @@
 +}
 +
 +static struct notifier_block xen_panic_block = {
-+	.notifier_call	= xen_panic_event,
-+	.next		= NULL,
-+	.priority	= 0	/* try to go last */
++	xen_panic_event, NULL, 0 /* try to go last */
 +};
 +#endif
 +
  extern void ia64_setup_printk_clock(void);
  
  DEFINE_PER_CPU(struct cpuinfo_ia64, cpu_info);
-@@ -176,15 +196,33 @@
- 	return 0;
- }
- 
-+static int __init
-+rsvd_region_cmp(struct rsvd_region *lhs, struct rsvd_region *rhs)
-+{
-+	if (lhs->start > rhs->start)
-+		return 1;
-+	if (lhs->start < rhs->start)
-+		return -1;
-+
-+	if (lhs->end > rhs->end)
-+		return 1;
-+	if (lhs->end < rhs->end)
-+		return -1;
-+
-+	return 0;
-+}
-+
- static void __init
- sort_regions (struct rsvd_region *rsvd_region, int max)
- {
-+	int num = max;
- 	int j;
- 
- 	/* simple bubble sorting */
- 	while (max--) {
- 		for (j = 0; j < max; ++j) {
--			if (rsvd_region[j].start > rsvd_region[j+1].start) {
-+			if (rsvd_region_cmp(&rsvd_region[j],
-+					    &rsvd_region[j + 1]) > 0) {
- 				struct rsvd_region tmp;
- 				tmp = rsvd_region[j];
- 				rsvd_region[j] = rsvd_region[j + 1];
-@@ -192,6 +230,36 @@
- 			}
- 		}
- 	}
-+
-+	for (j = 0; j < num - 1; j++) {
-+		int k;
-+		unsigned long start = rsvd_region[j].start;
-+		unsigned long end = rsvd_region[j].end;
-+		int collapsed;
-+		
-+		for (k = j + 1; k < num; k++) {
-+			BUG_ON(start > rsvd_region[k].start);
-+			if (end < rsvd_region[k].start) {
-+				k--;
-+				break;
-+			}
-+			end = max(end, rsvd_region[k].end);
-+		}
-+		if (k == num)
-+			k--;
-+		rsvd_region[j].end = end;
-+		collapsed = k - j;
-+		num -= collapsed;
-+		for (k = j + 1; k < num; k++) {
-+			rsvd_region[k] = rsvd_region[k + collapsed];
-+		}
-+	}
-+
-+	num_rsvd_regions = num;
-+	for (j = 0; j < num; j++) {
-+		printk("rsvd_region[%d]: [0x%016lx, 0x%06lx)\n",
-+		       j, rsvd_region[j].start, rsvd_region[j].end);
-+	}
- }
- 
- /*
-@@ -242,6 +310,14 @@
+@@ -242,6 +260,14 @@
  	rsvd_region[n].end   = (unsigned long) ia64_imva(_end);
  	n++;
  
@@ -22917,7 +22766,7 @@
  #ifdef CONFIG_BLK_DEV_INITRD
  	if (ia64_boot_param->initrd_start) {
  		rsvd_region[n].start = (unsigned long)__va(ia64_boot_param->initrd_start);
-@@ -333,6 +409,16 @@
+@@ -333,6 +359,16 @@
  {
  	int earlycons = 0;
  
@@ -22934,7 +22783,7 @@
  #ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
  	{
  		extern int sn_serial_console_early_setup(void);
-@@ -402,6 +488,14 @@
+@@ -402,6 +438,14 @@
  {
  	unw_init();
  
@@ -22942,14 +22791,14 @@
 +	if (is_running_on_xen()) {
 +		setup_xen_features();
 +		/* Register a call for panic conditions. */
-+		atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);
++		notifier_chain_register(&panic_notifier_list, &xen_panic_block);
 +	}
 +#endif
 +
  	ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
  
  	*cmdline_p = __va(ia64_boot_param->command_line);
-@@ -478,6 +572,23 @@
+@@ -478,6 +522,23 @@
  			conswitchp = &vga_con;
  # endif
  	}
@@ -22973,17 +22822,15 @@
  #endif
  
  	/* enable IA-64 Machine Check Abort Handling unless disabled */
-@@ -486,6 +597,9 @@
+@@ -486,6 +547,7 @@
  
  	platform_setup(cmdline_p);
  	paging_init();
-+#ifdef CONFIG_XEN
 +	contiguous_bitmap_init(max_pfn);
-+#endif
  }
  
  /*
-@@ -870,6 +984,15 @@
+@@ -870,6 +932,15 @@
  	/* size of physical stacked register partition plus 8 bytes: */
  	__get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
  	platform_cpu_init();
@@ -22999,9 +22846,9 @@
  	pm_idle = default_idle;
  }
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/Makefile linux-2.6.18-rc6-xen/arch/ia64/Makefile
---- linux-2.6.18-rc6/arch/ia64/Makefile	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/Makefile linux-2.6.18-xen/arch/ia64/Makefile
+--- linux-2.6.18/arch/ia64/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/Makefile	2006-08-15 13:03:12.000000000 +0200
 @@ -45,6 +45,12 @@
  endif
  
@@ -23042,28 +22889,26 @@
  
  define archhelp
    echo '* compressed	- Build compressed kernel image'
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/mm/ioremap.c linux-2.6.18-rc6-xen/arch/ia64/mm/ioremap.c
---- linux-2.6.18-rc6/arch/ia64/mm/ioremap.c	2006-09-05 10:53:01.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/ia64/mm/ioremap.c	2006-09-04 16:31:00.000000000 +0200
-@@ -16,6 +16,9 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/mm/ioremap.c linux-2.6.18-xen/arch/ia64/mm/ioremap.c
+--- linux-2.6.18/arch/ia64/mm/ioremap.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/ia64/mm/ioremap.c	2006-09-17 17:44:47.000000000 +0200
+@@ -16,6 +16,7 @@
  static inline void __iomem *
  __ioremap (unsigned long offset, unsigned long size)
  {
-+#ifdef CONFIG_XEN
 +	offset = HYPERVISOR_ioremap(offset, size);
-+#endif
  	return (void __iomem *) (__IA64_UNCACHED_OFFSET | offset);
  }
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/drivers/README linux-2.6.18-rc6-xen/arch/ia64/xen/drivers/README
---- linux-2.6.18-rc6/arch/ia64/xen/drivers/README	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/drivers/README	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/drivers/README linux-2.6.18-xen/arch/ia64/xen/drivers/README
+--- linux-2.6.18/arch/ia64/xen/drivers/README	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/drivers/README	2006-05-26 22:00:02.000000000 +0200
 @@ -0,0 +1,2 @@
 +This is a temporary location for source/Makefiles that need to be
 +patched/reworked in drivers/xen to work with xenlinux/ia64.
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/hypercall.S linux-2.6.18-rc6-xen/arch/ia64/xen/hypercall.S
---- linux-2.6.18-rc6/arch/ia64/xen/hypercall.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/hypercall.S	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/hypercall.S linux-2.6.18-xen/arch/ia64/xen/hypercall.S
+--- linux-2.6.18/arch/ia64/xen/hypercall.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/hypercall.S	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,413 @@
 +/*
 + * Support routines for Xen hypercalls
@@ -23478,10 +23323,10 @@
 +	;; 
 +END(xen_ssm_i_1)
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/hypervisor.c linux-2.6.18-rc6-xen/arch/ia64/xen/hypervisor.c
---- linux-2.6.18-rc6/arch/ia64/xen/hypervisor.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/hypervisor.c	2006-09-04 16:31:01.000000000 +0200
-@@ -0,0 +1,833 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/hypervisor.c linux-2.6.18-xen/arch/ia64/xen/hypervisor.c
+--- linux-2.6.18/arch/ia64/xen/hypervisor.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/hypervisor.c	2006-09-17 17:44:47.000000000 +0200
+@@ -0,0 +1,810 @@
 +/******************************************************************************
 + * include/asm-ia64/shadow.h
 + *
@@ -23855,8 +23700,6 @@
 +int
 +HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
 +{
-+	__u64 va1, va2, pa1, pa2;
-+
 +	if (cmd == GNTTABOP_map_grant_ref) {
 +		unsigned int i;
 +		for (i = 0; i < count; i++) {
@@ -23864,29 +23707,8 @@
 +				(struct gnttab_map_grant_ref*)uop + i);
 +		}
 +	}
-+	va1 = (__u64)uop & PAGE_MASK;
-+	pa1 = pa2 = 0;
-+	if ((REGION_NUMBER(va1) == 5) &&
-+	    ((va1 - KERNEL_START) >= KERNEL_TR_PAGE_SIZE)) {
-+		pa1 = ia64_tpa(va1);
-+		if (cmd <= GNTTABOP_transfer) {
-+			static uint32_t uop_size[GNTTABOP_transfer + 1] = {
-+				sizeof(struct gnttab_map_grant_ref),
-+				sizeof(struct gnttab_unmap_grant_ref),
-+				sizeof(struct gnttab_setup_table),
-+				sizeof(struct gnttab_dump_table),
-+				sizeof(struct gnttab_transfer),
-+			};
-+			va2 = (__u64)uop + (uop_size[cmd] * count) - 1;
-+			va2 &= PAGE_MASK;
-+			if (va1 != va2) {
-+				/* maximum size of uop is 2pages */
-+				BUG_ON(va2 > va1 + PAGE_SIZE);
-+				pa2 = ia64_tpa(va2);
-+			}
-+		}
-+	}
-+	return ____HYPERVISOR_grant_table_op(cmd, uop, count, pa1, pa2);
++
++	return ____HYPERVISOR_grant_table_op(cmd, uop, count);
 +}
 +EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
 +
@@ -24315,9 +24137,9 @@
 +	/* Just trigger a tick.  */
 +	ia64_cpu_local_tick();
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/Makefile linux-2.6.18-rc6-xen/arch/ia64/xen/Makefile
---- linux-2.6.18-rc6/arch/ia64/xen/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/Makefile	2006-09-04 16:31:00.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/Makefile linux-2.6.18-xen/arch/ia64/xen/Makefile
+--- linux-2.6.18/arch/ia64/xen/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/Makefile	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,8 @@
 +#
 +# Makefile for Xen components
@@ -24327,9 +24149,9 @@
 +	 hypervisor.o pci-dma-xen.o util.o
 +
 +pci-dma-xen-y := ../../i386/kernel/pci-dma-xen.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/util.c linux-2.6.18-rc6-xen/arch/ia64/xen/util.c
---- linux-2.6.18-rc6/arch/ia64/xen/util.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/util.c	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/util.c linux-2.6.18-xen/arch/ia64/xen/util.c
+--- linux-2.6.18/arch/ia64/xen/util.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/util.c	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,115 @@
 +/******************************************************************************
 + * arch/ia64/xen/util.c
@@ -24446,9 +24268,9 @@
 + *  tab-width: 8
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/xenentry.S linux-2.6.18-rc6-xen/arch/ia64/xen/xenentry.S
---- linux-2.6.18-rc6/arch/ia64/xen/xenentry.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/xenentry.S	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/xenentry.S linux-2.6.18-xen/arch/ia64/xen/xenentry.S
+--- linux-2.6.18/arch/ia64/xen/xenentry.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/xenentry.S	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,867 @@
 +/*
 + * ia64/xen/entry.S
@@ -25317,9 +25139,9 @@
 +#else
 +END(ia64_leave_kernel)
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/xenhpski.c linux-2.6.18-rc6-xen/arch/ia64/xen/xenhpski.c
---- linux-2.6.18-rc6/arch/ia64/xen/xenhpski.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/xenhpski.c	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/xenhpski.c linux-2.6.18-xen/arch/ia64/xen/xenhpski.c
+--- linux-2.6.18/arch/ia64/xen/xenhpski.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/xenhpski.c	2006-05-26 22:00:02.000000000 +0200
 @@ -0,0 +1,19 @@
 +
 +extern unsigned long xen_get_cpuid(int);
@@ -25340,9 +25162,9 @@
 +	return 1;
 +}
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/xenivt.S linux-2.6.18-rc6-xen/arch/ia64/xen/xenivt.S
---- linux-2.6.18-rc6/arch/ia64/xen/xenivt.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/xenivt.S	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/xenivt.S linux-2.6.18-xen/arch/ia64/xen/xenivt.S
+--- linux-2.6.18/arch/ia64/xen/xenivt.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/xenivt.S	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,2169 @@
 +/*
 + * arch/ia64/xen/ivt.S
@@ -27513,9 +27335,9 @@
 +	br.call.sptk.many b6=evtchn_do_upcall
 +END(xen_event_callback)
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/xenminstate.h linux-2.6.18-rc6-xen/arch/ia64/xen/xenminstate.h
---- linux-2.6.18-rc6/arch/ia64/xen/xenminstate.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/xenminstate.h	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/xenminstate.h linux-2.6.18-xen/arch/ia64/xen/xenminstate.h
+--- linux-2.6.18/arch/ia64/xen/xenminstate.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/xenminstate.h	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,368 @@
 +
 +#include <asm/cache.h>
@@ -27885,9 +27707,9 @@
 +#else
 +#define SAVE_MIN		DO_SAVE_MIN(     , mov r30=r0, )
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/xenpal.S linux-2.6.18-rc6-xen/arch/ia64/xen/xenpal.S
---- linux-2.6.18-rc6/arch/ia64/xen/xenpal.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/xenpal.S	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/xenpal.S linux-2.6.18-xen/arch/ia64/xen/xenpal.S
+--- linux-2.6.18/arch/ia64/xen/xenpal.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/xenpal.S	2006-08-15 13:03:13.000000000 +0200
 @@ -0,0 +1,76 @@
 +/*
 + * ia64/xen/xenpal.S
@@ -27965,9 +27787,9 @@
 +	srlz.d				// seralize restoration of psr.l
 +	br.ret.sptk.many b0
 +END(xen_pal_call_static)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/ia64/xen/xensetup.S linux-2.6.18-rc6-xen/arch/ia64/xen/xensetup.S
---- linux-2.6.18-rc6/arch/ia64/xen/xensetup.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/ia64/xen/xensetup.S	2006-09-04 16:31:01.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/ia64/xen/xensetup.S linux-2.6.18-xen/arch/ia64/xen/xensetup.S
+--- linux-2.6.18/arch/ia64/xen/xensetup.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/ia64/xen/xensetup.S	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,54 @@
 +/*
 + * Support routines for Xen
@@ -28023,9 +27845,9 @@
 +	mov ar.pfs=r20
 +	br.ret.sptk.many b0
 +END(HYPERVISOR_suspend)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/um/kernel/physmem.c linux-2.6.18-rc6-xen/arch/um/kernel/physmem.c
---- linux-2.6.18-rc6/arch/um/kernel/physmem.c	2006-09-05 10:53:09.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/um/kernel/physmem.c	2006-09-04 16:31:02.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/um/kernel/physmem.c linux-2.6.18-xen/arch/um/kernel/physmem.c
+--- linux-2.6.18/arch/um/kernel/physmem.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/um/kernel/physmem.c	2006-08-15 13:03:15.000000000 +0200
 @@ -226,7 +226,7 @@
  EXPORT_SYMBOL(physmem_remove_mapping);
  EXPORT_SYMBOL(physmem_subst_mapping);
@@ -28044,9 +27866,9 @@
  }
  
  int is_remapped(void *virt)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/ia32/ia32entry-xen.S linux-2.6.18-rc6-xen/arch/x86_64/ia32/ia32entry-xen.S
---- linux-2.6.18-rc6/arch/x86_64/ia32/ia32entry-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/ia32/ia32entry-xen.S	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/ia32/ia32entry-xen.S linux-2.6.18-xen/arch/x86_64/ia32/ia32entry-xen.S
+--- linux-2.6.18/arch/x86_64/ia32/ia32entry-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/ia32/ia32entry-xen.S	2006-08-15 13:03:15.000000000 +0200
 @@ -0,0 +1,743 @@
 +/*
 + * Compatibility mode system call entry point for x86-64. 
@@ -28143,11 +27965,11 @@
 +	__swapgs 
 +	movq	%gs:pda_kernelstack, %rsp
 +	addq	$(PDA_STACKOFFSET),%rsp
++	XEN_UNBLOCK_EVENTS(%r11)	
 +	/*
 +	 * No need to follow this irqs on/off section: the syscall
 +	 * disabled irqs, here we enable it straight after entry:
 +	 */
-+	XEN_UNBLOCK_EVENTS(%r11)	
 +	__sti
 + 	movl	%ebp,%ebp		/* zero extension */
 +	pushq	$__USER32_DS
@@ -28263,11 +28085,11 @@
 +	movl	%esp,%r8d
 +	CFI_REGISTER	rsp,r8
 +	movq	%gs:pda_kernelstack,%rsp
++	XEN_UNBLOCK_EVENTS(%r11)	
 +	/*
 +	 * No need to follow this irqs on/off section: the syscall
 +	 * disabled irqs and here we enable it straight after entry:
 +	 */
-+	XEN_UNBLOCK_EVENTS(%r11)	
 +	__sti
 +	SAVE_ARGS 8,1,1
 +	movl 	%eax,%eax	/* zero extension */
@@ -28372,11 +28194,11 @@
 +	/*CFI_REL_OFFSET	cs,CS-RIP*/
 +	CFI_REL_OFFSET	rip,RIP-RIP
 +	__swapgs
++	XEN_UNBLOCK_EVENTS(%r11)
 +	/*
 +	 * No need to follow this irqs on/off section: the syscall
 +	 * disabled irqs and here we enable it straight after entry:
 +	 */
-+	XEN_UNBLOCK_EVENTS(%r11)
 +	__sti
 +	movq (%rsp),%rcx
 +	movq 8(%rsp),%r11
@@ -28791,9 +28613,9 @@
 +	.quad compat_sys_vmsplice
 +	.quad compat_sys_move_pages
 +ia32_syscall_end:		
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/ia32/Makefile linux-2.6.18-rc6-xen/arch/x86_64/ia32/Makefile
---- linux-2.6.18-rc6/arch/x86_64/ia32/Makefile	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/ia32/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/ia32/Makefile linux-2.6.18-xen/arch/x86_64/ia32/Makefile
+--- linux-2.6.18/arch/x86_64/ia32/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/ia32/Makefile	2006-09-17 17:44:47.000000000 +0200
 @@ -27,9 +27,25 @@
  			   -Wl,-soname=linux-gate.so.1 -o $@ \
  			   -Wl,-T,$(filter-out FORCE,$^)
@@ -28822,9 +28644,9 @@
 +
 +obj-y := $(call cherrypickxen, $(obj-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/ia32/syscall32_syscall-xen.S linux-2.6.18-rc6-xen/arch/x86_64/ia32/syscall32_syscall-xen.S
---- linux-2.6.18-rc6/arch/x86_64/ia32/syscall32_syscall-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/ia32/syscall32_syscall-xen.S	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/ia32/syscall32_syscall-xen.S linux-2.6.18-xen/arch/x86_64/ia32/syscall32_syscall-xen.S
+--- linux-2.6.18/arch/x86_64/ia32/syscall32_syscall-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/ia32/syscall32_syscall-xen.S	2006-05-26 22:00:14.000000000 +0200
 @@ -0,0 +1,28 @@
 +/* 32bit VDSOs mapped into user space. */
 +
@@ -28854,9 +28676,9 @@
 +syscall32_sysenter:
 +	.incbin "arch/x86_64/ia32/vsyscall-sysenter.so"
 +syscall32_sysenter_end:
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/ia32/syscall32-xen.c linux-2.6.18-rc6-xen/arch/x86_64/ia32/syscall32-xen.c
---- linux-2.6.18-rc6/arch/x86_64/ia32/syscall32-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/ia32/syscall32-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/ia32/syscall32-xen.c linux-2.6.18-xen/arch/x86_64/ia32/syscall32-xen.c
+--- linux-2.6.18/arch/x86_64/ia32/syscall32-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/ia32/syscall32-xen.c	2006-05-26 22:00:14.000000000 +0200
 @@ -0,0 +1,128 @@
 +/* Copyright 2002,2003 Andi Kleen, SuSE Labs */
 +
@@ -28986,9 +28808,9 @@
 +	wrmsrl(MSR_CSTAR, ia32_cstar_target);
 +#endif
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/ia32/vsyscall-int80.S linux-2.6.18-rc6-xen/arch/x86_64/ia32/vsyscall-int80.S
---- linux-2.6.18-rc6/arch/x86_64/ia32/vsyscall-int80.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/ia32/vsyscall-int80.S	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/ia32/vsyscall-int80.S linux-2.6.18-xen/arch/x86_64/ia32/vsyscall-int80.S
+--- linux-2.6.18/arch/x86_64/ia32/vsyscall-int80.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/ia32/vsyscall-int80.S	2006-05-26 22:00:14.000000000 +0200
 @@ -0,0 +1,58 @@
 +/*
 + * Code for the vsyscall page.  This version uses the old int $0x80 method.
@@ -29048,9 +28870,9 @@
 + */
 +#define SYSCALL_ENTER_KERNEL    int $0x80
 +#include "vsyscall-sigreturn.S"
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/ia32/vsyscall-sigreturn.S linux-2.6.18-rc6-xen/arch/x86_64/ia32/vsyscall-sigreturn.S
---- linux-2.6.18-rc6/arch/x86_64/ia32/vsyscall-sigreturn.S	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/ia32/vsyscall-sigreturn.S	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/ia32/vsyscall-sigreturn.S linux-2.6.18-xen/arch/x86_64/ia32/vsyscall-sigreturn.S
+--- linux-2.6.18/arch/x86_64/ia32/vsyscall-sigreturn.S	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/ia32/vsyscall-sigreturn.S	2006-05-26 22:00:14.000000000 +0200
 @@ -139,5 +139,5 @@
  	.align 4
  .LENDFDE3:
@@ -29058,18 +28880,10 @@
 -#include "../../i386/kernel/vsyscall-note.S"
 +#include <vsyscall-note.S>
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/Kconfig linux-2.6.18-rc6-xen/arch/x86_64/Kconfig
---- linux-2.6.18-rc6/arch/x86_64/Kconfig	2006-09-05 10:53:09.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/Kconfig	2006-09-04 16:31:02.000000000 +0200
-@@ -30,6 +30,7 @@
- 
- config STACKTRACE_SUPPORT
- 	bool
-+	depends on !X86_64_XEN
- 	default y
- 
- config SEMAPHORE_SLEEPERS
-@@ -131,6 +132,22 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/Kconfig linux-2.6.18-xen/arch/x86_64/Kconfig
+--- linux-2.6.18/arch/x86_64/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/Kconfig	2006-09-20 13:58:38.000000000 +0200
+@@ -135,6 +135,22 @@
  
  endchoice
  
@@ -29092,7 +28906,7 @@
  #
  # Define implied options from the CPU selection here
  #
-@@ -151,6 +168,7 @@
+@@ -155,6 +171,7 @@
  
  config X86_TSC
  	bool
@@ -29100,7 +28914,7 @@
  	default y
  
  config X86_GOOD_APIC
-@@ -193,7 +211,7 @@
+@@ -197,7 +214,7 @@
  
  config X86_HT
  	bool
@@ -29109,7 +28923,7 @@
  	default y
  
  config MATH_EMULATION
-@@ -207,14 +225,22 @@
+@@ -211,14 +228,22 @@
  
  config X86_IO_APIC
  	bool
@@ -29132,7 +28946,7 @@
  	---help---
  	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
  	  the Memory Type Range Registers (MTRRs) may be used to control
-@@ -255,7 +281,7 @@
+@@ -259,7 +284,7 @@
  
  config SCHED_SMT
  	bool "SMT (Hyperthreading) scheduler support"
@@ -29141,7 +28955,7 @@
  	default n
  	help
  	  SMT scheduler support improves the CPU scheduler's decision making
-@@ -265,7 +291,7 @@
+@@ -269,7 +294,7 @@
  
  config SCHED_MC
  	bool "Multi-core scheduler support"
@@ -29150,7 +28964,7 @@
  	default y
  	help
  	  Multi-core scheduler support improves the CPU scheduler's decision
-@@ -276,7 +302,7 @@
+@@ -280,7 +305,7 @@
  
  config NUMA
         bool "Non Uniform Memory Access (NUMA) Support"
@@ -29159,7 +28973,7 @@
         help
  	 Enable NUMA (Non Uniform Memory Access) support. The kernel 
  	 will try to allocate memory used by a CPU on the local memory 
-@@ -337,7 +363,7 @@
+@@ -341,7 +366,7 @@
  
  config ARCH_SPARSEMEM_ENABLE
  	def_bool y
@@ -29168,7 +28982,7 @@
  
  config ARCH_MEMORY_PROBE
  	def_bool y
-@@ -361,6 +387,7 @@
+@@ -365,6 +390,7 @@
  	int "Maximum number of CPUs (2-256)"
  	range 2 255
  	depends on SMP
@@ -29176,7 +28990,7 @@
  	default "8"
  	help
  	  This allows you to specify the maximum number of CPUs which this
-@@ -383,6 +410,7 @@
+@@ -387,6 +413,7 @@
  
  config HPET_TIMER
  	bool
@@ -29184,7 +28998,7 @@
  	default y
  	help
  	  Use the IA-PC HPET (High Precision Event Timer) to manage
-@@ -403,7 +431,7 @@
+@@ -407,7 +434,7 @@
  	default y
  	select SWIOTLB
  	select AGP
@@ -29193,7 +29007,7 @@
  	help
  	  Support for full DMA access of devices with 32bit memory access only
  	  on systems with more than 3GB. This is usually needed for USB,
-@@ -440,6 +468,7 @@
+@@ -444,6 +471,7 @@
  
  config X86_MCE
  	bool "Machine check support" if EMBEDDED
@@ -29201,7 +29015,7 @@
  	default y
  	help
  	   Include a machine check error handler to report hardware errors.
-@@ -465,7 +494,7 @@
+@@ -469,7 +497,7 @@
  
  config KEXEC
  	bool "kexec system call (EXPERIMENTAL)"
@@ -29210,7 +29024,7 @@
  	help
  	  kexec is a system call that implements the ability to shutdown your
  	  current kernel, and to start another kernel.  It is like a reboot
-@@ -560,8 +589,11 @@
+@@ -564,8 +592,11 @@
  	default y
  
  menu "Power management options"
@@ -29222,7 +29036,7 @@
  
  source "drivers/acpi/Kconfig"
  
-@@ -584,6 +616,21 @@
+@@ -588,6 +619,21 @@
  	bool "Support mmconfig PCI config space access"
  	depends on PCI && ACPI
  
@@ -29244,24 +29058,24 @@
  source "drivers/pci/pcie/Kconfig"
  
  source "drivers/pci/Kconfig"
-@@ -654,4 +701,6 @@
+@@ -658,4 +704,6 @@
  
  source "crypto/Kconfig"
  
 +source "drivers/xen/Kconfig"
 +
  source "lib/Kconfig"
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/acpi/Makefile linux-2.6.18-rc6-xen/arch/x86_64/kernel/acpi/Makefile
---- linux-2.6.18-rc6/arch/x86_64/kernel/acpi/Makefile	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/acpi/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/acpi/Makefile linux-2.6.18-xen/arch/x86_64/kernel/acpi/Makefile
+--- linux-2.6.18/arch/x86_64/kernel/acpi/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/kernel/acpi/Makefile	2006-08-15 13:03:15.000000000 +0200
 @@ -7,3 +7,4 @@
  processor-y		:= ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o
  endif
  
 +boot-$(CONFIG_XEN)		:= ../../../i386/kernel/acpi/boot-xen.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/apic-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/apic-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/apic-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/apic-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/apic-xen.c linux-2.6.18-xen/arch/x86_64/kernel/apic-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/apic-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/apic-xen.c	2006-08-15 13:03:15.000000000 +0200
 @@ -0,0 +1,197 @@
 +/*
 + *	Local APIC handling, local APIC timers
@@ -29460,9 +29274,9 @@
 +
 +	return 1;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/asm-offsets.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/asm-offsets.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/asm-offsets.c	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/asm-offsets.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/asm-offsets.c linux-2.6.18-xen/arch/x86_64/kernel/asm-offsets.c
+--- linux-2.6.18/arch/x86_64/kernel/asm-offsets.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/kernel/asm-offsets.c	2006-08-15 13:03:15.000000000 +0200
 @@ -67,8 +67,10 @@
  	DEFINE(pbe_address, offsetof(struct pbe, address));
  	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
@@ -29474,10 +29288,10 @@
  	BLANK();
  	DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx));
  	return 0;
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/e820-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/e820-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/e820-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/e820-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,728 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/e820-xen.c linux-2.6.18-xen/arch/x86_64/kernel/e820-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/e820-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/e820-xen.c	2006-09-20 13:58:38.000000000 +0200
+@@ -0,0 +1,755 @@
 +/* 
 + * Handle the memory map.
 + * The functions here do the job until bootmem takes over.
@@ -29596,6 +29410,35 @@
 +	return 0;
 +}
 +
++/*
++ * This function checks if the entire range <start,end> is mapped with type.
++ *
++ * Note: this function only works correct if the e820 table is sorted and
++ * not-overlapping, which is the case
++ */
++int __init e820_all_mapped(unsigned long start, unsigned long end, unsigned type)
++{
++	int i;
++	for (i = 0; i < e820.nr_map; i++) {
++		struct e820entry *ei = &e820.map[i];
++		if (type && ei->type != type)
++			continue;
++		/* is the region (part) in overlap with the current region ?*/
++		if (ei->addr >= end || ei->addr + ei->size <= start)
++			continue;
++
++		/* if the region is at the beginning of <start,end> we move
++		 * start to the end of the region since it's ok until there
++		 */
++		if (ei->addr <= start)
++			start = ei->addr + ei->size;
++		/* if start is now at or beyond end, we're done, full coverage */
++		if (start >= end)
++			return 1; /* we're done */
++	}
++	return 0;
++}
++
 +/* 
 + * Find a free area in a specific range. 
 + */ 
@@ -29747,10 +29590,8 @@
 +			 *  so we try it repeatedly and let the resource manager
 +			 *  test it.
 +			 */
-+#ifndef CONFIG_XEN
 +			request_resource(res, &code_resource);
 +			request_resource(res, &data_resource);
-+#endif
 +#ifdef CONFIG_KEXEC
 +			request_resource(res, &crashk_res);
 +#endif
@@ -30206,9 +30047,9 @@
 +	printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n",
 +		pci_mem_start, gapstart, gapsize);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/early_printk-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/early_printk-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/early_printk-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/early_printk-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/early_printk-xen.c linux-2.6.18-xen/arch/x86_64/kernel/early_printk-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/early_printk-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/early_printk-xen.c	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,304 @@
 +
 +#include <linux/console.h>
@@ -30514,10 +30355,10 @@
 +}
 +
 +__setup("earlyprintk=", setup_early_printk);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/entry-xen.S linux-2.6.18-rc6-xen/arch/x86_64/kernel/entry-xen.S
---- linux-2.6.18-rc6/arch/x86_64/kernel/entry-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/entry-xen.S	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,1213 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/entry-xen.S linux-2.6.18-xen/arch/x86_64/kernel/entry-xen.S
+--- linux-2.6.18/arch/x86_64/kernel/entry-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/entry-xen.S	2006-09-17 17:44:47.000000000 +0200
+@@ -0,0 +1,1232 @@
 +/*
 + *  linux/arch/x86_64/entry.S
 + *
@@ -30583,7 +30424,6 @@
 +#define retint_kernel retint_restore_args
 +#endif	
 +
-+
 +.macro TRACE_IRQS_IRETQ offset=ARGOFFSET
 +#ifdef CONFIG_TRACE_IRQFLAGS
 +	bt   $9,EFLAGS-\offset(%rsp)	/* interrupts off? */
@@ -30795,10 +30635,6 @@
 +	andl %edi,%edx
 +	CFI_REMEMBER_STATE
 +	jnz  sysret_careful 
-+	/*
-+	 * sysretq will re-enable interrupts:
-+	 */
-+	TRACE_IRQS_ON
 +        XEN_UNBLOCK_EVENTS(%rsi)                
 +	CFI_REGISTER	rip,rcx
 +	RESTORE_ARGS 0,8,0
@@ -30811,8 +30647,7 @@
 +	CFI_RESTORE_STATE
 +	bt $TIF_NEED_RESCHED,%edx
 +	jnc sysret_signal
-+	TRACE_IRQS_ON
-+        XEN_UNBLOCK_EVENTS(%rsi)        
++	XEN_UNBLOCK_EVENTS(%rsi)
 +	pushq %rdi
 +	CFI_ADJUST_CFA_OFFSET 8
 +	call schedule
@@ -30822,7 +30657,6 @@
 +
 +	/* Handle a signal */ 
 +sysret_signal:
-+	TRACE_IRQS_ON
 +/*	sti */
 +        XEN_UNBLOCK_EVENTS(%rsi)        
 +	testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
@@ -30887,7 +30721,6 @@
 +	CFI_REL_OFFSET	r10,R10-ARGOFFSET
 +	CFI_REL_OFFSET	r11,R11-ARGOFFSET
 +        XEN_BLOCK_EVENTS(%rsi)
-+	TRACE_IRQS_OFF
 +	testb $3,CS-ARGOFFSET(%rsp)
 +        jnz 1f
 +        /* Need to set the proper %ss (not NULL) for ring 3 iretq */
@@ -30910,7 +30743,6 @@
 +int_careful:
 +	bt $TIF_NEED_RESCHED,%edx
 +	jnc  int_very_careful
-+	TRACE_IRQS_ON
 +/*	sti */
 +        XEN_UNBLOCK_EVENTS(%rsi)
 +	pushq %rdi
@@ -30919,12 +30751,10 @@
 +	popq %rdi
 +	CFI_ADJUST_CFA_OFFSET -8
 +	XEN_BLOCK_EVENTS(%rsi)
-+	TRACE_IRQS_OFF
 +	jmp int_with_check
 +
 +	/* handle signals and tracing -- both require a full stack frame */
 +int_very_careful:
-+	TRACE_IRQS_ON
 +/*	sti */
 +        XEN_UNBLOCK_EVENTS(%rsi)
 +	SAVE_REST
@@ -31069,7 +30899,7 @@
 +	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
 +	jnz restore_all_enable_events	#        != 0 => enable event delivery
 +	XEN_PUT_VCPU_INFO(%rsi)
-+	TRACE_IRQS_IRETQ
++		
 +	RESTORE_ARGS 0,8,0
 +	HYPERVISOR_IRET 0
 +	
@@ -31078,7 +30908,6 @@
 +	CFI_RESTORE_STATE
 +	bt    $TIF_NEED_RESCHED,%edx
 +	jnc   retint_signal
-+	TRACE_IRQS_ON
 +	XEN_UNBLOCK_EVENTS(%rsi)
 +/*	sti */        
 +	pushq %rdi
@@ -31088,14 +30917,12 @@
 +	CFI_ADJUST_CFA_OFFSET	-8
 +	GET_THREAD_INFO(%rcx)
 +	XEN_BLOCK_EVENTS(%rsi)		
-+	TRACE_IRQS_OFF
 +/*	cli */
 +	jmp retint_check
 +	
 +retint_signal:
 +	testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
 +	jz    retint_restore_args
-+	TRACE_IRQS_ON
 +        XEN_UNBLOCK_EVENTS(%rsi)
 +	SAVE_REST
 +	movq $-1,ORIG_RAX(%rsp) 			
@@ -31104,7 +30931,6 @@
 +	call do_notify_resume
 +	RESTORE_REST
 +        XEN_BLOCK_EVENTS(%rsi)		
-+	TRACE_IRQS_OFF
 +	movl $_TIF_NEED_RESCHED,%edi
 +	GET_THREAD_INFO(%rcx)
 +	jmp retint_check
@@ -31123,9 +30949,7 @@
 +	call preempt_schedule_irq
 +	jmp retint_kernel       /* check again */
 +#endif	
-+
 +	CFI_ENDPROC
-+END(common_interrupt)
 +	
 +/*
 + * APIC interrupts.
@@ -31250,7 +31074,6 @@
 +	addq	$EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
 +	.endif
 +/*	cli */
-+	TRACE_IRQS_OFF
 +	XEN_BLOCK_EVENTS(%rsi)		
 +	.endm
 +#endif
@@ -31308,12 +31131,11 @@
 +	RESTORE_REST
 +/*	cli */
 +	XEN_BLOCK_EVENTS(%rsi)		
-+	TRACE_IRQS_OFF
 +	GET_THREAD_INFO(%rcx)	
 +	testb $3,CS-ARGOFFSET(%rsp)
 +	jz retint_kernel
 +	movl  threadinfo_flags(%rcx),%edx
-+	movl  $_TIF_WORK_MASK,%edi
++	movl  $_TIF_WORK_MASK,%edi	
 +	andl  %edi,%edx
 +	jnz   retint_careful
 +	jmp   retint_restore_args
@@ -31344,7 +31166,7 @@
 +	jmp  error_sti
 +#endif        
 +END(error_entry)
-+		
++	
 +ENTRY(hypervisor_callback)
 +	zeroentry do_hypervisor_callback
 +        
@@ -31578,6 +31400,7 @@
 +/*	jmp paranoid_exit */
 +	CFI_ENDPROC
 +END(debug)
++END(nmi)
 +	.previous .text
 +
 +#if 0
@@ -31586,14 +31409,49 @@
 +	INTR_FRAME
 +	pushq $-1
 +	CFI_ADJUST_CFA_OFFSET 8
-+	paranoidentry do_nmi, 0, 0
-+#ifdef CONFIG_TRACE_IRQFLAGS
-+	paranoidexit 0
-+#else
-+	jmp paranoid_exit1
-+ 	CFI_ENDPROC
-+#endif
-+END(nmi)
++	paranoidentry do_nmi
++	/*
++ 	 * "Paranoid" exit path from exception stack.
++  	 * Paranoid because this is used by NMIs and cannot take
++	 * any kernel state for granted.
++	 * We don't do kernel preemption checks here, because only
++	 * NMI should be common and it does not enable IRQs and
++	 * cannot get reschedule ticks.
++	 */
++	/* ebx:	no swapgs flag */
++paranoid_exit:
++	testl %ebx,%ebx				/* swapgs needed? */
++	jnz paranoid_restore
++	testl $3,CS(%rsp)
++	jnz   paranoid_userspace
++paranoid_swapgs:	
++	swapgs
++paranoid_restore:	
++	RESTORE_ALL 8
++	iretq
++paranoid_userspace:	
++	GET_THREAD_INFO(%rcx)
++	movl threadinfo_flags(%rcx),%ebx
++	andl $_TIF_WORK_MASK,%ebx
++	jz paranoid_swapgs
++	movq %rsp,%rdi			/* &pt_regs */
++	call sync_regs
++	movq %rax,%rsp			/* switch stack for scheduling */
++	testl $_TIF_NEED_RESCHED,%ebx
++	jnz paranoid_schedule
++	movl %ebx,%edx			/* arg3: thread flags */
++	sti
++	xorl %esi,%esi 			/* arg2: oldset */
++	movq %rsp,%rdi 			/* arg1: &pt_regs */
++	call do_notify_resume
++	cli
++	jmp paranoid_userspace
++paranoid_schedule:
++	sti
++	call schedule
++	cli
++	jmp paranoid_userspace
++	CFI_ENDPROC
 +	.previous .text
 +#endif        
 +
@@ -31644,6 +31502,7 @@
 +ENTRY(segment_not_present)
 +	errorentry do_segment_not_present
 +END(segment_not_present)
++
 +	/* runs on exception stack */
 +ENTRY(stack_segment)
 +	XCPT_FRAME
@@ -31680,6 +31539,7 @@
 +END(machine_check)
 +#endif
 +
++/* Call softirq on interrupt stack. Interrupts are off. */
 +ENTRY(call_softirq)
 +	CFI_STARTPROC
 +	push %rbp
@@ -31731,10 +31591,10 @@
 +	CFI_ENDPROC
 +ENDPROC(arch_unwind_init_running)
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/genapic_xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/genapic_xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/genapic_xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/genapic_xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,176 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/genapic_xen.c linux-2.6.18-xen/arch/x86_64/kernel/genapic_xen.c
+--- linux-2.6.18/arch/x86_64/kernel/genapic_xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/genapic_xen.c	2006-09-17 17:44:47.000000000 +0200
+@@ -0,0 +1,149 @@
 +/*
 + * Copyright 2004 James Cleverdon, IBM.
 + * Subject to the GNU Public License, v.2
@@ -31753,14 +31613,8 @@
 +#include <linux/kernel.h>
 +#include <linux/ctype.h>
 +#include <linux/init.h>
-+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
 +#include <asm/smp.h>
 +#include <asm/ipi.h>
-+#else
-+#include <asm/apic.h>
-+#include <asm/apicdef.h>
-+#include <asm/genapic.h>
-+#endif
 +#include <xen/evtchn.h>
 +
 +DECLARE_PER_CPU(int, ipi_to_irq[NR_IPIS]);
@@ -31818,6 +31672,24 @@
 +	return;
 +}
 +
++static void xen_send_IPI_allbutself(int vector)
++{
++	/*
++	 * if there are no other CPUs in the system then
++	 * we get an APIC send error if we try to broadcast.
++	 * thus we have to avoid sending IPIs in this case.
++	 */
++	Dprintk("%s\n", __FUNCTION__);
++	if (num_online_cpus() > 1)
++		xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
++}
++
++static void xen_send_IPI_all(int vector)
++{
++	Dprintk("%s\n", __FUNCTION__);
++	xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
++}
++
 +static void xen_send_IPI_mask(cpumask_t cpumask, int vector)
 +{
 +	unsigned long mask = cpus_addr(cpumask)[0];
@@ -31836,48 +31708,12 @@
 +	local_irq_restore(flags);
 +}
 +
-+static void xen_send_IPI_allbutself(int vector)
-+{
-+#ifdef	CONFIG_HOTPLUG_CPU
-+	int hotplug = 1;
-+#else
-+	int hotplug = 0;
-+#endif
-+	/*
-+	 * if there are no other CPUs in the system then
-+	 * we get an APIC send error if we try to broadcast.
-+	 * thus we have to avoid sending IPIs in this case.
-+	 */
-+	Dprintk("%s\n", __FUNCTION__);
-+	if (hotplug || vector == NMI_VECTOR) {
-+		cpumask_t allbutme = cpu_online_map;
-+
-+		cpu_clear(smp_processor_id(), allbutme);
-+
-+		if (!cpus_empty(allbutme))
-+			xen_send_IPI_mask(allbutme, vector);
-+	} else if (num_online_cpus() > 1) {
-+		xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
-+	}
-+}
-+
-+static void xen_send_IPI_all(int vector)
-+{
-+	Dprintk("%s\n", __FUNCTION__);
-+	if (vector == NMI_VECTOR)
-+		xen_send_IPI_mask(cpu_online_map, vector);
-+	else
-+		xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
-+}
-+
-+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
 +static int xen_apic_id_registered(void)
 +{
 +	/* better be set */
 +	Dprintk("%s\n", __FUNCTION__);
 +	return physid_isset(smp_processor_id(), phys_cpu_present_map);
 +}
-+#endif
 +
 +static unsigned int xen_cpu_mask_to_apicid(cpumask_t cpumask)
 +{
@@ -31887,7 +31723,8 @@
 +
 +static unsigned int phys_pkg_id(int index_msb)
 +{
-+	int ebx;
++	u32 ebx;
++
 +	Dprintk("%s\n", __FUNCTION__);
 +	ebx = cpuid_ebx(1);
 +	return ((ebx >> 24) & 0xFF) >> index_msb;
@@ -31895,15 +31732,11 @@
 +
 +struct genapic apic_xen =  {
 +	.name = "xen",
-+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
 +	.int_delivery_mode = dest_LowestPrio,
-+#endif
 +	.int_dest_mode = (APIC_DEST_LOGICAL != 0),
 +	.int_delivery_dest = APIC_DEST_LOGICAL | APIC_DM_LOWEST,
 +	.target_cpus = xen_target_cpus,
-+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
 +	.apic_id_registered = xen_apic_id_registered,
-+#endif
 +	.init_apic_ldr = xen_init_apic_ldr,
 +	.send_IPI_all = xen_send_IPI_all,
 +	.send_IPI_allbutself = xen_send_IPI_allbutself,
@@ -31911,9 +31744,9 @@
 +	.cpu_mask_to_apicid = xen_cpu_mask_to_apicid,
 +	.phys_pkg_id = phys_pkg_id,
 +};
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/genapic-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/genapic-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/genapic-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/genapic-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/genapic-xen.c linux-2.6.18-xen/arch/x86_64/kernel/genapic-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/genapic-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/genapic-xen.c	2006-08-15 13:03:15.000000000 +0200
 @@ -0,0 +1,143 @@
 +/*
 + * Copyright 2004 James Cleverdon, IBM.
@@ -32058,10 +31891,10 @@
 +	xen_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
 +#endif
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/head64-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/head64-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/head64-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/head64-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,161 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/head64-xen.c linux-2.6.18-xen/arch/x86_64/kernel/head64-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/head64-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/head64-xen.c	2006-08-15 13:03:15.000000000 +0200
+@@ -0,0 +1,162 @@
 +/*
 + *  linux/arch/x86_64/kernel/head64.c -- prepare to run common code
 + *
@@ -32176,6 +32009,7 @@
 +			xen_start_info->nr_pt_frames;
 +	}
 +
++
 +	machine_to_phys_mapping = (unsigned long *)MACH2PHYS_VIRT_START;
 +	machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES;
 +	if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) {
@@ -32185,17 +32019,17 @@
 +	while ((1UL << machine_to_phys_order) < machine_to_phys_nr_ents )
 +		machine_to_phys_order++;
 +
++	/*
++	 * This must be called really, really early:
++	 */
++	lockdep_init();
++
 +#if 0
 +	for (i = 0; i < 256; i++)
 +		set_intr_gate(i, early_idt_handler);
 +	asm volatile("lidt %0" :: "m" (idt_descr));
 +#endif
 +
-+	/*
-+	 * This must be called really, really early:
-+	 */
-+	lockdep_init();
-+
 + 	for (i = 0; i < NR_CPUS; i++)
 + 		cpu_pda(i) = &boot_cpu_pda[i];
 +
@@ -32223,10 +32057,10 @@
 +	setup_boot_cpu_data();
 +	start_kernel();
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/head-xen.S linux-2.6.18-rc6-xen/arch/x86_64/kernel/head-xen.S
---- linux-2.6.18-rc6/arch/x86_64/kernel/head-xen.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/head-xen.S	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,191 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/head-xen.S linux-2.6.18-xen/arch/x86_64/kernel/head-xen.S
+--- linux-2.6.18/arch/x86_64/kernel/head-xen.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/head-xen.S	2006-05-26 22:00:14.000000000 +0200
+@@ -0,0 +1,176 @@
 +/*
 + *  linux/arch/x86_64/kernel/head.S -- start in 32bit and switch to 64bit
 + *
@@ -32245,15 +32079,12 @@
 +#include <linux/linkage.h>
 +#include <linux/threads.h>
 +#include <linux/init.h>
-+#include <linux/elfnote.h>
 +#include <asm/desc.h>
 +#include <asm/segment.h>
 +#include <asm/page.h>
 +#include <asm/msr.h>
 +#include <asm/cache.h>
 +
-+#include <xen/interface/elfnote.h>
-+
 +	.text
 +	.section .bootstrap.text
 +	.code64
@@ -32371,7 +32202,6 @@
 +ENTRY(empty_zero_page)
 +	.skip PAGE_SIZE
 +
-+#ifdef CONFIG_XEN_COMPAT_030002
 +/*
 + * __xen_guest information
 + */
@@ -32391,8 +32221,12 @@
 +	.ascii	",XEN_VER=xen-3.0"
 +	.ascii	",VIRT_BASE=0x"
 +		utoh __START_KERNEL_map
++#ifdef CONFIG_XEN_COMPAT_030002
 +	.ascii	",ELF_PADDR_OFFSET=0x"
 +		utoh __START_KERNEL_map
++#else
++	.ascii	",ELF_PADDR_OFFSET=0x0"
++#endif /* !CONFIG_XEN_COMPAT_030002 */
 +	.ascii	",VIRT_ENTRY=0x"
 +		utoh (__START_KERNEL_map + __PHYSICAL_START + VIRT_ENTRY_OFFSET)
 +	.ascii	",HYPERCALL_PAGE=0x"
@@ -32403,24 +32237,9 @@
 +	.ascii	         "|supervisor_mode_kernel"
 +	.ascii	",LOADER=generic"
 +	.byte	0
-+#endif /* CONFIG_XEN_COMPAT_030002 */
-+	
-+	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz, "linux")
-+	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz, "2.6")
-+	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz, "xen-3.0")
-+	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .quad,  __START_KERNEL_map)
-+#ifdef CONFIG_XEN_COMPAT_030002
-+	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad,  __START_KERNEL_map)
-+#else
-+	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad,  0)
-+#endif /* !CONFIG_XEN_COMPAT_030002 */
-+	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  startup_64)
-+	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
-+	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
-+	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/init_task.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/init_task.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/init_task.c	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/init_task.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/init_task.c linux-2.6.18-xen/arch/x86_64/kernel/init_task.c
+--- linux-2.6.18/arch/x86_64/kernel/init_task.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/kernel/init_task.c	2006-09-17 17:44:47.000000000 +0200
 @@ -37,6 +37,8 @@
  struct task_struct init_task = INIT_TASK(init_task);
  
@@ -32438,10 +32257,10 @@
  
  /* Copies of the original ist values from the tss are only accessed during
   * debugging, no special alignment required.
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/io_apic-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/io_apic-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/io_apic-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/io_apic-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,2263 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/io_apic-xen.c linux-2.6.18-xen/arch/x86_64/kernel/io_apic-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/io_apic-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/io_apic-xen.c	2006-08-15 13:03:15.000000000 +0200
+@@ -0,0 +1,2257 @@
 +/*
 + *	Intel IO-APIC support for multi-Pentium hosts.
 + *
@@ -33333,16 +33152,11 @@
 +int assign_irq_vector(int irq)
 +{
 +	struct physdev_irq irq_op;
-+	unsigned long flags;
-+
++  
 +  	BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS);
-+
-+	spin_lock_irqsave(&vector_lock, flags);
-+
-+	if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0) {
-+		spin_unlock_irqrestore(&vector_lock, flags);
++  	if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0)
 +  		return IO_APIC_VECTOR(irq);
-+	}
++
 +	irq_op.irq = irq;
 +	if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op))
 +		return -ENOSPC;
@@ -33351,7 +33165,6 @@
 +	if (irq != AUTO_ASSIGN)
 +		IO_APIC_VECTOR(irq) = irq_op.vector;
 +
-+	spin_unlock_irqrestore(&vector_lock, flags);
 +	return irq_op.vector;
 +}
 +
@@ -34153,6 +33966,7 @@
 +	.set_affinity = set_ioapic_affinity,
 +#endif
 +	.retrigger	= ioapic_retrigger,
++	.retrigger	= ioapic_retrigger,
 +};
 +
 +static struct hw_interrupt_type ioapic_level_type __read_mostly = {
@@ -34166,7 +33980,6 @@
 +#ifdef CONFIG_SMP
 +	.set_affinity = set_ioapic_affinity,
 +#endif
-+	.retrigger	= ioapic_retrigger,
 +};
 +#endif /* !CONFIG_XEN */
 +
@@ -34705,9 +34518,9 @@
 +}
 +#endif
 +#endif /* !CONFIG_XEN */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/ioport-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/ioport-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/ioport-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/ioport-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/ioport-xen.c linux-2.6.18-xen/arch/x86_64/kernel/ioport-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/ioport-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/ioport-xen.c	2006-07-07 20:51:32.000000000 +0200
 @@ -0,0 +1,99 @@
 +/*
 + *	linux/arch/x86_64/kernel/ioport.c
@@ -34808,9 +34621,9 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/irqflags-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/irqflags-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/irqflags-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/irqflags-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/irqflags-xen.c linux-2.6.18-xen/arch/x86_64/kernel/irqflags-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/irqflags-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/irqflags-xen.c	2006-08-15 13:03:15.000000000 +0200
 @@ -0,0 +1,100 @@
 +#include <linux/module.h>
 +#include <linux/smp.h>
@@ -34912,10 +34725,10 @@
 +	return disabled;
 +}
 +EXPORT_SYMBOL(raw_irqs_disabled);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/irq-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/irq-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/irq-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/irq-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,198 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/irq-xen.c linux-2.6.18-xen/arch/x86_64/kernel/irq-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/irq-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/irq-xen.c	2006-08-15 13:03:15.000000000 +0200
+@@ -0,0 +1,197 @@
 +/*
 + *	linux/arch/x86_64/kernel/irq.c
 + *
@@ -34981,7 +34794,7 @@
 +	if (i == 0) {
 +		seq_printf(p, "           ");
 +		for_each_online_cpu(j)
-+			seq_printf(p, "CPU%-8d       ",j);
++			seq_printf(p, "CPU%-8d",j);
 +		seq_putc(p, '\n');
 +	}
 +
@@ -35044,7 +34857,6 @@
 +
 +	exit_idle();
 +	irq_enter();
-+
 +#ifdef CONFIG_DEBUG_STACKOVERFLOW
 +	stack_overflow_check(regs);
 +#endif
@@ -35114,9 +34926,9 @@
 +        printk("unexpected IRQ trap at vector %02x\n", irq);
 +}
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/ldt-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/ldt-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/ldt-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/ldt-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/ldt-xen.c linux-2.6.18-xen/arch/x86_64/kernel/ldt-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/ldt-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/ldt-xen.c	2006-05-26 22:00:14.000000000 +0200
 @@ -0,0 +1,282 @@
 +/*
 + * linux/arch/x86_64/kernel/ldt.c
@@ -35400,9 +35212,9 @@
 +	}
 +	return ret;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/Makefile linux-2.6.18-rc6-xen/arch/x86_64/kernel/Makefile
---- linux-2.6.18-rc6/arch/x86_64/kernel/Makefile	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/Makefile linux-2.6.18-xen/arch/x86_64/kernel/Makefile
+--- linux-2.6.18/arch/x86_64/kernel/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/kernel/Makefile	2006-08-15 13:03:15.000000000 +0200
 @@ -21,11 +21,13 @@
  obj-$(CONFIG_X86_CPUID)		+= cpuid.o
  obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
@@ -35418,7 +35230,7 @@
  obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend_asm.o
  obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
  obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
-@@ -55,3 +57,18 @@
+@@ -55,3 +57,19 @@
  msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
  alternative-y			+= ../../i386/kernel/alternative.o
  
@@ -35437,9 +35249,10 @@
 +obj-y := $(call cherrypickxen, $(obj-y))
 +extra-y := $(call cherrypickxen, $(extra-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/mpparse-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/mpparse-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/mpparse-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/mpparse-xen.c	2006-09-04 16:31:03.000000000 +0200
++
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/mpparse-xen.c linux-2.6.18-xen/arch/x86_64/kernel/mpparse-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/mpparse-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/mpparse-xen.c	2006-08-15 13:03:16.000000000 +0200
 @@ -0,0 +1,1011 @@
 +/*
 + *	Intel Multiprocessor Specification 1.1 and 1.4
@@ -36452,10 +36265,10 @@
 +
 +#endif /*CONFIG_X86_IO_APIC*/
 +#endif /*CONFIG_ACPI*/
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/pci-swiotlb-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/pci-swiotlb-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/pci-swiotlb-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/pci-swiotlb-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,54 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/pci-swiotlb-xen.c linux-2.6.18-xen/arch/x86_64/kernel/pci-swiotlb-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/pci-swiotlb-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/pci-swiotlb-xen.c	2006-08-15 13:03:16.000000000 +0200
+@@ -0,0 +1,55 @@
 +/* Glue code to lib/swiotlb.c */
 +
 +#include <linux/pci.h>
@@ -36494,9 +36307,10 @@
 +{
 +#if 0
 +	/* don't initialize swiotlb if iommu=off (no_iommu=1) */
-+	if (!iommu_aperture && !no_iommu &&
-+	    (end_pfn > MAX_DMA32_PFN || force_iommu))
++	if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN)
 +	       swiotlb = 1;
++	if (swiotlb_force)
++		swiotlb = 1;
 +	if (swiotlb) {
 +		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
 +		swiotlb_init();
@@ -36510,10 +36324,10 @@
 +	}
 +#endif
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/process-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/process-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/process-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/process-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,794 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/process-xen.c linux-2.6.18-xen/arch/x86_64/kernel/process-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/process-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/process-xen.c	2006-08-15 13:03:16.000000000 +0200
+@@ -0,0 +1,793 @@
 +/*
 + *  linux/arch/x86-64/kernel/process.c
 + *
@@ -36588,6 +36402,7 @@
 + * Powermanagement idle function, if any..
 + */
 +void (*pm_idle)(void);
++EXPORT_SYMBOL(pm_idle);
 +static DEFINE_PER_CPU(unsigned int, cpu_idle_state);
 +
 +static ATOMIC_NOTIFIER_HEAD(idle_notifier);
@@ -36770,7 +36585,7 @@
 +{
 +	printk("CPU %d:", smp_processor_id());
 +	__show_regs(regs);
-+	show_trace(NULL, regs, &regs->rsp);
++	show_trace(NULL, regs, (void *)(regs + 1));
 +}
 +
 +/*
@@ -36821,7 +36636,6 @@
 +			current_thread_info()->status |= TS_COMPAT;
 +	}
 +
-+
 +	tsk->thread.debugreg0 = 0;
 +	tsk->thread.debugreg1 = 0;
 +	tsk->thread.debugreg2 = 0;
@@ -36978,6 +36792,18 @@
 +	multicall_entry_t _mcl[8], *mcl = _mcl;
 +
 +	/*
++	 * This is basically '__unlazy_fpu', except that we queue a
++	 * multicall to indicate FPU task switch, rather than
++	 * synchronously trapping to Xen.
++	 */
++	if (prev_p->thread_info->status & TS_USEDFPU) {
++		__save_init_fpu(prev_p); /* _not_ save_init_fpu() */
++		mcl->op      = __HYPERVISOR_fpu_taskswitch;
++		mcl->args[0] = 1;
++		mcl++;
++	}
++
++	/*
 +	 * Reload esp0, LDT and the page table pointer:
 +	 */
 +	mcl->op      = __HYPERVISOR_stack_switch;
@@ -37045,24 +36871,11 @@
 +		HYPERVISOR_set_segment_base(SEGBASE_GS_USER, next->gs); 
 +
 +	/* 
-+	 * Switch the PDA and FPU context.
++	 * Switch the PDA.
 +	 */
 +	prev->userrsp = read_pda(oldrsp); 
 +	write_pda(oldrsp, next->userrsp); 
 +	write_pda(pcurrent, next_p); 
-+
-+	/* This must be here to ensure both math_state_restore() and
-+	   kernel_fpu_begin() work consistently. 
-+	   And the AMD workaround requires it to be after DS reload. */
-+	/*
-+	 * This is basically '__unlazy_fpu', except that we queue a
-+	 * multicall to indicate FPU task switch, rather than
-+	 * synchronously trapping to Xen.
-+	 */
-+	if (prev_p->thread_info->status & TS_USEDFPU) {
-+		__save_init_fpu(prev_p); /* _not_ save_init_fpu() */
-+		HYPERVISOR_fpu_taskswitch(1);
-+	}
 +	write_pda(kernelstack,
 +		  task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
 +
@@ -37308,9 +37121,9 @@
 +{
 +}
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/setup64-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/setup64-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/setup64-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/setup64-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/setup64-xen.c linux-2.6.18-xen/arch/x86_64/kernel/setup64-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/setup64-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/setup64-xen.c	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,361 @@
 +/* 
 + * X86-64 specific CPU setup.
@@ -37673,9 +37486,9 @@
 +
 +	fpu_init(); 
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/setup-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/setup-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/setup-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/setup-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/setup-xen.c linux-2.6.18-xen/arch/x86_64/kernel/setup-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/setup-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/setup-xen.c	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,1655 @@
 +/*
 + *  linux/arch/x86-64/kernel/setup.c
@@ -37757,7 +37570,6 @@
 +
 +extern unsigned long start_pfn;
 +extern struct edid_info edid_info;
-+EXPORT_SYMBOL_GPL(edid_info);
 +
 +shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
 +EXPORT_SYMBOL(HYPERVISOR_shared_info);
@@ -37827,6 +37639,7 @@
 +};
 +
 +struct edid_info edid_info;
++EXPORT_SYMBOL_GPL(edid_info);
 +struct e820map e820;
 +
 +extern int root_mountflags;
@@ -38394,7 +38207,8 @@
 +
 +#ifdef CONFIG_XEN
 +	/* reserve physmap, start info and initial page tables */
-+	reserve_bootmem(__pa_symbol(&_end), (table_start<<PAGE_SHIFT)-__pa_symbol(&_end));
++	reserve_bootmem(__pa_symbol(&_end),
++			(table_start<<PAGE_SHIFT) - __pa_symbol(&_end));
 +#else
 +	/*
 +	 * reserve physical page 0 - it's a special BIOS page on many boxes,
@@ -38481,7 +38295,7 @@
 +
 +		if (!xen_feature(XENFEAT_auto_translated_physmap)) {
 +			/* Make sure we have a large enough P->M table. */
-+			phys_to_machine_mapping = alloc_bootmem_pages(
++			phys_to_machine_mapping = alloc_bootmem(
 +				end_pfn * sizeof(unsigned long));
 +			memset(phys_to_machine_mapping, ~0,
 +			       end_pfn * sizeof(unsigned long));
@@ -38498,7 +38312,7 @@
 +			 * list of frames that make up the p2m table. Used by
 +                         * save/restore.
 +			 */
-+			pfn_to_mfn_frame_list_list = alloc_bootmem_pages(PAGE_SIZE);
++			pfn_to_mfn_frame_list_list = alloc_bootmem(PAGE_SIZE);
 +			HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
 +				virt_to_mfn(pfn_to_mfn_frame_list_list);
 +
@@ -38508,7 +38322,7 @@
 +					k++;
 +					BUG_ON(k>=fpp);
 +					pfn_to_mfn_frame_list[k] =
-+						alloc_bootmem_pages(PAGE_SIZE);
++						alloc_bootmem(PAGE_SIZE);
 +					pfn_to_mfn_frame_list_list[k] =
 +						virt_to_mfn(pfn_to_mfn_frame_list[k]);
 +					j=0;
@@ -38588,10 +38402,9 @@
 +		BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap));
 +
 +		e820_reserve_resources(machine_e820, memmap.nr_entries);
-+	}
-+#else
-+	e820_reserve_resources(e820.map, e820.nr_map);
++	} else
 +#endif
++	e820_reserve_resources(e820.map, e820.nr_map);
 +
 +	request_resource(&iomem_resource, &video_ram_resource);
 +
@@ -38818,7 +38631,7 @@
 +		set_bit(X86_FEATURE_FXSAVE_LEAK, &c->x86_capability);
 +
 +	level = get_model_name(c);
-+	if (!level) { 
++	if (!level) {
 +		switch (c->x86) { 
 +		case 15:
 +			/* Should distinguish Models here, but this is only
@@ -38846,7 +38659,6 @@
 +#ifdef CONFIG_SMP
 +	u32 	eax, ebx, ecx, edx;
 +	int 	index_msb, core_bits;
-+	int 	cpu = smp_processor_id();
 +
 +	cpuid(1, &eax, &ebx, &ecx, &edx);
 +
@@ -38885,6 +38697,7 @@
 +		printk(KERN_INFO  "CPU: Physical Processor ID: %d\n", c->phys_proc_id);
 +		printk(KERN_INFO  "CPU: Processor Core ID: %d\n", c->cpu_core_id);
 +	}
++
 +#endif
 +}
 +
@@ -39167,9 +38980,9 @@
 +		/* Other (Linux-defined) */
 +		"cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL,
 +		"constant_tsc", NULL, NULL,
-+		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 +		"up", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
++		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 +
 +		/* Intel-defined (#2) */
 +		"pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
@@ -39332,9 +39145,9 @@
 +}
 +device_initcall(add_pcspkr);
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/smp-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/smp-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/smp-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/smp-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/smp-xen.c linux-2.6.18-xen/arch/x86_64/kernel/smp-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/smp-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/smp-xen.c	2006-08-15 13:03:16.000000000 +0200
 @@ -0,0 +1,600 @@
 +/*
 + *	Intel SMP support routines.
@@ -39479,10 +39292,10 @@
 +
 +	cpu = smp_processor_id();
 +	/*
-+	 * orig_rax contains the interrupt vector - 256.
++	 * orig_rax contains the negated interrupt vector.
 +	 * Use that to determine where the sender put the data.
 +	 */
-+	sender = regs->orig_rax + 256 - INVALIDATE_TLB_VECTOR_START;
++	sender = ~regs->orig_rax - INVALIDATE_TLB_VECTOR_START;
 +	f = &per_cpu(flush_state, sender);
 +
 +	if (!cpu_isset(cpu, f->flush_cpumask))
@@ -39936,10 +39749,10 @@
 +	return 0; /* Should not happen */
 +#endif
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/traps-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/traps-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/traps-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/traps-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,1173 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/traps-xen.c linux-2.6.18-xen/arch/x86_64/kernel/traps-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/traps-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/traps-xen.c	2006-09-17 17:44:47.000000000 +0200
+@@ -0,0 +1,1175 @@
 +/*
 + *  linux/arch/x86-64/traps.c
 + *
@@ -40011,6 +39824,7 @@
 +asmlinkage void spurious_interrupt_bug(void);
 +
 +ATOMIC_NOTIFIER_HEAD(die_chain);
++EXPORT_SYMBOL(die_chain);
 +
 +int register_die_notifier(struct notifier_block *nb)
 +{
@@ -40047,14 +39861,13 @@
 +	preempt_enable_no_resched();
 +}
 +
-+static int kstack_depth_to_print = 10;
++static int kstack_depth_to_print = 12;
 +#ifdef CONFIG_STACK_UNWIND
 +static int call_trace = 1;
 +#else
 +#define call_trace (-1)
 +#endif
 +
-+
 +#ifdef CONFIG_KALLSYMS
 +# include <linux/kallsyms.h>
 +void printk_address(unsigned long address)
@@ -40121,7 +39934,7 @@
 +			break;
 +#endif
 +		default:
-+			end = per_cpu(orig_tss, cpu).ist[k];
++			end = per_cpu(orig_ist, cpu).ist[k];
 +			break;
 +		}
 +		/*
@@ -40183,10 +39996,10 @@
 +	int n = 0;
 +
 +	while (unwind(info) == 0 && UNW_PC(info)) {
-+		if (arch_unw_user_mode(info))
-+			break;
 +		n++;
 +		printk_address(UNW_PC(info));
++		if (arch_unw_user_mode(info))
++			break;
 +	}
 +	return n;
 +}
@@ -40238,11 +40051,12 @@
 +		} else
 +			printk("Inexact backtrace:\n");
 +	}
-+ 	/*
-+ 	 * Print function call entries within a stack. 'cond' is the
-+ 	 * "end of stackframe" condition, that the 'stack++'
-+ 	 * iteration will eventually trigger.
-+ 	 */
++
++	/*
++	 * Print function call entries within a stack. 'cond' is the
++	 * "end of stackframe" condition, that the 'stack++'
++	 * iteration will eventually trigger.
++	 */
 +#define HANDLE_STACK(cond) \
 +	do while (cond) { \
 +		unsigned long addr = *stack++; \
@@ -40344,7 +40158,7 @@
 +		}
 +		if (i && ((i % 4) == 0))
 +			printk("\n");
-+		printk(" %016lx ", *stack++);
++		printk(" %016lx", *stack++);
 +		touch_nmi_watchdog();
 +	}
 +	show_trace(tsk, regs, rsp);
@@ -40437,6 +40251,7 @@
 +{ 
 +	BUG(); 
 +} 
++EXPORT_SYMBOL(out_of_line_bug);
 +#endif
 +
 +static DEFINE_SPINLOCK(die_lock);
@@ -41107,74 +40922,15 @@
 +		call_trace = 0;
 +	else if (strcmp(s, "newfallback") == 0)
 +		call_trace = 1;
-+ 	else if (strcmp(s, "new") == 0)
++	else if (strcmp(s, "new") == 0)
 +		call_trace = 2;
 +	return 1;
 +}
 +__setup("call_trace=", call_trace_setup);
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/vmlinux.lds.S linux-2.6.18-rc6-xen/arch/x86_64/kernel/vmlinux.lds.S
---- linux-2.6.18-rc6/arch/x86_64/kernel/vmlinux.lds.S	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/vmlinux.lds.S	2006-09-04 16:31:03.000000000 +0200
-@@ -13,6 +13,12 @@
- OUTPUT_ARCH(i386:x86-64)
- ENTRY(phys_startup_64)
- jiffies_64 = jiffies;
-+PHDRS {
-+	text PT_LOAD FLAGS(5);	/* R_E */
-+	data PT_LOAD FLAGS(7);	/* RWE */
-+	user PT_LOAD FLAGS(7);	/* RWE */
-+	note PT_NOTE FLAGS(4);	/* R__ */
-+}
- SECTIONS
- {
-   . = __START_KERNEL;
-@@ -31,7 +37,7 @@
- 	KPROBES_TEXT
- 	*(.fixup)
- 	*(.gnu.warning)
--	} = 0x9090
-+	} :text = 0x9090
-   				/* out-of-line lock text */
-   .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET) { *(.text.lock) }
- 
-@@ -57,7 +63,7 @@
-   .data : AT(ADDR(.data) - LOAD_OFFSET) {
- 	*(.data)
- 	CONSTRUCTORS
--	}
-+	} :data
- 
-   _edata = .;			/* End of data section */
- 
-@@ -89,7 +95,7 @@
- #define VVIRT(x) (ADDR(x) - VVIRT_OFFSET)
- 
-   . = VSYSCALL_ADDR;
--  .vsyscall_0 :	 AT(VSYSCALL_PHYS_ADDR) { *(.vsyscall_0) }
-+  .vsyscall_0 :	 AT(VSYSCALL_PHYS_ADDR) { *(.vsyscall_0) } :user
-   __vsyscall_0 = VSYSCALL_VIRT_ADDR;
- 
-   . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
-@@ -132,7 +138,7 @@
-   . = ALIGN(8192);		/* init_task */
-   .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- 	*(.data.init_task)
--  }
-+  } :data
- 
-   . = ALIGN(4096);
-   .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
-@@ -235,4 +241,6 @@
-   STABS_DEBUG
- 
-   DWARF_DEBUG
-+
-+  NOTES
- }
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/vsyscall-xen.c linux-2.6.18-rc6-xen/arch/x86_64/kernel/vsyscall-xen.c
---- linux-2.6.18-rc6/arch/x86_64/kernel/vsyscall-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/vsyscall-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/vsyscall-xen.c linux-2.6.18-xen/arch/x86_64/kernel/vsyscall-xen.c
+--- linux-2.6.18/arch/x86_64/kernel/vsyscall-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/vsyscall-xen.c	2006-08-15 13:03:16.000000000 +0200
 @@ -0,0 +1,239 @@
 +/*
 + *  linux/arch/x86_64/kernel/vsyscall.c
@@ -41415,9 +41171,9 @@
 +}
 +
 +__initcall(vsyscall_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/kernel/xen_entry.S linux-2.6.18-rc6-xen/arch/x86_64/kernel/xen_entry.S
---- linux-2.6.18-rc6/arch/x86_64/kernel/xen_entry.S	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/kernel/xen_entry.S	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/kernel/xen_entry.S linux-2.6.18-xen/arch/x86_64/kernel/xen_entry.S
+--- linux-2.6.18/arch/x86_64/kernel/xen_entry.S	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/kernel/xen_entry.S	2006-05-26 22:00:14.000000000 +0200
 @@ -0,0 +1,40 @@
 +/*
 + * Copied from arch/xen/i386/kernel/entry.S
@@ -41459,9 +41215,9 @@
 +VGCF_IN_SYSCALL = (1<<8)
 +        
 +	
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/Makefile linux-2.6.18-rc6-xen/arch/x86_64/Makefile
---- linux-2.6.18-rc6/arch/x86_64/Makefile	2006-09-05 10:53:09.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/Makefile	2006-09-04 16:31:02.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/Makefile linux-2.6.18-xen/arch/x86_64/Makefile
+--- linux-2.6.18/arch/x86_64/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/Makefile	2006-08-15 13:03:15.000000000 +0200
 @@ -32,6 +32,10 @@
  cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
  cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
@@ -41503,10 +41259,10 @@
  
  archclean:
  	$(Q)$(MAKE) $(clean)=$(boot)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/mm/fault-xen.c linux-2.6.18-rc6-xen/arch/x86_64/mm/fault-xen.c
---- linux-2.6.18-rc6/arch/x86_64/mm/fault-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/mm/fault-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,723 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/mm/fault-xen.c linux-2.6.18-xen/arch/x86_64/mm/fault-xen.c
+--- linux-2.6.18/arch/x86_64/mm/fault-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/mm/fault-xen.c	2006-08-15 13:03:16.000000000 +0200
+@@ -0,0 +1,725 @@
 +/*
 + *  linux/arch/x86-64/mm/fault.c
 + *
@@ -42015,8 +41771,10 @@
 +	if (!(vma->vm_flags & VM_GROWSDOWN))
 +		goto bad_area;
 +	if (error_code & 4) {
-+		// XXX: align red zone size with ABI 
-+		if (address + 128 < regs->rsp)
++		/* Allow userspace just enough access below the stack pointer
++		 * to let the 'enter' instruction work.
++		 */
++		if (address + 65536 + 32 * sizeof(unsigned long) < regs->rsp)
 +			goto bad_area;
 +	}
 +	if (expand_stack(vma, address))
@@ -42230,10 +41988,10 @@
 +	return 1;
 +}
 +__setup("pagefaulttrace", enable_pagefaulttrace);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/mm/init-xen.c linux-2.6.18-rc6-xen/arch/x86_64/mm/init-xen.c
---- linux-2.6.18-rc6/arch/x86_64/mm/init-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/mm/init-xen.c	2006-09-04 16:31:03.000000000 +0200
-@@ -0,0 +1,1200 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/mm/init-xen.c linux-2.6.18-xen/arch/x86_64/mm/init-xen.c
+--- linux-2.6.18/arch/x86_64/mm/init-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/mm/init-xen.c	2006-09-17 17:44:47.000000000 +0200
+@@ -0,0 +1,1209 @@
 +/*
 + *  linux/arch/x86_64/mm/init.c
 + *
@@ -42806,7 +42564,7 @@
 +		mk_kernel_pgd(__pa_symbol(level3_kernel_pgt));
 +	level3_kernel_pgt[pud_index(__START_KERNEL_map)] = 
 +		__pud(__pa_symbol(level2_kernel_pgt) |
-+		      _KERNPG_TABLE);
++		      _KERNPG_TABLE | _PAGE_USER);
 +	memcpy((void *)level2_kernel_pgt, page, PAGE_SIZE);
 +
 +	early_make_page_readonly(init_level4_pgt,
@@ -42855,7 +42613,7 @@
 +			pte_page = alloc_static_page(&phys);
 +			early_make_page_readonly(
 +				pte_page, XENFEAT_writable_page_tables);
-+			set_pmd(pmd, __pmd(phys | _KERNPG_TABLE));
++			set_pmd(pmd, __pmd(phys | _KERNPG_TABLE | _PAGE_USER));
 +		} else {
 +			addr = page[pmd_index(va)];
 +			addr_to_page(addr, pte_page);
@@ -42864,7 +42622,7 @@
 +		if (pte_none(*pte)) {
 +			new_pte = pfn_pte(
 +				(va - __START_KERNEL_map) >> PAGE_SHIFT, 
-+				__pgprot(_KERNPG_TABLE));
++				__pgprot(_KERNPG_TABLE | _PAGE_USER));
 +			xen_l1_entry_update(pte, new_pte);
 +		}
 +		va += PAGE_SIZE;
@@ -42899,7 +42657,7 @@
 +
 +	early_printk("kernel direct mapping tables up to %lx @ %lx-%lx\n",
 +		end, table_start << PAGE_SHIFT,
-+		     (table_end << PAGE_SHIFT) + tables);
++		(table_start << PAGE_SHIFT) + tables);
 +}
 +
 +/* Setup the direct mapping of the physical memory at PAGE_OFFSET.
@@ -42929,7 +42687,7 @@
 +		pud_t *pud;
 +
 +		if (after_bootmem) {
-+			pud = pud_offset(pgd, start & PGDIR_MASK);
++			pud = pud_offset_k(pgd, start & PGDIR_MASK);
 +			make_page_readonly(pud, XENFEAT_writable_page_tables);
 +			pud_phys = __pa(pud);
 +		} else {
@@ -43113,7 +42871,6 @@
 +/*
 + * Memory hotplug specific functions
 + */
-+
 +void online_page(struct page *page)
 +{
 +	ClearPageReserved(page);
@@ -43274,6 +43031,10 @@
 +void free_init_pages(char *what, unsigned long begin, unsigned long end)
 +{
 +#ifdef __DO_LATER__
++	/*
++	 * Some pages can be pinned, but some are not. Unpinning such pages 
++	 * triggers BUG(). 
++	 */
 +	unsigned long addr;
 +
 +	if (begin >= end)
@@ -43285,6 +43046,13 @@
 +		init_page_count(virt_to_page(addr));
 +		memset((void *)(addr & ~(PAGE_SIZE-1)),
 +			POISON_FREE_INITMEM, PAGE_SIZE);
++		make_page_writable(
++			__va(__pa(addr)), XENFEAT_writable_page_tables);
++		/*
++		 * Make pages from __PAGE_OFFSET address as well
++		 */
++		make_page_writable(
++			(void *)addr, XENFEAT_writable_page_tables);
 +		free_page(addr);
 +		totalram_pages++;
 +	}
@@ -43293,13 +43061,11 @@
 +
 +void free_initmem(void)
 +{
-+#ifdef __DO_LATER__
 +	memset(__initdata_begin, POISON_FREE_INITDATA,
-+	       __initdata_end - __initdata_begin);
++		__initdata_end - __initdata_begin);
 +	free_init_pages("unused kernel memory",
 +			(unsigned long)(&__init_begin),
 +			(unsigned long)(&__init_end));
-+#endif
 +}
 +
 +#ifdef CONFIG_DEBUG_RODATA
@@ -43313,6 +43079,7 @@
 +
 +	printk ("Write protecting the kernel read-only data: %luk\n",
 +			(__end_rodata - __start_rodata) >> 10);
++
 +	/*
 +	 * change_page_attr_addr() requires a global_flush_tlb() call after it.
 +	 * We do this after the printk so that if something went wrong in the
@@ -43434,9 +43201,9 @@
 +{
 +	return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/mm/Makefile linux-2.6.18-rc6-xen/arch/x86_64/mm/Makefile
---- linux-2.6.18-rc6/arch/x86_64/mm/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/mm/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/mm/Makefile linux-2.6.18-xen/arch/x86_64/mm/Makefile
+--- linux-2.6.18/arch/x86_64/mm/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/mm/Makefile	2006-05-26 22:00:14.000000000 +0200
 @@ -9,3 +9,13 @@
  obj-$(CONFIG_ACPI_NUMA) += srat.o
  
@@ -43451,9 +43218,9 @@
 +
 +obj-y := $(call cherrypickxen, $(obj-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/mm/pageattr-xen.c linux-2.6.18-rc6-xen/arch/x86_64/mm/pageattr-xen.c
---- linux-2.6.18-rc6/arch/x86_64/mm/pageattr-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/arch/x86_64/mm/pageattr-xen.c	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/mm/pageattr-xen.c linux-2.6.18-xen/arch/x86_64/mm/pageattr-xen.c
+--- linux-2.6.18/arch/x86_64/mm/pageattr-xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/arch/x86_64/mm/pageattr-xen.c	2006-08-15 13:03:16.000000000 +0200
 @@ -0,0 +1,396 @@
 +/* 
 + * Copyright 2002 Andi Kleen, SuSE Labs. 
@@ -43851,9 +43618,9 @@
 +
 +EXPORT_SYMBOL(change_page_attr);
 +EXPORT_SYMBOL(global_flush_tlb);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/oprofile/Makefile linux-2.6.18-rc6-xen/arch/x86_64/oprofile/Makefile
---- linux-2.6.18-rc6/arch/x86_64/oprofile/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/oprofile/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/oprofile/Makefile linux-2.6.18-xen/arch/x86_64/oprofile/Makefile
+--- linux-2.6.18/arch/x86_64/oprofile/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/oprofile/Makefile	2006-05-26 22:00:14.000000000 +0200
 @@ -11,9 +11,12 @@
  	oprofilefs.o oprofile_stats.o \
  	timer_int.o )
@@ -43868,9 +43635,9 @@
 -
 +endif
  oprofile-y = $(DRIVER_OBJS) $(addprefix ../../i386/oprofile/, $(OPROFILE-y))
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/arch/x86_64/pci/Makefile linux-2.6.18-rc6-xen/arch/x86_64/pci/Makefile
---- linux-2.6.18-rc6/arch/x86_64/pci/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/arch/x86_64/pci/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/arch/x86_64/pci/Makefile linux-2.6.18-xen/arch/x86_64/pci/Makefile
+--- linux-2.6.18/arch/x86_64/pci/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/arch/x86_64/pci/Makefile	2006-05-26 22:00:14.000000000 +0200
 @@ -15,11 +15,23 @@
  
  obj-$(CONFIG_NUMA)	+= k8-bus.o
@@ -43895,9 +43662,9 @@
 +
 +obj-y := $(call cherrypickxen, $(obj-y))
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/acpi/Kconfig linux-2.6.18-rc6-xen/drivers/acpi/Kconfig
---- linux-2.6.18-rc6/drivers/acpi/Kconfig	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/acpi/Kconfig	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/acpi/Kconfig linux-2.6.18-xen/drivers/acpi/Kconfig
+--- linux-2.6.18/drivers/acpi/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/acpi/Kconfig	2006-08-15 13:03:16.000000000 +0200
 @@ -45,7 +45,7 @@
  
  config ACPI_SLEEP
@@ -43915,21 +43682,9 @@
  	default y
  	help
  	  The Power Management Timer is available on all ACPI-capable,
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/hangcheck-timer.c linux-2.6.18-rc6-xen/drivers/char/hangcheck-timer.c
---- linux-2.6.18-rc6/drivers/char/hangcheck-timer.c	2006-09-05 10:53:11.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/hangcheck-timer.c	2006-09-04 16:31:04.000000000 +0200
-@@ -117,7 +117,7 @@
- __setup("hcheck_dump_tasks", hangcheck_parse_dump_tasks);
- #endif /* not MODULE */
- 
--#if defined(CONFIG_X86_64) || defined(CONFIG_S390)
-+#if defined(CONFIG_X86_64) || defined(CONFIG_S390) || defined(CONFIG_X86_XEN)
- # define HAVE_MONOTONIC
- # define TIMER_FREQ 1000000000ULL
- #elif defined(CONFIG_IA64)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/mem.c linux-2.6.18-rc6-xen/drivers/char/mem.c
---- linux-2.6.18-rc6/drivers/char/mem.c	2006-09-05 10:53:11.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/mem.c	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/mem.c linux-2.6.18-xen/drivers/char/mem.c
+--- linux-2.6.18/drivers/char/mem.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/char/mem.c	2006-08-15 13:03:17.000000000 +0200
 @@ -101,6 +101,7 @@
  }
  #endif
@@ -43964,19 +43719,18 @@
  
  static const struct file_operations kmem_fops = {
  	.llseek		= memory_lseek,
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/Kconfig linux-2.6.18-rc6-xen/drivers/char/tpm/Kconfig
---- linux-2.6.18-rc6/drivers/char/tpm/Kconfig	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/Kconfig	2006-09-04 16:31:04.000000000 +0200
-@@ -31,7 +31,7 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/Kconfig linux-2.6.18-xen/drivers/char/tpm/Kconfig
+--- linux-2.6.18/drivers/char/tpm/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/char/tpm/Kconfig	2006-08-15 13:03:18.000000000 +0200
+@@ -31,6 +31,7 @@
  
  config TCG_NSC
  	tristate "National Semiconductor TPM Interface"
--	depends on TCG_TPM && PNPACPI
 +	depends on TCG_TPM && PNPACPI && !XEN_UNPRIVILEGED_GUEST
+ 	depends on TCG_TPM && PNPACPI
  	---help---
  	  If you have a TPM security chip from National Semicondutor 
- 	  say Yes and it will be accessible from within Linux.  To 
-@@ -58,5 +58,13 @@
+@@ -58,5 +59,13 @@
  	  Further information on this driver and the supported hardware
  	  can be found at http://www.prosec.rub.de/tpm
  
@@ -43991,18 +43745,18 @@
 +	  will be called tpm_xenu.
  
 +endmenu
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/Makefile linux-2.6.18-rc6-xen/drivers/char/tpm/Makefile
---- linux-2.6.18-rc6/drivers/char/tpm/Makefile	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/Makefile	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/Makefile linux-2.6.18-xen/drivers/char/tpm/Makefile
+--- linux-2.6.18/drivers/char/tpm/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/char/tpm/Makefile	2006-08-15 13:03:18.000000000 +0200
 @@ -9,3 +9,5 @@
  obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 +obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
 +tpm_xenu-y = tpm_xen.o tpm_vtpm.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/tpm.c linux-2.6.18-rc6-xen/drivers/char/tpm/tpm.c
---- linux-2.6.18-rc6/drivers/char/tpm/tpm.c	2006-09-05 10:53:12.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/tpm.c	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/tpm.c linux-2.6.18-xen/drivers/char/tpm/tpm.c
+--- linux-2.6.18/drivers/char/tpm/tpm.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/char/tpm/tpm.c	2006-09-17 17:44:47.000000000 +0200
 @@ -30,7 +30,9 @@
  
  enum tpm_const {
@@ -44123,40 +43877,86 @@
  	return ret_size;
  }
  EXPORT_SYMBOL_GPL(tpm_read);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/tpm.h linux-2.6.18-rc6-xen/drivers/char/tpm/tpm.h
---- linux-2.6.18-rc6/drivers/char/tpm/tpm.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/tpm.h	2006-09-04 16:31:04.000000000 +0200
-@@ -61,6 +61,7 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/tpm.h linux-2.6.18-xen/drivers/char/tpm/tpm.h
+--- linux-2.6.18/drivers/char/tpm/tpm.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/char/tpm/tpm.h	2006-08-15 13:03:18.000000000 +0200
+@@ -26,6 +26,13 @@
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+ 
++#ifdef CONFIG_XEN
++enum tpm_bufsize {
++	TPM_MIN_BUFFERSIZE = 2048,
++	TPM_MAX_BUFFERSIZE = 64 * 1024,
++};
++#endif
++
+ enum tpm_timeout {
+ 	TPM_TIMEOUT = 5,	/* msecs */
+ };
+@@ -61,6 +68,9 @@
  	const u8 req_complete_mask;
  	const u8 req_complete_val;
  	const u8 req_canceled;
++#ifdef CONFIG_XEN
 +	u32 buffersize;
++#endif
  	void __iomem *iobase;		/* ioremapped address */
  	unsigned long base;		/* TPM base address */
  
-@@ -94,6 +95,7 @@
+@@ -94,6 +104,9 @@
  	/* Data passed to and from the tpm via the read/write calls */
  	u8 *data_buffer;
  	atomic_t data_pending;
++#ifdef CONFIG_XEN
 +	atomic_t data_position;
++#endif
  	struct semaphore buffer_mutex;
  
  	struct timer_list user_read_timer;	/* user needs to claim result */
-@@ -121,6 +123,11 @@
+@@ -105,6 +118,9 @@
+ 	struct dentry **bios_dir;
+ 
+ 	struct list_head list;
++#ifdef CONFIG_XEN
++	void *priv;
++#endif
+ };
+ 
+ #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
+@@ -121,6 +137,29 @@
  	outb(value & 0xFF, base+1);
  }
  
++#ifdef CONFIG_XEN
 +static inline u32 get_chip_buffersize(struct tpm_chip *chip)
 +{
-+	return chip->vendor->buffersize;
++	u32 size = chip->vendor.buffersize;
++	if (size > TPM_MAX_BUFFERSIZE) {
++		return TPM_MAX_BUFFERSIZE;
++	} else if (size < TPM_MIN_BUFFERSIZE) {
++		return TPM_MIN_BUFFERSIZE;
++	}
++	return size;
++}
++
++static inline void *chip_get_private(const struct tpm_chip *chip)
++{
++	return chip->priv;
 +}
 +
++static inline void chip_set_private(struct tpm_chip *chip, void *priv)
++{
++	chip->priv = priv;
++}
++#endif
++
  extern void tpm_get_timeouts(struct tpm_chip *);
  extern void tpm_gen_interrupt(struct tpm_chip *);
  extern void tpm_continue_selftest(struct tpm_chip *);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/tpm_vtpm.c linux-2.6.18-rc6-xen/drivers/char/tpm/tpm_vtpm.c
---- linux-2.6.18-rc6/drivers/char/tpm/tpm_vtpm.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/tpm_vtpm.c	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/tpm_vtpm.c linux-2.6.18-xen/drivers/char/tpm/tpm_vtpm.c
+--- linux-2.6.18/drivers/char/tpm/tpm_vtpm.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/char/tpm/tpm_vtpm.c	2006-08-15 13:03:18.000000000 +0200
 @@ -0,0 +1,547 @@
 +/*
 + * Copyright (C) 2006 IBM Corporation
@@ -44705,9 +44505,9 @@
 +	tpm_remove_hardware(dev);
 +	kfree(vtpms);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/tpm_vtpm.h linux-2.6.18-rc6-xen/drivers/char/tpm/tpm_vtpm.h
---- linux-2.6.18-rc6/drivers/char/tpm/tpm_vtpm.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/tpm_vtpm.h	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/tpm_vtpm.h linux-2.6.18-xen/drivers/char/tpm/tpm_vtpm.h
+--- linux-2.6.18/drivers/char/tpm/tpm_vtpm.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/char/tpm/tpm_vtpm.h	2006-08-15 13:03:18.000000000 +0200
 @@ -0,0 +1,68 @@
 +#ifndef TPM_VTPM_H
 +#define TPM_VTPM_H
@@ -44777,9 +44577,9 @@
 +}
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tpm/tpm_xen.c linux-2.6.18-rc6-xen/drivers/char/tpm/tpm_xen.c
---- linux-2.6.18-rc6/drivers/char/tpm/tpm_xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/char/tpm/tpm_xen.c	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tpm/tpm_xen.c linux-2.6.18-xen/drivers/char/tpm/tpm_xen.c
+--- linux-2.6.18/drivers/char/tpm/tpm_xen.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/char/tpm/tpm_xen.c	2006-09-17 17:44:47.000000000 +0200
 @@ -0,0 +1,756 @@
 +/*
 + * Copyright (c) 2005, IBM Corporation
@@ -45537,9 +45337,9 @@
 +module_init(tpmif_init);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/char/tty_io.c linux-2.6.18-rc6-xen/drivers/char/tty_io.c
---- linux-2.6.18-rc6/drivers/char/tty_io.c	2006-09-05 10:53:12.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/char/tty_io.c	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/char/tty_io.c linux-2.6.18-xen/drivers/char/tty_io.c
+--- linux-2.6.18/drivers/char/tty_io.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/char/tty_io.c	2006-09-17 17:44:47.000000000 +0200
 @@ -130,6 +130,8 @@
     vt.c for deeply disgusting hack reasons */
  DEFINE_MUTEX(tty_mutex);
@@ -45575,9 +45375,9 @@
  #endif
  	return 0;
  }
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/firmware/Kconfig linux-2.6.18-rc6-xen/drivers/firmware/Kconfig
---- linux-2.6.18-rc6/drivers/firmware/Kconfig	2006-09-05 10:53:12.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/firmware/Kconfig	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/firmware/Kconfig linux-2.6.18-xen/drivers/firmware/Kconfig
+--- linux-2.6.18/drivers/firmware/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/firmware/Kconfig	2006-08-15 13:03:18.000000000 +0200
 @@ -7,7 +7,7 @@
  
  config EDD
@@ -45587,9 +45387,9 @@
  	help
  	  Say Y or M here if you want to enable BIOS Enhanced Disk Drive
  	  Services real mode BIOS calls to determine which disk
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/ide/ide-lib.c linux-2.6.18-rc6-xen/drivers/ide/ide-lib.c
---- linux-2.6.18-rc6/drivers/ide/ide-lib.c	2006-09-05 10:53:12.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/ide/ide-lib.c	2006-09-04 16:31:04.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/ide/ide-lib.c linux-2.6.18-xen/drivers/ide/ide-lib.c
+--- linux-2.6.18/drivers/ide/ide-lib.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/ide/ide-lib.c	2006-08-15 13:03:19.000000000 +0200
 @@ -408,10 +408,10 @@
  {
  	u64 addr = BLK_BOUNCE_HIGH;	/* dma64_addr_t */
@@ -45605,9 +45405,9 @@
  			addr = HWIF(drive)->pci_dev->dma_mask;
  	}
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/Makefile linux-2.6.18-rc6-xen/drivers/Makefile
---- linux-2.6.18-rc6/drivers/Makefile	2006-09-05 10:53:10.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/Makefile	2006-09-04 16:31:03.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/Makefile linux-2.6.18-xen/drivers/Makefile
+--- linux-2.6.18/drivers/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/Makefile	2006-08-15 13:03:16.000000000 +0200
 @@ -31,6 +31,7 @@
  obj-$(CONFIG_NUBUS)		+= nubus/
  obj-$(CONFIG_ATM)		+= atm/
@@ -45616,9 +45416,9 @@
  obj-$(CONFIG_IDE)		+= ide/
  obj-$(CONFIG_FC4)		+= fc4/
  obj-$(CONFIG_SCSI)		+= scsi/
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/buffer_sync.c linux-2.6.18-rc6-xen/drivers/oprofile/buffer_sync.c
---- linux-2.6.18-rc6/drivers/oprofile/buffer_sync.c	2006-09-05 10:53:21.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/buffer_sync.c	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/buffer_sync.c linux-2.6.18-xen/drivers/oprofile/buffer_sync.c
+--- linux-2.6.18/drivers/oprofile/buffer_sync.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/buffer_sync.c	2006-08-15 13:03:24.000000000 +0200
 @@ -6,6 +6,10 @@
   *
   * @author John Levon <levon at movementarian.org>
@@ -45739,9 +45539,9 @@
  				}
  			}
  		}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/cpu_buffer.c linux-2.6.18-rc6-xen/drivers/oprofile/cpu_buffer.c
---- linux-2.6.18-rc6/drivers/oprofile/cpu_buffer.c	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/cpu_buffer.c	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/cpu_buffer.c linux-2.6.18-xen/drivers/oprofile/cpu_buffer.c
+--- linux-2.6.18/drivers/oprofile/cpu_buffer.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/cpu_buffer.c	2006-08-15 13:03:24.000000000 +0200
 @@ -6,6 +6,10 @@
   *
   * @author John Levon <levon at movementarian.org>
@@ -45798,13 +45598,12 @@
  {
  	struct task_struct * task;
  
-@@ -180,18 +186,20 @@
+@@ -180,18 +186,18 @@
  		return 0;
  	}
  
 -	is_kernel = !!is_kernel;
-+	WARN_ON(cpu_mode > CPU_MODE_XEN);
- 
+-
  	task = current;
  
  	/* notice a switch from user->kernel or vice versa */
@@ -45825,7 +45624,7 @@
  		cpu_buf->last_task = task;
  		add_code(cpu_buf, (unsigned long)task);
  	}
-@@ -275,6 +283,25 @@
+@@ -275,6 +281,25 @@
  	add_sample(cpu_buf, pc, 0);
  }
  
@@ -45851,9 +45650,9 @@
  /*
   * This serves to avoid cpu buffer overflow, and makes sure
   * the task mortuary progresses
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/cpu_buffer.h linux-2.6.18-rc6-xen/drivers/oprofile/cpu_buffer.h
---- linux-2.6.18-rc6/drivers/oprofile/cpu_buffer.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/cpu_buffer.h	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/cpu_buffer.h linux-2.6.18-xen/drivers/oprofile/cpu_buffer.h
+--- linux-2.6.18/drivers/oprofile/cpu_buffer.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/cpu_buffer.h	2006-08-15 13:03:24.000000000 +0200
 @@ -36,7 +36,7 @@
  	volatile unsigned long tail_pos;
  	unsigned long buffer_size;
@@ -45876,9 +45675,9 @@
 +#define CPU_DOMAIN_SWITCH       4
  
  #endif /* OPROFILE_CPU_BUFFER_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/event_buffer.h linux-2.6.18-rc6-xen/drivers/oprofile/event_buffer.h
---- linux-2.6.18-rc6/drivers/oprofile/event_buffer.h	2006-09-05 10:53:21.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/event_buffer.h	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/event_buffer.h linux-2.6.18-xen/drivers/oprofile/event_buffer.h
+--- linux-2.6.18/drivers/oprofile/event_buffer.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/event_buffer.h	2006-08-15 13:03:24.000000000 +0200
 @@ -29,15 +29,20 @@
  #define CPU_SWITCH_CODE 		2
  #define COOKIE_SWITCH_CODE 		3
@@ -45901,9 +45700,9 @@
  /* add data to the event buffer */
  void add_event_entry(unsigned long data);
   
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/oprof.c linux-2.6.18-rc6-xen/drivers/oprofile/oprof.c
---- linux-2.6.18-rc6/drivers/oprofile/oprof.c	2006-09-05 10:53:21.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/oprof.c	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/oprof.c linux-2.6.18-xen/drivers/oprofile/oprof.c
+--- linux-2.6.18/drivers/oprofile/oprof.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/oprof.c	2006-08-15 13:03:24.000000000 +0200
 @@ -5,6 +5,10 @@
   * @remark Read the file COPYING
   *
@@ -45957,9 +45756,9 @@
  int oprofile_setup(void)
  {
  	int err;
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/oprof.h linux-2.6.18-rc6-xen/drivers/oprofile/oprof.h
---- linux-2.6.18-rc6/drivers/oprofile/oprof.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/oprof.h	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/oprof.h linux-2.6.18-xen/drivers/oprofile/oprof.h
+--- linux-2.6.18/drivers/oprofile/oprof.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/oprof.h	2006-08-15 13:03:24.000000000 +0200
 @@ -35,5 +35,8 @@
  void oprofile_timer_init(struct oprofile_operations * ops);
  
@@ -45969,9 +45768,9 @@
 +int oprofile_set_passive(int passive_domains[], unsigned int pdomains);
   
  #endif /* OPROF_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/oprofile/oprofile_files.c linux-2.6.18-rc6-xen/drivers/oprofile/oprofile_files.c
---- linux-2.6.18-rc6/drivers/oprofile/oprofile_files.c	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/oprofile/oprofile_files.c	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/oprofile/oprofile_files.c linux-2.6.18-xen/drivers/oprofile/oprofile_files.c
+--- linux-2.6.18/drivers/oprofile/oprofile_files.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/oprofile/oprofile_files.c	2006-08-15 13:03:24.000000000 +0200
 @@ -5,15 +5,21 @@
   * @remark Read the file COPYING
   *
@@ -45995,14 +45794,13 @@
  unsigned long fs_buffer_size = 131072;
  unsigned long fs_cpu_buffer_size = 8192;
  unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */
-@@ -117,11 +123,208 @@
+@@ -117,11 +123,206 @@
  static struct file_operations dump_fops = {
  	.write		= dump_write,
  };
 - 
 +
 +#ifdef CONFIG_XEN
-+
 +#define TMPBUFSIZE 512
 +
 +static unsigned int adomains = 0;
@@ -46191,8 +45989,7 @@
 +	.read		= pdomain_read,
 +	.write		= pdomain_write,
 +};
-+
-+#endif /* CONFIG_XEN */
++#endif
 +
  void oprofile_create_files(struct super_block * sb, struct dentry * root)
  {
@@ -46205,9 +46002,9 @@
  	oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
  	oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size);
  	oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/pci/Kconfig linux-2.6.18-rc6-xen/drivers/pci/Kconfig
---- linux-2.6.18-rc6/drivers/pci/Kconfig	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/pci/Kconfig	2006-09-04 16:31:08.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/pci/Kconfig linux-2.6.18-xen/drivers/pci/Kconfig
+--- linux-2.6.18/drivers/pci/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/pci/Kconfig	2006-05-26 22:00:30.000000000 +0200
 @@ -5,6 +5,7 @@
  	bool "Message Signaled Interrupts (MSI and MSI-X)"
  	depends on PCI
@@ -46216,9 +46013,9 @@
  	help
  	   This allows device drivers to enable MSI (Message Signaled
  	   Interrupts).  Message Signaled Interrupts enable a device to
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/serial/Kconfig linux-2.6.18-rc6-xen/drivers/serial/Kconfig
---- linux-2.6.18-rc6/drivers/serial/Kconfig	2006-09-05 10:53:23.000000000 +0200
-+++ linux-2.6.18-rc6-xen/drivers/serial/Kconfig	2006-09-04 16:31:10.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/serial/Kconfig linux-2.6.18-xen/drivers/serial/Kconfig
+--- linux-2.6.18/drivers/serial/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/drivers/serial/Kconfig	2006-08-15 13:03:26.000000000 +0200
 @@ -11,6 +11,7 @@
  config SERIAL_8250
  	tristate "8250/16550 and compatible serial support"
@@ -46227,9 +46024,9 @@
  	select SERIAL_CORE
  	---help---
  	  This selects whether you want to include the driver for the standard
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/balloon/balloon.c linux-2.6.18-rc6-xen/drivers/xen/balloon/balloon.c
---- linux-2.6.18-rc6/drivers/xen/balloon/balloon.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/balloon/balloon.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/balloon/balloon.c linux-2.6.18-xen/drivers/xen/balloon/balloon.c
+--- linux-2.6.18/drivers/xen/balloon/balloon.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/balloon/balloon.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,625 @@
 +/******************************************************************************
 + * balloon.c
@@ -46856,16 +46653,16 @@
 +EXPORT_SYMBOL_GPL(balloon_release_driver_page);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/balloon/Makefile linux-2.6.18-rc6-xen/drivers/xen/balloon/Makefile
---- linux-2.6.18-rc6/drivers/xen/balloon/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/balloon/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/balloon/Makefile linux-2.6.18-xen/drivers/xen/balloon/Makefile
+--- linux-2.6.18/drivers/xen/balloon/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/balloon/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +obj-y += balloon.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkback/blkback.c linux-2.6.18-rc6-xen/drivers/xen/blkback/blkback.c
---- linux-2.6.18-rc6/drivers/xen/blkback/blkback.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkback/blkback.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,567 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkback/blkback.c linux-2.6.18-xen/drivers/xen/blkback/blkback.c
+--- linux-2.6.18/drivers/xen/blkback/blkback.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkback/blkback.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,566 @@
 +/******************************************************************************
 + * arch/xen/drivers/blkif/backend/main.c
 + * 
@@ -46908,7 +46705,6 @@
 +#include <linux/list.h>
 +#include <xen/balloon.h>
 +#include <asm/hypervisor.h>
-+#include <asm/hypercall.h>
 +#include "common.h"
 +
 +/*
@@ -47433,9 +47229,9 @@
 +module_init(blkif_init);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkback/common.h linux-2.6.18-rc6-xen/drivers/xen/blkback/common.h
---- linux-2.6.18-rc6/drivers/xen/blkback/common.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkback/common.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkback/common.h linux-2.6.18-xen/drivers/xen/blkback/common.h
+--- linux-2.6.18/drivers/xen/blkback/common.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkback/common.h	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,133 @@
 +/* 
 + * This program is free software; you can redistribute it and/or
@@ -47570,9 +47366,9 @@
 +int blkif_schedule(void *arg);
 +
 +#endif /* __BLKIF__BACKEND__COMMON_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkback/interface.c linux-2.6.18-rc6-xen/drivers/xen/blkback/interface.c
---- linux-2.6.18-rc6/drivers/xen/blkback/interface.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkback/interface.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkback/interface.c linux-2.6.18-xen/drivers/xen/blkback/interface.c
+--- linux-2.6.18/drivers/xen/blkback/interface.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkback/interface.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,171 @@
 +/******************************************************************************
 + * arch/xen/drivers/blkif/backend/interface.c
@@ -47745,16 +47541,16 @@
 +	blkif_cachep = kmem_cache_create("blkif_cache", sizeof(blkif_t), 
 +					 0, 0, NULL, NULL);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkback/Makefile linux-2.6.18-rc6-xen/drivers/xen/blkback/Makefile
---- linux-2.6.18-rc6/drivers/xen/blkback/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkback/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkback/Makefile linux-2.6.18-xen/drivers/xen/blkback/Makefile
+--- linux-2.6.18/drivers/xen/blkback/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkback/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,3 @@
 +obj-$(CONFIG_XEN_BLKDEV_BACKEND) := blkbk.o
 +
 +blkbk-y	:= blkback.o xenbus.o interface.o vbd.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkback/vbd.c linux-2.6.18-rc6-xen/drivers/xen/blkback/vbd.c
---- linux-2.6.18-rc6/drivers/xen/blkback/vbd.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkback/vbd.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkback/vbd.c linux-2.6.18-xen/drivers/xen/blkback/vbd.c
+--- linux-2.6.18/drivers/xen/blkback/vbd.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkback/vbd.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,119 @@
 +/******************************************************************************
 + * blkback/vbd.c
@@ -47875,9 +47671,9 @@
 + out:
 +	return rc;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkback/xenbus.c linux-2.6.18-rc6-xen/drivers/xen/blkback/xenbus.c
---- linux-2.6.18-rc6/drivers/xen/blkback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkback/xenbus.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkback/xenbus.c linux-2.6.18-xen/drivers/xen/blkback/xenbus.c
+--- linux-2.6.18/drivers/xen/blkback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkback/xenbus.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,464 @@
 +/*  Xenbus code for blkif backend
 +    Copyright (C) 2005 Rusty Russell <rusty at rustcorp.com.au>
@@ -48343,9 +48139,9 @@
 +{
 +	xenbus_register_backend(&blkback);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkfront/blkfront.c linux-2.6.18-rc6-xen/drivers/xen/blkfront/blkfront.c
---- linux-2.6.18-rc6/drivers/xen/blkfront/blkfront.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkfront/blkfront.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkfront/blkfront.c linux-2.6.18-xen/drivers/xen/blkfront/blkfront.c
+--- linux-2.6.18/drivers/xen/blkfront/blkfront.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkfront/blkfront.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,842 @@
 +/******************************************************************************
 + * blkfront.c
@@ -49189,9 +48985,9 @@
 +module_exit(xlblk_exit);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkfront/block.h linux-2.6.18-rc6-xen/drivers/xen/blkfront/block.h
---- linux-2.6.18-rc6/drivers/xen/blkfront/block.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkfront/block.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkfront/block.h linux-2.6.18-xen/drivers/xen/blkfront/block.h
+--- linux-2.6.18/drivers/xen/blkfront/block.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkfront/block.h	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,154 @@
 +/******************************************************************************
 + * block.h
@@ -49347,9 +49143,9 @@
 +void xlvbd_del(struct blkfront_info *info);
 +
 +#endif /* __XEN_DRIVERS_BLOCK_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkfront/Kconfig linux-2.6.18-rc6-xen/drivers/xen/blkfront/Kconfig
---- linux-2.6.18-rc6/drivers/xen/blkfront/Kconfig	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkfront/Kconfig	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkfront/Kconfig linux-2.6.18-xen/drivers/xen/blkfront/Kconfig
+--- linux-2.6.18/drivers/xen/blkfront/Kconfig	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkfront/Kconfig	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,6 @@
 +
 +config XENBLOCK
@@ -49357,19 +49153,19 @@
 +	depends on ARCH_XEN
 +	help
 +	  Block device driver for Xen
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkfront/Makefile linux-2.6.18-rc6-xen/drivers/xen/blkfront/Makefile
---- linux-2.6.18-rc6/drivers/xen/blkfront/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkfront/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkfront/Makefile linux-2.6.18-xen/drivers/xen/blkfront/Makefile
+--- linux-2.6.18/drivers/xen/blkfront/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkfront/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,5 @@
 +
 +obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	:= xenblk.o
 +
 +xenblk-objs := blkfront.o vbd.o
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blkfront/vbd.c linux-2.6.18-rc6-xen/drivers/xen/blkfront/vbd.c
---- linux-2.6.18-rc6/drivers/xen/blkfront/vbd.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blkfront/vbd.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,318 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blkfront/vbd.c linux-2.6.18-xen/drivers/xen/blkfront/vbd.c
+--- linux-2.6.18/drivers/xen/blkfront/vbd.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blkfront/vbd.c	2006-08-15 13:03:28.000000000 +0200
+@@ -0,0 +1,317 @@
 +/******************************************************************************
 + * vbd.c
 + * 
@@ -49502,7 +49298,6 @@
 +		return NULL;
 +	}
 +
-+/*	devfs_mk_dir(ptr->type->devname);*/
 +	major_info[index] = ptr;
 +	return ptr;
 +}
@@ -49688,10 +49483,10 @@
 +	blk_cleanup_queue(info->rq);
 +	info->rq = NULL;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blktap/blktap.c linux-2.6.18-rc6-xen/drivers/xen/blktap/blktap.c
---- linux-2.6.18-rc6/drivers/xen/blktap/blktap.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blktap/blktap.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,1444 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blktap/blktap.c linux-2.6.18-xen/drivers/xen/blktap/blktap.c
+--- linux-2.6.18/drivers/xen/blktap/blktap.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blktap/blktap.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,1442 @@
 +/******************************************************************************
 + * drivers/xen/blktap/blktap.c
 + * 
@@ -49807,8 +49602,8 @@
 +} domid_translate_t ;
 +
 +
-+static domid_translate_t  translate_domid[MAX_TAP_DEV];
-+static tap_blkif_t *tapfds[MAX_TAP_DEV];
++domid_translate_t  translate_domid[MAX_TAP_DEV];
++tap_blkif_t *tapfds[MAX_TAP_DEV];
 +
 +static int __init set_blkif_reqs(char *str)
 +{
@@ -50811,7 +50606,7 @@
 +			       "ring does not exist!\n");
 +			print_dbug = 0; /*We only print this message once*/
 +		}
-+		return 0;
++		return 1;
 +	}
 +
 +	info = tapfds[blkif->dev_num];
@@ -50820,7 +50615,7 @@
 +			WPRINTK("Can't get UE info!\n");
 +			print_dbug = 0;
 +		}
-+		return 0;
++		return 1;
 +	}
 +
 +	while (rc != rp) {
@@ -51085,7 +50880,7 @@
 +
 +static int __init blkif_init(void)
 +{
-+	int i, ret;
++	int i,ret;
 +	tap_blkif_t *info;
 +
 +	if (!is_running_on_xen())
@@ -51111,7 +50906,7 @@
 +
 +	ret = register_chrdev(BLKTAP_DEV_MAJOR,"blktap",&blktap_fops);
 +
-+	if ( (ret < 0) ) {
++	if (ret < 0) {
 +		WPRINTK("Couldn't register /dev/xen/blktap\n");
 +		return -ENOMEM;
 +	}	
@@ -51124,8 +50919,6 @@
 +		info->blkif = NULL;
 +
 +		info->dev_pending = info->dev_inuse = 0;
-+
-+		DPRINTK("Created misc_dev [/dev/xen/blktap%d]\n",i);
 +	}
 +	
 +	DPRINTK("Blktap device successfully created\n");
@@ -51136,9 +50929,9 @@
 +module_init(blkif_init);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blktap/common.h linux-2.6.18-rc6-xen/drivers/xen/blktap/common.h
---- linux-2.6.18-rc6/drivers/xen/blktap/common.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blktap/common.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blktap/common.h linux-2.6.18-xen/drivers/xen/blktap/common.h
+--- linux-2.6.18/drivers/xen/blktap/common.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blktap/common.h	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,119 @@
 +/* 
 + * This program is free software; you can redistribute it and/or
@@ -51259,9 +51052,9 @@
 +void signal_tapdisk(int idx);
 +
 +#endif /* __BLKIF__BACKEND__COMMON_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blktap/interface.c linux-2.6.18-rc6-xen/drivers/xen/blktap/interface.c
---- linux-2.6.18-rc6/drivers/xen/blktap/interface.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blktap/interface.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blktap/interface.c linux-2.6.18-xen/drivers/xen/blktap/interface.c
+--- linux-2.6.18/drivers/xen/blktap/interface.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blktap/interface.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,159 @@
 +/******************************************************************************
 + * drivers/xen/blktap/interface.c
@@ -51422,16 +51215,16 @@
 +	blkif_cachep = kmem_cache_create("blktapif_cache", sizeof(blkif_t), 
 +					 0, 0, NULL, NULL);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blktap/Makefile linux-2.6.18-rc6-xen/drivers/xen/blktap/Makefile
---- linux-2.6.18-rc6/drivers/xen/blktap/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blktap/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blktap/Makefile linux-2.6.18-xen/drivers/xen/blktap/Makefile
+--- linux-2.6.18/drivers/xen/blktap/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blktap/Makefile	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,3 @@
 +LINUXINCLUDE += -I../xen/include/public/io
 +obj-y	:= xenbus.o interface.o blktap.o 
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/blktap/xenbus.c linux-2.6.18-rc6-xen/drivers/xen/blktap/xenbus.c
---- linux-2.6.18-rc6/drivers/xen/blktap/xenbus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/blktap/xenbus.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/blktap/xenbus.c linux-2.6.18-xen/drivers/xen/blktap/xenbus.c
+--- linux-2.6.18/drivers/xen/blktap/xenbus.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/blktap/xenbus.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,353 @@
 +/* drivers/xen/blktap/xenbus.c
 + *
@@ -51786,15 +51579,15 @@
 +{
 +	xenbus_register_backend(&blktap);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/char/Makefile linux-2.6.18-rc6-xen/drivers/xen/char/Makefile
---- linux-2.6.18-rc6/drivers/xen/char/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/char/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/char/Makefile linux-2.6.18-xen/drivers/xen/char/Makefile
+--- linux-2.6.18/drivers/xen/char/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/char/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +obj-y	:= mem.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/char/mem.c linux-2.6.18-rc6-xen/drivers/xen/char/mem.c
---- linux-2.6.18-rc6/drivers/xen/char/mem.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/char/mem.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/char/mem.c linux-2.6.18-xen/drivers/xen/char/mem.c
+--- linux-2.6.18/drivers/xen/char/mem.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/char/mem.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,180 @@
 +/*
 + *  Originally from linux/drivers/char/mem.c
@@ -51976,9 +51769,9 @@
 +	.mmap		= mmap_mem,
 +	.open		= open_mem,
 +};
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/console/console.c linux-2.6.18-rc6-xen/drivers/xen/console/console.c
---- linux-2.6.18-rc6/drivers/xen/console/console.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/console/console.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/console/console.c linux-2.6.18-xen/drivers/xen/console/console.c
+--- linux-2.6.18/drivers/xen/console/console.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/console/console.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,644 @@
 +/******************************************************************************
 + * console.c
@@ -52020,7 +51813,6 @@
 +#include <linux/interrupt.h>
 +#include <linux/tty.h>
 +#include <linux/tty_flip.h>
-+#include <linux/vt.h>
 +#include <linux/serial.h>
 +#include <linux/major.h>
 +#include <linux/ptrace.h>
@@ -52031,6 +51823,7 @@
 +#include <linux/console.h>
 +#include <linux/bootmem.h>
 +#include <linux/sysrq.h>
++#include <linux/vt.h>
 +#include <asm/io.h>
 +#include <asm/irq.h>
 +#include <asm/uaccess.h>
@@ -52624,15 +52417,15 @@
 +module_init(xencons_init);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/console/Makefile linux-2.6.18-rc6-xen/drivers/xen/console/Makefile
---- linux-2.6.18-rc6/drivers/xen/console/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/console/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/console/Makefile linux-2.6.18-xen/drivers/xen/console/Makefile
+--- linux-2.6.18/drivers/xen/console/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/console/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +obj-y	:= console.o xencons_ring.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/console/xencons_ring.c linux-2.6.18-rc6-xen/drivers/xen/console/xencons_ring.c
---- linux-2.6.18-rc6/drivers/xen/console/xencons_ring.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/console/xencons_ring.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/console/xencons_ring.c linux-2.6.18-xen/drivers/xen/console/xencons_ring.c
+--- linux-2.6.18/drivers/xen/console/xencons_ring.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/console/xencons_ring.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,141 @@
 +/* 
 + * This program is free software; you can redistribute it and/or
@@ -52775,9 +52568,9 @@
 +{
 +	(void)xencons_ring_init();
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/cpu_hotplug.c linux-2.6.18-rc6-xen/drivers/xen/core/cpu_hotplug.c
---- linux-2.6.18-rc6/drivers/xen/core/cpu_hotplug.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/cpu_hotplug.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/cpu_hotplug.c linux-2.6.18-xen/drivers/xen/core/cpu_hotplug.c
+--- linux-2.6.18/drivers/xen/core/cpu_hotplug.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/cpu_hotplug.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,188 @@
 +
 +#include <linux/init.h>
@@ -52967,10 +52760,10 @@
 +{
 +	xenbus_allowed_cpumask = cpu_present_map;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/evtchn.c linux-2.6.18-rc6-xen/drivers/xen/core/evtchn.c
---- linux-2.6.18-rc6/drivers/xen/core/evtchn.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/evtchn.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,868 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/evtchn.c linux-2.6.18-xen/drivers/xen/core/evtchn.c
+--- linux-2.6.18/drivers/xen/core/evtchn.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/evtchn.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,865 @@
 +/******************************************************************************
 + * evtchn.c
 + * 
@@ -53448,11 +53241,12 @@
 +static int retrigger(unsigned int irq)
 +{
 +	int evtchn = evtchn_from_irq(irq);
-+	shared_info_t *s = HYPERVISOR_shared_info;
++	struct shared_info *s = HYPERVISOR_shared_info;
 +	if (!VALID_EVTCHN(evtchn))
-+		return 1;
-+	BUG_ON(!synch_test_bit(evtchn, &s->evtchn_mask[0]));
++		goto out;
++	BUG_ON(!test_bit(evtchn, &s->evtchn_mask[0]));
 +	synch_set_bit(evtchn, &s->evtchn_pending[0]);
++out:
 +	return 1;
 +}
 +
@@ -53513,17 +53307,15 @@
 +		unmask_evtchn(evtchn);
 +}
 +
-+static struct hw_interrupt_type dynirq_type = {
-+	.typename	= "Dynamic-irq",
++static struct hw_interrupt_type dynirq_type __read_mostly = {
++	.name		= "Dynamic-irq",
 +	.startup	= startup_dynirq,
 +	.shutdown	= shutdown_dynirq,
 +	.enable		= enable_dynirq,
 +	.disable	= disable_dynirq,
 +	.ack		= ack_dynirq,
 +	.end		= end_dynirq,
-+#ifdef CONFIG_SMP
 +	.set_affinity	= set_affinity_irq,
-+#endif
 +	.retrigger	= retrigger,
 +};
 +
@@ -53641,18 +53433,16 @@
 +	}
 +}
 +
-+static struct hw_interrupt_type pirq_type = {
-+	.typename	= "Phys-irq",
++static struct hw_interrupt_type pirq_type __read_mostly = {
++	.name		= "Phys-irq",
 +	.startup	= startup_pirq,
 +	.shutdown	= shutdown_pirq,
 +	.enable		= enable_pirq,
 +	.disable	= disable_pirq,
 +	.ack		= ack_pirq,
 +	.end		= end_pirq,
-+#ifdef CONFIG_SMP
 +	.set_affinity	= set_affinity_irq,
-+#endif
-+	.retrigger	= retrigger,
++	.retrigger	= retrigger
 +};
 +
 +int irq_ignore_unhandled(unsigned int irq)
@@ -53666,7 +53456,7 @@
 +	return !!(irq_status.flags & XENIRQSTAT_shared);
 +}
 +
-+void resend_irq_on_evtchn(unsigned int i)
++void resend_irq_on_evtchn(struct hw_interrupt_type *h, unsigned int i)
 +{
 +	int evtchn = evtchn_from_irq(i);
 +	shared_info_t *s = HYPERVISOR_shared_info;
@@ -53820,7 +53610,7 @@
 +		irq_desc[dynirq_to_irq(i)].status  = IRQ_DISABLED;
 +		irq_desc[dynirq_to_irq(i)].action  = NULL;
 +		irq_desc[dynirq_to_irq(i)].depth   = 1;
-+		irq_desc[dynirq_to_irq(i)].chip    = &dynirq_type;
++		irq_desc[dynirq_to_irq(i)].chip = &dynirq_type;
 +	}
 +
 +	/* Phys IRQ space is statically bound (1:1 mapping). Nail refcnts. */
@@ -53836,12 +53626,12 @@
 +		irq_desc[pirq_to_irq(i)].status  = IRQ_DISABLED;
 +		irq_desc[pirq_to_irq(i)].action  = NULL;
 +		irq_desc[pirq_to_irq(i)].depth   = 1;
-+		irq_desc[pirq_to_irq(i)].chip    = &pirq_type;
++		irq_desc[pirq_to_irq(i)].chip = &pirq_type;
 +	}
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/features.c linux-2.6.18-rc6-xen/drivers/xen/core/features.c
---- linux-2.6.18-rc6/drivers/xen/core/features.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/features.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/features.c linux-2.6.18-xen/drivers/xen/core/features.c
+--- linux-2.6.18/drivers/xen/core/features.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/features.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,30 @@
 +/******************************************************************************
 + * features.c
@@ -53873,9 +53663,9 @@
 +			xen_features[i*32+j] = !!(fi.submap & 1<<j);
 +	}
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/gnttab.c linux-2.6.18-rc6-xen/drivers/xen/core/gnttab.c
---- linux-2.6.18-rc6/drivers/xen/core/gnttab.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/gnttab.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/gnttab.c linux-2.6.18-xen/drivers/xen/core/gnttab.c
+--- linux-2.6.18/drivers/xen/core/gnttab.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/gnttab.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,483 @@
 +/******************************************************************************
 + * gnttab.c
@@ -54360,9 +54150,9 @@
 +#ifdef CONFIG_XEN
 +core_initcall(gnttab_init);
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/hypervisor_sysfs.c linux-2.6.18-rc6-xen/drivers/xen/core/hypervisor_sysfs.c
---- linux-2.6.18-rc6/drivers/xen/core/hypervisor_sysfs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/hypervisor_sysfs.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/hypervisor_sysfs.c linux-2.6.18-xen/drivers/xen/core/hypervisor_sysfs.c
+--- linux-2.6.18/drivers/xen/core/hypervisor_sysfs.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/hypervisor_sysfs.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,59 @@
 +/*
 + *  copyright (c) 2006 IBM Corporation
@@ -54423,9 +54213,9 @@
 +
 +device_initcall(hypervisor_subsys_init);
 +EXPORT_SYMBOL_GPL(hypervisor_subsys);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/Makefile linux-2.6.18-rc6-xen/drivers/xen/core/Makefile
---- linux-2.6.18-rc6/drivers/xen/core/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/Makefile linux-2.6.18-xen/drivers/xen/core/Makefile
+--- linux-2.6.18/drivers/xen/core/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/Makefile	2006-07-07 20:51:41.000000000 +0200
 @@ -0,0 +1,13 @@
 +#
 +# Makefile for the linux kernel.
@@ -54440,9 +54230,9 @@
 +obj-$(CONFIG_XEN_SKBUFF)	+= skbuff.o
 +obj-$(CONFIG_XEN_REBOOT)	+= reboot.o
 +obj-$(CONFIG_XEN_SMPBOOT)	+= smpboot.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/reboot.c linux-2.6.18-rc6-xen/drivers/xen/core/reboot.c
---- linux-2.6.18-rc6/drivers/xen/core/reboot.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/reboot.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/reboot.c linux-2.6.18-xen/drivers/xen/core/reboot.c
+--- linux-2.6.18/drivers/xen/core/reboot.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/reboot.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,384 @@
 +#define __KERNEL_SYSCALLS__
 +#include <linux/version.h>
@@ -54828,9 +54618,9 @@
 +}
 +
 +subsys_initcall(setup_shutdown_event);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/skbuff.c linux-2.6.18-rc6-xen/drivers/xen/core/skbuff.c
---- linux-2.6.18-rc6/drivers/xen/core/skbuff.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/skbuff.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/skbuff.c linux-2.6.18-xen/drivers/xen/core/skbuff.c
+--- linux-2.6.18/drivers/xen/core/skbuff.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/skbuff.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,139 @@
 +
 +#include <linux/module.h>
@@ -54971,10 +54761,10 @@
 +core_initcall(skbuff_init);
 +
 +EXPORT_SYMBOL(__dev_alloc_skb);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/smpboot.c linux-2.6.18-rc6-xen/drivers/xen/core/smpboot.c
---- linux-2.6.18-rc6/drivers/xen/core/smpboot.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/smpboot.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,429 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/smpboot.c linux-2.6.18-xen/drivers/xen/core/smpboot.c
+--- linux-2.6.18/drivers/xen/core/smpboot.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/smpboot.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,434 @@
 +/*
 + *	Xen SMP booting functions
 + *
@@ -55015,13 +54805,15 @@
 +
 +/* Number of siblings per CPU package */
 +int smp_num_siblings = 1;
-+EXPORT_SYMBOL(smp_num_siblings);
++int phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
++EXPORT_SYMBOL(phys_proc_id);
++int cpu_core_id[NR_CPUS]; /* Core ID of each logical CPU */
++EXPORT_SYMBOL(cpu_core_id);
 +#if defined(__i386__)
 +int cpu_llc_id[NR_CPUS] __cpuinitdata = {[0 ... NR_CPUS-1] = BAD_APICID};
 +#elif defined(__x86_64__)
 +u8 cpu_llc_id[NR_CPUS] __cpuinitdata  = {[0 ... NR_CPUS-1] = BAD_APICID};
 +#endif
-+EXPORT_SYMBOL(cpu_llc_id);
 +
 +cpumask_t cpu_online_map;
 +EXPORT_SYMBOL(cpu_online_map);
@@ -55045,7 +54837,6 @@
 +void *xquad_portio;
 +
 +cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
-+EXPORT_SYMBOL(cpu_sibling_map);
 +cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned;
 +EXPORT_SYMBOL(cpu_core_map);
 +
@@ -55074,8 +54865,8 @@
 +static inline void
 +set_cpu_sibling_map(int cpu)
 +{
-+	cpu_data[cpu].phys_proc_id = cpu;
-+	cpu_data[cpu].cpu_core_id = 0;
++	phys_proc_id[cpu] = cpu;
++	cpu_core_id[cpu]  = 0;
 +
 +	cpu_sibling_map[cpu] = cpumask_of_cpu(cpu);
 +	cpu_core_map[cpu]    = cpumask_of_cpu(cpu);
@@ -55317,8 +55108,8 @@
 +static void
 +remove_siblinginfo(int cpu)
 +{
-+	cpu_data[cpu].phys_proc_id = BAD_APICID;
-+	cpu_data[cpu].cpu_core_id = BAD_APICID;
++	phys_proc_id[cpu] = BAD_APICID;
++	cpu_core_id[cpu]  = BAD_APICID;
 +
 +	cpus_clear(cpu_sibling_map[cpu]);
 +	cpus_clear(cpu_core_map[cpu]);
@@ -55352,8 +55143,10 @@
 +
 +	xen_smp_intr_exit(cpu);
 +
++#if defined(__i386__) || defined(__x86_64__)
 +	if (num_online_cpus() == 1)
 +		alternatives_smp_switch(0);
++#endif
 +}
 +
 +#else /* !CONFIG_HOTPLUG_CPU */
@@ -55378,8 +55171,10 @@
 +	if (rc)
 +		return rc;
 +
++#if defined(__i386__) || defined(__x86_64__)
 +	if (num_online_cpus() == 1)
 +		alternatives_smp_switch(1);
++#endif
 +
 +	/* This must be done before setting cpu_online_map */
 +	set_cpu_sibling_map(cpu);
@@ -55404,9 +55199,9 @@
 +	return -EINVAL;
 +}
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/xen_proc.c linux-2.6.18-rc6-xen/drivers/xen/core/xen_proc.c
---- linux-2.6.18-rc6/drivers/xen/core/xen_proc.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/xen_proc.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/xen_proc.c linux-2.6.18-xen/drivers/xen/core/xen_proc.c
+--- linux-2.6.18/drivers/xen/core/xen_proc.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/xen_proc.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,18 @@
 +
 +#include <linux/proc_fs.h>
@@ -55426,9 +55221,9 @@
 +{
 +	remove_proc_entry(name, xen_base);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/core/xen_sysfs.c linux-2.6.18-rc6-xen/drivers/xen/core/xen_sysfs.c
---- linux-2.6.18-rc6/drivers/xen/core/xen_sysfs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/core/xen_sysfs.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/core/xen_sysfs.c linux-2.6.18-xen/drivers/xen/core/xen_sysfs.c
+--- linux-2.6.18/drivers/xen/core/xen_sysfs.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/core/xen_sysfs.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,378 @@
 +/*
 + *  copyright (c) 2006 IBM Corporation
@@ -55808,9 +55603,9 @@
 +
 +module_init(hyper_sysfs_init);
 +module_exit(hyper_sysfs_exit);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/evtchn/evtchn.c linux-2.6.18-rc6-xen/drivers/xen/evtchn/evtchn.c
---- linux-2.6.18-rc6/drivers/xen/evtchn/evtchn.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/evtchn/evtchn.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/evtchn/evtchn.c linux-2.6.18-xen/drivers/xen/evtchn/evtchn.c
+--- linux-2.6.18/drivers/xen/evtchn/evtchn.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/evtchn/evtchn.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,456 @@
 +/******************************************************************************
 + * evtchn.c
@@ -56268,15 +56063,15 @@
 +module_exit(evtchn_cleanup);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/evtchn/Makefile linux-2.6.18-rc6-xen/drivers/xen/evtchn/Makefile
---- linux-2.6.18-rc6/drivers/xen/evtchn/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/evtchn/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/evtchn/Makefile linux-2.6.18-xen/drivers/xen/evtchn/Makefile
+--- linux-2.6.18/drivers/xen/evtchn/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/evtchn/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +obj-y	:= evtchn.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/Kconfig linux-2.6.18-rc6-xen/drivers/xen/Kconfig
---- linux-2.6.18-rc6/drivers/xen/Kconfig	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/Kconfig	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/Kconfig linux-2.6.18-xen/drivers/xen/Kconfig
+--- linux-2.6.18/drivers/xen/Kconfig	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/Kconfig	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,260 @@
 +#
 +# This Kconfig describe xen options
@@ -56538,9 +56333,9 @@
 +	depends on SMP
 +
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/Makefile linux-2.6.18-rc6-xen/drivers/xen/Makefile
---- linux-2.6.18-rc6/drivers/xen/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/Makefile linux-2.6.18-xen/drivers/xen/Makefile
+--- linux-2.6.18/drivers/xen/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/Makefile	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,17 @@
 +obj-y	+= core/
 +obj-y	+= console/
@@ -56559,10 +56354,10 @@
 +obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= netfront/
 +obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= pciback/
 +obj-$(CONFIG_XEN_PCIDEV_FRONTEND)	+= pcifront/
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netback/common.h linux-2.6.18-rc6-xen/drivers/xen/netback/common.h
---- linux-2.6.18-rc6/drivers/xen/netback/common.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netback/common.h	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,141 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netback/common.h linux-2.6.18-xen/drivers/xen/netback/common.h
+--- linux-2.6.18/drivers/xen/netback/common.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netback/common.h	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,140 @@
 +/******************************************************************************
 + * arch/xen/drivers/netif/backend/common.h
 + * 
@@ -56610,7 +56405,6 @@
 +#include <xen/interface/grant_table.h>
 +#include <xen/gnttab.h>
 +#include <xen/driver_util.h>
-+#include <asm/hypercall.h>
 +
 +#define DPRINTK(_f, _a...)			\
 +	pr_debug("(file=%s, line=%d) " _f,	\
@@ -56704,9 +56498,9 @@
 +}
 +
 +#endif /* __NETIF__BACKEND__COMMON_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netback/interface.c linux-2.6.18-rc6-xen/drivers/xen/netback/interface.c
---- linux-2.6.18-rc6/drivers/xen/netback/interface.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netback/interface.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netback/interface.c linux-2.6.18-xen/drivers/xen/netback/interface.c
+--- linux-2.6.18/drivers/xen/netback/interface.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netback/interface.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,339 @@
 +/******************************************************************************
 + * arch/xen/drivers/netif/backend/interface.c
@@ -57047,9 +56841,9 @@
 +	}
 +	netif_free(netif);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netback/loopback.c linux-2.6.18-rc6-xen/drivers/xen/netback/loopback.c
---- linux-2.6.18-rc6/drivers/xen/netback/loopback.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netback/loopback.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netback/loopback.c linux-2.6.18-xen/drivers/xen/netback/loopback.c
+--- linux-2.6.18/drivers/xen/netback/loopback.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netback/loopback.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,260 @@
 +/******************************************************************************
 + * netback/loopback.c
@@ -57311,19 +57105,19 @@
 +module_exit(loopback_exit);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netback/Makefile linux-2.6.18-rc6-xen/drivers/xen/netback/Makefile
---- linux-2.6.18-rc6/drivers/xen/netback/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netback/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netback/Makefile linux-2.6.18-xen/drivers/xen/netback/Makefile
+--- linux-2.6.18/drivers/xen/netback/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netback/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,5 @@
 +obj-$(CONFIG_XEN_NETDEV_BACKEND) := netbk.o
 +obj-$(CONFIG_XEN_NETDEV_LOOPBACK) += netloop.o
 +
 +netbk-y   := netback.o xenbus.o interface.o
 +netloop-y := loopback.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netback/netback.c linux-2.6.18-rc6-xen/drivers/xen/netback/netback.c
---- linux-2.6.18-rc6/drivers/xen/netback/netback.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netback/netback.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,1498 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netback/netback.c linux-2.6.18-xen/drivers/xen/netback/netback.c
+--- linux-2.6.18/drivers/xen/netback/netback.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netback/netback.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,1497 @@
 +/******************************************************************************
 + * drivers/xen/netback/netback.c
 + * 
@@ -57363,7 +57157,6 @@
 +#include "common.h"
 +#include <xen/balloon.h>
 +#include <xen/interface/memory.h>
-+#include <asm/page.h>
 +
 +/*#define NETBE_DEBUG_INTERRUPT*/
 +
@@ -58822,9 +58615,9 @@
 +module_init(netback_init);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netback/xenbus.c linux-2.6.18-rc6-xen/drivers/xen/netback/xenbus.c
---- linux-2.6.18-rc6/drivers/xen/netback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netback/xenbus.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netback/xenbus.c linux-2.6.18-xen/drivers/xen/netback/xenbus.c
+--- linux-2.6.18/drivers/xen/netback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netback/xenbus.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,461 @@
 +/*  Xenbus code for netif backend
 +    Copyright (C) 2005 Rusty Russell <rusty at rustcorp.com.au>
@@ -59287,9 +59080,9 @@
 +{
 +	xenbus_register_backend(&netback);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netfront/Kconfig linux-2.6.18-rc6-xen/drivers/xen/netfront/Kconfig
---- linux-2.6.18-rc6/drivers/xen/netfront/Kconfig	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netfront/Kconfig	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netfront/Kconfig linux-2.6.18-xen/drivers/xen/netfront/Kconfig
+--- linux-2.6.18/drivers/xen/netfront/Kconfig	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netfront/Kconfig	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,6 @@
 +
 +config XENNET
@@ -59297,18 +59090,18 @@
 +	depends on NETDEVICES && ARCH_XEN
 +	help
 +	  Network driver for Xen
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netfront/Makefile linux-2.6.18-rc6-xen/drivers/xen/netfront/Makefile
---- linux-2.6.18-rc6/drivers/xen/netfront/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netfront/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netfront/Makefile linux-2.6.18-xen/drivers/xen/netfront/Makefile
+--- linux-2.6.18/drivers/xen/netfront/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netfront/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,4 @@
 +
 +obj-$(CONFIG_XEN_NETDEV_FRONTEND)	:= xennet.o
 +
 +xennet-objs := netfront.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/netfront/netfront.c linux-2.6.18-rc6-xen/drivers/xen/netfront/netfront.c
---- linux-2.6.18-rc6/drivers/xen/netfront/netfront.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/netfront/netfront.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,2077 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/netfront/netfront.c linux-2.6.18-xen/drivers/xen/netfront/netfront.c
+--- linux-2.6.18/drivers/xen/netfront/netfront.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/netfront/netfront.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,2067 @@
 +/******************************************************************************
 + * Virtual network driver for conversing with remote driver backends.
 + *
@@ -59340,6 +59133,7 @@
 + * IN THE SOFTWARE.
 + */
 +
++#include <linux/config.h>
 +#include <linux/module.h>
 +#include <linux/version.h>
 +#include <linux/kernel.h>
@@ -59361,7 +59155,6 @@
 +#include <net/pkt_sched.h>
 +#include <net/arp.h>
 +#include <net/route.h>
-+#include <asm/hypercall.h>
 +#include <asm/uaccess.h>
 +#include <xen/evtchn.h>
 +#include <xen/xenbus.h>
@@ -59504,7 +59297,6 @@
 +
 +static void end_access(int, void *);
 +static void netif_disconnect_backend(struct netfront_info *);
-+static int open_netdev(struct netfront_info *);
 +static void close_netdev(struct netfront_info *);
 +static void netif_free(struct netfront_info *);
 +
@@ -59575,22 +59367,15 @@
 +	dev->dev.driver_data = info;
 +
 +	err = talk_to_backend(dev, info);
-+	if (err)
-+		goto fail_backend;
-+
-+	err = open_netdev(info);
-+	if (err)
-+		goto fail_open;
++	if (err) {
++		xennet_sysfs_delif(info->netdev);
++		unregister_netdev(netdev);
++		free_netdev(netdev);
++		dev->dev.driver_data = NULL;
++		return err;
++	}
 +
 +	return 0;
-+
-+ fail_open:
-+	xennet_sysfs_delif(info->netdev);
-+	unregister_netdev(netdev);
-+ fail_backend:
-+	free_netdev(netdev);
-+	dev->dev.driver_data = NULL;
-+	return err;
 +}
 +
 +
@@ -60229,7 +60014,7 @@
 +#endif
 +
 +#ifdef HAVE_GSO
-+	if (skb_is_gso(skb)) {
++	if (skb_shinfo(skb)->gso_size) {
 +		struct netif_extra_info *gso = (struct netif_extra_info *)
 +			RING_GET_REQUEST(&np->tx, ++i);
 +
@@ -60896,7 +60681,7 @@
 +	xennet_set_sg(dev, 0);
 +
 +	/* We need checksum offload to enable scatter/gather and TSO. */
-+	if (!(dev->features & NETIF_F_IP_CSUM))
++	if (!(dev->features & NETIF_F_ALL_CSUM))
 +		return;
 +
 +	if (!xennet_set_sg(dev, 1))
@@ -61206,9 +60991,27 @@
 +	SET_MODULE_OWNER(netdev);
 +	SET_NETDEV_DEV(netdev, &dev->dev);
 +
++	err = register_netdev(netdev);
++	if (err) {
++		printk(KERN_WARNING "%s> register_netdev err=%d\n",
++		       __FUNCTION__, err);
++		goto exit_free_rx;
++	}
++
++	err = xennet_sysfs_addif(netdev);
++	if (err) {
++		/* This can be non-fatal: it only means no tuning parameters */
++		printk(KERN_WARNING "%s> add sysfs failed err=%d\n",
++		       __FUNCTION__, err);
++	}
++
 +	np->netdev = netdev;
++
 +	return netdev;
 +
++
++ exit_free_rx:
++	gnttab_free_grant_references(np->gref_rx_head);
 + exit_free_tx:
 +	gnttab_free_grant_references(np->gref_tx_head);
 + exit:
@@ -61268,26 +61071,6 @@
 +}
 +
 +
-+static int open_netdev(struct netfront_info *info)
-+{
-+	int err;
-+	
-+	err = register_netdev(info->netdev);
-+	if (err) {
-+		printk(KERN_WARNING "%s: register_netdev err=%d\n",
-+		       __FUNCTION__, err);
-+		return err;
-+	}
-+
-+	err = xennet_sysfs_addif(info->netdev);
-+	if (err) {
-+		/* This can be non-fatal: it only means no tuning parameters */
-+		printk(KERN_WARNING "%s: add sysfs failed err=%d\n",
-+		       __FUNCTION__, err);
-+	}
-+	return 0;
-+}
-+
 +static void close_netdev(struct netfront_info *info)
 +{
 +	del_timer_sync(&info->rx_refill_timer);
@@ -61386,9 +61169,9 @@
 +module_exit(netif_exit);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space.c linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space.c
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space.c linux-2.6.18-xen/drivers/xen/pciback/conf_space.c
+--- linux-2.6.18/drivers/xen/pciback/conf_space.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,425 @@
 +/*
 + * PCI Backend - Functions for creating a virtual configuration space for
@@ -61815,9 +61598,9 @@
 +{
 +	return pciback_config_capability_init();
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability.c linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability.c
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_capability.c linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability.c
+--- linux-2.6.18/drivers/xen/pciback/conf_space_capability.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,71 @@
 +/*
 + * PCI Backend - Handles the virtual fields found on the capability lists
@@ -61890,9 +61673,9 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability.h linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability.h
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_capability.h linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability.h
+--- linux-2.6.18/drivers/xen/pciback/conf_space_capability.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability.h	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,23 @@
 +/*
 + * PCI Backend - Data structures for special overlays for structures on
@@ -61917,9 +61700,9 @@
 +};
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability_pm.c linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability_pm.c
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability_pm.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability_pm.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_capability_pm.c linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability_pm.c
+--- linux-2.6.18/drivers/xen/pciback/conf_space_capability_pm.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability_pm.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,113 @@
 +/*
 + * PCI Backend - Configuration space overlay for power management
@@ -62034,9 +61817,9 @@
 +	.capability = PCI_CAP_ID_PM,
 +	.fields = caplist_pm,
 +};
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability_vpd.c linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability_vpd.c
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_capability_vpd.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_capability_vpd.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_capability_vpd.c linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability_vpd.c
+--- linux-2.6.18/drivers/xen/pciback/conf_space_capability_vpd.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_capability_vpd.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,42 @@
 +/*
 + * PCI Backend - Configuration space overlay for Vital Product Data
@@ -62080,9 +61863,9 @@
 +	.capability = PCI_CAP_ID_VPD,
 +	.fields = caplist_vpd,
 +};
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space.h linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space.h
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space.h linux-2.6.18-xen/drivers/xen/pciback/conf_space.h
+--- linux-2.6.18/drivers/xen/pciback/conf_space.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space.h	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,126 @@
 +/*
 + * PCI Backend - Common data structures for overriding the configuration space
@@ -62210,9 +61993,9 @@
 +int pciback_config_capability_add_fields(struct pci_dev *dev);
 +
 +#endif				/* __XEN_PCIBACK_CONF_SPACE_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_header.c linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_header.c
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_header.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_header.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_header.c linux-2.6.18-xen/drivers/xen/pciback/conf_space_header.c
+--- linux-2.6.18/drivers/xen/pciback/conf_space_header.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_header.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,299 @@
 +/*
 + * PCI Backend - Handles the virtual fields in the configuration space headers.
@@ -62513,9 +62296,9 @@
 +      out:
 +	return err;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_quirks.c linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_quirks.c
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_quirks.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_quirks.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_quirks.c linux-2.6.18-xen/drivers/xen/pciback/conf_space_quirks.c
+--- linux-2.6.18/drivers/xen/pciback/conf_space_quirks.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_quirks.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,128 @@
 +/*
 + * PCI Backend - Handle special overlays for broken devices.
@@ -62645,9 +62428,9 @@
 +      out:
 +	return ret;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/conf_space_quirks.h linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_quirks.h
---- linux-2.6.18-rc6/drivers/xen/pciback/conf_space_quirks.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/conf_space_quirks.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/conf_space_quirks.h linux-2.6.18-xen/drivers/xen/pciback/conf_space_quirks.h
+--- linux-2.6.18/drivers/xen/pciback/conf_space_quirks.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/conf_space_quirks.h	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,35 @@
 +/*
 + * PCI Backend - Data structures for special overlays for broken devices.
@@ -62684,9 +62467,9 @@
 +int pciback_field_is_dup(struct pci_dev *dev, int reg);
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/Makefile linux-2.6.18-rc6-xen/drivers/xen/pciback/Makefile
---- linux-2.6.18-rc6/drivers/xen/pciback/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/Makefile linux-2.6.18-xen/drivers/xen/pciback/Makefile
+--- linux-2.6.18/drivers/xen/pciback/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/Makefile	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,15 @@
 +obj-$(CONFIG_XEN_PCIDEV_BACKEND) += pciback.o
 +
@@ -62703,9 +62486,9 @@
 +ifeq ($(CONFIG_XEN_PCIDEV_BE_DEBUG),y)
 +EXTRA_CFLAGS += -DDEBUG
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/passthrough.c linux-2.6.18-rc6-xen/drivers/xen/pciback/passthrough.c
---- linux-2.6.18-rc6/drivers/xen/pciback/passthrough.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/passthrough.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/passthrough.c linux-2.6.18-xen/drivers/xen/pciback/passthrough.c
+--- linux-2.6.18/drivers/xen/pciback/passthrough.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/passthrough.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,157 @@
 +/*
 + * PCI Backend - Provides restricted access to the real PCI bus topology
@@ -62864,9 +62647,9 @@
 +	kfree(dev_data);
 +	pdev->pci_dev_data = NULL;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/pciback.h linux-2.6.18-rc6-xen/drivers/xen/pciback/pciback.h
---- linux-2.6.18-rc6/drivers/xen/pciback/pciback.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/pciback.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/pciback.h linux-2.6.18-xen/drivers/xen/pciback/pciback.h
+--- linux-2.6.18/drivers/xen/pciback/pciback.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/pciback.h	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,93 @@
 +/*
 + * PCI Backend Common Data Structures & Function Declarations
@@ -62961,9 +62744,9 @@
 +
 +extern int verbose_request;
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/pciback_ops.c linux-2.6.18-rc6-xen/drivers/xen/pciback/pciback_ops.c
---- linux-2.6.18-rc6/drivers/xen/pciback/pciback_ops.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/pciback_ops.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/pciback_ops.c linux-2.6.18-xen/drivers/xen/pciback/pciback_ops.c
+--- linux-2.6.18/drivers/xen/pciback/pciback_ops.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/pciback_ops.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,95 @@
 +/*
 + * PCI Backend Operations - respond to PCI requests from Frontend
@@ -63060,9 +62843,9 @@
 +
 +	return IRQ_HANDLED;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/pci_stub.c linux-2.6.18-rc6-xen/drivers/xen/pciback/pci_stub.c
---- linux-2.6.18-rc6/drivers/xen/pciback/pci_stub.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/pci_stub.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/pci_stub.c linux-2.6.18-xen/drivers/xen/pciback/pci_stub.c
+--- linux-2.6.18/drivers/xen/pciback/pci_stub.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/pci_stub.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,916 @@
 +/*
 + * PCI Stub Driver - Grabs devices in backend to be exported later
@@ -63980,9 +63763,9 @@
 +module_exit(pciback_cleanup);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/slot.c linux-2.6.18-rc6-xen/drivers/xen/pciback/slot.c
---- linux-2.6.18-rc6/drivers/xen/pciback/slot.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/slot.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/slot.c linux-2.6.18-xen/drivers/xen/pciback/slot.c
+--- linux-2.6.18/drivers/xen/pciback/slot.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/slot.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,151 @@
 +/*
 + * PCI Backend - Provides a Virtual PCI bus (with real devices)
@@ -64135,9 +63918,9 @@
 +	kfree(slot_dev);
 +	pdev->pci_dev_data = NULL;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/vpci.c linux-2.6.18-rc6-xen/drivers/xen/pciback/vpci.c
---- linux-2.6.18-rc6/drivers/xen/pciback/vpci.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/vpci.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/vpci.c linux-2.6.18-xen/drivers/xen/pciback/vpci.c
+--- linux-2.6.18/drivers/xen/pciback/vpci.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/vpci.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,204 @@
 +/*
 + * PCI Backend - Provides a Virtual PCI bus (with real devices)
@@ -64343,9 +64126,9 @@
 +	kfree(vpci_dev);
 +	pdev->pci_dev_data = NULL;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pciback/xenbus.c linux-2.6.18-rc6-xen/drivers/xen/pciback/xenbus.c
---- linux-2.6.18-rc6/drivers/xen/pciback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pciback/xenbus.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pciback/xenbus.c linux-2.6.18-xen/drivers/xen/pciback/xenbus.c
+--- linux-2.6.18/drivers/xen/pciback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pciback/xenbus.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,458 @@
 +/*
 + * PCI Backend Xenbus Setup - handles setup with frontend and xend
@@ -64805,9 +64588,9 @@
 +{
 +	xenbus_unregister_driver(&xenbus_pciback_driver);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pcifront/Makefile linux-2.6.18-rc6-xen/drivers/xen/pcifront/Makefile
---- linux-2.6.18-rc6/drivers/xen/pcifront/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pcifront/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pcifront/Makefile linux-2.6.18-xen/drivers/xen/pcifront/Makefile
+--- linux-2.6.18/drivers/xen/pcifront/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pcifront/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,7 @@
 +obj-y += pcifront.o
 +
@@ -64816,9 +64599,9 @@
 +ifeq ($(CONFIG_XEN_PCIDEV_FE_DEBUG),y)
 +EXTRA_CFLAGS += -DDEBUG
 +endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pcifront/pci.c linux-2.6.18-rc6-xen/drivers/xen/pcifront/pci.c
---- linux-2.6.18-rc6/drivers/xen/pcifront/pci.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pcifront/pci.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pcifront/pci.c linux-2.6.18-xen/drivers/xen/pcifront/pci.c
+--- linux-2.6.18/drivers/xen/pcifront/pci.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pcifront/pci.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,46 @@
 +/*
 + * PCI Frontend Operations - ensure only one PCI frontend runs at a time
@@ -64866,9 +64649,9 @@
 +
 +	spin_unlock(&pcifront_dev_lock);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pcifront/pcifront.h linux-2.6.18-rc6-xen/drivers/xen/pcifront/pcifront.h
---- linux-2.6.18-rc6/drivers/xen/pcifront/pcifront.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pcifront/pcifront.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pcifront/pcifront.h linux-2.6.18-xen/drivers/xen/pcifront/pcifront.h
+--- linux-2.6.18/drivers/xen/pcifront/pcifront.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pcifront/pcifront.h	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,40 @@
 +/*
 + * PCI Frontend - Common data structures & function declarations
@@ -64910,9 +64693,9 @@
 +void pcifront_free_roots(struct pcifront_device *pdev);
 +
 +#endif	/* __XEN_PCIFRONT_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pcifront/pci_op.c linux-2.6.18-rc6-xen/drivers/xen/pcifront/pci_op.c
---- linux-2.6.18-rc6/drivers/xen/pcifront/pci_op.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pcifront/pci_op.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pcifront/pci_op.c linux-2.6.18-xen/drivers/xen/pcifront/pci_op.c
+--- linux-2.6.18/drivers/xen/pcifront/pci_op.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pcifront/pci_op.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,273 @@
 +/*
 + * PCI Frontend Operations - Communicates with frontend
@@ -65187,9 +64970,9 @@
 +		kfree(bus_entry);
 +	}
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/pcifront/xenbus.c linux-2.6.18-rc6-xen/drivers/xen/pcifront/xenbus.c
---- linux-2.6.18-rc6/drivers/xen/pcifront/xenbus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/pcifront/xenbus.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/pcifront/xenbus.c linux-2.6.18-xen/drivers/xen/pcifront/xenbus.c
+--- linux-2.6.18/drivers/xen/pcifront/xenbus.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/pcifront/xenbus.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,295 @@
 +/*
 + * PCI Frontend Xenbus Setup - handles setup with backend (imports page/evtchn)
@@ -65486,16 +65269,16 @@
 +
 +/* Initialize after the Xen PCI Frontend Stub is initialized */
 +subsys_initcall(pcifront_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/privcmd/Makefile linux-2.6.18-rc6-xen/drivers/xen/privcmd/Makefile
---- linux-2.6.18-rc6/drivers/xen/privcmd/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/privcmd/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/privcmd/Makefile linux-2.6.18-xen/drivers/xen/privcmd/Makefile
+--- linux-2.6.18/drivers/xen/privcmd/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/privcmd/Makefile	2006-07-07 20:51:41.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +obj-$(CONFIG_XEN_PRIVCMD)	:= privcmd.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/privcmd/privcmd.c linux-2.6.18-rc6-xen/drivers/xen/privcmd/privcmd.c
---- linux-2.6.18-rc6/drivers/xen/privcmd/privcmd.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/privcmd/privcmd.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,266 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/privcmd/privcmd.c linux-2.6.18-xen/drivers/xen/privcmd/privcmd.c
+--- linux-2.6.18/drivers/xen/privcmd/privcmd.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/privcmd/privcmd.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,289 @@
 +/******************************************************************************
 + * privcmd.c
 + * 
@@ -65532,6 +65315,9 @@
 +static struct proc_dir_entry *privcmd_intf;
 +static struct proc_dir_entry *capabilities_intf;
 +
++#define NR_HYPERCALLS 64
++static DECLARE_BITMAP(hypercall_permission_map, NR_HYPERCALLS);
++
 +static int privcmd_ioctl(struct inode *inode, struct file *file,
 +			 unsigned int cmd, unsigned long data)
 +{
@@ -65545,6 +65331,12 @@
 +		if (copy_from_user(&hypercall, udata, sizeof(hypercall)))
 +			return -EFAULT;
 +
++		/* Check hypercall number for validity. */
++		if (hypercall.op >= NR_HYPERCALLS)
++			return -EINVAL;
++		if (!test_bit(hypercall.op, hypercall_permission_map))
++			return -EINVAL;
++
 +#if defined(__i386__)
 +		__asm__ __volatile__ (
 +			"pushl %%ebx; pushl %%ecx; pushl %%edx; "
@@ -65721,7 +65513,7 @@
 +static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)
 +{
 +	/* DONTCOPY is essential for Xen as copy_page_range is broken. */
-+	vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP;
++	vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY;
 +
 +	return 0;
 +}
@@ -65750,6 +65542,20 @@
 +	if (!is_running_on_xen())
 +		return -ENODEV;
 +
++	/* Set of hypercalls that privileged applications may execute. */
++	set_bit(__HYPERVISOR_acm_op,           hypercall_permission_map);
++	set_bit(__HYPERVISOR_dom0_op,          hypercall_permission_map);
++	set_bit(__HYPERVISOR_event_channel_op, hypercall_permission_map);
++	set_bit(__HYPERVISOR_memory_op,        hypercall_permission_map);
++	set_bit(__HYPERVISOR_mmu_update,       hypercall_permission_map);
++	set_bit(__HYPERVISOR_mmuext_op,        hypercall_permission_map);
++	set_bit(__HYPERVISOR_xen_version,      hypercall_permission_map);
++	set_bit(__HYPERVISOR_sched_op,         hypercall_permission_map);
++	set_bit(__HYPERVISOR_sched_op_compat,  hypercall_permission_map);
++	set_bit(__HYPERVISOR_event_channel_op_compat,
++		hypercall_permission_map);
++	set_bit(__HYPERVISOR_hvm_op,           hypercall_permission_map);
++
 +	privcmd_intf = create_xen_proc_entry("privcmd", 0400);
 +	if (privcmd_intf != NULL)
 +		privcmd_intf->proc_fops = &privcmd_file_ops;
@@ -65762,9 +65568,9 @@
 +}
 +
 +__initcall(privcmd_init);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/tpmback/common.h linux-2.6.18-rc6-xen/drivers/xen/tpmback/common.h
---- linux-2.6.18-rc6/drivers/xen/tpmback/common.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/tpmback/common.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/tpmback/common.h linux-2.6.18-xen/drivers/xen/tpmback/common.h
+--- linux-2.6.18/drivers/xen/tpmback/common.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/tpmback/common.h	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,84 @@
 +/******************************************************************************
 + * drivers/xen/tpmback/common.h
@@ -65850,9 +65656,9 @@
 +#define MMAP_VADDR(t,_req) ((t)->mmap_vstart + ((_req) * PAGE_SIZE))
 +
 +#endif /* __TPMIF__BACKEND__COMMON_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/tpmback/interface.c linux-2.6.18-rc6-xen/drivers/xen/tpmback/interface.c
---- linux-2.6.18-rc6/drivers/xen/tpmback/interface.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/tpmback/interface.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/tpmback/interface.c linux-2.6.18-xen/drivers/xen/tpmback/interface.c
+--- linux-2.6.18/drivers/xen/tpmback/interface.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/tpmback/interface.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,177 @@
 + /*****************************************************************************
 + * drivers/xen/tpmback/interface.c
@@ -66031,17 +65837,17 @@
 +{
 +	kmem_cache_destroy(tpmif_cachep);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/tpmback/Makefile linux-2.6.18-rc6-xen/drivers/xen/tpmback/Makefile
---- linux-2.6.18-rc6/drivers/xen/tpmback/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/tpmback/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/tpmback/Makefile linux-2.6.18-xen/drivers/xen/tpmback/Makefile
+--- linux-2.6.18/drivers/xen/tpmback/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/tpmback/Makefile	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,4 @@
 +
 +obj-$(CONFIG_XEN_TPMDEV_BACKEND)	+= tpmbk.o
 +
 +tpmbk-y += tpmback.o interface.o xenbus.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/tpmback/tpmback.c linux-2.6.18-rc6-xen/drivers/xen/tpmback/tpmback.c
---- linux-2.6.18-rc6/drivers/xen/tpmback/tpmback.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/tpmback/tpmback.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/tpmback/tpmback.c linux-2.6.18-xen/drivers/xen/tpmback/tpmback.c
+--- linux-2.6.18/drivers/xen/tpmback/tpmback.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/tpmback/tpmback.c	2006-08-15 13:03:28.000000000 +0200
 @@ -0,0 +1,944 @@
 +/******************************************************************************
 + * drivers/xen/tpmback/tpmback.c
@@ -66987,9 +66793,9 @@
 +}
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/tpmback/xenbus.c linux-2.6.18-rc6-xen/drivers/xen/tpmback/xenbus.c
---- linux-2.6.18-rc6/drivers/xen/tpmback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/tpmback/xenbus.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/tpmback/xenbus.c linux-2.6.18-xen/drivers/xen/tpmback/xenbus.c
+--- linux-2.6.18/drivers/xen/tpmback/xenbus.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/tpmback/xenbus.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,287 @@
 +/*  Xenbus code for tpmif backend
 +    Copyright (C) 2005 IBM Corporation
@@ -67278,9 +67084,9 @@
 +{
 +	xenbus_unregister_driver(&tpmback);
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/util.c linux-2.6.18-rc6-xen/drivers/xen/util.c
---- linux-2.6.18-rc6/drivers/xen/util.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/util.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/util.c linux-2.6.18-xen/drivers/xen/util.c
+--- linux-2.6.18/drivers/xen/util.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/util.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,70 @@
 +
 +#include <linux/mm.h>
@@ -67352,9 +67158,9 @@
 +	preempt_enable();
 +}
 +EXPORT_SYMBOL_GPL(unlock_vm_area);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/Makefile linux-2.6.18-rc6-xen/drivers/xen/xenbus/Makefile
---- linux-2.6.18-rc6/drivers/xen/xenbus/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/Makefile	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/Makefile linux-2.6.18-xen/drivers/xen/xenbus/Makefile
+--- linux-2.6.18/drivers/xen/xenbus/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/Makefile	2006-07-07 20:51:41.000000000 +0200
 @@ -0,0 +1,12 @@
 +obj-y	+= xenbus.o
 +obj-$(CONFIG_XEN_BACKEND) += xenbus_be.o
@@ -67368,9 +67174,9 @@
 +xenbus-objs += xenbus_xs.o
 +xenbus-objs += xenbus_probe.o
 +obj-$(CONFIG_XEN_XENBUS_DEV) += xenbus_dev.o
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_backend_client.c linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_backend_client.c
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_backend_client.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_backend_client.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_backend_client.c linux-2.6.18-xen/drivers/xen/xenbus/xenbus_backend_client.c
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_backend_client.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_backend_client.c	2006-05-26 22:00:38.000000000 +0200
 @@ -0,0 +1,135 @@
 +/******************************************************************************
 + * Backend-client-facing interface for the Xenbus driver.  In other words, the
@@ -67507,9 +67313,9 @@
 +EXPORT_SYMBOL_GPL(xenbus_unmap_ring);
 +
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_client.c linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_client.c
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_client.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_client.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_client.c linux-2.6.18-xen/drivers/xen/xenbus/xenbus_client.c
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_client.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_client.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,278 @@
 +/******************************************************************************
 + * Client-facing interface for the Xenbus driver.  In other words, the
@@ -67789,9 +67595,9 @@
 +	return result;
 +}
 +EXPORT_SYMBOL_GPL(xenbus_read_driver_state);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_comms.c linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_comms.c
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_comms.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_comms.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_comms.c linux-2.6.18-xen/drivers/xen/xenbus/xenbus_comms.c
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_comms.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_comms.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,203 @@
 +/******************************************************************************
 + * xenbus_comms.c
@@ -67996,9 +67802,9 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_comms.h linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_comms.h
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_comms.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_comms.h	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_comms.h linux-2.6.18-xen/drivers/xen/xenbus/xenbus_comms.h
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_comms.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_comms.h	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,45 @@
 +/*
 + * Private include for xenbus communications.
@@ -68045,9 +67851,9 @@
 +extern int xen_store_evtchn;
 +
 +#endif /* _XENBUS_COMMS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_dev.c linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_dev.c
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_dev.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_dev.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_dev.c linux-2.6.18-xen/drivers/xen/xenbus/xenbus_dev.c
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_dev.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_dev.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,356 @@
 +/*
 + * xenbus_dev.c
@@ -68405,10 +68211,10 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_probe.c linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_probe.c
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_probe.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_probe.c	2006-09-04 16:31:13.000000000 +0200
-@@ -0,0 +1,1150 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_probe.c linux-2.6.18-xen/drivers/xen/xenbus/xenbus_probe.c
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_probe.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_probe.c	2006-09-17 17:44:49.000000000 +0200
+@@ -0,0 +1,1149 @@
 +/******************************************************************************
 + * Talks to Xen Store to figure out what devices we have.
 + *
@@ -68459,7 +68265,6 @@
 +#include <asm/maddr.h>
 +#include <asm/pgtable.h>
 +#include <asm/hypervisor.h>
-+#include <asm/hypercall.h>
 +#include <xen/xenbus.h>
 +#include <xen/xen_proc.h>
 +#include <xen/evtchn.h>
@@ -69559,9 +69364,9 @@
 +
 +late_initcall(boot_wait_for_devices);
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_xs.c linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_xs.c
---- linux-2.6.18-rc6/drivers/xen/xenbus/xenbus_xs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/drivers/xen/xenbus/xenbus_xs.c	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/drivers/xen/xenbus/xenbus_xs.c linux-2.6.18-xen/drivers/xen/xenbus/xenbus_xs.c
+--- linux-2.6.18/drivers/xen/xenbus/xenbus_xs.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/drivers/xen/xenbus/xenbus_xs.c	2006-09-17 17:44:49.000000000 +0200
 @@ -0,0 +1,853 @@
 +/******************************************************************************
 + * xenbus_xs.c
@@ -70416,9 +70221,272 @@
 +
 +	return 0;
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/fs/Kconfig linux-2.6.18-rc6-xen/fs/Kconfig
---- linux-2.6.18-rc6/fs/Kconfig	2006-09-05 10:53:24.000000000 +0200
-+++ linux-2.6.18-rc6-xen/fs/Kconfig	2006-09-04 16:31:13.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/fs/aio.c linux-2.6.18-xen/fs/aio.c
+--- linux-2.6.18/fs/aio.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/fs/aio.c	2006-08-15 13:03:29.000000000 +0200
+@@ -34,6 +34,11 @@
+ #include <asm/uaccess.h>
+ #include <asm/mmu_context.h>
+ 
++#ifdef CONFIG_EPOLL
++#include <linux/poll.h>
++#include <linux/eventpoll.h>
++#endif
++
+ #if DEBUG > 1
+ #define dprintk		printk
+ #else
+@@ -1015,6 +1020,10 @@
+ 	if (waitqueue_active(&ctx->wait))
+ 		wake_up(&ctx->wait);
+ 
++#ifdef CONFIG_EPOLL
++	if (ctx->file && waitqueue_active(&ctx->poll_wait))
++		wake_up(&ctx->poll_wait);
++#endif
+ 	if (ret)
+ 		put_ioctx(ctx);
+ 
+@@ -1024,6 +1033,8 @@
+ /* aio_read_evt
+  *	Pull an event off of the ioctx's event ring.  Returns the number of 
+  *	events fetched (0 or 1 ;-)
++ *	If ent parameter is 0, just returns the number of events that would
++ *	be fetched.
+  *	FIXME: make this use cmpxchg.
+  *	TODO: make the ringbuffer user mmap()able (requires FIXME).
+  */
+@@ -1046,13 +1057,18 @@
+ 
+ 	head = ring->head % info->nr;
+ 	if (head != ring->tail) {
+-		struct io_event *evp = aio_ring_event(info, head, KM_USER1);
+-		*ent = *evp;
+-		head = (head + 1) % info->nr;
+-		smp_mb(); /* finish reading the event before updatng the head */
+-		ring->head = head;
+-		ret = 1;
+-		put_aio_ring_event(evp, KM_USER1);
++		if (ent) { /* event requested */
++			struct io_event *evp =
++				aio_ring_event(info, head, KM_USER1);
++			*ent = *evp;
++			head = (head + 1) % info->nr;
++			/* finish reading the event before updatng the head */
++			smp_mb();
++			ring->head = head;
++			ret = 1;
++			put_aio_ring_event(evp, KM_USER1);
++		} else /* only need to know availability */
++			ret = 1;
+ 	}
+ 	spin_unlock(&info->ring_lock);
+ 
+@@ -1235,9 +1251,78 @@
+ 
+ 	aio_cancel_all(ioctx);
+ 	wait_for_all_aios(ioctx);
++#ifdef CONFIG_EPOLL
++	/* forget the poll file, but it's up to the user to close it */
++	if (ioctx->file) {
++		ioctx->file->private_data = 0;
++		ioctx->file = 0;
++	}
++#endif
+ 	put_ioctx(ioctx);	/* once for the lookup */
+ }
+ 
++#ifdef CONFIG_EPOLL
++
++static int aio_queue_fd_close(struct inode *inode, struct file *file)
++{
++	struct kioctx *ioctx = file->private_data;
++	if (ioctx) {
++		file->private_data = 0;
++		spin_lock_irq(&ioctx->ctx_lock);
++		ioctx->file = 0;
++		spin_unlock_irq(&ioctx->ctx_lock);
++	}
++	return 0;
++}
++
++static unsigned int aio_queue_fd_poll(struct file *file, poll_table *wait)
++{	unsigned int pollflags = 0;
++	struct kioctx *ioctx = file->private_data;
++
++	if (ioctx) {
++
++		spin_lock_irq(&ioctx->ctx_lock);
++		/* Insert inside our poll wait queue */
++		poll_wait(file, &ioctx->poll_wait, wait);
++
++		/* Check our condition */
++		if (aio_read_evt(ioctx, 0))
++			pollflags = POLLIN | POLLRDNORM;
++		spin_unlock_irq(&ioctx->ctx_lock);
++	}
++
++	return pollflags;
++}
++
++static struct file_operations aioq_fops = {
++	.release	= aio_queue_fd_close,
++	.poll		= aio_queue_fd_poll
++};
++
++/* make_aio_fd:
++ *  Create a file descriptor that can be used to poll the event queue.
++ *  Based and piggybacked on the excellent epoll code.
++ */
++
++static int make_aio_fd(struct kioctx *ioctx)
++{
++	int error, fd;
++	struct inode *inode;
++	struct file *file;
++
++	error = ep_getfd(&fd, &inode, &file, NULL, &aioq_fops);
++	if (error)
++		return error;
++
++	/* associate the file with the IO context */
++	file->private_data = ioctx;
++	ioctx->file = file;
++	init_waitqueue_head(&ioctx->poll_wait);
++	return fd;
++}
++#endif
++
++
+ /* sys_io_setup:
+  *	Create an aio_context capable of receiving at least nr_events.
+  *	ctxp must not point to an aio_context that already exists, and
+@@ -1250,18 +1335,30 @@
+  *	resources are available.  May fail with -EFAULT if an invalid
+  *	pointer is passed for ctxp.  Will fail with -ENOSYS if not
+  *	implemented.
++ *
++ *	To request a selectable fd, the user context has to be initialized
++ *	to 1, instead of 0, and the return value is the fd.
++ *	This keeps the system call compatible, since a non-zero value
++ *	was not allowed so far.
+  */
+ asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp)
+ {
+ 	struct kioctx *ioctx = NULL;
+ 	unsigned long ctx;
+ 	long ret;
++	int make_fd = 0;
+ 
+ 	ret = get_user(ctx, ctxp);
+ 	if (unlikely(ret))
+ 		goto out;
+ 
+ 	ret = -EINVAL;
++#ifdef CONFIG_EPOLL
++	if (ctx == 1) {
++		make_fd = 1;
++		ctx = 0;
++	}
++#endif
+ 	if (unlikely(ctx || nr_events == 0)) {
+ 		pr_debug("EINVAL: io_setup: ctx %lu nr_events %u\n",
+ 		         ctx, nr_events);
+@@ -1272,8 +1369,12 @@
+ 	ret = PTR_ERR(ioctx);
+ 	if (!IS_ERR(ioctx)) {
+ 		ret = put_user(ioctx->user_id, ctxp);
+-		if (!ret)
+-			return 0;
++#ifdef CONFIG_EPOLL
++		if (make_fd && ret >= 0)
++			ret = make_aio_fd(ioctx);
++#endif
++		if (ret >= 0)
++			return ret;
+ 
+ 		get_ioctx(ioctx); /* io_destroy() expects us to hold a ref */
+ 		io_destroy(ioctx);
+diff -urN -x .hg -x .hgtags linux-2.6.18/fs/eventpoll.c linux-2.6.18-xen/fs/eventpoll.c
+--- linux-2.6.18/fs/eventpoll.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/fs/eventpoll.c	2006-09-17 17:44:49.000000000 +0200
+@@ -236,8 +236,6 @@
+ 
+ static void ep_poll_safewake_init(struct poll_safewake *psw);
+ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq);
+-static int ep_getfd(int *efd, struct inode **einode, struct file **efile,
+-		    struct eventpoll *ep);
+ static int ep_alloc(struct eventpoll **pep);
+ static void ep_free(struct eventpoll *ep);
+ static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd);
+@@ -267,7 +265,7 @@
+ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
+ 		   int maxevents, long timeout);
+ static int eventpollfs_delete_dentry(struct dentry *dentry);
+-static struct inode *ep_eventpoll_inode(void);
++static struct inode *ep_eventpoll_inode(struct file_operations *fops);
+ static int eventpollfs_get_sb(struct file_system_type *fs_type,
+ 			      int flags, const char *dev_name,
+ 			      void *data, struct vfsmount *mnt);
+@@ -517,7 +515,7 @@
+ 	 * Creates all the items needed to setup an eventpoll file. That is,
+ 	 * a file structure, and inode and a free file descriptor.
+ 	 */
+-	error = ep_getfd(&fd, &inode, &file, ep);
++	error = ep_getfd(&fd, &inode, &file, ep, &eventpoll_fops);
+ 	if (error)
+ 		goto eexit_2;
+ 
+@@ -702,8 +700,8 @@
+ /*
+  * Creates the file descriptor to be used by the epoll interface.
+  */
+-static int ep_getfd(int *efd, struct inode **einode, struct file **efile,
+-		    struct eventpoll *ep)
++int ep_getfd(int *efd, struct inode **einode, struct file **efile,
++		    struct eventpoll *ep, struct file_operations *fops)
+ {
+ 	struct qstr this;
+ 	char name[32];
+@@ -719,7 +717,7 @@
+ 		goto eexit_1;
+ 
+ 	/* Allocates an inode from the eventpoll file system */
+-	inode = ep_eventpoll_inode();
++	inode = ep_eventpoll_inode(fops);
+ 	error = PTR_ERR(inode);
+ 	if (IS_ERR(inode))
+ 		goto eexit_2;
+@@ -750,7 +748,7 @@
+ 
+ 	file->f_pos = 0;
+ 	file->f_flags = O_RDONLY;
+-	file->f_op = &eventpoll_fops;
++	file->f_op = fops;
+ 	file->f_mode = FMODE_READ;
+ 	file->f_version = 0;
+ 	file->private_data = ep;
+@@ -1569,7 +1567,7 @@
+ }
+ 
+ 
+-static struct inode *ep_eventpoll_inode(void)
++static struct inode *ep_eventpoll_inode(struct file_operations *fops)
+ {
+ 	int error = -ENOMEM;
+ 	struct inode *inode = new_inode(eventpoll_mnt->mnt_sb);
+@@ -1577,7 +1575,7 @@
+ 	if (!inode)
+ 		goto eexit_1;
+ 
+-	inode->i_fop = &eventpoll_fops;
++	inode->i_fop = fops;
+ 
+ 	/*
+ 	 * Mark the inode dirty from the very beginning,
+diff -urN -x .hg -x .hgtags linux-2.6.18/fs/Kconfig linux-2.6.18-xen/fs/Kconfig
+--- linux-2.6.18/fs/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/fs/Kconfig	2006-09-17 17:44:49.000000000 +0200
 @@ -865,6 +865,7 @@
  config HUGETLBFS
  	bool "HugeTLB file system support"
@@ -70427,19 +70495,21 @@
  	help
  	  hugetlbfs is a filesystem backing for HugeTLB pages, based on
  	  ramfs. For architectures that support it, say Y here and read
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-generic/vmlinux.lds.h linux-2.6.18-rc6-xen/include/asm-generic/vmlinux.lds.h
---- linux-2.6.18-rc6/include/asm-generic/vmlinux.lds.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-generic/vmlinux.lds.h	2006-09-04 16:31:16.000000000 +0200
-@@ -194,3 +194,6 @@
- 		.stab.index 0 : { *(.stab.index) }			\
- 		.stab.indexstr 0 : { *(.stab.indexstr) }		\
- 		.comment 0 : { *(.comment) }
-+
-+#define NOTES								\
-+		.notes : { *(.note.*) } :note
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/apic.h linux-2.6.18-rc6-xen/include/asm-i386/apic.h
---- linux-2.6.18-rc6/include/asm-i386/apic.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-i386/apic.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/a.out.h linux-2.6.18-xen/include/asm-i386/a.out.h
+--- linux-2.6.18/include/asm-i386/a.out.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/a.out.h	2006-05-26 22:00:47.000000000 +0200
+@@ -19,7 +19,7 @@
+ 
+ #ifdef __KERNEL__
+ 
+-#define STACK_TOP	TASK_SIZE
++#define STACK_TOP	(TASK_SIZE - 3*PAGE_SIZE)
+ 
+ #endif
+ 
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/apic.h linux-2.6.18-xen/include/asm-i386/apic.h
+--- linux-2.6.18/include/asm-i386/apic.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/apic.h	2006-08-15 13:03:31.000000000 +0200
 @@ -119,10 +119,12 @@
  
  extern int disable_timer_pin_1;
@@ -70453,9 +70523,9 @@
  
  extern int timer_over_8254;
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/fixmap.h linux-2.6.18-rc6-xen/include/asm-i386/fixmap.h
---- linux-2.6.18-rc6/include/asm-i386/fixmap.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-i386/fixmap.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/fixmap.h linux-2.6.18-xen/include/asm-i386/fixmap.h
+--- linux-2.6.18/include/asm-i386/fixmap.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/fixmap.h	2006-08-15 13:03:31.000000000 +0200
 @@ -19,7 +19,7 @@
   * Leave one empty page between vmalloc'ed areas and
   * the start of the fixmap.
@@ -70474,9 +70544,9 @@
  #define set_fixmap(idx, phys) \
  		__set_fixmap(idx, phys, PAGE_KERNEL)
  /*
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-default/mach_traps.h linux-2.6.18-rc6-xen/include/asm-i386/mach-default/mach_traps.h
---- linux-2.6.18-rc6/include/asm-i386/mach-default/mach_traps.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-default/mach_traps.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-default/mach_traps.h linux-2.6.18-xen/include/asm-i386/mach-default/mach_traps.h
+--- linux-2.6.18/include/asm-i386/mach-default/mach_traps.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/mach-default/mach_traps.h	2006-05-26 22:00:47.000000000 +0200
 @@ -15,6 +15,18 @@
  	outb(reason, 0x61);
  }
@@ -70496,9 +70566,9 @@
  static inline unsigned char get_nmi_reason(void)
  {
  	return inb(0x61);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/agp.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/agp.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/agp.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/agp.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/agp.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/agp.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/agp.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/agp.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,37 @@
 +#ifndef AGP_H
 +#define AGP_H 1
@@ -70537,9 +70607,9 @@
 +	dma_free_coherent(NULL,PAGE_SIZE<<(order),(table),virt_to_bus(table))
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/desc.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/desc.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/desc.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/desc.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/desc.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/desc.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/desc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/desc.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,164 @@
 +#ifndef __ARCH_DESC_H
 +#define __ARCH_DESC_H
@@ -70705,9 +70775,9 @@
 +#endif /* !__ASSEMBLY__ */
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/dma-mapping.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/dma-mapping.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/dma-mapping.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/dma-mapping.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/dma-mapping.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/dma-mapping.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/dma-mapping.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/dma-mapping.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,151 @@
 +#ifndef _ASM_I386_DMA_MAPPING_H
 +#define _ASM_I386_DMA_MAPPING_H
@@ -70860,9 +70930,9 @@
 +				  dma_addr_t device_addr, size_t size);
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/fixmap.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/fixmap.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/fixmap.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/fixmap.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/fixmap.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/fixmap.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/fixmap.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/fixmap.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,156 @@
 +/*
 + * fixmap.h: compile-time virtual memory allocation
@@ -71020,9 +71090,9 @@
 +
 +#endif /* !__ASSEMBLY__ */
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/floppy.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/floppy.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/floppy.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/floppy.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/floppy.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/floppy.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/floppy.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/floppy.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,147 @@
 +/*
 + * Architecture specific parts of the Floppy driver
@@ -71114,8 +71184,8 @@
 +
 +static int fd_request_irq(void)
 +{
-+	return request_irq(FLOPPY_IRQ, floppy_hardint,
-+			   IRQF_DISABLED, "floppy", NULL);
++	return request_irq(FLOPPY_IRQ, floppy_hardint, IRQF_DISABLED,
++			   "floppy", NULL);
 +}
 +
 +static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
@@ -71171,9 +71241,9 @@
 +#define EXTRA_FLOPPY_PARAMS
 +
 +#endif /* __ASM_XEN_I386_FLOPPY_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/highmem.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/highmem.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/highmem.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/highmem.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/highmem.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/highmem.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/highmem.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/highmem.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,80 @@
 +/*
 + * highmem.h: virtual kernel memory mappings for high memory
@@ -71255,9 +71325,9 @@
 +#endif /* __KERNEL__ */
 +
 +#endif /* _ASM_HIGHMEM_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/hw_irq.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/hw_irq.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/hw_irq.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/hw_irq.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/hw_irq.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/hw_irq.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/hw_irq.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/hw_irq.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,72 @@
 +#ifndef _ASM_HW_IRQ_H
 +#define _ASM_HW_IRQ_H
@@ -71331,10 +71401,10 @@
 +#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
 +
 +#endif /* _ASM_HW_IRQ_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/hypercall.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/hypercall.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/hypercall.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/hypercall.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,389 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/hypercall.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/hypercall.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/hypercall.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/hypercall.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,379 @@
 +/******************************************************************************
 + * hypercall.h
 + * 
@@ -71379,21 +71449,11 @@
 +#define __STR(x) #x
 +#define STR(x) __STR(x)
 +
-+#ifdef CONFIG_XEN
-+#define HYPERCALL_STR(name)					\
-+	"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
-+#else
-+#define HYPERCALL_STR(name)					\
-+	"mov hypercall_stubs,%%eax; "				\
-+	"add $("STR(__HYPERVISOR_##name)" * 32),%%eax; "	\
-+	"call *%%eax"
-+#endif
-+
 +#define _hypercall0(type, name)			\
 +({						\
 +	long __res;				\
 +	asm volatile (				\
-+		HYPERCALL_STR(name)		\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res)			\
 +		:				\
 +		: "memory" );			\
@@ -71404,7 +71464,7 @@
 +({								\
 +	long __res, __ign1;					\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=b" (__ign1)			\
 +		: "1" ((long)(a1))				\
 +		: "memory" );					\
@@ -71415,7 +71475,7 @@
 +({								\
 +	long __res, __ign1, __ign2;				\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=b" (__ign1), "=c" (__ign2)	\
 +		: "1" ((long)(a1)), "2" ((long)(a2))		\
 +		: "memory" );					\
@@ -71426,7 +71486,7 @@
 +({								\
 +	long __res, __ign1, __ign2, __ign3;			\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=b" (__ign1), "=c" (__ign2), 	\
 +		"=d" (__ign3)					\
 +		: "1" ((long)(a1)), "2" ((long)(a2)),		\
@@ -71439,7 +71499,7 @@
 +({								\
 +	long __res, __ign1, __ign2, __ign3, __ign4;		\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=b" (__ign1), "=c" (__ign2),	\
 +		"=d" (__ign3), "=S" (__ign4)			\
 +		: "1" ((long)(a1)), "2" ((long)(a2)),		\
@@ -71452,7 +71512,7 @@
 +({								\
 +	long __res, __ign1, __ign2, __ign3, __ign4, __ign5;	\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=b" (__ign1), "=c" (__ign2),	\
 +		"=d" (__ign3), "=S" (__ign4), "=D" (__ign5)	\
 +		: "1" ((long)(a1)), "2" ((long)(a2)),		\
@@ -71724,9 +71784,9 @@
 +
 +
 +#endif /* __HYPERCALL_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/hypervisor.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/hypervisor.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/hypervisor.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/hypervisor.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/hypervisor.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/hypervisor.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/hypervisor.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/hypervisor.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,234 @@
 +/******************************************************************************
 + * hypervisor.h
@@ -71962,9 +72022,9 @@
 +}
 +
 +#endif /* __HYPERVISOR_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/io.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/io.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/io.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/io.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/io.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/io.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/io.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/io.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,389 @@
 +#ifndef _ASM_IO_H
 +#define _ASM_IO_H
@@ -72355,9 +72415,9 @@
 +#define ARCH_HAS_DEV_MEM
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/irqflags.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/irqflags.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/irqflags.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/irqflags.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/irqflags.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/irqflags.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/irqflags.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/irqflags.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,80 @@
 +/*
 + * include/asm-i386/irqflags.h
@@ -72439,9 +72499,9 @@
 +#endif
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/kmap_types.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/kmap_types.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/kmap_types.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/kmap_types.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/kmap_types.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/kmap_types.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/kmap_types.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,31 @@
 +#ifndef _ASM_KMAP_TYPES_H
 +#define _ASM_KMAP_TYPES_H
@@ -72474,9 +72534,9 @@
 +#undef D
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/maddr.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/maddr.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/maddr.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/maddr.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/maddr.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/maddr.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/maddr.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/maddr.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,160 @@
 +#ifndef _I386_MADDR_H
 +#define _I386_MADDR_H
@@ -72638,9 +72698,9 @@
 +#define __pte_ma(x)	((pte_t) { (x) } )
 +
 +#endif /* _I386_MADDR_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/mmu_context.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/mmu_context.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/mmu_context.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/mmu_context.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/mmu_context.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/mmu_context.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/mmu_context.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/mmu_context.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,108 @@
 +#ifndef __I386_SCHED_H
 +#define __I386_SCHED_H
@@ -72750,9 +72810,9 @@
 +}
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/mmu.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/mmu.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/mmu.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/mmu.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/mmu.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/mmu.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/mmu.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/mmu.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,29 @@
 +#ifndef __i386_MMU_H
 +#define __i386_MMU_H
@@ -72783,10 +72843,10 @@
 +#define arch_dup_mmap(mm, oldmm) ((void)(oldmm), _arch_dup_mmap(mm))
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/page.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/page.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/page.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/page.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,220 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/page.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/page.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/page.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/page.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,217 @@
 +#ifndef _I386_PAGE_H
 +#define _I386_PAGE_H
 +
@@ -72995,10 +73055,7 @@
 +	((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
 +		 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 +
-+/* VIRT <-> MACHINE conversion */
-+#define virt_to_machine(v)	(phys_to_machine(__pa(v)))
-+#define virt_to_mfn(v)		(pfn_to_mfn(__pa(v) >> PAGE_SHIFT))
-+#define mfn_to_virt(m)		(__va(mfn_to_pfn(m) << PAGE_SHIFT))
++#define __HAVE_ARCH_GATE_AREA 1
 +
 +#include <asm-generic/memory_model.h>
 +#include <asm-generic/page.h>
@@ -73007,9 +73064,9 @@
 +#endif /* __KERNEL__ */
 +
 +#endif /* _I386_PAGE_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/param.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/param.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/param.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/param.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/param.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/param.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/param.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/param.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,23 @@
 +#ifndef _ASMi386_PARAM_H
 +#define _ASMi386_PARAM_H
@@ -73034,9 +73091,9 @@
 +#define COMMAND_LINE_SIZE 256
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pci.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pci.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pci.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pci.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pci.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pci.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pci.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pci.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,153 @@
 +#ifndef __i386_PCI_H
 +#define __i386_PCI_H
@@ -73191,9 +73248,9 @@
 +#define pcibios_scan_all_fns(a, b)	1
 +
 +#endif /* __i386_PCI_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgalloc.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgalloc.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgalloc.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgalloc.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pgalloc.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgalloc.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pgalloc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgalloc.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,63 @@
 +#ifndef _I386_PGALLOC_H
 +#define _I386_PGALLOC_H
@@ -73258,9 +73315,9 @@
 +#define check_pgt_cache()	do { } while (0)
 +
 +#endif /* _I386_PGALLOC_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-2level-defs.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,21 @@
 +#ifndef _I386_PGTABLE_2LEVEL_DEFS_H
 +#define _I386_PGTABLE_2LEVEL_DEFS_H
@@ -73283,9 +73340,9 @@
 +#define PTRS_PER_PTE	1024
 +
 +#endif /* _I386_PGTABLE_2LEVEL_DEFS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-2level.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-2level.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-2level.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-2level.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-2level.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-2level.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-2level.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-2level.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,87 @@
 +#ifndef _I386_PGTABLE_2LEVEL_H
 +#define _I386_PGTABLE_2LEVEL_H
@@ -73374,9 +73431,9 @@
 +void vmalloc_sync_all(void);
 +
 +#endif /* _I386_PGTABLE_2LEVEL_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-3level-defs.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,25 @@
 +#ifndef _I386_PGTABLE_3LEVEL_DEFS_H
 +#define _I386_PGTABLE_3LEVEL_DEFS_H
@@ -73403,9 +73460,9 @@
 +#define PTRS_PER_PTE	512
 +
 +#endif /* _I386_PGTABLE_3LEVEL_DEFS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-3level.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-3level.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable-3level.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable-3level.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-3level.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-3level.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable-3level.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable-3level.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,185 @@
 +#ifndef _I386_PGTABLE_3LEVEL_H
 +#define _I386_PGTABLE_3LEVEL_H
@@ -73592,9 +73649,9 @@
 +#define vmalloc_sync_all() ((void)0)
 +
 +#endif /* _I386_PGTABLE_3LEVEL_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/pgtable.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/pgtable.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/pgtable.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/pgtable.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,508 @@
 +#ifndef _I386_PGTABLE_H
 +#define _I386_PGTABLE_H
@@ -74104,9 +74161,9 @@
 +#include <asm-generic/pgtable.h>
 +
 +#endif /* _I386_PGTABLE_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/processor.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/processor.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/processor.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/processor.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/processor.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/processor.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/processor.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/processor.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,741 @@
 +/*
 + * include/asm-i386/processor.h
@@ -74849,9 +74906,9 @@
 +extern int sysenter_setup(void);
 +
 +#endif /* __ASM_I386_PROCESSOR_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/ptrace.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/ptrace.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/ptrace.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/ptrace.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/ptrace.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/ptrace.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/ptrace.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/ptrace.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,90 @@
 +#ifndef _I386_PTRACE_H
 +#define _I386_PTRACE_H
@@ -74943,9 +75000,9 @@
 +#endif /* __KERNEL__ */
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/scatterlist.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/scatterlist.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/scatterlist.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/scatterlist.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/scatterlist.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/scatterlist.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/scatterlist.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/scatterlist.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,22 @@
 +#ifndef _I386_SCATTERLIST_H
 +#define _I386_SCATTERLIST_H
@@ -74969,9 +75026,9 @@
 +#define ISA_DMA_THRESHOLD (0x00ffffff)
 +
 +#endif /* !(_I386_SCATTERLIST_H) */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/segment.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/segment.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/segment.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/segment.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/segment.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/segment.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/segment.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/segment.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,117 @@
 +#ifndef _ASM_SEGMENT_H
 +#define _ASM_SEGMENT_H
@@ -75090,10 +75147,10 @@
 +#define IDT_ENTRIES 256
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/setup.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/setup.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/setup.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/setup.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,79 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/setup.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/setup.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/setup.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/setup.h	2006-09-20 13:58:41.000000000 +0200
+@@ -0,0 +1,81 @@
 +/*
 + *	Just a place holder. We don't want to have to test x86 before
 + *	we include stuff
@@ -75102,6 +75159,7 @@
 +#ifndef _i386_SETUP_H
 +#define _i386_SETUP_H
 +
++#ifdef __KERNEL__
 +#include <linux/pfn.h>
 +
 +/*
@@ -75109,6 +75167,7 @@
 + */
 +#define MAXMEM_PFN	PFN_DOWN(MAXMEM)
 +#define MAX_NONPAE_PFN	(1 << 20)
++#endif
 +
 +#define PARAM_SIZE 4096
 +#define COMMAND_LINE_SIZE 256
@@ -75173,9 +75232,9 @@
 +#endif /* __ASSEMBLY__ */
 +
 +#endif /* _i386_SETUP_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/smp.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/smp.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/smp.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/smp.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/smp.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/smp.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/smp.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/smp.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,103 @@
 +#ifndef __ASM_SMP_H
 +#define __ASM_SMP_H
@@ -75280,9 +75339,9 @@
 +
 +#endif
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/spinlock.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/spinlock.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/spinlock.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/spinlock.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/spinlock.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/spinlock.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/spinlock.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/spinlock.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,202 @@
 +#ifndef __ASM_SPINLOCK_H
 +#define __ASM_SPINLOCK_H
@@ -75486,9 +75545,9 @@
 +}
 +
 +#endif /* __ASM_SPINLOCK_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/swiotlb.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/swiotlb.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/swiotlb.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/swiotlb.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/swiotlb.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/swiotlb.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/swiotlb.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/swiotlb.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,41 @@
 +#ifndef _ASM_SWIOTLB_H
 +#define _ASM_SWIOTLB_H 1
@@ -75531,9 +75590,9 @@
 +#endif
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/synch_bitops.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/synch_bitops.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/synch_bitops.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/synch_bitops.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/synch_bitops.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/synch_bitops.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/synch_bitops.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/synch_bitops.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,141 @@
 +#ifndef __XEN_SYNCH_BITOPS_H__
 +#define __XEN_SYNCH_BITOPS_H__
@@ -75676,10 +75735,10 @@
 +#define synch_cmpxchg_subword synch_cmpxchg
 +
 +#endif /* __XEN_SYNCH_BITOPS_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/system.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/system.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/system.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/system.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,489 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/system.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/system.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/system.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/system.h	2006-09-20 13:58:41.000000000 +0200
+@@ -0,0 +1,495 @@
 +#ifndef __ASM_SYSTEM_H
 +#define __ASM_SYSTEM_H
 +
@@ -75701,9 +75760,14 @@
 +struct task_struct;	/* one of the stranger aspects of C forward declarations.. */
 +extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next));
 +
++/*
++ * Saving eflags is important. It switches not only IOPL between tasks,
++ * it also protects other tasks from NT leaking through sysenter etc.
++ */
 +#define switch_to(prev,next,last) do {					\
 +	unsigned long esi,edi;						\
-+	asm volatile("pushl %%ebp\n\t"					\
++	asm volatile("pushfl\n\t"		/* Save flags */	\
++		     "pushl %%ebp\n\t"					\
 +		     "movl %%esp,%0\n\t"	/* save ESP */		\
 +		     "movl %5,%%esp\n\t"	/* restore ESP */	\
 +		     "movl $1f,%1\n\t"		/* save EIP */		\
@@ -75711,6 +75775,7 @@
 +		     "jmp __switch_to\n"				\
 +		     "1:\t"						\
 +		     "popl %%ebp\n\t"					\
++		     "popfl"						\
 +		     :"=m" (prev->thread.esp),"=m" (prev->thread.eip),	\
 +		      "=a" (last),"=S" (esi),"=D" (edi)			\
 +		     :"m" (next->thread.esp),"m" (next->thread.eip),	\
@@ -76169,83 +76234,9 @@
 +void default_idle(void);
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/timer.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/timer.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/timer.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/timer.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,70 @@
-+#ifndef _ASMi386_TIMER_H
-+#define _ASMi386_TIMER_H
-+#include <linux/init.h>
-+#include <linux/pm.h>
-+
-+/**
-+ * struct timer_ops - used to define a timer source
-+ *
-+ * @name: name of the timer.
-+ * @init: Probes and initializes the timer. Takes clock= override 
-+ *        string as an argument. Returns 0 on success, anything else
-+ *        on failure.
-+ * @mark_offset: called by the timer interrupt.
-+ * @get_offset:  called by gettimeofday(). Returns the number of microseconds
-+ *               since the last timer interupt.
-+ * @monotonic_clock: returns the number of nanoseconds since the init of the
-+ *                   timer.
-+ * @delay: delays this many clock cycles.
-+ */
-+struct timer_opts {
-+	char* name;
-+	void (*mark_offset)(void);
-+	unsigned long (*get_offset)(void);
-+	unsigned long long (*monotonic_clock)(void);
-+	void (*delay)(unsigned long);
-+	unsigned long (*read_timer)(void);
-+	int (*suspend)(pm_message_t state);
-+	int (*resume)(void);
-+};
-+
-+struct init_timer_opts {
-+	int (*init)(char *override);
-+	struct timer_opts *opts;
-+};
-+
-+#define TICK_SIZE (tick_nsec / 1000)
-+
-+extern struct timer_opts* __init select_timer(void);
-+extern void clock_fallback(void);
-+void setup_pit_timer(void);
-+
-+/* Modifiers for buggy PIT handling */
-+
-+extern int pit_latch_buggy;
-+
-+extern struct timer_opts *cur_timer;
-+extern int timer_ack;
-+
-+/* list of externed timers */
-+extern struct timer_opts timer_none;
-+extern struct timer_opts timer_pit;
-+extern struct init_timer_opts timer_pit_init;
-+extern struct init_timer_opts timer_tsc_init;
-+#ifdef CONFIG_X86_CYCLONE_TIMER
-+extern struct init_timer_opts timer_cyclone_init;
-+#endif
-+
-+extern unsigned long calibrate_tsc(void);
-+extern unsigned long read_timer_tsc(void);
-+extern void init_cpu_khz(void);
-+extern int recalibrate_cpu_khz(void);
-+#ifdef CONFIG_HPET_TIMER
-+extern struct init_timer_opts timer_hpet_init;
-+extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
-+#endif
-+
-+#ifdef CONFIG_X86_PM_TIMER
-+extern struct init_timer_opts timer_pmtmr_init;
-+#endif
-+#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/tlbflush.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/tlbflush.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/tlbflush.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/tlbflush.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/tlbflush.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/tlbflush.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/tlbflush.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/tlbflush.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,101 @@
 +#ifndef _I386_TLBFLUSH_H
 +#define _I386_TLBFLUSH_H
@@ -76348,9 +76339,9 @@
 +}
 +
 +#endif /* _I386_TLBFLUSH_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/vga.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/vga.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/asm/vga.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/asm/vga.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/asm/vga.h linux-2.6.18-xen/include/asm-i386/mach-xen/asm/vga.h
+--- linux-2.6.18/include/asm-i386/mach-xen/asm/vga.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/asm/vga.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,20 @@
 +/*
 + *	Access to VGA videoram
@@ -76372,9 +76363,9 @@
 +#define vga_writeb(x,y) (*(y) = (x))
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/irq_vectors.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/irq_vectors.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/irq_vectors.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/irq_vectors.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/irq_vectors.h linux-2.6.18-xen/include/asm-i386/mach-xen/irq_vectors.h
+--- linux-2.6.18/include/asm-i386/mach-xen/irq_vectors.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/irq_vectors.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,125 @@
 +/*
 + * This file should contain #defines for all of the interrupt vector
@@ -76501,9 +76492,9 @@
 +#define irq_to_dynirq(_x)	((_x) - DYNIRQ_BASE)
 +
 +#endif /* _ASM_IRQ_VECTORS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/mach_traps.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/mach_traps.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/mach_traps.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/mach_traps.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/mach_traps.h linux-2.6.18-xen/include/asm-i386/mach-xen/mach_traps.h
+--- linux-2.6.18/include/asm-i386/mach-xen/mach_traps.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/mach_traps.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,33 @@
 +/*
 + *  include/asm-xen/asm-i386/mach-xen/mach_traps.h
@@ -76538,18 +76529,18 @@
 +static inline void reassert_nmi(void) {}
 +
 +#endif /* !_MACH_TRAPS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/mach-xen/setup_arch.h linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/setup_arch.h
---- linux-2.6.18-rc6/include/asm-i386/mach-xen/setup_arch.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-i386/mach-xen/setup_arch.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/mach-xen/setup_arch.h linux-2.6.18-xen/include/asm-i386/mach-xen/setup_arch.h
+--- linux-2.6.18/include/asm-i386/mach-xen/setup_arch.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-i386/mach-xen/setup_arch.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,5 @@
 +/* Hook to call BIOS initialisation function */
 +
 +#define ARCH_SETUP machine_specific_arch_setup();
 +
 +void __init machine_specific_arch_setup(void);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/page.h linux-2.6.18-rc6-xen/include/asm-i386/page.h
---- linux-2.6.18-rc6/include/asm-i386/page.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-i386/page.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/page.h linux-2.6.18-xen/include/asm-i386/page.h
+--- linux-2.6.18/include/asm-i386/page.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/page.h	2006-08-15 13:03:31.000000000 +0200
 @@ -122,7 +122,7 @@
  
  #define PAGE_OFFSET		((unsigned long)__PAGE_OFFSET)
@@ -76559,9 +76550,18 @@
  #define __pa(x)			((unsigned long)(x)-PAGE_OFFSET)
  #define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
  #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/pgtable-2level-defs.h linux-2.6.18-rc6-xen/include/asm-i386/pgtable-2level-defs.h
---- linux-2.6.18-rc6/include/asm-i386/pgtable-2level-defs.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-i386/pgtable-2level-defs.h	2006-09-04 16:31:16.000000000 +0200
+@@ -138,6 +138,8 @@
+ 	((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+ 		 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+ 
++#define __HAVE_ARCH_GATE_AREA 1
++
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+ 
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/pgtable-2level-defs.h linux-2.6.18-xen/include/asm-i386/pgtable-2level-defs.h
+--- linux-2.6.18/include/asm-i386/pgtable-2level-defs.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/pgtable-2level-defs.h	2006-05-26 22:00:47.000000000 +0200
 @@ -1,6 +1,8 @@
  #ifndef _I386_PGTABLE_2LEVEL_DEFS_H
  #define _I386_PGTABLE_2LEVEL_DEFS_H
@@ -76571,9 +76571,9 @@
  /*
   * traditional i386 two-level paging structure:
   */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-i386/pgtable-3level-defs.h linux-2.6.18-rc6-xen/include/asm-i386/pgtable-3level-defs.h
---- linux-2.6.18-rc6/include/asm-i386/pgtable-3level-defs.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-i386/pgtable-3level-defs.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-i386/pgtable-3level-defs.h linux-2.6.18-xen/include/asm-i386/pgtable-3level-defs.h
+--- linux-2.6.18/include/asm-i386/pgtable-3level-defs.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-i386/pgtable-3level-defs.h	2006-05-26 22:00:47.000000000 +0200
 @@ -1,6 +1,8 @@
  #ifndef _I386_PGTABLE_3LEVEL_DEFS_H
  #define _I386_PGTABLE_3LEVEL_DEFS_H
@@ -76583,27 +76583,23 @@
  /*
   * PGDIR_SHIFT determines what a top-level page table entry can map
   */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/agp.h linux-2.6.18-rc6-xen/include/asm-ia64/agp.h
---- linux-2.6.18-rc6/include/asm-ia64/agp.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/agp.h	2006-09-04 16:31:16.000000000 +0200
-@@ -19,13 +19,49 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/agp.h linux-2.6.18-xen/include/asm-ia64/agp.h
+--- linux-2.6.18/include/asm-ia64/agp.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/agp.h	2006-09-17 17:44:50.000000000 +0200
+@@ -19,13 +19,32 @@
  #define flush_agp_cache()		mb()
  
  /* Convert a physical address to an address suitable for the GART. */
-+#ifndef CONFIG_XEN
- #define phys_to_gart(x) (x)
- #define gart_to_phys(x) (x)
-+#else
+-#define phys_to_gart(x) (x)
+-#define gart_to_phys(x) (x)
 +#define phys_to_gart(x) phys_to_machine_for_dma(x)
 +#define gart_to_phys(x) machine_to_phys_for_dma(x)
-+#endif
  
  /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 -#define alloc_gatt_pages(order)		\
 -	((char *)__get_free_pages(GFP_KERNEL, (order)))
 -#define free_gatt_pages(table, order)	\
 -	free_pages((unsigned long)(table), (order))
-+#ifdef CONFIG_XEN
 +#include <asm/hypervisor.h>
 +static inline char*
 +alloc_gatt_pages(unsigned int order)
@@ -76627,56 +76623,15 @@
 +	xen_destroy_contiguous_region((unsigned long)table, order);
 +	free_pages((unsigned long)table, order);
 +}
-+#else	/* CONFIG_XEN */
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)         \
-+        ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order)   \
-+        free_pages((unsigned long)(table), (order))
-+#endif	/* CONFIG_XEN */
  
  #endif /* _ASM_IA64_AGP_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/dma-mapping.h linux-2.6.18-rc6-xen/include/asm-ia64/dma-mapping.h
---- linux-2.6.18-rc6/include/asm-ia64/dma-mapping.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/dma-mapping.h	2006-09-04 16:31:16.000000000 +0200
-@@ -7,19 +7,68 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/dma-mapping.h linux-2.6.18-xen/include/asm-ia64/dma-mapping.h
+--- linux-2.6.18/include/asm-ia64/dma-mapping.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/dma-mapping.h	2006-09-17 17:44:50.000000000 +0200
+@@ -6,20 +6,49 @@
+  *	David Mosberger-Tang <davidm at hpl.hp.com>
   */
  #include <asm/machvec.h>
- 
--#define dma_alloc_coherent	platform_dma_alloc_coherent
--#define dma_alloc_noncoherent	platform_dma_alloc_coherent	/* coherent mem. is cheap */
--#define dma_free_coherent	platform_dma_free_coherent
--#define dma_free_noncoherent	platform_dma_free_coherent
--#define dma_map_single		platform_dma_map_single
--#define dma_map_sg		platform_dma_map_sg
--#define dma_unmap_single	platform_dma_unmap_single
--#define dma_unmap_sg		platform_dma_unmap_sg
--#define dma_sync_single_for_cpu	platform_dma_sync_single_for_cpu
--#define dma_sync_sg_for_cpu	platform_dma_sync_sg_for_cpu
-+#ifndef CONFIG_XEN
-+
-+#define dma_alloc_coherent      platform_dma_alloc_coherent
-+#define dma_alloc_noncoherent   platform_dma_alloc_coherent     /* coherent mem. is cheap */
-+#define dma_free_coherent       platform_dma_free_coherent
-+#define dma_free_noncoherent    platform_dma_free_coherent
-+#define dma_map_single          platform_dma_map_single
-+#define dma_map_sg              platform_dma_map_sg
-+#define dma_unmap_single        platform_dma_unmap_single
-+#define dma_unmap_sg            platform_dma_unmap_sg
-+#define dma_sync_single_for_cpu platform_dma_sync_single_for_cpu
-+#define dma_sync_sg_for_cpu     platform_dma_sync_sg_for_cpu
- #define dma_sync_single_for_device platform_dma_sync_single_for_device
--#define dma_sync_sg_for_device	platform_dma_sync_sg_for_device
--#define dma_mapping_error	platform_dma_mapping_error
-+#define dma_sync_sg_for_device  platform_dma_sync_sg_for_device
-+#define dma_mapping_error       platform_dma_mapping_error
-+
-+
-+#else /* CONFIG_XEN */
 +/* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */
 +#include <asm/hypervisor.h>
 +/* Needed for arch/i386/kernel/swiotlb.c */
@@ -76701,7 +76656,20 @@
 +                                size_t size,
 +                                enum dma_data_direction direction);
 +int dma_mapping_error(dma_addr_t dma_addr);
-+
+ 
+-#define dma_alloc_coherent	platform_dma_alloc_coherent
+-#define dma_alloc_noncoherent	platform_dma_alloc_coherent	/* coherent mem. is cheap */
+-#define dma_free_coherent	platform_dma_free_coherent
+-#define dma_free_noncoherent	platform_dma_free_coherent
+-#define dma_map_single		platform_dma_map_single
+-#define dma_map_sg		platform_dma_map_sg
+-#define dma_unmap_single	platform_dma_unmap_single
+-#define dma_unmap_sg		platform_dma_unmap_sg
+-#define dma_sync_single_for_cpu	platform_dma_sync_single_for_cpu
+-#define dma_sync_sg_for_cpu	platform_dma_sync_sg_for_cpu
+-#define dma_sync_single_for_device platform_dma_sync_single_for_device
+-#define dma_sync_sg_for_device	platform_dma_sync_sg_for_device
+-#define dma_mapping_error	platform_dma_mapping_error
 +#define flush_write_buffers()	do { } while (0)
 +static inline void
 +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
@@ -76720,15 +76688,13 @@
 +		swiotlb_sync_sg_for_device(dev,sg,nelems,direction);
 +	flush_write_buffers();
 +}
-+#endif /* CONFIG_XEN */
  
  #define dma_map_page(dev, pg, off, size, dir)				\
  	dma_map_single(dev, page_address(pg) + (off), (size), (dir))
-@@ -61,4 +110,29 @@
+@@ -61,4 +90,25 @@
  
  #define dma_is_consistent(dma_handle)	(1)	/* all we do is coherent memory... */
  
-+#ifdef CONFIG_XEN
 +/* arch/i386/kernel/swiotlb.o requires */
 +void contiguous_bitmap_init(unsigned long end_pfn);
 +
@@ -76741,9 +76707,6 @@
 +		mask = *hwdev->dma_mask;
 +	return (addr & ~mask) != 0;
 +}
-+#else
-+#define contiguous_bitmap_init(end_pfn)	((void)end_pfn)
-+#endif
 +
 +static inline int
 +range_straddles_page_boundary(void *p, size_t size)
@@ -76754,15 +76717,15 @@
 +}
 +
  #endif /* _ASM_IA64_DMA_MAPPING_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/fixmap.h linux-2.6.18-rc6-xen/include/asm-ia64/fixmap.h
---- linux-2.6.18-rc6/include/asm-ia64/fixmap.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/fixmap.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/fixmap.h linux-2.6.18-xen/include/asm-ia64/fixmap.h
+--- linux-2.6.18/include/asm-ia64/fixmap.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-ia64/fixmap.h	2006-05-26 22:00:47.000000000 +0200
 @@ -0,0 +1,2 @@
 +#define clear_fixmap(x)	do {} while (0)
 +#define	set_fixmap(x,y)	do {} while (0)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/gcc_intrin.h linux-2.6.18-rc6-xen/include/asm-ia64/gcc_intrin.h
---- linux-2.6.18-rc6/include/asm-ia64/gcc_intrin.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/gcc_intrin.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/gcc_intrin.h linux-2.6.18-xen/include/asm-ia64/gcc_intrin.h
+--- linux-2.6.18/include/asm-ia64/gcc_intrin.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/gcc_intrin.h	2006-05-26 22:00:47.000000000 +0200
 @@ -26,7 +26,7 @@
  
  register unsigned long ia64_r13 asm ("r13") __attribute_used__;
@@ -76952,9 +76915,9 @@
 +#define __ia64_get_psr_i()	(__ia64_getreg(_IA64_REG_PSR) & 0x4000UL)
 +
  #endif /* _ASM_IA64_GCC_INTRIN_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/hw_irq.h linux-2.6.18-rc6-xen/include/asm-ia64/hw_irq.h
---- linux-2.6.18-rc6/include/asm-ia64/hw_irq.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/hw_irq.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/hw_irq.h linux-2.6.18-xen/include/asm-ia64/hw_irq.h
+--- linux-2.6.18/include/asm-ia64/hw_irq.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/hw_irq.h	2006-08-15 13:03:31.000000000 +0200
 @@ -15,7 +15,11 @@
  #include <asm/ptrace.h>
  #include <asm/smp.h>
@@ -76967,23 +76930,24 @@
  
  /*
   * 0 special
-@@ -99,6 +103,12 @@
+@@ -99,6 +103,13 @@
  
  static inline void ia64_resend_irq(unsigned int vector)
  {
 +#ifdef CONFIG_XEN
-+	extern void resend_irq_on_evtchn(unsigned int i);
++	extern void resend_irq_on_evtchn(struct hw_interrupt_type *h,
++					 unsigned int i);
 +	if (is_running_on_xen())
-+		resend_irq_on_evtchn(vector);
++		resend_irq_on_evtchn(h, vector);
 +	else
 +#endif /* CONFIG_XEN */
  	platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
  }
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/hypercall.h linux-2.6.18-rc6-xen/include/asm-ia64/hypercall.h
---- linux-2.6.18-rc6/include/asm-ia64/hypercall.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/hypercall.h	2006-09-05 10:45:47.000000000 +0200
-@@ -0,0 +1,419 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/hypercall.h linux-2.6.18-xen/include/asm-ia64/hypercall.h
+--- linux-2.6.18/include/asm-ia64/hypercall.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-ia64/hypercall.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,496 @@
 +/******************************************************************************
 + * hypercall.h
 + * 
@@ -77037,7 +77001,7 @@
 +			      "break 0x1000 ;;\n"		\
 +			      "mov %0=r8 ;;\n"			\
 +			      : "=r" (__res)			\
-+			      : "J" (__HYPERVISOR_##name)	\
++			      : "i" (__HYPERVISOR_##name)	\
 +			      : "r2","r8",			\
 +			        "memory" );			\
 +	(type)__res;						\
@@ -77052,8 +77016,8 @@
 +			      "break 0x1000 ;;\n"		\
 +			      "mov %0=r8 ;;\n"			\
 +			      : "=r" (__res)			\
-+			      : "J" (__HYPERVISOR_##name),	\
-+				"rI" ((unsigned long)(a1))	\
++			      : "i" (__HYPERVISOR_##name),	\
++				"r" ((unsigned long)(a1))	\
 +			      : "r14","r2","r8",		\
 +				"memory" );			\
 +	(type)__res;						\
@@ -77069,9 +77033,9 @@
 +			      "break 0x1000 ;;\n"		\
 +			      "mov %0=r8 ;;\n"			\
 +			      : "=r" (__res)			\
-+			      : "J" (__HYPERVISOR_##name),	\
-+				"rI" ((unsigned long)(a1)),	\
-+				"rI" ((unsigned long)(a2))	\
++			      : "i" (__HYPERVISOR_##name),	\
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2))	\
 +			      : "r14","r15","r2","r8",		\
 +				"memory" );			\
 +	(type)__res;						\
@@ -77088,10 +77052,10 @@
 +			      "break 0x1000 ;;\n"               \
 +			      "mov %0=r8 ;;\n"                  \
 +			      : "=r" (__res)                    \
-+			      : "J" (__HYPERVISOR_##name),      \
-+				"rI" ((unsigned long)(a1)),     \
-+				"rI" ((unsigned long)(a2)),     \
-+				"rI" ((unsigned long)(a3))      \
++			      : "i" (__HYPERVISOR_##name),      \
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2)),	\
++				"r" ((unsigned long)(a3))	\
 +			      : "r14","r15","r16","r2","r8",	\
 +			        "memory" );                     \
 +	(type)__res;                                            \
@@ -77109,11 +77073,11 @@
 +			      "break 0x1000 ;;\n"               \
 +			      "mov %0=r8 ;;\n"                  \
 +			      : "=r" (__res)                    \
-+			      : "J" (__HYPERVISOR_##name),      \
-+				"rI" ((unsigned long)(a1)),     \
-+				"rI" ((unsigned long)(a2)),     \
-+				"rI" ((unsigned long)(a3)),     \
-+				"rI" ((unsigned long)(a4))      \
++			      : "i" (__HYPERVISOR_##name),      \
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2)),	\
++				"r" ((unsigned long)(a3)),	\
++				"r" ((unsigned long)(a4))       \
 +			      : "r14","r15","r16","r2","r8",	\
 +			        "r17","memory" );               \
 +	(type)__res;                                            \
@@ -77132,12 +77096,12 @@
 +			      "break 0x1000 ;;\n"               \
 +			      "mov %0=r8 ;;\n"                  \
 +			      : "=r" (__res)                    \
-+			      : "J" (__HYPERVISOR_##name),      \
-+				"rI" ((unsigned long)(a1)),     \
-+				"rI" ((unsigned long)(a2)),     \
-+				"rI" ((unsigned long)(a3)),     \
-+				"rI" ((unsigned long)(a4)),     \
-+				"rI" ((unsigned long)(a5))      \
++			      : "i" (__HYPERVISOR_##name),      \
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2)),	\
++				"r" ((unsigned long)(a3)),	\
++				"r" ((unsigned long)(a4)),	\
++				"r" ((unsigned long)(a5))       \
 +			      : "r14","r15","r16","r2","r8",	\
 +			        "r17","r18","memory" );         \
 +	(type)__res;                                            \
@@ -77261,10 +77225,9 @@
 +//XXX __HYPERVISOR_grant_table_op is used for this hypercall constant.
 +static inline int
 +____HYPERVISOR_grant_table_op(
-+    unsigned int cmd, void *uop, unsigned int count,
-+    unsigned long pa1, unsigned long pa2)
++    unsigned int cmd, void *uop, unsigned int count)
 +{
-+    return _hypercall5(int, grant_table_op, cmd, uop, count, pa1, pa2);
++    return _hypercall3(int, grant_table_op, cmd, uop, count);
 +}
 +
 +int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
@@ -77278,13 +77241,6 @@
 +
 +extern int HYPERVISOR_suspend(unsigned long srec);
 +
-+static inline unsigned long
-+HYPERVISOR_hvm_op(
-+	int cmd, void *arg)
-+{
-+	return _hypercall2(unsigned long, hvm_op, cmd, arg);
-+}
-+
 +static inline int
 +HYPERVISOR_callback_op(
 +	int cmd, void *arg)
@@ -77301,15 +77257,99 @@
 +})
 +
 +#include <linux/err.h>
-+#ifdef CONFIG_XEN
 +#include <asm/xen/privop.h>
-+#endif /* CONFIG_XEN */
++
++#define _hypercall_imm1(type, name, imm, a1)			\
++({								\
++	long __res;						\
++	__asm__ __volatile__ (";;\n"				\
++			      "mov r14=%2\n"			\
++			      "mov r15=%3\n"			\
++			      "mov r2=%1\n"			\
++			      "break 0x1000 ;;\n"		\
++			      "mov %0=r8 ;;\n"			\
++			      : "=r" (__res)			\
++			      : "i" (__HYPERVISOR_##name),	\
++				"i" (imm),			\
++				"r" ((unsigned long)(a1))	\
++			      : "r14","r15","r2","r8",		\
++				"memory" );			\
++	(type)__res;						\
++})
++
++#define _hypercall_imm2(type, name, imm, a1, a2)		\
++({								\
++	long __res;						\
++	__asm__ __volatile__ (";;\n"				\
++			      "mov r14=%2\n"			\
++			      "mov r15=%3\n"			\
++			      "mov r16=%4\n"			\
++			      "mov r2=%1\n"			\
++			      "break 0x1000 ;;\n"		\
++			      "mov %0=r8 ;;\n"			\
++			      : "=r" (__res)			\
++			      : "i" (__HYPERVISOR_##name),	\
++				"i" (imm),			\
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2))	\
++			      : "r14","r15","r16","r2","r8",	\
++				"memory" );			\
++	(type)__res;						\
++})
++
++#define _hypercall_imm3(type, name, imm, a1, a2, a3)		\
++({								\
++	long __res;						\
++	__asm__ __volatile__ (";;\n"				\
++			      "mov r14=%2\n"			\
++			      "mov r15=%3\n"			\
++			      "mov r16=%4\n"			\
++			      "mov r17=%5\n"			\
++			      "mov r2=%1\n"			\
++			      "break 0x1000 ;;\n"		\
++			      "mov %0=r8 ;;\n"			\
++			      : "=r" (__res)			\
++			      : "i" (__HYPERVISOR_##name),	\
++				"i" (imm),			\
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2)),	\
++				"r" ((unsigned long)(a3))	\
++			      : "r14","r15","r16","r17",	\
++				"r2","r8",			\
++				"memory" );			\
++	(type)__res;						\
++})
++
++#define _hypercall_imm4(type, name, imm, a1, a2, a3, a4)	\
++({								\
++	long __res;						\
++	__asm__ __volatile__ (";;\n"				\
++			      "mov r14=%2\n"			\
++			      "mov r15=%3\n"			\
++			      "mov r16=%4\n"			\
++			      "mov r17=%5\n"			\
++			      "mov r18=%6\n"			\
++			      "mov r2=%1\n"			\
++			      "break 0x1000 ;;\n"		\
++			      "mov %0=r8 ;;\n"			\
++			      : "=r" (__res)			\
++			      : "i" (__HYPERVISOR_##name),	\
++				"i" (imm),			\
++				"r" ((unsigned long)(a1)),	\
++				"r" ((unsigned long)(a2)),	\
++				"r" ((unsigned long)(a3)),	\
++				"r" ((unsigned long)(a4))	\
++			      : "r14","r15","r16","r17","r18",	\
++				"r2","r8",			\
++				"memory" );			\
++	(type)__res;						\
++})
 +
 +static inline unsigned long
 +__HYPERVISOR_ioremap(unsigned long ioaddr, unsigned long size)
 +{
-+	return _hypercall3(unsigned long, ia64_dom0vp_op,
-+	                   IA64_DOM0VP_ioremap, ioaddr, size);
++	return _hypercall_imm2(unsigned long, ia64_dom0vp_op,
++			       IA64_DOM0VP_ioremap, ioaddr, size);
 +}
 +
 +static inline unsigned long
@@ -77331,8 +77371,8 @@
 +static inline unsigned long
 +__HYPERVISOR_phystomach(unsigned long gpfn)
 +{
-+	return _hypercall2(unsigned long, ia64_dom0vp_op,
-+	                   IA64_DOM0VP_phystomach, gpfn);
++	return _hypercall_imm1(unsigned long, ia64_dom0vp_op,
++			       IA64_DOM0VP_phystomach, gpfn);
 +}
 +
 +static inline unsigned long
@@ -77348,8 +77388,8 @@
 +static inline unsigned long
 +__HYPERVISOR_machtophys(unsigned long mfn)
 +{
-+	return _hypercall2(unsigned long, ia64_dom0vp_op,
-+	                   IA64_DOM0VP_machtophys, mfn);
++	return _hypercall_imm1(unsigned long, ia64_dom0vp_op,
++			       IA64_DOM0VP_machtophys, mfn);
 +}
 +
 +static inline unsigned long
@@ -77365,8 +77405,8 @@
 +static inline unsigned long
 +__HYPERVISOR_zap_physmap(unsigned long gpfn, unsigned int extent_order)
 +{
-+	return _hypercall3(unsigned long, ia64_dom0vp_op,
-+	                   IA64_DOM0VP_zap_physmap, gpfn, extent_order);
++	return _hypercall_imm2(unsigned long, ia64_dom0vp_op,
++			       IA64_DOM0VP_zap_physmap, gpfn, extent_order);
 +}
 +
 +static inline unsigned long
@@ -77383,8 +77423,9 @@
 +__HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
 +			 unsigned long flags, domid_t domid)
 +{
-+	return _hypercall5(unsigned long, ia64_dom0vp_op,
-+	                   IA64_DOM0VP_add_physmap, gpfn, mfn, flags, domid);
++	return _hypercall_imm4(unsigned long, ia64_dom0vp_op,
++			       IA64_DOM0VP_add_physmap, gpfn, mfn, flags,
++			       domid);
 +}
 +
 +static inline unsigned long
@@ -77403,10 +77444,10 @@
 +#define HYPERVISOR_update_va_mapping(va, new_val, flags) (0)
 +
 +#endif /* __HYPERCALL_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/hypervisor.h linux-2.6.18-rc6-xen/include/asm-ia64/hypervisor.h
---- linux-2.6.18-rc6/include/asm-ia64/hypervisor.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/hypervisor.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,214 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/hypervisor.h linux-2.6.18-xen/include/asm-ia64/hypervisor.h
+--- linux-2.6.18/include/asm-ia64/hypervisor.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-ia64/hypervisor.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,192 @@
 +/******************************************************************************
 + * hypervisor.h
 + * 
@@ -77442,7 +77483,7 @@
 +#ifndef __HYPERVISOR_H__
 +#define __HYPERVISOR_H__
 +
-+#if !defined(CONFIG_XEN) && !defined(CONFIG_VMX_GUEST)
++#ifndef CONFIG_XEN
 +#define is_running_on_xen()			(0)
 +#define HYPERVISOR_ioremap(offset, size)	(offset)
 +#else
@@ -77450,7 +77491,7 @@
 +#define is_running_on_xen()			(running_on_xen)
 +#endif
 +
-+#if defined(CONFIG_XEN) || defined(CONFIG_VMX_GUEST)
++#ifdef CONFIG_XEN
 +#include <linux/types.h>
 +#include <linux/kernel.h>
 +#include <linux/version.h>
@@ -77467,9 +77508,10 @@
 +extern shared_info_t *HYPERVISOR_shared_info;
 +extern start_info_t *xen_start_info;
 +
++#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
++
 +void force_evtchn_callback(void);
 +
-+#ifndef CONFIG_VMX_GUEST
 +/* Turn jiffies into Xen system time. XXX Implement me. */
 +#define jiffies_to_st(j)	0
 +
@@ -77554,14 +77596,10 @@
 +#define scrub_pages(_p,_n) ((void)0)
 +#endif
 +#define	pte_mfn(_x)	pte_pfn(_x)
++#define __pte_ma(_x)	((pte_t) {(_x)})
 +#define phys_to_machine_mapping_valid(_x)	(1)
++#define pfn_pte_ma(_x,_y)	__pte_ma(0)
 +
-+#endif /* !CONFIG_VMX_GUEST */
-+
-+#define __pte_ma(_x)	((pte_t) {(_x)})        /* unmodified use */
-+#define pfn_pte_ma(_x,_y)	__pte_ma(0)     /* unmodified use */
-+
-+#ifndef CONFIG_VMX_GUEST
 +int __xen_create_contiguous_region(unsigned long vstart, unsigned int order, unsigned int address_bits);
 +static inline int
 +xen_create_contiguous_region(unsigned long vstart,
@@ -77583,8 +77621,6 @@
 +		__xen_destroy_contiguous_region(vstart, order);
 +}
 +
-+#endif /* !CONFIG_VMX_GUEST */
-+
 +// for netfront.c, netback.c
 +#define MULTI_UVMFLAGS_INDEX 0 //XXX any value
 +
@@ -77597,33 +77633,16 @@
 +	mcl->result = 0;
 +}
 +
-+static inline void
-+MULTI_grant_table_op(multicall_entry_t *mcl, unsigned int cmd,
-+	void *uop, unsigned int count)
-+{
-+	mcl->op = __HYPERVISOR_grant_table_op;
-+	mcl->args[0] = cmd;
-+	mcl->args[1] = (unsigned long)uop;
-+	mcl->args[2] = count;
-+}
-+
 +// for debug
 +asmlinkage int xprintk(const char *fmt, ...);
 +#define xprintd(fmt, ...)	xprintk("%s:%d " fmt, __func__, __LINE__, \
 +					##__VA_ARGS__)
-+
-+#endif /* CONFIG_XEN || CONFIG_VMX_GUEST */
-+
-+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
-+#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
-+#else
-+#define is_initial_xendomain() 0
-+#endif
++#endif /* CONFIG_XEN */
 +
 +#endif /* __HYPERVISOR_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/intel_intrin.h linux-2.6.18-rc6-xen/include/asm-ia64/intel_intrin.h
---- linux-2.6.18-rc6/include/asm-ia64/intel_intrin.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/intel_intrin.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/intel_intrin.h linux-2.6.18-xen/include/asm-ia64/intel_intrin.h
+--- linux-2.6.18/include/asm-ia64/intel_intrin.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/intel_intrin.h	2006-05-26 22:00:47.000000000 +0200
 @@ -16,8 +16,10 @@
  		 	 * intrinsic
  		 	 */
@@ -77747,9 +77766,9 @@
  #define __builtin_trap()	__break(0);
  
  #endif /* _ASM_IA64_INTEL_INTRIN_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/io.h linux-2.6.18-rc6-xen/include/asm-ia64/io.h
---- linux-2.6.18-rc6/include/asm-ia64/io.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/io.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/io.h linux-2.6.18-xen/include/asm-ia64/io.h
+--- linux-2.6.18/include/asm-ia64/io.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/io.h	2006-09-17 17:44:50.000000000 +0200
 @@ -66,9 +66,11 @@
  #define PIO_RESERVED		__IA64_UNCACHED_OFFSET
  #define HAVE_ARCH_PIO_SIZE
@@ -77762,17 +77781,13 @@
  #include <asm/system.h>
  #include <asm-generic/iomap.h>
  
-@@ -96,9 +98,41 @@
+@@ -96,9 +98,33 @@
   * The following two macros are deprecated and scheduled for removal.
   * Please use the PCI-DMA interface defined in <asm/pci.h> instead.
   */
-+#ifndef CONFIG_XEN
- #define bus_to_virt	phys_to_virt
- #define virt_to_bus	virt_to_phys
- #define page_to_bus	page_to_phys
-+#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
-+#define page_to_pseudophys(page)	page_to_phys(page)
-+#else /* CONFIG_XEN */
+-#define bus_to_virt	phys_to_virt
+-#define virt_to_bus	virt_to_phys
+-#define page_to_bus	page_to_phys
 +#define bus_to_virt(bus)	\
 +	phys_to_virt(machine_to_phys_for_dma(bus))
 +#define virt_to_bus(virt)	\
@@ -77800,13 +77815,12 @@
 +	(((bvec_to_bus((vec1)) + (vec1)->bv_len) == bvec_to_bus((vec2))) && \
 +	 ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) ==		\
 +	  bvec_to_pseudophys((vec2))))
-+#endif /* CONFIG_XEN */
  
  # endif /* KERNEL */
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/iosapic.h linux-2.6.18-rc6-xen/include/asm-ia64/iosapic.h
---- linux-2.6.18-rc6/include/asm-ia64/iosapic.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/iosapic.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/iosapic.h linux-2.6.18-xen/include/asm-ia64/iosapic.h
+--- linux-2.6.18/include/asm-ia64/iosapic.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/iosapic.h	2006-05-26 22:00:47.000000000 +0200
 @@ -53,6 +53,7 @@
  
  #define NR_IOSAPICS			256
@@ -77823,9 +77837,9 @@
  
  static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)
  {
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/irq.h linux-2.6.18-rc6-xen/include/asm-ia64/irq.h
---- linux-2.6.18-rc6/include/asm-ia64/irq.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/irq.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/irq.h linux-2.6.18-xen/include/asm-ia64/irq.h
+--- linux-2.6.18/include/asm-ia64/irq.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/irq.h	2006-08-15 13:03:31.000000000 +0200
 @@ -11,8 +11,39 @@
   * 02/29/00     D.Mosberger	moved most things into hw_irq.h
   */
@@ -77866,14 +77880,13 @@
  
  static __inline__ int
  irq_canonicalize (int irq)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/machvec.h linux-2.6.18-rc6-xen/include/asm-ia64/machvec.h
---- linux-2.6.18-rc6/include/asm-ia64/machvec.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/machvec.h	2006-09-05 10:45:47.000000000 +0200
-@@ -260,6 +260,20 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/machvec.h linux-2.6.18-xen/include/asm-ia64/machvec.h
+--- linux-2.6.18/include/asm-ia64/machvec.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/machvec.h	2006-09-17 17:44:50.000000000 +0200
+@@ -260,6 +260,19 @@
  #  error Unknown configuration.  Update asm-ia64/machvec.h.
  # endif /* CONFIG_IA64_GENERIC */
  
-+#ifdef CONFIG_XEN
 +# define platform_dma_map_sg		dma_map_sg
 +# define platform_dma_unmap_sg		dma_unmap_sg
 +# define platform_dma_mapping_error	dma_mapping_error
@@ -77886,105 +77899,13 @@
 +					dma_sync_single_for_cpu
 +# define platform_dma_sync_single_for_device \
 +					dma_sync_single_for_device
-+#endif /* CONFIG_XEN */
++
  /*
   * Declare default routines which aren't declared anywhere else:
   */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/maddr.h linux-2.6.18-rc6-xen/include/asm-ia64/maddr.h
---- linux-2.6.18-rc6/include/asm-ia64/maddr.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/maddr.h	2006-09-04 16:31:16.000000000 +0200
-@@ -0,0 +1,88 @@
-+#ifndef _ASM_IA64_MADDR_H
-+#define _ASM_IA64_MADDR_H
-+
-+#include <linux/kernel.h>
-+#include <asm/hypervisor.h>
-+#include <xen/features.h>
-+#include <xen/interface/xen.h>
-+
-+#ifdef CONFIG_XEN
-+
-+#define INVALID_P2M_ENTRY       (~0UL)
-+
-+/* XXX xen page size != page size */
-+static inline unsigned long
-+pfn_to_mfn_for_dma(unsigned long pfn)
-+{
-+	unsigned long mfn;
-+	mfn = HYPERVISOR_phystomach(pfn);
-+	BUG_ON(mfn == 0); // XXX
-+	BUG_ON(mfn == INVALID_P2M_ENTRY); // XXX
-+	BUG_ON(mfn == INVALID_MFN);
-+	return mfn;
-+}
-+
-+static inline unsigned long
-+phys_to_machine_for_dma(unsigned long phys)
-+{
-+	unsigned long machine =
-+	              pfn_to_mfn_for_dma(phys >> PAGE_SHIFT) << PAGE_SHIFT;
-+	machine |= (phys & ~PAGE_MASK);
-+	return machine;
-+}
-+
-+static inline unsigned long
-+mfn_to_pfn_for_dma(unsigned long mfn)
-+{
-+	unsigned long pfn;
-+	pfn = HYPERVISOR_machtophys(mfn);
-+	BUG_ON(pfn == 0);
-+	//BUG_ON(pfn == INVALID_M2P_ENTRY);
-+	return pfn;
-+}
-+
-+static inline unsigned long
-+machine_to_phys_for_dma(unsigned long machine)
-+{
-+	unsigned long phys =
-+	              mfn_to_pfn_for_dma(machine >> PAGE_SHIFT) << PAGE_SHIFT;
-+	phys |= (machine & ~PAGE_MASK);
-+	return phys;
-+}
-+
-+static inline unsigned long
-+mfn_to_local_pfn(unsigned long mfn)
-+{
-+	extern unsigned long max_mapnr;
-+	unsigned long pfn = mfn_to_pfn_for_dma(mfn);
-+	if (!pfn_valid(pfn))
-+		return INVALID_P2M_ENTRY;
-+	return pfn;
-+}
-+
-+#else /* !CONFIG_XEN */
-+
-+#define pfn_to_mfn_for_dma(pfn) (pfn)
-+#define mfn_to_pfn_for_dma(mfn) (mfn)
-+#define phys_to_machine_for_dma(phys) (phys)
-+#define machine_to_phys_for_dma(machine) (machine)
-+#define mfn_to_local_pfn(mfn) (mfn)
-+
-+#endif /* !CONFIG_XEN */
-+
-+/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
-+#define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
-+
-+#define mfn_to_pfn(mfn) (mfn)
-+#define pfn_to_mfn(pfn) (pfn)
-+
-+#define mfn_to_virt(mfn) (__va((mfn) << PAGE_SHIFT))
-+#define virt_to_mfn(virt) (__pa(virt) >> PAGE_SHIFT)
-+#define virt_to_machine(virt) __pa(virt) // for tpmfront.c
-+
-+#define set_phys_to_machine(pfn, mfn) do { } while (0)
-+#define xen_machphys_update(mfn, pfn) do { } while (0)
-+
-+typedef unsigned long maddr_t;	// to compile netback, netfront
-+
-+#endif /* _ASM_IA64_MADDR_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/meminit.h linux-2.6.18-rc6-xen/include/asm-ia64/meminit.h
---- linux-2.6.18-rc6/include/asm-ia64/meminit.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/meminit.h	2006-09-04 16:31:16.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/meminit.h linux-2.6.18-xen/include/asm-ia64/meminit.h
+--- linux-2.6.18/include/asm-ia64/meminit.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/meminit.h	2006-09-17 17:44:50.000000000 +0200
 @@ -16,10 +16,15 @@
   * 	- command line string
   * 	- kernel code & data
@@ -78001,29 +77922,30 @@
  
  struct rsvd_region {
  	unsigned long start;	/* virtual address of beginning of element */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/page.h linux-2.6.18-rc6-xen/include/asm-ia64/page.h
---- linux-2.6.18-rc6/include/asm-ia64/page.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/page.h	2006-09-04 16:31:16.000000000 +0200
-@@ -126,7 +126,9 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/page.h linux-2.6.18-xen/include/asm-ia64/page.h
+--- linux-2.6.18/include/asm-ia64/page.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/page.h	2006-09-20 13:58:41.000000000 +0200
+@@ -126,7 +126,6 @@
  # define pfn_valid(pfn)		(((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
  #endif
  
-+#ifndef CONFIG_XEN
- #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
-+#endif
+-#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
  #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
  #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
  
-@@ -228,5 +230,54 @@
+@@ -227,5 +226,118 @@
  					 (((current->personality & READ_IMPLIES_EXEC) != 0)	\
  					  ? VM_EXEC : 0))
  
 +#ifndef __ASSEMBLY__
 +#ifdef CONFIG_XEN
 +
++#define INVALID_P2M_ENTRY	(~0UL)
++
 +#include <linux/kernel.h>
 +#include <asm/hypervisor.h>
 +#include <xen/features.h>	// to compile netback, netfront
++typedef unsigned long maddr_t;	// to compile netback, netfront
 +
 +/*
 + * XXX hack!
@@ -78062,42 +77984,100 @@
 +})
 +#define HAVE_ARCH_FREE_PAGE
 +
-+#include <asm/maddr.h>
-+
-+#endif /* CONFIG_XEN */
-+#endif /* __ASSEMBLY__ */
++/* XXX xen page size != page size */
 +
- # endif /* __KERNEL__ */
- #endif /* _ASM_IA64_PAGE_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/pal.h linux-2.6.18-rc6-xen/include/asm-ia64/pal.h
---- linux-2.6.18-rc6/include/asm-ia64/pal.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/pal.h	2006-09-04 16:31:16.000000000 +0200
-@@ -82,6 +82,7 @@
- #ifndef __ASSEMBLY__
++static inline unsigned long
++pfn_to_mfn_for_dma(unsigned long pfn)
++{
++	unsigned long mfn;
++	mfn = HYPERVISOR_phystomach(pfn);
++	BUG_ON(mfn == 0); // XXX
++	BUG_ON(mfn == INVALID_P2M_ENTRY); // XXX
++	BUG_ON(mfn == INVALID_MFN);
++	return mfn;
++}
++
++static inline unsigned long
++phys_to_machine_for_dma(unsigned long phys)
++{
++	unsigned long machine =
++	              pfn_to_mfn_for_dma(phys >> PAGE_SHIFT) << PAGE_SHIFT;
++	machine |= (phys & ~PAGE_MASK);
++	return machine;
++}
++
++static inline unsigned long
++mfn_to_pfn_for_dma(unsigned long mfn)
++{
++	unsigned long pfn;
++	pfn = HYPERVISOR_machtophys(mfn);
++	BUG_ON(pfn == 0);
++	//BUG_ON(pfn == INVALID_M2P_ENTRY);
++	return pfn;
++}
++
++static inline unsigned long
++machine_to_phys_for_dma(unsigned long machine)
++{
++	unsigned long phys =
++	              mfn_to_pfn_for_dma(machine >> PAGE_SHIFT) << PAGE_SHIFT;
++	phys |= (machine & ~PAGE_MASK);
++	return phys;
++}
++
++#define set_phys_to_machine(pfn, mfn) do { } while (0)
++#define xen_machphys_update(mfn, pfn) do { } while (0)
++
++/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
++#define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
++
++#define mfn_to_pfn(mfn)			(mfn)
++#define mfn_to_virt(mfn)		(__va((mfn) << PAGE_SHIFT))
++#define pfn_to_mfn(pfn)			(pfn)
++#define virt_to_mfn(virt)		(__pa(virt) >> PAGE_SHIFT)
++#define virt_to_machine(virt)		__pa(virt) // for tpmfront.c
++
++static inline unsigned long
++mfn_to_local_pfn(unsigned long mfn)
++{
++	extern unsigned long max_mapnr;
++	unsigned long pfn = mfn_to_pfn_for_dma(mfn);
++	if (!pfn_valid(pfn))
++		return INVALID_P2M_ENTRY;
++	return pfn;
++}
++
++#endif /* CONFIG_XEN */
++#endif /* __ASSEMBLY__ */
++
+ # endif /* __KERNEL__ */
+ #endif /* _ASM_IA64_PAGE_H */
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/pal.h linux-2.6.18-xen/include/asm-ia64/pal.h
+--- linux-2.6.18/include/asm-ia64/pal.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/pal.h	2006-09-17 17:44:50.000000000 +0200
+@@ -82,6 +82,7 @@
+ #ifndef __ASSEMBLY__
  
  #include <linux/types.h>
 +#include <asm/processor.h>
  #include <asm/fpu.h>
  
  /*
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/pgalloc.h linux-2.6.18-rc6-xen/include/asm-ia64/pgalloc.h
---- linux-2.6.18-rc6/include/asm-ia64/pgalloc.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/pgalloc.h	2006-09-04 16:31:16.000000000 +0200
-@@ -125,7 +125,11 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/pgalloc.h linux-2.6.18-xen/include/asm-ia64/pgalloc.h
+--- linux-2.6.18/include/asm-ia64/pgalloc.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/pgalloc.h	2006-07-07 20:51:43.000000000 +0200
+@@ -125,7 +125,7 @@
  static inline void
  pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte)
  {
-+#ifndef CONFIG_XEN
- 	pmd_val(*pmd_entry) = page_to_phys(pte);
-+#else
+-	pmd_val(*pmd_entry) = page_to_phys(pte);
 +	pmd_val(*pmd_entry) = page_to_pseudophys(pte);
-+#endif
  }
  
  static inline void
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/privop.h linux-2.6.18-rc6-xen/include/asm-ia64/privop.h
---- linux-2.6.18-rc6/include/asm-ia64/privop.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/privop.h	2006-09-04 16:31:17.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/privop.h linux-2.6.18-xen/include/asm-ia64/privop.h
+--- linux-2.6.18/include/asm-ia64/privop.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-ia64/privop.h	2006-07-07 20:51:43.000000000 +0200
 @@ -0,0 +1,59 @@
 +#ifndef _ASM_IA64_PRIVOP_H
 +#define _ASM_IA64_PRIVOP_H
@@ -78158,9 +78138,9 @@
 +#endif /* !__ASSEMBLY */
 +
 +#endif /* _ASM_IA64_PRIVOP_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/processor.h linux-2.6.18-rc6-xen/include/asm-ia64/processor.h
---- linux-2.6.18-rc6/include/asm-ia64/processor.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/processor.h	2006-09-04 16:31:17.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/processor.h linux-2.6.18-xen/include/asm-ia64/processor.h
+--- linux-2.6.18/include/asm-ia64/processor.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/processor.h	2006-07-07 20:51:43.000000000 +0200
 @@ -18,6 +18,7 @@
  #include <asm/kregs.h>
  #include <asm/ptrace.h>
@@ -78169,9 +78149,9 @@
  
  #define IA64_NUM_DBG_REGS	8
  /*
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/synch_bitops.h linux-2.6.18-rc6-xen/include/asm-ia64/synch_bitops.h
---- linux-2.6.18-rc6/include/asm-ia64/synch_bitops.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/synch_bitops.h	2006-09-04 16:31:17.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/synch_bitops.h linux-2.6.18-xen/include/asm-ia64/synch_bitops.h
+--- linux-2.6.18/include/asm-ia64/synch_bitops.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-ia64/synch_bitops.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,61 @@
 +#ifndef __XEN_SYNCH_BITOPS_H__
 +#define __XEN_SYNCH_BITOPS_H__
@@ -78234,9 +78214,9 @@
 +#define synch_cmpxchg_subword synch_cmpxchg
 +
 +#endif /* __XEN_SYNCH_BITOPS_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/system.h linux-2.6.18-rc6-xen/include/asm-ia64/system.h
---- linux-2.6.18-rc6/include/asm-ia64/system.h	2006-09-05 10:53:25.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/system.h	2006-09-04 16:31:17.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/system.h linux-2.6.18-xen/include/asm-ia64/system.h
+--- linux-2.6.18/include/asm-ia64/system.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-ia64/system.h	2006-09-17 17:44:50.000000000 +0200
 @@ -123,7 +123,7 @@
  #define __local_irq_save(x)			\
  do {						\
@@ -78255,9 +78235,9 @@
  
  #define irqs_disabled()				\
  ({						\
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-ia64/xen/privop.h linux-2.6.18-rc6-xen/include/asm-ia64/xen/privop.h
---- linux-2.6.18-rc6/include/asm-ia64/xen/privop.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-ia64/xen/privop.h	2006-09-04 16:31:17.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-ia64/xen/privop.h linux-2.6.18-xen/include/asm-ia64/xen/privop.h
+--- linux-2.6.18/include/asm-ia64/xen/privop.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-ia64/xen/privop.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,304 @@
 +#ifndef _ASM_IA64_XEN_PRIVOP_H
 +#define _ASM_IA64_XEN_PRIVOP_H
@@ -78563,9 +78543,9 @@
 +#define	ia64_pal_call_static		xen_pal_call_static
 +
 +#endif /* _ASM_IA64_XEN_PRIVOP_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-um/page.h linux-2.6.18-rc6-xen/include/asm-um/page.h
---- linux-2.6.18-rc6/include/asm-um/page.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-um/page.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-um/page.h linux-2.6.18-xen/include/asm-um/page.h
+--- linux-2.6.18/include/asm-um/page.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-um/page.h	2006-07-07 20:51:46.000000000 +0200
 @@ -114,7 +114,7 @@
  extern struct page *arch_validate(struct page *page, gfp_t mask, int order);
  #define HAVE_ARCH_VALIDATE
@@ -78575,9 +78555,9 @@
  #define HAVE_ARCH_FREE_PAGE
  
  #include <asm-generic/memory_model.h>
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/apic.h linux-2.6.18-rc6-xen/include/asm-x86_64/apic.h
---- linux-2.6.18-rc6/include/asm-x86_64/apic.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/apic.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/apic.h linux-2.6.18-xen/include/asm-x86_64/apic.h
+--- linux-2.6.18/include/asm-x86_64/apic.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/asm-x86_64/apic.h	2006-08-15 13:03:31.000000000 +0200
 @@ -98,11 +98,13 @@
  extern int disable_timer_pin_1;
  
@@ -78592,9 +78572,9 @@
  
  #endif /* CONFIG_X86_LOCAL_APIC */
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/arch_hooks.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/arch_hooks.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/arch_hooks.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/arch_hooks.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/arch_hooks.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/arch_hooks.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/arch_hooks.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/arch_hooks.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,27 @@
 +#ifndef _ASM_ARCH_HOOKS_H
 +#define _ASM_ARCH_HOOKS_H
@@ -78623,9 +78603,9 @@
 +extern void mca_nmi_hook(void);
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/bootsetup.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/bootsetup.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/bootsetup.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/bootsetup.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/bootsetup.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/bootsetup.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/bootsetup.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/bootsetup.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,42 @@
 +
 +#ifndef _X86_64_BOOTSETUP_H
@@ -78669,9 +78649,9 @@
 +#define RAMDISK_LOAD_FLAG		0x4000	
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/desc.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/desc.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/desc.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/desc.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/desc.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/desc.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/desc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/desc.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,263 @@
 +/* Written 2000 by Andi Kleen */ 
 +#ifndef __ARCH_DESC_H
@@ -78936,10 +78916,10 @@
 +#endif /* !__ASSEMBLY__ */
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/dma-mapping.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/dma-mapping.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/dma-mapping.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/dma-mapping.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,208 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/dma-mapping.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/dma-mapping.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/dma-mapping.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/dma-mapping.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,207 @@
 +#ifndef _X8664_DMA_MAPPING_H
 +#define _X8664_DMA_MAPPING_H 1
 +
@@ -79142,15 +79122,14 @@
 +
 +extern struct device fallback_dev;
 +#endif
-+
 +extern int panic_on_overflow;
 +
 +#endif /* _X8664_DMA_MAPPING_H */
 +
 +#include <asm-i386/mach-xen/asm/dma-mapping.h>
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/dmi.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/dmi.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/dmi.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/dmi.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/dmi.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/dmi.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/dmi.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/dmi.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,29 @@
 +#ifndef _ASM_DMI_H
 +#define _ASM_DMI_H 1
@@ -79181,10 +79160,10 @@
 +#define dmi_iounmap bt_iounmap
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/e820.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/e820.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/e820.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/e820.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,64 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/e820.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/e820.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/e820.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/e820.h	2006-06-19 13:20:42.000000000 +0200
+@@ -0,0 +1,63 @@
 +/*
 + * structures and definitions for the int 15, ax=e820 memory map
 + * scheme.
@@ -79234,8 +79213,7 @@
 +extern unsigned long e820_end_of_ram(void);
 +extern void e820_reserve_resources(struct e820entry *e820, int nr_map);
 +extern void e820_print_map(char *who);
-+extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type);
-+extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type);
++extern int e820_mapped(unsigned long start, unsigned long end, unsigned type);
 +
 +extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end);
 +extern void e820_setup_gap(struct e820entry *e820, int nr_map);
@@ -79249,9 +79227,9 @@
 +#endif/*!__ASSEMBLY__*/
 +
 +#endif/*__E820_HEADER*/
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/fixmap.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/fixmap.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/fixmap.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/fixmap.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/fixmap.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/fixmap.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/fixmap.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/fixmap.h	2006-07-07 20:51:46.000000000 +0200
 @@ -0,0 +1,113 @@
 +/*
 + * fixmap.h: compile-time virtual memory allocation
@@ -79366,9 +79344,9 @@
 +}
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/floppy.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/floppy.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/floppy.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/floppy.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/floppy.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/floppy.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/floppy.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/floppy.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,206 @@
 +/*
 + * Architecture specific parts of the Floppy driver
@@ -79506,8 +79484,8 @@
 +
 +static int fd_request_irq(void)
 +{
-+	return request_irq(FLOPPY_IRQ, floppy_hardint,
-+			   IRQF_DISABLED, "floppy", NULL);
++	return request_irq(FLOPPY_IRQ, floppy_hardint, IRQF_DISABLED,
++			   "floppy", NULL);
 +}
 +
 +#if 0
@@ -79576,9 +79554,9 @@
 +#define EXTRA_FLOPPY_PARAMS
 +
 +#endif /* __ASM_XEN_X86_64_FLOPPY_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/hw_irq.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/hw_irq.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/hw_irq.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/hw_irq.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/hw_irq.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/hw_irq.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/hw_irq.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/hw_irq.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,136 @@
 +#ifndef _ASM_HW_IRQ_H
 +#define _ASM_HW_IRQ_H
@@ -79708,7 +79686,7 @@
 +__asm__( \
 +"\n.p2align\n" \
 +"IRQ" #nr "_interrupt:\n\t" \
-+	"push $" #nr "-256 ; " \
++	"push $~(" #nr ") ; " \
 +	"jmp common_interrupt");
 +
 +#define platform_legacy_irq(irq)	((irq) < 16)
@@ -79716,10 +79694,10 @@
 +#endif
 +
 +#endif /* _ASM_HW_IRQ_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/hypercall.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/hypercall.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/hypercall.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/hypercall.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,389 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/hypercall.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/hypercall.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/hypercall.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/hypercall.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,379 @@
 +/******************************************************************************
 + * hypercall.h
 + * 
@@ -79768,21 +79746,11 @@
 +#define __STR(x) #x
 +#define STR(x) __STR(x)
 +
-+#ifdef CONFIG_XEN
-+#define HYPERCALL_STR(name)					\
-+	"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
-+#else
-+#define HYPERCALL_STR(name)					\
-+	"mov hypercall_stubs,%%rax; "				\
-+	"add $("STR(__HYPERVISOR_##name)" * 32),%%rax; "	\
-+	"call *%%rax"
-+#endif
-+
 +#define _hypercall0(type, name)			\
 +({						\
 +	long __res;				\
 +	asm volatile (				\
-+		HYPERCALL_STR(name)		\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res)			\
 +		:				\
 +		: "memory" );			\
@@ -79793,7 +79761,7 @@
 +({								\
 +	long __res, __ign1;					\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=D" (__ign1)			\
 +		: "1" ((long)(a1))				\
 +		: "memory" );					\
@@ -79804,7 +79772,7 @@
 +({								\
 +	long __res, __ign1, __ign2;				\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=D" (__ign1), "=S" (__ign2)	\
 +		: "1" ((long)(a1)), "2" ((long)(a2))		\
 +		: "memory" );					\
@@ -79815,7 +79783,7 @@
 +({								\
 +	long __res, __ign1, __ign2, __ign3;			\
 +	asm volatile (						\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=D" (__ign1), "=S" (__ign2), 	\
 +		"=d" (__ign3)					\
 +		: "1" ((long)(a1)), "2" ((long)(a2)),		\
@@ -79829,7 +79797,7 @@
 +	long __res, __ign1, __ign2, __ign3;			\
 +	asm volatile (						\
 +		"movq %7,%%r10; "				\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=D" (__ign1), "=S" (__ign2),	\
 +		"=d" (__ign3)					\
 +		: "1" ((long)(a1)), "2" ((long)(a2)),		\
@@ -79843,7 +79811,7 @@
 +	long __res, __ign1, __ign2, __ign3;			\
 +	asm volatile (						\
 +		"movq %7,%%r10; movq %8,%%r8; "			\
-+		HYPERCALL_STR(name)				\
++		"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\
 +		: "=a" (__res), "=D" (__ign1), "=S" (__ign2),	\
 +		"=d" (__ign3)					\
 +		: "1" ((long)(a1)), "2" ((long)(a2)),		\
@@ -80109,15 +80077,15 @@
 +}
 +
 +#endif /* __HYPERCALL_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/hypervisor.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/hypervisor.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/hypervisor.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/hypervisor.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/hypervisor.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/hypervisor.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/hypervisor.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/hypervisor.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +#include <asm-i386/mach-xen/asm/hypervisor.h>
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/io.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/io.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/io.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/io.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/io.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/io.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/io.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/io.h	2006-07-07 20:51:46.000000000 +0200
 @@ -0,0 +1,327 @@
 +#ifndef _ASM_IO_H
 +#define _ASM_IO_H
@@ -80446,9 +80414,9 @@
 +#define ARCH_HAS_DEV_MEM
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/irqflags.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/irqflags.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/irqflags.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/irqflags.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/irqflags.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/irqflags.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/irqflags.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/irqflags.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,65 @@
 +/*
 + * include/asm-x86_64/irqflags.h
@@ -80515,9 +80483,9 @@
 +#endif
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/irq.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/irq.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/irq.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/irq.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/irq.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/irq.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/irq.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/irq.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,38 @@
 +#ifndef _ASM_IRQ_H
 +#define _ASM_IRQ_H
@@ -80557,9 +80525,9 @@
 +#define __ARCH_HAS_DO_SOFTIRQ 1
 +
 +#endif /* _ASM_IRQ_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/maddr.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/maddr.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/maddr.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/maddr.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/maddr.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/maddr.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/maddr.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/maddr.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,139 @@
 +#ifndef _X86_64_MADDR_H
 +#define _X86_64_MADDR_H
@@ -80700,9 +80668,9 @@
 +
 +#endif /* _X86_64_MADDR_H */
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/mmu_context.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/mmu_context.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/mmu_context.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/mmu_context.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/mmu_context.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/mmu_context.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/mmu_context.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/mmu_context.h	2006-07-07 20:51:46.000000000 +0200
 @@ -0,0 +1,135 @@
 +#ifndef __X86_64_MMU_CONTEXT_H
 +#define __X86_64_MMU_CONTEXT_H
@@ -80839,9 +80807,9 @@
 +}
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/mmu.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/mmu.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/mmu.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/mmu.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/mmu.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/mmu.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/mmu.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/mmu.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,38 @@
 +#ifndef __x86_64_MMU_H
 +#define __x86_64_MMU_H
@@ -80881,9 +80849,9 @@
 +#endif
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/msr.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/msr.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/msr.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/msr.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/msr.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/msr.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/msr.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/msr.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,399 @@
 +#ifndef X86_64_MSR_H
 +#define X86_64_MSR_H 1
@@ -81284,9 +81252,9 @@
 +#define MSR_P4_U2L_ESCR1 		0x3b1
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/nmi.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/nmi.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/nmi.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/nmi.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/nmi.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/nmi.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/nmi.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/nmi.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,93 @@
 +/*
 + *  linux/include/asm-i386/nmi.h
@@ -81319,7 +81287,7 @@
 +void unset_nmi_callback(void);
 +
 +#ifdef CONFIG_PM
-+ 
++
 +/** Replace the PM callback routine for NMI. */
 +struct pm_dev * set_nmi_pm_callback(pm_callback callback);
 +
@@ -81332,13 +81300,13 @@
 +{
 +	return 0;
 +} 
-+ 
++
 +static inline void unset_nmi_pm_callback(struct pm_dev * dev)
 +{
 +}
 +
 +#endif /* CONFIG_PM */
-+ 
++
 +extern void default_do_nmi(struct pt_regs *);
 +extern void die_nmi(char *str, struct pt_regs *regs);
 +
@@ -81362,7 +81330,7 @@
 +extern int unknown_nmi_panic;
 +
 +extern int check_nmi_watchdog(void);
-+ 
++
 +extern void setup_apic_nmi_watchdog (void);
 +extern int reserve_lapic_nmi(void);
 +extern void release_lapic_nmi(void);
@@ -81381,9 +81349,9 @@
 +#define NMI_INVALID	3
 +
 +#endif /* ASM_NMI_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/page.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/page.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/page.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/page.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/page.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/page.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/page.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/page.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,208 @@
 +#ifndef _X86_64_PAGE_H
 +#define _X86_64_PAGE_H
@@ -81593,9 +81561,9 @@
 +#endif /* __KERNEL__ */
 +
 +#endif /* _X86_64_PAGE_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/param.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/param.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/param.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/param.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/param.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/param.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/param.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/param.h	2006-07-07 20:51:46.000000000 +0200
 @@ -0,0 +1,22 @@
 +#ifndef _ASMx86_64_PARAM_H
 +#define _ASMx86_64_PARAM_H
@@ -81619,9 +81587,9 @@
 +#define MAXHOSTNAMELEN	64	/* max length of hostname */
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/pci.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/pci.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/pci.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/pci.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/pci.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pci.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/pci.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pci.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,173 @@
 +#ifndef __x8664_PCI_H
 +#define __x8664_PCI_H
@@ -81796,9 +81764,9 @@
 +#define pcibios_scan_all_fns(a, b)	1
 +
 +#endif /* __x8664_PCI_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/pgalloc.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/pgalloc.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/pgalloc.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/pgalloc.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/pgalloc.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pgalloc.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/pgalloc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pgalloc.h	2006-05-26 22:00:53.000000000 +0200
 @@ -0,0 +1,226 @@
 +#ifndef _X86_64_PGALLOC_H
 +#define _X86_64_PGALLOC_H
@@ -82026,10 +81994,10 @@
 +#define __pud_free_tlb(tlb,x)   pud_free((x))
 +
 +#endif /* _X86_64_PGALLOC_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/pgtable.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/pgtable.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/pgtable.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/pgtable.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,558 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/pgtable.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pgtable.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/pgtable.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pgtable.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,559 @@
 +#ifndef _X86_64_PGTABLE_H
 +#define _X86_64_PGTABLE_H
 +
@@ -82238,7 +82206,7 @@
 +#define _PAGE_NX        (1UL<<_PAGE_BIT_NX)
 +
 +#define _PAGE_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
-+#define _KERNPG_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
++#define _KERNPG_TABLE	_PAGE_TABLE
 +
 +#define _PAGE_CHG_MASK	(PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 +
@@ -82251,21 +82219,22 @@
 +#define PAGE_READONLY	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
 +#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
 +#define __PAGE_KERNEL \
-+	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
++	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX | _PAGE_USER )
 +#define __PAGE_KERNEL_EXEC \
-+	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
++	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER )
 +#define __PAGE_KERNEL_NOCACHE \
-+	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED | _PAGE_NX)
++	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED | _PAGE_NX | _PAGE_USER )
 +#define __PAGE_KERNEL_RO \
-+	(_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
++	(_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX | _PAGE_USER )
 +#define __PAGE_KERNEL_VSYSCALL \
-+	(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
++	(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_USER )
 +#define __PAGE_KERNEL_VSYSCALL_NOCACHE \
-+	(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD)
++	(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD | _PAGE_USER )
 +#define __PAGE_KERNEL_LARGE \
-+	(__PAGE_KERNEL | _PAGE_PSE)
++	(__PAGE_KERNEL | _PAGE_PSE | _PAGE_USER )
 +#define __PAGE_KERNEL_LARGE_EXEC \
-+	(__PAGE_KERNEL_EXEC | _PAGE_PSE)
++	(__PAGE_KERNEL_EXEC | _PAGE_PSE | _PAGE_USER )
++
 +
 +/*
 + * We don't support GLOBAL page in xenolinux64
@@ -82450,7 +82419,7 @@
 +   can temporarily clear it. */
 +#define pmd_present(x)	(pmd_val(x))
 +#define pmd_clear(xp)	do { set_pmd(xp, __pmd(0)); } while (0)
-+#define	pmd_bad(x)	((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PRESENT)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
++#define	pmd_bad(x)	((pmd_val(x) & (~PAGE_MASK & ~_PAGE_PRESENT)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
 +#define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot)))
 +#define pmd_pfn(x)  ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT)
 +
@@ -82588,10 +82557,10 @@
 +#include <asm-generic/pgtable.h>
 +
 +#endif /* _X86_64_PGTABLE_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/processor.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/processor.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/processor.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/processor.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,504 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/processor.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/processor.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/processor.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/processor.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,503 @@
 +/*
 + * include/asm-x86_64/processor.h
 + *
@@ -82838,7 +82807,6 @@
 +DECLARE_PER_CPU(struct tss_struct,init_tss);
 +#endif
 +
-+
 +extern struct cpuinfo_x86 boot_cpu_data;
 +/* Save the original ist values for checking stack pointers during debugging */
 +struct orig_ist {
@@ -83096,9 +83064,9 @@
 +#define HAVE_ARCH_PICK_MMAP_LAYOUT 1
 +
 +#endif /* __ASM_X86_64_PROCESSOR_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/ptrace.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/ptrace.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/ptrace.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/ptrace.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/ptrace.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/ptrace.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/ptrace.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/ptrace.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,125 @@
 +#ifndef _X86_64_PTRACE_H
 +#define _X86_64_PTRACE_H
@@ -83225,9 +83193,9 @@
 +#endif
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/smp.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/smp.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/smp.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/smp.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/smp.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/smp.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/smp.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/smp.h	2006-08-15 13:03:31.000000000 +0200
 @@ -0,0 +1,150 @@
 +#ifndef __ASM_SMP_H
 +#define __ASM_SMP_H
@@ -83379,21 +83347,22 @@
 +
 +#endif
 +
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/synch_bitops.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/synch_bitops.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/synch_bitops.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/synch_bitops.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/synch_bitops.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/synch_bitops.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/synch_bitops.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/synch_bitops.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,2 @@
 +
 +#include <asm-i386/mach-xen/asm/synch_bitops.h>
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/system.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/system.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/system.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/system.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,264 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/system.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/system.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/system.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/system.h	2006-08-15 13:03:31.000000000 +0200
+@@ -0,0 +1,265 @@
 +#ifndef __ASM_SYSTEM_H
 +#define __ASM_SYSTEM_H
 +
 +#include <linux/kernel.h>
 +#include <asm/segment.h>
++#include <asm/alternative.h>
 +#include <asm/synch_bitops.h>
 +#include <asm/hypervisor.h>
 +#include <xen/interface/arch-x86_64.h>
@@ -83653,9 +83622,9 @@
 +extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/timer.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/timer.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/timer.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/timer.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/timer.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/timer.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/timer.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/timer.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,67 @@
 +#ifndef _ASMi386_TIMER_H
 +#define _ASMi386_TIMER_H
@@ -83724,9 +83693,9 @@
 +extern struct init_timer_opts timer_pmtmr_init;
 +#endif
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/tlbflush.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/tlbflush.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/tlbflush.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/tlbflush.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/tlbflush.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/tlbflush.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/tlbflush.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/tlbflush.h	2006-07-07 20:51:46.000000000 +0200
 @@ -0,0 +1,103 @@
 +#ifndef _X8664_TLBFLUSH_H
 +#define _X8664_TLBFLUSH_H
@@ -83831,9 +83800,9 @@
 +}
 +
 +#endif /* _X8664_TLBFLUSH_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/vga.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/vga.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/vga.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/vga.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/vga.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/vga.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/vga.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/vga.h	2006-07-07 20:51:46.000000000 +0200
 @@ -0,0 +1,20 @@
 +/*
 + *	Access to VGA videoram
@@ -83855,9 +83824,9 @@
 +#define vga_writeb(x,y) (*(y) = (x))
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/xor.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/xor.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/asm/xor.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/asm/xor.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/asm/xor.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/xor.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/asm/xor.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/xor.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,328 @@
 +/*
 + * x86-64 changes / gcc fixes from Andi Kleen. 
@@ -84187,9 +84156,9 @@
 +   We may also be able to load into the L1 only depending on how the cpu
 +   deals with a load to a line that is being prefetched.  */
 +#define XOR_SELECT_TEMPLATE(FASTEST) (&xor_block_sse)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/irq_vectors.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/irq_vectors.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/irq_vectors.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/irq_vectors.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/irq_vectors.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/irq_vectors.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/irq_vectors.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/irq_vectors.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,123 @@
 +/*
 + * This file should contain #defines for all of the interrupt vector
@@ -84314,9 +84283,9 @@
 +#define irq_to_dynirq(_x)	((_x) - DYNIRQ_BASE)
 +
 +#endif /* _ASM_IRQ_VECTORS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/mach_time.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/mach_time.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/mach_time.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/mach_time.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/mach_time.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/mach_time.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/mach_time.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/mach_time.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,111 @@
 +/*
 + *  include/asm-i386/mach-default/mach_time.h
@@ -84429,9 +84398,9 @@
 +}
 +
 +#endif /* !_MACH_TIME_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/mach_timer.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/mach_timer.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/mach_timer.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/mach_timer.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/mach_timer.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/mach_timer.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/mach_timer.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/mach_timer.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,48 @@
 +/*
 + *  include/asm-i386/mach-default/mach_timer.h
@@ -84481,9 +84450,9 @@
 +}
 +
 +#endif /* !_MACH_TIMER_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/setup_arch_post.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/setup_arch_post.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/setup_arch_post.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/setup_arch_post.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/setup_arch_post.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/setup_arch_post.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/setup_arch_post.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/setup_arch_post.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,58 @@
 +/**
 + * machine_specific_* - Hooks for machine specific setup.
@@ -84543,112 +84512,50 @@
 +	}
 +#endif
 +}
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/asm-x86_64/mach-xen/setup_arch_pre.h linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/setup_arch_pre.h
---- linux-2.6.18-rc6/include/asm-x86_64/mach-xen/setup_arch_pre.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/asm-x86_64/mach-xen/setup_arch_pre.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/asm-x86_64/mach-xen/setup_arch_pre.h linux-2.6.18-xen/include/asm-x86_64/mach-xen/setup_arch_pre.h
+--- linux-2.6.18/include/asm-x86_64/mach-xen/setup_arch_pre.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/asm-x86_64/mach-xen/setup_arch_pre.h	2006-05-26 22:00:54.000000000 +0200
 @@ -0,0 +1,5 @@
 +/* Hook to call BIOS initialisation function */
 +
 +#define ARCH_SETUP machine_specific_arch_setup();
 +
 +static void __init machine_specific_arch_setup(void);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/elfnote.h linux-2.6.18-rc6-xen/include/linux/elfnote.h
---- linux-2.6.18-rc6/include/linux/elfnote.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/linux/elfnote.h	2006-09-04 16:31:18.000000000 +0200
-@@ -0,0 +1,90 @@
-+#ifndef _LINUX_ELFNOTE_H
-+#define _LINUX_ELFNOTE_H
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/aio.h linux-2.6.18-xen/include/linux/aio.h
+--- linux-2.6.18/include/linux/aio.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/aio.h	2006-08-15 13:03:31.000000000 +0200
+@@ -191,6 +191,11 @@
+ 	struct aio_ring_info	ring_info;
+ 
+ 	struct work_struct	wq;
++#ifdef CONFIG_EPOLL
++	// poll integration
++	wait_queue_head_t       poll_wait;
++	struct file		*file;
++#endif
+ };
+ 
+ /* prototypes */
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/eventpoll.h linux-2.6.18-xen/include/linux/eventpoll.h
+--- linux-2.6.18/include/linux/eventpoll.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/eventpoll.h	2006-08-15 13:03:31.000000000 +0200
+@@ -90,6 +90,13 @@
+ 	eventpoll_release_file(file);
+ }
+ 
++
 +/*
-+ * Helper macros to generate ELF Note structures, which are put into a
-+ * PT_NOTE segment of the final vmlinux image.  These are useful for
-+ * including name-value pairs of metadata into the kernel binary (or
-+ * modules?) for use by external programs.
-+ *
-+ * Each note has three parts: a name, a type and a desc.  The name is
-+ * intended to distinguish the note's originator, so it would be a
-+ * company, project, subsystem, etc; it must be in a suitable form for
-+ * use in a section name.  The type is an integer which is used to tag
-+ * the data, and is considered to be within the "name" namespace (so
-+ * "FooCo"'s type 42 is distinct from "BarProj"'s type 42).  The
-+ * "desc" field is the actual data.  There are no constraints on the
-+ * desc field's contents, though typically they're fairly small.
-+ *
-+ * All notes from a given NAME are put into a section named
-+ * .note.NAME.  When the kernel image is finally linked, all the notes
-+ * are packed into a single .notes section, which is mapped into the
-+ * PT_NOTE segment.  Because notes for a given name are grouped into
-+ * the same section, they'll all be adjacent the output file.
-+ *
-+ * This file defines macros for both C and assembler use.  Their
-+ * syntax is slightly different, but they're semantically similar.
-+ *
-+ * See the ELF specification for more detail about ELF notes.
-+ */
-+
-+#ifdef __ASSEMBLER__
-+/*
-+ * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
-+ * turn out to be the same size and shape), followed by the name and
-+ * desc data with appropriate padding.  The 'desctype' argument is the
-+ * assembler pseudo op defining the type of the data e.g. .asciz while
-+ * 'descdata' is the data itself e.g.  "hello, world".
-+ *
-+ * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
-+ *      ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
-+ */
-+#define ELFNOTE(name, type, desctype, descdata)	\
-+.pushsection .note.name			;	\
-+  .align 4				;	\
-+  .long 2f - 1f		/* namesz */	;	\
-+  .long 4f - 3f		/* descsz */	;	\
-+  .long type				;	\
-+1:.asciz "name"				;	\
-+2:.align 4				;	\
-+3:desctype descdata			;	\
-+4:.align 4				;	\
-+.popsection				;
-+#else	/* !__ASSEMBLER__ */
-+#include <linux/elf.h>
-+/*
-+ * Use an anonymous structure which matches the shape of
-+ * Elf{32,64}_Nhdr, but includes the name and desc data.  The size and
-+ * type of name and desc depend on the macro arguments.  "name" must
-+ * be a literal string, and "desc" must be passed by value.  You may
-+ * only define one note per line, since __LINE__ is used to generate
-+ * unique symbols.
-+ */
-+#define _ELFNOTE_PASTE(a,b)	a##b
-+#define _ELFNOTE(size, name, unique, type, desc)			\
-+	static const struct {						\
-+		struct elf##size##_note _nhdr;				\
-+		unsigned char _name[sizeof(name)]			\
-+		__attribute__((aligned(sizeof(Elf##size##_Word))));	\
-+		typeof(desc) _desc					\
-+			     __attribute__((aligned(sizeof(Elf##size##_Word)))); \
-+	} _ELFNOTE_PASTE(_note_, unique)				\
-+		__attribute_used__					\
-+		__attribute__((section(".note." name),			\
-+			       aligned(sizeof(Elf##size##_Word)),	\
-+			       unused)) = {				\
-+		{							\
-+			sizeof(name),					\
-+			sizeof(desc),					\
-+			type,						\
-+		},							\
-+		name,							\
-+		desc							\
-+	}
-+#define ELFNOTE(size, name, type, desc)		\
-+	_ELFNOTE(size, name, __LINE__, type, desc)
-+
-+#define ELFNOTE32(name, type, desc) ELFNOTE(32, name, type, desc)
-+#define ELFNOTE64(name, type, desc) ELFNOTE(64, name, type, desc)
-+#endif	/* __ASSEMBLER__ */
-+
-+#endif /* _LINUX_ELFNOTE_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/gfp.h linux-2.6.18-rc6-xen/include/linux/gfp.h
---- linux-2.6.18-rc6/include/linux/gfp.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/linux/gfp.h	2006-09-04 16:31:18.000000000 +0200
++ * called by aio code to create fd that can poll the  aio event queueQ
++ */
++struct eventpoll;
++int ep_getfd(int *efd, struct inode **einode, struct file **efile,
++             struct eventpoll *ep, struct file_operations *fops);
+ #else
+ 
+ static inline void eventpoll_init_file(struct file *file) {}
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/gfp.h linux-2.6.18-xen/include/linux/gfp.h
+--- linux-2.6.18/include/linux/gfp.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/gfp.h	2006-07-07 20:51:47.000000000 +0200
 @@ -99,7 +99,11 @@
   */
  
@@ -84662,9 +84569,9 @@
  #endif
  
  extern struct page *
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/highmem.h linux-2.6.18-rc6-xen/include/linux/highmem.h
---- linux-2.6.18-rc6/include/linux/highmem.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/linux/highmem.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/highmem.h linux-2.6.18-xen/include/linux/highmem.h
+--- linux-2.6.18/include/linux/highmem.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/highmem.h	2006-07-07 20:51:47.000000000 +0200
 @@ -24,10 +24,16 @@
  
  /* declarations for linux/mm/highmem.c */
@@ -84682,9 +84589,9 @@
  
  static inline void *kmap(struct page *page)
  {
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/interrupt.h linux-2.6.18-rc6-xen/include/linux/interrupt.h
---- linux-2.6.18-rc6/include/linux/interrupt.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/linux/interrupt.h	2006-09-04 16:31:18.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/interrupt.h linux-2.6.18-xen/include/linux/interrupt.h
+--- linux-2.6.18/include/linux/interrupt.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/interrupt.h	2006-08-15 13:03:31.000000000 +0200
 @@ -166,6 +166,12 @@
  
  #endif /* CONFIG_GENERIC_HARDIRQS */
@@ -84698,9 +84605,9 @@
  #ifndef __ARCH_SET_SOFTIRQ_PENDING
  #define set_softirq_pending(x) (local_softirq_pending() = (x))
  #define or_softirq_pending(x)  (local_softirq_pending() |= (x))
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/mm.h linux-2.6.18-rc6-xen/include/linux/mm.h
---- linux-2.6.18-rc6/include/linux/mm.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/linux/mm.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/mm.h linux-2.6.18-xen/include/linux/mm.h
+--- linux-2.6.18/include/linux/mm.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/mm.h	2006-09-17 17:44:50.000000000 +0200
 @@ -164,6 +164,9 @@
  #define VM_NONLINEAR	0x00800000	/* Is non-linear (remap_file_pages) */
  #define VM_MAPPED_COPY	0x01000000	/* T if mapped copy of data (nommu mmap) */
@@ -84725,9 +84632,9 @@
  #ifdef CONFIG_PROC_FS
  void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
  #else
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/oprofile.h linux-2.6.18-rc6-xen/include/linux/oprofile.h
---- linux-2.6.18-rc6/include/linux/oprofile.h	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/linux/oprofile.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/oprofile.h linux-2.6.18-xen/include/linux/oprofile.h
+--- linux-2.6.18/include/linux/oprofile.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/oprofile.h	2006-08-15 13:03:31.000000000 +0200
 @@ -16,6 +16,10 @@
  #include <linux/types.h>
  #include <linux/spinlock.h>
@@ -84760,9 +84667,20 @@
  
  /**
   * Create a file of the given name as a child of the given root, with
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/linux/skbuff.h linux-2.6.18-rc6-xen/include/linux/skbuff.h
---- linux-2.6.18-rc6/include/linux/skbuff.h	2006-09-05 10:53:26.000000000 +0200
-+++ linux-2.6.18-rc6-xen/include/linux/skbuff.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/pfn.h linux-2.6.18-xen/include/linux/pfn.h
+--- linux-2.6.18/include/linux/pfn.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/pfn.h	2006-05-26 22:00:56.000000000 +0200
+@@ -4,6 +4,6 @@
+ #define PFN_ALIGN(x)	(((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
+ #define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+ #define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
+-#define PFN_PHYS(x)	((x) << PAGE_SHIFT)
++#define PFN_PHYS(x)	((unsigned long long)(x) << PAGE_SHIFT)
+ 
+ #endif
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/linux/skbuff.h linux-2.6.18-xen/include/linux/skbuff.h
+--- linux-2.6.18/include/linux/skbuff.h	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/include/linux/skbuff.h	2006-09-17 17:44:50.000000000 +0200
 @@ -203,6 +203,8 @@
   *	@local_df: allow local fragmentation
   *	@cloned: Head may be cloned (check refcnt to be sure)
@@ -84814,10 +84732,10 @@
  
  /**
   *	dev_alloc_skb - allocate an skbuff for receiving
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/balloon.h linux-2.6.18-rc6-xen/include/xen/balloon.h
---- linux-2.6.18-rc6/include/xen/balloon.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/balloon.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,67 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/balloon.h linux-2.6.18-xen/include/xen/balloon.h
+--- linux-2.6.18/include/xen/balloon.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/balloon.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,65 @@
 +/******************************************************************************
 + * balloon.h
 + *
@@ -84858,23 +84776,21 @@
 + * Inform the balloon driver that it should allow some slop for device-driver
 + * memory activities.
 + */
-+void
++extern void
 +balloon_update_driver_allowance(
 +	long delta);
 +
 +/* Allocate an empty low-memory page range. */
-+struct page *
++extern struct page *
 +balloon_alloc_empty_page_range(
 +	unsigned long nr_pages);
 +
 +/* Deallocate an empty page range, adding to the balloon. */
-+void
++extern void
 +balloon_dealloc_empty_page_range(
 +	struct page *page, unsigned long nr_pages);
 +
-+void
-+balloon_release_driver_page(
-+	struct page *page);
++void balloon_release_driver_page(struct page *page);
 +
 +/*
 + * Prevent the balloon driver from changing the memory reservation during
@@ -84885,9 +84801,9 @@
 +#define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags)
 +
 +#endif /* __ASM_BALLOON_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/cpu_hotplug.h linux-2.6.18-rc6-xen/include/xen/cpu_hotplug.h
---- linux-2.6.18-rc6/include/xen/cpu_hotplug.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/cpu_hotplug.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/cpu_hotplug.h linux-2.6.18-xen/include/xen/cpu_hotplug.h
+--- linux-2.6.18/include/xen/cpu_hotplug.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/cpu_hotplug.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,43 @@
 +#ifndef __XEN_CPU_HOTPLUG_H__
 +#define __XEN_CPU_HOTPLUG_H__
@@ -84932,9 +84848,9 @@
 +#endif /* !defined(CONFIG_HOTPLUG_CPU) */
 +
 +#endif /* __XEN_CPU_HOTPLUG_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/driver_util.h linux-2.6.18-rc6-xen/include/xen/driver_util.h
---- linux-2.6.18-rc6/include/xen/driver_util.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/driver_util.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/driver_util.h linux-2.6.18-xen/include/xen/driver_util.h
+--- linux-2.6.18/include/xen/driver_util.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/driver_util.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,15 @@
 +
 +#ifndef __ASM_XEN_DRIVER_UTIL_H__
@@ -84951,9 +84867,9 @@
 +extern void unlock_vm_area(struct vm_struct *area);
 +
 +#endif /* __ASM_XEN_DRIVER_UTIL_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/evtchn.h linux-2.6.18-rc6-xen/include/xen/evtchn.h
---- linux-2.6.18-rc6/include/xen/evtchn.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/evtchn.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/evtchn.h linux-2.6.18-xen/include/xen/evtchn.h
+--- linux-2.6.18/include/xen/evtchn.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/evtchn.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,113 @@
 +/******************************************************************************
 + * evtchn.h
@@ -85068,9 +84984,9 @@
 +extern void notify_remote_via_irq(int irq);
 +
 +#endif /* __ASM_EVTCHN_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/features.h linux-2.6.18-rc6-xen/include/xen/features.h
---- linux-2.6.18-rc6/include/xen/features.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/features.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/features.h linux-2.6.18-xen/include/xen/features.h
+--- linux-2.6.18/include/xen/features.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/features.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,20 @@
 +/******************************************************************************
 + * features.h
@@ -85092,9 +85008,9 @@
 +#define xen_feature(flag)	(xen_features[flag])
 +
 +#endif /* __ASM_XEN_FEATURES_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/foreign_page.h linux-2.6.18-rc6-xen/include/xen/foreign_page.h
---- linux-2.6.18-rc6/include/xen/foreign_page.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/foreign_page.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/foreign_page.h linux-2.6.18-xen/include/xen/foreign_page.h
+--- linux-2.6.18/include/xen/foreign_page.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/foreign_page.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,30 @@
 +/******************************************************************************
 + * foreign_page.h
@@ -85126,9 +85042,9 @@
 +	( (void (*) (struct page *)) (page)->mapping )
 +
 +#endif /* __ASM_XEN_FOREIGN_PAGE_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/gnttab.h linux-2.6.18-rc6-xen/include/xen/gnttab.h
---- linux-2.6.18-rc6/include/xen/gnttab.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/gnttab.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/gnttab.h linux-2.6.18-xen/include/xen/gnttab.h
+--- linux-2.6.18/include/xen/gnttab.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/gnttab.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,150 @@
 +/******************************************************************************
 + * gnttab.h
@@ -85280,9 +85196,9 @@
 +}
 +
 +#endif /* __ASM_GNTTAB_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/hvm.h linux-2.6.18-rc6-xen/include/xen/hvm.h
---- linux-2.6.18-rc6/include/xen/hvm.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/hvm.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/hvm.h linux-2.6.18-xen/include/xen/hvm.h
+--- linux-2.6.18/include/xen/hvm.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/hvm.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,24 @@
 +/* Simple wrappers around HVM functions */
 +#ifndef XEN_HVM_H__
@@ -85308,9 +85224,9 @@
 +}
 +
 +#endif /* XEN_HVM_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/hypervisor_sysfs.h linux-2.6.18-rc6-xen/include/xen/hypervisor_sysfs.h
---- linux-2.6.18-rc6/include/xen/hypervisor_sysfs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/hypervisor_sysfs.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/hypervisor_sysfs.h linux-2.6.18-xen/include/xen/hypervisor_sysfs.h
+--- linux-2.6.18/include/xen/hypervisor_sysfs.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/hypervisor_sysfs.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,32 @@
 +/*
 + *  copyright (c) 2006 IBM Corporation
@@ -85344,10 +85260,10 @@
 +};
 +
 +#endif /* _HYP_SYSFS_H_ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/acm.h linux-2.6.18-rc6-xen/include/xen/interface/acm.h
---- linux-2.6.18-rc6/include/xen/interface/acm.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/acm.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,187 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/acm.h linux-2.6.18-xen/include/xen/interface/acm.h
+--- linux-2.6.18/include/xen/interface/acm.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/acm.h	2006-07-07 20:51:48.000000000 +0200
+@@ -0,0 +1,188 @@
 +/*
 + * acm.h: Xen access control module interface defintions
 + *
@@ -85359,6 +85275,7 @@
 +#define _XEN_PUBLIC_ACM_H
 +
 +#include "xen.h"
++#include "sched_ctl.h"
 +
 +/* if ACM_DEBUG defined, all hooks should
 + * print a short trace message (comment it out
@@ -85535,10 +85452,10 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/acm_ops.h linux-2.6.18-rc6-xen/include/xen/interface/acm_ops.h
---- linux-2.6.18-rc6/include/xen/interface/acm_ops.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/acm_ops.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,102 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/acm_ops.h linux-2.6.18-xen/include/xen/interface/acm_ops.h
+--- linux-2.6.18/include/xen/interface/acm_ops.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/acm_ops.h	2006-07-07 20:51:48.000000000 +0200
+@@ -0,0 +1,103 @@
 +/*
 + * acm_ops.h: Xen access control module hypervisor commands
 + *
@@ -85550,6 +85467,7 @@
 +#define __XEN_PUBLIC_ACM_OPS_H__
 +
 +#include "xen.h"
++#include "sched_ctl.h"
 +#include "acm.h"
 +
 +/*
@@ -85641,9 +85559,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/arch-ia64.h linux-2.6.18-rc6-xen/include/xen/interface/arch-ia64.h
---- linux-2.6.18-rc6/include/xen/interface/arch-ia64.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/arch-ia64.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/arch-ia64.h linux-2.6.18-xen/include/xen/interface/arch-ia64.h
+--- linux-2.6.18/include/xen/interface/arch-ia64.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/arch-ia64.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,448 @@
 +/******************************************************************************
 + * arch-ia64/hypervisor-if.h
@@ -86093,9 +86011,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/arch-powerpc.h linux-2.6.18-rc6-xen/include/xen/interface/arch-powerpc.h
---- linux-2.6.18-rc6/include/xen/interface/arch-powerpc.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/arch-powerpc.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/arch-powerpc.h linux-2.6.18-xen/include/xen/interface/arch-powerpc.h
+--- linux-2.6.18/include/xen/interface/arch-powerpc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/arch-powerpc.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,115 @@
 +/*
 + * This program is free software; you can redistribute it and/or modify
@@ -86212,10 +86130,10 @@
 +#endif
 +
 +#endif
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/arch-x86_32.h linux-2.6.18-rc6-xen/include/xen/interface/arch-x86_32.h
---- linux-2.6.18-rc6/include/xen/interface/arch-x86_32.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/arch-x86_32.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,255 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/arch-x86_32.h linux-2.6.18-xen/include/xen/interface/arch-x86_32.h
+--- linux-2.6.18/include/xen/interface/arch-x86_32.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/arch-x86_32.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,256 @@
 +/******************************************************************************
 + * arch-x86_32.h
 + * 
@@ -86245,6 +86163,7 @@
 +#define TRAP_INSTR "int $0x82"
 +#endif
 +
++
 +/* Structural guest handles introduced in 0x00030201. */
 +#if __XEN_INTERFACE_VERSION__ >= 0x00030201
 +#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
@@ -86471,9 +86390,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/arch-x86_64.h linux-2.6.18-rc6-xen/include/xen/interface/arch-x86_64.h
---- linux-2.6.18-rc6/include/xen/interface/arch-x86_64.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/arch-x86_64.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/arch-x86_64.h linux-2.6.18-xen/include/xen/interface/arch-x86_64.h
+--- linux-2.6.18/include/xen/interface/arch-x86_64.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/arch-x86_64.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,322 @@
 +/******************************************************************************
 + * arch-x86_64.h
@@ -86797,9 +86716,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/callback.h linux-2.6.18-rc6-xen/include/xen/interface/callback.h
---- linux-2.6.18-rc6/include/xen/interface/callback.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/callback.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/callback.h linux-2.6.18-xen/include/xen/interface/callback.h
+--- linux-2.6.18/include/xen/interface/callback.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/callback.h	2006-06-19 13:20:42.000000000 +0200
 @@ -0,0 +1,74 @@
 +/******************************************************************************
 + * callback.h
@@ -86875,162 +86794,98 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/dom0_ops.h linux-2.6.18-rc6-xen/include/xen/interface/dom0_ops.h
---- linux-2.6.18-rc6/include/xen/interface/dom0_ops.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/dom0_ops.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,102 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/dom0_ops.h linux-2.6.18-xen/include/xen/interface/dom0_ops.h
+--- linux-2.6.18/include/xen/interface/dom0_ops.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/dom0_ops.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,619 @@
 +/******************************************************************************
 + * dom0_ops.h
 + * 
 + * Process command requests from domain-0 guest OS.
 + * 
 + * Copyright (c) 2002-2003, B Dragovic
-+ * Copyright (c) 2002-2006, K Fraser
++ * Copyright (c) 2002-2004, K Fraser
 + */
 +
++
 +#ifndef __XEN_PUBLIC_DOM0_OPS_H__
 +#define __XEN_PUBLIC_DOM0_OPS_H__
 +
 +#include "xen.h"
-+#include "platform.h"
-+
-+#if __XEN_INTERFACE_VERSION__ >= 0x00030204
-+#error "dom0_ops.h is a compatibility interface only"
-+#endif
-+
-+#define DOM0_INTERFACE_VERSION XENPF_INTERFACE_VERSION
-+
-+#define DOM0_SETTIME          XENPF_settime
-+#define dom0_settime          xenpf_settime
-+#define dom0_settime_t        xenpf_settime_t
-+
-+#define DOM0_ADD_MEMTYPE      XENPF_add_memtype
-+#define dom0_add_memtype      xenpf_add_memtype
-+#define dom0_add_memtype_t    xenpf_add_memtype_t
-+
-+#define DOM0_DEL_MEMTYPE      XENPF_del_memtype
-+#define dom0_del_memtype      xenpf_del_memtype
-+#define dom0_del_memtype_t    xenpf_del_memtype_t
-+
-+#define DOM0_READ_MEMTYPE     XENPF_read_memtype
-+#define dom0_read_memtype     xenpf_read_memtype
-+#define dom0_read_memtype_t   xenpf_read_memtype_t
-+
-+#define DOM0_MICROCODE        XENPF_microcode_update
-+#define dom0_microcode        xenpf_microcode_update
-+#define dom0_microcode_t      xenpf_microcode_update_t
++#include "sched_ctl.h"
 +
-+#define DOM0_PLATFORM_QUIRK   XENPF_platform_quirk
-+#define dom0_platform_quirk   xenpf_platform_quirk
-+#define dom0_platform_quirk_t xenpf_platform_quirk_t
++/*
++ * Make sure you increment the interface version whenever you modify this file!
++ * This makes sure that old versions of dom0 tools will stop working in a
++ * well-defined way (rather than crashing the machine, for instance).
++ */
++#define DOM0_INTERFACE_VERSION   0x03000001
 +
-+typedef uint64_t cpumap_t;
++/************************************************************************/
 +
-+/* Unsupported legacy operation -- defined for API compatibility. */
-+#define DOM0_MSR                 15
-+struct dom0_msr {
++#define DOM0_GETMEMLIST        2
++struct dom0_getmemlist {
 +    /* IN variables. */
-+    uint32_t write;
-+    cpumap_t cpu_mask;
-+    uint32_t msr;
-+    uint32_t in1;
-+    uint32_t in2;
++    domid_t       domain;
++    uint64_t max_pfns;
++    XEN_GUEST_HANDLE(xen_pfn_t) buffer;
 +    /* OUT variables. */
-+    uint32_t out1;
-+    uint32_t out2;
++    uint64_t num_pfns;
 +};
-+typedef struct dom0_msr dom0_msr_t;
-+DEFINE_XEN_GUEST_HANDLE(dom0_msr_t);
++typedef struct dom0_getmemlist dom0_getmemlist_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getmemlist_t);
 +
-+/* Unsupported legacy operation -- defined for API compatibility. */
-+#define DOM0_PHYSICAL_MEMORY_MAP 40
-+struct dom0_memory_map_entry {
-+    uint64_t start, end;
-+    uint32_t flags; /* reserved */
-+    uint8_t  is_ram;
-+};
-+typedef struct dom0_memory_map_entry dom0_memory_map_entry_t;
-+DEFINE_XEN_GUEST_HANDLE(dom0_memory_map_entry_t);
++#define DOM0_SCHEDCTL          6
++ /* struct sched_ctl_cmd is from sched-ctl.h   */
++typedef struct sched_ctl_cmd dom0_schedctl_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_schedctl_t);
++
++#define DOM0_ADJUSTDOM         7
++/* struct sched_adjdom_cmd is from sched-ctl.h */
++typedef struct sched_adjdom_cmd dom0_adjustdom_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_adjustdom_t);
 +
-+struct dom0_op {
-+    uint32_t cmd;
-+    uint32_t interface_version; /* DOM0_INTERFACE_VERSION */
-+    union {
-+        struct dom0_msr               msr;
-+        struct dom0_settime           settime;
-+        struct dom0_add_memtype       add_memtype;
-+        struct dom0_del_memtype       del_memtype;
-+        struct dom0_read_memtype      read_memtype;
-+        struct dom0_microcode         microcode;
-+        struct dom0_platform_quirk    platform_quirk;
-+        struct dom0_memory_map_entry  physical_memory_map;
-+        uint8_t                       pad[128];
-+    } u;
++#define DOM0_CREATEDOMAIN      8
++struct dom0_createdomain {
++    /* IN parameters */
++    uint32_t ssidref;
++    xen_domain_handle_t handle;
++    /* IN/OUT parameters. */
++    /* Identifier for new domain (auto-allocate if zero is specified). */
++    domid_t domain;
 +};
-+typedef struct dom0_op dom0_op_t;
-+DEFINE_XEN_GUEST_HANDLE(dom0_op_t);
-+
-+#endif /* __XEN_PUBLIC_DOM0_OPS_H__ */
-+
-+/*
-+ * Local variables:
-+ * mode: C
-+ * c-set-style: "BSD"
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * indent-tabs-mode: nil
-+ * End:
-+ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/domctl.h linux-2.6.18-rc6-xen/include/xen/interface/domctl.h
---- linux-2.6.18-rc6/include/xen/interface/domctl.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/domctl.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,392 @@
-+/******************************************************************************
-+ * domctl.h
-+ * 
-+ * Domain management operations. For use by node control stack.
-+ * 
-+ * Copyright (c) 2002-2003, B Dragovic
-+ * Copyright (c) 2002-2006, K Fraser
-+ */
-+
-+#ifndef __XEN_PUBLIC_DOMCTL_H__
-+#define __XEN_PUBLIC_DOMCTL_H__
-+
-+#if !defined(__XEN__) && !defined(__XEN_TOOLS__)
-+#error "domctl operations are intended for use by node control tools only"
-+#endif
-+
-+#include "xen.h"
-+
-+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000003
++typedef struct dom0_createdomain dom0_createdomain_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_createdomain_t);
 +
-+struct xenctl_cpumap {
-+    XEN_GUEST_HANDLE(uint8_t) bitmap;
-+    uint32_t nr_cpus;
++#define DOM0_DESTROYDOMAIN     9
++struct dom0_destroydomain {
++    /* IN variables. */
++    domid_t domain;
 +};
++typedef struct dom0_destroydomain dom0_destroydomain_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_destroydomain_t);
 +
-+/*
-+ * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
-+ * If it is specified as zero, an id is auto-allocated and returned.
-+ */
-+#define XEN_DOMCTL_createdomain       1
-+struct xen_domctl_createdomain {
-+    /* IN parameters */
-+    uint32_t ssidref;
-+    xen_domain_handle_t handle;
++#define DOM0_PAUSEDOMAIN      10
++struct dom0_pausedomain {
++    /* IN parameters. */
++    domid_t domain;
 +};
-+typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
++typedef struct dom0_pausedomain dom0_pausedomain_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_pausedomain_t);
 +
-+#define XEN_DOMCTL_destroydomain      2
-+#define XEN_DOMCTL_pausedomain        3
-+#define XEN_DOMCTL_unpausedomain      4
++#define DOM0_UNPAUSEDOMAIN    11
++struct dom0_unpausedomain {
++    /* IN parameters. */
++    domid_t domain;
++};
++typedef struct dom0_unpausedomain dom0_unpausedomain_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_unpausedomain_t);
 +
-+#define XEN_DOMCTL_getdomaininfo      5
-+struct xen_domctl_getdomaininfo {
++#define DOM0_GETDOMAININFO    12
++struct dom0_getdomaininfo {
++    /* IN variables. */
++    domid_t  domain;                  /* NB. IN/OUT variable. */
 +    /* OUT variables. */
-+    domid_t  domain;              /* Also echoed in domctl.domain */
 +#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
 +#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut down.             */
 +#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
@@ -87043,467 +86898,515 @@
 +    uint32_t flags;
 +    uint64_t tot_pages;
 +    uint64_t max_pages;
-+    uint64_t shared_info_frame;  /* MFN of shared_info struct */
++    xen_pfn_t shared_info_frame;  /* MFN of shared_info struct */
 +    uint64_t cpu_time;
 +    uint32_t nr_online_vcpus;     /* Number of VCPUs currently online. */
 +    uint32_t max_vcpu_id;         /* Maximum VCPUID in use by this domain. */
 +    uint32_t ssidref;
 +    xen_domain_handle_t handle;
 +};
-+typedef struct xen_domctl_getdomaininfo xen_domctl_getdomaininfo_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t);
++typedef struct dom0_getdomaininfo dom0_getdomaininfo_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getdomaininfo_t);
 +
++#define DOM0_SETVCPUCONTEXT   13
++struct dom0_setvcpucontext {
++    /* IN variables. */
++    domid_t               domain;
++    uint32_t              vcpu;
++    /* IN/OUT parameters */
++    XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt;
++};
++typedef struct dom0_setvcpucontext dom0_setvcpucontext_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_setvcpucontext_t);
 +
-+#define XEN_DOMCTL_getmemlist         6
-+struct xen_domctl_getmemlist {
++#define DOM0_MSR              15
++struct dom0_msr {
 +    /* IN variables. */
-+    /* Max entries to write to output buffer. */
-+    uint64_t max_pfns;
-+    /* Start index in guest's page list. */
-+    uint64_t start_pfn;
-+    XEN_GUEST_HANDLE(xen_pfn_t) buffer;
++    uint32_t write;
++    cpumap_t cpu_mask;
++    uint32_t msr;
++    uint32_t in1;
++    uint32_t in2;
 +    /* OUT variables. */
-+    uint64_t num_pfns;
++    uint32_t out1;
++    uint32_t out2;
 +};
-+typedef struct xen_domctl_getmemlist xen_domctl_getmemlist_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_getmemlist_t);
-+
++typedef struct dom0_msr dom0_msr_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_msr_t);
 +
-+#define XEN_DOMCTL_getpageframeinfo   7
++/*
++ * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
++ * 1 January, 1970 if the current system time was <system_time>.
++ */
++#define DOM0_SETTIME          17
++struct dom0_settime {
++    /* IN variables. */
++    uint32_t secs;
++    uint32_t nsecs;
++    uint64_t system_time;
++};
++typedef struct dom0_settime dom0_settime_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_settime_t);
 +
-+#define XEN_DOMCTL_PFINFO_LTAB_SHIFT 28
-+#define XEN_DOMCTL_PFINFO_NOTAB   (0x0<<28)
-+#define XEN_DOMCTL_PFINFO_L1TAB   (0x1<<28)
-+#define XEN_DOMCTL_PFINFO_L2TAB   (0x2<<28)
-+#define XEN_DOMCTL_PFINFO_L3TAB   (0x3<<28)
-+#define XEN_DOMCTL_PFINFO_L4TAB   (0x4<<28)
-+#define XEN_DOMCTL_PFINFO_LTABTYPE_MASK (0x7<<28)
-+#define XEN_DOMCTL_PFINFO_LPINTAB (0x1<<31)
-+#define XEN_DOMCTL_PFINFO_XTAB    (0xf<<28) /* invalid page */
-+#define XEN_DOMCTL_PFINFO_LTAB_MASK (0xf<<28)
++#define DOM0_GETPAGEFRAMEINFO 18
++#define LTAB_SHIFT 28
++#define NOTAB 0         /* normal page */
++#define L1TAB (1<<LTAB_SHIFT)
++#define L2TAB (2<<LTAB_SHIFT)
++#define L3TAB (3<<LTAB_SHIFT)
++#define L4TAB (4<<LTAB_SHIFT)
++#define LPINTAB  (1<<31)
++#define XTAB  (0xf<<LTAB_SHIFT) /* invalid page */
++#define LTAB_MASK XTAB
++#define LTABTYPE_MASK (0x7<<LTAB_SHIFT)
 +
-+struct xen_domctl_getpageframeinfo {
++struct dom0_getpageframeinfo {
 +    /* IN variables. */
-+    uint64_t gmfn;        /* GMFN to query */
++    xen_pfn_t gmfn;        /* GMFN to query.                            */
++    domid_t domain;        /* To which domain does the frame belong?    */
 +    /* OUT variables. */
 +    /* Is the page PINNED to a type? */
 +    uint32_t type;         /* see above type defs */
 +};
-+typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
-+
++typedef struct dom0_getpageframeinfo dom0_getpageframeinfo_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getpageframeinfo_t);
 +
-+#define XEN_DOMCTL_getpageframeinfo2  8
-+struct xen_domctl_getpageframeinfo2 {
++/*
++ * Read console content from Xen buffer ring.
++ */
++#define DOM0_READCONSOLE      19
++struct dom0_readconsole {
 +    /* IN variables. */
-+    uint64_t num;
++    uint32_t clear;                /* Non-zero -> clear after reading. */
++    XEN_GUEST_HANDLE(char) buffer; /* Buffer start */
 +    /* IN/OUT variables. */
-+    XEN_GUEST_HANDLE(ulong) array;
++    uint32_t count;            /* In: Buffer size;  Out: Used buffer size  */
 +};
-+typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
-+
++typedef struct dom0_readconsole dom0_readconsole_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_readconsole_t);
 +
 +/*
-+ * Control shadow pagetables operation
++ * Set which physical cpus a vcpu can execute on.
 + */
-+#define XEN_DOMCTL_shadow_op         10
++#define DOM0_SETVCPUAFFINITY  20
++struct dom0_setvcpuaffinity {
++    /* IN variables. */
++    domid_t   domain;
++    uint32_t  vcpu;
++    cpumap_t  cpumap;
++};
++typedef struct dom0_setvcpuaffinity dom0_setvcpuaffinity_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_setvcpuaffinity_t);
++
++/* Get trace buffers machine base address */
++#define DOM0_TBUFCONTROL       21
++struct dom0_tbufcontrol {
++    /* IN variables */
++#define DOM0_TBUF_GET_INFO     0
++#define DOM0_TBUF_SET_CPU_MASK 1
++#define DOM0_TBUF_SET_EVT_MASK 2
++#define DOM0_TBUF_SET_SIZE     3
++#define DOM0_TBUF_ENABLE       4
++#define DOM0_TBUF_DISABLE      5
++    uint32_t      op;
++    /* IN/OUT variables */
++    cpumap_t      cpu_mask;
++    uint32_t      evt_mask;
++    /* OUT variables */
++    xen_pfn_t buffer_mfn;
++    uint32_t size;
++};
++typedef struct dom0_tbufcontrol dom0_tbufcontrol_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_tbufcontrol_t);
 +
-+/* Disable shadow mode. */
-+#define XEN_DOMCTL_SHADOW_OP_OFF         0
++/*
++ * Get physical information about the host machine
++ */
++#define DOM0_PHYSINFO         22
++struct dom0_physinfo {
++    uint32_t threads_per_core;
++    uint32_t cores_per_socket;
++    uint32_t sockets_per_node;
++    uint32_t nr_nodes;
++    uint32_t cpu_khz;
++    uint64_t total_pages;
++    uint64_t free_pages;
++    uint64_t scrub_pages;
++    uint32_t hw_cap[8];
++};
++typedef struct dom0_physinfo dom0_physinfo_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_physinfo_t);
 +
-+/* Enable shadow mode (mode contains ORed XEN_DOMCTL_SHADOW_ENABLE_* flags). */
-+#define XEN_DOMCTL_SHADOW_OP_ENABLE      32
++/*
++ * Get the ID of the current scheduler.
++ */
++#define DOM0_SCHED_ID        24
++struct dom0_sched_id {
++    /* OUT variable */
++    uint32_t sched_id;
++};
++typedef struct dom0_physinfo dom0_sched_id_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_sched_id_t);
 +
-+/* Log-dirty bitmap operations. */
-+ /* Return the bitmap and clean internal copy for next round. */
-+#define XEN_DOMCTL_SHADOW_OP_CLEAN       11
-+ /* Return the bitmap but do not modify internal copy. */
-+#define XEN_DOMCTL_SHADOW_OP_PEEK        12
-+
-+/* Memory allocation accessors. */
-+#define XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION   30
-+#define XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION   31
-+
-+/* Legacy enable operations. */
-+ /* Equiv. to ENABLE with no mode flags. */
-+#define XEN_DOMCTL_SHADOW_OP_ENABLE_TEST       1
-+ /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */
-+#define XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY   2
-+ /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */
-+#define XEN_DOMCTL_SHADOW_OP_ENABLE_TRANSLATE  3
++/*
++ * Control shadow pagetables operation
++ */
++#define DOM0_SHADOW_CONTROL  25
 +
-+/* Mode flags for XEN_DOMCTL_SHADOW_OP_ENABLE. */
-+ /*
-+  * Shadow pagetables are refcounted: guest does not use explicit mmu
-+  * operations nor write-protect its pagetables.
-+  */
-+#define XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT  (1 << 1)
-+ /*
-+  * Log pages in a bitmap as they are dirtied.
-+  * Used for live relocation to determine which pages must be re-sent.
-+  */
-+#define XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY (1 << 2)
-+ /*
-+  * Automatically translate GPFNs into MFNs.
-+  */
-+#define XEN_DOMCTL_SHADOW_ENABLE_TRANSLATE (1 << 3)
-+ /*
-+  * Xen does not steal virtual address space from the guest.
-+  * Requires HVM support.
-+  */
-+#define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL  (1 << 4)
++#define DOM0_SHADOW_CONTROL_OP_OFF         0
++#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1
++#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
++#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3
++
++#define DOM0_SHADOW_CONTROL_OP_FLUSH       10     /* table ops */
++#define DOM0_SHADOW_CONTROL_OP_CLEAN       11
++#define DOM0_SHADOW_CONTROL_OP_PEEK        12
++
++/* Shadow2 operations */
++#define DOM0_SHADOW2_CONTROL_OP_GET_ALLOCATION   30
++#define DOM0_SHADOW2_CONTROL_OP_SET_ALLOCATION   31
++#define DOM0_SHADOW2_CONTROL_OP_ENABLE           32
++
++/* Mode flags for Shadow2 enable op */
++#define DOM0_SHADOW2_CONTROL_FLAG_ENABLE    (1 << 0)
++#define DOM0_SHADOW2_CONTROL_FLAG_REFCOUNT  (1 << 1)
++#define DOM0_SHADOW2_CONTROL_FLAG_LOG_DIRTY (1 << 2)
++#define DOM0_SHADOW2_CONTROL_FLAG_TRANSLATE (1 << 3)
++#define DOM0_SHADOW2_CONTROL_FLAG_EXTERNAL  (1 << 4)
 +
-+struct xen_domctl_shadow_op_stats {
++struct dom0_shadow_control_stats {
 +    uint32_t fault_count;
 +    uint32_t dirty_count;
++    uint32_t dirty_net_count;
++    uint32_t dirty_block_count;
 +};
-+typedef struct xen_domctl_shadow_op_stats xen_domctl_shadow_op_stats_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_stats_t);
++typedef struct dom0_shadow_control_stats dom0_shadow_control_stats_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_shadow_control_stats_t);
 +
-+struct xen_domctl_shadow_op {
++struct dom0_shadow_control {
 +    /* IN variables. */
-+    uint32_t       op;       /* XEN_DOMCTL_SHADOW_OP_* */
++    domid_t        domain;
++    uint32_t       op;
++    XEN_GUEST_HANDLE(ulong) dirty_bitmap;
++    /* IN/OUT variables. */
++    uint64_t       pages;    /* size of buffer, updated with actual size */
++    uint32_t       mb;       /* Shadow2 memory allocation in MB */
++    uint32_t       mode;     /* Shadow2 mode to enable */
++    /* OUT variables. */
++    struct dom0_shadow_control_stats stats;
++};
++typedef struct dom0_shadow_control dom0_shadow_control_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_shadow_control_t);
 +
-+    /* OP_ENABLE */
-+    uint32_t       mode;     /* XEN_DOMCTL_SHADOW_ENABLE_* */
++#define DOM0_SETDOMAINMAXMEM   28
++struct dom0_setdomainmaxmem {
++    /* IN variables. */
++    domid_t  domain;
++    uint64_t max_memkb;
++};
++typedef struct dom0_setdomainmaxmem dom0_setdomainmaxmem_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_setdomainmaxmem_t);
 +
-+    /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
-+    uint32_t       mb;       /* Shadow memory allocation in MB */
++#define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
++struct dom0_getpageframeinfo2 {
++    /* IN variables. */
++    domid_t  domain;
++    uint64_t num;
++    /* IN/OUT variables. */
++    XEN_GUEST_HANDLE(ulong) array;
++};
++typedef struct dom0_getpageframeinfo2 dom0_getpageframeinfo2_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getpageframeinfo2_t);
 +
-+    /* OP_PEEK / OP_CLEAN */
-+    XEN_GUEST_HANDLE(ulong) dirty_bitmap;
-+    uint64_t       pages;    /* Size of buffer. Updated with actual size. */
-+    struct xen_domctl_shadow_op_stats stats;
++/*
++ * Request memory range (@mfn, @mfn+ at nr_mfns-1) to have type @type.
++ * On x86, @type is an architecture-defined MTRR memory type.
++ * On success, returns the MTRR that was used (@reg) and a handle that can
++ * be passed to DOM0_DEL_MEMTYPE to accurately tear down the new setting.
++ * (x86-specific).
++ */
++#define DOM0_ADD_MEMTYPE         31
++struct dom0_add_memtype {
++    /* IN variables. */
++    xen_pfn_t mfn;
++    uint64_t nr_mfns;
++    uint32_t type;
++    /* OUT variables. */
++    uint32_t handle;
++    uint32_t reg;
 +};
-+typedef struct xen_domctl_shadow_op xen_domctl_shadow_op_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_shadow_op_t);
++typedef struct dom0_add_memtype dom0_add_memtype_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_add_memtype_t);
 +
++/*
++ * Tear down an existing memory-range type. If @handle is remembered then it
++ * should be passed in to accurately tear down the correct setting (in case
++ * of overlapping memory regions with differing types). If it is not known
++ * then @handle should be set to zero. In all cases @reg must be set.
++ * (x86-specific).
++ */
++#define DOM0_DEL_MEMTYPE         32
++struct dom0_del_memtype {
++    /* IN variables. */
++    uint32_t handle;
++    uint32_t reg;
++};
++typedef struct dom0_del_memtype dom0_del_memtype_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_del_memtype_t);
 +
-+#define XEN_DOMCTL_max_mem           11
-+struct xen_domctl_max_mem {
++/* Read current type of an MTRR (x86-specific). */
++#define DOM0_READ_MEMTYPE        33
++struct dom0_read_memtype {
 +    /* IN variables. */
-+    uint64_t max_memkb;
++    uint32_t reg;
++    /* OUT variables. */
++    xen_pfn_t mfn;
++    uint64_t nr_mfns;
++    uint32_t type;
 +};
-+typedef struct xen_domctl_max_mem xen_domctl_max_mem_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_mem_t);
++typedef struct dom0_read_memtype dom0_read_memtype_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_read_memtype_t);
 +
++/* Interface for controlling Xen software performance counters. */
++#define DOM0_PERFCCONTROL        34
++/* Sub-operations: */
++#define DOM0_PERFCCONTROL_OP_RESET 1   /* Reset all counters to zero. */
++#define DOM0_PERFCCONTROL_OP_QUERY 2   /* Get perfctr information. */
++struct dom0_perfc_desc {
++    char         name[80];             /* name of perf counter */
++    uint32_t     nr_vals;              /* number of values for this counter */
++};
++typedef struct dom0_perfc_desc dom0_perfc_desc_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_perfc_desc_t);
++typedef uint32_t dom0_perfc_val_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_perfc_val_t);
++
++struct dom0_perfccontrol {
++    /* IN variables. */
++    uint32_t       op;                /*  DOM0_PERFCCONTROL_OP_??? */
++    /* OUT variables. */
++    uint32_t       nr_counters;       /*  number of counters description  */
++    uint32_t       nr_vals;			  /*  number of values  */
++    XEN_GUEST_HANDLE(dom0_perfc_desc_t) desc; /*  counter information (or NULL) */
++    XEN_GUEST_HANDLE(dom0_perfc_val_t) val;   /*  counter values (or NULL)  */
++};
++typedef struct dom0_perfccontrol dom0_perfccontrol_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_perfccontrol_t);
++
++#define DOM0_MICROCODE           35
++struct dom0_microcode {
++    /* IN variables. */
++    XEN_GUEST_HANDLE(void) data;          /* Pointer to microcode data */
++    uint32_t length;                  /* Length of microcode data. */
++};
++typedef struct dom0_microcode dom0_microcode_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_microcode_t);
 +
-+#define XEN_DOMCTL_setvcpucontext    12
-+#define XEN_DOMCTL_getvcpucontext    13
-+struct xen_domctl_vcpucontext {
-+    uint32_t              vcpu;                  /* IN */
-+    XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt; /* IN/OUT */
++#define DOM0_IOPORT_PERMISSION   36
++struct dom0_ioport_permission {
++    domid_t  domain;                  /* domain to be affected */
++    uint32_t first_port;              /* first port int range */
++    uint32_t nr_ports;                /* size of port range */
++    uint8_t  allow_access;            /* allow or deny access to range? */
 +};
-+typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
++typedef struct dom0_ioport_permission dom0_ioport_permission_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_ioport_permission_t);
 +
++#define DOM0_GETVCPUCONTEXT      37
++struct dom0_getvcpucontext {
++    /* IN variables. */
++    domid_t  domain;                  /* domain to be affected */
++    uint32_t vcpu;                    /* vcpu # */
++    /* OUT variables. */
++    XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt;
++};
++typedef struct dom0_getvcpucontext dom0_getvcpucontext_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getvcpucontext_t);
 +
-+#define XEN_DOMCTL_getvcpuinfo       14
-+struct xen_domctl_getvcpuinfo {
++#define DOM0_GETVCPUINFO         43
++struct dom0_getvcpuinfo {
 +    /* IN variables. */
-+    uint32_t vcpu;
++    domid_t  domain;                  /* domain to be affected */
++    uint32_t vcpu;                    /* vcpu # */
 +    /* OUT variables. */
 +    uint8_t  online;                  /* currently online (not hotplugged)? */
 +    uint8_t  blocked;                 /* blocked waiting for an event? */
 +    uint8_t  running;                 /* currently scheduled on its CPU? */
 +    uint64_t cpu_time;                /* total cpu time consumed (ns) */
 +    uint32_t cpu;                     /* current mapping   */
++    cpumap_t cpumap;                  /* allowable mapping */
 +};
-+typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
++typedef struct dom0_getvcpuinfo dom0_getvcpuinfo_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getvcpuinfo_t);
 +
-+
-+/* Get/set which physical cpus a vcpu can execute on. */
-+#define XEN_DOMCTL_setvcpuaffinity    9
-+#define XEN_DOMCTL_getvcpuaffinity   25
-+struct xen_domctl_vcpuaffinity {
-+    uint32_t  vcpu;              /* IN */
-+    struct xenctl_cpumap cpumap; /* IN/OUT */
++#define DOM0_GETDOMAININFOLIST   38
++struct dom0_getdomaininfolist {
++    /* IN variables. */
++    domid_t               first_domain;
++    uint32_t              max_domains;
++    XEN_GUEST_HANDLE(dom0_getdomaininfo_t) buffer;
++    /* OUT variables. */
++    uint32_t              num_domains;
 +};
-+typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
-+
++typedef struct dom0_getdomaininfolist dom0_getdomaininfolist_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_getdomaininfolist_t);
 +
-+#define XEN_DOMCTL_max_vcpus         15
-+struct xen_domctl_max_vcpus {
-+    uint32_t max;           /* maximum number of vcpus */
++#define DOM0_PLATFORM_QUIRK      39
++#define QUIRK_NOIRQBALANCING      1 /* Do not restrict IO-APIC RTE targets */
++#define QUIRK_IOAPIC_BAD_REGSEL   2 /* IO-APIC REGSEL forgets its value    */
++#define QUIRK_IOAPIC_GOOD_REGSEL  3 /* IO-APIC REGSEL behaves properly     */
++struct dom0_platform_quirk {
++    /* IN variables. */
++    uint32_t quirk_id;
 +};
-+typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
++typedef struct dom0_platform_quirk dom0_platform_quirk_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_platform_quirk_t);
 +
++#define DOM0_PHYSICAL_MEMORY_MAP 40   /* Unimplemented from 3.0.3 onwards */
++struct dom0_memory_map_entry {
++    uint64_t start, end;
++    uint32_t flags; /* reserved */
++    uint8_t  is_ram;
++};
++typedef struct dom0_memory_map_entry dom0_memory_map_entry_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_memory_map_entry_t);
 +
-+#define XEN_DOMCTL_scheduler_op      16
-+/* Scheduler types. */
-+#define XEN_SCHEDULER_SEDF     4
-+#define XEN_SCHEDULER_CREDIT   5
-+/* Set or get info? */
-+#define XEN_DOMCTL_SCHEDOP_putinfo 0
-+#define XEN_DOMCTL_SCHEDOP_getinfo 1
-+struct xen_domctl_scheduler_op {
-+    uint32_t sched_id;  /* XEN_SCHEDULER_* */
-+    uint32_t cmd;       /* XEN_DOMCTL_SCHEDOP_* */
-+    union {
-+        struct xen_domctl_sched_sedf {
-+            uint64_t period;
-+            uint64_t slice;
-+            uint64_t latency;
-+            uint32_t extratime;
-+            uint32_t weight;
-+        } sedf;
-+        struct xen_domctl_sched_credit {
-+            uint16_t weight;
-+            uint16_t cap;
-+        } credit;
-+    } u;
++struct dom0_physical_memory_map {
++    /* IN variables. */
++    uint32_t max_map_entries;
++    /* OUT variables. */
++    uint32_t nr_map_entries;
++    XEN_GUEST_HANDLE(dom0_memory_map_entry_t) memory_map;
 +};
-+typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_scheduler_op_t);
++typedef struct dom0_physical_memory_map dom0_physical_memory_map_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_physical_memory_map_t);
 +
++#define DOM0_MAX_VCPUS 41
++struct dom0_max_vcpus {
++    domid_t  domain;        /* domain to be affected */
++    uint32_t max;           /* maximum number of vcpus */
++};
++typedef struct dom0_max_vcpus dom0_max_vcpus_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_max_vcpus_t);
 +
-+#define XEN_DOMCTL_setdomainhandle   17
-+struct xen_domctl_setdomainhandle {
++#define DOM0_SETDOMAINHANDLE 44
++struct dom0_setdomainhandle {
++    domid_t domain;
 +    xen_domain_handle_t handle;
 +};
-+typedef struct xen_domctl_setdomainhandle xen_domctl_setdomainhandle_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdomainhandle_t);
-+
++typedef struct dom0_setdomainhandle dom0_setdomainhandle_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_setdomainhandle_t);
 +
-+#define XEN_DOMCTL_setdebugging      18
-+struct xen_domctl_setdebugging {
++#define DOM0_SETDEBUGGING 45
++struct dom0_setdebugging {
++    domid_t domain;
 +    uint8_t enable;
 +};
-+typedef struct xen_domctl_setdebugging xen_domctl_setdebugging_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_setdebugging_t);
++typedef struct dom0_setdebugging dom0_setdebugging_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_setdebugging_t);
 +
-+
-+#define XEN_DOMCTL_irq_permission    19
-+struct xen_domctl_irq_permission {
++#define DOM0_IRQ_PERMISSION 46
++struct dom0_irq_permission {
++    domid_t domain;          /* domain to be affected */
 +    uint8_t pirq;
 +    uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
 +};
-+typedef struct xen_domctl_irq_permission xen_domctl_irq_permission_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_irq_permission_t);
-+
++typedef struct dom0_irq_permission dom0_irq_permission_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_irq_permission_t);
 +
-+#define XEN_DOMCTL_iomem_permission  20
-+struct xen_domctl_iomem_permission {
-+    uint64_t first_mfn;       /* first page (physical page number) in range */
++#define DOM0_IOMEM_PERMISSION 47
++struct dom0_iomem_permission {
++    domid_t  domain;          /* domain to be affected */
++    xen_pfn_t first_mfn;      /* first page (physical page number) in range */
 +    uint64_t nr_mfns;         /* number of pages in range (>0) */
-+    uint8_t  allow_access;    /* allow (!0) or deny (0) access to range? */
++    uint8_t allow_access;     /* allow (!0) or deny (0) access to range? */
 +};
-+typedef struct xen_domctl_iomem_permission xen_domctl_iomem_permission_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem_permission_t);
++typedef struct dom0_iomem_permission dom0_iomem_permission_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_iomem_permission_t);
 +
-+
-+#define XEN_DOMCTL_ioport_permission 21
-+struct xen_domctl_ioport_permission {
-+    uint32_t first_port;              /* first port int range */
-+    uint32_t nr_ports;                /* size of port range */
-+    uint8_t  allow_access;            /* allow or deny access to range? */
-+};
-+typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t);
-+
-+#define XEN_DOMCTL_hypercall_init    22
-+struct xen_domctl_hypercall_init {
-+    uint64_t  gmfn;            /* GMFN to be initialised */
++#define DOM0_HYPERCALL_INIT   48
++struct dom0_hypercall_init {
++    domid_t   domain;          /* domain to be affected */
++    xen_pfn_t gmfn;            /* GMFN to be initialised */
 +};
-+typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
++typedef struct dom0_hypercall_init dom0_hypercall_init_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_hypercall_init_t);
 +
-+#define XEN_DOMCTL_arch_setup        23
++#define DOM0_DOMAIN_SETUP     49
 +#define _XEN_DOMAINSETUP_hvm_guest 0
 +#define XEN_DOMAINSETUP_hvm_guest  (1UL<<_XEN_DOMAINSETUP_hvm_guest)
-+#define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save)  */
++#define _XEN_DOMAINSETUP_query 1	/* Get parameters (for save)  */
 +#define XEN_DOMAINSETUP_query  (1UL<<_XEN_DOMAINSETUP_query)
-+typedef struct xen_domctl_arch_setup {
-+    uint64_t flags;      /* XEN_DOMAINSETUP_* */
++typedef struct dom0_domain_setup {
++    domid_t  domain;          /* domain to be affected */
++    unsigned long flags;      /* XEN_DOMAINSETUP_* */
 +#ifdef __ia64__
-+    uint64_t bp;            /* mpaddr of boot param area */
-+    uint64_t maxmem;        /* Highest memory address for MDT.  */
-+    uint64_t xsi_va;        /* Xen shared_info area virtual address.  */
-+    uint32_t hypercall_imm; /* Break imm for Xen hypercalls.  */
++    unsigned long bp;         /* mpaddr of boot param area */
++    unsigned long maxmem;	  /* Highest memory address for MDT.  */
++    unsigned long xsi_va;     /* Xen shared_info area virtual address.  */
++    unsigned int hypercall_imm;	/* Break imm for Xen hypercalls.  */
 +#endif
-+} xen_domctl_arch_setup_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
++} dom0_domain_setup_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_domain_setup_t);
 +
-+#define XEN_DOMCTL_settimeoffset     24
-+struct xen_domctl_settimeoffset {
++#define DOM0_SETTIMEOFFSET    50
++struct dom0_settimeoffset {
++    domid_t  domain;
 +    int32_t  time_offset_seconds; /* applied to domain wallclock time */
 +};
-+typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
++typedef struct dom0_settimeoffset dom0_settimeoffset_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_settimeoffset_t);
 +
-+struct xen_domctl {
++struct dom0_op {
 +    uint32_t cmd;
-+    uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
-+    domid_t  domain;
++    uint32_t interface_version; /* DOM0_INTERFACE_VERSION */
 +    union {
-+        struct xen_domctl_createdomain      createdomain;
-+        struct xen_domctl_getdomaininfo     getdomaininfo;
-+        struct xen_domctl_getmemlist        getmemlist;
-+        struct xen_domctl_getpageframeinfo  getpageframeinfo;
-+        struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
-+        struct xen_domctl_vcpuaffinity      vcpuaffinity;
-+        struct xen_domctl_shadow_op         shadow_op;
-+        struct xen_domctl_max_mem           max_mem;
-+        struct xen_domctl_vcpucontext       vcpucontext;
-+        struct xen_domctl_getvcpuinfo       getvcpuinfo;
-+        struct xen_domctl_max_vcpus         max_vcpus;
-+        struct xen_domctl_scheduler_op      scheduler_op;
-+        struct xen_domctl_setdomainhandle   setdomainhandle;
-+        struct xen_domctl_setdebugging      setdebugging;
-+        struct xen_domctl_irq_permission    irq_permission;
-+        struct xen_domctl_iomem_permission  iomem_permission;
-+        struct xen_domctl_ioport_permission ioport_permission;
-+        struct xen_domctl_hypercall_init    hypercall_init;
-+        struct xen_domctl_arch_setup        arch_setup;
-+        struct xen_domctl_settimeoffset     settimeoffset;
-+        uint8_t                             pad[128];
++        struct dom0_createdomain      createdomain;
++        struct dom0_pausedomain       pausedomain;
++        struct dom0_unpausedomain     unpausedomain;
++        struct dom0_destroydomain     destroydomain;
++        struct dom0_getmemlist        getmemlist;
++        struct sched_ctl_cmd          schedctl;
++        struct sched_adjdom_cmd       adjustdom;
++        struct dom0_setvcpucontext    setvcpucontext;
++        struct dom0_getdomaininfo     getdomaininfo;
++        struct dom0_getpageframeinfo  getpageframeinfo;
++        struct dom0_msr               msr;
++        struct dom0_settime           settime;
++        struct dom0_readconsole       readconsole;
++        struct dom0_setvcpuaffinity   setvcpuaffinity;
++        struct dom0_tbufcontrol       tbufcontrol;
++        struct dom0_physinfo          physinfo;
++        struct dom0_sched_id          sched_id;
++        struct dom0_shadow_control    shadow_control;
++        struct dom0_setdomainmaxmem   setdomainmaxmem;
++        struct dom0_getpageframeinfo2 getpageframeinfo2;
++        struct dom0_add_memtype       add_memtype;
++        struct dom0_del_memtype       del_memtype;
++        struct dom0_read_memtype      read_memtype;
++        struct dom0_perfccontrol      perfccontrol;
++        struct dom0_microcode         microcode;
++        struct dom0_ioport_permission ioport_permission;
++        struct dom0_getvcpucontext    getvcpucontext;
++        struct dom0_getvcpuinfo       getvcpuinfo;
++        struct dom0_getdomaininfolist getdomaininfolist;
++        struct dom0_platform_quirk    platform_quirk;
++        struct dom0_physical_memory_map physical_memory_map;
++        struct dom0_max_vcpus         max_vcpus;
++        struct dom0_setdomainhandle   setdomainhandle;
++        struct dom0_setdebugging      setdebugging;
++        struct dom0_irq_permission    irq_permission;
++        struct dom0_iomem_permission  iomem_permission;
++        struct dom0_hypercall_init    hypercall_init;
++        struct dom0_domain_setup      domain_setup;
++        struct dom0_settimeoffset     settimeoffset;
++        uint8_t                       pad[128];
 +    } u;
 +};
-+typedef struct xen_domctl xen_domctl_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
-+
-+#endif /* __XEN_PUBLIC_DOMCTL_H__ */
-+
-+/*
-+ * Local variables:
-+ * mode: C
-+ * c-set-style: "BSD"
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * indent-tabs-mode: nil
-+ * End:
-+ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/elfnote.h linux-2.6.18-rc6-xen/include/xen/interface/elfnote.h
---- linux-2.6.18-rc6/include/xen/interface/elfnote.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/elfnote.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,133 @@
-+/******************************************************************************
-+ * elfnote.h
-+ *
-+ * Definitions used for the Xen ELF notes.
-+ *
-+ * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
-+ */
-+
-+#ifndef __XEN_PUBLIC_ELFNOTE_H__
-+#define __XEN_PUBLIC_ELFNOTE_H__
-+
-+/*
-+ * The notes should live in a SHT_NOTE segment and have "Xen" in the
-+ * name field.
-+ *
-+ * Numeric types are either 4 or 8 bytes depending on the content of
-+ * the desc field.
-+ *
-+ * LEGACY indicated the fields in the legacy __xen_guest string which
-+ * this a note type replaces.
-+ */
-+
-+/*
-+ * NAME=VALUE pair (string).
-+ *
-+ * LEGACY: FEATURES and PAE
-+ */
-+#define XEN_ELFNOTE_INFO           0
-+
-+/*
-+ * The virtual address of the entry point (numeric).
-+ *
-+ * LEGACY: VIRT_ENTRY
-+ */
-+#define XEN_ELFNOTE_ENTRY          1
-+
-+/* The virtual address of the hypercall transfer page (numeric).
-+ *
-+ * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
-+ * number not a virtual address)
-+ */
-+#define XEN_ELFNOTE_HYPERCALL_PAGE 2
-+
-+/* The virtual address where the kernel image should be mapped (numeric).
-+ *
-+ * Defaults to 0.
-+ *
-+ * LEGACY: VIRT_BASE
-+ */
-+#define XEN_ELFNOTE_VIRT_BASE      3
-+
-+/*
-+ * The offset of the ELF paddr field from the acutal required
-+ * psuedo-physical address (numeric).
-+ *
-+ * This is used to maintain backwards compatibility with older kernels
-+ * which wrote __PAGE_OFFSET into that field. This field defaults to 0
-+ * if not present.
-+ *
-+ * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
-+ */
-+#define XEN_ELFNOTE_PADDR_OFFSET   4
-+
-+/*
-+ * The version of Xen that we work with (string).
-+ *
-+ * LEGACY: XEN_VER
-+ */
-+#define XEN_ELFNOTE_XEN_VERSION    5
-+
-+/*
-+ * The name of the guest operating system (string).
-+ *
-+ * LEGACY: GUEST_OS
-+ */
-+#define XEN_ELFNOTE_GUEST_OS       6
-+
-+/*
-+ * The version of the guest operating system (string).
-+ *
-+ * LEGACY: GUEST_VER
-+ */
-+#define XEN_ELFNOTE_GUEST_VERSION  7
-+
-+/*
-+ * The loader type (string).
-+ *
-+ * LEGACY: LOADER
-+ */
-+#define XEN_ELFNOTE_LOADER         8
-+
-+/*
-+ * The kernel supports PAE (x86/32 only, string = "yes" or "no").
-+ *
-+ * LEGACY: PAE (n.b. The legacy interface included a provision to
-+ * indicate 'extended-cr3' support allowing L3 page tables to be
-+ * placed above 4G. It is assumed that any kernel new enough to use
-+ * these ELF notes will include this and therefore "yes" here is
-+ * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
-+ */
-+#define XEN_ELFNOTE_PAE_MODE       9
-+
-+/*
-+ * The features supported/required by this kernel (string).
-+ *
-+ * The string must consist of a list of feature names (as given in
-+ * features.h, without the "XENFEAT_" prefix) separated by '|'
-+ * characters. If a feature is required for the kernel to function
-+ * then the feature name must be preceded by a '!' character.
-+ *
-+ * LEGACY: FEATURES
-+ */
-+#define XEN_ELFNOTE_FEATURES      10
-+
-+/*
-+ * The kernel requires the symbol table to be loaded (string = "yes" or "no")
-+ * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
-+ * of this string as a boolean flag rather than requiring "yes" or
-+ * "no".
-+ */
-+#define XEN_ELFNOTE_BSD_SYMTAB    11
++typedef struct dom0_op dom0_op_t;
++DEFINE_XEN_GUEST_HANDLE(dom0_op_t);
 +
-+#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
++#endif /* __XEN_PUBLIC_DOM0_OPS_H__ */
 +
 +/*
 + * Local variables:
@@ -87514,9 +87417,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/event_channel.h linux-2.6.18-rc6-xen/include/xen/interface/event_channel.h
---- linux-2.6.18-rc6/include/xen/interface/event_channel.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/event_channel.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/event_channel.h linux-2.6.18-xen/include/xen/interface/event_channel.h
+--- linux-2.6.18/include/xen/interface/event_channel.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/event_channel.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,233 @@
 +/******************************************************************************
 + * event_channel.h
@@ -87751,9 +87654,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/features.h linux-2.6.18-rc6-xen/include/xen/interface/features.h
---- linux-2.6.18-rc6/include/xen/interface/features.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/features.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/features.h linux-2.6.18-xen/include/xen/interface/features.h
+--- linux-2.6.18/include/xen/interface/features.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/features.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,53 @@
 +/******************************************************************************
 + * features.h
@@ -87808,9 +87711,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/grant_table.h linux-2.6.18-rc6-xen/include/xen/interface/grant_table.h
---- linux-2.6.18-rc6/include/xen/interface/grant_table.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/grant_table.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/grant_table.h linux-2.6.18-xen/include/xen/interface/grant_table.h
+--- linux-2.6.18/include/xen/interface/grant_table.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/grant_table.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,362 @@
 +/******************************************************************************
 + * grant_table.h
@@ -88174,9 +88077,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/hvm/e820.h linux-2.6.18-rc6-xen/include/xen/interface/hvm/e820.h
---- linux-2.6.18-rc6/include/xen/interface/hvm/e820.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/hvm/e820.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/hvm/e820.h linux-2.6.18-xen/include/xen/interface/hvm/e820.h
+--- linux-2.6.18/include/xen/interface/hvm/e820.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/hvm/e820.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,32 @@
 +#ifndef __XEN_PUBLIC_HVM_E820_H__
 +#define __XEN_PUBLIC_HVM_E820_H__
@@ -88210,9 +88113,9 @@
 +#define HVM_BELOW_4G_MMIO_LENGTH    ((1ULL << 32) - HVM_BELOW_4G_MMIO_START)
 +
 +#endif /* __XEN_PUBLIC_HVM_E820_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/hvm/hvm_info_table.h linux-2.6.18-rc6-xen/include/xen/interface/hvm/hvm_info_table.h
---- linux-2.6.18-rc6/include/xen/interface/hvm/hvm_info_table.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/hvm/hvm_info_table.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/hvm/hvm_info_table.h linux-2.6.18-xen/include/xen/interface/hvm/hvm_info_table.h
+--- linux-2.6.18/include/xen/interface/hvm/hvm_info_table.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/hvm/hvm_info_table.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,22 @@
 +/******************************************************************************
 + * hvm/hvm_info_table.h
@@ -88236,9 +88139,9 @@
 +};
 +
 +#endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/hvm/ioreq.h linux-2.6.18-rc6-xen/include/xen/interface/hvm/ioreq.h
---- linux-2.6.18-rc6/include/xen/interface/hvm/ioreq.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/hvm/ioreq.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/hvm/ioreq.h linux-2.6.18-xen/include/xen/interface/hvm/ioreq.h
+--- linux-2.6.18/include/xen/interface/hvm/ioreq.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/hvm/ioreq.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,99 @@
 +/*
 + * ioreq.h: I/O request definitions for device models
@@ -88339,9 +88242,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/hvm/params.h linux-2.6.18-rc6-xen/include/xen/interface/hvm/params.h
---- linux-2.6.18-rc6/include/xen/interface/hvm/params.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/hvm/params.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/hvm/params.h linux-2.6.18-xen/include/xen/interface/hvm/params.h
+--- linux-2.6.18/include/xen/interface/hvm/params.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/hvm/params.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,24 @@
 +#ifndef __XEN_PUBLIC_HVM_PARAMS_H__
 +#define __XEN_PUBLIC_HVM_PARAMS_H__
@@ -88367,9 +88270,9 @@
 +DEFINE_XEN_GUEST_HANDLE(xen_hvm_param_t);
 +
 +#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/hvm/vmx_assist.h linux-2.6.18-rc6-xen/include/xen/interface/hvm/vmx_assist.h
---- linux-2.6.18-rc6/include/xen/interface/hvm/vmx_assist.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/hvm/vmx_assist.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/hvm/vmx_assist.h linux-2.6.18-xen/include/xen/interface/hvm/vmx_assist.h
+--- linux-2.6.18/include/xen/interface/hvm/vmx_assist.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/hvm/vmx_assist.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,98 @@
 +/*
 + * vmx_assist.h: Context definitions for the VMXASSIST world switch.
@@ -88469,9 +88372,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/blkif.h linux-2.6.18-rc6-xen/include/xen/interface/io/blkif.h
---- linux-2.6.18-rc6/include/xen/interface/io/blkif.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/blkif.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/blkif.h linux-2.6.18-xen/include/xen/interface/io/blkif.h
+--- linux-2.6.18/include/xen/interface/io/blkif.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/blkif.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,87 @@
 +/******************************************************************************
 + * blkif.h
@@ -88560,9 +88463,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/console.h linux-2.6.18-rc6-xen/include/xen/interface/io/console.h
---- linux-2.6.18-rc6/include/xen/interface/io/console.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/console.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/console.h linux-2.6.18-xen/include/xen/interface/io/console.h
+--- linux-2.6.18/include/xen/interface/io/console.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/console.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,33 @@
 +/******************************************************************************
 + * console.h
@@ -88597,9 +88500,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/netif.h linux-2.6.18-rc6-xen/include/xen/interface/io/netif.h
---- linux-2.6.18-rc6/include/xen/interface/io/netif.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/netif.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/netif.h linux-2.6.18-xen/include/xen/interface/io/netif.h
+--- linux-2.6.18/include/xen/interface/io/netif.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/netif.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,166 @@
 +/******************************************************************************
 + * netif.h
@@ -88767,9 +88670,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/pciif.h linux-2.6.18-rc6-xen/include/xen/interface/io/pciif.h
---- linux-2.6.18-rc6/include/xen/interface/io/pciif.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/pciif.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/pciif.h linux-2.6.18-xen/include/xen/interface/io/pciif.h
+--- linux-2.6.18/include/xen/interface/io/pciif.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/pciif.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,55 @@
 +/*
 + * PCI Backend/Frontend Common Data Structures & Macros
@@ -88826,9 +88729,9 @@
 +};
 +
 +#endif /* __XEN_PCI_COMMON_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/ring.h linux-2.6.18-rc6-xen/include/xen/interface/io/ring.h
---- linux-2.6.18-rc6/include/xen/interface/io/ring.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/ring.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/ring.h linux-2.6.18-xen/include/xen/interface/io/ring.h
+--- linux-2.6.18/include/xen/interface/io/ring.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/ring.h	2006-06-19 13:20:42.000000000 +0200
 @@ -0,0 +1,273 @@
 +/******************************************************************************
 + * ring.h
@@ -89103,9 +89006,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/tpmif.h linux-2.6.18-rc6-xen/include/xen/interface/io/tpmif.h
---- linux-2.6.18-rc6/include/xen/interface/io/tpmif.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/tpmif.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/tpmif.h linux-2.6.18-xen/include/xen/interface/io/tpmif.h
+--- linux-2.6.18/include/xen/interface/io/tpmif.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/tpmif.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,59 @@
 +/******************************************************************************
 + * tpmif.h
@@ -89166,9 +89069,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/xenbus.h linux-2.6.18-rc6-xen/include/xen/interface/io/xenbus.h
---- linux-2.6.18-rc6/include/xen/interface/io/xenbus.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/xenbus.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/xenbus.h linux-2.6.18-xen/include/xen/interface/io/xenbus.h
+--- linux-2.6.18/include/xen/interface/io/xenbus.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/xenbus.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,45 @@
 +/*****************************************************************************
 + * xenbus.h
@@ -89215,9 +89118,9 @@
 +typedef enum xenbus_state XenbusState;
 +
 +#endif /* _XEN_PUBLIC_IO_XENBUS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/io/xs_wire.h linux-2.6.18-rc6-xen/include/xen/interface/io/xs_wire.h
---- linux-2.6.18-rc6/include/xen/interface/io/xs_wire.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/io/xs_wire.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/io/xs_wire.h linux-2.6.18-xen/include/xen/interface/io/xs_wire.h
+--- linux-2.6.18/include/xen/interface/io/xs_wire.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/io/xs_wire.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,97 @@
 +/*
 + * Details of the "wire" protocol between Xen Store Daemon and client
@@ -89316,9 +89219,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/memory.h linux-2.6.18-rc6-xen/include/xen/interface/memory.h
---- linux-2.6.18-rc6/include/xen/interface/memory.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/memory.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/memory.h linux-2.6.18-xen/include/xen/interface/memory.h
+--- linux-2.6.18/include/xen/interface/memory.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/memory.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,243 @@
 +/******************************************************************************
 + * memory.h
@@ -89563,9 +89466,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/nmi.h linux-2.6.18-rc6-xen/include/xen/interface/nmi.h
---- linux-2.6.18-rc6/include/xen/interface/nmi.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/nmi.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/nmi.h linux-2.6.18-xen/include/xen/interface/nmi.h
+--- linux-2.6.18/include/xen/interface/nmi.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/nmi.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,60 @@
 +/******************************************************************************
 + * nmi.h
@@ -89627,9 +89530,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/physdev.h linux-2.6.18-rc6-xen/include/xen/interface/physdev.h
---- linux-2.6.18-rc6/include/xen/interface/physdev.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/physdev.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/physdev.h linux-2.6.18-xen/include/xen/interface/physdev.h
+--- linux-2.6.18/include/xen/interface/physdev.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/physdev.h	2006-07-07 20:51:48.000000000 +0200
 @@ -0,0 +1,149 @@
 +
 +#ifndef __XEN_PUBLIC_PHYSDEV_H__
@@ -89780,125 +89683,69 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/platform.h linux-2.6.18-rc6-xen/include/xen/interface/platform.h
---- linux-2.6.18-rc6/include/xen/interface/platform.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/platform.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,125 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/sched_ctl.h linux-2.6.18-xen/include/xen/interface/sched_ctl.h
+--- linux-2.6.18/include/xen/interface/sched_ctl.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/sched_ctl.h	2006-06-19 13:20:42.000000000 +0200
+@@ -0,0 +1,69 @@
 +/******************************************************************************
-+ * platform.h
-+ * 
-+ * Hardware platform operations. Intended for use by domain-0 kernel.
-+ * 
-+ * Copyright (c) 2002-2006, K Fraser
++ * Generic scheduler control interface.
++ *
++ * Mark Williamson, (C) 2004 Intel Research Cambridge
 + */
 +
-+#ifndef __XEN_PUBLIC_PLATFORM_H__
-+#define __XEN_PUBLIC_PLATFORM_H__
-+
-+#include "xen.h"
++#ifndef __XEN_PUBLIC_SCHED_CTL_H__
++#define __XEN_PUBLIC_SCHED_CTL_H__
 +
-+#define XENPF_INTERFACE_VERSION 0x03000001
-+
-+/*
-+ * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
-+ * 1 January, 1970 if the current system time was <system_time>.
-+ */
-+#define XENPF_settime             17
-+struct xenpf_settime {
-+    /* IN variables. */
-+    uint32_t secs;
-+    uint32_t nsecs;
-+    uint64_t system_time;
-+};
-+typedef struct xenpf_settime xenpf_settime_t;
-+DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
++/* Scheduler types. */
++#define SCHED_BVT      0
++#define SCHED_SEDF     4
++#define SCHED_CREDIT   5
 +
-+/*
-+ * Request memory range (@mfn, @mfn+ at nr_mfns-1) to have type @type.
-+ * On x86, @type is an architecture-defined MTRR memory type.
-+ * On success, returns the MTRR that was used (@reg) and a handle that can
-+ * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting.
-+ * (x86-specific).
-+ */
-+#define XENPF_add_memtype         31
-+struct xenpf_add_memtype {
-+    /* IN variables. */
-+    xen_pfn_t mfn;
-+    uint64_t nr_mfns;
-+    uint32_t type;
-+    /* OUT variables. */
-+    uint32_t handle;
-+    uint32_t reg;
-+};
-+typedef struct xenpf_add_memtype xenpf_add_memtype_t;
-+DEFINE_XEN_GUEST_HANDLE(xenpf_add_memtype_t);
++/* Set or get info? */
++#define SCHED_INFO_PUT 0
++#define SCHED_INFO_GET 1
 +
 +/*
-+ * Tear down an existing memory-range type. If @handle is remembered then it
-+ * should be passed in to accurately tear down the correct setting (in case
-+ * of overlapping memory regions with differing types). If it is not known
-+ * then @handle should be set to zero. In all cases @reg must be set.
-+ * (x86-specific).
++ * Generic scheduler control command - used to adjust system-wide scheduler
++ * parameters
 + */
-+#define XENPF_del_memtype         32
-+struct xenpf_del_memtype {
-+    /* IN variables. */
-+    uint32_t handle;
-+    uint32_t reg;
-+};
-+typedef struct xenpf_del_memtype xenpf_del_memtype_t;
-+DEFINE_XEN_GUEST_HANDLE(xenpf_del_memtype_t);
-+
-+/* Read current type of an MTRR (x86-specific). */
-+#define XENPF_read_memtype        33
-+struct xenpf_read_memtype {
-+    /* IN variables. */
-+    uint32_t reg;
-+    /* OUT variables. */
-+    xen_pfn_t mfn;
-+    uint64_t nr_mfns;
-+    uint32_t type;
-+};
-+typedef struct xenpf_read_memtype xenpf_read_memtype_t;
-+DEFINE_XEN_GUEST_HANDLE(xenpf_read_memtype_t);
-+
-+#define XENPF_microcode_update    35
-+struct xenpf_microcode_update {
-+    /* IN variables. */
-+    XEN_GUEST_HANDLE(void) data;      /* Pointer to microcode data */
-+    uint32_t length;                  /* Length of microcode data. */
-+};
-+typedef struct xenpf_microcode_update xenpf_microcode_update_t;
-+DEFINE_XEN_GUEST_HANDLE(xenpf_microcode_update_t);
-+
-+#define XENPF_platform_quirk      39
-+#define QUIRK_NOIRQBALANCING      1 /* Do not restrict IO-APIC RTE targets */
-+#define QUIRK_IOAPIC_BAD_REGSEL   2 /* IO-APIC REGSEL forgets its value    */
-+#define QUIRK_IOAPIC_GOOD_REGSEL  3 /* IO-APIC REGSEL behaves properly     */
-+struct xenpf_platform_quirk {
-+    /* IN variables. */
-+    uint32_t quirk_id;
++struct sched_ctl_cmd {
++    uint32_t sched_id;
++    uint32_t direction;
++    union {
++        struct bvt_ctl {
++            uint32_t ctx_allow;
++        } bvt;
++    } u;
 +};
-+typedef struct xenpf_platform_quirk xenpf_platform_quirk_t;
-+DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
 +
-+struct xen_platform_op {
-+    uint32_t cmd;
-+    uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
++struct sched_adjdom_cmd {
++    uint32_t sched_id;
++    uint32_t direction;
++    domid_t  domain;
 +    union {
-+        struct xenpf_settime           settime;
-+        struct xenpf_add_memtype       add_memtype;
-+        struct xenpf_del_memtype       del_memtype;
-+        struct xenpf_read_memtype      read_memtype;
-+        struct xenpf_microcode_update  microcode;
-+        struct xenpf_platform_quirk    platform_quirk;
-+        uint8_t                        pad[128];
++        struct bvt_adjdom {
++            uint32_t mcu_adv;      /* mcu advance: inverse of weight */
++            uint32_t warpback;     /* warp? */
++            int32_t  warpvalue;    /* warp value */
++            int64_t  warpl;        /* warp limit */
++            int64_t  warpu;        /* unwarp time requirement */
++        } bvt;
++        struct sedf_adjdom {
++            uint64_t period;
++            uint64_t slice;
++            uint64_t latency;
++            uint32_t extratime;
++            uint32_t weight;
++        } sedf;
++        struct sched_credit_adjdom {
++            uint16_t weight;
++            uint16_t cap;
++        } credit;
 +    } u;
 +};
-+typedef struct xen_platform_op xen_platform_op_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_platform_op_t);
 +
-+#endif /* __XEN_PUBLIC_PLATFORM_H__ */
++#endif /* __XEN_PUBLIC_SCHED_CTL_H__ */
 +
 +/*
 + * Local variables:
@@ -89909,9 +89756,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/sched.h linux-2.6.18-rc6-xen/include/xen/interface/sched.h
---- linux-2.6.18-rc6/include/xen/interface/sched.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/sched.h	2006-09-04 16:31:19.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/sched.h linux-2.6.18-xen/include/xen/interface/sched.h
+--- linux-2.6.18/include/xen/interface/sched.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/sched.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,103 @@
 +/******************************************************************************
 + * sched.h
@@ -90016,164 +89863,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/sysctl.h linux-2.6.18-rc6-xen/include/xen/interface/sysctl.h
---- linux-2.6.18-rc6/include/xen/interface/sysctl.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/sysctl.h	2006-09-04 16:31:19.000000000 +0200
-@@ -0,0 +1,151 @@
-+/******************************************************************************
-+ * sysctl.h
-+ * 
-+ * System management operations. For use by node control stack.
-+ * 
-+ * Copyright (c) 2002-2006, K Fraser
-+ */
-+
-+#ifndef __XEN_PUBLIC_SYSCTL_H__
-+#define __XEN_PUBLIC_SYSCTL_H__
-+
-+#if !defined(__XEN__) && !defined(__XEN_TOOLS__)
-+#error "sysctl operations are intended for use by node control tools only"
-+#endif
-+
-+#include "xen.h"
-+#include "domctl.h"
-+
-+#define XEN_SYSCTL_INTERFACE_VERSION 0x00000002
-+
-+/*
-+ * Read console content from Xen buffer ring.
-+ */
-+#define XEN_SYSCTL_readconsole       1
-+struct xen_sysctl_readconsole {
-+    /* IN variables. */
-+    uint32_t clear;                /* Non-zero -> clear after reading. */
-+    XEN_GUEST_HANDLE(char) buffer; /* Buffer start */
-+    /* IN/OUT variables. */
-+    uint32_t count;            /* In: Buffer size;  Out: Used buffer size  */
-+};
-+typedef struct xen_sysctl_readconsole xen_sysctl_readconsole_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_readconsole_t);
-+
-+/* Get trace buffers machine base address */
-+#define XEN_SYSCTL_tbuf_op           2
-+struct xen_sysctl_tbuf_op {
-+    /* IN variables */
-+#define XEN_SYSCTL_TBUFOP_get_info     0
-+#define XEN_SYSCTL_TBUFOP_set_cpu_mask 1
-+#define XEN_SYSCTL_TBUFOP_set_evt_mask 2
-+#define XEN_SYSCTL_TBUFOP_set_size     3
-+#define XEN_SYSCTL_TBUFOP_enable       4
-+#define XEN_SYSCTL_TBUFOP_disable      5
-+    uint32_t cmd;
-+    /* IN/OUT variables */
-+    struct xenctl_cpumap cpu_mask;
-+    uint32_t             evt_mask;
-+    /* OUT variables */
-+    uint64_t buffer_mfn;
-+    uint32_t size;
-+};
-+typedef struct xen_sysctl_tbuf_op xen_sysctl_tbuf_op_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tbuf_op_t);
-+
-+/*
-+ * Get physical information about the host machine
-+ */
-+#define XEN_SYSCTL_physinfo          3
-+struct xen_sysctl_physinfo {
-+    uint32_t threads_per_core;
-+    uint32_t cores_per_socket;
-+    uint32_t sockets_per_node;
-+    uint32_t nr_nodes;
-+    uint32_t cpu_khz;
-+    uint64_t total_pages;
-+    uint64_t free_pages;
-+    uint64_t scrub_pages;
-+    uint32_t hw_cap[8];
-+};
-+typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t);
-+
-+/*
-+ * Get the ID of the current scheduler.
-+ */
-+#define XEN_SYSCTL_sched_id          4
-+struct xen_sysctl_sched_id {
-+    /* OUT variable */
-+    uint32_t sched_id;
-+};
-+typedef struct xen_sysctl_sched_id xen_sysctl_sched_id_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_sched_id_t);
-+
-+/* Interface for controlling Xen software performance counters. */
-+#define XEN_SYSCTL_perfc_op          5
-+/* Sub-operations: */
-+#define XEN_SYSCTL_PERFCOP_reset 1   /* Reset all counters to zero. */
-+#define XEN_SYSCTL_PERFCOP_query 2   /* Get perfctr information. */
-+struct xen_sysctl_perfc_desc {
-+    char         name[80];             /* name of perf counter */
-+    uint32_t     nr_vals;              /* number of values for this counter */
-+};
-+typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t);
-+typedef uint32_t xen_sysctl_perfc_val_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t);
-+
-+struct xen_sysctl_perfc_op {
-+    /* IN variables. */
-+    uint32_t       cmd;                /*  XEN_SYSCTL_PERFCOP_??? */
-+    /* OUT variables. */
-+    uint32_t       nr_counters;       /*  number of counters description  */
-+    uint32_t       nr_vals;			  /*  number of values  */
-+    /* counter information (or NULL) */
-+    XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc;
-+    /* counter values (or NULL) */
-+    XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val;
-+};
-+typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t);
-+
-+#define XEN_SYSCTL_getdomaininfolist 6
-+struct xen_sysctl_getdomaininfolist {
-+    /* IN variables. */
-+    domid_t               first_domain;
-+    uint32_t              max_domains;
-+    XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t) buffer;
-+    /* OUT variables. */
-+    uint32_t              num_domains;
-+};
-+typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
-+
-+struct xen_sysctl {
-+    uint32_t cmd;
-+    uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
-+    union {
-+        struct xen_sysctl_readconsole       readconsole;
-+        struct xen_sysctl_tbuf_op           tbuf_op;
-+        struct xen_sysctl_physinfo          physinfo;
-+        struct xen_sysctl_sched_id          sched_id;
-+        struct xen_sysctl_perfc_op          perfc_op;
-+        struct xen_sysctl_getdomaininfolist getdomaininfolist;
-+        uint8_t                             pad[128];
-+    } u;
-+};
-+typedef struct xen_sysctl xen_sysctl_t;
-+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
-+
-+#endif /* __XEN_PUBLIC_SYSCTL_H__ */
-+
-+/*
-+ * Local variables:
-+ * mode: C
-+ * c-set-style: "BSD"
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * indent-tabs-mode: nil
-+ * End:
-+ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/trace.h linux-2.6.18-rc6-xen/include/xen/interface/trace.h
---- linux-2.6.18-rc6/include/xen/interface/trace.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/trace.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/trace.h linux-2.6.18-xen/include/xen/interface/trace.h
+--- linux-2.6.18/include/xen/interface/trace.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/trace.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,87 @@
 +/******************************************************************************
 + * include/public/trace.h
@@ -90262,9 +89954,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/vcpu.h linux-2.6.18-rc6-xen/include/xen/interface/vcpu.h
---- linux-2.6.18-rc6/include/xen/interface/vcpu.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/vcpu.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/vcpu.h linux-2.6.18-xen/include/xen/interface/vcpu.h
+--- linux-2.6.18/include/xen/interface/vcpu.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/vcpu.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,121 @@
 +/******************************************************************************
 + * vcpu.h
@@ -90387,9 +90079,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/version.h linux-2.6.18-rc6-xen/include/xen/interface/version.h
---- linux-2.6.18-rc6/include/xen/interface/version.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/version.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/version.h linux-2.6.18-xen/include/xen/interface/version.h
+--- linux-2.6.18/include/xen/interface/version.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/version.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,73 @@
 +/******************************************************************************
 + * version.h
@@ -90464,9 +90156,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/xencomm.h linux-2.6.18-rc6-xen/include/xen/interface/xencomm.h
---- linux-2.6.18-rc6/include/xen/interface/xencomm.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/xencomm.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/xencomm.h linux-2.6.18-xen/include/xen/interface/xencomm.h
+--- linux-2.6.18/include/xen/interface/xencomm.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/xencomm.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,37 @@
 +/*
 + * Copyright (C) 2006 Hollis Blanchard <hollisb at us.ibm.com>, IBM Corporation
@@ -90505,9 +90197,9 @@
 +};
 +
 +#endif /* _XEN_XENCOMM_H_ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/xen-compat.h linux-2.6.18-rc6-xen/include/xen/interface/xen-compat.h
---- linux-2.6.18-rc6/include/xen/interface/xen-compat.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/xen-compat.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/xen-compat.h linux-2.6.18-xen/include/xen/interface/xen-compat.h
+--- linux-2.6.18/include/xen/interface/xen-compat.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/xen-compat.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,26 @@
 +/******************************************************************************
 + * xen-compat.h
@@ -90520,7 +90212,7 @@
 +#ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 +#define __XEN_PUBLIC_XEN_COMPAT_H__
 +
-+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030204
++#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030203
 +
 +#if defined(__XEN__) || defined(__XEN_TOOLS__)
 +/* Xen is built with matching headers and implements the latest interface. */
@@ -90535,10 +90227,10 @@
 +#endif
 +
 +#endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/xen.h linux-2.6.18-rc6-xen/include/xen/interface/xen.h
---- linux-2.6.18-rc6/include/xen/interface/xen.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/xen.h	2006-09-04 16:31:20.000000000 +0200
-@@ -0,0 +1,569 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/xen.h linux-2.6.18-xen/include/xen/interface/xen.h
+--- linux-2.6.18/include/xen/interface/xen.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/xen.h	2006-09-17 17:44:50.000000000 +0200
+@@ -0,0 +1,558 @@
 +/******************************************************************************
 + * xen.h
 + * 
@@ -90575,7 +90267,7 @@
 +#define __HYPERVISOR_set_callbacks         4
 +#define __HYPERVISOR_fpu_taskswitch        5
 +#define __HYPERVISOR_sched_op_compat       6 /* compat since 0x00030101 */
-+#define __HYPERVISOR_platform_op           7
++#define __HYPERVISOR_dom0_op               7
 +#define __HYPERVISOR_set_debugreg          8
 +#define __HYPERVISOR_get_debugreg          9
 +#define __HYPERVISOR_update_descriptor    10
@@ -90602,9 +90294,6 @@
 +#define __HYPERVISOR_event_channel_op     32
 +#define __HYPERVISOR_physdev_op           33
 +#define __HYPERVISOR_hvm_op               34
-+#define __HYPERVISOR_sysctl               35
-+#define __HYPERVISOR_domctl               36
-+#define __HYPERVISOR_kexec_op             37
 +
 +/* Architecture-specific hypercall definitions. */
 +#define __HYPERVISOR_arch_0               48
@@ -90634,11 +90323,6 @@
 +#define __HYPERVISOR_physdev_op __HYPERVISOR_physdev_op_compat
 +#endif
 +
-+/* New platform_op hypercall introduced in 0x00030204. */
-+#if __XEN_INTERFACE_VERSION__ < 0x00030204
-+#define __HYPERVISOR_dom0_op __HYPERVISOR_platform_op
-+#endif
-+
 +/* 
 + * VIRTUAL INTERRUPTS
 + * 
@@ -91079,17 +90763,14 @@
 +    uint8_t rsvd_size;
 +} dom0_vga_console_info_t;
 +
++typedef uint64_t cpumap_t;
++
 +typedef uint8_t xen_domain_handle_t[16];
 +
 +/* Turn a plain number into a C unsigned long constant. */
 +#define __mk_unsigned_long(x) x ## UL
 +#define mk_unsigned_long(x) __mk_unsigned_long(x)
 +
-+DEFINE_XEN_GUEST_HANDLE(uint8_t);
-+DEFINE_XEN_GUEST_HANDLE(uint16_t);
-+DEFINE_XEN_GUEST_HANDLE(uint32_t);
-+DEFINE_XEN_GUEST_HANDLE(uint64_t);
-+
 +#else /* __ASSEMBLY__ */
 +
 +/* In assembly code we cannot use C numeric constant suffixes. */
@@ -91108,9 +90789,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/interface/xenoprof.h linux-2.6.18-rc6-xen/include/xen/interface/xenoprof.h
---- linux-2.6.18-rc6/include/xen/interface/xenoprof.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/interface/xenoprof.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/interface/xenoprof.h linux-2.6.18-xen/include/xen/interface/xenoprof.h
+--- linux-2.6.18/include/xen/interface/xenoprof.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/interface/xenoprof.h	2006-08-15 13:03:32.000000000 +0200
 @@ -0,0 +1,103 @@
 +/******************************************************************************
 + * xenoprof.h
@@ -91215,9 +90896,9 @@
 + * indent-tabs-mode: nil
 + * End:
 + */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/pcifront.h linux-2.6.18-rc6-xen/include/xen/pcifront.h
---- linux-2.6.18-rc6/include/xen/pcifront.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/pcifront.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/pcifront.h linux-2.6.18-xen/include/xen/pcifront.h
+--- linux-2.6.18/include/xen/pcifront.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/pcifront.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,76 @@
 +/*
 + * PCI Frontend - arch-dependendent declarations
@@ -91288,16 +90969,16 @@
 +	sd->platform_data = pdev;
 +}
 +
-+#endif /* __ia64__ */
++#endif /* __ia64__ */ 
 +
 +extern struct rw_semaphore pci_bus_sem;
 +
 +#endif /* __KERNEL__ */
 +
 +#endif /* __XEN_ASM_PCIFRONT_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/public/evtchn.h linux-2.6.18-rc6-xen/include/xen/public/evtchn.h
---- linux-2.6.18-rc6/include/xen/public/evtchn.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/public/evtchn.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/public/evtchn.h linux-2.6.18-xen/include/xen/public/evtchn.h
+--- linux-2.6.18/include/xen/public/evtchn.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/public/evtchn.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,91 @@
 +/******************************************************************************
 + * evtchn.h
@@ -91390,9 +91071,9 @@
 +	_IOC(_IOC_NONE, 'E', 5, 0)
 +
 +#endif /* __LINUX_PUBLIC_EVTCHN_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/public/privcmd.h linux-2.6.18-rc6-xen/include/xen/public/privcmd.h
---- linux-2.6.18-rc6/include/xen/public/privcmd.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/public/privcmd.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/public/privcmd.h linux-2.6.18-xen/include/xen/public/privcmd.h
+--- linux-2.6.18/include/xen/public/privcmd.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/public/privcmd.h	2006-06-19 13:20:42.000000000 +0200
 @@ -0,0 +1,79 @@
 +/******************************************************************************
 + * privcmd.h
@@ -91473,9 +91154,9 @@
 +	_IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t))
 +
 +#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/xenbus.h linux-2.6.18-rc6-xen/include/xen/xenbus.h
---- linux-2.6.18-rc6/include/xen/xenbus.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/xenbus.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/xenbus.h linux-2.6.18-xen/include/xen/xenbus.h
+--- linux-2.6.18/include/xen/xenbus.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/xenbus.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,300 @@
 +/******************************************************************************
 + * xenbus.h
@@ -91777,9 +91458,9 @@
 +int __init xenbus_dev_init(void);
 +
 +#endif /* _XEN_XENBUS_H */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/xencons.h linux-2.6.18-rc6-xen/include/xen/xencons.h
---- linux-2.6.18-rc6/include/xen/xencons.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/xencons.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/xencons.h linux-2.6.18-xen/include/xen/xencons.h
+--- linux-2.6.18/include/xen/xencons.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/xencons.h	2006-05-26 22:00:57.000000000 +0200
 @@ -0,0 +1,14 @@
 +#ifndef __ASM_XENCONS_H__
 +#define __ASM_XENCONS_H__
@@ -91795,9 +91476,9 @@
 +int xencons_ring_send(const char *data, unsigned len);
 +
 +#endif /* __ASM_XENCONS_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/include/xen/xen_proc.h linux-2.6.18-rc6-xen/include/xen/xen_proc.h
---- linux-2.6.18-rc6/include/xen/xen_proc.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/include/xen/xen_proc.h	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/include/xen/xen_proc.h linux-2.6.18-xen/include/xen/xen_proc.h
+--- linux-2.6.18/include/xen/xen_proc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/include/xen/xen_proc.h	2006-09-17 17:44:50.000000000 +0200
 @@ -0,0 +1,12 @@
 +
 +#ifndef __ASM_XEN_PROC_H__
@@ -91811,9 +91492,9 @@
 +	const char *name);
 +
 +#endif /* __ASM_XEN_PROC_H__ */
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/kernel/fork.c linux-2.6.18-rc6-xen/kernel/fork.c
---- linux-2.6.18-rc6/kernel/fork.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/kernel/fork.c	2006-09-05 10:45:48.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/kernel/fork.c linux-2.6.18-xen/kernel/fork.c
+--- linux-2.6.18/kernel/fork.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/kernel/fork.c	2006-09-20 13:58:41.000000000 +0200
 @@ -276,6 +276,9 @@
  		if (retval)
  			goto out;
@@ -91824,9 +91505,9 @@
  	retval = 0;
  out:
  	up_write(&mm->mmap_sem);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/kernel/irq/manage.c linux-2.6.18-rc6-xen/kernel/irq/manage.c
---- linux-2.6.18-rc6/kernel/irq/manage.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/kernel/irq/manage.c	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/kernel/irq/manage.c linux-2.6.18-xen/kernel/irq/manage.c
+--- linux-2.6.18/kernel/irq/manage.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/kernel/irq/manage.c	2006-09-17 17:44:50.000000000 +0200
 @@ -350,7 +350,6 @@
  	struct irqaction **p;
  	unsigned long flags;
@@ -91835,9 +91516,9 @@
  	if (irq >= NR_IRQS)
  		return;
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/kernel/Kconfig.preempt linux-2.6.18-rc6-xen/kernel/Kconfig.preempt
---- linux-2.6.18-rc6/kernel/Kconfig.preempt	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/kernel/Kconfig.preempt	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/kernel/Kconfig.preempt linux-2.6.18-xen/kernel/Kconfig.preempt
+--- linux-2.6.18/kernel/Kconfig.preempt	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/kernel/Kconfig.preempt	2006-05-26 22:00:57.000000000 +0200
 @@ -35,6 +35,7 @@
  
  config PREEMPT
@@ -91846,23 +91527,11 @@
  	help
  	  This option reduces the latency of the kernel by making
  	  all kernel code (that is not executing in a critical section)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/lib/Kconfig.debug linux-2.6.18-rc6-xen/lib/Kconfig.debug
---- linux-2.6.18-rc6/lib/Kconfig.debug	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/lib/Kconfig.debug	2006-09-04 16:31:20.000000000 +0200
-@@ -325,7 +325,7 @@
- 
- config UNWIND_INFO
- 	bool "Compile the kernel with frame unwind information"
--	depends on !IA64 && !PARISC
-+	depends on !IA64 && !PARISC && !X86_64_XEN
- 	depends on !MODULES || !(MIPS || PPC || SUPERH || V850)
- 	help
- 	  If you say Y here the resulting kernel image will be slightly larger
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/lib/Makefile linux-2.6.18-rc6-xen/lib/Makefile
---- linux-2.6.18-rc6/lib/Makefile	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/lib/Makefile	2006-09-04 16:31:20.000000000 +0200
-@@ -51,6 +51,9 @@
- obj-$(CONFIG_SMP) += percpu_counter.o
+diff -urN -x .hg -x .hgtags linux-2.6.18/lib/Makefile linux-2.6.18-xen/lib/Makefile
+--- linux-2.6.18/lib/Makefile	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/lib/Makefile	2006-09-20 13:58:41.000000000 +0200
+@@ -52,6 +52,9 @@
+ obj-$(CONFIG_AUDIT_GENERIC) += audit.o
  
  obj-$(CONFIG_SWIOTLB) += swiotlb.o
 +ifneq ($(CONFIG_XEN_IA64_DOM0_NON_VP),y)
@@ -91871,9 +91540,9 @@
  
  hostprogs-y	:= gen_crc32table
  clean-files	:= crc32table.h
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/mm/highmem.c linux-2.6.18-rc6-xen/mm/highmem.c
---- linux-2.6.18-rc6/mm/highmem.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/mm/highmem.c	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/mm/highmem.c linux-2.6.18-xen/mm/highmem.c
+--- linux-2.6.18/mm/highmem.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/mm/highmem.c	2006-08-15 13:03:33.000000000 +0200
 @@ -142,6 +142,17 @@
  	return vaddr;
  }
@@ -91892,9 +91561,9 @@
  void fastcall *kmap_high(struct page *page)
  {
  	unsigned long vaddr;
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/mm/Kconfig linux-2.6.18-rc6-xen/mm/Kconfig
---- linux-2.6.18-rc6/mm/Kconfig	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/mm/Kconfig	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/mm/Kconfig linux-2.6.18-xen/mm/Kconfig
+--- linux-2.6.18/mm/Kconfig	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/mm/Kconfig	2006-08-15 13:03:33.000000000 +0200
 @@ -127,11 +127,14 @@
  # Default to 4 for wider testing, though 8 might be more appropriate.
  # ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
@@ -91910,9 +91579,9 @@
  	default "4"
  
  #
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/mm/memory.c linux-2.6.18-rc6-xen/mm/memory.c
---- linux-2.6.18-rc6/mm/memory.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/mm/memory.c	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/mm/memory.c linux-2.6.18-xen/mm/memory.c
+--- linux-2.6.18/mm/memory.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/mm/memory.c	2006-09-17 17:44:50.000000000 +0200
 @@ -390,7 +390,7 @@
  
  	if (unlikely(vma->vm_flags & VM_PFNMAP)) {
@@ -92052,10 +91721,10 @@
  /*
   * handle_pte_fault chooses page fault handler according to an entry
   * which was read non-atomically.  Before making any commitment, on
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/mm/mmap.c linux-2.6.18-rc6-xen/mm/mmap.c
---- linux-2.6.18-rc6/mm/mmap.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/mm/mmap.c	2006-09-04 16:31:20.000000000 +0200
-@@ -1950,6 +1950,10 @@
+diff -urN -x .hg -x .hgtags linux-2.6.18/mm/mmap.c linux-2.6.18-xen/mm/mmap.c
+--- linux-2.6.18/mm/mmap.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/mm/mmap.c	2006-09-20 13:58:41.000000000 +0200
+@@ -1963,6 +1963,10 @@
  	unsigned long nr_accounted = 0;
  	unsigned long end;
  
@@ -92066,9 +91735,9 @@
  	lru_add_drain();
  	flush_cache_mm(mm);
  	tlb = tlb_gather_mmu(mm, 1);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/mm/page_alloc.c linux-2.6.18-rc6-xen/mm/page_alloc.c
---- linux-2.6.18-rc6/mm/page_alloc.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/mm/page_alloc.c	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/mm/page_alloc.c linux-2.6.18-xen/mm/page_alloc.c
+--- linux-2.6.18/mm/page_alloc.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/mm/page_alloc.c	2006-08-15 13:03:33.000000000 +0200
 @@ -443,7 +443,8 @@
  	int i;
  	int reserved = 0;
@@ -92089,9 +91758,9 @@
  
  	if (PageAnon(page))
  		page->mapping = NULL;
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/net/core/dev.c linux-2.6.18-rc6-xen/net/core/dev.c
---- linux-2.6.18-rc6/net/core/dev.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/net/core/dev.c	2006-09-04 16:31:20.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/net/core/dev.c linux-2.6.18-xen/net/core/dev.c
+--- linux-2.6.18/net/core/dev.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/net/core/dev.c	2006-09-17 17:44:50.000000000 +0200
 @@ -118,6 +118,12 @@
  #include <linux/err.h>
  #include <linux/ctype.h>
@@ -92190,9 +91859,9 @@
  
  #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
  EXPORT_SYMBOL(br_handle_frame_hook);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/net/core/skbuff.c linux-2.6.18-rc6-xen/net/core/skbuff.c
---- linux-2.6.18-rc6/net/core/skbuff.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/net/core/skbuff.c	2006-09-04 16:31:21.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/net/core/skbuff.c linux-2.6.18-xen/net/core/skbuff.c
+--- linux-2.6.18/net/core/skbuff.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/net/core/skbuff.c	2006-09-17 17:44:50.000000000 +0200
 @@ -139,6 +139,7 @@
   *	Buffers may only be allocated from interrupts using a @gfp_mask of
   *	%GFP_ATOMIC.
@@ -92263,9 +91932,9 @@
  	C(pkt_type);
  	C(ip_summed);
  	C(priority);
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/net/ipv4/netfilter/ip_nat_proto_tcp.c linux-2.6.18-rc6-xen/net/ipv4/netfilter/ip_nat_proto_tcp.c
---- linux-2.6.18-rc6/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-09-04 16:31:22.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/net/ipv4/netfilter/ip_nat_proto_tcp.c linux-2.6.18-xen/net/ipv4/netfilter/ip_nat_proto_tcp.c
+--- linux-2.6.18/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-08-15 13:03:34.000000000 +0200
 @@ -129,7 +129,12 @@
  	if (hdrsize < sizeof(*hdr))
  		return 1;
@@ -92280,9 +91949,9 @@
  					ip_nat_cheat_check(oldport ^ 0xFFFF,
  							   newport,
  							   hdr->check));
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/net/ipv4/netfilter/ip_nat_proto_udp.c linux-2.6.18-rc6-xen/net/ipv4/netfilter/ip_nat_proto_udp.c
---- linux-2.6.18-rc6/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-06-18 03:49:35.000000000 +0200
-+++ linux-2.6.18-rc6-xen/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-09-04 16:31:22.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/net/ipv4/netfilter/ip_nat_proto_udp.c linux-2.6.18-xen/net/ipv4/netfilter/ip_nat_proto_udp.c
+--- linux-2.6.18/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-09-17 17:44:50.000000000 +0200
 @@ -114,7 +114,12 @@
  		portptr = &hdr->dest;
  	}
@@ -92297,9 +91966,9 @@
  					ip_nat_cheat_check(*portptr ^ 0xFFFF,
  							   newport,
  							   hdr->check));
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/net/ipv4/xfrm4_output.c linux-2.6.18-rc6-xen/net/ipv4/xfrm4_output.c
---- linux-2.6.18-rc6/net/ipv4/xfrm4_output.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/net/ipv4/xfrm4_output.c	2006-09-04 16:31:23.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/net/ipv4/xfrm4_output.c linux-2.6.18-xen/net/ipv4/xfrm4_output.c
+--- linux-2.6.18/net/ipv4/xfrm4_output.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/net/ipv4/xfrm4_output.c	2006-08-15 13:03:34.000000000 +0200
 @@ -18,6 +18,8 @@
  #include <net/xfrm.h>
  #include <net/icmp.h>
@@ -92320,9 +91989,9 @@
  	if (skb->ip_summed == CHECKSUM_HW) {
  		err = skb_checksum_help(skb, 0);
  		if (err)
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/net/ipv6/addrconf.c linux-2.6.18-rc6-xen/net/ipv6/addrconf.c
---- linux-2.6.18-rc6/net/ipv6/addrconf.c	2006-09-05 10:53:27.000000000 +0200
-+++ linux-2.6.18-rc6-xen/net/ipv6/addrconf.c	2006-09-04 16:31:23.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/net/ipv6/addrconf.c linux-2.6.18-xen/net/ipv6/addrconf.c
+--- linux-2.6.18/net/ipv6/addrconf.c	2006-09-20 05:42:06.000000000 +0200
++++ linux-2.6.18-xen/net/ipv6/addrconf.c	2006-09-17 17:44:50.000000000 +0200
 @@ -2514,6 +2514,7 @@
  	spin_lock_bh(&ifp->lock);
  
@@ -92339,9 +92008,9 @@
  	    (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {
  		struct in6_addr all_routers;
  
-diff -urN -x .hg -x .hgtags linux-2.6.18-rc6/scripts/Makefile.xen linux-2.6.18-rc6-xen/scripts/Makefile.xen
---- linux-2.6.18-rc6/scripts/Makefile.xen	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-rc6-xen/scripts/Makefile.xen	2006-09-04 16:31:23.000000000 +0200
+diff -urN -x .hg -x .hgtags linux-2.6.18/scripts/Makefile.xen linux-2.6.18-xen/scripts/Makefile.xen
+--- linux-2.6.18/scripts/Makefile.xen	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.18-xen/scripts/Makefile.xen	2006-05-26 22:01:02.000000000 +0200
 @@ -0,0 +1,14 @@
 +
 +# cherrypickxen($1 = allobj)

Modified: dists/trunk/linux-2.6/debian/patches/series/1-extra
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/1-extra	(original)
+++ dists/trunk/linux-2.6/debian/patches/series/1-extra	Wed Sep 20 12:03:12 2006
@@ -1,4 +1,4 @@
-+ features/all/xen/fedora-35901.patch *_xen *_xen-vserver
++ features/all/xen/upstream-35844.patch *_xen *_xen-vserver
 + mips-tulip.patch mipsel
 + mips-tulip_dc21143.patch mipsel
 + mips-dec-scsi.patch mipsel



More information about the Kernel-svn-changes mailing list