Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2009-11-06 14:41:36 +0100
committerMichal Marek <mmarek@suse.cz>2009-11-06 14:41:36 +0100
commitbe8ded197d09da4ff9ba85af6b3d9b5098a0de7f (patch)
treeca89369d023fde8324f0f04a3678eb5320533154
parentd6093693e0980717a6fafc3d9c1cc87cf10ad27f (diff)
parentaee2f292c87f3e09318e6ed346cd9b515de7f59b (diff)
Merge branch 'master' into SLE11-SP1rpm-2.6.32-0.4
-rw-r--r--config/i386/ec21
-rw-r--r--config/i386/xen3
-rw-r--r--config/x86_64/ec21
-rw-r--r--config/x86_64/xen3
-rw-r--r--kernel-source.changes12
-rw-r--r--patches.xen/add-console-use-vt14
-rw-r--r--patches.xen/ipv6-no-autoconf6
-rw-r--r--patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch13
-rw-r--r--patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch13
-rw-r--r--patches.xen/pci-guestdev67
-rw-r--r--patches.xen/pci-reserve39
-rw-r--r--patches.xen/sfc-driverlink60
-rw-r--r--patches.xen/sfc-driverlink-conditional52
-rw-r--r--patches.xen/sfc-endianness13
-rw-r--r--patches.xen/sfc-external-sram16
-rw-r--r--patches.xen/sfc-resource-driver368
-rw-r--r--patches.xen/sfc-sync-headers78
-rw-r--r--patches.xen/tmem103
-rw-r--r--patches.xen/xen-balloon-max-target18
-rw-r--r--patches.xen/xen-blkback-bimodal-suse16
-rw-r--r--patches.xen/xen-blkback-cdrom30
-rw-r--r--patches.xen/xen-blkfront-cdrom42
-rw-r--r--patches.xen/xen-blkif-protocol-fallback-hack87
-rw-r--r--patches.xen/xen-blktap-write-barriers15
-rw-r--r--patches.xen/xen-configurable-guest-devices24
-rw-r--r--patches.xen/xen-cpufreq-report18
-rw-r--r--patches.xen/xen-ipi-per-cpu-irq89
-rw-r--r--patches.xen/xen-kconfig-compat16
-rw-r--r--patches.xen/xen-modular-blktap18
-rw-r--r--patches.xen/xen-netback-notify-multi22
-rw-r--r--patches.xen/xen-netback-nr-irqs19
-rw-r--r--patches.xen/xen-op-packet83
-rw-r--r--patches.xen/xen-scsifront-block-timeout-update10
-rw-r--r--patches.xen/xen-sections27
-rw-r--r--patches.xen/xen-staging-build18
-rw-r--r--patches.xen/xen-swiotlb-heuristics8
-rw-r--r--patches.xen/xen-sysdev-suspend47
-rw-r--r--patches.xen/xen-unpriv-build37
-rw-r--r--patches.xen/xen-virq-per-cpu-irq82
-rw-r--r--patches.xen/xen-x86-bigmem22
-rw-r--r--patches.xen/xen-x86-consistent-nmi45
-rw-r--r--patches.xen/xen-x86-dcr-fallback18
-rw-r--r--patches.xen/xen-x86-exit-mmap8
-rw-r--r--patches.xen/xen-x86-machphys-prediction18
-rw-r--r--patches.xen/xen-x86-no-lapic56
-rw-r--r--patches.xen/xen-x86-panic-no-reboot8
-rw-r--r--patches.xen/xen-x86-per-cpu-vcpu-info86
-rw-r--r--patches.xen/xen-x86-pmd-handling47
-rw-r--r--patches.xen/xen-x86_64-dump-user-pgt8
-rw-r--r--patches.xen/xen-x86_64-note-init-p2m52
-rw-r--r--patches.xen/xen-x86_64-pgd-alloc-order91
-rw-r--r--patches.xen/xen-x86_64-pgd-pin31
-rw-r--r--patches.xen/xen3-auto-arch-i386.diff30
-rw-r--r--patches.xen/xen3-auto-arch-x86.diff245
-rw-r--r--patches.xen/xen3-auto-arch-x86_64.diff20
-rw-r--r--patches.xen/xen3-auto-common.diff283
-rw-r--r--patches.xen/xen3-auto-include-xen-interface.diff170
-rw-r--r--patches.xen/xen3-auto-xen-arch.diff46113
-rw-r--r--patches.xen/xen3-auto-xen-drivers.diff1298
-rw-r--r--patches.xen/xen3-auto-xen-kconfig.diff60
-rw-r--r--patches.xen/xen3-fixup-arch-x8646
-rw-r--r--patches.xen/xen3-fixup-common75
-rw-r--r--patches.xen/xen3-fixup-kconfig18
-rw-r--r--patches.xen/xen3-fixup-xen318
-rw-r--r--patches.xen/xen3-kdb-x8613
-rw-r--r--patches.xen/xen3-patch-2.6.18114
-rw-r--r--patches.xen/xen3-patch-2.6.1910638
-rw-r--r--patches.xen/xen3-patch-2.6.203787
-rw-r--r--patches.xen/xen3-patch-2.6.213311
-rw-r--r--patches.xen/xen3-patch-2.6.227879
-rw-r--r--patches.xen/xen3-patch-2.6.234306
-rw-r--r--patches.xen/xen3-patch-2.6.245305
-rw-r--r--patches.xen/xen3-patch-2.6.2516735
-rw-r--r--patches.xen/xen3-patch-2.6.269625
-rw-r--r--patches.xen/xen3-patch-2.6.275315
-rw-r--r--patches.xen/xen3-patch-2.6.288147
-rw-r--r--patches.xen/xen3-patch-2.6.294729
-rw-r--r--patches.xen/xen3-patch-2.6.301011
-rw-r--r--patches.xen/xen3-patch-2.6.31700
-rw-r--r--patches.xen/xen3-patch-2.6.32-rc4568
-rw-r--r--patches.xen/xen3-patch-2.6.32-rc4-rc582
-rw-r--r--patches.xen/xen3-patch-2.6.32-rc5-rc648
-rw-r--r--patches.xen/xen3-seccomp-disable-tsc-option8
-rw-r--r--patches.xen/xen3-stack-unwind13
-rw-r--r--patches.xen/xen3-x86_64-unwind-annotations8
-rw-r--r--rpm/kernel-binary.spec.in6
-rw-r--r--series.conf2
-rw-r--r--supported.conf1
88 files changed, 65450 insertions, 67655 deletions
diff --git a/config/i386/ec2 b/config/i386/ec2
index 924726108c..8ad03652e2 100644
--- a/config/i386/ec2
+++ b/config/i386/ec2
@@ -1168,6 +1168,7 @@ CONFIG_XEN_COMPAT_030004_AND_LATER=y
# CONFIG_XEN_COMPAT_030100_AND_LATER is not set
# CONFIG_XEN_COMPAT_030200_AND_LATER is not set
# CONFIG_XEN_COMPAT_030300_AND_LATER is not set
+# CONFIG_XEN_COMPAT_030400_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
CONFIG_XEN_COMPAT=0x030004
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
diff --git a/config/i386/xen b/config/i386/xen
index 0751b41cd1..76ab7f91f9 100644
--- a/config/i386/xen
+++ b/config/i386/xen
@@ -2102,7 +2102,6 @@ CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
-CONFIG_VMXNET3=m
CONFIG_ISDN=y
CONFIG_ISDN_I4L=m
CONFIG_MISDN=m
@@ -4047,6 +4046,7 @@ CONFIG_XEN_INTERFACE_VERSION=0x00030207
CONFIG_XEN_PRIVILEGED_GUEST=y
# CONFIG_XEN_UNPRIVILEGED_GUEST is not set
CONFIG_XEN_PRIVCMD=y
+CONFIG_XEN_DOMCTL=m
CONFIG_XEN_XENBUS_DEV=y
CONFIG_XEN_NETDEV_ACCEL_SFC_UTIL=m
CONFIG_XEN_BACKEND=m
@@ -4086,6 +4086,7 @@ CONFIG_XEN_NR_GUEST_DEVICES=256
# CONFIG_XEN_COMPAT_030100_AND_LATER is not set
# CONFIG_XEN_COMPAT_030200_AND_LATER is not set
CONFIG_XEN_COMPAT_030300_AND_LATER=y
+# CONFIG_XEN_COMPAT_030400_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
CONFIG_XEN_COMPAT=0x030300
CONFIG_XEN_VCPU_INFO_PLACEMENT=y
diff --git a/config/x86_64/ec2 b/config/x86_64/ec2
index ff3ca6dad3..dbf8398d60 100644
--- a/config/x86_64/ec2
+++ b/config/x86_64/ec2
@@ -1152,6 +1152,7 @@ CONFIG_XEN_COMPAT_030004_AND_LATER=y
# CONFIG_XEN_COMPAT_030100_AND_LATER is not set
# CONFIG_XEN_COMPAT_030200_AND_LATER is not set
# CONFIG_XEN_COMPAT_030300_AND_LATER is not set
+# CONFIG_XEN_COMPAT_030400_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
CONFIG_XEN_COMPAT=0x030004
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
diff --git a/config/x86_64/xen b/config/x86_64/xen
index 2537e6aed5..d6c390ebcc 100644
--- a/config/x86_64/xen
+++ b/config/x86_64/xen
@@ -2069,7 +2069,6 @@ CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
-CONFIG_VMXNET3=m
CONFIG_ISDN=y
CONFIG_ISDN_I4L=m
CONFIG_MISDN=m
@@ -3986,6 +3985,7 @@ CONFIG_XEN_INTERFACE_VERSION=0x00030207
CONFIG_XEN_PRIVILEGED_GUEST=y
# CONFIG_XEN_UNPRIVILEGED_GUEST is not set
CONFIG_XEN_PRIVCMD=y
+CONFIG_XEN_DOMCTL=m
CONFIG_XEN_XENBUS_DEV=y
CONFIG_XEN_NETDEV_ACCEL_SFC_UTIL=m
CONFIG_XEN_BACKEND=m
@@ -4025,6 +4025,7 @@ CONFIG_XEN_NR_GUEST_DEVICES=2048
# CONFIG_XEN_COMPAT_030100_AND_LATER is not set
# CONFIG_XEN_COMPAT_030200_AND_LATER is not set
CONFIG_XEN_COMPAT_030300_AND_LATER=y
+# CONFIG_XEN_COMPAT_030400_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
CONFIG_XEN_COMPAT=0x030300
CONFIG_XEN_VCPU_INFO_PLACEMENT=y
diff --git a/kernel-source.changes b/kernel-source.changes
index 5d2841422b..c6bb15f143 100644
--- a/kernel-source.changes
+++ b/kernel-source.changes
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Fri Nov 6 13:33:27 CET 2009 - mmarek@suse.cz
+
+- rpm/kernel-binary.spec.in: fix last change.
+
+-------------------------------------------------------------------
+Fri Nov 6 12:47:52 CET 2009 - jbeulich@novell.com
+
+- Update Xen patches to 2.6.32-rc6 and c/s 941.
+- Update Xen config files.
+- supported.conf: Add domctl.
+
+-------------------------------------------------------------------
Fri Nov 6 09:50:40 CET 2009 - mmarek@suse.cz
- rpm/kernel-binary.spec.in: add the /lib/modules/.../{source,devel}
diff --git a/patches.xen/add-console-use-vt b/patches.xen/add-console-use-vt
index 906f943fa4..953d72b357 100644
--- a/patches.xen/add-console-use-vt
+++ b/patches.xen/add-console-use-vt
@@ -5,12 +5,12 @@ Patch-mainline: no
$subject says all
---
- drivers/char/tty_io.c | 7 +++++--
+ drivers/char/tty_io.c | 7 ++++++-
include/linux/console.h | 1 +
- 2 files changed, 6 insertions(+), 2 deletions(-)
+ 2 files changed, 7 insertions(+), 1 deletion(-)
---- a/drivers/char/tty_io.c
-+++ b/drivers/char/tty_io.c
+--- head-2009-10-12.orig/drivers/char/tty_io.c 2009-10-12 11:46:55.000000000 +0200
++++ head-2009-10-12/drivers/char/tty_io.c 2009-10-12 12:16:48.000000000 +0200
@@ -136,6 +136,8 @@ LIST_HEAD(tty_drivers); /* linked list
DEFINE_MUTEX(tty_mutex);
EXPORT_SYMBOL(tty_mutex);
@@ -39,9 +39,9 @@ $subject says all
#endif
return 0;
}
---- a/include/linux/console.h
-+++ b/include/linux/console.h
-@@ -63,6 +63,7 @@ extern const struct consw dummy_con; /*
+--- head-2009-10-12.orig/include/linux/console.h 2009-10-12 11:47:00.000000000 +0200
++++ head-2009-10-12/include/linux/console.h 2009-10-12 12:16:48.000000000 +0200
+@@ -63,6 +63,7 @@ extern const struct consw dummy_con; /*
extern const struct consw vga_con; /* VGA text console */
extern const struct consw newport_con; /* SGI Newport console */
extern const struct consw prom_con; /* SPARC PROM console */
diff --git a/patches.xen/ipv6-no-autoconf b/patches.xen/ipv6-no-autoconf
index 8f81e9eac5..bc515a7de8 100644
--- a/patches.xen/ipv6-no-autoconf
+++ b/patches.xen/ipv6-no-autoconf
@@ -15,10 +15,10 @@ interface's ability to do multicast. Turning off multicast for an
interface before bringing it up will suppress autoconfiguration.
net/ipv6/addrconf.c | 2 ++
- 1 file changed, 2 insertions(+)
+ 1 files changed, 2 insertions(+)
---- a/net/ipv6/addrconf.c
-+++ b/net/ipv6/addrconf.c
+--- head-2009-10-12.orig/net/ipv6/addrconf.c 2009-10-12 11:46:39.000000000 +0200
++++ head-2009-10-12/net/ipv6/addrconf.c 2009-10-12 12:17:01.000000000 +0200
@@ -2796,6 +2796,7 @@ static void addrconf_dad_start(struct in
spin_lock_bh(&ifp->lock);
diff --git a/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch b/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch
index dea1709990..64b80a4d46 100644
--- a/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch
+++ b/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch
@@ -17,13 +17,8 @@ Acked-by: jbeulich@novell.com
Applies to 2.6.19-rc1.
jb: fixed up register usage (paralleling what's needed for 2.6.30 on x86-64)
----
- arch/x86/kernel/machine_kexec_32.c | 60 -----------------------------------
- arch/x86/kernel/relocate_kernel_32.S | 39 +++++++++++++++++++++-
- 2 files changed, 37 insertions(+), 62 deletions(-)
-
---- a/arch/x86/kernel/machine_kexec_32.c
-+++ b/arch/x86/kernel/machine_kexec_32.c
+--- head-2009-10-06.orig/arch/x86/kernel/machine_kexec_32.c 2009-10-12 10:33:15.000000000 +0200
++++ head-2009-10-06/arch/x86/kernel/machine_kexec_32.c 2009-04-21 10:33:15.000000000 +0200
@@ -26,48 +26,6 @@
#include <asm/system.h>
#include <asm/cacheflush.h>
@@ -98,8 +93,8 @@ Acked-by: jbeulich@novell.com
/* now call it */
image->start = relocate_kernel_ptr((unsigned long)image->head,
(unsigned long)page_list,
---- a/arch/x86/kernel/relocate_kernel_32.S
-+++ b/arch/x86/kernel/relocate_kernel_32.S
+--- head-2009-10-06.orig/arch/x86/kernel/relocate_kernel_32.S 2009-10-12 10:33:15.000000000 +0200
++++ head-2009-10-06/arch/x86/kernel/relocate_kernel_32.S 2009-10-12 10:39:36.000000000 +0200
@@ -87,14 +87,32 @@ relocate_kernel:
movl PTR(PA_PGD)(%ebp), %eax
movl %eax, %cr3
diff --git a/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch b/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch
index 221283ec7c..cbf66fcb82 100644
--- a/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch
+++ b/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch
@@ -17,13 +17,8 @@ Acked-by: jbeulich@novell.com
Applies to 2.6.19-rc1.
jb: fixed up register usage for 2.6.30 (bnc#545206)
----
- arch/x86/kernel/machine_kexec_64.c | 59 -----------------------------------
- arch/x86/kernel/relocate_kernel_64.S | 36 ++++++++++++++++++++-
- 2 files changed, 34 insertions(+), 61 deletions(-)
-
---- a/arch/x86/kernel/machine_kexec_64.c
-+++ b/arch/x86/kernel/machine_kexec_64.c
+--- head-2009-10-06.orig/arch/x86/kernel/machine_kexec_64.c 2009-10-12 10:17:22.000000000 +0200
++++ head-2009-10-06/arch/x86/kernel/machine_kexec_64.c 2009-04-21 10:35:13.000000000 +0200
@@ -201,47 +201,6 @@ static int init_pgtable(struct kimage *i
return init_transition_pgtable(image, level4p);
}
@@ -97,8 +92,8 @@ Acked-by: jbeulich@novell.com
/* now call it */
image->start = relocate_kernel((unsigned long)image->head,
(unsigned long)page_list,
---- a/arch/x86/kernel/relocate_kernel_64.S
-+++ b/arch/x86/kernel/relocate_kernel_64.S
+--- head-2009-10-06.orig/arch/x86/kernel/relocate_kernel_64.S 2009-10-12 10:17:22.000000000 +0200
++++ head-2009-10-06/arch/x86/kernel/relocate_kernel_64.S 2009-10-12 10:32:00.000000000 +0200
@@ -91,13 +91,30 @@ relocate_kernel:
/* Switch to the identity mapped page tables */
movq %r9, %cr3
diff --git a/patches.xen/pci-guestdev b/patches.xen/pci-guestdev
index 7e62d63309..a370a2ae62 100644
--- a/patches.xen/pci-guestdev
+++ b/patches.xen/pci-guestdev
@@ -3,24 +3,9 @@ From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 898:ca12928cdafe)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
----
- Documentation/kernel-parameters.txt | 22
- drivers/acpi/pci_root.c | 69 +
- drivers/acpi/scan.c | 25
- drivers/pci/Kconfig | 14
- drivers/pci/Makefile | 2
- drivers/pci/guestdev.c | 887 ++++++++++++++++++++++
- drivers/pci/iomulti.c | 1415 ++++++++++++++++++++++++++++++++++++
- drivers/pci/iomulti.h | 51 +
- drivers/pci/pci.c | 7
- drivers/pci/pci.h | 7
- include/linux/acpi.h | 2
- include/linux/pci.h | 6
- 12 files changed, 2507 insertions(+)
-
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -808,6 +808,24 @@ and is between 256 and 4096 characters.
+--- head-2009-11-06.orig/Documentation/kernel-parameters.txt 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/Documentation/kernel-parameters.txt 2009-11-06 10:30:33.000000000 +0100
+@@ -808,6 +808,24 @@ and is between 256 and 4096 characters.
gpt [EFI] Forces disk with valid GPT signature but
invalid Protective MBR to be treated as GPT.
@@ -45,7 +30,7 @@ Acked-by: jbeulich@novell.com
gvp11= [HW,SCSI]
hashdist= [KNL,NUMA] Large hashes allocated during boot
-@@ -2125,6 +2143,10 @@ and is between 256 and 4096 characters.
+@@ -2125,6 +2143,10 @@ and is between 256 and 4096 characters.
Run specified binary instead of /init from the ramdisk,
used for early userspace startup. See initrd.
@@ -56,8 +41,8 @@ Acked-by: jbeulich@novell.com
reboot= [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode
Format: <reboot_mode>[,<reboot_mode2>[,...]]
See arch/*/kernel/reboot.c or arch/*/kernel/process.c
---- a/drivers/acpi/pci_root.c
-+++ b/drivers/acpi/pci_root.c
+--- head-2009-11-06.orig/drivers/acpi/pci_root.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/pci_root.c 2009-11-06 10:30:33.000000000 +0100
@@ -465,6 +465,40 @@ out:
}
EXPORT_SYMBOL(acpi_pci_osc_control_set);
@@ -145,8 +130,8 @@ Acked-by: jbeulich@novell.com
+ return FALSE;
+}
+#endif
---- a/drivers/acpi/scan.c
-+++ b/drivers/acpi/scan.c
+--- head-2009-11-06.orig/drivers/acpi/scan.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/scan.c 2009-11-06 10:30:33.000000000 +0100
@@ -168,6 +168,16 @@ acpi_device_hid_show(struct device *dev,
}
static DEVICE_ATTR(hid, 0444, acpi_device_hid_show, NULL);
@@ -200,8 +185,8 @@ Acked-by: jbeulich@novell.com
if (info->valid & ACPI_VALID_ADR) {
device->pnp.bus_address = info->address;
device->flags.bus_address = 1;
---- a/drivers/pci/Kconfig
-+++ b/drivers/pci/Kconfig
+--- head-2009-11-06.orig/drivers/pci/Kconfig 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/pci/Kconfig 2009-11-06 10:30:33.000000000 +0100
@@ -42,6 +42,20 @@ config PCI_DEBUG
When in doubt, say N.
@@ -223,8 +208,8 @@ Acked-by: jbeulich@novell.com
config PCI_STUB
tristate "PCI Stub driver"
depends on PCI
---- a/drivers/pci/Makefile
-+++ b/drivers/pci/Makefile
+--- head-2009-11-06.orig/drivers/pci/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/pci/Makefile 2009-11-06 10:30:33.000000000 +0100
@@ -7,6 +7,8 @@ obj-y += access.o bus.o probe.o remove.
irq.o
obj-$(CONFIG_PROC_FS) += proc.o
@@ -234,8 +219,8 @@ Acked-by: jbeulich@novell.com
obj-$(CONFIG_PCI_LEGACY) += legacy.o
CFLAGS_legacy.o += -Wno-deprecated-declarations
---- /dev/null
-+++ b/drivers/pci/guestdev.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/pci/guestdev.c 2009-11-06 10:30:33.000000000 +0100
@@ -0,0 +1,887 @@
+/*
+ * Copyright (c) 2008, 2009 NEC Corporation.
@@ -1124,8 +1109,8 @@ Acked-by: jbeulich@novell.com
+
+fs_initcall(pci_check_guestdev_exists);
+
---- /dev/null
-+++ b/drivers/pci/iomulti.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/pci/iomulti.c 2009-11-06 10:30:33.000000000 +0100
@@ -0,0 +1,1415 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@@ -2542,8 +2527,8 @@ Acked-by: jbeulich@novell.com
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Isaku Yamahata <yamahata@valinux.co.jp>");
+MODULE_DESCRIPTION("PCI IO space multiplexing driver");
---- /dev/null
-+++ b/drivers/pci/iomulti.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/pci/iomulti.h 2009-11-06 10:30:33.000000000 +0100
@@ -0,0 +1,51 @@
+#ifndef PCI_IOMULTI_H
+#define PCI_IOMULTI_H
@@ -2596,8 +2581,8 @@ Acked-by: jbeulich@novell.com
+#define PCI_IOMUL_OUT _IOW ('P', 3, struct pci_iomul_out)
+
+#endif /* PCI_IOMULTI_H */
---- a/drivers/pci/pci.c
-+++ b/drivers/pci/pci.c
+--- head-2009-11-06.orig/drivers/pci/pci.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/pci/pci.c 2009-11-06 10:30:33.000000000 +0100
@@ -2658,6 +2658,13 @@ resource_size_t pci_specified_resource_a
*/
int pci_is_reassigndev(struct pci_dev *dev)
@@ -2612,8 +2597,8 @@ Acked-by: jbeulich@novell.com
return (pci_specified_resource_alignment(dev) != 0);
}
---- a/drivers/pci/pci.h
-+++ b/drivers/pci/pci.h
+--- head-2009-11-06.orig/drivers/pci/pci.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/pci/pci.h 2009-11-06 10:30:33.000000000 +0100
@@ -311,4 +311,11 @@ static inline int pci_resource_alignment
return resource_alignment(res);
}
@@ -2626,8 +2611,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
#endif /* DRIVERS_PCI_H */
---- a/include/linux/acpi.h
-+++ b/include/linux/acpi.h
+--- head-2009-11-06.orig/include/linux/acpi.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/acpi.h 2009-11-06 10:30:33.000000000 +0100
@@ -247,6 +247,8 @@ int acpi_check_region(resource_size_t st
int acpi_check_mem_region(resource_size_t start, resource_size_t n,
const char *name);
@@ -2637,8 +2622,8 @@ Acked-by: jbeulich@novell.com
#ifdef CONFIG_PM_SLEEP
void __init acpi_no_s4_hw_signature(void);
void __init acpi_old_suspend_ordering(void);
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
+--- head-2009-11-06.orig/include/linux/pci.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/pci.h 2009-11-06 10:30:33.000000000 +0100
@@ -1290,5 +1290,11 @@ extern void pci_hp_create_module_link(st
extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
#endif
diff --git a/patches.xen/pci-reserve b/patches.xen/pci-reserve
index 7cf0317ba7..ee4b057ef4 100644
--- a/patches.xen/pci-reserve
+++ b/patches.xen/pci-reserve
@@ -8,18 +8,9 @@ by PCI hotplug.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: jbeulich@novell.com
----
- Documentation/kernel-parameters.txt | 7 +
- drivers/pci/Kconfig | 7 +
- drivers/pci/Makefile | 1
- drivers/pci/pci.h | 15 +++
- drivers/pci/reserve.c | 143 ++++++++++++++++++++++++++++++++++++
- drivers/pci/setup-bus.c | 5 -
- 6 files changed, 176 insertions(+), 2 deletions(-)
-
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -1989,6 +1989,13 @@ and is between 256 and 4096 characters.
+--- head-2009-10-15.orig/Documentation/kernel-parameters.txt 2009-10-15 11:48:37.000000000 +0200
++++ head-2009-10-15/Documentation/kernel-parameters.txt 2009-10-15 11:48:42.000000000 +0200
+@@ -1989,6 +1989,13 @@ and is between 256 and 4096 characters.
off: Turn ECRC off
on: Turn ECRC on.
@@ -33,8 +24,8 @@ Acked-by: jbeulich@novell.com
pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power
Management.
off Disable ASPM.
---- a/drivers/pci/Kconfig
-+++ b/drivers/pci/Kconfig
+--- head-2009-10-15.orig/drivers/pci/Kconfig 2009-10-15 11:48:37.000000000 +0200
++++ head-2009-10-15/drivers/pci/Kconfig 2009-10-15 11:48:42.000000000 +0200
@@ -56,6 +56,13 @@ config PCI_IOMULTI
help
Say Y here if you need io multiplexing.
@@ -49,8 +40,8 @@ Acked-by: jbeulich@novell.com
config PCI_STUB
tristate "PCI Stub driver"
depends on PCI
---- a/drivers/pci/Makefile
-+++ b/drivers/pci/Makefile
+--- head-2009-10-15.orig/drivers/pci/Makefile 2009-10-15 11:48:37.000000000 +0200
++++ head-2009-10-15/drivers/pci/Makefile 2009-10-15 11:48:42.000000000 +0200
@@ -9,6 +9,7 @@ obj-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_SYSFS) += slot.o
obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
@@ -59,8 +50,8 @@ Acked-by: jbeulich@novell.com
obj-$(CONFIG_PCI_LEGACY) += legacy.o
CFLAGS_legacy.o += -Wno-deprecated-declarations
---- a/drivers/pci/pci.h
-+++ b/drivers/pci/pci.h
+--- head-2009-10-15.orig/drivers/pci/pci.h 2009-10-15 11:48:37.000000000 +0200
++++ head-2009-10-15/drivers/pci/pci.h 2009-10-15 11:48:42.000000000 +0200
@@ -318,4 +318,19 @@ extern int pci_is_iomuldev(struct pci_de
#define pci_is_iomuldev(dev) 0
#endif
@@ -81,8 +72,8 @@ Acked-by: jbeulich@novell.com
+#endif /* CONFIG_PCI_RESERVE */
+
#endif /* DRIVERS_PCI_H */
---- /dev/null
-+++ b/drivers/pci/reserve.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-10-15/drivers/pci/reserve.c 2009-10-15 11:48:42.000000000 +0200
@@ -0,0 +1,143 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@@ -227,9 +218,9 @@ Acked-by: jbeulich@novell.com
+ return 1;
+}
+__setup("pci_reserve=", pci_reserve_setup);
---- a/drivers/pci/setup-bus.c
-+++ b/drivers/pci/setup-bus.c
-@@ -343,7 +343,7 @@ static void pbus_size_io(struct pci_bus
+--- head-2009-10-15.orig/drivers/pci/setup-bus.c 2009-10-12 11:46:29.000000000 +0200
++++ head-2009-10-15/drivers/pci/setup-bus.c 2009-10-15 11:48:42.000000000 +0200
+@@ -343,7 +343,7 @@ static void pbus_size_io(struct pci_bus
#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
size = (size & 0xff) + ((size & ~0xffUL) << 2);
#endif
@@ -238,7 +229,7 @@ Acked-by: jbeulich@novell.com
if (!size) {
b_res->flags = 0;
return;
-@@ -423,7 +423,8 @@ static int pbus_size_mem(struct pci_bus
+@@ -423,7 +423,8 @@ static int pbus_size_mem(struct pci_bus
min_align = align1 >> 1;
align += aligns[order];
}
diff --git a/patches.xen/sfc-driverlink b/patches.xen/sfc-driverlink
index c28a4bd920..02f8f9d1b3 100644
--- a/patches.xen/sfc-driverlink
+++ b/patches.xen/sfc-driverlink
@@ -8,20 +8,8 @@ Subject: sfc: Driverlink API for exporting hardware features to client drivers
References: FATE#303479
Acked-by: jbeulich@novell.com
----
- drivers/net/sfc/Makefile | 3
- drivers/net/sfc/driverlink.c | 367 +++++++++++++++++++++++++++++++++++++++
- drivers/net/sfc/driverlink.h | 43 ++++
- drivers/net/sfc/driverlink_api.h | 303 ++++++++++++++++++++++++++++++++
- drivers/net/sfc/efx.c | 40 ++++
- drivers/net/sfc/falcon.c | 78 +++++++-
- drivers/net/sfc/net_driver.h | 15 +
- drivers/net/sfc/rx.c | 25 ++
- drivers/net/sfc/tx.c | 12 +
- 9 files changed, 879 insertions(+), 7 deletions(-)
-
---- a/drivers/net/sfc/Makefile
-+++ b/drivers/net/sfc/Makefile
+--- head-2009-11-06.orig/drivers/net/sfc/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/Makefile 2009-07-28 10:04:25.000000000 +0200
@@ -1,6 +1,7 @@
sfc-y += efx.o falcon.o tx.o rx.o falcon_gmac.o \
falcon_xmac.o selftest.o ethtool.o xfp_phy.o \
@@ -31,8 +19,8 @@ Acked-by: jbeulich@novell.com
sfc-$(CONFIG_SFC_MTD) += mtd.o
obj-$(CONFIG_SFC) += sfc.o
---- /dev/null
-+++ b/drivers/net/sfc/driverlink.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/net/sfc/driverlink.c 2009-07-28 10:04:25.000000000 +0200
@@ -0,0 +1,367 @@
+/****************************************************************************
+ * Driver for Solarflare Solarstorm network controllers and boards
@@ -401,8 +389,8 @@ Acked-by: jbeulich@novell.com
+
+ mutex_unlock(&efx_driverlink_lock);
+}
---- /dev/null
-+++ b/drivers/net/sfc/driverlink.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/net/sfc/driverlink.h 2009-07-28 10:04:25.000000000 +0200
@@ -0,0 +1,43 @@
+/****************************************************************************
+ * Driver for Solarflare Solarstorm network controllers and boards
@@ -447,8 +435,8 @@ Acked-by: jbeulich@novell.com
+extern void efx_dl_reset_resume(struct efx_nic *efx, int ok);
+
+#endif /* EFX_DRIVERLINK_H */
---- /dev/null
-+++ b/drivers/net/sfc/driverlink_api.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/net/sfc/driverlink_api.h 2009-07-28 10:04:25.000000000 +0200
@@ -0,0 +1,303 @@
+/****************************************************************************
+ * Driver for Solarflare Solarstorm network controllers and boards
@@ -753,8 +741,8 @@ Acked-by: jbeulich@novell.com
+ break;
+
+#endif /* EFX_DRIVERLINK_API_H */
---- a/drivers/net/sfc/efx.c
-+++ b/drivers/net/sfc/efx.c
+--- head-2009-11-06.orig/drivers/net/sfc/efx.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/efx.c 2009-10-12 13:40:25.000000000 +0200
@@ -1487,12 +1487,21 @@ static int efx_change_mtu(struct net_dev
efx_stop_all(efx);
@@ -854,8 +842,8 @@ Acked-by: jbeulich@novell.com
fail5:
efx_pci_remove_main(efx);
fail4:
---- a/drivers/net/sfc/falcon.c
-+++ b/drivers/net/sfc/falcon.c
+--- head-2009-11-06.orig/drivers/net/sfc/falcon.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/falcon.c 2009-07-28 10:04:25.000000000 +0200
@@ -36,14 +36,14 @@
/**
@@ -923,7 +911,7 @@ Acked-by: jbeulich@novell.com
break;
}
}
-@@ -2744,6 +2750,59 @@ static int falcon_probe_nvconfig(struct
+@@ -2744,6 +2750,59 @@ static int falcon_probe_nvconfig(struct
return rc;
}
@@ -1028,8 +1016,8 @@ Acked-by: jbeulich@novell.com
}
void falcon_update_nic_stats(struct efx_nic *efx)
---- a/drivers/net/sfc/net_driver.h
-+++ b/drivers/net/sfc/net_driver.h
+--- head-2009-11-06.orig/drivers/net/sfc/net_driver.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/net_driver.h 2009-07-28 10:04:25.000000000 +0200
@@ -29,6 +29,8 @@
#include "enum.h"
@@ -1066,8 +1054,8 @@ Acked-by: jbeulich@novell.com
};
static inline int efx_dev_registered(struct efx_nic *efx)
---- a/drivers/net/sfc/rx.c
-+++ b/drivers/net/sfc/rx.c
+--- head-2009-11-06.orig/drivers/net/sfc/rx.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/rx.c 2009-11-06 10:32:03.000000000 +0100
@@ -447,7 +447,21 @@ static void efx_rx_packet_lro(struct efx
struct efx_rx_buffer *rx_buf,
bool checksummed)
@@ -1090,7 +1078,7 @@ Acked-by: jbeulich@novell.com
/* Pass the skb/page into the LRO engine */
if (rx_buf->page) {
-@@ -550,6 +564,7 @@ void __efx_rx_packet(struct efx_channel
+@@ -550,6 +564,7 @@ void __efx_rx_packet(struct efx_channel
struct efx_rx_buffer *rx_buf, bool checksummed)
{
struct efx_nic *efx = channel->efx;
@@ -1098,11 +1086,10 @@ Acked-by: jbeulich@novell.com
struct sk_buff *skb;
/* If we're in loopback test, then pass the packet directly to the
-@@ -560,6 +575,16 @@ void __efx_rx_packet(struct efx_channel
- efx_free_rx_buffer(efx, rx_buf);
+@@ -561,6 +576,16 @@ void __efx_rx_packet(struct efx_channel
goto done;
}
-+
+
+ /* Allow callback to veto the packet */
+ veto = EFX_DL_CALLBACK(efx, rx_packet, rx_buf->data, rx_buf->len);
+ if (unlikely(veto)) {
@@ -1112,11 +1099,12 @@ Acked-by: jbeulich@novell.com
+ efx_free_rx_buffer(efx, rx_buf);
+ goto done;
+ }
-
++
if (rx_buf->skb) {
prefetch(skb_shinfo(rx_buf->skb));
---- a/drivers/net/sfc/tx.c
-+++ b/drivers/net/sfc/tx.c
+
+--- head-2009-11-06.orig/drivers/net/sfc/tx.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/tx.c 2009-10-12 13:40:32.000000000 +0200
@@ -374,6 +374,7 @@ netdev_tx_t efx_hard_start_xmit(struct s
{
struct efx_nic *efx = netdev_priv(net_dev);
diff --git a/patches.xen/sfc-driverlink-conditional b/patches.xen/sfc-driverlink-conditional
index ae4763f8d8..5ca60cb051 100644
--- a/patches.xen/sfc-driverlink-conditional
+++ b/patches.xen/sfc-driverlink-conditional
@@ -7,20 +7,8 @@ At once converted the EFX_TRACE() invocations after vetoed RX/TX
callbacks to ...LOG() ones, which is consistent with Solarflare's
current code according to David Riddoch (2008-09-12).
----
- drivers/net/sfc/Kconfig | 4 ++++
- drivers/net/sfc/Makefile | 4 ++--
- drivers/net/sfc/driverlink.c | 1 -
- drivers/net/sfc/driverlink.h | 23 +++++++++++++++++++++++
- drivers/net/sfc/efx.c | 4 ++++
- drivers/net/sfc/falcon.c | 16 ++++++++++++++++
- drivers/net/sfc/net_driver.h | 3 ++-
- drivers/net/sfc/rx.c | 8 ++++----
- drivers/net/sfc/tx.c | 6 +++---
- 9 files changed, 58 insertions(+), 11 deletions(-)
-
---- a/drivers/net/sfc/Kconfig
-+++ b/drivers/net/sfc/Kconfig
+--- head-2009-11-06.orig/drivers/net/sfc/Kconfig 2009-04-21 11:02:22.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/Kconfig 2009-10-12 13:41:03.000000000 +0200
@@ -12,8 +12,12 @@ config SFC
To compile this driver as a module, choose M here. The module
will be called sfc.
@@ -34,8 +22,8 @@ current code according to David Riddoch (2008-09-12).
tristate "Solarflare Solarstorm SFC4000 resource driver"
help
This module provides the SFC resource manager driver.
---- a/drivers/net/sfc/Makefile
-+++ b/drivers/net/sfc/Makefile
+--- head-2009-11-06.orig/drivers/net/sfc/Makefile 2009-02-06 12:42:18.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/Makefile 2009-10-12 13:41:03.000000000 +0200
@@ -1,7 +1,7 @@
sfc-y += efx.o falcon.o tx.o rx.o falcon_gmac.o \
falcon_xmac.o selftest.o ethtool.o xfp_phy.o \
@@ -46,8 +34,8 @@ current code according to David Riddoch (2008-09-12).
sfc-$(CONFIG_SFC_MTD) += mtd.o
obj-$(CONFIG_SFC) += sfc.o
---- a/drivers/net/sfc/driverlink.c
-+++ b/drivers/net/sfc/driverlink.c
+--- head-2009-11-06.orig/drivers/net/sfc/driverlink.c 2009-07-28 10:04:25.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/driverlink.c 2009-10-12 13:41:03.000000000 +0200
@@ -14,7 +14,6 @@
#include <linux/rtnetlink.h>
#include "net_driver.h"
@@ -56,8 +44,8 @@ current code according to David Riddoch (2008-09-12).
#include "driverlink.h"
/* Protects @efx_driverlink_lock and @efx_driver_list */
---- a/drivers/net/sfc/driverlink.h
-+++ b/drivers/net/sfc/driverlink.h
+--- head-2009-11-06.orig/drivers/net/sfc/driverlink.h 2009-07-28 10:04:25.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/driverlink.h 2009-10-12 13:41:03.000000000 +0200
@@ -15,6 +15,10 @@
struct efx_dl_device;
struct efx_nic;
@@ -93,8 +81,8 @@ current code according to David Riddoch (2008-09-12).
+#endif /* CONFIG_SFC_DRIVERLINK */
+
#endif /* EFX_DRIVERLINK_H */
---- a/drivers/net/sfc/efx.c
-+++ b/drivers/net/sfc/efx.c
+--- head-2009-11-06.orig/drivers/net/sfc/efx.c 2009-10-12 13:40:25.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/efx.c 2009-10-12 13:41:03.000000000 +0200
@@ -1689,6 +1689,7 @@ static void efx_unregister_netdev(struct
* Device reset and suspend
*
@@ -123,8 +111,8 @@ current code according to David Riddoch (2008-09-12).
INIT_WORK(&efx->phy_work, efx_phy_work);
INIT_WORK(&efx->mac_work, efx_mac_work);
atomic_set(&efx->netif_stop_count, 1);
---- a/drivers/net/sfc/falcon.c
-+++ b/drivers/net/sfc/falcon.c
+--- head-2009-11-06.orig/drivers/net/sfc/falcon.c 2009-07-28 10:04:25.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/falcon.c 2009-10-12 13:41:03.000000000 +0200
@@ -36,6 +36,7 @@
/**
@@ -159,7 +147,7 @@ current code according to David Riddoch (2008-09-12).
EFX_LOG(efx, "allocating special buffers %d-%d at %llx+%x "
"(virt %p phys %llx)\n", buffer->index,
-@@ -2755,6 +2765,7 @@ static int falcon_probe_nvconfig(struct
+@@ -2755,6 +2765,7 @@ static int falcon_probe_nvconfig(struct
* should live. */
static int falcon_dimension_resources(struct efx_nic *efx)
{
@@ -195,8 +183,8 @@ current code according to David Riddoch (2008-09-12).
}
void falcon_update_nic_stats(struct efx_nic *efx)
---- a/drivers/net/sfc/net_driver.h
-+++ b/drivers/net/sfc/net_driver.h
+--- head-2009-11-06.orig/drivers/net/sfc/net_driver.h 2009-07-28 10:04:25.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/net_driver.h 2009-10-12 13:41:03.000000000 +0200
@@ -29,7 +29,6 @@
#include "enum.h"
@@ -219,8 +207,8 @@ current code according to David Riddoch (2008-09-12).
};
static inline int efx_dev_registered(struct efx_nic *efx)
---- a/drivers/net/sfc/rx.c
-+++ b/drivers/net/sfc/rx.c
+--- head-2009-11-06.orig/drivers/net/sfc/rx.c 2009-11-06 10:32:03.000000000 +0100
++++ head-2009-11-06/drivers/net/sfc/rx.c 2009-11-06 10:32:24.000000000 +0100
@@ -456,8 +456,8 @@ static void efx_rx_packet_lro(struct efx
* an obvious interface to this, so veto packets before LRO */
veto = EFX_DL_CALLBACK(efx, rx_packet, rx_buf->data, rx_buf->len);
@@ -232,7 +220,7 @@ current code according to David Riddoch (2008-09-12).
/* Free the buffer now */
efx_free_rx_buffer(efx, rx_buf);
return;
-@@ -579,8 +579,8 @@ void __efx_rx_packet(struct efx_channel
+@@ -579,8 +579,8 @@ void __efx_rx_packet(struct efx_channel
/* Allow callback to veto the packet */
veto = EFX_DL_CALLBACK(efx, rx_packet, rx_buf->data, rx_buf->len);
if (unlikely(veto)) {
@@ -243,8 +231,8 @@ current code according to David Riddoch (2008-09-12).
/* Free the buffer now */
efx_free_rx_buffer(efx, rx_buf);
goto done;
---- a/drivers/net/sfc/tx.c
-+++ b/drivers/net/sfc/tx.c
+--- head-2009-11-06.orig/drivers/net/sfc/tx.c 2009-10-12 13:40:32.000000000 +0200
++++ head-2009-11-06/drivers/net/sfc/tx.c 2009-10-12 13:41:03.000000000 +0200
@@ -387,9 +387,9 @@ netdev_tx_t efx_hard_start_xmit(struct s
/* See if driverlink wants to veto the packet. */
veto = EFX_DL_CALLBACK(efx, tx_packet, skb);
diff --git a/patches.xen/sfc-endianness b/patches.xen/sfc-endianness
index 2f98e8ebba..0ee5fd3e18 100644
--- a/patches.xen/sfc-endianness
+++ b/patches.xen/sfc-endianness
@@ -2,13 +2,8 @@ From: jbeulich@novell.com
Subject: fix building with gcc 4.4
Patch-mainline: obsolete
----
- drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h | 4 ++--
- drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h
+--- head-2009-05-19.orig/drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h 2008-07-17 16:18:07.000000000 +0200
++++ head-2009-05-19/drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h 2009-05-19 15:44:02.000000000 +0200
@@ -42,9 +42,9 @@
#include <linux/io.h>
@@ -21,8 +16,8 @@ Patch-mainline: obsolete
#define EFHW_IS_BIG_ENDIAN
#else
#error Unknown endianness
---- a/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h
+--- head-2009-05-19.orig/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h 2009-04-07 15:16:30.000000000 +0200
++++ head-2009-05-19/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h 2009-05-19 15:44:02.000000000 +0200
@@ -42,9 +42,9 @@
#include <linux/io.h>
diff --git a/patches.xen/sfc-external-sram b/patches.xen/sfc-external-sram
index 15cf6689f0..cb8ea0c266 100644
--- a/patches.xen/sfc-external-sram
+++ b/patches.xen/sfc-external-sram
@@ -7,12 +7,8 @@ allow event queues to be accessed by virtualised guests.
Acked-by: jbeulich@novell.com
----
- drivers/net/sfc/falcon.c | 151 ++++++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 130 insertions(+), 21 deletions(-)
-
---- a/drivers/net/sfc/falcon.c
-+++ b/drivers/net/sfc/falcon.c
+--- head-2009-07-28.orig/drivers/net/sfc/falcon.c 2009-07-28 10:05:40.000000000 +0200
++++ head-2009-07-28/drivers/net/sfc/falcon.c 2009-07-28 10:06:53.000000000 +0200
@@ -36,6 +36,9 @@
/**
@@ -146,7 +142,7 @@ Acked-by: jbeulich@novell.com
int rc;
nvconfig = kmalloc(sizeof(*nvconfig), GFP_KERNEL);
-@@ -2716,6 +2752,7 @@ static int falcon_probe_nvconfig(struct
+@@ -2716,6 +2752,7 @@ static int falcon_probe_nvconfig(struct
efx->phy_type = PHY_TYPE_NONE;
efx->mdio.prtad = MDIO_PRTAD_NONE;
board_rev = 0;
@@ -154,7 +150,7 @@ Acked-by: jbeulich@novell.com
rc = 0;
} else if (rc) {
goto fail1;
-@@ -2726,6 +2763,13 @@ static int falcon_probe_nvconfig(struct
+@@ -2726,6 +2763,13 @@ static int falcon_probe_nvconfig(struct
efx->phy_type = v2->port0_phy_type;
efx->mdio.prtad = v2->port0_phy_addr;
board_rev = le16_to_cpu(v2->board_revision);
@@ -168,7 +164,7 @@ Acked-by: jbeulich@novell.com
if (le16_to_cpu(nvconfig->board_struct_ver) >= 3) {
__le32 fl = v3->spi_device_type[EE_SPI_FLASH];
-@@ -2750,6 +2794,21 @@ static int falcon_probe_nvconfig(struct
+@@ -2750,6 +2794,21 @@ static int falcon_probe_nvconfig(struct
efx_set_board_info(efx, board_rev);
@@ -190,7 +186,7 @@ Acked-by: jbeulich@novell.com
kfree(nvconfig);
return 0;
-@@ -2765,9 +2824,9 @@ static int falcon_probe_nvconfig(struct
+@@ -2765,9 +2824,9 @@ static int falcon_probe_nvconfig(struct
* should live. */
static int falcon_dimension_resources(struct efx_nic *efx)
{
diff --git a/patches.xen/sfc-resource-driver b/patches.xen/sfc-resource-driver
index d95912aded..460bb57310 100644
--- a/patches.xen/sfc-resource-driver
+++ b/patches.xen/sfc-resource-driver
@@ -9,84 +9,8 @@ Subject: Solarflare: Resource driver.
References: FATE#303479
Acked-by: jbeulich@novell.com
----
- drivers/net/sfc/Kconfig | 7
- drivers/net/sfc/Makefile | 2
- drivers/net/sfc/sfc_resource/Makefile | 14
- drivers/net/sfc/sfc_resource/assert_valid.c | 92
- drivers/net/sfc/sfc_resource/buddy.c | 220
- drivers/net/sfc/sfc_resource/buffer_table.c | 209
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware.h | 188
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/common.h | 68
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon.h | 422 +
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_core.h | 1147 ++++
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_desc.h | 75
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_event.h | 155
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_intr_vec.h | 44
- drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/workarounds.h | 67
- drivers/net/sfc/sfc_resource/ci/driver/resource/efx_vi.h | 273 +
- drivers/net/sfc/sfc_resource/ci/driver/resource/linux_efhw_nic.h | 69
- drivers/net/sfc/sfc_resource/ci/efhw/checks.h | 118
- drivers/net/sfc/sfc_resource/ci/efhw/common.h | 93
- drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h | 61
- drivers/net/sfc/sfc_resource/ci/efhw/debug.h | 84
- drivers/net/sfc/sfc_resource/ci/efhw/efhw_config.h | 43
- drivers/net/sfc/sfc_resource/ci/efhw/efhw_types.h | 382 +
- drivers/net/sfc/sfc_resource/ci/efhw/eventq.h | 72
- drivers/net/sfc/sfc_resource/ci/efhw/eventq_macros.h | 77
- drivers/net/sfc/sfc_resource/ci/efhw/falcon.h | 94
- drivers/net/sfc/sfc_resource/ci/efhw/falcon_hash.h | 58
- drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h | 69
- drivers/net/sfc/sfc_resource/ci/efhw/iopage.h | 58
- drivers/net/sfc/sfc_resource/ci/efhw/iopage_types.h | 190
- drivers/net/sfc/sfc_resource/ci/efhw/nic.h | 62
- drivers/net/sfc/sfc_resource/ci/efhw/public.h | 104
- drivers/net/sfc/sfc_resource/ci/efhw/sysdep.h | 55
- drivers/net/sfc/sfc_resource/ci/efrm/buddy.h | 68
- drivers/net/sfc/sfc_resource/ci/efrm/buffer_table.h | 81
- drivers/net/sfc/sfc_resource/ci/efrm/debug.h | 78
- drivers/net/sfc/sfc_resource/ci/efrm/driver_private.h | 89
- drivers/net/sfc/sfc_resource/ci/efrm/efrm_client.h | 32
- drivers/net/sfc/sfc_resource/ci/efrm/efrm_nic.h | 26
- drivers/net/sfc/sfc_resource/ci/efrm/filter.h | 122
- drivers/net/sfc/sfc_resource/ci/efrm/iobufset.h | 110
- drivers/net/sfc/sfc_resource/ci/efrm/nic_set.h | 104
- drivers/net/sfc/sfc_resource/ci/efrm/nic_table.h | 98
- drivers/net/sfc/sfc_resource/ci/efrm/private.h | 118
- drivers/net/sfc/sfc_resource/ci/efrm/resource.h | 119
- drivers/net/sfc/sfc_resource/ci/efrm/resource_id.h | 104
- drivers/net/sfc/sfc_resource/ci/efrm/sysdep.h | 46
- drivers/net/sfc/sfc_resource/ci/efrm/sysdep_linux.h | 93
- drivers/net/sfc/sfc_resource/ci/efrm/vi_resource.h | 157
- drivers/net/sfc/sfc_resource/ci/efrm/vi_resource_manager.h | 155
- drivers/net/sfc/sfc_resource/ci/efrm/vi_resource_private.h | 65
- drivers/net/sfc/sfc_resource/driver_object.c | 328 +
- drivers/net/sfc/sfc_resource/driverlink_new.c | 260 +
- drivers/net/sfc/sfc_resource/efrm_internal.h | 41
- drivers/net/sfc/sfc_resource/efx_vi_shm.c | 707 ++
- drivers/net/sfc/sfc_resource/eventq.c | 321 +
- drivers/net/sfc/sfc_resource/falcon.c | 2525 ++++++++++
- drivers/net/sfc/sfc_resource/falcon_hash.c | 159
- drivers/net/sfc/sfc_resource/filter_resource.c | 250
- drivers/net/sfc/sfc_resource/iobufset_resource.c | 404 +
- drivers/net/sfc/sfc_resource/iopage.c | 103
- drivers/net/sfc/sfc_resource/kernel_compat.c | 118
- drivers/net/sfc/sfc_resource/kernel_compat.h | 70
- drivers/net/sfc/sfc_resource/kernel_proc.c | 109
- drivers/net/sfc/sfc_resource/kfifo.c | 208
- drivers/net/sfc/sfc_resource/linux_resource_internal.h | 76
- drivers/net/sfc/sfc_resource/nic.c | 174
- drivers/net/sfc/sfc_resource/resource_driver.c | 600 ++
- drivers/net/sfc/sfc_resource/resource_manager.c | 145
- drivers/net/sfc/sfc_resource/resources.c | 94
- drivers/net/sfc/sfc_resource/vi_resource_alloc.c | 820 +++
- drivers/net/sfc/sfc_resource/vi_resource_event.c | 250
- drivers/net/sfc/sfc_resource/vi_resource_flush.c | 483 +
- drivers/net/sfc/sfc_resource/vi_resource_manager.c | 231
- 73 files changed, 14813 insertions(+)
-
---- a/drivers/net/sfc/Kconfig
-+++ b/drivers/net/sfc/Kconfig
+--- head-2009-04-21.orig/drivers/net/sfc/Kconfig 2009-04-21 11:01:52.000000000 +0200
++++ head-2009-04-21/drivers/net/sfc/Kconfig 2009-04-21 11:02:22.000000000 +0200
@@ -11,6 +11,13 @@ config SFC
To compile this driver as a module, choose M here. The module
@@ -101,16 +25,16 @@ Acked-by: jbeulich@novell.com
config SFC_MTD
bool "Solarflare Solarstorm SFC4000 flash MTD support"
depends on SFC && MTD && !(SFC=y && MTD=m)
---- a/drivers/net/sfc/Makefile
-+++ b/drivers/net/sfc/Makefile
+--- head-2009-04-21.orig/drivers/net/sfc/Makefile 2009-04-21 11:01:52.000000000 +0200
++++ head-2009-04-21/drivers/net/sfc/Makefile 2009-02-06 12:42:18.000000000 +0100
@@ -5,3 +5,5 @@ sfc-y += efx.o falcon.o tx.o rx.o falc
sfc-$(CONFIG_SFC_MTD) += mtd.o
obj-$(CONFIG_SFC) += sfc.o
+
+obj-$(CONFIG_SFC_RESOURCE) += sfc_resource/
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/Makefile
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/Makefile 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,14 @@
+obj-$(CONFIG_SFC_RESOURCE) := sfc_resource.o
+
@@ -126,8 +50,8 @@ Acked-by: jbeulich@novell.com
+ iobufset_resource.o resource_manager.o resources.o \
+ vi_resource_alloc.o vi_resource_event.o vi_resource_flush.o \
+ vi_resource_manager.o driver_object.o kernel_compat.o
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/assert_valid.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/assert_valid.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,92 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -221,8 +145,8 @@ Acked-by: jbeulich@novell.com
+EXPORT_SYMBOL(efrm_resource_assert_valid);
+
+#endif
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/buddy.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/buddy.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,220 @@
+
+/****************************************************************************
@@ -444,8 +368,8 @@ Acked-by: jbeulich@novell.com
+ ("buddy - free %x merged into order %d", addr, order););
+ efrm_buddy_free_list_add(b, order, addr);
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/buffer_table.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/buffer_table.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,209 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -656,8 +580,8 @@ Acked-by: jbeulich@novell.com
+ EFRM_FOR_EACH_NIC(nic_i, nic)
+ efhw_nic_buffer_table_commit(nic);
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,188 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -847,8 +771,8 @@ Acked-by: jbeulich@novell.com
+#define EFHW_NIC_PAGE_MASK (~(EFHW_NIC_PAGE_SIZE-1))
+
+#endif /* __CI_DRIVER_EFAB_HARDWARE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/common.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/common.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -918,8 +842,8 @@ Acked-by: jbeulich@novell.com
+#define EFHW_8G 0x200000000ULL
+
+#endif /* __CI_DRIVER_EFAB_HARDWARE_COMMON_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,422 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -1343,8 +1267,8 @@ Acked-by: jbeulich@novell.com
+}
+#endif /* __CI_DRIVER_EFAB_HARDWARE_FALCON_H__ */
+/*! \cidoxg_end */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_core.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_core.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,1147 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -2493,8 +2417,8 @@ Acked-by: jbeulich@novell.com
+#define EE_VPD_SW_DATA_REG_OFST 0x160 /* VPD access SW data register */
+ #define EE_VPD_CYC_DAT_LBN 0
+ #define EE_VPD_CYC_DAT_WIDTH 32
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_desc.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_desc.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,75 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -2571,8 +2495,8 @@ Acked-by: jbeulich@novell.com
+ #define TX_USR_BUF_ID_WIDTH 20
+ #define TX_USR_BYTE_OFS_LBN 0
+ #define TX_USR_BYTE_OFS_WIDTH 13
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_event.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_event.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,155 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -2729,8 +2653,8 @@ Acked-by: jbeulich@novell.com
+ #define DRV_GEN_EV_CODE_WIDTH 4
+ #define DRV_GEN_EV_DATA_LBN 0
+ #define DRV_GEN_EV_DATA_WIDTH 60
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_intr_vec.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/falcon/falcon_intr_vec.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,44 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -2776,8 +2700,8 @@ Acked-by: jbeulich@novell.com
+#define DW2_OFST 0x8 /* Double-word 2: Fatal interrupts */
+ #define FATAL_INT_LBN 0
+ #define FATAL_INT_WIDTH 1
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/workarounds.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/efab/hardware/workarounds.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,67 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -2846,8 +2770,8 @@ Acked-by: jbeulich@novell.com
+#endif /* B0/A01 */
+
+#endif /* __CI_DRIVER_EFAB_WORKAROUNDS_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/resource/efx_vi.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/resource/efx_vi.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,273 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3122,8 +3046,8 @@ Acked-by: jbeulich@novell.com
+ int *length);
+
+#endif /* __CI_DRIVER_RESOURCE_EFX_VI_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/driver/resource/linux_efhw_nic.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/driver/resource/linux_efhw_nic.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3194,8 +3118,8 @@ Acked-by: jbeulich@novell.com
+ container_of(_efhw_nic, struct linux_efhw_nic, efrm_nic.efhw_nic)
+
+#endif /* __CI_DRIVER_RESOURCE_LINUX_RESOURCE__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/checks.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/checks.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,118 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3315,8 +3239,8 @@ Acked-by: jbeulich@novell.com
+ EFHW_ASSERT(((LBN) >= 0) && (((LBN)+(WIDTH)) <= 64))
+
+#endif /* __CI_EFHW_CHECK_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/common.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/common.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,93 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3411,8 +3335,8 @@ Acked-by: jbeulich@novell.com
+ support */
+
+#endif /* __CI_EFHW_COMMON_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,61 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3475,8 +3399,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
+#endif /* __CI_EFHW_COMMON_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/debug.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/debug.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3562,8 +3486,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
+#endif /* __CI_EFHW_DEBUG_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/efhw_config.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/efhw_config.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,43 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3608,8 +3532,8 @@ Acked-by: jbeulich@novell.com
+#define EFHW_MAX_NR_DEVS 5 /* max number of efhw devices supported */
+
+#endif /* __CI_EFHW_EFAB_CONFIG_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/efhw_types.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/efhw_types.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,382 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -3993,8 +3917,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __CI_EFHW_EFHW_TYPES_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/eventq.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/eventq.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,72 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4068,8 +3992,8 @@ Acked-by: jbeulich@novell.com
+ efhw_event_t *);
+
+#endif /* __CI_EFHW_EVENTQ_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/eventq_macros.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/eventq_macros.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,77 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4148,8 +4072,8 @@ Acked-by: jbeulich@novell.com
+ (EFHW_IS_EVENT(EFHW_EVENT_PTR(evq, s, 1)))
+
+#endif /* __CI_EFHW_EVENTQ_MACROS_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/falcon.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/falcon.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,94 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4245,8 +4169,8 @@ Acked-by: jbeulich@novell.com
+extern void falcon_nic_filter_dtor(struct efhw_nic *nic);
+
+#endif /* __CI_EFHW_FALCON_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/falcon_hash.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/falcon_hash.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,58 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4306,8 +4230,8 @@ Acked-by: jbeulich@novell.com
+ unsigned int n_search, unsigned int nfilters);
+
+#endif /* __CI_EFHW_FALCON_HASH_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/hardware_sysdep.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4378,8 +4302,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
+#endif /* __CI_EFHW_HARDWARE_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/iopage.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/iopage.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,58 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4439,8 +4363,8 @@ Acked-by: jbeulich@novell.com
+extern void efhw_iopages_free(struct efhw_nic *, struct efhw_iopages *p);
+
+#endif /* __CI_DRIVER_RESOURCE_IOPAGE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/iopage_types.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/iopage_types.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,190 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4632,8 +4556,8 @@ Acked-by: jbeulich@novell.com
+}
+
+#endif /* __CI_EFHW_IOPAGE_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/nic.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/nic.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,62 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4697,8 +4621,8 @@ Acked-by: jbeulich@novell.com
+extern void efhw_nic_close_interrupts(struct efhw_nic *nic);
+
+#endif /* __CI_EFHW_NIC_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/public.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/public.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,104 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4804,8 +4728,8 @@ Acked-by: jbeulich@novell.com
+ uint32_t *udp_full, uint32_t *udp_wild);
+
+#endif /* __CI_EFHW_PUBLIC_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/sysdep.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efhw/sysdep.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,55 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4862,8 +4786,8 @@ Acked-by: jbeulich@novell.com
+#define spin_lock_destroy(l_) do {} while (0)
+
+#endif /* __CI_EFHW_SYSDEP_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/buddy.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/buddy.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -4933,8 +4857,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __CI_EFRM_BUDDY_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/buffer_table.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/buffer_table.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,81 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5017,8 +4941,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __CI_EFRM_BUFFER_TABLE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/debug.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/debug.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,78 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5098,8 +5022,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
+#endif /* __CI_EFRM_DEBUG_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/driver_private.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/driver_private.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,89 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5190,8 +5114,8 @@ Acked-by: jbeulich@novell.com
+extern void efrm_resources_fini(void);
+
+#endif /* __CI_EFRM_DRIVER_PRIVATE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/efrm_client.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/efrm_client.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,32 @@
+#ifndef __EFRM_CLIENT_H__
+#define __EFRM_CLIENT_H__
@@ -5225,8 +5149,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __EFRM_CLIENT_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/efrm_nic.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/efrm_nic.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,26 @@
+#ifndef __EFRM_NIC_H__
+#define __EFRM_NIC_H__
@@ -5254,8 +5178,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __EFRM_NIC_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/filter.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/filter.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,122 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5379,8 +5303,8 @@ Acked-by: jbeulich@novell.com
+
+#endif /* __CI_EFRM_FILTER_H__ */
+/*! \cidoxg_end */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/iobufset.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/iobufset.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5492,8 +5416,8 @@ Acked-by: jbeulich@novell.com
+}
+
+#endif /* __CI_EFRM_IOBUFSET_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/nic_set.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/nic_set.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,104 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5599,8 +5523,8 @@ Acked-by: jbeulich@novell.com
+ if (efrm_nic_set_read((_set), (_nic_i)))
+
+#endif /* __CI_EFRM_NIC_SET_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/nic_table.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/nic_table.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,98 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5700,8 +5624,8 @@ Acked-by: jbeulich@novell.com
+ efrm_nic_set_read((_set), (_i)))
+
+#endif /* __CI_EFRM_NIC_TABLE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/private.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/private.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,118 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5821,8 +5745,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __CI_EFRM_PRIVATE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/resource.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/resource.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -5943,8 +5867,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __CI_EFRM_RESOURCE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/resource_id.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/resource_id.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,104 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6050,8 +5974,8 @@ Acked-by: jbeulich@novell.com
+ "<invalid>")
+
+#endif /* __CI_DRIVER_EFRM_RESOURCE_ID_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/sysdep.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/sysdep.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,46 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6099,8 +6023,8 @@ Acked-by: jbeulich@novell.com
+#include <ci/efrm/sysdep_linux.h>
+
+#endif /* __CI_EFRM_SYSDEP_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/sysdep_linux.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/sysdep_linux.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,93 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6195,8 +6119,8 @@ Acked-by: jbeulich@novell.com
+}
+
+#endif /* __CI_EFRM_SYSDEP_LINUX_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/vi_resource.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/vi_resource.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,157 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6355,8 +6279,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __CI_EFRM_VI_RESOURCE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/vi_resource_manager.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/vi_resource_manager.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,155 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6513,8 +6437,8 @@ Acked-by: jbeulich@novell.com
+}
+
+#endif /* __CI_DRIVER_EFAB_VI_RESOURCE_MANAGER_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/ci/efrm/vi_resource_private.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/ci/efrm/vi_resource_private.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,65 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6581,8 +6505,8 @@ Acked-by: jbeulich@novell.com
+extern void efrm_handle_sram_event(struct efhw_nic *nic);
+
+#endif /* __CI_EFRM_VI_RESOURCE_PRIVATE_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/driver_object.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/driver_object.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,328 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -6912,8 +6836,8 @@ Acked-by: jbeulich@novell.com
+ return client->nic;
+}
+EXPORT_SYMBOL(efrm_client_get_nic);
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/driverlink_new.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/driverlink_new.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,260 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -7175,8 +7099,8 @@ Acked-by: jbeulich@novell.com
+ break;
+ }
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/efrm_internal.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/efrm_internal.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,41 @@
+#ifndef __EFRM_INTERNAL_H__
+#define __EFRM_INTERNAL_H__
@@ -7219,8 +7143,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* __EFRM_INTERNAL_H__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/efx_vi_shm.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/efx_vi_shm.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,707 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -7929,8 +7853,8 @@ Acked-by: jbeulich@novell.com
+ return 0;
+}
+EXPORT_SYMBOL(efx_vi_hw_resource_get_phys);
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/eventq.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/eventq.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,321 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -8253,8 +8177,8 @@ Acked-by: jbeulich@novell.com
+ false);
+ return count;
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/falcon.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/falcon.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,2525 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -10781,8 +10705,8 @@ Acked-by: jbeulich@novell.com
+};
+
+
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/falcon_hash.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/falcon_hash.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,159 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -10943,8 +10867,8 @@ Acked-by: jbeulich@novell.com
+ return (hash1 + (n_search * hash2)) & (nfilters - 1);
+}
+
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/filter_resource.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/filter_resource.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,250 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -11196,8 +11120,8 @@ Acked-by: jbeulich@novell.com
+ return filter_resource(rs);
+}
+EXPORT_SYMBOL(efrm_filter_resource_from_resource);
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/iobufset_resource.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/iobufset_resource.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,404 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -11603,8 +11527,8 @@ Acked-by: jbeulich@novell.com
+ kfree(efrm_iobufset_manager);
+ return rc;
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/iopage.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/iopage.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,103 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -11709,8 +11633,8 @@ Acked-by: jbeulich@novell.com
+ efrm_dma_free_coherent(&lnic->pci_dev->dev, bytes,
+ (void *)p->kva, p->dma_addr);
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/kernel_compat.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/kernel_compat.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,118 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -11830,8 +11754,8 @@ Acked-by: jbeulich@novell.com
+
+ dma_free_coherent(dev, size, ptr, dma_addr);
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/kernel_compat.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/kernel_compat.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,70 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -11903,8 +11827,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif /* DRIVER_LINUX_RESOURCE_KERNEL_COMPAT_H */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/kernel_proc.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/kernel_proc.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -12015,8 +11939,8 @@ Acked-by: jbeulich@novell.com
+
+ return count ? strlen(buf) : 0;
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/kfifo.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/kfifo.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,208 @@
+/*
+ * A simple kernel FIFO implementation.
@@ -12226,8 +12150,8 @@ Acked-by: jbeulich@novell.com
+EXPORT_SYMBOL(__kfifo_get);
+
+#endif
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/linux_resource_internal.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/linux_resource_internal.h 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,76 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -12305,8 +12229,8 @@ Acked-by: jbeulich@novell.com
+extern void efrm_uninstall_proc_entries(void);
+
+#endif /* __LINUX_RESOURCE_INTERNAL__ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/nic.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/nic.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,174 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -12482,8 +12406,8 @@ Acked-by: jbeulich@novell.com
+
+ EFHW_TRACE("%s: DONE", __func__);
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/resource_driver.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/resource_driver.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,600 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -13085,8 +13009,8 @@ Acked-by: jbeulich@novell.com
+
+module_init(init_sfc_resource);
+module_exit(cleanup_sfc_resource);
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/resource_manager.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/resource_manager.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,145 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -13233,8 +13157,8 @@ Acked-by: jbeulich@novell.com
+/*
+ * vi: sw=8:ai:aw
+ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/resources.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/resources.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,94 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -13330,8 +13254,8 @@ Acked-by: jbeulich@novell.com
+
+ efrm_buffer_table_dtor();
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/vi_resource_alloc.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/vi_resource_alloc.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,820 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -14153,8 +14077,8 @@ Acked-by: jbeulich@novell.com
+ efrm_vi_rm_detach_evq(virs);
+ efrm_vi_rm_drop_ref(virs);
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/vi_resource_event.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/vi_resource_event.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,250 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -14406,8 +14330,8 @@ Acked-by: jbeulich@novell.com
+ if (nic->buf_commit_outstanding > 0)
+ nic->buf_commit_outstanding--;
+}
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/vi_resource_flush.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/vi_resource_flush.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,483 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
@@ -14892,8 +14816,8 @@ Acked-by: jbeulich@novell.com
+/*
+ * vi: sw=8:ai:aw
+ */
---- /dev/null
-+++ b/drivers/net/sfc/sfc_resource/vi_resource_manager.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-04-21/drivers/net/sfc/sfc_resource/vi_resource_manager.c 2008-07-17 16:18:07.000000000 +0200
@@ -0,0 +1,231 @@
+/****************************************************************************
+ * Driver for Solarflare network controllers -
diff --git a/patches.xen/sfc-sync-headers b/patches.xen/sfc-sync-headers
index 6c1e5bf27d..aba630605a 100644
--- a/patches.xen/sfc-sync-headers
+++ b/patches.xen/sfc-sync-headers
@@ -15,26 +15,8 @@ Set efhw_arch field of device type.
Acked-by: jbeulich@novell.com
----
- drivers/net/sfc/sfc_resource/ci/efhw/common.h | 4
- drivers/net/sfc/sfc_resource/nic.c | 2
- drivers/xen/sfc_netback/accel.h | 2
- drivers/xen/sfc_netback/accel_solarflare.c | 35 ---
- drivers/xen/sfc_netback/ci/driver/resource/efx_vi.h | 4
- drivers/xen/sfc_netback/ci/efhw/common.h | 25 +-
- drivers/xen/sfc_netback/ci/efhw/common_sysdep.h | 12 -
- drivers/xen/sfc_netback/ci/efhw/efhw_types.h | 81 +++++++--
- drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h | 19 --
- drivers/xen/sfc_netback/ci/efhw/iopage_types.h | 5
- drivers/xen/sfc_netback/ci/efhw/public.h | 21 ++
- drivers/xen/sfc_netback/ci/efhw/sysdep.h | 19 --
- drivers/xen/sfc_netback/ci/efrm/nic_table.h | 2
- drivers/xen/sfc_netback/ci/efrm/sysdep.h | 10 -
- drivers/xen/sfc_netback/ci/efrm/sysdep_linux.h | 176 --------------------
- 15 files changed, 111 insertions(+), 306 deletions(-)
-
---- a/drivers/net/sfc/sfc_resource/ci/efhw/common.h
-+++ b/drivers/net/sfc/sfc_resource/ci/efhw/common.h
+--- head-2009-04-07.orig/drivers/net/sfc/sfc_resource/ci/efhw/common.h 2009-04-07 14:39:57.000000000 +0200
++++ head-2009-04-07/drivers/net/sfc/sfc_resource/ci/efhw/common.h 2009-04-07 15:02:05.000000000 +0200
@@ -41,6 +41,10 @@
#include <ci/efhw/common_sysdep.h>
@@ -46,8 +28,8 @@ Acked-by: jbeulich@novell.com
typedef uint32_t efhw_buffer_addr_t;
#define EFHW_BUFFER_ADDR_FMT "[ba:%"PRIx32"]"
---- a/drivers/net/sfc/sfc_resource/nic.c
-+++ b/drivers/net/sfc/sfc_resource/nic.c
+--- head-2009-04-07.orig/drivers/net/sfc/sfc_resource/nic.c 2009-04-07 14:39:57.000000000 +0200
++++ head-2009-04-07/drivers/net/sfc/sfc_resource/nic.c 2009-04-07 15:02:05.000000000 +0200
@@ -47,6 +47,7 @@ int efhw_device_type_init(struct efhw_de
switch (device_id) {
case 0x0703:
@@ -64,8 +46,8 @@ Acked-by: jbeulich@novell.com
dt->variant = 'B';
switch (class_revision) {
case 2:
---- a/drivers/xen/sfc_netback/accel.h
-+++ b/drivers/xen/sfc_netback/accel.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/accel.h 2009-04-07 14:39:57.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/accel.h 2009-04-07 15:02:05.000000000 +0200
@@ -123,8 +123,6 @@ struct netback_accel {
enum net_accel_hw_type hw_type;
/*! State of allocation */
@@ -75,8 +57,8 @@ Acked-by: jbeulich@novell.com
/*! How to set up the acceleration for this hardware */
int (*accel_setup)(struct netback_accel *);
/*! And how to stop it. */
---- a/drivers/xen/sfc_netback/accel_solarflare.c
-+++ b/drivers/xen/sfc_netback/accel_solarflare.c
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/accel_solarflare.c 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/accel_solarflare.c 2009-04-07 15:03:41.000000000 +0200
@@ -87,7 +87,6 @@ struct driverlink_port {
enum net_accel_hw_type type;
struct net_device *net_dev;
@@ -147,8 +129,8 @@ Acked-by: jbeulich@novell.com
if (rc != 0) {
EPRINTK("%s: efx_vi_alloc failed %d\n", __FUNCTION__, rc);
free_page_state(bend);
---- a/drivers/xen/sfc_netback/ci/driver/resource/efx_vi.h
-+++ b/drivers/xen/sfc_netback/ci/driver/resource/efx_vi.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/driver/resource/efx_vi.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/driver/resource/efx_vi.h 2009-04-07 15:02:05.000000000 +0200
@@ -49,11 +49,11 @@ struct efx_vi_state;
* Allocate an efx_vi, including event queue and pt_endpoint
*
@@ -163,8 +145,8 @@ Acked-by: jbeulich@novell.com
/*!
* Free a previously allocated efx_vi
---- a/drivers/xen/sfc_netback/ci/efhw/common.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/common.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/common.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/common.h 2009-04-07 15:07:31.000000000 +0200
@@ -43,7 +43,6 @@
enum efhw_arch {
@@ -204,8 +186,8 @@ Acked-by: jbeulich@novell.com
/* Types of hardware filter */
/* Each of these values implicitly selects scatter filters on B0 - or in
---- a/drivers/xen/sfc_netback/ci/efhw/common_sysdep.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/common_sysdep.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/common_sysdep.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/common_sysdep.h 2009-04-07 15:26:24.000000000 +0200
@@ -41,7 +41,6 @@
#define __CI_EFHW_COMMON_LINUX_H__
@@ -236,8 +218,8 @@ Acked-by: jbeulich@novell.com
-#endif /* LINUX_VERSION_CODE < 2.6.19 */
-
#endif /* __CI_EFHW_COMMON_LINUX_H__ */
---- a/drivers/xen/sfc_netback/ci/efhw/efhw_types.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/efhw_types.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/efhw_types.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/efhw_types.h 2009-04-07 15:14:23.000000000 +0200
@@ -86,6 +86,37 @@ struct efhw_keventq {
struct efhw_ev_handler *ev_handlers;
};
@@ -390,8 +372,8 @@ Acked-by: jbeulich@novell.com
};
---- a/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/hardware_sysdep.h 2009-04-07 15:16:30.000000000 +0200
@@ -40,7 +40,7 @@
#ifndef __CI_EFHW_HARDWARE_LINUX_H__
#define __CI_EFHW_HARDWARE_LINUX_H__
@@ -425,8 +407,8 @@ Acked-by: jbeulich@novell.com
#ifndef readq
static inline uint64_t __readq(volatile void __iomem *addr)
{
---- a/drivers/xen/sfc_netback/ci/efhw/iopage_types.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/iopage_types.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/iopage_types.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/iopage_types.h 2009-04-07 15:27:46.000000000 +0200
@@ -39,13 +39,8 @@
#ifndef __CI_EFHW_IOPAGE_LINUX_H__
#define __CI_EFHW_IOPAGE_LINUX_H__
@@ -441,8 +423,8 @@ Acked-by: jbeulich@novell.com
#include <linux/errno.h>
#include <ci/efhw/debug.h>
---- a/drivers/xen/sfc_netback/ci/efhw/public.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/public.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/public.h 2009-04-07 14:39:57.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/public.h 2009-04-07 15:02:05.000000000 +0200
@@ -70,11 +70,32 @@ int efhw_nic_event_queue_alloc_iobuffer(
extern void falcon_nic_set_rx_usr_buf_size(struct efhw_nic *,
int rx_usr_buf_size);
@@ -476,8 +458,8 @@ Acked-by: jbeulich@novell.com
extern void
falcon_nic_rx_filter_ctl_get(struct efhw_nic *nic, uint32_t *tcp_full,
uint32_t *tcp_wild,
---- a/drivers/xen/sfc_netback/ci/efhw/sysdep.h
-+++ b/drivers/xen/sfc_netback/ci/efhw/sysdep.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efhw/sysdep.h 2009-04-07 14:39:57.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efhw/sysdep.h 2009-04-07 15:02:05.000000000 +0200
@@ -39,34 +39,17 @@
#ifndef __CI_EFHW_SYSDEP_LINUX_H__
#define __CI_EFHW_SYSDEP_LINUX_H__
@@ -514,8 +496,8 @@ Acked-by: jbeulich@novell.com
-#endif
-
#endif /* __CI_EFHW_SYSDEP_LINUX_H__ */
---- a/drivers/xen/sfc_netback/ci/efrm/nic_table.h
-+++ b/drivers/xen/sfc_netback/ci/efrm/nic_table.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efrm/nic_table.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efrm/nic_table.h 2009-04-07 15:28:15.000000000 +0200
@@ -76,7 +76,7 @@ static inline void efrm_nic_table_rele(v
static inline int efrm_nic_table_held(void)
@@ -525,8 +507,8 @@ Acked-by: jbeulich@novell.com
}
/* Run code block _x multiple times with variable nic set to each
---- a/drivers/xen/sfc_netback/ci/efrm/sysdep.h
-+++ b/drivers/xen/sfc_netback/ci/efrm/sysdep.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efrm/sysdep.h 2009-04-07 14:39:57.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efrm/sysdep.h 2009-04-07 15:02:05.000000000 +0200
@@ -41,14 +41,6 @@
/* Spinlocks are defined in efhw/sysdep.h */
#include <ci/efhw/sysdep.h>
@@ -543,8 +525,8 @@ Acked-by: jbeulich@novell.com
+#include <ci/efrm/sysdep_linux.h>
#endif /* __CI_EFRM_SYSDEP_H__ */
---- a/drivers/xen/sfc_netback/ci/efrm/sysdep_linux.h
-+++ b/drivers/xen/sfc_netback/ci/efrm/sysdep_linux.h
+--- head-2009-04-07.orig/drivers/xen/sfc_netback/ci/efrm/sysdep_linux.h 2009-04-07 13:58:48.000000000 +0200
++++ head-2009-04-07/drivers/xen/sfc_netback/ci/efrm/sysdep_linux.h 2009-04-07 15:28:24.000000000 +0200
@@ -42,7 +42,6 @@
#ifndef __CI_EFRM_SYSDEP_LINUX_H__
#define __CI_EFRM_SYSDEP_LINUX_H__
diff --git a/patches.xen/tmem b/patches.xen/tmem
index 9ccdc3a17f..48c3f39aa2 100644
--- a/patches.xen/tmem
+++ b/patches.xen/tmem
@@ -30,31 +30,8 @@ http://oss.oracle.com/projects/tmem
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: jbeulich@novell.com
----
- fs/buffer.c | 6 +
- fs/ext3/super.c | 2
- fs/ext4/super.c | 3
- fs/mpage.c | 8 ++
- fs/ocfs2/super.c | 2
- fs/reiserfs/super.c | 2
- fs/super.c | 8 ++
- include/linux/fs.h | 3
- include/linux/precache.h | 55 ++++++++++++++
- include/linux/swap.h | 51 +++++++++++++
- kernel/sysctl.c | 12 +++
- mm/Kconfig | 28 +++++++
- mm/Makefile | 3
- mm/filemap.c | 11 ++
- mm/page_io.c | 20 +++++
- mm/precache.c | 140 +++++++++++++++++++++++++++++++++++
- mm/preswap.c | 184 +++++++++++++++++++++++++++++++++++++++++++++++
- mm/swapfile.c | 137 +++++++++++++++++++++++++++++++++-
- mm/tmem.h | 84 +++++++++++++++++++++
- mm/truncate.c | 10 ++
- 20 files changed, 765 insertions(+), 4 deletions(-)
-
---- a/fs/buffer.c
-+++ b/fs/buffer.c
+--- head-2009-11-06.orig/fs/buffer.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/buffer.c 2009-11-06 10:32:37.000000000 +0100
@@ -41,6 +41,7 @@
#include <linux/bitops.h>
#include <linux/mpage.h>
@@ -75,8 +52,8 @@ Acked-by: jbeulich@novell.com
}
EXPORT_SYMBOL(invalidate_bdev);
---- a/fs/ext3/super.c
-+++ b/fs/ext3/super.c
+--- head-2009-11-06.orig/fs/ext3/super.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/ext3/super.c 2009-11-06 10:32:37.000000000 +0100
@@ -38,6 +38,7 @@
#include <linux/seq_file.h>
#include <linux/nfs4acl.h>
@@ -93,8 +70,8 @@ Acked-by: jbeulich@novell.com
return res;
}
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
+--- head-2009-11-06.orig/fs/ext4/super.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/ext4/super.c 2009-11-06 10:32:37.000000000 +0100
@@ -39,6 +39,7 @@
#include <linux/ctype.h>
#include <linux/log2.h>
@@ -112,8 +89,8 @@ Acked-by: jbeulich@novell.com
return res;
}
---- a/fs/mpage.c
-+++ b/fs/mpage.c
+--- head-2009-11-06.orig/fs/mpage.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/mpage.c 2009-11-06 10:32:37.000000000 +0100
@@ -26,6 +26,7 @@
#include <linux/writeback.h>
#include <linux/backing-dev.h>
@@ -136,8 +113,8 @@ Acked-by: jbeulich@novell.com
/*
* This page will go to BIO. Do we need to send this BIO off first?
*/
---- a/fs/ocfs2/super.c
-+++ b/fs/ocfs2/super.c
+--- head-2009-11-06.orig/fs/ocfs2/super.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/ocfs2/super.c 2009-11-06 10:32:37.000000000 +0100
@@ -41,6 +41,7 @@
#include <linux/mount.h>
#include <linux/seq_file.h>
@@ -154,8 +131,8 @@ Acked-by: jbeulich@novell.com
bail:
mlog_exit(status);
---- a/fs/reiserfs/super.c
-+++ b/fs/reiserfs/super.c
+--- head-2009-11-06.orig/fs/reiserfs/super.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/reiserfs/super.c 2009-11-06 10:32:37.000000000 +0100
@@ -26,6 +26,7 @@
#include <linux/vfs.h>
#include <linux/mount.h>
@@ -172,8 +149,8 @@ Acked-by: jbeulich@novell.com
return (0);
---- a/fs/super.c
-+++ b/fs/super.c
+--- head-2009-11-06.orig/fs/super.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/super.c 2009-11-06 10:32:37.000000000 +0100
@@ -37,6 +37,7 @@
#include <linux/kobject.h>
#include <linux/mutex.h>
@@ -210,8 +187,8 @@ Acked-by: jbeulich@novell.com
simple_set_mnt(mnt, s);
return 0;
}
---- a/include/linux/fs.h
-+++ b/include/linux/fs.h
+--- head-2009-11-06.orig/include/linux/fs.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/fs.h 2009-11-06 10:32:37.000000000 +0100
@@ -1371,6 +1371,9 @@ struct super_block {
/* Granularity of c/m/atime in ns.
Cannot be worse than a second */
@@ -222,8 +199,8 @@ Acked-by: jbeulich@novell.com
/*
* Filesystem subtype. If non-empty the filesystem type field
---- /dev/null
-+++ b/include/linux/precache.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/linux/precache.h 2009-11-06 10:32:37.000000000 +0100
@@ -0,0 +1,55 @@
+#ifndef _LINUX_PRECACHE_H
+
@@ -280,8 +257,8 @@ Acked-by: jbeulich@novell.com
+
+#define _LINUX_PRECACHE_H
+#endif /* _LINUX_PRECACHE_H */
---- a/include/linux/swap.h
-+++ b/include/linux/swap.h
+--- head-2009-11-06.orig/include/linux/swap.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/swap.h 2009-11-06 10:32:37.000000000 +0100
@@ -177,8 +177,59 @@ struct swap_info_struct {
unsigned int max;
unsigned int inuse_pages;
@@ -342,8 +319,8 @@ Acked-by: jbeulich@novell.com
struct swap_list_t {
int head; /* head of priority-ordered swapfile list */
int next; /* swapfile to be used next */
---- a/kernel/sysctl.c
-+++ b/kernel/sysctl.c
+--- head-2009-11-06.orig/kernel/sysctl.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/kernel/sysctl.c 2009-11-06 10:32:37.000000000 +0100
@@ -1424,6 +1424,18 @@ static struct ctl_table vm_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec,
@@ -363,8 +340,8 @@ Acked-by: jbeulich@novell.com
#ifdef CONFIG_MEMORY_FAILURE
{
.ctl_name = CTL_UNNUMBERED,
---- a/mm/Kconfig
-+++ b/mm/Kconfig
+--- head-2009-11-06.orig/mm/Kconfig 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/Kconfig 2009-11-06 10:32:37.000000000 +0100
@@ -287,3 +287,31 @@ config NOMMU_INITIAL_TRIM_EXCESS
of 1 says that all excess pages should be trimmed.
@@ -397,8 +374,8 @@ Acked-by: jbeulich@novell.com
+ Allows the transcendent memory pool to be used as a pseudo-swap
+ device which, under some circumstances, will greatly reduce
+ swapping and thus improve performance. If unsure, say Y.
---- a/mm/Makefile
-+++ b/mm/Makefile
+--- head-2009-11-06.orig/mm/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/Makefile 2009-11-06 10:32:37.000000000 +0100
@@ -17,6 +17,9 @@ obj-y += init-mm.o
obj-$(CONFIG_BOUNCE) += bounce.o
@@ -409,8 +386,8 @@ Acked-by: jbeulich@novell.com
obj-$(CONFIG_HAS_DMA) += dmapool.o
obj-$(CONFIG_HUGETLBFS) += hugetlb.o
obj-$(CONFIG_NUMA) += mempolicy.o
---- a/mm/filemap.c
-+++ b/mm/filemap.c
+--- head-2009-11-06.orig/mm/filemap.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/filemap.c 2009-11-06 10:32:37.000000000 +0100
@@ -33,6 +33,7 @@
#include <linux/cpuset.h>
#include <linux/hardirq.h> /* for BUG_ON(!in_atomic()) only */
@@ -436,8 +413,8 @@ Acked-by: jbeulich@novell.com
radix_tree_delete(&mapping->page_tree, page->index);
page->mapping = NULL;
mapping->nrpages--;
---- a/mm/page_io.c
-+++ b/mm/page_io.c
+--- head-2009-11-06.orig/mm/page_io.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/page_io.c 2009-11-06 10:32:37.000000000 +0100
@@ -110,10 +110,23 @@ int swap_writepage(struct page *page, st
ret = -ENOMEM;
goto out;
@@ -476,8 +453,8 @@ Acked-by: jbeulich@novell.com
bio = get_swap_bio(GFP_KERNEL, page_private(page), page,
end_swap_bio_read);
if (bio == NULL) {
---- /dev/null
-+++ b/mm/precache.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/mm/precache.c 2009-11-06 10:32:37.000000000 +0100
@@ -0,0 +1,140 @@
+/*
+ * linux/mm/precache.c
@@ -619,8 +596,8 @@ Acked-by: jbeulich@novell.com
+ sb->precache_poolid = tmem_new_pool(uuid_lo, uuid_hi, TMEM_POOL_SHARED);
+}
+EXPORT_SYMBOL(shared_precache_init);
---- /dev/null
-+++ b/mm/preswap.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/mm/preswap.c 2009-11-06 10:32:37.000000000 +0100
@@ -0,0 +1,184 @@
+/*
+ * linux/mm/preswap.c
@@ -806,8 +783,8 @@ Acked-by: jbeulich@novell.com
+ if (preswap_poolid < 0)
+ return;
+}
---- a/mm/swapfile.c
-+++ b/mm/swapfile.c
+--- head-2009-11-06.orig/mm/swapfile.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/swapfile.c 2009-11-06 10:32:37.000000000 +0100
@@ -589,6 +589,7 @@ static int swap_entry_free(struct swap_i
swap_list.next = p - swap_info;
nr_swap_pages++;
@@ -1065,8 +1042,8 @@ Acked-by: jbeulich@novell.com
+}
+#endif
+#endif /* CONFIG_PRESWAP */
---- /dev/null
-+++ b/mm/tmem.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/mm/tmem.h 2009-11-06 10:32:37.000000000 +0100
@@ -0,0 +1,84 @@
+/*
+ * linux/mm/tmem.h
@@ -1152,8 +1129,8 @@ Acked-by: jbeulich@novell.com
+ } u;
+};
+#endif
---- a/mm/truncate.c
-+++ b/mm/truncate.c
+--- head-2009-11-06.orig/mm/truncate.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/truncate.c 2009-11-06 10:32:37.000000000 +0100
@@ -15,6 +15,7 @@
#include <linux/pagemap.h>
#include <linux/highmem.h>
diff --git a/patches.xen/xen-balloon-max-target b/patches.xen/xen-balloon-max-target
index 4b862aba73..3644046810 100644
--- a/patches.xen/xen-balloon-max-target
+++ b/patches.xen/xen-balloon-max-target
@@ -5,14 +5,8 @@ References: 152667, 184727
jb: Also added this to the sysfs representation.
----
- drivers/xen/balloon/balloon.c | 7 +++++--
- drivers/xen/balloon/common.h | 1 +
- drivers/xen/balloon/sysfs.c | 5 +++++
- 3 files changed, 11 insertions(+), 2 deletions(-)
-
---- a/drivers/xen/balloon/balloon.c
-+++ b/drivers/xen/balloon/balloon.c
+--- head-2009-10-12.orig/drivers/xen/balloon/balloon.c 2009-10-14 16:16:37.000000000 +0200
++++ head-2009-10-12/drivers/xen/balloon/balloon.c 2009-10-14 16:19:48.000000000 +0200
@@ -227,7 +227,7 @@ static unsigned long current_target(void
return target;
}
@@ -45,8 +39,8 @@ jb: Also added this to the sysfs representation.
PAGES2KB(bs.balloon_low), PAGES2KB(bs.balloon_high),
PAGES2KB(bs.driver_pages));
---- a/drivers/xen/balloon/common.h
-+++ b/drivers/xen/balloon/common.h
+--- head-2009-10-12.orig/drivers/xen/balloon/common.h 2009-06-09 15:01:37.000000000 +0200
++++ head-2009-10-12/drivers/xen/balloon/common.h 2009-08-19 10:36:49.000000000 +0200
@@ -52,5 +52,6 @@ int balloon_sysfs_init(void);
void balloon_sysfs_exit(void);
@@ -54,8 +48,8 @@ jb: Also added this to the sysfs representation.
+unsigned long balloon_minimum_target(void);
#endif /* __XEN_BALLOON_COMMON_H__ */
---- a/drivers/xen/balloon/sysfs.c
-+++ b/drivers/xen/balloon/sysfs.c
+--- head-2009-10-12.orig/drivers/xen/balloon/sysfs.c 2009-10-12 16:30:07.000000000 +0200
++++ head-2009-10-12/drivers/xen/balloon/sysfs.c 2009-08-19 10:36:47.000000000 +0200
@@ -31,6 +31,7 @@
#include <linux/capability.h>
#include <linux/errno.h>
diff --git a/patches.xen/xen-blkback-bimodal-suse b/patches.xen/xen-blkback-bimodal-suse
index 4659ba806b..3ca681fd97 100644
--- a/patches.xen/xen-blkback-bimodal-suse
+++ b/patches.xen/xen-blkback-bimodal-suse
@@ -3,12 +3,14 @@ From: Gerd Hoffmann <kraxel@suse.de>
Patch-mainline: obsolete
---
- drivers/xen/blkback/xenbus.c | 6 ++++++
- drivers/xen/blktap/xenbus.c | 6 ++++++
+ linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c | 6 ++++++
+ linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c | 6 ++++++
2 files changed, 12 insertions(+)
---- a/drivers/xen/blkback/xenbus.c
-+++ b/drivers/xen/blkback/xenbus.c
+Index: head-2008-09-15/drivers/xen/blkback/xenbus.c
+===================================================================
+--- head-2008-09-15.orig/drivers/xen/blkback/xenbus.c 2008-09-15 14:32:56.000000000 +0200
++++ head-2008-09-15/drivers/xen/blkback/xenbus.c 2008-09-15 15:10:36.000000000 +0200
@@ -496,6 +496,12 @@ static int connect_ring(struct backend_i
be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
@@ -22,8 +24,10 @@ Patch-mainline: obsolete
else {
xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
return -1;
---- a/drivers/xen/blktap/xenbus.c
-+++ b/drivers/xen/blktap/xenbus.c
+Index: head-2008-09-15/drivers/xen/blktap/xenbus.c
+===================================================================
+--- head-2008-09-15.orig/drivers/xen/blktap/xenbus.c 2008-09-15 14:32:56.000000000 +0200
++++ head-2008-09-15/drivers/xen/blktap/xenbus.c 2008-09-15 15:10:36.000000000 +0200
@@ -434,6 +434,12 @@ static int connect_ring(struct backend_i
be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
diff --git a/patches.xen/xen-blkback-cdrom b/patches.xen/xen-blkback-cdrom
index dacef14f37..08fba8da58 100644
--- a/patches.xen/xen-blkback-cdrom
+++ b/patches.xen/xen-blkback-cdrom
@@ -3,24 +3,16 @@ From: plc@novell.com
Patch-mainline: obsolete
References: 159907
----
- drivers/xen/blkback/Makefile | 2
- drivers/xen/blkback/cdrom.c | 162 +++++++++++++++++++++++++++++++++++++++++++
- drivers/xen/blkback/common.h | 14 +++
- drivers/xen/blkback/vbd.c | 3
- drivers/xen/blkback/xenbus.c | 19 ++---
- 5 files changed, 189 insertions(+), 11 deletions(-)
-
---- a/drivers/xen/blkback/Makefile
-+++ b/drivers/xen/blkback/Makefile
+--- head-2009-06-09.orig/drivers/xen/blkback/Makefile 2009-06-09 15:01:37.000000000 +0200
++++ head-2009-06-09/drivers/xen/blkback/Makefile 2009-06-09 15:50:31.000000000 +0200
@@ -1,4 +1,4 @@
obj-$(CONFIG_XEN_BLKDEV_BACKEND) := blkbk.o
obj-$(CONFIG_XEN_BLKBACK_PAGEMAP) += blkback-pagemap.o
-blkbk-y := blkback.o xenbus.o interface.o vbd.o
+blkbk-y := blkback.o xenbus.o interface.o vbd.o cdrom.o
---- /dev/null
-+++ b/drivers/xen/blkback/cdrom.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-06-09/drivers/xen/blkback/cdrom.c 2009-06-09 15:50:31.000000000 +0200
@@ -0,0 +1,162 @@
+/******************************************************************************
+ * blkback/cdrom.c
@@ -184,8 +176,8 @@ References: 159907
+ }
+ }
+}
---- a/drivers/xen/blkback/common.h
-+++ b/drivers/xen/blkback/common.h
+--- head-2009-06-09.orig/drivers/xen/blkback/common.h 2009-06-09 15:37:17.000000000 +0200
++++ head-2009-06-09/drivers/xen/blkback/common.h 2009-06-09 15:50:31.000000000 +0200
@@ -98,6 +98,17 @@ typedef struct blkif_st {
grant_ref_t shmem_ref;
} blkif_t;
@@ -212,9 +204,9 @@ References: 159907
+void cdrom_add_media_watch(struct backend_info *be);
+
#endif /* __BLKIF__BACKEND__COMMON_H__ */
---- a/drivers/xen/blkback/vbd.c
-+++ b/drivers/xen/blkback/vbd.c
-@@ -107,6 +107,9 @@ int vbd_translate(struct phys_req *req,
+--- head-2009-06-09.orig/drivers/xen/blkback/vbd.c 2009-06-09 15:43:48.000000000 +0200
++++ head-2009-06-09/drivers/xen/blkback/vbd.c 2009-06-09 15:50:31.000000000 +0200
+@@ -107,6 +107,9 @@ int vbd_translate(struct phys_req *req,
if ((operation != READ) && vbd->readonly)
goto out;
@@ -224,8 +216,8 @@ References: 159907
if (unlikely((req->sector_number + req->nr_sects) > vbd_sz(vbd)))
goto out;
---- a/drivers/xen/blkback/xenbus.c
-+++ b/drivers/xen/blkback/xenbus.c
+--- head-2009-06-09.orig/drivers/xen/blkback/xenbus.c 2009-06-09 15:50:30.000000000 +0200
++++ head-2009-06-09/drivers/xen/blkback/xenbus.c 2009-06-09 15:50:31.000000000 +0200
@@ -28,16 +28,6 @@
pr_debug("blkback/xenbus (%s:%d) " fmt ".\n", \
__FUNCTION__, __LINE__, ##args)
diff --git a/patches.xen/xen-blkfront-cdrom b/patches.xen/xen-blkfront-cdrom
index 61bb898073..034a24b088 100644
--- a/patches.xen/xen-blkfront-cdrom
+++ b/patches.xen/xen-blkfront-cdrom
@@ -3,19 +3,9 @@ Subject: implement forwarding of CD-ROM specific commands
Patch-mainline: obsolete
References: fate#300964
----
- drivers/cdrom/Makefile | 1
- drivers/xen/blkfront/Makefile | 2
- drivers/xen/blkfront/blkfront.c | 4
- drivers/xen/blkfront/block.h | 4
- drivers/xen/blkfront/vbd.c | 5
- drivers/xen/blkfront/vcd.c | 504 +++++++++++++++++++++++++++++++++++++
- include/xen/interface/io/cdromif.h | 120 ++++++++
- 7 files changed, 637 insertions(+), 3 deletions(-)
-
---- a/drivers/cdrom/Makefile
-+++ b/drivers/cdrom/Makefile
-@@ -9,6 +9,7 @@ obj-$(CONFIG_BLK_DEV_IDECD) +=
+--- head-2009-10-15.orig/drivers/cdrom/Makefile 2009-11-03 10:05:58.000000000 +0100
++++ head-2009-10-15/drivers/cdrom/Makefile 2009-10-15 12:13:13.000000000 +0200
+@@ -9,6 +9,7 @@ obj-$(CONFIG_BLK_DEV_IDECD) +=
obj-$(CONFIG_BLK_DEV_SR) += cdrom.o
obj-$(CONFIG_PARIDE_PCD) += cdrom.o
obj-$(CONFIG_CDROM_PKTCDVD) += cdrom.o
@@ -23,8 +13,8 @@ References: fate#300964
obj-$(CONFIG_VIOCD) += viocd.o cdrom.o
obj-$(CONFIG_GDROM) += gdrom.o cdrom.o
---- a/drivers/xen/blkfront/Makefile
-+++ b/drivers/xen/blkfront/Makefile
+--- head-2009-10-15.orig/drivers/xen/blkfront/Makefile 2007-06-12 13:13:44.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkfront/Makefile 2009-10-15 12:13:13.000000000 +0200
@@ -1,5 +1,5 @@
obj-$(CONFIG_XEN_BLKDEV_FRONTEND) := xenblk.o
@@ -32,8 +22,8 @@ References: fate#300964
-xenblk-objs := blkfront.o vbd.o
+xenblk-objs := blkfront.o vbd.o vcd.o
---- a/drivers/xen/blkfront/blkfront.c
-+++ b/drivers/xen/blkfront/blkfront.c
+--- head-2009-10-15.orig/drivers/xen/blkfront/blkfront.c 2009-07-29 10:19:00.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkfront/blkfront.c 2009-10-15 12:13:13.000000000 +0200
@@ -377,6 +377,8 @@ static void connect(struct blkfront_info
add_disk(info->gd);
@@ -52,8 +42,8 @@ References: fate#300964
xlvbd_del(info);
out:
---- a/drivers/xen/blkfront/block.h
-+++ b/drivers/xen/blkfront/block.h
+--- head-2009-10-15.orig/drivers/xen/blkfront/block.h 2009-10-15 12:03:46.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkfront/block.h 2009-10-15 12:13:13.000000000 +0200
@@ -162,4 +162,8 @@ static inline void xlvbd_sysfs_delif(str
}
#endif
@@ -63,8 +53,8 @@ References: fate#300964
+extern void unregister_vcd(struct blkfront_info *info);
+
#endif /* __XEN_DRIVERS_BLOCK_H__ */
---- a/drivers/xen/blkfront/vbd.c
-+++ b/drivers/xen/blkfront/vbd.c
+--- head-2009-10-15.orig/drivers/xen/blkfront/vbd.c 2009-10-13 15:52:03.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkfront/vbd.c 2009-10-15 12:13:13.000000000 +0200
@@ -283,7 +283,8 @@ xlvbd_add(blkif_sector_t capacity, int v
goto out;
info->mi = mi;
@@ -84,8 +74,8 @@ References: fate#300964
if (offset < 26) {
sprintf(gd->disk_name, "%s%c",
mi->type->diskname, 'a' + offset );
---- /dev/null
-+++ b/drivers/xen/blkfront/vcd.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-10-15/drivers/xen/blkfront/vcd.c 2009-11-03 10:48:43.000000000 +0100
@@ -0,0 +1,504 @@
+/*******************************************************************************
+* vcd.c
@@ -164,7 +154,7 @@ References: fate#300964
+ req->flags |= REQ_BLOCK_PC;
+#endif
+ req->__sector = 0;
-+ req->__data_len = 512;
++ req->__data_len = PAGE_SIZE;
+ req->timeout = 60*HZ;
+
+ blk_execute_rq(req->q, info->gd, req, 1);
@@ -591,8 +581,8 @@ References: fate#300964
+ spin_unlock(&vcd_disks_lock);
+}
+
---- /dev/null
-+++ b/include/xen/interface/io/cdromif.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-10-15/include/xen/interface/io/cdromif.h 2009-10-15 12:13:13.000000000 +0200
@@ -0,0 +1,120 @@
+/******************************************************************************
+ * cdromif.h
diff --git a/patches.xen/xen-blkif-protocol-fallback-hack b/patches.xen/xen-blkif-protocol-fallback-hack
index 4c927b9090..c1aaed0e11 100644
--- a/patches.xen/xen-blkif-protocol-fallback-hack
+++ b/patches.xen/xen-blkif-protocol-fallback-hack
@@ -5,16 +5,36 @@ Patch-mainline: never.
See the comment below. Oh well.
----
- drivers/xen/blkback/xenbus.c | 7 +-
- drivers/xen/blktap/xenbus.c | 7 +-
- drivers/xen/core/Makefile | 2
- drivers/xen/core/domctl.c | 113 +++++++++++++++++++++++++++++++++++++++++++
- drivers/xen/core/domctl.h | 2
- 5 files changed, 126 insertions(+), 5 deletions(-)
-
---- a/drivers/xen/blkback/xenbus.c
-+++ b/drivers/xen/blkback/xenbus.c
+--- head-2009-10-15.orig/drivers/xen/Kconfig 2009-10-21 16:20:22.000000000 +0200
++++ head-2009-10-15/drivers/xen/Kconfig 2009-10-21 11:41:12.000000000 +0200
+@@ -27,6 +27,9 @@ config XEN_PRIVCMD
+ def_bool y
+ depends on PROC_FS
+
++config XEN_DOMCTL
++ tristate
++
+ config XEN_XENBUS_DEV
+ def_bool y
+ depends on PROC_FS
+@@ -46,6 +49,7 @@ config XEN_BLKDEV_BACKEND
+ tristate "Block-device backend driver"
+ depends on XEN_BACKEND
+ default XEN_BACKEND
++ select XEN_DOMCTL
+ help
+ The block-device backend driver allows the kernel to export its
+ block devices to other guests via a high-performance shared-memory
+@@ -55,6 +59,7 @@ config XEN_BLKDEV_TAP
+ tristate "Block-device tap backend driver"
+ depends on XEN_BACKEND
+ default XEN_BACKEND
++ select XEN_DOMCTL
+ help
+ The block tap driver is an alternative to the block back driver
+ and allows VM block requests to be redirected to userspace through
+--- head-2009-10-15.orig/drivers/xen/blkback/xenbus.c 2009-10-21 16:20:22.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkback/xenbus.c 2008-09-15 15:10:39.000000000 +0200
@@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/kthread.h>
@@ -36,8 +56,8 @@ See the comment below. Oh well.
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
---- a/drivers/xen/blktap/xenbus.c
-+++ b/drivers/xen/blktap/xenbus.c
+--- head-2009-10-15.orig/drivers/xen/blktap/xenbus.c 2009-10-21 16:20:22.000000000 +0200
++++ head-2009-10-15/drivers/xen/blktap/xenbus.c 2008-09-15 15:10:39.000000000 +0200
@@ -39,6 +39,7 @@
#include <linux/kthread.h>
#include <xen/xenbus.h>
@@ -59,20 +79,18 @@ See the comment below. Oh well.
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
---- a/drivers/xen/core/Makefile
-+++ b/drivers/xen/core/Makefile
-@@ -2,7 +2,7 @@
- # Makefile for the linux kernel.
- #
-
--obj-y := evtchn.o gnttab.o reboot.o machine_reboot.o firmware.o
-+obj-y := evtchn.o gnttab.o reboot.o machine_reboot.o firmware.o domctl.o
-
- obj-$(CONFIG_PCI) += pci.o
- obj-$(CONFIG_PROC_FS) += xen_proc.o
---- /dev/null
-+++ b/drivers/xen/core/domctl.c
-@@ -0,0 +1,113 @@
+--- head-2009-10-15.orig/drivers/xen/core/Makefile 2009-10-21 16:20:22.000000000 +0200
++++ head-2009-10-15/drivers/xen/core/Makefile 2009-10-21 15:01:14.000000000 +0200
+@@ -12,4 +12,6 @@ obj-$(CONFIG_XEN_SYSFS) += xen_sysfs.o
+ obj-$(CONFIG_XEN_SMPBOOT) += smpboot.o
+ obj-$(CONFIG_SMP) += spinlock.o
+ obj-$(CONFIG_KEXEC) += machine_kexec.o
++obj-$(CONFIG_XEN_DOMCTL) += domctl.o
++CFLAGS_domctl.o := -D__XEN_TOOLS__ -D__XEN_PUBLIC_XEN_H__ -imacros xen/interface/domctl.h
+ obj-$(CONFIG_XEN_XENCOMM) += xencomm.o
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-10-15/drivers/xen/core/domctl.c 2009-10-21 16:20:37.000000000 +0200
+@@ -0,0 +1,116 @@
+/*
+ * !!! dirty hack alert !!!
+ *
@@ -90,7 +108,8 @@ See the comment below. Oh well.
+ * we don't want to have dependencies between dom0 kernel and
+ * xen kernel versions. Now we have one. Ouch.
+ */
-+
++#undef __XEN_PUBLIC_XEN_H__
++#undef __XEN_TOOLS__
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <asm/hypervisor.h>
@@ -101,7 +120,6 @@ See the comment below. Oh well.
+/* stuff copied from xen/interface/domctl.h, which we can't
+ * include directly for the reasons outlined above .... */
+
-+#define XEN_DOMCTL_get_address_size 36
+typedef struct xen_domctl_address_size {
+ uint32_t size;
+} xen_domctl_address_size_t;
@@ -119,7 +137,7 @@ See the comment below. Oh well.
+ struct xen_domctl_address_size address_size;
+ uint64_t dummy_align;
+ uint8_t dummy_pad[128];
-+ } u;
++ };
+ } v4;
+
+ /* v5: upstream: xen 3.1 */
@@ -131,7 +149,7 @@ See the comment below. Oh well.
+ struct xen_domctl_address_size address_size;
+ uint64_aligned_t dummy_align;
+ uint8_t dummy_pad[128];
-+ } u;
++ };
+ } v5;
+};
+
@@ -152,7 +170,7 @@ See the comment below. Oh well.
+ domctl.v##ver.cmd = XEN_DOMCTL_get_address_size; \
+ domctl.v##ver.interface_version = low = ver; \
+ domctl.v##ver.domain = domid; \
-+ ret = hypervisor_domctl(&domctl) ?: domctl.v##ver.u.address_size.size; \
++ ret = hypervisor_domctl(&domctl) ?: domctl.v##ver.address_size.size; \
+ if (ret == 32 || ret == 64) { \
+ printk("v" #ver " domctl worked ok: dom%d is %d-bit\n", \
+ domid, ret); \
@@ -160,6 +178,7 @@ See the comment below. Oh well.
+ } \
+} while (0)
+
++ BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 5);
+ guest_address_size(5);
+#if CONFIG_XEN_COMPAT < 0x030100
+ guest_address_size(4);
@@ -186,8 +205,10 @@ See the comment below. Oh well.
+ return BLKIF_PROTOCOL_NATIVE;
+}
+EXPORT_SYMBOL_GPL(xen_guest_blkif_protocol);
---- /dev/null
-+++ b/drivers/xen/core/domctl.h
++
++MODULE_LICENSE("GPL");
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-10-15/drivers/xen/core/domctl.h 2008-09-15 15:10:39.000000000 +0200
@@ -0,0 +1,2 @@
+int xen_guest_address_size(int domid);
+int xen_guest_blkif_protocol(int domid);
diff --git a/patches.xen/xen-blktap-write-barriers b/patches.xen/xen-blktap-write-barriers
index 4380d9a221..a84c25b20c 100644
--- a/patches.xen/xen-blktap-write-barriers
+++ b/patches.xen/xen-blktap-write-barriers
@@ -2,13 +2,8 @@ From: kwolf@suse.de
Subject: blktap: Write Barriers
Patch-mainline: obsolete
----
- drivers/xen/blktap/blktap.c | 26 ++++++++++++++++++++++----
- drivers/xen/blktap/xenbus.c | 21 +++++++++++++++++++++
- 2 files changed, 43 insertions(+), 4 deletions(-)
-
---- a/drivers/xen/blktap/blktap.c
-+++ b/drivers/xen/blktap/blktap.c
+--- head-2009-07-28.orig/drivers/xen/blktap/blktap.c 2009-07-30 10:54:23.000000000 +0200
++++ head-2009-07-28/drivers/xen/blktap/blktap.c 2009-07-30 10:55:18.000000000 +0200
@@ -1363,6 +1363,9 @@ static int do_block_io_op(blkif_t *blkif
dispatch_rw_block_io(blkif, &req, pending_req);
break;
@@ -77,9 +72,9 @@ Patch-mainline: obsolete
flags |= GNTMAP_readonly;
gnttab_set_map_op(&map[op], ptep, flags,
req->seg[i].gref, blkif->domid);
---- a/drivers/xen/blktap/xenbus.c
-+++ b/drivers/xen/blktap/xenbus.c
-@@ -395,7 +395,28 @@ static void connect(struct backend_info
+--- head-2009-07-28.orig/drivers/xen/blktap/xenbus.c 2008-09-15 15:10:39.000000000 +0200
++++ head-2009-07-28/drivers/xen/blktap/xenbus.c 2009-05-19 10:10:06.000000000 +0200
+@@ -395,7 +395,28 @@ static void connect(struct backend_info
int err;
struct xenbus_device *dev = be->dev;
diff --git a/patches.xen/xen-configurable-guest-devices b/patches.xen/xen-configurable-guest-devices
index e0d762b859..6243315659 100644
--- a/patches.xen/xen-configurable-guest-devices
+++ b/patches.xen/xen-configurable-guest-devices
@@ -7,14 +7,8 @@ value).
Similarly, allow the number of simultaneous transmits in netback to be
configurable.
----
- arch/x86/include/mach-xen/asm/irq_vectors.h | 2 +-
- drivers/xen/Kconfig | 19 +++++++++++++++++++
- drivers/xen/netback/netback.c | 3 ++-
- 3 files changed, 22 insertions(+), 2 deletions(-)
-
---- a/arch/x86/include/mach-xen/asm/irq_vectors.h
-+++ b/arch/x86/include/mach-xen/asm/irq_vectors.h
+--- head-2009-10-15.orig/arch/x86/include/mach-xen/asm/irq_vectors.h 2009-10-15 12:08:38.000000000 +0200
++++ head-2009-10-15/arch/x86/include/mach-xen/asm/irq_vectors.h 2009-10-15 13:04:58.000000000 +0200
@@ -87,7 +87,7 @@ extern int nr_pirqs;
#endif
@@ -24,9 +18,9 @@ configurable.
#define NR_IRQS (NR_PIRQS + NR_DYNIRQS)
---- a/drivers/xen/Kconfig
-+++ b/drivers/xen/Kconfig
-@@ -90,6 +90,15 @@ config XEN_NETDEV_BACKEND
+--- head-2009-10-15.orig/drivers/xen/Kconfig 2009-11-04 14:42:40.000000000 +0100
++++ head-2009-10-15/drivers/xen/Kconfig 2009-11-04 14:42:49.000000000 +0100
+@@ -95,6 +95,15 @@ config XEN_NETDEV_BACKEND
network devices to other guests via a high-performance shared-memory
interface.
@@ -42,7 +36,7 @@ configurable.
config XEN_NETDEV_PIPELINED_TRANSMITTER
bool "Pipelined transmitter (DANGEROUS)"
depends on XEN_NETDEV_BACKEND
-@@ -301,6 +310,16 @@ config XEN_SYSFS
+@@ -306,6 +315,16 @@ config XEN_SYSFS
help
Xen hypervisor attributes will show up under /sys/hypervisor/.
@@ -59,8 +53,8 @@ configurable.
choice
prompt "Xen version compatibility"
default XEN_COMPAT_030002_AND_LATER
---- a/drivers/xen/netback/netback.c
-+++ b/drivers/xen/netback/netback.c
+--- head-2009-10-15.orig/drivers/xen/netback/netback.c 2009-10-13 17:07:13.000000000 +0200
++++ head-2009-10-15/drivers/xen/netback/netback.c 2009-10-15 13:04:58.000000000 +0200
@@ -71,7 +71,7 @@ static DECLARE_TASKLET(net_rx_tasklet, n
static struct timer_list net_timer;
static struct timer_list netbk_tx_pending_timer;
@@ -70,7 +64,7 @@ configurable.
static struct sk_buff_head rx_queue;
-@@ -1241,6 +1241,7 @@ static void net_tx_action(unsigned long
+@@ -1241,6 +1241,7 @@ static void net_tx_action(unsigned long
net_tx_action_dealloc();
mop = tx_map_ops;
diff --git a/patches.xen/xen-cpufreq-report b/patches.xen/xen-cpufreq-report
index 5242e2f24f..6d89f053be 100644
--- a/patches.xen/xen-cpufreq-report
+++ b/patches.xen/xen-cpufreq-report
@@ -2,14 +2,8 @@ From: jbeulich@novell.com
Subject: make /proc/cpuinfo track CPU speed
Patch-mainline: obsolete
----
- arch/x86/kernel/acpi/processor_extcntl_xen.c | 11 +++++++++++
- include/linux/cpufreq.h | 2 +-
- include/xen/interface/platform.h | 11 +++++++++++
- 3 files changed, 23 insertions(+), 1 deletion(-)
-
---- a/arch/x86/kernel/acpi/processor_extcntl_xen.c
-+++ b/arch/x86/kernel/acpi/processor_extcntl_xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-13 14:25:35.000000000 +0200
++++ head-2009-11-06/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-11-06 11:09:27.000000000 +0100
@@ -204,3 +204,14 @@ void arch_acpi_processor_init_extcntl(co
*ops = &xen_extcntl_ops;
}
@@ -25,8 +19,8 @@ Patch-mainline: obsolete
+
+ return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0;
+}
---- a/include/linux/cpufreq.h
-+++ b/include/linux/cpufreq.h
+--- head-2009-11-06.orig/include/linux/cpufreq.h 2009-11-06 10:29:50.000000000 +0100
++++ head-2009-11-06/include/linux/cpufreq.h 2009-11-06 11:09:27.000000000 +0100
@@ -302,7 +302,7 @@ static inline unsigned int cpufreq_get(u
#endif
@@ -36,8 +30,8 @@ Patch-mainline: obsolete
unsigned int cpufreq_quick_get(unsigned int cpu);
#else
static inline unsigned int cpufreq_quick_get(unsigned int cpu)
---- a/include/xen/interface/platform.h
-+++ b/include/xen/interface/platform.h
+--- head-2009-11-06.orig/include/xen/interface/platform.h 2009-06-23 09:28:21.000000000 +0200
++++ head-2009-11-06/include/xen/interface/platform.h 2009-11-06 11:09:27.000000000 +0100
@@ -312,6 +312,16 @@ struct xenpf_set_processor_pminfo {
typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;
DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t);
diff --git a/patches.xen/xen-ipi-per-cpu-irq b/patches.xen/xen-ipi-per-cpu-irq
index 63bd4f192e..f9645b09cf 100644
--- a/patches.xen/xen-ipi-per-cpu-irq
+++ b/patches.xen/xen-ipi-per-cpu-irq
@@ -2,19 +2,8 @@ From: jbeulich@novell.com
Subject: fold IPIs onto a single IRQ each
Patch-mainline: obsolete
----
- arch/x86/kernel/apic/ipi-xen.c | 19 ---
- arch/x86/kernel/irq_32-xen.c | 2
- arch/x86/kernel/irq_64-xen.c | 1
- drivers/xen/Kconfig | 4
- drivers/xen/core/evtchn.c | 213 ++++++++++++++++++++++++++++++++++++++---
- drivers/xen/core/smpboot.c | 132 +++++++++++++------------
- drivers/xen/core/spinlock.c | 33 +++---
- include/xen/evtchn.h | 18 +++
- 8 files changed, 316 insertions(+), 106 deletions(-)
-
---- a/arch/x86/kernel/apic/ipi-xen.c
-+++ b/arch/x86/kernel/apic/ipi-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/apic/ipi-xen.c 2009-11-06 10:52:02.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/apic/ipi-xen.c 2009-11-06 11:10:20.000000000 +0100
@@ -21,31 +21,22 @@
#include <xen/evtchn.h>
@@ -50,7 +39,7 @@ Patch-mainline: obsolete
break;
default:
printk("XXXXXX __send_IPI_shortcut %08x vector %d\n", shortcut,
-@@ -63,7 +54,7 @@ void xen_send_IPI_mask_allbutself(const
+@@ -63,7 +54,7 @@ void xen_send_IPI_mask_allbutself(const
WARN_ON(!cpumask_subset(cpumask, cpu_online_mask));
for_each_cpu_and(cpu, cpumask, cpu_online_mask)
if (cpu != smp_processor_id())
@@ -68,8 +57,8 @@ Patch-mainline: obsolete
local_irq_restore(flags);
}
---- a/arch/x86/kernel/irq_32-xen.c
-+++ b/arch/x86/kernel/irq_32-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/irq_32-xen.c 2009-11-06 10:52:22.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/irq_32-xen.c 2009-11-06 11:10:20.000000000 +0100
@@ -227,6 +227,8 @@ void fixup_irqs(void)
continue;
if (irq == 2)
@@ -79,8 +68,8 @@ Patch-mainline: obsolete
affinity = desc->affinity;
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
---- a/arch/x86/kernel/irq_64-xen.c
-+++ b/arch/x86/kernel/irq_64-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/irq_64-xen.c 2009-11-06 10:52:02.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/irq_64-xen.c 2009-11-06 11:10:20.000000000 +0100
@@ -85,6 +85,7 @@ void fixup_irqs(void)
affinity = desc->affinity;
@@ -89,8 +78,8 @@ Patch-mainline: obsolete
cpumask_equal(affinity, cpu_online_mask)) {
spin_unlock(&desc->lock);
continue;
---- a/drivers/xen/Kconfig
-+++ b/drivers/xen/Kconfig
+--- head-2009-11-06.orig/drivers/xen/Kconfig 2009-11-06 11:09:26.000000000 +0100
++++ head-2009-11-06/drivers/xen/Kconfig 2009-11-06 11:10:20.000000000 +0100
@@ -4,6 +4,7 @@
config XEN
@@ -99,7 +88,7 @@ Patch-mainline: obsolete
if XEN
config XEN_INTERFACE_VERSION
-@@ -339,6 +340,9 @@ endmenu
+@@ -348,6 +349,9 @@ endmenu
config HAVE_IRQ_IGNORE_UNHANDLED
def_bool y
@@ -109,8 +98,8 @@ Patch-mainline: obsolete
config NO_IDLE_HZ
def_bool y
---- a/drivers/xen/core/evtchn.c
-+++ b/drivers/xen/core/evtchn.c
+--- head-2009-11-06.orig/drivers/xen/core/evtchn.c 2009-11-06 11:10:15.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/evtchn.c 2009-11-06 11:10:20.000000000 +0100
@@ -58,6 +58,22 @@ static DEFINE_SPINLOCK(irq_mapping_updat
static int evtchn_to_irq[NR_EVENT_CHANNELS] = {
[0 ... NR_EVENT_CHANNELS-1] = -1 };
@@ -134,7 +123,7 @@ Patch-mainline: obsolete
/* Binding types. */
enum {
IRQT_UNBOUND,
-@@ -116,12 +132,14 @@ static inline u32 mk_irq_info(u32 type,
+@@ -116,12 +132,14 @@ static inline u32 mk_irq_info(u32 type,
* Accessors for packed IRQ information.
*/
@@ -185,7 +174,7 @@ Patch-mainline: obsolete
#ifdef CONFIG_SMP
-@@ -169,8 +205,14 @@ static void bind_evtchn_to_cpu(unsigned
+@@ -169,8 +205,14 @@ static void bind_evtchn_to_cpu(unsigned
BUG_ON(!test_bit(chn, s->evtchn_mask));
@@ -202,7 +191,7 @@ Patch-mainline: obsolete
clear_bit(chn, per_cpu(cpu_evtchn_mask, cpu_evtchn[chn]));
set_bit(chn, per_cpu(cpu_evtchn_mask, cpu));
-@@ -339,7 +381,7 @@ asmlinkage void __irq_entry evtchn_do_up
+@@ -338,7 +380,7 @@ asmlinkage void __irq_entry evtchn_do_up
static struct irq_chip dynirq_chip;
@@ -211,7 +200,7 @@ Patch-mainline: obsolete
{
static int warned;
int irq;
-@@ -349,10 +391,19 @@ static int find_unbound_irq(unsigned int
+@@ -348,10 +390,19 @@ static int find_unbound_irq(unsigned int
struct irq_cfg *cfg = desc->chip_data;
if (!cfg->bindcount) {
@@ -233,7 +222,7 @@ Patch-mainline: obsolete
return irq;
}
}
-@@ -373,7 +424,7 @@ static int bind_caller_port_to_irq(unsig
+@@ -372,7 +423,7 @@ static int bind_caller_port_to_irq(unsig
spin_lock(&irq_mapping_update_lock);
if ((irq = evtchn_to_irq[caller_port]) == -1) {
@@ -242,7 +231,7 @@ Patch-mainline: obsolete
goto out;
evtchn_to_irq[caller_port] = irq;
-@@ -396,7 +447,7 @@ static int bind_local_port_to_irq(unsign
+@@ -395,7 +446,7 @@ static int bind_local_port_to_irq(unsign
BUG_ON(evtchn_to_irq[local_port] != -1);
@@ -251,7 +240,7 @@ Patch-mainline: obsolete
struct evtchn_close close = { .port = local_port };
if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close))
BUG();
-@@ -449,7 +500,7 @@ static int bind_virq_to_irq(unsigned int
+@@ -448,7 +499,7 @@ static int bind_virq_to_irq(unsigned int
spin_lock(&irq_mapping_update_lock);
if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1) {
@@ -260,7 +249,7 @@ Patch-mainline: obsolete
goto out;
bind_virq.virq = virq;
-@@ -474,6 +525,7 @@ static int bind_virq_to_irq(unsigned int
+@@ -473,6 +524,7 @@ static int bind_virq_to_irq(unsigned int
return irq;
}
@@ -268,7 +257,7 @@ Patch-mainline: obsolete
static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
{
struct evtchn_bind_ipi bind_ipi;
-@@ -482,7 +534,7 @@ static int bind_ipi_to_irq(unsigned int
+@@ -481,7 +533,7 @@ static int bind_ipi_to_irq(unsigned int
spin_lock(&irq_mapping_update_lock);
if ((irq = per_cpu(ipi_to_irq, cpu)[ipi]) == -1) {
@@ -277,7 +266,7 @@ Patch-mainline: obsolete
goto out;
bind_ipi.vcpu = cpu;
-@@ -505,6 +557,7 @@ static int bind_ipi_to_irq(unsigned int
+@@ -504,6 +556,7 @@ static int bind_ipi_to_irq(unsigned int
spin_unlock(&irq_mapping_update_lock);
return irq;
}
@@ -285,7 +274,7 @@ Patch-mainline: obsolete
static void unbind_from_irq(unsigned int irq)
{
-@@ -512,6 +565,7 @@ static void unbind_from_irq(unsigned int
+@@ -511,6 +564,7 @@ static void unbind_from_irq(unsigned int
unsigned int cpu;
int evtchn = evtchn_from_irq(irq);
@@ -293,7 +282,7 @@ Patch-mainline: obsolete
spin_lock(&irq_mapping_update_lock);
if (!--irq_cfg(irq)->bindcount && VALID_EVTCHN(evtchn)) {
-@@ -525,10 +579,12 @@ static void unbind_from_irq(unsigned int
+@@ -524,10 +578,12 @@ static void unbind_from_irq(unsigned int
per_cpu(virq_to_irq, cpu_from_evtchn(evtchn))
[index_from_irq(irq)] = -1;
break;
@@ -306,7 +295,7 @@ Patch-mainline: obsolete
default:
break;
}
-@@ -551,6 +607,46 @@ static void unbind_from_irq(unsigned int
+@@ -550,6 +606,46 @@ static void unbind_from_irq(unsigned int
spin_unlock(&irq_mapping_update_lock);
}
@@ -353,7 +342,7 @@ Patch-mainline: obsolete
int bind_caller_port_to_irqhandler(
unsigned int caller_port,
irq_handler_t handler,
-@@ -645,6 +741,8 @@ int bind_virq_to_irqhandler(
+@@ -644,6 +740,8 @@ int bind_virq_to_irqhandler(
}
EXPORT_SYMBOL_GPL(bind_virq_to_irqhandler);
@@ -362,7 +351,7 @@ Patch-mainline: obsolete
int bind_ipi_to_irqhandler(
unsigned int ipi,
unsigned int cpu,
-@@ -668,7 +766,71 @@ int bind_ipi_to_irqhandler(
+@@ -667,7 +765,71 @@ int bind_ipi_to_irqhandler(
return irq;
}
@@ -435,7 +424,7 @@ Patch-mainline: obsolete
void unbind_from_irqhandler(unsigned int irq, void *dev_id)
{
-@@ -694,6 +856,7 @@ static void rebind_irq_to_cpu(unsigned i
+@@ -693,6 +855,7 @@ static void rebind_irq_to_cpu(unsigned i
{
int evtchn = evtchn_from_irq(irq);
@@ -443,7 +432,7 @@ Patch-mainline: obsolete
if (VALID_EVTCHN(evtchn))
rebind_evtchn_to_cpu(evtchn, tcpu);
}
-@@ -779,6 +942,7 @@ static struct irq_chip dynirq_chip = {
+@@ -778,6 +941,7 @@ static struct irq_chip dynirq_chip = {
.unmask = unmask_dynirq,
.mask_ack = ack_dynirq,
.ack = ack_dynirq,
@@ -451,7 +440,7 @@ Patch-mainline: obsolete
.end = end_dynirq,
#ifdef CONFIG_SMP
.set_affinity = set_affinity_irq,
-@@ -958,10 +1122,21 @@ int irq_ignore_unhandled(unsigned int ir
+@@ -957,10 +1121,21 @@ int irq_ignore_unhandled(unsigned int ir
return !!(irq_status.flags & XENIRQSTAT_shared);
}
@@ -473,7 +462,7 @@ Patch-mainline: obsolete
if (VALID_EVTCHN(evtchn))
notify_remote_via_evtchn(evtchn);
}
-@@ -969,6 +1144,7 @@ EXPORT_SYMBOL_GPL(notify_remote_via_irq)
+@@ -968,6 +1143,7 @@ EXPORT_SYMBOL_GPL(notify_remote_via_irq)
int irq_to_evtchn_port(int irq)
{
@@ -481,7 +470,7 @@ Patch-mainline: obsolete
return evtchn_from_irq(irq);
}
EXPORT_SYMBOL_GPL(irq_to_evtchn_port);
-@@ -1084,11 +1260,17 @@ static void restore_cpu_virqs(unsigned i
+@@ -1083,11 +1259,17 @@ static void restore_cpu_virqs(unsigned i
static void restore_cpu_ipis(unsigned int cpu)
{
@@ -499,7 +488,7 @@ Patch-mainline: obsolete
continue;
BUG_ON(irq_cfg(irq)->info != mk_irq_info(IRQT_IPI, ipi, 0));
-@@ -1102,13 +1284,18 @@ static void restore_cpu_ipis(unsigned in
+@@ -1101,13 +1283,18 @@ static void restore_cpu_ipis(unsigned in
/* Record the new mapping. */
evtchn_to_irq[evtchn] = irq;
@@ -518,8 +507,8 @@ Patch-mainline: obsolete
}
static int evtchn_resume(struct sys_device *dev)
---- a/drivers/xen/core/smpboot.c
-+++ b/drivers/xen/core/smpboot.c
+--- head-2009-11-06.orig/drivers/xen/core/smpboot.c 2009-11-06 11:09:19.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/smpboot.c 2009-11-06 11:10:20.000000000 +0100
@@ -40,14 +40,10 @@ cpumask_var_t vcpu_initialized_mask;
DEFINE_PER_CPU(struct cpuinfo_x86, cpu_info);
EXPORT_PER_CPU_SYMBOL(cpu_info);
@@ -690,8 +679,8 @@ Patch-mainline: obsolete
xen_spinlock_cleanup(cpu);
}
#endif
---- a/drivers/xen/core/spinlock.c
-+++ b/drivers/xen/core/spinlock.c
+--- head-2009-11-06.orig/drivers/xen/core/spinlock.c 2009-11-06 10:52:02.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/spinlock.c 2009-11-06 11:10:20.000000000 +0100
@@ -14,8 +14,7 @@
#ifdef TICKET_SHIFT
@@ -761,8 +750,8 @@ Patch-mainline: obsolete
return;
}
}
---- a/include/xen/evtchn.h
-+++ b/include/xen/evtchn.h
+--- head-2009-11-06.orig/include/xen/evtchn.h 2009-11-06 11:10:15.000000000 +0100
++++ head-2009-11-06/include/xen/evtchn.h 2009-11-06 11:10:20.000000000 +0100
@@ -89,6 +89,8 @@ int bind_virq_to_irqhandler(
unsigned long irqflags,
const char *devname,
diff --git a/patches.xen/xen-kconfig-compat b/patches.xen/xen-kconfig-compat
index 18f7bdcb47..c440bed44b 100644
--- a/patches.xen/xen-kconfig-compat
+++ b/patches.xen/xen-kconfig-compat
@@ -2,13 +2,9 @@ From: jbeulich@novell.com
Subject: add 3.2.0-compatibility configure option
Patch-mainline: obsolete
----
- drivers/xen/Kconfig | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/drivers/xen/Kconfig
-+++ b/drivers/xen/Kconfig
-@@ -313,6 +313,12 @@ choice
+--- head-2009-10-15.orig/drivers/xen/Kconfig 2009-10-21 11:41:12.000000000 +0200
++++ head-2009-10-15/drivers/xen/Kconfig 2009-11-04 14:42:28.000000000 +0100
+@@ -318,6 +318,15 @@ choice
config XEN_COMPAT_030100_AND_LATER
bool "3.1.0 and later"
@@ -18,13 +14,17 @@ Patch-mainline: obsolete
+ config XEN_COMPAT_030300_AND_LATER
+ bool "3.3.0 and later"
+
++ config XEN_COMPAT_030400_AND_LATER
++ bool "3.4.0 and later"
++
config XEN_COMPAT_LATEST_ONLY
bool "no compatibility code"
-@@ -321,6 +327,8 @@ endchoice
+@@ -326,6 +335,9 @@ endchoice
config XEN_COMPAT
hex
default 0xffffff if XEN_COMPAT_LATEST_ONLY
++ default 0x030400 if XEN_COMPAT_030400_AND_LATER
+ default 0x030300 if XEN_COMPAT_030300_AND_LATER
+ default 0x030200 if XEN_COMPAT_030200_AND_LATER
default 0x030100 if XEN_COMPAT_030100_AND_LATER
diff --git a/patches.xen/xen-modular-blktap b/patches.xen/xen-modular-blktap
index 8d08bf759a..cbc56a1275 100644
--- a/patches.xen/xen-modular-blktap
+++ b/patches.xen/xen-modular-blktap
@@ -2,14 +2,8 @@ From: ccoffing@novell.com
Subject: Retain backwards-compatible module name with CONFIG_XEN_BLKDEV_TAP=m
Patch-mainline: obsolete
----
- drivers/xen/blktap/Makefile | 4 ++--
- drivers/xen/blktap/blocktap.c | 1 +
- drivers/xen/blktap2/Makefile | 5 +++--
- 3 files changed, 6 insertions(+), 4 deletions(-)
-
---- a/drivers/xen/blktap/Makefile
-+++ b/drivers/xen/blktap/Makefile
+--- head-2009-05-29.orig/drivers/xen/blktap/Makefile 2007-06-12 13:13:44.000000000 +0200
++++ head-2009-05-29/drivers/xen/blktap/Makefile 2009-05-29 12:39:04.000000000 +0200
@@ -1,5 +1,5 @@
LINUXINCLUDE += -I../xen/include/public/io
@@ -18,12 +12,12 @@ Patch-mainline: obsolete
-xenblktap-y := xenbus.o interface.o blktap.o
+blktap-y := xenbus.o interface.o blocktap.o
---- /dev/null
-+++ b/drivers/xen/blktap/blocktap.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-05-29/drivers/xen/blktap/blocktap.c 2009-05-29 12:39:04.000000000 +0200
@@ -0,0 +1 @@
+#include "blktap.c"
---- a/drivers/xen/blktap2/Makefile
-+++ b/drivers/xen/blktap2/Makefile
+--- head-2009-05-29.orig/drivers/xen/blktap2/Makefile 2009-05-29 10:25:53.000000000 +0200
++++ head-2009-05-29/drivers/xen/blktap2/Makefile 2009-05-29 12:39:04.000000000 +0200
@@ -1,3 +1,4 @@
-obj-$(CONFIG_XEN_BLKDEV_TAP2) := blktap.o
+obj-$(CONFIG_XEN_BLKDEV_TAP2) := blktap2.o
diff --git a/patches.xen/xen-netback-notify-multi b/patches.xen/xen-netback-notify-multi
index 39904c0a76..3796a4334d 100644
--- a/patches.xen/xen-netback-notify-multi
+++ b/patches.xen/xen-netback-notify-multi
@@ -5,15 +5,9 @@ Patch-mainline: obsolete
This also does a small fairness improvement since now notifications
get sent in the order requests came in rather than in the inverse one.
----
- drivers/xen/core/evtchn.c | 15 +++++++++++++++
- drivers/xen/netback/netback.c | 14 ++++++++++++--
- include/xen/evtchn.h | 13 +++++++++++++
- 3 files changed, 40 insertions(+), 2 deletions(-)
-
---- a/drivers/xen/core/evtchn.c
-+++ b/drivers/xen/core/evtchn.c
-@@ -1330,6 +1330,21 @@ void notify_remote_via_irq(int irq)
+--- head-2009-11-06.orig/drivers/xen/core/evtchn.c 2009-11-06 11:10:22.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/evtchn.c 2009-11-06 11:10:30.000000000 +0100
+@@ -1329,6 +1329,21 @@ void notify_remote_via_irq(int irq)
}
EXPORT_SYMBOL_GPL(notify_remote_via_irq);
@@ -35,9 +29,9 @@ get sent in the order requests came in rather than in the inverse one.
int irq_to_evtchn_port(int irq)
{
BUG_IF_VIRQ_PER_CPU(irq);
---- a/drivers/xen/netback/netback.c
-+++ b/drivers/xen/netback/netback.c
-@@ -751,10 +751,20 @@ static void net_rx_action(unsigned long
+--- head-2009-11-06.orig/drivers/xen/netback/netback.c 2009-11-06 11:10:29.000000000 +0100
++++ head-2009-11-06/drivers/xen/netback/netback.c 2009-11-06 11:10:30.000000000 +0100
+@@ -751,10 +751,20 @@ static void net_rx_action(unsigned long
npo.meta_cons += nr_frags + 1;
}
@@ -60,8 +54,8 @@ get sent in the order requests came in rather than in the inverse one.
}
/* More work to do? */
---- a/include/xen/evtchn.h
-+++ b/include/xen/evtchn.h
+--- head-2009-11-06.orig/include/xen/evtchn.h 2009-11-06 11:10:22.000000000 +0100
++++ head-2009-11-06/include/xen/evtchn.h 2009-11-06 11:10:30.000000000 +0100
@@ -190,6 +190,18 @@ static inline void notify_remote_via_evt
VOID(HYPERVISOR_event_channel_op(EVTCHNOP_send, &send));
}
diff --git a/patches.xen/xen-netback-nr-irqs b/patches.xen/xen-netback-nr-irqs
index 987b898cf4..9e5304b7bb 100644
--- a/patches.xen/xen-netback-nr-irqs
+++ b/patches.xen/xen-netback-nr-irqs
@@ -8,13 +8,8 @@ be pretty unbounded. Also, store the dynirq rather than the raw irq
to push up the limit where the type of notify_list needs to become
'int' rather than 'u16'.
----
- drivers/xen/netback/interface.c | 1 +
- drivers/xen/netback/netback.c | 16 +++++++++-------
- 2 files changed, 10 insertions(+), 7 deletions(-)
-
---- a/drivers/xen/netback/interface.c
-+++ b/drivers/xen/netback/interface.c
+--- head-2009-07-28.orig/drivers/xen/netback/interface.c 2009-07-28 12:32:07.000000000 +0200
++++ head-2009-07-28/drivers/xen/netback/interface.c 2009-07-30 10:55:48.000000000 +0200
@@ -334,6 +334,7 @@ int netif_map(netif_t *netif, unsigned l
netif->dev->name, netif);
if (err < 0)
@@ -23,9 +18,9 @@ to push up the limit where the type of notify_list needs to become
netif->irq = err;
disable_irq(netif->irq);
---- a/drivers/xen/netback/netback.c
-+++ b/drivers/xen/netback/netback.c
-@@ -583,8 +583,12 @@ static void net_rx_action(unsigned long
+--- head-2009-07-28.orig/drivers/xen/netback/netback.c 2009-07-29 10:32:34.000000000 +0200
++++ head-2009-07-28/drivers/xen/netback/netback.c 2009-05-29 12:40:22.000000000 +0200
+@@ -583,8 +583,12 @@ static void net_rx_action(unsigned long
static mmu_update_t rx_mmu[NET_RX_RING_SIZE];
static gnttab_transfer_t grant_trans_op[NET_RX_RING_SIZE];
static gnttab_copy_t grant_copy_op[NET_RX_RING_SIZE];
@@ -39,7 +34,7 @@ to push up the limit where the type of notify_list needs to become
static struct netbk_rx_meta meta[NET_RX_RING_SIZE];
struct netrx_pending_operations npo = {
-@@ -733,11 +737,9 @@ static void net_rx_action(unsigned long
+@@ -733,11 +737,9 @@ static void net_rx_action(unsigned long
nr_frags);
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netif->rx, ret);
@@ -53,7 +48,7 @@ to push up the limit where the type of notify_list needs to become
if (netif_queue_stopped(netif->dev) &&
netif_schedulable(netif) &&
-@@ -751,8 +753,8 @@ static void net_rx_action(unsigned long
+@@ -751,8 +753,8 @@ static void net_rx_action(unsigned long
while (notify_nr != 0) {
irq = notify_list[--notify_nr];
diff --git a/patches.xen/xen-op-packet b/patches.xen/xen-op-packet
index 08a3a987b8..631a24f695 100644
--- a/patches.xen/xen-op-packet
+++ b/patches.xen/xen-op-packet
@@ -3,17 +3,8 @@ Subject: add support for new operation type BLKIF_OP_PACKET
Patch-mainline: obsolete
References: fate#300964
----
- drivers/xen/blkback/blkback.c | 13 +++++++++++--
- drivers/xen/blkback/common.h | 1 +
- drivers/xen/blkfront/blkfront.c | 5 ++++-
- drivers/xen/blktap/blktap.c | 12 ++++++++++--
- drivers/xen/blktap/common.h | 1 +
- include/xen/interface/io/blkif.h | 4 ++++
- 6 files changed, 31 insertions(+), 5 deletions(-)
-
---- a/drivers/xen/blkback/blkback.c
-+++ b/drivers/xen/blkback/blkback.c
+--- head-2009-10-15.orig/drivers/xen/blkback/blkback.c 2009-10-15 12:08:38.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkback/blkback.c 2009-07-29 10:18:11.000000000 +0200
@@ -193,13 +193,15 @@ static void fast_flush_area(pending_req_
static void print_stats(blkif_t *blkif)
@@ -46,8 +37,8 @@ References: fate#300964
default:
/* A good sign something is wrong: sleep for a while to
* avoid excessive CPU consumption by a bad guest. */
---- a/drivers/xen/blkback/common.h
-+++ b/drivers/xen/blkback/common.h
+--- head-2009-10-15.orig/drivers/xen/blkback/common.h 2009-06-09 15:50:31.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkback/common.h 2009-07-29 10:18:11.000000000 +0200
@@ -89,6 +89,7 @@ typedef struct blkif_st {
int st_wr_req;
int st_oo_req;
@@ -56,8 +47,8 @@ References: fate#300964
int st_rd_sect;
int st_wr_sect;
---- a/drivers/xen/blkfront/blkfront.c
-+++ b/drivers/xen/blkfront/blkfront.c
+--- head-2009-10-15.orig/drivers/xen/blkfront/blkfront.c 2009-10-15 12:08:38.000000000 +0200
++++ head-2009-10-15/drivers/xen/blkfront/blkfront.c 2009-07-29 10:19:00.000000000 +0200
@@ -645,6 +645,8 @@ static int blkif_queue_request(struct re
BLKIF_OP_WRITE : BLKIF_OP_READ;
if (blk_barrier_rq(req))
@@ -84,8 +75,8 @@ References: fate#300964
if (unlikely(bret->status != BLKIF_RSP_OKAY))
DPRINTK("Bad return from blkdev data "
"request: %x\n", bret->status);
---- a/drivers/xen/blktap/blktap.c
-+++ b/drivers/xen/blktap/blktap.c
+--- head-2009-10-15.orig/drivers/xen/blktap/blktap.c 2009-07-30 10:55:18.000000000 +0200
++++ head-2009-10-15/drivers/xen/blktap/blktap.c 2009-07-30 10:55:28.000000000 +0200
@@ -1130,13 +1130,14 @@ static void fast_flush_area(pending_req_
static void print_stats(blkif_t *blkif)
@@ -124,8 +115,8 @@ References: fate#300964
case BLKIF_OP_READ:
operation = READ;
break;
---- a/drivers/xen/blktap/common.h
-+++ b/drivers/xen/blktap/common.h
+--- head-2009-10-15.orig/drivers/xen/blktap/common.h 2009-10-15 11:59:07.000000000 +0200
++++ head-2009-10-15/drivers/xen/blktap/common.h 2009-07-29 10:18:11.000000000 +0200
@@ -75,6 +75,7 @@ typedef struct blkif_st {
int st_rd_req;
int st_wr_req;
@@ -134,8 +125,58 @@ References: fate#300964
int st_rd_sect;
int st_wr_sect;
---- a/include/xen/interface/io/blkif.h
-+++ b/include/xen/interface/io/blkif.h
+--- head-2009-10-15.orig/drivers/xen/blktap2/blktap.h 2009-10-15 12:00:21.000000000 +0200
++++ head-2009-10-15/drivers/xen/blktap2/blktap.h 2009-11-03 10:35:24.000000000 +0100
+@@ -136,6 +136,7 @@ struct blktap_statistics {
+ int st_rd_req;
+ int st_wr_req;
+ int st_oo_req;
++ int st_pk_req;
+ int st_rd_sect;
+ int st_wr_sect;
+ s64 st_rd_cnt;
+--- head-2009-10-15.orig/drivers/xen/blktap2/device.c 2009-11-03 10:32:58.000000000 +0100
++++ head-2009-10-15/drivers/xen/blktap2/device.c 2009-11-03 10:45:45.000000000 +0100
+@@ -370,7 +370,8 @@ blktap_device_fail_pending_requests(stru
+
+ BTERR("%u:%u: failing pending %s of %d pages\n",
+ blktap_device_major, tap->minor,
+- (request->operation == BLKIF_OP_READ ?
++ (request->operation == BLKIF_OP_PACKET ?
++ "packet" : request->operation == BLKIF_OP_READ ?
+ "read" : "write"), request->nr_pages);
+
+ blktap_unmap(tap, request);
+@@ -411,6 +412,7 @@ blktap_device_finish_request(struct blkt
+ switch (request->operation) {
+ case BLKIF_OP_READ:
+ case BLKIF_OP_WRITE:
++ case BLKIF_OP_PACKET:
+ if (unlikely(res->status != BLKIF_RSP_OKAY))
+ BTERR("Bad return from device data "
+ "request: %x\n", res->status);
+@@ -645,6 +647,8 @@ blktap_device_process_request(struct blk
+ blkif_req.handle = 0;
+ blkif_req.operation = rq_data_dir(req) ?
+ BLKIF_OP_WRITE : BLKIF_OP_READ;
++ if (unlikely(blk_pc_request(req)))
++ blkif_req.operation = BLKIF_OP_PACKET;
+
+ request->id = (unsigned long)req;
+ request->operation = blkif_req.operation;
+@@ -711,7 +715,9 @@ blktap_device_process_request(struct blk
+ wmb(); /* blktap_poll() reads req_prod_pvt asynchronously */
+ ring->ring.req_prod_pvt++;
+
+- if (rq_data_dir(req)) {
++ if (unlikely(blk_pc_request(req)))
++ tap->stats.st_pk_req++;
++ else if (rq_data_dir(req)) {
+ tap->stats.st_wr_sect += nr_sects;
+ tap->stats.st_wr_req++;
+ } else {
+--- head-2009-10-15.orig/include/xen/interface/io/blkif.h 2009-08-17 14:15:11.000000000 +0200
++++ head-2009-10-15/include/xen/interface/io/blkif.h 2009-07-29 10:18:11.000000000 +0200
@@ -76,6 +76,10 @@
* "feature-flush-cache" node!
*/
diff --git a/patches.xen/xen-scsifront-block-timeout-update b/patches.xen/xen-scsifront-block-timeout-update
index 4ece77f586..577b8413cf 100644
--- a/patches.xen/xen-scsifront-block-timeout-update
+++ b/patches.xen/xen-scsifront-block-timeout-update
@@ -7,12 +7,10 @@ patches.
Signed-off-by: Hannes Reinecke <hare@suse.de>
----
- drivers/xen/scsifront/scsifront.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/xen/scsifront/scsifront.c
-+++ b/drivers/xen/scsifront/scsifront.c
+Index: head-2008-09-15/drivers/xen/scsifront/scsifront.c
+===================================================================
+--- head-2008-09-15.orig/drivers/xen/scsifront/scsifront.c 2008-09-15 15:22:09.000000000 +0200
++++ head-2008-09-15/drivers/xen/scsifront/scsifront.c 2008-09-15 15:22:12.000000000 +0200
@@ -348,7 +348,7 @@ static int scsifront_queuecommand(struct
memset(ring_req->cmnd, 0, VSCSIIF_MAX_COMMAND_SIZE);
diff --git a/patches.xen/xen-sections b/patches.xen/xen-sections
index be1ded1599..0953edcb8b 100644
--- a/patches.xen/xen-sections
+++ b/patches.xen/xen-sections
@@ -2,16 +2,9 @@ From: jbeulich@novell.com
Subject: fix placement of some routines/data
Patch-mainline: obsolete
----
- arch/x86/kernel/time-xen.c | 4 ++--
- drivers/xen/core/cpu_hotplug.c | 16 ++++++++--------
- drivers/xen/core/smpboot.c | 4 ++--
- drivers/xen/evtchn/evtchn.c | 5 +++--
- 4 files changed, 15 insertions(+), 14 deletions(-)
-
---- a/arch/x86/kernel/time-xen.c
-+++ b/arch/x86/kernel/time-xen.c
-@@ -655,7 +655,7 @@ int xen_update_persistent_clock(void)
+--- head-2009-11-06.orig/arch/x86/kernel/time-xen.c 2009-11-06 11:04:13.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/time-xen.c 2009-11-06 11:09:19.000000000 +0100
+@@ -656,7 +656,7 @@ int xen_update_persistent_clock(void)
/* Dynamically-mapped IRQ. */
DEFINE_PER_CPU(int, timer_irq);
@@ -20,7 +13,7 @@ Patch-mainline: obsolete
{
per_cpu(timer_irq, 0) =
bind_virq_to_irqhandler(
-@@ -867,7 +867,7 @@ int __cpuinit local_setup_timer(unsigned
+@@ -868,7 +868,7 @@ int __cpuinit local_setup_timer(unsigned
return 0;
}
@@ -29,8 +22,8 @@ Patch-mainline: obsolete
{
BUG_ON(cpu == 0);
unbind_from_irqhandler(per_cpu(timer_irq, cpu), NULL);
---- a/drivers/xen/core/cpu_hotplug.c
-+++ b/drivers/xen/core/cpu_hotplug.c
+--- head-2009-11-06.orig/drivers/xen/core/cpu_hotplug.c 2009-11-06 10:51:55.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/cpu_hotplug.c 2009-11-06 11:09:19.000000000 +0100
@@ -24,7 +24,7 @@ static int local_cpu_hotplug_request(voi
return (current->mm != NULL);
}
@@ -92,8 +85,8 @@ Patch-mainline: obsolete
{
unsigned int cpu;
---- a/drivers/xen/core/smpboot.c
-+++ b/drivers/xen/core/smpboot.c
+--- head-2009-11-06.orig/drivers/xen/core/smpboot.c 2009-11-06 10:52:09.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/smpboot.c 2009-11-06 11:09:19.000000000 +0100
@@ -173,7 +173,7 @@ static int __cpuinit xen_smp_intr_init(u
}
@@ -112,8 +105,8 @@ Patch-mainline: obsolete
{
while (HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL)) {
current->state = TASK_UNINTERRUPTIBLE;
---- a/drivers/xen/evtchn/evtchn.c
-+++ b/drivers/xen/evtchn/evtchn.c
+--- head-2009-11-06.orig/drivers/xen/evtchn/evtchn.c 2009-03-18 10:39:31.000000000 +0100
++++ head-2009-11-06/drivers/xen/evtchn/evtchn.c 2009-11-06 11:09:19.000000000 +0100
@@ -549,14 +549,15 @@ static int __init evtchn_init(void)
return 0;
diff --git a/patches.xen/xen-staging-build b/patches.xen/xen-staging-build
index 4e3d14e064..459ec0465b 100644
--- a/patches.xen/xen-staging-build
+++ b/patches.xen/xen-staging-build
@@ -2,14 +2,8 @@ From: jbeulich@novell.com
Subject: fix issue with Windows-style types used in drivers/staging/
Patch-mainline: obsolete
----
- arch/x86/include/mach-xen/asm/hypervisor.h | 5 +++++
- drivers/staging/vt6655/ttype.h | 3 +++
- drivers/staging/vt6656/ttype.h | 3 +++
- 3 files changed, 11 insertions(+)
-
---- a/arch/x86/include/mach-xen/asm/hypervisor.h
-+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 15:48:06.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 17:02:12.000000000 +0200
@@ -352,4 +352,9 @@ MULTI_grant_table_op(multicall_entry_t *
#define uvm_multi(cpumask) ((unsigned long)cpumask_bits(cpumask) | UVMF_MULTI)
@@ -20,8 +14,8 @@ Patch-mainline: obsolete
+#endif
+
#endif /* __HYPERVISOR_H__ */
---- a/drivers/staging/vt6655/ttype.h
-+++ b/drivers/staging/vt6655/ttype.h
+--- head-2009-10-12.orig/drivers/staging/vt6655/ttype.h 2009-10-12 11:46:31.000000000 +0200
++++ head-2009-10-12/drivers/staging/vt6655/ttype.h 2009-10-13 17:02:12.000000000 +0200
@@ -30,6 +30,9 @@
#ifndef __TTYPE_H__
#define __TTYPE_H__
@@ -32,8 +26,8 @@ Patch-mainline: obsolete
/******* Common definitions and typedefs ***********************************/
---- a/drivers/staging/vt6656/ttype.h
-+++ b/drivers/staging/vt6656/ttype.h
+--- head-2009-10-12.orig/drivers/staging/vt6656/ttype.h 2009-10-12 11:46:31.000000000 +0200
++++ head-2009-10-12/drivers/staging/vt6656/ttype.h 2009-10-13 17:02:12.000000000 +0200
@@ -30,6 +30,9 @@
#ifndef __TTYPE_H__
#define __TTYPE_H__
diff --git a/patches.xen/xen-swiotlb-heuristics b/patches.xen/xen-swiotlb-heuristics
index 6f6f82f6a3..38768c36dc 100644
--- a/patches.xen/xen-swiotlb-heuristics
+++ b/patches.xen/xen-swiotlb-heuristics
@@ -2,12 +2,8 @@ From: jbeulich@novell.com
Subject: adjust Xen's swiotlb default size setting
Patch-mainline: obsolete
----
- lib/swiotlb-xen.c | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
-
---- a/lib/swiotlb-xen.c
-+++ b/lib/swiotlb-xen.c
+--- head-2009-10-12.orig/lib/swiotlb-xen.c 2009-10-14 15:52:38.000000000 +0200
++++ head-2009-10-12/lib/swiotlb-xen.c 2009-10-14 16:20:35.000000000 +0200
@@ -211,8 +211,8 @@ swiotlb_init_with_default_size(size_t de
void __init
swiotlb_init(void)
diff --git a/patches.xen/xen-sysdev-suspend b/patches.xen/xen-sysdev-suspend
index c1d1c9d961..0142933c7e 100644
--- a/patches.xen/xen-sysdev-suspend
+++ b/patches.xen/xen-sysdev-suspend
@@ -4,17 +4,8 @@ Patch-mainline: obsolete
... rather than calling just a few functions explicitly.
----
- arch/x86/kernel/time-xen.c | 100 +++++++++++++++++---------------------
- drivers/xen/core/evtchn.c | 39 ++++++++++++++
- drivers/xen/core/gnttab.c | 34 +++++++++++-
- drivers/xen/core/machine_reboot.c | 40 +++++++++------
- include/xen/evtchn.h | 2
- include/xen/gnttab.h | 3 -
- 6 files changed, 144 insertions(+), 74 deletions(-)
-
---- a/arch/x86/kernel/time-xen.c
-+++ b/arch/x86/kernel/time-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/time-xen.c 2009-11-06 11:09:19.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/time-xen.c 2009-11-06 11:10:15.000000000 +0100
@@ -70,6 +70,10 @@ static DEFINE_PER_CPU(struct vcpu_runsta
/* Must be signed, as it's compared with s64 quantities which can be -ve. */
#define NS_PER_TICK (1000000000LL/HZ)
@@ -26,7 +17,7 @@ Patch-mainline: obsolete
static void __clock_was_set(struct work_struct *unused)
{
clock_was_set();
-@@ -549,6 +553,25 @@ void mark_tsc_unstable(char *reason)
+@@ -550,6 +554,25 @@ void mark_tsc_unstable(char *reason)
}
EXPORT_SYMBOL_GPL(mark_tsc_unstable);
@@ -52,7 +43,7 @@ Patch-mainline: obsolete
static cycle_t cs_last;
static cycle_t xen_clocksource_read(struct clocksource *cs)
-@@ -585,11 +608,32 @@ static cycle_t xen_clocksource_read(stru
+@@ -586,11 +609,32 @@ static cycle_t xen_clocksource_read(stru
#endif
}
@@ -87,7 +78,7 @@ Patch-mainline: obsolete
cs_last = local_clock();
}
-@@ -604,25 +648,6 @@ static struct clocksource clocksource_xe
+@@ -605,25 +649,6 @@ static struct clocksource clocksource_xe
.resume = xen_clocksource_resume,
};
@@ -113,7 +104,7 @@ Patch-mainline: obsolete
void xen_read_persistent_clock(struct timespec *ts)
{
const shared_info_t *s = HYPERVISOR_shared_info;
-@@ -668,10 +693,6 @@ static void __init setup_cpu0_timer_irq(
+@@ -669,10 +694,6 @@ static void __init setup_cpu0_timer_irq(
BUG_ON(per_cpu(timer_irq, 0) < 0);
}
@@ -124,7 +115,7 @@ Patch-mainline: obsolete
void __init time_init(void)
{
init_cpu_khz();
-@@ -796,35 +817,6 @@ void xen_halt(void)
+@@ -797,35 +818,6 @@ void xen_halt(void)
}
EXPORT_SYMBOL(xen_halt);
@@ -160,8 +151,8 @@ Patch-mainline: obsolete
#ifdef CONFIG_SMP
static char timer_name[NR_CPUS][15];
---- a/drivers/xen/core/evtchn.c
-+++ b/drivers/xen/core/evtchn.c
+--- head-2009-11-06.orig/drivers/xen/core/evtchn.c 2009-11-06 11:04:38.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/evtchn.c 2009-11-06 11:10:15.000000000 +0100
@@ -35,6 +35,7 @@
#include <linux/interrupt.h>
#include <linux/sched.h>
@@ -170,7 +161,7 @@ Patch-mainline: obsolete
#include <linux/ftrace.h>
#include <linux/version.h>
#include <asm/atomic.h>
-@@ -1110,10 +1111,21 @@ static void restore_cpu_ipis(unsigned in
+@@ -1109,10 +1110,21 @@ static void restore_cpu_ipis(unsigned in
}
}
@@ -193,7 +184,7 @@ Patch-mainline: obsolete
init_evtchn_cpu_bindings();
-@@ -1149,7 +1161,32 @@ void irq_resume(void)
+@@ -1148,7 +1160,32 @@ void irq_resume(void)
restore_cpu_ipis(cpu);
}
@@ -226,8 +217,8 @@ Patch-mainline: obsolete
#endif
int __init arch_early_irq_init(void)
---- a/drivers/xen/core/gnttab.c
-+++ b/drivers/xen/core/gnttab.c
+--- head-2009-11-06.orig/drivers/xen/core/gnttab.c 2009-11-06 10:51:42.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/gnttab.c 2009-11-06 11:10:15.000000000 +0100
@@ -35,6 +35,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
@@ -296,8 +287,8 @@ Patch-mainline: obsolete
nr_grant_frames = 1;
boot_max_nr_grant_frames = __max_nr_grant_frames();
---- a/drivers/xen/core/machine_reboot.c
-+++ b/drivers/xen/core/machine_reboot.c
+--- head-2009-11-06.orig/drivers/xen/core/machine_reboot.c 2009-11-06 10:51:55.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/machine_reboot.c 2009-11-06 11:10:15.000000000 +0100
@@ -17,6 +17,7 @@
#include <xen/xencons.h>
#include <xen/cpu_hotplug.h>
@@ -391,8 +382,8 @@ Patch-mainline: obsolete
return 0;
}
#endif
---- a/include/xen/evtchn.h
-+++ b/include/xen/evtchn.h
+--- head-2009-11-06.orig/include/xen/evtchn.h 2009-11-06 10:51:55.000000000 +0100
++++ head-2009-11-06/include/xen/evtchn.h 2009-11-06 11:10:15.000000000 +0100
@@ -104,7 +104,9 @@ int bind_ipi_to_irqhandler(
*/
void unbind_from_irqhandler(unsigned int irq, void *dev_id);
@@ -403,8 +394,8 @@ Patch-mainline: obsolete
/* Entry point for notifications into Linux subsystems. */
asmlinkage void evtchn_do_upcall(struct pt_regs *regs);
---- a/include/xen/gnttab.h
-+++ b/include/xen/gnttab.h
+--- head-2009-11-06.orig/include/xen/gnttab.h 2008-11-04 11:13:10.000000000 +0100
++++ head-2009-11-06/include/xen/gnttab.h 2009-11-06 11:10:15.000000000 +0100
@@ -110,8 +110,9 @@ static inline void __gnttab_dma_unmap_pa
void gnttab_reset_grant_page(struct page *page);
diff --git a/patches.xen/xen-unpriv-build b/patches.xen/xen-unpriv-build
index 8bee976928..a0b46e60da 100644
--- a/patches.xen/xen-unpriv-build
+++ b/patches.xen/xen-unpriv-build
@@ -2,17 +2,8 @@ From: jbeulich@novell.com
Subject: no need to build certain bits when building non-privileged kernel
Patch-mainline: n/a
----
- arch/x86/Kconfig | 3 +++
- drivers/firmware/Kconfig | 2 +-
- drivers/xen/core/Makefile | 5 +++--
- drivers/xen/privcmd/Makefile | 5 ++---
- drivers/xen/privcmd/privcmd.c | 9 +++++++++
- include/xen/firmware.h | 4 ++++
- 6 files changed, 22 insertions(+), 6 deletions(-)
-
---- a/arch/x86/Kconfig
-+++ b/arch/x86/Kconfig
+--- head-2009-11-06.orig/arch/x86/Kconfig 2009-11-06 10:52:09.000000000 +0100
++++ head-2009-11-06/arch/x86/Kconfig 2009-11-06 11:10:32.000000000 +0100
@@ -648,6 +648,7 @@ config HPET_EMULATE_RTC
config DMI
default y
@@ -31,8 +22,8 @@ Patch-mainline: n/a
source "fs/Kconfig"
---- a/drivers/firmware/Kconfig
-+++ b/drivers/firmware/Kconfig
+--- head-2009-11-06.orig/drivers/firmware/Kconfig 2009-11-06 10:51:32.000000000 +0100
++++ head-2009-11-06/drivers/firmware/Kconfig 2009-11-06 11:10:32.000000000 +0100
@@ -114,7 +114,7 @@ config DMIID
config ISCSI_IBFT_FIND
@@ -42,14 +33,14 @@ Patch-mainline: n/a
default n
help
This option enables the kernel to find the region of memory
---- a/drivers/xen/core/Makefile
-+++ b/drivers/xen/core/Makefile
+--- head-2009-11-06.orig/drivers/xen/core/Makefile 2009-11-06 11:09:13.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/Makefile 2009-11-06 11:10:32.000000000 +0100
@@ -2,9 +2,10 @@
# Makefile for the linux kernel.
#
--obj-y := evtchn.o gnttab.o reboot.o machine_reboot.o firmware.o domctl.o
-+obj-y := evtchn.o gnttab.o reboot.o machine_reboot.o domctl.o
+-obj-y := evtchn.o gnttab.o reboot.o machine_reboot.o firmware.o
++obj-y := evtchn.o gnttab.o reboot.o machine_reboot.o
-obj-$(CONFIG_PCI) += pci.o
+priv-$(CONFIG_PCI) += pci.o
@@ -57,16 +48,16 @@ Patch-mainline: n/a
obj-$(CONFIG_PROC_FS) += xen_proc.o
obj-$(CONFIG_SYS_HYPERVISOR) += hypervisor_sysfs.o
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
---- a/drivers/xen/privcmd/Makefile
-+++ b/drivers/xen/privcmd/Makefile
+--- head-2009-11-06.orig/drivers/xen/privcmd/Makefile 2007-07-10 09:42:30.000000000 +0200
++++ head-2009-11-06/drivers/xen/privcmd/Makefile 2009-11-06 11:10:32.000000000 +0100
@@ -1,3 +1,2 @@
-
-obj-y += privcmd.o
-obj-$(CONFIG_COMPAT) += compat_privcmd.o
+priv-$(CONFIG_COMPAT) := compat_privcmd.o
+obj-y := privcmd.o $(priv-y)
---- a/drivers/xen/privcmd/privcmd.c
-+++ b/drivers/xen/privcmd/privcmd.c
+--- head-2009-11-06.orig/drivers/xen/privcmd/privcmd.c 2009-11-06 10:51:32.000000000 +0100
++++ head-2009-11-06/drivers/xen/privcmd/privcmd.c 2009-11-06 11:10:32.000000000 +0100
@@ -33,6 +33,9 @@
static struct proc_dir_entry *privcmd_intf;
static struct proc_dir_entry *capabilities_intf;
@@ -105,8 +96,8 @@ Patch-mainline: n/a
};
static int capabilities_read(char *page, char **start, off_t off,
---- a/include/xen/firmware.h
-+++ b/include/xen/firmware.h
+--- head-2009-11-06.orig/include/xen/firmware.h 2007-07-02 08:16:19.000000000 +0200
++++ head-2009-11-06/include/xen/firmware.h 2009-11-06 11:10:32.000000000 +0100
@@ -5,6 +5,10 @@
void copy_edd(void);
#endif
diff --git a/patches.xen/xen-virq-per-cpu-irq b/patches.xen/xen-virq-per-cpu-irq
index 8b146a0d92..93a969f089 100644
--- a/patches.xen/xen-virq-per-cpu-irq
+++ b/patches.xen/xen-virq-per-cpu-irq
@@ -2,19 +2,9 @@ From: jbeulich@novell.com
Subject: fold per-CPU VIRQs onto a single IRQ each
Patch-mainline: obsolete
----
- arch/x86/kernel/time-xen.c | 32 +---
- drivers/xen/core/evtchn.c | 263 ++++++++++++++++++++++++++++++++++---
- drivers/xen/core/smpboot.c | 16 +-
- drivers/xen/core/spinlock.c | 2
- drivers/xen/netback/netback.c | 15 +-
- drivers/xen/xenoprof/xenoprofile.c | 14 -
- include/xen/evtchn.h | 19 ++
- 7 files changed, 295 insertions(+), 66 deletions(-)
-
---- a/arch/x86/kernel/time-xen.c
-+++ b/arch/x86/kernel/time-xen.c
-@@ -678,19 +678,17 @@ int xen_update_persistent_clock(void)
+--- head-2009-11-06.orig/arch/x86/kernel/time-xen.c 2009-11-06 11:10:15.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/time-xen.c 2009-11-06 11:10:22.000000000 +0100
+@@ -679,19 +679,17 @@ int xen_update_persistent_clock(void)
}
/* Dynamically-mapped IRQ. */
@@ -42,7 +32,7 @@ Patch-mainline: obsolete
}
void __init time_init(void)
-@@ -818,8 +816,6 @@ void xen_halt(void)
+@@ -819,8 +817,6 @@ void xen_halt(void)
EXPORT_SYMBOL(xen_halt);
#ifdef CONFIG_SMP
@@ -51,7 +41,7 @@ Patch-mainline: obsolete
int __cpuinit local_setup_timer(unsigned int cpu)
{
int seq, irq;
-@@ -845,16 +841,10 @@ int __cpuinit local_setup_timer(unsigned
+@@ -846,16 +842,10 @@ int __cpuinit local_setup_timer(unsigned
init_missing_ticks_accounting(cpu);
} while (read_seqretry(&xtime_lock, seq));
@@ -70,7 +60,7 @@ Patch-mainline: obsolete
return 0;
}
-@@ -862,7 +852,7 @@ int __cpuinit local_setup_timer(unsigned
+@@ -863,7 +853,7 @@ int __cpuinit local_setup_timer(unsigned
void __cpuinit local_teardown_timer(unsigned int cpu)
{
BUG_ON(cpu == 0);
@@ -79,8 +69,8 @@ Patch-mainline: obsolete
}
#endif
---- a/drivers/xen/core/evtchn.c
-+++ b/drivers/xen/core/evtchn.c
+--- head-2009-11-06.orig/drivers/xen/core/evtchn.c 2009-11-06 11:10:20.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/evtchn.c 2009-11-06 11:10:22.000000000 +0100
@@ -58,6 +58,23 @@ static DEFINE_SPINLOCK(irq_mapping_updat
static int evtchn_to_irq[NR_EVENT_CHANNELS] = {
[0 ... NR_EVENT_CHANNELS-1] = -1 };
@@ -105,7 +95,7 @@ Patch-mainline: obsolete
/* IRQ <-> IPI mapping. */
#ifndef NR_IPIS
#define NR_IPIS 1
-@@ -132,15 +149,6 @@ static inline u32 mk_irq_info(u32 type,
+@@ -132,15 +149,6 @@ static inline u32 mk_irq_info(u32 type,
* Accessors for packed IRQ information.
*/
@@ -169,7 +159,7 @@ Patch-mainline: obsolete
/* IRQ <-> VIRQ mapping. */
DEFINE_PER_CPU(int[NR_VIRQS], virq_to_irq) = {[0 ... NR_VIRQS-1] = -1};
-@@ -511,6 +534,14 @@ static int bind_virq_to_irq(unsigned int
+@@ -510,6 +533,14 @@ static int bind_virq_to_irq(unsigned int
evtchn = bind_virq.port;
evtchn_to_irq[evtchn] = irq;
@@ -184,7 +174,7 @@ Patch-mainline: obsolete
irq_cfg(irq)->info = mk_irq_info(IRQT_VIRQ, virq, evtchn);
per_cpu(virq_to_irq, cpu)[virq] = irq;
-@@ -565,7 +596,9 @@ static void unbind_from_irq(unsigned int
+@@ -564,7 +595,9 @@ static void unbind_from_irq(unsigned int
unsigned int cpu;
int evtchn = evtchn_from_irq(irq);
@@ -194,7 +184,7 @@ Patch-mainline: obsolete
spin_lock(&irq_mapping_update_lock);
if (!--irq_cfg(irq)->bindcount && VALID_EVTCHN(evtchn)) {
-@@ -578,6 +611,11 @@ static void unbind_from_irq(unsigned int
+@@ -577,6 +610,11 @@ static void unbind_from_irq(unsigned int
case IRQT_VIRQ:
per_cpu(virq_to_irq, cpu_from_evtchn(evtchn))
[index_from_irq(irq)] = -1;
@@ -206,7 +196,7 @@ Patch-mainline: obsolete
break;
#if defined(CONFIG_SMP) && defined(PER_CPU_IPI_IRQ)
case IRQT_IPI:
-@@ -607,11 +645,13 @@ static void unbind_from_irq(unsigned int
+@@ -606,11 +644,13 @@ static void unbind_from_irq(unsigned int
spin_unlock(&irq_mapping_update_lock);
}
@@ -222,7 +212,7 @@ Patch-mainline: obsolete
spin_lock(&irq_mapping_update_lock);
-@@ -622,6 +662,32 @@ void unbind_from_per_cpu_irq(unsigned in
+@@ -621,6 +661,32 @@ void unbind_from_per_cpu_irq(unsigned in
BUG_ON(irq_cfg(irq)->bindcount <= 1);
irq_cfg(irq)->bindcount--;
@@ -255,7 +245,7 @@ Patch-mainline: obsolete
cpumask_clear_cpu(cpu, desc->affinity);
close.port = evtchn;
-@@ -629,9 +695,16 @@ void unbind_from_per_cpu_irq(unsigned in
+@@ -628,9 +694,16 @@ void unbind_from_per_cpu_irq(unsigned in
BUG();
switch (type_from_irq(irq)) {
@@ -272,7 +262,7 @@ Patch-mainline: obsolete
default:
BUG();
break;
-@@ -643,9 +716,16 @@ void unbind_from_per_cpu_irq(unsigned in
+@@ -642,9 +715,16 @@ void unbind_from_per_cpu_irq(unsigned in
evtchn_to_irq[evtchn] = -1;
}
@@ -290,7 +280,7 @@ Patch-mainline: obsolete
int bind_caller_port_to_irqhandler(
unsigned int caller_port,
-@@ -727,6 +807,8 @@ int bind_virq_to_irqhandler(
+@@ -726,6 +806,8 @@ int bind_virq_to_irqhandler(
{
int irq, retval;
@@ -299,7 +289,7 @@ Patch-mainline: obsolete
irq = bind_virq_to_irq(virq, cpu);
if (irq < 0)
return irq;
-@@ -742,6 +824,108 @@ int bind_virq_to_irqhandler(
+@@ -741,6 +823,108 @@ int bind_virq_to_irqhandler(
EXPORT_SYMBOL_GPL(bind_virq_to_irqhandler);
#ifdef CONFIG_SMP
@@ -408,7 +398,7 @@ Patch-mainline: obsolete
#ifdef PER_CPU_IPI_IRQ
int bind_ipi_to_irqhandler(
unsigned int ipi,
-@@ -821,7 +1005,7 @@ int __cpuinit bind_ipi_to_irqaction(
+@@ -820,7 +1004,7 @@ int __cpuinit bind_ipi_to_irqaction(
action->flags |= IRQF_PERCPU | IRQF_NO_SUSPEND;
retval = setup_irq(irq, action);
if (retval) {
@@ -417,7 +407,7 @@ Patch-mainline: obsolete
BUG_ON(retval > 0);
irq = retval;
}
-@@ -856,7 +1040,9 @@ static void rebind_irq_to_cpu(unsigned i
+@@ -855,7 +1039,9 @@ static void rebind_irq_to_cpu(unsigned i
{
int evtchn = evtchn_from_irq(irq);
@@ -427,7 +417,7 @@ Patch-mainline: obsolete
if (VALID_EVTCHN(evtchn))
rebind_evtchn_to_cpu(evtchn, tcpu);
}
-@@ -1136,7 +1322,9 @@ void notify_remote_via_irq(int irq)
+@@ -1135,7 +1321,9 @@ void notify_remote_via_irq(int irq)
{
int evtchn = evtchn_from_irq(irq);
@@ -437,7 +427,7 @@ Patch-mainline: obsolete
if (VALID_EVTCHN(evtchn))
notify_remote_via_evtchn(evtchn);
}
-@@ -1144,6 +1332,7 @@ EXPORT_SYMBOL_GPL(notify_remote_via_irq)
+@@ -1143,6 +1331,7 @@ EXPORT_SYMBOL_GPL(notify_remote_via_irq)
int irq_to_evtchn_port(int irq)
{
@@ -445,7 +435,7 @@ Patch-mainline: obsolete
BUG_IF_IPI(irq);
return evtchn_from_irq(irq);
}
-@@ -1238,6 +1427,12 @@ static void restore_cpu_virqs(unsigned i
+@@ -1237,6 +1426,12 @@ static void restore_cpu_virqs(unsigned i
if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1)
continue;
@@ -458,7 +448,7 @@ Patch-mainline: obsolete
BUG_ON(irq_cfg(irq)->info != mk_irq_info(IRQT_VIRQ, virq, 0));
/* Get a new binding from Xen. */
-@@ -1250,7 +1445,20 @@ static void restore_cpu_virqs(unsigned i
+@@ -1249,7 +1444,20 @@ static void restore_cpu_virqs(unsigned i
/* Record the new mapping. */
evtchn_to_irq[evtchn] = irq;
@@ -479,7 +469,7 @@ Patch-mainline: obsolete
bind_evtchn_to_cpu(evtchn, cpu);
/* Ready for use. */
-@@ -1306,7 +1514,11 @@ static int evtchn_resume(struct sys_devi
+@@ -1305,7 +1513,11 @@ static int evtchn_resume(struct sys_devi
/* Avoid doing anything in the 'suspend cancelled' case. */
status.dom = DOMID_SELF;
@@ -491,7 +481,7 @@ Patch-mainline: obsolete
if (HYPERVISOR_event_channel_op(EVTCHNOP_status, &status))
BUG();
if (status.status == EVTCHNSTAT_virq
-@@ -1535,6 +1747,15 @@ void __init xen_init_IRQ(void)
+@@ -1534,6 +1746,15 @@ void __init xen_init_IRQ(void)
unsigned int i;
struct physdev_pirq_eoi_gmfn eoi_gmfn;
@@ -507,8 +497,8 @@ Patch-mainline: obsolete
init_evtchn_cpu_bindings();
i = get_order(sizeof(unsigned long) * BITS_TO_LONGS(nr_pirqs));
---- a/drivers/xen/core/smpboot.c
-+++ b/drivers/xen/core/smpboot.c
+--- head-2009-11-06.orig/drivers/xen/core/smpboot.c 2009-11-06 11:10:20.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/smpboot.c 2009-11-06 11:10:22.000000000 +0100
@@ -168,13 +168,13 @@ static int __cpuinit xen_smp_intr_init(u
fail:
xen_spinlock_cleanup(cpu);
@@ -542,8 +532,8 @@ Patch-mainline: obsolete
xen_spinlock_cleanup(cpu);
}
#endif
---- a/drivers/xen/core/spinlock.c
-+++ b/drivers/xen/core/spinlock.c
+--- head-2009-11-06.orig/drivers/xen/core/spinlock.c 2009-11-06 11:10:20.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/spinlock.c 2009-11-06 11:10:22.000000000 +0100
@@ -55,7 +55,7 @@ int __cpuinit xen_spinlock_init(unsigned
void __cpuinit xen_spinlock_cleanup(unsigned int cpu)
@@ -553,8 +543,8 @@ Patch-mainline: obsolete
}
int xen_spin_wait(raw_spinlock_t *lock, unsigned int token)
---- a/drivers/xen/netback/netback.c
-+++ b/drivers/xen/netback/netback.c
+--- head-2009-11-06.orig/drivers/xen/netback/netback.c 2009-11-06 10:52:23.000000000 +0100
++++ head-2009-11-06/drivers/xen/netback/netback.c 2009-11-06 11:10:22.000000000 +0100
@@ -1589,6 +1589,12 @@ static irqreturn_t netif_be_dbg(int irq,
return IRQ_HANDLED;
@@ -584,8 +574,8 @@ Patch-mainline: obsolete
#endif
return 0;
---- a/drivers/xen/xenoprof/xenoprofile.c
-+++ b/drivers/xen/xenoprof/xenoprofile.c
+--- head-2009-11-06.orig/drivers/xen/xenoprof/xenoprofile.c 2009-11-06 10:51:55.000000000 +0100
++++ head-2009-11-06/drivers/xen/xenoprof/xenoprofile.c 2009-11-06 11:10:22.000000000 +0100
@@ -210,6 +210,11 @@ static irqreturn_t xenoprof_ovf_interrup
return IRQ_HANDLED;
}
@@ -621,8 +611,8 @@ Patch-mainline: obsolete
if (result < 0) {
unbind_virq();
---- a/include/xen/evtchn.h
-+++ b/include/xen/evtchn.h
+--- head-2009-11-06.orig/include/xen/evtchn.h 2009-11-06 11:10:20.000000000 +0100
++++ head-2009-11-06/include/xen/evtchn.h 2009-11-06 11:10:22.000000000 +0100
@@ -89,6 +89,17 @@ int bind_virq_to_irqhandler(
unsigned long irqflags,
const char *devname,
diff --git a/patches.xen/xen-x86-bigmem b/patches.xen/xen-x86-bigmem
index ceb94697a4..5912a65e3d 100644
--- a/patches.xen/xen-x86-bigmem
+++ b/patches.xen/xen-x86-bigmem
@@ -3,14 +3,8 @@ Subject: fix issues with the assignment of huge amounts of memory
Patch-mainline: obsolete
References: bnc#482614, bnc#537435
----
- arch/x86/kernel/e820-xen.c | 37 +++++++++++++++++++++++++++++++++++++
- arch/x86/kernel/setup-xen.c | 30 ++++++++++++++++++------------
- drivers/xen/core/machine_reboot.c | 2 +-
- 3 files changed, 56 insertions(+), 13 deletions(-)
-
---- a/arch/x86/kernel/e820-xen.c
-+++ b/arch/x86/kernel/e820-xen.c
+--- head-2009-10-15.orig/arch/x86/kernel/e820-xen.c 2009-10-13 16:43:01.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/e820-xen.c 2009-10-13 17:22:14.000000000 +0200
@@ -1350,6 +1350,26 @@ static int __init parse_memopt(char *p)
userdef = 1;
@@ -69,8 +63,8 @@ References: bnc#482614, bnc#537435
if (is_initial_xendomain()) {
memmap.nr_entries = E820MAX;
set_xen_guest_handle(memmap.buffer, machine_e820.map);
---- a/arch/x86/kernel/setup-xen.c
-+++ b/arch/x86/kernel/setup-xen.c
+--- head-2009-10-15.orig/arch/x86/kernel/setup-xen.c 2009-10-13 17:07:23.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/setup-xen.c 2009-10-30 14:36:36.000000000 +0100
@@ -128,12 +128,7 @@ static struct notifier_block xen_panic_b
unsigned long *phys_to_machine_mapping;
EXPORT_SYMBOL(phys_to_machine_mapping);
@@ -85,7 +79,7 @@ References: bnc#482614, bnc#537435
/* Raw start-of-day parameters from the hypervisor. */
start_info_t *xen_start_info;
-@@ -1136,17 +1131,17 @@ void __init setup_arch(char **cmdline_p)
+@@ -1137,17 +1132,17 @@ void __init setup_arch(char **cmdline_p)
p2m_pages = xen_start_info->nr_pages;
if (!xen_feature(XENFEAT_auto_translated_physmap)) {
@@ -106,7 +100,7 @@ References: bnc#482614, bnc#537435
free_bootmem(
__pa(xen_start_info->mfn_list),
PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
-@@ -1156,15 +1151,26 @@ void __init setup_arch(char **cmdline_p)
+@@ -1157,15 +1152,26 @@ void __init setup_arch(char **cmdline_p)
* Initialise the list of the frames that specify the list of
* frames that make up the p2m table. Used by save/restore.
*/
@@ -136,8 +130,8 @@ References: bnc#482614, bnc#537435
pfn_to_mfn_frame_list[k] =
alloc_bootmem_pages(PAGE_SIZE);
pfn_to_mfn_frame_list_list[k] =
---- a/drivers/xen/core/machine_reboot.c
-+++ b/drivers/xen/core/machine_reboot.c
+--- head-2009-10-15.orig/drivers/xen/core/machine_reboot.c 2009-10-13 17:07:02.000000000 +0200
++++ head-2009-10-15/drivers/xen/core/machine_reboot.c 2009-10-13 17:22:14.000000000 +0200
@@ -79,7 +79,7 @@ static void post_suspend(int suspend_can
unsigned long shinfo_mfn;
extern unsigned long max_pfn;
diff --git a/patches.xen/xen-x86-consistent-nmi b/patches.xen/xen-x86-consistent-nmi
index 2f3868701c..ec0e55848f 100644
--- a/patches.xen/xen-x86-consistent-nmi
+++ b/patches.xen/xen-x86-consistent-nmi
@@ -3,19 +3,8 @@ Subject: make i386 and x86 NMI code consistent, disable all APIC-related stuff
Patch-mainline: obsolete
References: 191115
----
- arch/x86/include/asm/irq.h | 2 +-
- arch/x86/include/asm/nmi.h | 12 ++++++++----
- arch/x86/kernel/apic/Makefile | 2 --
- arch/x86/kernel/apic/nmi.c | 17 ++++++++++++++---
- arch/x86/kernel/cpu/Makefile | 2 +-
- arch/x86/kernel/head-xen.c | 4 ----
- arch/x86/kernel/traps-xen.c | 3 +++
- kernel/sysctl.c | 2 ++
- 8 files changed, 29 insertions(+), 15 deletions(-)
-
---- a/arch/x86/include/asm/irq.h
-+++ b/arch/x86/include/asm/irq.h
+--- head-2009-10-15.orig/arch/x86/include/asm/irq.h 2009-10-15 15:31:13.000000000 +0200
++++ head-2009-10-15/arch/x86/include/asm/irq.h 2009-10-13 17:07:27.000000000 +0200
@@ -15,7 +15,7 @@ static inline int irq_canonicalize(int i
return ((irq == 2) ? 9 : irq);
}
@@ -25,8 +14,8 @@ References: 191115
# define ARCH_HAS_NMI_WATCHDOG
#endif
---- a/arch/x86/include/asm/nmi.h
-+++ b/arch/x86/include/asm/nmi.h
+--- head-2009-10-15.orig/arch/x86/include/asm/nmi.h 2009-10-15 15:31:13.000000000 +0200
++++ head-2009-10-15/arch/x86/include/asm/nmi.h 2009-10-13 17:07:27.000000000 +0200
@@ -5,8 +5,6 @@
#include <asm/irq.h>
#include <asm/io.h>
@@ -74,8 +63,8 @@ References: 191115
void stop_nmi(void);
void restart_nmi(void);
---- a/arch/x86/kernel/apic/Makefile
-+++ b/arch/x86/kernel/apic/Makefile
+--- head-2009-10-15.orig/arch/x86/kernel/apic/Makefile 2009-10-15 12:06:12.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/apic/Makefile 2009-10-13 17:07:27.000000000 +0200
@@ -18,8 +18,6 @@ obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
obj-$(CONFIG_X86_ES7000) += es7000_32.o
obj-$(CONFIG_X86_SUMMIT) += summit_32.o
@@ -85,8 +74,8 @@ References: 191115
probe_64-$(CONFIG_XEN) := probe_32.o
disabled-obj-$(CONFIG_XEN) := apic_flat_$(BITS).o
---- a/arch/x86/kernel/apic/nmi.c
-+++ b/arch/x86/kernel/apic/nmi.c
+--- head-2009-10-15.orig/arch/x86/kernel/apic/nmi.c 2009-10-15 12:03:11.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/apic/nmi.c 2009-10-13 17:18:34.000000000 +0200
@@ -27,8 +27,10 @@
#include <linux/kdebug.h>
#include <linux/smp.h>
@@ -123,7 +112,7 @@ References: 191115
#ifdef CONFIG_X86_32
timer_ack = 0;
-@@ -472,8 +475,11 @@ nmi_watchdog_tick(struct pt_regs *regs,
+@@ -472,8 +475,11 @@ nmi_watchdog_tick(struct pt_regs *regs,
return rc;
}
@@ -172,8 +161,8 @@ References: 191115
}
}
+#endif
---- a/arch/x86/kernel/cpu/Makefile
-+++ b/arch/x86/kernel/cpu/Makefile
+--- head-2009-10-15.orig/arch/x86/kernel/cpu/Makefile 2009-10-13 10:15:02.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/cpu/Makefile 2009-10-13 17:17:07.000000000 +0200
@@ -35,7 +35,7 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/
obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
@@ -183,8 +172,8 @@ References: 191115
quiet_cmd_mkcapflags = MKCAP $@
cmd_mkcapflags = $(PERL) $(srctree)/$(src)/mkcapflags.pl $< $@
---- a/arch/x86/kernel/head-xen.c
-+++ b/arch/x86/kernel/head-xen.c
+--- head-2009-10-15.orig/arch/x86/kernel/head-xen.c 2009-10-15 15:27:23.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/head-xen.c 2009-10-15 15:32:46.000000000 +0200
@@ -179,12 +179,10 @@ void __init xen_arch_setup(void)
.address = CALLBACK_ADDR(system_call)
};
@@ -213,8 +202,8 @@ References: 191115
-#endif
}
#endif /* CONFIG_XEN */
---- a/arch/x86/kernel/traps-xen.c
-+++ b/arch/x86/kernel/traps-xen.c
+--- head-2009-10-15.orig/arch/x86/kernel/traps-xen.c 2009-10-14 17:24:57.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/traps-xen.c 2009-10-14 17:26:48.000000000 +0200
@@ -51,6 +51,7 @@
#include <asm/atomic.h>
#include <asm/system.h>
@@ -238,8 +227,8 @@ References: 191115
if (!do_nmi_callback(regs, cpu))
unknown_nmi_error(reason, regs);
#else
---- a/kernel/sysctl.c
-+++ b/kernel/sysctl.c
+--- head-2009-10-15.orig/kernel/sysctl.c 2009-10-12 13:59:42.000000000 +0200
++++ head-2009-10-15/kernel/sysctl.c 2009-10-13 17:07:27.000000000 +0200
@@ -772,6 +772,7 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec,
diff --git a/patches.xen/xen-x86-dcr-fallback b/patches.xen/xen-x86-dcr-fallback
index 0e6d60b582..97a07d5415 100644
--- a/patches.xen/xen-x86-dcr-fallback
+++ b/patches.xen/xen-x86-dcr-fallback
@@ -6,14 +6,8 @@ References: 181869
This avoids losing precious special memory in places where any memory can be
used.
----
- arch/x86/mm/hypervisor.c | 78 ++++++++++++++++++++++++++++++++++++++++++
- drivers/xen/balloon/balloon.c | 20 +++++++++-
- include/xen/balloon.h | 4 ++
- 3 files changed, 99 insertions(+), 3 deletions(-)
-
---- a/arch/x86/mm/hypervisor.c
-+++ b/arch/x86/mm/hypervisor.c
+--- head-2009-10-12.orig/arch/x86/mm/hypervisor.c 2009-10-12 16:32:30.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/hypervisor.c 2009-06-09 15:52:17.000000000 +0200
@@ -43,6 +43,7 @@
#include <xen/interface/memory.h>
#include <linux/module.h>
@@ -106,8 +100,8 @@ used.
}
EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region);
---- a/drivers/xen/balloon/balloon.c
-+++ b/drivers/xen/balloon/balloon.c
+--- head-2009-10-12.orig/drivers/xen/balloon/balloon.c 2009-10-14 16:19:48.000000000 +0200
++++ head-2009-10-12/drivers/xen/balloon/balloon.c 2009-10-14 16:21:57.000000000 +0200
@@ -717,7 +717,8 @@ struct page **alloc_empty_pages_and_page
goto out;
}
@@ -149,8 +143,8 @@ used.
void balloon_release_driver_page(struct page *page)
{
unsigned long flags;
---- a/include/xen/balloon.h
-+++ b/include/xen/balloon.h
+--- head-2009-10-12.orig/include/xen/balloon.h 2009-10-12 15:55:39.000000000 +0200
++++ head-2009-10-12/include/xen/balloon.h 2009-06-09 15:52:17.000000000 +0200
@@ -47,6 +47,10 @@ void balloon_update_driver_allowance(lon
struct page **alloc_empty_pages_and_pagevec(int nr_pages);
void free_empty_pages_and_pagevec(struct page **pagevec, int nr_pages);
diff --git a/patches.xen/xen-x86-exit-mmap b/patches.xen/xen-x86-exit-mmap
index a9a28b7724..1f79225fcd 100644
--- a/patches.xen/xen-x86-exit-mmap
+++ b/patches.xen/xen-x86-exit-mmap
@@ -5,12 +5,8 @@ Patch-mainline: obsolete
... by not only handling the current task on the CPU arch_exit_mmap()
gets executed on, but also forcing remote CPUs to do so.
----
- arch/x86/mm/pgtable-xen.c | 40 +++++++++++++++++++++++++++++-----------
- 1 file changed, 29 insertions(+), 11 deletions(-)
-
---- a/arch/x86/mm/pgtable-xen.c
-+++ b/arch/x86/mm/pgtable-xen.c
+--- head-2009-10-12.orig/arch/x86/mm/pgtable-xen.c 2009-10-13 17:22:09.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/pgtable-xen.c 2009-10-14 14:19:25.000000000 +0200
@@ -1,5 +1,6 @@
#include <linux/mm.h>
#include <linux/module.h>
diff --git a/patches.xen/xen-x86-machphys-prediction b/patches.xen/xen-x86-machphys-prediction
index b1f70dc2ab..b633164706 100644
--- a/patches.xen/xen-x86-machphys-prediction
+++ b/patches.xen/xen-x86-machphys-prediction
@@ -2,14 +2,8 @@ From: jbeulich@novell.com
Subject: properly predict phys<->mach translations
Patch-mainline: obsolete
----
- arch/x86/include/mach-xen/asm/maddr_32.h | 23 +++++++++++++----------
- arch/x86/include/mach-xen/asm/maddr_64.h | 23 +++++++++++++----------
- arch/x86/include/mach-xen/asm/pgtable_types.h | 20 ++++++++++----------
- 3 files changed, 36 insertions(+), 30 deletions(-)
-
---- a/arch/x86/include/mach-xen/asm/maddr_32.h
-+++ b/arch/x86/include/mach-xen/asm/maddr_32.h
+--- head-2009-07-28.orig/arch/x86/include/mach-xen/asm/maddr_32.h 2009-07-28 12:14:16.000000000 +0200
++++ head-2009-07-28/arch/x86/include/mach-xen/asm/maddr_32.h 2009-07-29 10:56:35.000000000 +0200
@@ -30,17 +30,19 @@ extern unsigned int machine_to_phys_or
static inline unsigned long pfn_to_mfn(unsigned long pfn)
@@ -67,8 +61,8 @@ Patch-mainline: obsolete
BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
return;
}
---- a/arch/x86/include/mach-xen/asm/maddr_64.h
-+++ b/arch/x86/include/mach-xen/asm/maddr_64.h
+--- head-2009-07-28.orig/arch/x86/include/mach-xen/asm/maddr_64.h 2009-07-28 12:14:16.000000000 +0200
++++ head-2009-07-28/arch/x86/include/mach-xen/asm/maddr_64.h 2009-07-29 10:56:35.000000000 +0200
@@ -25,17 +25,19 @@ extern unsigned int machine_to_phys_or
static inline unsigned long pfn_to_mfn(unsigned long pfn)
@@ -126,8 +120,8 @@ Patch-mainline: obsolete
BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
return;
}
---- a/arch/x86/include/mach-xen/asm/pgtable_types.h
-+++ b/arch/x86/include/mach-xen/asm/pgtable_types.h
+--- head-2009-07-28.orig/arch/x86/include/mach-xen/asm/pgtable_types.h 2009-07-28 13:14:11.000000000 +0200
++++ head-2009-07-28/arch/x86/include/mach-xen/asm/pgtable_types.h 2009-07-29 10:56:35.000000000 +0200
@@ -207,7 +207,7 @@ typedef struct { pgdval_t pgd; } pgd_t;
#define __pgd_ma(x) ((pgd_t) { (x) } )
static inline pgd_t xen_make_pgd(pgdval_t val)
diff --git a/patches.xen/xen-x86-no-lapic b/patches.xen/xen-x86-no-lapic
index d81f7c0771..6928f2ac9a 100644
--- a/patches.xen/xen-x86-no-lapic
+++ b/patches.xen/xen-x86-no-lapic
@@ -3,20 +3,8 @@ Subject: Disallow all accesses to the local APIC page
Patch-mainline: obsolete
References: 191115
----
- arch/x86/include/asm/apic.h | 13 +++++++++++++
- arch/x86/include/asm/apicdef.h | 16 ++++++++++++++++
- arch/x86/include/mach-xen/asm/fixmap.h | 3 +--
- arch/x86/include/mach-xen/asm/smp.h | 4 ++--
- arch/x86/kernel/acpi/boot.c | 12 +++++++-----
- arch/x86/kernel/apic/io_apic-xen.c | 6 ++++++
- arch/x86/kernel/irq-xen.c | 10 +++++++++-
- arch/x86/kernel/mpparse-xen.c | 10 +++++++++-
- drivers/xen/core/smpboot.c | 2 +-
- 9 files changed, 64 insertions(+), 12 deletions(-)
-
---- a/arch/x86/include/asm/apic.h
-+++ b/arch/x86/include/asm/apic.h
+--- head-2009-10-12.orig/arch/x86/include/asm/apic.h 2009-10-12 15:16:17.000000000 +0200
++++ head-2009-10-12/arch/x86/include/asm/apic.h 2009-10-13 17:19:31.000000000 +0200
@@ -10,7 +10,9 @@
#include <asm/processor.h>
#include <asm/apicdef.h>
@@ -80,8 +68,8 @@ References: 191115
#endif /* CONFIG_X86_LOCAL_APIC */
#ifdef CONFIG_X86_32
---- a/arch/x86/include/asm/apicdef.h
-+++ b/arch/x86/include/asm/apicdef.h
+--- head-2009-10-12.orig/arch/x86/include/asm/apicdef.h 2009-10-15 11:01:41.000000000 +0200
++++ head-2009-10-12/arch/x86/include/asm/apicdef.h 2009-10-14 17:01:50.000000000 +0200
@@ -11,6 +11,8 @@
#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000
#define APIC_DEFAULT_PHYS_BASE 0xfee00000
@@ -126,8 +114,8 @@ References: 191115
#ifdef CONFIG_X86_32
#define BAD_APICID 0xFFu
#else
---- a/arch/x86/include/mach-xen/asm/fixmap.h
-+++ b/arch/x86/include/mach-xen/asm/fixmap.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/fixmap.h 2009-10-13 09:41:29.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/fixmap.h 2009-10-13 17:19:31.000000000 +0200
@@ -17,7 +17,6 @@
#ifndef __ASSEMBLY__
#include <linux/kernel.h>
@@ -148,8 +136,8 @@ References: 191115
#ifdef CONFIG_X86_IO_APIC
FIX_IO_APIC_BASE_0,
FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
---- a/arch/x86/include/mach-xen/asm/smp.h
-+++ b/arch/x86/include/mach-xen/asm/smp.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/smp.h 2009-10-14 15:21:42.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/smp.h 2009-10-14 15:24:21.000000000 +0200
@@ -15,7 +15,7 @@
# include <asm/io_apic.h>
# endif
@@ -168,8 +156,8 @@ References: 191115
#ifndef CONFIG_X86_64
static inline int logical_smp_processor_id(void)
---- a/arch/x86/kernel/acpi/boot.c
-+++ b/arch/x86/kernel/acpi/boot.c
+--- head-2009-10-12.orig/arch/x86/kernel/acpi/boot.c 2009-10-12 16:32:30.000000000 +0200
++++ head-2009-10-12/arch/x86/kernel/acpi/boot.c 2009-10-13 17:19:31.000000000 +0200
@@ -71,13 +71,13 @@ int acpi_sci_override_gsi __initdata;
#ifndef CONFIG_XEN
int acpi_skip_timer_override __initdata;
@@ -219,7 +207,7 @@ References: 191115
return 0;
}
-@@ -1055,7 +1057,7 @@ int mp_register_gsi(struct device *dev,
+@@ -1055,7 +1057,7 @@ int mp_register_gsi(struct device *dev,
ioapic_pin = mp_find_ioapic_pin(ioapic, gsi);
@@ -228,8 +216,8 @@ References: 191115
if (ioapic_renumber_irq)
gsi = ioapic_renumber_irq(ioapic, gsi);
#endif
---- a/arch/x86/kernel/apic/io_apic-xen.c
-+++ b/arch/x86/kernel/apic/io_apic-xen.c
+--- head-2009-10-12.orig/arch/x86/kernel/apic/io_apic-xen.c 2009-10-14 16:58:33.000000000 +0200
++++ head-2009-10-12/arch/x86/kernel/apic/io_apic-xen.c 2009-10-14 17:01:38.000000000 +0200
@@ -1093,7 +1093,9 @@ static inline int irq_trigger(int idx)
return MPBIOS_trigger(idx);
}
@@ -240,7 +228,7 @@ References: 191115
static int pin_2_irq(int idx, int apic, int pin)
{
int irq, i;
-@@ -1115,11 +1117,13 @@ static int pin_2_irq(int idx, int apic,
+@@ -1115,11 +1117,13 @@ static int pin_2_irq(int idx, int apic,
while (i < apic)
irq += nr_ioapic_registers[i++];
irq += pin;
@@ -267,8 +255,8 @@ References: 191115
return id;
#else
int i;
---- a/arch/x86/kernel/irq-xen.c
-+++ b/arch/x86/kernel/irq-xen.c
+--- head-2009-10-12.orig/arch/x86/kernel/irq-xen.c 2009-10-13 16:43:01.000000000 +0200
++++ head-2009-10-12/arch/x86/kernel/irq-xen.c 2009-10-13 17:19:31.000000000 +0200
@@ -15,7 +15,9 @@
#include <asm/mce.h>
#include <asm/hw_irq.h>
@@ -279,7 +267,7 @@ References: 191115
/* Function pointer for generic interrupt vector handling */
void (*generic_interrupt_extension)(void) = NULL;
-@@ -55,7 +57,7 @@ static int show_other_interrupts(struct
+@@ -55,7 +57,7 @@ static int show_other_interrupts(struct
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->__nmi_count);
seq_printf(p, " Non-maskable interrupts\n");
@@ -288,7 +276,7 @@ References: 191115
seq_printf(p, "%*s: ", prec, "LOC");
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs);
-@@ -118,10 +120,12 @@ static int show_other_interrupts(struct
+@@ -118,10 +120,12 @@ static int show_other_interrupts(struct
seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
seq_printf(p, " Machine check polls\n");
#endif
@@ -318,8 +306,8 @@ References: 191115
}
---- a/arch/x86/kernel/mpparse-xen.c
-+++ b/arch/x86/kernel/mpparse-xen.c
+--- head-2009-10-12.orig/arch/x86/kernel/mpparse-xen.c 2009-10-13 11:39:38.000000000 +0200
++++ head-2009-10-12/arch/x86/kernel/mpparse-xen.c 2009-10-13 17:19:31.000000000 +0200
@@ -288,7 +288,9 @@ static int __init smp_check_mpc(struct m
printk(KERN_INFO "MPTABLE: Product ID: %s\n", str);
@@ -372,8 +360,8 @@ References: 191115
return;
}
---- a/drivers/xen/core/smpboot.c
-+++ b/drivers/xen/core/smpboot.c
+--- head-2009-10-12.orig/drivers/xen/core/smpboot.c 2009-10-15 11:12:02.000000000 +0200
++++ head-2009-10-12/drivers/xen/core/smpboot.c 2009-10-15 11:12:11.000000000 +0200
@@ -354,7 +354,7 @@ void __init smp_prepare_cpus(unsigned in
* Here we can be sure that there is an IO-APIC in the system. Let's
* go and set it up:
diff --git a/patches.xen/xen-x86-panic-no-reboot b/patches.xen/xen-x86-panic-no-reboot
index e9254318b1..a6ab2d4d72 100644
--- a/patches.xen/xen-x86-panic-no-reboot
+++ b/patches.xen/xen-x86-panic-no-reboot
@@ -4,12 +4,8 @@ Patch-mainline: obsolete
$subject says it all.
----
- arch/x86/kernel/setup-xen.c | 14 ++++++++------
- 1 file changed, 8 insertions(+), 6 deletions(-)
-
---- a/arch/x86/kernel/setup-xen.c
-+++ b/arch/x86/kernel/setup-xen.c
+--- head-2009-10-12.orig/arch/x86/kernel/setup-xen.c 2009-10-13 15:12:06.000000000 +0200
++++ head-2009-10-12/arch/x86/kernel/setup-xen.c 2009-10-13 17:07:23.000000000 +0200
@@ -765,15 +765,17 @@ void __init setup_arch(char **cmdline_p)
unsigned long p2m_pages;
struct physdev_set_iopl set_iopl;
diff --git a/patches.xen/xen-x86-per-cpu-vcpu-info b/patches.xen/xen-x86-per-cpu-vcpu-info
index b7eb38d852..1b7359e093 100644
--- a/patches.xen/xen-x86-per-cpu-vcpu-info
+++ b/patches.xen/xen-x86-per-cpu-vcpu-info
@@ -5,26 +5,8 @@ Patch-mainline: obsolete
... reducing access code size and latency, as well as being the
prerequisite for removing the limitation on 32 vCPU-s per guest.
----
- arch/x86/include/asm/percpu.h | 36 ++++++++++++
- arch/x86/include/mach-xen/asm/hypervisor.h | 14 ++++
- arch/x86/include/mach-xen/asm/irqflags.h | 34 +++++++++--
- arch/x86/include/mach-xen/asm/pgtable_64.h | 2
- arch/x86/include/mach-xen/asm/system.h | 4 -
- arch/x86/kernel/cpu/common-xen.c | 10 +++
- arch/x86/kernel/entry_32-xen.S | 11 +++
- arch/x86/kernel/head-xen.c | 2
- arch/x86/kernel/time-xen.c | 14 +---
- arch/x86/mm/hypervisor.c | 85 +++++++++++++++++++++++++++++
- arch/x86/mm/init_64-xen.c | 20 ++++++
- drivers/xen/Kconfig | 12 ++++
- drivers/xen/core/evtchn.c | 40 ++++++++++---
- drivers/xen/core/machine_reboot.c | 17 +++++
- drivers/xen/core/smpboot.c | 5 +
- 15 files changed, 274 insertions(+), 32 deletions(-)
-
---- a/arch/x86/include/asm/percpu.h
-+++ b/arch/x86/include/asm/percpu.h
+--- head-2009-11-06.orig/arch/x86/include/asm/percpu.h 2009-11-06 10:29:50.000000000 +0100
++++ head-2009-11-06/arch/x86/include/asm/percpu.h 2009-11-06 11:12:01.000000000 +0100
@@ -133,6 +133,38 @@ do { \
ret__; \
})
@@ -75,8 +57,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
/* This is not atomic against other CPUs -- CPU preemption needs to be off */
#define x86_test_and_clear_bit_percpu(bit, var) \
---- a/arch/x86/include/mach-xen/asm/hypervisor.h
-+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
+--- head-2009-11-06.orig/arch/x86/include/mach-xen/asm/hypervisor.h 2009-11-06 11:11:58.000000000 +0100
++++ head-2009-11-06/arch/x86/include/mach-xen/asm/hypervisor.h 2009-11-06 11:12:01.000000000 +0100
@@ -50,12 +50,26 @@
extern shared_info_t *HYPERVISOR_shared_info;
@@ -104,8 +86,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#ifdef CONFIG_X86_32
extern unsigned long hypervisor_virt_start;
---- a/arch/x86/include/mach-xen/asm/irqflags.h
-+++ b/arch/x86/include/mach-xen/asm/irqflags.h
+--- head-2009-11-06.orig/arch/x86/include/mach-xen/asm/irqflags.h 2009-11-06 10:52:22.000000000 +0100
++++ head-2009-11-06/arch/x86/include/mach-xen/asm/irqflags.h 2009-11-06 11:12:01.000000000 +0100
@@ -12,7 +12,7 @@
* includes these barriers, for example.
*/
@@ -181,8 +163,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
TRACE_IRQS_OFF ; \
sysexit_ecrit: /**** END OF SYSEXIT CRITICAL REGION ****/ ; \
mov $__KERNEL_PERCPU, %ecx ; \
---- a/arch/x86/include/mach-xen/asm/pgtable_64.h
-+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
+--- head-2009-11-06.orig/arch/x86/include/mach-xen/asm/pgtable_64.h 2009-11-06 11:11:58.000000000 +0100
++++ head-2009-11-06/arch/x86/include/mach-xen/asm/pgtable_64.h 2009-11-06 11:12:01.000000000 +0100
@@ -117,6 +117,8 @@ static inline void xen_set_pgd(pgd_t *pg
#define __pte_mfn(_pte) (((_pte).pte & PTE_PFN_MASK) >> PAGE_SHIFT)
@@ -192,8 +174,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
/*
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
---- a/arch/x86/include/mach-xen/asm/system.h
-+++ b/arch/x86/include/mach-xen/asm/system.h
+--- head-2009-11-06.orig/arch/x86/include/mach-xen/asm/system.h 2009-11-06 10:52:22.000000000 +0100
++++ head-2009-11-06/arch/x86/include/mach-xen/asm/system.h 2009-11-06 11:12:01.000000000 +0100
@@ -233,8 +233,8 @@ static inline void xen_write_cr0(unsigne
asm volatile("mov %0,%%cr0": : "r" (val), "m" (__force_order));
}
@@ -205,8 +187,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
static inline unsigned long xen_read_cr3(void)
{
---- a/arch/x86/kernel/cpu/common-xen.c
-+++ b/arch/x86/kernel/cpu/common-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/cpu/common-xen.c 2009-11-06 10:52:22.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/cpu/common-xen.c 2009-11-06 11:12:01.000000000 +0100
@@ -335,8 +335,16 @@ static const char *__cpuinit table_looku
__u32 cpu_caps_cleared[NCAPINTS] __cpuinitdata;
__u32 cpu_caps_set[NCAPINTS] __cpuinitdata;
@@ -225,8 +207,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#ifdef CONFIG_X86_32
loadsegment(fs, __KERNEL_PERCPU);
#else
---- a/arch/x86/kernel/entry_32-xen.S
-+++ b/arch/x86/kernel/entry_32-xen.S
+--- head-2009-11-06.orig/arch/x86/kernel/entry_32-xen.S 2009-11-06 11:09:09.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/entry_32-xen.S 2009-11-06 11:12:01.000000000 +0100
@@ -463,6 +463,9 @@ sysenter_exit:
movl PT_EIP(%esp), %edx
movl PT_OLDESP(%esp), %ecx
@@ -259,8 +241,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
.previous
# Hypervisor uses this for application faults while it executes.
---- a/arch/x86/kernel/head-xen.c
-+++ b/arch/x86/kernel/head-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/head-xen.c 2009-11-06 11:11:56.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/head-xen.c 2009-11-06 11:12:01.000000000 +0100
@@ -151,6 +151,8 @@ void __init xen_start_kernel(void)
HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
memset(empty_zero_page, 0, sizeof(empty_zero_page));
@@ -270,8 +252,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
/* Set up mapping of lowest 1MB of physical memory. */
for (i = 0; i < NR_FIX_ISAMAPS; i++)
if (is_initial_xendomain())
---- a/arch/x86/kernel/time-xen.c
-+++ b/arch/x86/kernel/time-xen.c
+--- head-2009-11-06.orig/arch/x86/kernel/time-xen.c 2009-11-06 11:10:22.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/time-xen.c 2009-11-06 11:12:01.000000000 +0100
@@ -267,16 +267,10 @@ static void get_time_values_from_xen(uns
local_irq_restore(flags);
}
@@ -300,7 +282,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
get_time_values_from_xen(cpu);
barrier();
} while (local_time_version != shadow->version);
-@@ -445,7 +439,7 @@ irqreturn_t timer_interrupt(int irq, voi
+@@ -446,7 +440,7 @@ irqreturn_t timer_interrupt(int irq, voi
delta_cpu -= per_cpu(processed_system_time, cpu);
get_runstate_snapshot(&runstate);
@@ -309,8 +291,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
if ((unlikely(delta < -(s64)permitted_clock_jitter) ||
unlikely(delta_cpu < -(s64)permitted_clock_jitter))
---- a/arch/x86/mm/hypervisor.c
-+++ b/arch/x86/mm/hypervisor.c
+--- head-2009-11-06.orig/arch/x86/mm/hypervisor.c 2009-11-06 11:11:58.000000000 +0100
++++ head-2009-11-06/arch/x86/mm/hypervisor.c 2009-11-06 11:12:01.000000000 +0100
@@ -41,6 +41,7 @@
#include <xen/balloon.h>
#include <xen/features.h>
@@ -411,8 +393,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#define NR_MC BITS_PER_LONG
#define NR_MMU BITS_PER_LONG
---- a/arch/x86/mm/init_64-xen.c
-+++ b/arch/x86/mm/init_64-xen.c
+--- head-2009-11-06.orig/arch/x86/mm/init_64-xen.c 2009-11-06 11:11:58.000000000 +0100
++++ head-2009-11-06/arch/x86/mm/init_64-xen.c 2009-11-06 11:12:01.000000000 +0100
@@ -116,6 +116,26 @@ void __meminit early_make_page_readonly(
BUG();
}
@@ -440,9 +422,9 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
#ifndef CONFIG_XEN
static int __init parse_direct_gbpages_off(char *arg)
{
---- a/drivers/xen/Kconfig
-+++ b/drivers/xen/Kconfig
-@@ -354,6 +354,18 @@ config XEN_COMPAT
+--- head-2009-11-06.orig/drivers/xen/Kconfig 2009-11-06 11:10:27.000000000 +0100
++++ head-2009-11-06/drivers/xen/Kconfig 2009-11-06 11:12:01.000000000 +0100
+@@ -363,6 +363,18 @@ config XEN_COMPAT
default 0x030002 if XEN_COMPAT_030002_AND_LATER
default 0
@@ -461,8 +443,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
endmenu
config HAVE_IRQ_IGNORE_UNHANDLED
---- a/drivers/xen/core/evtchn.c
-+++ b/drivers/xen/core/evtchn.c
+--- head-2009-11-06.orig/drivers/xen/core/evtchn.c 2009-11-06 11:10:30.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/evtchn.c 2009-11-06 11:12:01.000000000 +0100
@@ -316,6 +316,24 @@ static DEFINE_PER_CPU(unsigned int, upca
static DEFINE_PER_CPU(unsigned int, last_processed_l1i) = { BITS_PER_LONG - 1 };
static DEFINE_PER_CPU(unsigned int, last_processed_l2i) = { BITS_PER_LONG - 1 };
@@ -519,7 +501,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
l1i = percpu_read(last_processed_l1i);
l2i = percpu_read(last_processed_l2i);
-@@ -1364,7 +1382,6 @@ void unmask_evtchn(int port)
+@@ -1363,7 +1381,6 @@ void unmask_evtchn(int port)
{
shared_info_t *s = HYPERVISOR_shared_info;
unsigned int cpu = smp_processor_id();
@@ -527,7 +509,7 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
BUG_ON(!irqs_disabled());
-@@ -1378,10 +1395,13 @@ void unmask_evtchn(int port)
+@@ -1377,10 +1394,13 @@ void unmask_evtchn(int port)
synch_clear_bit(port, s->evtchn_mask);
/* Did we miss an interrupt 'edge'? Re-fire if so. */
@@ -545,8 +527,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
}
EXPORT_SYMBOL_GPL(unmask_evtchn);
---- a/drivers/xen/core/machine_reboot.c
-+++ b/drivers/xen/core/machine_reboot.c
+--- head-2009-11-06.orig/drivers/xen/core/machine_reboot.c 2009-11-06 11:11:59.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/machine_reboot.c 2009-11-06 11:12:01.000000000 +0100
@@ -179,6 +179,23 @@ static int take_machine_down(void *_susp
* merely checkpointed, and 0 if it is resuming in a new domain.
*/
@@ -571,8 +553,8 @@ prerequisite for removing the limitation on 32 vCPU-s per guest.
} else
BUG_ON(suspend_cancelled > 0);
suspend->resume_notifier(suspend_cancelled);
---- a/drivers/xen/core/smpboot.c
-+++ b/drivers/xen/core/smpboot.c
+--- head-2009-11-06.orig/drivers/xen/core/smpboot.c 2009-11-06 11:11:57.000000000 +0100
++++ head-2009-11-06/drivers/xen/core/smpboot.c 2009-11-06 11:12:01.000000000 +0100
@@ -361,8 +361,13 @@ void __init smp_prepare_cpus(unsigned in
void __init smp_prepare_boot_cpu(void)
diff --git a/patches.xen/xen-x86-pmd-handling b/patches.xen/xen-x86-pmd-handling
index 4aecea5676..05d3ffaefe 100644
--- a/patches.xen/xen-x86-pmd-handling
+++ b/patches.xen/xen-x86-pmd-handling
@@ -2,19 +2,8 @@ From: jbeulich@novell.com
Subject: consolidate pmd/pud/pgd entry handling
Patch-mainline: obsolete
----
- arch/x86/include/mach-xen/asm/hypervisor.h | 16 ++
- arch/x86/include/mach-xen/asm/pgalloc.h | 51 +++-----
- arch/x86/include/mach-xen/asm/pgtable-3level.h | 21 ++-
- arch/x86/include/mach-xen/asm/pgtable_64.h | 36 +++---
- arch/x86/mm/hypervisor.c | 74 +++++++++++-
- arch/x86/mm/init_32-xen.c | 4
- arch/x86/mm/init_64-xen.c | 15 +-
- arch/x86/mm/pgtable-xen.c | 149 ++++++++++++++++---------
- 8 files changed, 248 insertions(+), 118 deletions(-)
-
---- a/arch/x86/include/mach-xen/asm/hypervisor.h
-+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 17:02:12.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 17:22:09.000000000 +0200
@@ -97,10 +97,12 @@ void xen_invlpg(unsigned long ptr);
void xen_l1_entry_update(pte_t *ptr, pte_t val);
void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
@@ -48,8 +37,8 @@ Patch-mainline: obsolete
MULTI_grant_table_op(multicall_entry_t *mcl, unsigned int cmd,
void *uop, unsigned int count)
{
---- a/arch/x86/include/mach-xen/asm/pgalloc.h
-+++ b/arch/x86/include/mach-xen/asm/pgalloc.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/pgalloc.h 2009-10-12 16:39:40.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/pgalloc.h 2009-10-13 17:22:09.000000000 +0200
@@ -70,20 +70,16 @@ static inline void pmd_populate(struct m
struct page *pte)
{
@@ -129,8 +118,8 @@ Patch-mainline: obsolete
}
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
---- a/arch/x86/include/mach-xen/asm/pgtable-3level.h
-+++ b/arch/x86/include/mach-xen/asm/pgtable-3level.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/pgtable-3level.h 2009-10-12 16:32:30.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/pgtable-3level.h 2009-10-13 17:22:09.000000000 +0200
@@ -61,12 +61,15 @@ static inline void __xen_pte_clear(pte_t
ptep->pte_high = 0;
}
@@ -167,8 +156,8 @@ Patch-mainline: obsolete
#ifdef CONFIG_SMP
static inline pte_t xen_ptep_get_and_clear(pte_t *ptep, pte_t res)
{
---- a/arch/x86/include/mach-xen/asm/pgtable_64.h
-+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
+--- head-2009-10-12.orig/arch/x86/include/mach-xen/asm/pgtable_64.h 2009-10-12 16:39:40.000000000 +0200
++++ head-2009-10-12/arch/x86/include/mach-xen/asm/pgtable_64.h 2009-10-13 17:22:09.000000000 +0200
@@ -79,33 +79,41 @@ static inline void xen_set_pmd(pmd_t *pm
xen_l2_entry_update(pmdp, pmd);
}
@@ -225,8 +214,8 @@ Patch-mainline: obsolete
#define __pte_mfn(_pte) (((_pte).pte & PTE_PFN_MASK) >> PAGE_SHIFT)
---- a/arch/x86/mm/hypervisor.c
-+++ b/arch/x86/mm/hypervisor.c
+--- head-2009-10-12.orig/arch/x86/mm/hypervisor.c 2009-10-13 17:07:25.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/hypervisor.c 2009-10-13 17:22:09.000000000 +0200
@@ -360,31 +360,91 @@ void xen_l1_entry_update(pte_t *ptr, pte
}
EXPORT_SYMBOL_GPL(xen_l1_entry_update);
@@ -326,8 +315,8 @@ Patch-mainline: obsolete
}
#endif /* CONFIG_X86_64 */
---- a/arch/x86/mm/init_32-xen.c
-+++ b/arch/x86/mm/init_32-xen.c
+--- head-2009-10-12.orig/arch/x86/mm/init_32-xen.c 2009-10-13 09:41:29.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/init_32-xen.c 2009-10-13 17:22:09.000000000 +0200
@@ -748,6 +748,8 @@ static void __init zone_sizes_init(void)
#endif
@@ -346,8 +335,8 @@ Patch-mainline: obsolete
}
#ifdef CONFIG_MEMORY_HOTPLUG
---- a/arch/x86/mm/init_64-xen.c
-+++ b/arch/x86/mm/init_64-xen.c
+--- head-2009-10-12.orig/arch/x86/mm/init_64-xen.c 2009-10-13 09:41:29.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/init_64-xen.c 2009-10-13 17:22:09.000000000 +0200
@@ -193,7 +193,10 @@ static pud_t *fill_pud(pgd_t *pgd, unsig
if (pgd_none(*pgd)) {
pud_t *pud = (pud_t *)spp_getpage();
@@ -372,7 +361,7 @@ Patch-mainline: obsolete
if (pmd != pmd_offset(pud, 0))
printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
pmd, pmd_offset(pud, 0));
-@@ -535,7 +541,6 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
+@@ -535,7 +541,6 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
XENFEAT_writable_page_tables);
*pmd = __pmd(pte_phys | _PAGE_TABLE);
} else {
@@ -380,7 +369,7 @@ Patch-mainline: obsolete
spin_lock(&init_mm.page_table_lock);
pmd_populate_kernel(&init_mm, pmd, __va(pte_phys));
spin_unlock(&init_mm.page_table_lock);
-@@ -624,7 +629,6 @@ phys_pud_init(pud_t *pud_page, unsigned
+@@ -624,7 +629,6 @@ phys_pud_init(pud_t *pud_page, unsigned
else
*pud = __pud(pmd_phys | _PAGE_TABLE);
} else {
@@ -405,8 +394,8 @@ Patch-mainline: obsolete
}
/*
---- a/arch/x86/mm/pgtable-xen.c
-+++ b/arch/x86/mm/pgtable-xen.c
+--- head-2009-10-12.orig/arch/x86/mm/pgtable-xen.c 2009-10-13 15:44:59.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/pgtable-xen.c 2009-10-13 17:22:09.000000000 +0200
@@ -44,16 +44,16 @@ pgtable_t pte_alloc_one(struct mm_struct
void __pte_free(pgtable_t pte)
{
diff --git a/patches.xen/xen-x86_64-dump-user-pgt b/patches.xen/xen-x86_64-dump-user-pgt
index 86e7cd0197..cfc9bb05ca 100644
--- a/patches.xen/xen-x86_64-dump-user-pgt
+++ b/patches.xen/xen-x86_64-dump-user-pgt
@@ -2,12 +2,8 @@ From: jbeulich@novell.com
Subject: dump the correct page tables for user mode faults
Patch-mainline: obsolete
----
- arch/x86/mm/fault-xen.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
---- a/arch/x86/mm/fault-xen.c
-+++ b/arch/x86/mm/fault-xen.c
+--- head-2009-10-12.orig/arch/x86/mm/fault-xen.c 2009-10-13 13:40:11.000000000 +0200
++++ head-2009-10-12/arch/x86/mm/fault-xen.c 2009-10-13 17:28:26.000000000 +0200
@@ -328,6 +328,7 @@ static void dump_pagetable(unsigned long
out:
printk(KERN_CONT "\n");
diff --git a/patches.xen/xen-x86_64-note-init-p2m b/patches.xen/xen-x86_64-note-init-p2m
index c49a55ae00..5dc206ecf7 100644
--- a/patches.xen/xen-x86_64-note-init-p2m
+++ b/patches.xen/xen-x86_64-note-init-p2m
@@ -18,19 +18,8 @@ shouldn't be as expensive (and hence can be viewed as an optimization
avoiding the spurious page fault on the local CPU), but is required
when the functions are used before the page fault handler gets set up.
----
- arch/x86/kernel/head64-xen.c | 8 ++++
- arch/x86/kernel/head_64-xen.S | 2 +
- arch/x86/kernel/setup-xen.c | 84 +++++++++++++++++++++++++++++++++++++++---
- arch/x86/mm/init-xen.c | 15 +++++++
- arch/x86/mm/init_64-xen.c | 58 +++++++++++++++++++++++------
- arch/x86/mm/pageattr-xen.c | 2 -
- arch/x86/mm/pgtable-xen.c | 4 +-
- arch/x86/mm/pgtable_32-xen.c | 2 -
- 8 files changed, 153 insertions(+), 22 deletions(-)
-
---- a/arch/x86/kernel/head64-xen.c
-+++ b/arch/x86/kernel/head64-xen.c
+--- head-2009-10-15.orig/arch/x86/kernel/head64-xen.c 2009-10-15 15:26:59.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/head64-xen.c 2009-10-15 15:33:36.000000000 +0200
@@ -123,6 +123,14 @@ void __init x86_64_start_reservations(ch
reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");
@@ -46,8 +35,8 @@ when the functions are used before the page fault handler gets set up.
/*
* At this point everything still needed from the boot loader
* or BIOS or kernel text should be early reserved or marked not
---- a/arch/x86/kernel/head_64-xen.S
-+++ b/arch/x86/kernel/head_64-xen.S
+--- head-2009-10-15.orig/arch/x86/kernel/head_64-xen.S 2009-10-13 17:25:41.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/head_64-xen.S 2009-10-14 18:29:46.000000000 +0200
@@ -17,6 +17,7 @@
#include <linux/elfnote.h>
#include <asm/segment.h>
@@ -64,9 +53,9 @@ when the functions are used before the page fault handler gets set up.
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")
ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
---- a/arch/x86/kernel/setup-xen.c
-+++ b/arch/x86/kernel/setup-xen.c
-@@ -1121,7 +1121,7 @@ void __init setup_arch(char **cmdline_p)
+--- head-2009-10-15.orig/arch/x86/kernel/setup-xen.c 2009-10-30 14:36:36.000000000 +0100
++++ head-2009-10-15/arch/x86/kernel/setup-xen.c 2009-10-30 14:36:57.000000000 +0100
+@@ -1122,7 +1122,7 @@ void __init setup_arch(char **cmdline_p)
difference = xen_start_info->nr_pages - max_pfn;
set_xen_guest_handle(reservation.extent_start,
@@ -75,7 +64,7 @@ when the functions are used before the page fault handler gets set up.
reservation.nr_extents = difference;
ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation,
&reservation);
-@@ -1138,14 +1138,86 @@ void __init setup_arch(char **cmdline_p)
+@@ -1139,14 +1139,86 @@ void __init setup_arch(char **cmdline_p)
phys_to_machine_mapping = alloc_bootmem_pages(
max_pfn * sizeof(unsigned long));
memcpy(phys_to_machine_mapping,
@@ -167,8 +156,8 @@ when the functions are used before the page fault handler gets set up.
/*
* Initialise the list of the frames that specify the list of
---- a/arch/x86/mm/init-xen.c
-+++ b/arch/x86/mm/init-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/init-xen.c 2009-10-13 09:41:29.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/init-xen.c 2009-10-13 17:28:32.000000000 +0200
@@ -347,9 +347,22 @@ unsigned long __init_refok init_memory_m
__flush_tlb_all();
@@ -193,8 +182,8 @@ when the functions are used before the page fault handler gets set up.
if (!after_bootmem)
early_memtest(start, end);
---- a/arch/x86/mm/init_64-xen.c
-+++ b/arch/x86/mm/init_64-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/init_64-xen.c 2009-10-13 17:25:41.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/init_64-xen.c 2009-11-04 13:43:50.000000000 +0100
@@ -181,6 +181,17 @@ static int __init nonx32_setup(char *str
}
__setup("noexec32=", nonx32_setup);
@@ -279,7 +268,7 @@ when the functions are used before the page fault handler gets set up.
/* Do an early initialization of the fixmap area. */
addr = __fix_to_virt(FIX_EARLYCON_MEM_BASE);
if (pud_present(level3_kernel_pgt[pud_index(addr)])) {
-@@ -749,22 +779,28 @@ void __init xen_init_pt(void)
+@@ -749,22 +779,27 @@ void __init xen_init_pt(void)
void __init xen_finish_init_mapping(void)
{
unsigned long start, end;
@@ -304,16 +293,15 @@ when the functions are used before the page fault handler gets set up.
+ /* Unpin the no longer used Xen provided page tables. */
+ mmuext.cmd = MMUEXT_UNPIN_TABLE;
-+ mmuext.arg1.mfn = pfn_to_mfn(__pa(xen_start_info->pt_base)
-+ >> PAGE_SHIFT);
++ mmuext.arg1.mfn = virt_to_mfn(xen_start_info->pt_base);
+ if (HYPERVISOR_mmuext_op(&mmuext, 1, NULL, DOMID_SELF))
+ BUG();
+
/* Destroy the Xen-created mappings beyond the kernel image. */
start = PAGE_ALIGN(_brk_end);
end = __START_KERNEL_map + (e820_table_start << PAGE_SHIFT);
---- a/arch/x86/mm/pageattr-xen.c
-+++ b/arch/x86/mm/pageattr-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/pageattr-xen.c 2009-10-13 09:41:29.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/pageattr-xen.c 2009-10-13 17:28:32.000000000 +0200
@@ -1396,7 +1396,7 @@ static void __make_page_writable(unsigne
pte = lookup_address(va, &level);
@@ -323,8 +311,8 @@ when the functions are used before the page fault handler gets set up.
BUG();
if (in_secondary_range(va)) {
unsigned long pfn = pte_pfn(*pte);
---- a/arch/x86/mm/pgtable-xen.c
-+++ b/arch/x86/mm/pgtable-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/pgtable-xen.c 2009-10-14 14:20:53.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/pgtable-xen.c 2009-10-26 16:03:21.000000000 +0100
@@ -322,7 +322,7 @@ void __init xen_init_pgd_pin(void)
if (PTRS_PER_PUD > 1) /* not folded */
SetPagePinned(virt_to_page(pud));
@@ -343,8 +331,8 @@ when the functions are used before the page fault handler gets set up.
continue;
SetPagePinned(pmd_page(*pmd));
}
---- a/arch/x86/mm/pgtable_32-xen.c
-+++ b/arch/x86/mm/pgtable_32-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/pgtable_32-xen.c 2009-10-15 12:06:12.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/pgtable_32-xen.c 2009-10-13 17:28:32.000000000 +0200
@@ -175,6 +175,6 @@ void make_lowmem_page_writable(void *va,
pte = lookup_address((unsigned long)va, &level);
BUG_ON(!pte || level != PG_LEVEL_4K || !pte_present(*pte));
diff --git a/patches.xen/xen-x86_64-pgd-alloc-order b/patches.xen/xen-x86_64-pgd-alloc-order
index 18c5866aff..bf094b69bf 100644
--- a/patches.xen/xen-x86_64-pgd-alloc-order
+++ b/patches.xen/xen-x86_64-pgd-alloc-order
@@ -4,21 +4,8 @@ Patch-mainline: obsolete
At the same time remove the useless user mode pair of init_level4_pgt.
----
- arch/x86/include/mach-xen/asm/hypervisor.h | 6 ++--
- arch/x86/include/mach-xen/asm/mmu_context.h | 11 +++++--
- arch/x86/include/mach-xen/asm/pgalloc.h | 4 --
- arch/x86/include/mach-xen/asm/pgtable_64.h | 13 +++++++--
- arch/x86/kernel/cpu/common-xen.c | 3 --
- arch/x86/kernel/head_64-xen.S | 8 -----
- arch/x86/mm/hypervisor.c | 40 +++++++++++++++++++---------
- arch/x86/mm/init_64-xen.c | 5 ---
- arch/x86/mm/pgtable-xen.c | 39 +++++++++++++++++++++------
- drivers/xen/core/machine_reboot.c | 3 --
- 10 files changed, 82 insertions(+), 50 deletions(-)
-
---- a/arch/x86/include/mach-xen/asm/hypervisor.h
-+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
+--- head-2009-10-15.orig/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 17:25:37.000000000 +0200
++++ head-2009-10-15/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 17:25:41.000000000 +0200
@@ -102,8 +102,8 @@ void do_hypervisor_callback(struct pt_re
* be MACHINE addresses.
*/
@@ -39,8 +26,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
void xen_pgd_pin(pgd_t *);
void xen_pgd_unpin(pgd_t *);
---- a/arch/x86/include/mach-xen/asm/mmu_context.h
-+++ b/arch/x86/include/mach-xen/asm/mmu_context.h
+--- head-2009-10-15.orig/arch/x86/include/mach-xen/asm/mmu_context.h 2009-11-04 13:38:54.000000000 +0100
++++ head-2009-10-15/arch/x86/include/mach-xen/asm/mmu_context.h 2009-11-04 13:42:34.000000000 +0100
@@ -82,6 +82,9 @@ static inline void switch_mm(struct mm_s
{
unsigned cpu = smp_processor_id();
@@ -51,22 +38,21 @@ At the same time remove the useless user mode pair of init_level4_pgt.
if (likely(prev != next)) {
BUG_ON(!xen_feature(XENFEAT_writable_page_tables) &&
-@@ -100,10 +103,12 @@ static inline void switch_mm(struct mm_s
- op->arg1.mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
+@@ -100,10 +103,11 @@ static inline void switch_mm(struct mm_s
+ op->arg1.mfn = virt_to_mfn(next->pgd);
op++;
- /* xen_new_user_pt(__pa(__user_pgd(next->pgd))) */
+ /* xen_new_user_pt(next->pgd) */
#ifdef CONFIG_X86_64
op->cmd = MMUEXT_NEW_USER_BASEPTR;
-- op->arg1.mfn = pfn_to_mfn(__pa(__user_pgd(next->pgd)) >> PAGE_SHIFT);
+- op->arg1.mfn = virt_to_mfn(__user_pgd(next->pgd));
+ upgd = __user_pgd(next->pgd);
-+ op->arg1.mfn = likely(upgd)
-+ ? pfn_to_mfn(__pa(upgd) >> PAGE_SHIFT) : 0;
++ op->arg1.mfn = likely(upgd) ? virt_to_mfn(upgd) : 0;
op++;
#endif
-@@ -131,7 +136,7 @@ static inline void switch_mm(struct mm_s
+@@ -131,7 +135,7 @@ static inline void switch_mm(struct mm_s
* to make sure to use no freed page tables.
*/
load_cr3(next->pgd);
@@ -75,8 +61,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
load_LDT_nolock(&next->context);
}
}
---- a/arch/x86/include/mach-xen/asm/pgalloc.h
-+++ b/arch/x86/include/mach-xen/asm/pgalloc.h
+--- head-2009-10-15.orig/arch/x86/include/mach-xen/asm/pgalloc.h 2009-10-13 17:22:09.000000000 +0200
++++ head-2009-10-15/arch/x86/include/mach-xen/asm/pgalloc.h 2009-10-13 17:25:41.000000000 +0200
@@ -118,15 +118,13 @@ static inline void pud_populate(struct m
#endif /* CONFIG_X86_PAE */
@@ -94,8 +80,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
else
*__user_pgd(pgd) = *pgd = ent;
}
---- a/arch/x86/include/mach-xen/asm/pgtable_64.h
-+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
+--- head-2009-10-15.orig/arch/x86/include/mach-xen/asm/pgtable_64.h 2009-10-15 13:05:10.000000000 +0200
++++ head-2009-10-15/arch/x86/include/mach-xen/asm/pgtable_64.h 2009-10-13 17:25:41.000000000 +0200
@@ -100,18 +100,25 @@ static inline void xen_set_pud(pud_t *pu
: (void)(*__pudp = xen_make_pud(0)); \
})
@@ -125,8 +111,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
: (void)(*__user_pgd(__pgdp) = *__pgdp = xen_make_pgd(0)); \
})
---- a/arch/x86/kernel/cpu/common-xen.c
-+++ b/arch/x86/kernel/cpu/common-xen.c
+--- head-2009-10-15.orig/arch/x86/kernel/cpu/common-xen.c 2009-10-15 13:05:10.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/cpu/common-xen.c 2009-10-13 17:25:41.000000000 +0200
@@ -1029,8 +1029,7 @@ DEFINE_PER_CPU_FIRST(union irq_stack_uni
void xen_switch_pt(void)
{
@@ -137,8 +123,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
#endif
}
---- a/arch/x86/kernel/head_64-xen.S
-+++ b/arch/x86/kernel/head_64-xen.S
+--- head-2009-10-15.orig/arch/x86/kernel/head_64-xen.S 2009-10-14 18:28:56.000000000 +0200
++++ head-2009-10-15/arch/x86/kernel/head_64-xen.S 2009-10-13 17:25:41.000000000 +0200
@@ -56,14 +56,6 @@ ENTRY(name)
NEXT_PAGE(init_level4_pgt)
@@ -154,8 +140,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
NEXT_PAGE(level3_kernel_pgt)
.fill 512,8,0
---- a/arch/x86/mm/hypervisor.c
-+++ b/arch/x86/mm/hypervisor.c
+--- head-2009-10-15.orig/arch/x86/mm/hypervisor.c 2009-11-04 13:40:37.000000000 +0100
++++ head-2009-10-15/arch/x86/mm/hypervisor.c 2009-11-04 17:23:39.000000000 +0100
@@ -511,7 +511,7 @@ void xen_l3_entry_update(pud_t *ptr, pud
#endif
@@ -165,20 +151,21 @@ At the same time remove the useless user mode pair of init_level4_pgt.
{
mmu_update_t u[2];
struct page *page = NULL;
-@@ -524,8 +524,10 @@ void xen_l4_entry_update(pgd_t *ptr, int
+@@ -524,8 +524,11 @@ void xen_l4_entry_update(pgd_t *ptr, int
}
u[0].ptr = virt_to_machine(ptr);
u[0].val = __pgd_val(val);
- if (user) {
- u[1].ptr = virt_to_machine(__user_pgd(ptr));
+ if (((unsigned long)ptr & ~PAGE_MASK)
-+ < pgd_index(__HYPERVISOR_VIRT_START) * sizeof(*ptr)
-+ && (ptr = __user_pgd(ptr)) != NULL) {
++ <= pgd_index(TASK_SIZE_MAX) * sizeof(*ptr)) {
++ ptr = __user_pgd(ptr);
++ BUG_ON(!ptr);
+ u[1].ptr = virt_to_machine(ptr);
u[1].val = __pgd_val(val);
do_lN_entry_update(u, 2, page);
} else
-@@ -533,21 +535,25 @@ void xen_l4_entry_update(pgd_t *ptr, int
+@@ -533,21 +536,25 @@ void xen_l4_entry_update(pgd_t *ptr, int
}
#endif /* CONFIG_X86_64 */
@@ -189,7 +176,7 @@ At the same time remove the useless user mode pair of init_level4_pgt.
struct mmuext_op op;
op.cmd = MMUEXT_NEW_BASEPTR;
- op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-+ op.arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
++ op.arg1.mfn = virt_to_mfn(pgd);
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
@@ -201,27 +188,27 @@ At the same time remove the useless user mode pair of init_level4_pgt.
+ pgd = __user_pgd(pgd);
op.cmd = MMUEXT_NEW_USER_BASEPTR;
- op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-+ op.arg1.mfn = pgd ? pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT) : 0;
++ op.arg1.mfn = pgd ? virt_to_mfn(pgd) : 0;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
+#endif
void xen_tlb_flush(void)
{
-@@ -619,28 +625,38 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
+@@ -619,28 +626,38 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
void xen_pgd_pin(pgd_t *pgd)
{
struct mmuext_op op[NR_PGD_PIN_OPS];
+ unsigned int nr = NR_PGD_PIN_OPS;
op[0].cmd = MMUEXT_PIN_L3_TABLE;
- op[0].arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
+ op[0].arg1.mfn = virt_to_mfn(pgd);
#ifdef CONFIG_X86_64
op[1].cmd = op[0].cmd = MMUEXT_PIN_L4_TABLE;
-- op[1].arg1.mfn = pfn_to_mfn(__pa(__user_pgd(pgd)) >> PAGE_SHIFT);
+- op[1].arg1.mfn = virt_to_mfn(__user_pgd(pgd));
+ pgd = __user_pgd(pgd);
+ if (pgd)
-+ op[1].arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
++ op[1].arg1.mfn = virt_to_mfn(pgd);
+ else
+ nr = 1;
#endif
@@ -236,14 +223,14 @@ At the same time remove the useless user mode pair of init_level4_pgt.
+ unsigned int nr = NR_PGD_PIN_OPS;
op[0].cmd = MMUEXT_UNPIN_TABLE;
- op[0].arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
+ op[0].arg1.mfn = virt_to_mfn(pgd);
#ifdef CONFIG_X86_64
- op[1].cmd = MMUEXT_UNPIN_TABLE;
-- op[1].arg1.mfn = pfn_to_mfn(__pa(__user_pgd(pgd)) >> PAGE_SHIFT);
+- op[1].arg1.mfn = virt_to_mfn(__user_pgd(pgd));
+ pgd = __user_pgd(pgd);
+ if (pgd) {
+ op[1].cmd = MMUEXT_UNPIN_TABLE;
-+ op[1].arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
++ op[1].arg1.mfn = virt_to_mfn(pgd);
+ } else
+ nr = 1;
#endif
@@ -252,8 +239,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
BUG();
}
---- a/arch/x86/mm/init_64-xen.c
-+++ b/arch/x86/mm/init_64-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/init_64-xen.c 2009-10-13 17:25:37.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/init_64-xen.c 2009-10-13 17:25:41.000000000 +0200
@@ -718,9 +718,6 @@ void __init xen_init_pt(void)
(PTRS_PER_PUD - pud_index(__START_KERNEL_map))
* sizeof(*level3_kernel_pgt));
@@ -273,8 +260,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
early_make_page_readonly(level3_kernel_pgt,
XENFEAT_writable_page_tables);
early_make_page_readonly(level3_user_pgt,
---- a/arch/x86/mm/pgtable-xen.c
-+++ b/arch/x86/mm/pgtable-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/pgtable-xen.c 2009-10-14 14:20:47.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/pgtable-xen.c 2009-10-14 14:20:53.000000000 +0200
@@ -269,9 +269,11 @@ static void pgd_walk(pgd_t *pgd_base, pg
BUG();
seq = 0;
@@ -352,8 +339,8 @@ At the same time remove the useless user mode pair of init_level4_pgt.
}
/* blktap and gntdev need this, as otherwise they would implicitly (and
---- a/drivers/xen/core/machine_reboot.c
-+++ b/drivers/xen/core/machine_reboot.c
+--- head-2009-10-15.orig/drivers/xen/core/machine_reboot.c 2009-10-15 13:05:10.000000000 +0200
++++ head-2009-10-15/drivers/xen/core/machine_reboot.c 2009-10-13 17:25:41.000000000 +0200
@@ -211,8 +211,7 @@ static int take_machine_down(void *_susp
* in fast-suspend mode as that implies a new enough Xen.
*/
diff --git a/patches.xen/xen-x86_64-pgd-pin b/patches.xen/xen-x86_64-pgd-pin
index 538a244301..67d0f4c8a2 100644
--- a/patches.xen/xen-x86_64-pgd-pin
+++ b/patches.xen/xen-x86_64-pgd-pin
@@ -2,15 +2,8 @@ From: jbeulich@novell.com
Subject: make pinning of pgd pairs transparent to callers
Patch-mainline: obsolete
----
- arch/x86/include/mach-xen/asm/hypervisor.h | 4 +-
- arch/x86/mm/hypervisor.c | 40 ++++++++++++++++++-----------
- arch/x86/mm/init_64-xen.c | 6 +---
- arch/x86/mm/pgtable-xen.c | 10 +------
- 4 files changed, 32 insertions(+), 28 deletions(-)
-
---- a/arch/x86/include/mach-xen/asm/hypervisor.h
-+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
+--- head-2009-10-15.orig/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-15 13:05:10.000000000 +0200
++++ head-2009-10-15/arch/x86/include/mach-xen/asm/hypervisor.h 2009-10-13 17:25:37.000000000 +0200
@@ -112,8 +112,8 @@ void xen_l1_entry_update(pte_t *ptr, pte
void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
@@ -22,8 +15,8 @@ Patch-mainline: obsolete
void xen_init_pgd_pin(void);
---- a/arch/x86/mm/hypervisor.c
-+++ b/arch/x86/mm/hypervisor.c
+--- head-2009-10-15.orig/arch/x86/mm/hypervisor.c 2009-10-15 13:05:10.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/hypervisor.c 2009-11-04 13:40:37.000000000 +0100
@@ -610,26 +610,38 @@ EXPORT_SYMBOL_GPL(xen_invlpg_mask);
#endif /* CONFIG_SMP */
@@ -48,10 +41,10 @@ Patch-mainline: obsolete
+ struct mmuext_op op[NR_PGD_PIN_OPS];
+
+ op[0].cmd = MMUEXT_PIN_L3_TABLE;
-+ op[0].arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
++ op[0].arg1.mfn = virt_to_mfn(pgd);
+#ifdef CONFIG_X86_64
+ op[1].cmd = op[0].cmd = MMUEXT_PIN_L4_TABLE;
-+ op[1].arg1.mfn = pfn_to_mfn(__pa(__user_pgd(pgd)) >> PAGE_SHIFT);
++ op[1].arg1.mfn = virt_to_mfn(__user_pgd(pgd));
+#endif
+ if (HYPERVISOR_mmuext_op(op, NR_PGD_PIN_OPS, NULL, DOMID_SELF) < 0)
+ BUG();
@@ -67,18 +60,18 @@ Patch-mainline: obsolete
+ struct mmuext_op op[NR_PGD_PIN_OPS];
+
+ op[0].cmd = MMUEXT_UNPIN_TABLE;
-+ op[0].arg1.mfn = pfn_to_mfn(__pa(pgd) >> PAGE_SHIFT);
++ op[0].arg1.mfn = virt_to_mfn(pgd);
+#ifdef CONFIG_X86_64
+ op[1].cmd = MMUEXT_UNPIN_TABLE;
-+ op[1].arg1.mfn = pfn_to_mfn(__pa(__user_pgd(pgd)) >> PAGE_SHIFT);
++ op[1].arg1.mfn = virt_to_mfn(__user_pgd(pgd));
+#endif
+ if (HYPERVISOR_mmuext_op(op, NR_PGD_PIN_OPS, NULL, DOMID_SELF) < 0)
+ BUG();
}
void xen_set_ldt(const void *ptr, unsigned int ents)
---- a/arch/x86/mm/init_64-xen.c
-+++ b/arch/x86/mm/init_64-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/init_64-xen.c 2009-10-15 13:05:10.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/init_64-xen.c 2009-10-13 17:25:37.000000000 +0200
@@ -747,10 +747,8 @@ void __init xen_init_pt(void)
early_make_page_readonly(level1_fixmap_pgt,
XENFEAT_writable_page_tables);
@@ -92,8 +85,8 @@ Patch-mainline: obsolete
}
void __init xen_finish_init_mapping(void)
---- a/arch/x86/mm/pgtable-xen.c
-+++ b/arch/x86/mm/pgtable-xen.c
+--- head-2009-10-15.orig/arch/x86/mm/pgtable-xen.c 2009-10-14 14:19:25.000000000 +0200
++++ head-2009-10-15/arch/x86/mm/pgtable-xen.c 2009-10-14 14:20:47.000000000 +0200
@@ -346,19 +346,13 @@ static void __pgd_pin(pgd_t *pgd)
{
pgd_walk(pgd, PAGE_KERNEL_RO);
diff --git a/patches.xen/xen3-auto-arch-i386.diff b/patches.xen/xen3-auto-arch-i386.diff
index 9c62dcf1eb..dc6d181641 100644
--- a/patches.xen/xen3-auto-arch-i386.diff
+++ b/patches.xen/xen3-auto-arch-i386.diff
@@ -1,18 +1,10 @@
Subject: xen3 arch-i386
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 938:cd453b4804b9)
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 941:9348c4535655)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
----
- arch/x86/kernel/asm-offsets_32.c | 7 ++++
- arch/x86/kernel/entry_32.S | 6 ++--
- arch/x86/kernel/machine_kexec_32.c | 55 +++++++++++++++++++++++++++++++++++++
- arch/x86/kernel/vm86_32.c | 12 ++++++++
- arch/x86/vdso/vdso32-setup.c | 34 ++++++++++++++++++++++
- 5 files changed, 110 insertions(+), 4 deletions(-)
-
---- a/arch/x86/kernel/asm-offsets_32.c
-+++ b/arch/x86/kernel/asm-offsets_32.c
+--- head-2009-11-06.orig/arch/x86/kernel/asm-offsets_32.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/asm-offsets_32.c 2009-11-06 10:37:19.000000000 +0100
@@ -93,9 +93,14 @@ void foo(void)
OFFSET(pbe_orig_address, pbe, orig_address);
OFFSET(pbe_next, pbe, next);
@@ -29,8 +21,8 @@ Acked-by: jbeulich@novell.com
DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
---- a/arch/x86/kernel/entry_32.S
-+++ b/arch/x86/kernel/entry_32.S
+--- head-2009-11-06.orig/arch/x86/kernel/entry_32.S 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/entry_32.S 2009-11-06 10:37:19.000000000 +0100
@@ -393,7 +393,7 @@ ENTRY(ia32_sysenter_target)
CFI_SIGNAL_FRAME
CFI_DEF_CFA esp, 0
@@ -58,8 +50,8 @@ Acked-by: jbeulich@novell.com
CFI_DEF_CFA esp, 0
CFI_UNDEFINED eip
pushfl
---- a/arch/x86/kernel/machine_kexec_32.c
-+++ b/arch/x86/kernel/machine_kexec_32.c
+--- head-2009-11-06.orig/arch/x86/kernel/machine_kexec_32.c 2009-11-06 10:30:30.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/machine_kexec_32.c 2009-11-06 10:37:19.000000000 +0100
@@ -26,6 +26,10 @@
#include <asm/system.h>
#include <asm/cacheflush.h>
@@ -143,8 +135,8 @@ Acked-by: jbeulich@novell.com
void arch_crash_save_vmcoreinfo(void)
{
---- a/arch/x86/kernel/vm86_32.c
-+++ b/arch/x86/kernel/vm86_32.c
+--- head-2009-11-06.orig/arch/x86/kernel/vm86_32.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/vm86_32.c 2009-11-06 10:37:19.000000000 +0100
@@ -125,7 +125,9 @@ static int copy_vm86_regs_from_user(stru
struct pt_regs *save_v86_state(struct kernel_vm86_regs *regs)
@@ -199,8 +191,8 @@ Acked-by: jbeulich@novell.com
tsk->thread.screen_bitmap = info->screen_bitmap;
if (info->flags & VM86_SCREEN_BITMAP)
---- a/arch/x86/vdso/vdso32-setup.c
-+++ b/arch/x86/vdso/vdso32-setup.c
+--- head-2009-11-06.orig/arch/x86/vdso/vdso32-setup.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/vdso/vdso32-setup.c 2009-11-06 10:37:19.000000000 +0100
@@ -26,6 +26,10 @@
#include <asm/vdso.h>
#include <asm/proto.h>
diff --git a/patches.xen/xen3-auto-arch-x86.diff b/patches.xen/xen3-auto-arch-x86.diff
index 42ec4ddec7..a5813c9e67 100644
--- a/patches.xen/xen3-auto-arch-x86.diff
+++ b/patches.xen/xen3-auto-arch-x86.diff
@@ -1,5 +1,5 @@
Subject: xen3 arch-x86
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 938:cd453b4804b9)
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 941:9348c4535655)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
@@ -9,27 +9,8 @@ take the forward porting patches:
2.6.26/arch/x86/kernel/crash.c
2.6.30/arch/x86/kernel/acpi/boot.c
----
- arch/x86/Makefile | 24 +++++++++++++++++++++++-
- arch/x86/boot/Makefile | 9 +++++++++
- arch/x86/include/asm/acpi.h | 27 +++++++++++++++++++++++++++
- arch/x86/include/asm/apic.h | 2 ++
- arch/x86/include/asm/kexec.h | 13 +++++++++++++
- arch/x86/kernel/Makefile | 9 +++++++++
- arch/x86/kernel/acpi/Makefile | 4 ++++
- arch/x86/kernel/acpi/processor.c | 11 +++++++++++
- arch/x86/kernel/cpu/mcheck/Makefile | 1 +
- arch/x86/kernel/cpu/mcheck/mce.c | 21 +++++++++++++++++++++
- arch/x86/kernel/cpu/mtrr/Makefile | 1 +
- arch/x86/lib/Makefile | 2 ++
- arch/x86/mm/Makefile | 2 ++
- arch/x86/oprofile/Makefile | 7 +++++++
- arch/x86/pci/Makefile | 3 +++
- arch/x86/power/cpu.c | 4 ++++
- 16 files changed, 139 insertions(+), 1 deletion(-)
-
---- a/arch/x86/Makefile
-+++ b/arch/x86/Makefile
+--- head-2009-11-06.orig/arch/x86/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -111,6 +111,10 @@ endif
# prevent gcc from generating any FP code by mistake
KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
@@ -77,8 +58,8 @@ take the forward porting patches:
PHONY += install
install:
---- a/arch/x86/boot/Makefile
-+++ b/arch/x86/boot/Makefile
+--- head-2009-11-06.orig/arch/x86/boot/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/boot/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -23,6 +23,7 @@ ROOT_DEV := CURRENT
SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
@@ -102,94 +83,9 @@ take the forward porting patches:
install:
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
System.map "$(INSTALL_PATH)"
---- a/arch/x86/include/asm/acpi.h
-+++ b/arch/x86/include/asm/acpi.h
-@@ -30,6 +30,10 @@
- #include <asm/mmu.h>
- #include <asm/mpspec.h>
-
-+#ifdef CONFIG_XEN
-+#include <xen/interface/platform.h>
-+#endif
-+
- #define COMPILER_DEPENDENT_INT64 long long
- #define COMPILER_DEPENDENT_UINT64 unsigned long long
-
-@@ -120,6 +124,27 @@ extern unsigned long acpi_wakeup_address
- /* early initialization routine */
- extern void acpi_reserve_bootmem(void);
-
-+#ifdef CONFIG_XEN
-+static inline int acpi_notify_hypervisor_state(u8 sleep_state,
-+ u32 pm1a_cnt_val,
-+ u32 pm1b_cnt_val)
-+{
-+ struct xen_platform_op op = {
-+ .cmd = XENPF_enter_acpi_sleep,
-+ .interface_version = XENPF_INTERFACE_VERSION,
-+ .u = {
-+ .enter_acpi_sleep = {
-+ .pm1a_cnt_val = pm1a_cnt_val,
-+ .pm1b_cnt_val = pm1b_cnt_val,
-+ .sleep_state = sleep_state,
-+ },
-+ },
-+ };
-+
-+ return HYPERVISOR_platform_op(&op);
-+}
-+#endif /* CONFIG_XEN */
-+
- /*
- * Check if the CPU can handle C2 and deeper
- */
-@@ -152,7 +177,9 @@ static inline void disable_acpi(void) {
-
- #endif /* !CONFIG_ACPI */
-
-+#ifndef CONFIG_XEN
- #define ARCH_HAS_POWER_INIT 1
-+#endif
-
- struct bootnode;
-
---- a/arch/x86/include/asm/apic.h
-+++ b/arch/x86/include/asm/apic.h
-@@ -15,7 +15,9 @@
- #include <asm/system.h>
- #include <asm/msr.h>
-
-+#ifndef CONFIG_XEN
- #define ARCH_APICTIMER_STOPS_ON_C3 1
-+#endif
-
- /*
- * Debugging macros
---- a/arch/x86/include/asm/kexec.h
-+++ b/arch/x86/include/asm/kexec.h
-@@ -163,6 +163,19 @@ struct kimage_arch {
- };
- #endif
-
-+/* Under Xen we need to work with machine addresses. These macros give the
-+ * machine address of a certain page to the generic kexec code instead of
-+ * the pseudo physical address which would be given by the default macros.
-+ */
-+
-+#ifdef CONFIG_XEN
-+#define KEXEC_ARCH_HAS_PAGE_MACROS
-+#define kexec_page_to_pfn(page) pfn_to_mfn(page_to_pfn(page))
-+#define kexec_pfn_to_page(pfn) pfn_to_page(mfn_to_pfn(pfn))
-+#define kexec_virt_to_phys(addr) virt_to_machine(addr)
-+#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
-+#endif
-+
- #endif /* __ASSEMBLY__ */
-
- #endif /* _ASM_X86_KEXEC_H */
---- a/arch/x86/kernel/Makefile
-+++ b/arch/x86/kernel/Makefile
-@@ -117,9 +117,12 @@ obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION)
+--- head-2009-11-06.orig/arch/x86/kernel/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/Makefile 2009-11-06 10:37:15.000000000 +0100
+@@ -117,9 +117,12 @@ obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION)
obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
@@ -213,8 +109,8 @@ take the forward porting patches:
+
+disabled-obj-$(CONFIG_XEN) := i8259_$(BITS).o reboot.o smpboot_$(BITS).o
+%/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
---- a/arch/x86/kernel/acpi/Makefile
-+++ b/arch/x86/kernel/acpi/Makefile
+--- head-2009-11-06.orig/arch/x86/kernel/acpi/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/acpi/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -5,6 +5,9 @@ obj-$(CONFIG_ACPI_SLEEP) += sleep.o wake
ifneq ($(CONFIG_ACPI_PROCESSOR),)
@@ -230,8 +126,8 @@ take the forward porting patches:
$(Q)$(MAKE) $(build)=$(obj)/realmode
+disabled-obj-$(CONFIG_XEN) := cstate.o wakeup_$(BITS).o
---- a/arch/x86/kernel/acpi/processor.c
-+++ b/arch/x86/kernel/acpi/processor.c
+--- head-2009-11-06.orig/arch/x86/kernel/acpi/processor.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/acpi/processor.c 2009-11-06 10:37:15.000000000 +0100
@@ -76,7 +76,18 @@ static void init_intel_pdc(struct acpi_p
/* Initialize _PDC data based on the CPU vendor */
void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
@@ -251,8 +147,8 @@ take the forward porting patches:
pr->pdc = NULL;
if (c->x86_vendor == X86_VENDOR_INTEL)
---- a/arch/x86/kernel/cpu/mcheck/Makefile
-+++ b/arch/x86/kernel/cpu/mcheck/Makefile
+--- head-2009-11-06.orig/arch/x86/kernel/cpu/mcheck/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/cpu/mcheck/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -3,6 +3,7 @@ obj-y = mce.o mce-severity.o
obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o
obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
@@ -261,8 +157,8 @@ take the forward porting patches:
obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o
---- a/arch/x86/kernel/cpu/mcheck/mce.c
-+++ b/arch/x86/kernel/cpu/mcheck/mce.c
+--- head-2009-11-06.orig/arch/x86/kernel/cpu/mcheck/mce.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/cpu/mcheck/mce.c 2009-11-06 10:37:15.000000000 +0100
@@ -1116,8 +1116,15 @@ void mce_log_therm_throt_event(__u64 sta
* Periodic polling timer for "silent" machine check errors. If the
* poller finds an MCE, poll 2x faster. When the poller finds no more
@@ -328,23 +224,23 @@ take the forward porting patches:
return err;
}
---- a/arch/x86/kernel/cpu/mtrr/Makefile
-+++ b/arch/x86/kernel/cpu/mtrr/Makefile
+--- head-2009-11-06.orig/arch/x86/kernel/cpu/mtrr/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/cpu/mtrr/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -1,3 +1,4 @@
obj-y := main.o if.o generic.o state.o cleanup.o
obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
+obj-$(CONFIG_XEN) := main.o if.o
---- a/arch/x86/lib/Makefile
-+++ b/arch/x86/lib/Makefile
+--- head-2009-11-06.orig/arch/x86/lib/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/lib/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -27,3 +27,5 @@ else
lib-y += memmove_64.o memset_64.o
lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
endif
+
+lib-$(CONFIG_XEN_SCRUB_PAGES) += scrub.o
---- a/arch/x86/mm/Makefile
-+++ b/arch/x86/mm/Makefile
+--- head-2009-11-06.orig/arch/x86/mm/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/mm/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -25,4 +25,6 @@ obj-$(CONFIG_NUMA) += numa.o numa_$(BIT
obj-$(CONFIG_K8_NUMA) += k8topology_64.o
obj-$(CONFIG_ACPI_NUMA) += srat_$(BITS).o
@@ -352,8 +248,8 @@ take the forward porting patches:
+obj-$(CONFIG_XEN) += hypervisor.o
+
obj-$(CONFIG_MEMTEST) += memtest.o
---- a/arch/x86/oprofile/Makefile
-+++ b/arch/x86/oprofile/Makefile
+--- head-2009-11-06.orig/arch/x86/oprofile/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/oprofile/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -6,7 +6,14 @@ DRIVER_OBJS = $(addprefix ../../../drive
oprofilefs.o oprofile_stats.o \
timer_int.o )
@@ -369,8 +265,8 @@ take the forward porting patches:
op_model_ppro.o op_model_p4.o
oprofile-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
+endif
---- a/arch/x86/pci/Makefile
-+++ b/arch/x86/pci/Makefile
+--- head-2009-11-06.orig/arch/x86/pci/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/pci/Makefile 2009-11-06 10:37:15.000000000 +0100
@@ -4,6 +4,9 @@ obj-$(CONFIG_PCI_BIOS) += pcbios.o
obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_$(BITS).o direct.o mmconfig-shared.o
obj-$(CONFIG_PCI_DIRECT) += direct.o
@@ -381,8 +277,8 @@ take the forward porting patches:
obj-y += fixup.o
obj-$(CONFIG_ACPI) += acpi.o
---- a/arch/x86/power/cpu.c
-+++ b/arch/x86/power/cpu.c
+--- head-2009-11-06.orig/arch/x86/power/cpu.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/power/cpu.c 2009-11-06 10:37:15.000000000 +0100
@@ -125,6 +125,7 @@ static void do_fpu_end(void)
static void fix_processor_context(void)
@@ -402,3 +298,88 @@ take the forward porting patches:
syscall_init(); /* This sets MSR_*STAR and related */
#endif
load_TR_desc(); /* This does ltr */
+--- head-2009-11-06.orig/arch/x86/include/asm/acpi.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/include/asm/acpi.h 2009-11-06 10:37:15.000000000 +0100
+@@ -30,6 +30,10 @@
+ #include <asm/mmu.h>
+ #include <asm/mpspec.h>
+
++#ifdef CONFIG_XEN
++#include <xen/interface/platform.h>
++#endif
++
+ #define COMPILER_DEPENDENT_INT64 long long
+ #define COMPILER_DEPENDENT_UINT64 unsigned long long
+
+@@ -120,6 +124,27 @@ extern unsigned long acpi_wakeup_address
+ /* early initialization routine */
+ extern void acpi_reserve_bootmem(void);
+
++#ifdef CONFIG_XEN
++static inline int acpi_notify_hypervisor_state(u8 sleep_state,
++ u32 pm1a_cnt_val,
++ u32 pm1b_cnt_val)
++{
++ struct xen_platform_op op = {
++ .cmd = XENPF_enter_acpi_sleep,
++ .interface_version = XENPF_INTERFACE_VERSION,
++ .u = {
++ .enter_acpi_sleep = {
++ .pm1a_cnt_val = pm1a_cnt_val,
++ .pm1b_cnt_val = pm1b_cnt_val,
++ .sleep_state = sleep_state,
++ },
++ },
++ };
++
++ return HYPERVISOR_platform_op(&op);
++}
++#endif /* CONFIG_XEN */
++
+ /*
+ * Check if the CPU can handle C2 and deeper
+ */
+@@ -152,7 +177,9 @@ static inline void disable_acpi(void) {
+
+ #endif /* !CONFIG_ACPI */
+
++#ifndef CONFIG_XEN
+ #define ARCH_HAS_POWER_INIT 1
++#endif
+
+ struct bootnode;
+
+--- head-2009-11-06.orig/arch/x86/include/asm/apic.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/include/asm/apic.h 2009-11-06 10:37:15.000000000 +0100
+@@ -15,7 +15,9 @@
+ #include <asm/system.h>
+ #include <asm/msr.h>
+
++#ifndef CONFIG_XEN
+ #define ARCH_APICTIMER_STOPS_ON_C3 1
++#endif
+
+ /*
+ * Debugging macros
+--- head-2009-11-06.orig/arch/x86/include/asm/kexec.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/include/asm/kexec.h 2009-11-06 10:37:15.000000000 +0100
+@@ -163,6 +163,19 @@ struct kimage_arch {
+ };
+ #endif
+
++/* Under Xen we need to work with machine addresses. These macros give the
++ * machine address of a certain page to the generic kexec code instead of
++ * the pseudo physical address which would be given by the default macros.
++ */
++
++#ifdef CONFIG_XEN
++#define KEXEC_ARCH_HAS_PAGE_MACROS
++#define kexec_page_to_pfn(page) pfn_to_mfn(page_to_pfn(page))
++#define kexec_pfn_to_page(pfn) pfn_to_page(mfn_to_pfn(pfn))
++#define kexec_virt_to_phys(addr) virt_to_machine(addr)
++#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
++#endif
++
+ #endif /* __ASSEMBLY__ */
+
+ #endif /* _ASM_X86_KEXEC_H */
diff --git a/patches.xen/xen3-auto-arch-x86_64.diff b/patches.xen/xen3-auto-arch-x86_64.diff
index a9fe4b8ce2..3b52852af3 100644
--- a/patches.xen/xen3-auto-arch-x86_64.diff
+++ b/patches.xen/xen3-auto-arch-x86_64.diff
@@ -1,16 +1,10 @@
Subject: xen3 arch-x86_64
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 938:cd453b4804b9)
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 941:9348c4535655)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
----
- arch/x86/kernel/asm-offsets_64.c | 2
- arch/x86/kernel/machine_kexec_64.c | 133 +++++++++++++++++++++++++++++++++++--
- arch/x86/vdso/Makefile | 2
- 3 files changed, 131 insertions(+), 6 deletions(-)
-
---- a/arch/x86/kernel/asm-offsets_64.c
-+++ b/arch/x86/kernel/asm-offsets_64.c
+--- head-2009-11-06.orig/arch/x86/kernel/asm-offsets_64.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/asm-offsets_64.c 2009-11-06 10:37:22.000000000 +0100
@@ -115,8 +115,10 @@ int main(void)
ENTRY(cr8);
BLANK();
@@ -22,8 +16,8 @@ Acked-by: jbeulich@novell.com
DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx));
BLANK();
DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
---- a/arch/x86/kernel/machine_kexec_64.c
-+++ b/arch/x86/kernel/machine_kexec_64.c
+--- head-2009-11-06.orig/arch/x86/kernel/machine_kexec_64.c 2009-11-06 10:30:31.000000000 +0100
++++ head-2009-11-06/arch/x86/kernel/machine_kexec_64.c 2009-11-06 10:37:22.000000000 +0100
@@ -19,6 +19,119 @@
#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
@@ -215,8 +209,8 @@ Acked-by: jbeulich@novell.com
void arch_crash_save_vmcoreinfo(void)
{
---- a/arch/x86/vdso/Makefile
-+++ b/arch/x86/vdso/Makefile
+--- head-2009-11-06.orig/arch/x86/vdso/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/arch/x86/vdso/Makefile 2009-11-06 10:37:22.000000000 +0100
@@ -65,6 +65,8 @@ obj-$(VDSO32-y) += vdso32-syms.lds
vdso32.so-$(VDSO32-y) += int80
vdso32.so-$(CONFIG_COMPAT) += syscall
diff --git a/patches.xen/xen3-auto-common.diff b/patches.xen/xen3-auto-common.diff
index 0549e16d40..4f4fc52d59 100644
--- a/patches.xen/xen3-auto-common.diff
+++ b/patches.xen/xen3-auto-common.diff
@@ -1,5 +1,5 @@
Subject: xen3 common
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 938:cd453b4804b9)
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 941:9348c4535655)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
@@ -12,63 +12,8 @@ take the forward porting patches:
2.6.25/mm/highmem.c
2.6.30/include/linux/pci_regs.h
----
- drivers/Makefile | 1
- drivers/acpi/Makefile | 3
- drivers/acpi/acpica/hwsleep.c | 15
- drivers/acpi/processor_core.c | 69 ++-
- drivers/acpi/processor_extcntl.c | 241 +++++++++++
- drivers/acpi/processor_idle.c | 14
- drivers/acpi/processor_perflib.c | 21
- drivers/acpi/sleep.c | 9
- drivers/char/agp/intel-agp.c | 10
- drivers/char/mem.c | 16
- drivers/char/tpm/Makefile | 2
- drivers/char/tpm/tpm.h | 15
- drivers/char/tpm/tpm_vtpm.c | 542 +++++++++++++++++++++++++
- drivers/char/tpm/tpm_vtpm.h | 55 ++
- drivers/char/tpm/tpm_xen.c | 722 ++++++++++++++++++++++++++++++++++
- drivers/edac/edac_mc.c | 4
- drivers/ide/ide-lib.c | 8
- drivers/oprofile/buffer_sync.c | 72 ++-
- drivers/oprofile/cpu_buffer.c | 52 +-
- drivers/oprofile/cpu_buffer.h | 12
- drivers/oprofile/event_buffer.h | 3
- drivers/oprofile/oprof.c | 30 +
- drivers/oprofile/oprof.h | 3
- drivers/oprofile/oprofile_files.c | 197 +++++++++
- fs/aio.c | 119 +++++
- fs/compat_ioctl.c | 19
- include/acpi/processor.h | 143 ++++++
- include/asm-generic/pgtable.h | 4
- include/linux/aio.h | 6
- include/linux/highmem.h | 6
- include/linux/interrupt.h | 6
- include/linux/kexec.h | 13
- include/linux/mm.h | 20
- include/linux/oprofile.h | 16
- include/linux/page-flags.h | 37 +
- include/linux/pci.h | 9
- include/linux/skbuff.h | 8
- include/linux/vermagic.h | 7
- kernel/irq/spurious.c | 2
- kernel/kexec.c | 68 ++-
- kernel/sysctl.c | 2
- mm/memory.c | 40 +
- mm/mmap.c | 10
- mm/mprotect.c | 2
- mm/page_alloc.c | 14
- net/core/dev.c | 62 ++
- net/core/skbuff.c | 4
- net/ipv4/netfilter/nf_nat_proto_tcp.c | 3
- net/ipv4/netfilter/nf_nat_proto_udp.c | 4
- net/ipv4/xfrm4_output.c | 2
- scripts/Makefile.build | 15
- scripts/Makefile.lib | 6
- 52 files changed, 2688 insertions(+), 75 deletions(-)
-
---- a/drivers/Makefile
-+++ b/drivers/Makefile
+--- head-2009-11-06.orig/drivers/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/Makefile 2009-11-06 10:37:01.000000000 +0100
@@ -33,6 +33,7 @@ obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ block/ misc/ mfd/
obj-$(CONFIG_NUBUS) += nubus/
@@ -77,8 +22,8 @@ take the forward porting patches:
obj-$(CONFIG_SCSI) += scsi/
obj-$(CONFIG_ATA) += ata/
obj-$(CONFIG_MTD) += mtd/
---- a/drivers/acpi/Makefile
-+++ b/drivers/acpi/Makefile
+--- head-2009-11-06.orig/drivers/acpi/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/Makefile 2009-11-06 10:37:01.000000000 +0100
@@ -62,5 +62,8 @@ obj-$(CONFIG_ACPI_POWER_METER) += power_
processor-y := processor_core.o processor_throttling.o
processor-y += processor_idle.o processor_thermal.o
@@ -88,8 +33,8 @@ take the forward porting patches:
+endif
obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
---- a/drivers/acpi/acpica/hwsleep.c
-+++ b/drivers/acpi/acpica/hwsleep.c
+--- head-2009-11-06.orig/drivers/acpi/acpica/hwsleep.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/acpica/hwsleep.c 2009-11-06 10:37:01.000000000 +0100
@@ -236,7 +236,11 @@ acpi_status asmlinkage acpi_enter_sleep_
u32 pm1b_control;
struct acpi_bit_register_info *sleep_type_reg_info;
@@ -127,8 +72,8 @@ take the forward porting patches:
return_ACPI_STATUS(AE_OK);
}
---- a/drivers/acpi/processor_core.c
-+++ b/drivers/acpi/processor_core.c
+--- head-2009-11-06.orig/drivers/acpi/processor_core.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/processor_core.c 2009-11-06 10:37:01.000000000 +0100
@@ -658,7 +658,8 @@ static int acpi_processor_get_info(struc
*/
if (pr->id == -1) {
@@ -228,7 +173,7 @@ take the forward porting patches:
pr->cdev = thermal_cooling_device_register("Processor", device,
&processor_cooling_ops);
if (IS_ERR(pr->cdev)) {
-@@ -889,7 +922,7 @@ static int acpi_processor_remove(struct
+@@ -889,7 +922,7 @@ static int acpi_processor_remove(struct
pr = acpi_driver_data(device);
@@ -237,7 +182,7 @@ take the forward porting patches:
goto free;
if (type == ACPI_BUS_REMOVAL_EJECT) {
-@@ -910,8 +943,14 @@ static int acpi_processor_remove(struct
+@@ -910,8 +943,14 @@ static int acpi_processor_remove(struct
pr->cdev = NULL;
}
@@ -296,8 +241,8 @@ take the forward porting patches:
if (cpu_online(pr->id))
cpu_down(pr->id);
---- /dev/null
-+++ b/drivers/acpi/processor_extcntl.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/acpi/processor_extcntl.c 2009-11-06 10:37:01.000000000 +0100
@@ -0,0 +1,241 @@
+/*
+ * processor_extcntl.c - channel to external control logic
@@ -540,8 +485,8 @@ take the forward porting patches:
+ kfree(perf);
+ return ret;
+}
---- a/drivers/acpi/processor_idle.c
-+++ b/drivers/acpi/processor_idle.c
+--- head-2009-11-06.orig/drivers/acpi/processor_idle.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/processor_idle.c 2009-11-06 10:37:01.000000000 +0100
@@ -419,7 +419,8 @@ static int acpi_processor_get_power_info
*/
cx.entry_method = ACPI_CSTATE_HALT;
@@ -577,8 +522,8 @@ take the forward porting patches:
return 0;
}
---- a/drivers/acpi/processor_perflib.c
-+++ b/drivers/acpi/processor_perflib.c
+--- head-2009-11-06.orig/drivers/acpi/processor_perflib.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/processor_perflib.c 2009-11-06 10:37:01.000000000 +0100
@@ -78,6 +78,7 @@ MODULE_PARM_DESC(ignore_ppc, "If the fre
static int acpi_processor_ppc_status;
@@ -653,8 +598,8 @@ take the forward porting patches:
{
int result = 0;
acpi_status status = AE_OK;
---- a/drivers/acpi/sleep.c
-+++ b/drivers/acpi/sleep.c
+--- head-2009-11-06.orig/drivers/acpi/sleep.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/acpi/sleep.c 2009-11-06 10:37:01.000000000 +0100
@@ -60,6 +60,7 @@ static struct notifier_block tts_notifie
static int acpi_sleep_prepare(u32 acpi_state)
{
@@ -686,8 +631,8 @@ take the forward porting patches:
break;
}
---- a/drivers/char/agp/intel-agp.c
-+++ b/drivers/char/agp/intel-agp.c
+--- head-2009-11-06.orig/drivers/char/agp/intel-agp.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/char/agp/intel-agp.c 2009-11-06 10:37:01.000000000 +0100
@@ -397,6 +397,13 @@ static struct page *i8xx_alloc_pages(voi
if (page == NULL)
return NULL;
@@ -712,8 +657,8 @@ take the forward porting patches:
put_page(page);
__free_pages(page, 2);
atomic_dec(&agp_bridge->current_memory_agp);
---- a/drivers/char/mem.c
-+++ b/drivers/char/mem.c
+--- head-2009-11-06.orig/drivers/char/mem.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/char/mem.c 2009-11-06 10:37:01.000000000 +0100
@@ -110,6 +110,7 @@ void __attribute__((weak)) unxlate_dev_m
{
}
@@ -730,7 +675,7 @@ take the forward porting patches:
int __attribute__((weak)) phys_mem_access_prot_allowed(struct file *file,
unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
-@@ -345,6 +347,9 @@ static int mmap_mem(struct file * file,
+@@ -345,6 +347,9 @@ static int mmap_mem(struct file * file,
static int mmap_kmem(struct file * file, struct vm_area_struct * vma)
{
unsigned long pfn;
@@ -772,16 +717,16 @@ take the forward porting patches:
#ifdef CONFIG_DEVKMEM
static const struct file_operations kmem_fops = {
---- a/drivers/char/tpm/Makefile
-+++ b/drivers/char/tpm/Makefile
+--- head-2009-11-06.orig/drivers/char/tpm/Makefile 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/char/tpm/Makefile 2009-11-06 10:37:01.000000000 +0100
@@ -9,3 +9,5 @@ obj-$(CONFIG_TCG_TIS) += tpm_tis.o
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
---- a/drivers/char/tpm/tpm.h
-+++ b/drivers/char/tpm/tpm.h
+--- head-2009-11-06.orig/drivers/char/tpm/tpm.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/char/tpm/tpm.h 2009-11-06 10:37:01.000000000 +0100
@@ -108,6 +108,9 @@ struct tpm_chip {
struct dentry **bios_dir;
@@ -811,8 +756,8 @@ take the forward porting patches:
extern void tpm_get_timeouts(struct tpm_chip *);
extern void tpm_gen_interrupt(struct tpm_chip *);
extern void tpm_continue_selftest(struct tpm_chip *);
---- /dev/null
-+++ b/drivers/char/tpm/tpm_vtpm.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/char/tpm/tpm_vtpm.c 2009-11-06 10:37:01.000000000 +0100
@@ -0,0 +1,542 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
@@ -1356,8 +1301,8 @@ take the forward porting patches:
+ tpm_remove_hardware(dev);
+ kfree(vtpms);
+}
---- /dev/null
-+++ b/drivers/char/tpm/tpm_vtpm.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/char/tpm/tpm_vtpm.h 2009-11-06 10:37:01.000000000 +0100
@@ -0,0 +1,55 @@
+#ifndef TPM_VTPM_H
+#define TPM_VTPM_H
@@ -1414,8 +1359,8 @@ take the forward porting patches:
+}
+
+#endif
---- /dev/null
-+++ b/drivers/char/tpm/tpm_xen.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/drivers/char/tpm/tpm_xen.c 2009-11-06 10:37:01.000000000 +0100
@@ -0,0 +1,722 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
@@ -2139,8 +2084,8 @@ take the forward porting patches:
+module_init(tpmif_init);
+
+MODULE_LICENSE("Dual BSD/GPL");
---- a/drivers/edac/edac_mc.c
-+++ b/drivers/edac/edac_mc.c
+--- head-2009-11-06.orig/drivers/edac/edac_mc.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/edac/edac_mc.c 2009-11-06 10:37:01.000000000 +0100
@@ -578,6 +578,10 @@ static void edac_mc_scrub_block(unsigned
debugf3("%s()\n", __func__);
@@ -2152,8 +2097,8 @@ take the forward porting patches:
/* ECC error page was not in our memory. Ignore it. */
if (!pfn_valid(page))
return;
---- a/drivers/ide/ide-lib.c
-+++ b/drivers/ide/ide-lib.c
+--- head-2009-11-06.orig/drivers/ide/ide-lib.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/ide/ide-lib.c 2009-11-06 10:37:01.000000000 +0100
@@ -18,12 +18,12 @@ void ide_toggle_bounce(ide_drive_t *driv
{
u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
@@ -2171,8 +2116,8 @@ take the forward porting patches:
addr = *dev->dma_mask;
}
---- a/drivers/oprofile/buffer_sync.c
-+++ b/drivers/oprofile/buffer_sync.c
+--- head-2009-11-06.orig/drivers/oprofile/buffer_sync.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/buffer_sync.c 2009-11-06 10:37:01.000000000 +0100
@@ -8,6 +8,10 @@
* @author Barry Kasindorf
* @author Robert Richter <robert.richter@amd.com>
@@ -2349,8 +2294,8 @@ take the forward porting patches:
mark_done(cpu);
mutex_unlock(&buffer_mutex);
---- a/drivers/oprofile/cpu_buffer.c
-+++ b/drivers/oprofile/cpu_buffer.c
+--- head-2009-11-06.orig/drivers/oprofile/cpu_buffer.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/cpu_buffer.c 2009-11-06 10:37:01.000000000 +0100
@@ -8,6 +8,10 @@
* @author Barry Kasindorf <barry.kasindorf@amd.com>
* @author Robert Richter <robert.richter@amd.com>
@@ -2380,7 +2325,7 @@ take the forward porting patches:
b->tracing = 0;
b->buffer_size = buffer_size;
b->sample_received = 0;
-@@ -216,7 +222,7 @@ unsigned long op_cpu_buffer_entries(int
+@@ -216,7 +222,7 @@ unsigned long op_cpu_buffer_entries(int
static int
op_add_code(struct oprofile_cpu_buffer *cpu_buf, unsigned long backtrace,
@@ -2466,8 +2411,8 @@ take the forward porting patches:
/*
* This serves to avoid cpu buffer overflow, and makes sure
* the task mortuary progresses
---- a/drivers/oprofile/cpu_buffer.h
-+++ b/drivers/oprofile/cpu_buffer.h
+--- head-2009-11-06.orig/drivers/oprofile/cpu_buffer.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/cpu_buffer.h 2009-11-06 10:37:01.000000000 +0100
@@ -40,7 +40,7 @@ struct op_entry;
struct oprofile_cpu_buffer {
unsigned long buffer_size;
@@ -2502,8 +2447,8 @@ take the forward porting patches:
+#define DOMAIN_SWITCH (1UL << 5)
#endif /* OPROFILE_CPU_BUFFER_H */
---- a/drivers/oprofile/event_buffer.h
-+++ b/drivers/oprofile/event_buffer.h
+--- head-2009-11-06.orig/drivers/oprofile/event_buffer.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/event_buffer.h 2009-11-06 10:37:01.000000000 +0100
@@ -30,6 +30,9 @@ void wake_up_buffer_waiter(void);
#define INVALID_COOKIE ~0UL
#define NO_COOKIE 0UL
@@ -2514,8 +2459,8 @@ take the forward porting patches:
extern const struct file_operations event_buffer_fops;
/* mutex between sync_cpu_buffers() and the
---- a/drivers/oprofile/oprof.c
-+++ b/drivers/oprofile/oprof.c
+--- head-2009-11-06.orig/drivers/oprofile/oprof.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/oprof.c 2009-11-06 10:37:01.000000000 +0100
@@ -5,6 +5,10 @@
* @remark Read the file COPYING
*
@@ -2560,8 +2505,8 @@ take the forward porting patches:
int oprofile_setup(void)
{
int err;
---- a/drivers/oprofile/oprof.h
-+++ b/drivers/oprofile/oprof.h
+--- head-2009-11-06.orig/drivers/oprofile/oprof.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/oprof.h 2009-11-06 10:37:01.000000000 +0100
@@ -39,4 +39,7 @@ void oprofile_timer_init(struct oprofile
int oprofile_set_backtrace(unsigned long depth);
int oprofile_set_timeout(unsigned long time);
@@ -2570,8 +2515,8 @@ take the forward porting patches:
+int oprofile_set_passive(int passive_domains[], unsigned int pdomains);
+
#endif /* OPROF_H */
---- a/drivers/oprofile/oprofile_files.c
-+++ b/drivers/oprofile/oprofile_files.c
+--- head-2009-11-06.orig/drivers/oprofile/oprofile_files.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/drivers/oprofile/oprofile_files.c 2009-11-06 10:37:01.000000000 +0100
@@ -5,11 +5,17 @@
* @remark Read the file COPYING
*
@@ -2795,8 +2740,8 @@ take the forward porting patches:
oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
oprofilefs_create_ulong(sb, root, "buffer_size", &oprofile_buffer_size);
oprofilefs_create_ulong(sb, root, "buffer_watershed", &oprofile_buffer_watershed);
---- a/fs/aio.c
-+++ b/fs/aio.c
+--- head-2009-11-06.orig/fs/aio.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/aio.c 2009-11-06 10:37:01.000000000 +0100
@@ -36,6 +36,11 @@
#include <asm/kmap_types.h>
#include <asm/uaccess.h>
@@ -2984,8 +2929,8 @@ take the forward porting patches:
get_ioctx(ioctx); /* io_destroy() expects us to hold a ref */
io_destroy(ioctx);
---- a/fs/compat_ioctl.c
-+++ b/fs/compat_ioctl.c
+--- head-2009-11-06.orig/fs/compat_ioctl.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/fs/compat_ioctl.c 2009-11-06 10:37:01.000000000 +0100
@@ -115,6 +115,13 @@
#include <asm/fbio.h>
#endif
@@ -3019,8 +2964,8 @@ take the forward porting patches:
};
#define IOCTL_HASHSIZE 256
---- a/include/acpi/processor.h
-+++ b/include/acpi/processor.h
+--- head-2009-11-06.orig/include/acpi/processor.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/acpi/processor.h 2009-11-06 10:37:01.000000000 +0100
@@ -17,6 +17,12 @@
#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */
#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4
@@ -3204,8 +3149,8 @@ take the forward porting patches:
+#endif /* CONFIG_XEN */
+
#endif
---- a/include/asm-generic/pgtable.h
-+++ b/include/asm-generic/pgtable.h
+--- head-2009-11-06.orig/include/asm-generic/pgtable.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/asm-generic/pgtable.h 2009-11-06 10:37:01.000000000 +0100
@@ -99,6 +99,10 @@ static inline void ptep_set_wrprotect(st
}
#endif
@@ -3217,8 +3162,8 @@ take the forward porting patches:
#ifndef __HAVE_ARCH_PTE_SAME
#define pte_same(A,B) (pte_val(A) == pte_val(B))
#endif
---- a/include/linux/aio.h
-+++ b/include/linux/aio.h
+--- head-2009-11-06.orig/include/linux/aio.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/aio.h 2009-11-06 10:37:01.000000000 +0100
@@ -201,6 +201,12 @@ struct kioctx {
struct delayed_work wq;
@@ -3232,8 +3177,8 @@ take the forward porting patches:
struct rcu_head rcu_head;
};
---- a/include/linux/highmem.h
-+++ b/include/linux/highmem.h
+--- head-2009-11-06.orig/include/linux/highmem.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/highmem.h 2009-11-06 10:37:01.000000000 +0100
@@ -130,12 +130,14 @@ alloc_zeroed_user_highpage_movable(struc
return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr);
}
@@ -3258,15 +3203,15 @@ take the forward porting patches:
static inline void copy_highpage(struct page *to, struct page *from)
{
char *vfrom, *vto;
-@@ -200,4 +204,6 @@ static inline void copy_highpage(struct
+@@ -200,4 +204,6 @@ static inline void copy_highpage(struct
kunmap_atomic(vto, KM_USER1);
}
+#endif
+
#endif /* _LINUX_HIGHMEM_H */
---- a/include/linux/interrupt.h
-+++ b/include/linux/interrupt.h
+--- head-2009-11-06.orig/include/linux/interrupt.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/interrupt.h 2009-11-06 10:37:01.000000000 +0100
@@ -317,6 +317,12 @@ static inline int disable_irq_wake(unsig
}
#endif /* CONFIG_GENERIC_HARDIRQS */
@@ -3280,8 +3225,8 @@ take the forward porting patches:
#ifndef __ARCH_SET_SOFTIRQ_PENDING
#define set_softirq_pending(x) (local_softirq_pending() = (x))
#define or_softirq_pending(x) (local_softirq_pending() |= (x))
---- a/include/linux/kexec.h
-+++ b/include/linux/kexec.h
+--- head-2009-11-06.orig/include/linux/kexec.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/kexec.h 2009-11-06 10:37:01.000000000 +0100
@@ -46,6 +46,13 @@
KEXEC_CORE_NOTE_NAME_BYTES + \
KEXEC_CORE_NOTE_DESC_BYTES )
@@ -3309,9 +3254,9 @@ take the forward porting patches:
extern asmlinkage long sys_kexec_load(unsigned long entry,
unsigned long nr_segments,
struct kexec_segment __user *segments,
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -102,7 +102,12 @@ extern unsigned int kobjsize(const void
+--- head-2009-11-06.orig/include/linux/mm.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/mm.h 2009-11-06 10:37:01.000000000 +0100
+@@ -102,7 +102,12 @@ extern unsigned int kobjsize(const void
#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
@@ -3324,7 +3269,7 @@ take the forward porting patches:
#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */
#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
-@@ -127,6 +132,12 @@ extern unsigned int kobjsize(const void
+@@ -127,6 +132,12 @@ extern unsigned int kobjsize(const void
*/
#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)
@@ -3353,8 +3298,8 @@ take the forward porting patches:
#ifdef CONFIG_NUMA
/*
* set_policy() op must add a reference to any non-NULL @new mempolicy
---- a/include/linux/oprofile.h
-+++ b/include/linux/oprofile.h
+--- head-2009-11-06.orig/include/linux/oprofile.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/oprofile.h 2009-11-06 10:37:01.000000000 +0100
@@ -16,6 +16,8 @@
#include <linux/types.h>
#include <linux/spinlock.h>
@@ -3406,8 +3351,8 @@ take the forward porting patches:
/**
* Create a file of the given name as a child of the given root, with
---- a/include/linux/page-flags.h
-+++ b/include/linux/page-flags.h
+--- head-2009-11-06.orig/include/linux/page-flags.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/page-flags.h 2009-11-06 10:37:01.000000000 +0100
@@ -110,6 +110,11 @@ enum pageflags {
#ifdef CONFIG_MEMORY_FAILURE
PG_hwpoison, /* hardware poisoned page. Don't touch */
@@ -3473,8 +3418,8 @@ take the forward porting patches:
/*
* Flags checked when a page is prepped for return by the page allocator.
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
+--- head-2009-11-06.orig/include/linux/pci.h 2009-11-06 10:30:33.000000000 +0100
++++ head-2009-11-06/include/linux/pci.h 2009-11-06 10:37:01.000000000 +0100
@@ -877,6 +877,11 @@ static inline int pci_msi_enabled(void)
{
return 0;
@@ -3498,8 +3443,8 @@ take the forward porting patches:
#endif
#ifndef CONFIG_PCIEASPM
---- a/include/linux/skbuff.h
-+++ b/include/linux/skbuff.h
+--- head-2009-11-06.orig/include/linux/skbuff.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/skbuff.h 2009-11-06 10:37:01.000000000 +0100
@@ -278,6 +278,8 @@ typedef unsigned char *sk_buff_data_t;
* @local_df: allow local fragmentation
* @cloned: Head may be cloned (check refcnt to be sure)
@@ -3524,8 +3469,8 @@ take the forward porting patches:
#ifdef CONFIG_NET_DMA
dma_cookie_t dma_cookie;
---- a/include/linux/vermagic.h
-+++ b/include/linux/vermagic.h
+--- head-2009-11-06.orig/include/linux/vermagic.h 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/include/linux/vermagic.h 2009-11-06 10:37:01.000000000 +0100
@@ -22,6 +22,11 @@
#else
#define MODULE_VERMAGIC_MODVERSIONS ""
@@ -3545,8 +3490,8 @@ take the forward porting patches:
- MODULE_ARCH_VERMAGIC
+ MODULE_VERMAGIC_XEN MODULE_ARCH_VERMAGIC
---- a/kernel/irq/spurious.c
-+++ b/kernel/irq/spurious.c
+--- head-2009-11-06.orig/kernel/irq/spurious.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/kernel/irq/spurious.c 2009-11-06 10:37:01.000000000 +0100
@@ -235,7 +235,7 @@ void note_interrupt(unsigned int irq, st
*/
if (time_after(jiffies, desc->last_unhandled + HZ/10))
@@ -3556,8 +3501,8 @@ take the forward porting patches:
desc->irqs_unhandled++;
desc->last_unhandled = jiffies;
if (unlikely(action_ret != IRQ_NONE))
---- a/kernel/kexec.c
-+++ b/kernel/kexec.c
+--- head-2009-11-06.orig/kernel/kexec.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/kernel/kexec.c 2009-11-06 10:37:01.000000000 +0100
@@ -360,13 +360,26 @@ static int kimage_is_destination_range(s
return 0;
}
@@ -3758,8 +3703,8 @@ take the forward porting patches:
/* Install the new kernel, and Uninstall the old */
image = xchg(dest_image, image);
---- a/kernel/sysctl.c
-+++ b/kernel/sysctl.c
+--- head-2009-11-06.orig/kernel/sysctl.c 2009-11-06 10:32:37.000000000 +0100
++++ head-2009-11-06/kernel/sysctl.c 2009-11-06 10:37:01.000000000 +0100
@@ -858,7 +858,7 @@ static struct ctl_table kern_table[] = {
.proc_handler = &proc_dointvec,
},
@@ -3769,8 +3714,8 @@ take the forward porting patches:
{
.procname = "acpi_video_flags",
.data = &acpi_realmode_flags,
---- a/mm/memory.c
-+++ b/mm/memory.c
+--- head-2009-11-06.orig/mm/memory.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/memory.c 2009-11-06 10:37:01.000000000 +0100
@@ -523,6 +523,12 @@ struct page *vm_normal_page(struct vm_ar
{
unsigned long pfn = pte_pfn(pte);
@@ -3817,7 +3762,7 @@ take the forward porting patches:
/**
* zap_vma_ptes - remove ptes mapping the vma
-@@ -1296,6 +1310,28 @@ int __get_user_pages(struct task_struct
+@@ -1296,6 +1310,28 @@ int __get_user_pages(struct task_struct
continue;
}
@@ -3846,8 +3791,8 @@ take the forward porting patches:
if (!vma ||
(vma->vm_flags & (VM_IO | VM_PFNMAP)) ||
!(vm_flags & vma->vm_flags))
---- a/mm/mmap.c
-+++ b/mm/mmap.c
+--- head-2009-11-06.orig/mm/mmap.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/mmap.c 2009-11-06 10:37:01.000000000 +0100
@@ -1856,6 +1856,12 @@ static void unmap_region(struct mm_struc
tlb_finish_mmu(tlb, start, end);
}
@@ -3879,8 +3824,8 @@ take the forward porting patches:
vma = mm->mmap;
if (!vma) /* Can happen if dup_mmap() received an OOM */
return;
---- a/mm/mprotect.c
-+++ b/mm/mprotect.c
+--- head-2009-11-06.orig/mm/mprotect.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/mprotect.c 2009-11-06 10:37:01.000000000 +0100
@@ -91,6 +91,8 @@ static inline void change_pmd_range(stru
next = pmd_addr_end(addr, end);
if (pmd_none_or_clear_bad(pmd))
@@ -3890,9 +3835,9 @@ take the forward porting patches:
change_pte_range(mm, pmd, addr, next, newprot, dirty_accountable);
} while (pmd++, addr = next, addr != end);
}
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -585,6 +585,13 @@ static void __free_pages_ok(struct page
+--- head-2009-11-06.orig/mm/page_alloc.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/mm/page_alloc.c 2009-11-06 10:37:01.000000000 +0100
+@@ -585,6 +585,13 @@ static void __free_pages_ok(struct page
int bad = 0;
int wasMlocked = __TestClearPageMlocked(page);
@@ -3920,8 +3865,8 @@ take the forward porting patches:
kmemcheck_free_shadow(page, 0);
if (PageAnon(page))
---- a/net/core/dev.c
-+++ b/net/core/dev.c
+--- head-2009-11-06.orig/net/core/dev.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/net/core/dev.c 2009-11-06 10:37:01.000000000 +0100
@@ -136,6 +136,12 @@
/* This should be increased if a protocol with a bigger head is added. */
#define GRO_MAX_HEAD (MAX_HEADER + 128)
@@ -4012,8 +3957,8 @@ take the forward porting patches:
list_for_each_entry_rcu(ptype, &ptype_all, list) {
if (ptype->dev == null_or_orig || ptype->dev == skb->dev ||
ptype->dev == orig_dev) {
---- a/net/core/skbuff.c
-+++ b/net/core/skbuff.c
+--- head-2009-11-06.orig/net/core/skbuff.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/net/core/skbuff.c 2009-11-06 10:37:01.000000000 +0100
@@ -581,6 +581,10 @@ static struct sk_buff *__skb_clone(struc
n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
n->cloned = 1;
@@ -4025,8 +3970,8 @@ take the forward porting patches:
n->destructor = NULL;
C(tail);
C(end);
---- a/net/ipv4/netfilter/nf_nat_proto_tcp.c
-+++ b/net/ipv4/netfilter/nf_nat_proto_tcp.c
+--- head-2009-11-06.orig/net/ipv4/netfilter/nf_nat_proto_tcp.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/net/ipv4/netfilter/nf_nat_proto_tcp.c 2009-11-06 10:37:01.000000000 +0100
@@ -75,6 +75,9 @@ tcp_manip_pkt(struct sk_buff *skb,
if (hdrsize < sizeof(*hdr))
return true;
@@ -4037,8 +3982,8 @@ take the forward porting patches:
inet_proto_csum_replace4(&hdr->check, skb, oldip, newip, 1);
inet_proto_csum_replace2(&hdr->check, skb, oldport, newport, 0);
return true;
---- a/net/ipv4/netfilter/nf_nat_proto_udp.c
-+++ b/net/ipv4/netfilter/nf_nat_proto_udp.c
+--- head-2009-11-06.orig/net/ipv4/netfilter/nf_nat_proto_udp.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/net/ipv4/netfilter/nf_nat_proto_udp.c 2009-11-06 10:37:01.000000000 +0100
@@ -60,6 +60,10 @@ udp_manip_pkt(struct sk_buff *skb,
newport = tuple->dst.u.udp.port;
portptr = &hdr->dest;
@@ -4050,8 +3995,8 @@ take the forward porting patches:
if (hdr->check || skb->ip_summed == CHECKSUM_PARTIAL) {
inet_proto_csum_replace4(&hdr->check, skb, oldip, newip, 1);
inet_proto_csum_replace2(&hdr->check, skb, *portptr, newport,
---- a/net/ipv4/xfrm4_output.c
-+++ b/net/ipv4/xfrm4_output.c
+--- head-2009-11-06.orig/net/ipv4/xfrm4_output.c 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/net/ipv4/xfrm4_output.c 2009-11-06 10:37:01.000000000 +0100
@@ -81,7 +81,7 @@ static int xfrm4_output_finish(struct sk
#endif
@@ -4061,8 +4006,8 @@ take the forward porting patches:
}
int xfrm4_output(struct sk_buff *skb)
---- a/scripts/Makefile.build
-+++ b/scripts/Makefile.build
+--- head-2009-11-06.orig/scripts/Makefile.build 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/scripts/Makefile.build 2009-11-06 10:37:01.000000000 +0100
@@ -76,6 +76,21 @@ ifndef obj
$(warning kbuild: Makefile.build is included improperly)
endif
@@ -4085,8 +4030,8 @@ take the forward porting patches:
# ===========================================================================
ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),)
---- a/scripts/Makefile.lib
-+++ b/scripts/Makefile.lib
+--- head-2009-11-06.orig/scripts/Makefile.lib 2009-11-06 10:29:51.000000000 +0100
++++ head-2009-11-06/scripts/Makefile.lib 2009-11-06 10:37:01.000000000 +0100
@@ -22,6 +22,12 @@ obj-m := $(filter-out $(obj-y),$(obj-m))
lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
diff --git a/patches.xen/xen3-auto-include-xen-interface.diff b/patches.xen/xen3-auto-include-xen-interface.diff
index 45a87adf3e..ce3428b2f6 100644
--- a/patches.xen/xen3-auto-include-xen-interface.diff
+++ b/patches.xen/xen3-auto-include-xen-interface.diff
@@ -1,46 +1,10 @@
Subject: xen3 include-xen-interface
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 938:cd453b4804b9)
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 941:9348c4535655)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
----
- include/xen/interface/COPYING | 38 +
- include/xen/interface/arch-x86/cpuid.h | 68 ++
- include/xen/interface/arch-x86/hvm/save.h | 438 +++++++++++++++++
- include/xen/interface/arch-x86/xen-mca.h | 422 ++++++++++++++++
- include/xen/interface/arch-x86/xen-x86_32.h | 180 +++++++
- include/xen/interface/arch-x86/xen-x86_64.h | 212 ++++++++
- include/xen/interface/arch-x86/xen.h | 200 +++++++
- include/xen/interface/arch-x86_32.h | 27 +
- include/xen/interface/arch-x86_64.h | 27 +
- include/xen/interface/dom0_ops.h | 120 ++++
- include/xen/interface/domctl.h | 710 ++++++++++++++++++++++++++++
- include/xen/interface/hvm/e820.h | 34 +
- include/xen/interface/hvm/hvm_info_table.h | 69 ++
- include/xen/interface/hvm/hvm_op.h | 133 +++++
- include/xen/interface/hvm/ioreq.h | 127 +++++
- include/xen/interface/hvm/params.h | 111 ++++
- include/xen/interface/hvm/save.h | 88 +++
- include/xen/interface/io/fsif.h | 192 +++++++
- include/xen/interface/io/pciif.h | 124 ++++
- include/xen/interface/io/tpmif.h | 77 +++
- include/xen/interface/io/usbif.h | 151 +++++
- include/xen/interface/io/vscsiif.h | 105 ++++
- include/xen/interface/kexec.h | 168 ++++++
- include/xen/interface/nmi.h | 80 +++
- include/xen/interface/platform.h | 346 +++++++++++++
- include/xen/interface/sysctl.h | 490 +++++++++++++++++++
- include/xen/interface/tmem.h | 111 ++++
- include/xen/interface/trace.h | 208 ++++++++
- include/xen/interface/xen-compat.h | 44 +
- include/xen/interface/xenoprof.h | 138 +++++
- include/xen/interface/xsm/acm.h | 235 +++++++++
- include/xen/interface/xsm/acm_ops.h | 159 ++++++
- include/xen/interface/xsm/flask_op.h | 45 +
- 33 files changed, 5677 insertions(+)
-
---- /dev/null
-+++ b/include/xen/interface/COPYING
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/COPYING 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,38 @@
+XEN NOTICE
+==========
@@ -80,8 +44,8 @@ Acked-by: jbeulich@novell.com
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
---- /dev/null
-+++ b/include/xen/interface/arch-x86/cpuid.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86/cpuid.h 2008-01-21 11:15:27.000000000 +0100
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * arch-x86/cpuid.h
@@ -151,8 +115,8 @@ Acked-by: jbeulich@novell.com
+#define XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD (1u<<0)
+
+#endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */
---- /dev/null
-+++ b/include/xen/interface/arch-x86/hvm/save.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86/hvm/save.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,438 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
@@ -592,8 +556,8 @@ Acked-by: jbeulich@novell.com
+#define HVM_SAVE_CODE_MAX 15
+
+#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
---- /dev/null
-+++ b/include/xen/interface/arch-x86/xen-mca.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86/xen-mca.h 2009-05-19 09:16:41.000000000 +0200
@@ -0,0 +1,422 @@
+/******************************************************************************
+ * arch-x86/mca.h
@@ -1017,8 +981,8 @@ Acked-by: jbeulich@novell.com
+#endif /* __ASSEMBLY__ */
+
+#endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */
---- /dev/null
-+++ b/include/xen/interface/arch-x86/xen-x86_32.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86/xen-x86_32.h 2008-07-21 11:00:33.000000000 +0200
@@ -0,0 +1,180 @@
+/******************************************************************************
+ * xen-x86_32.h
@@ -1200,8 +1164,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/arch-x86/xen-x86_64.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86/xen-x86_64.h 2008-04-02 12:34:02.000000000 +0200
@@ -0,0 +1,212 @@
+/******************************************************************************
+ * xen-x86_64.h
@@ -1415,8 +1379,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/arch-x86/xen.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86/xen.h 2009-05-19 09:16:41.000000000 +0200
@@ -0,0 +1,200 @@
+/******************************************************************************
+ * arch-x86/xen.h
@@ -1618,8 +1582,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/arch-x86_32.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86_32.h 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * arch-x86_32.h
@@ -1648,8 +1612,8 @@ Acked-by: jbeulich@novell.com
+ */
+
+#include "arch-x86/xen.h"
---- /dev/null
-+++ b/include/xen/interface/arch-x86_64.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/arch-x86_64.h 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * arch-x86_64.h
@@ -1678,8 +1642,8 @@ Acked-by: jbeulich@novell.com
+ */
+
+#include "arch-x86/xen.h"
---- /dev/null
-+++ b/include/xen/interface/dom0_ops.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/dom0_ops.h 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,120 @@
+/******************************************************************************
+ * dom0_ops.h
@@ -1801,8 +1765,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/domctl.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/domctl.h 2009-05-19 09:16:41.000000000 +0200
@@ -0,0 +1,710 @@
+/******************************************************************************
+ * domctl.h
@@ -2514,8 +2478,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/hvm/e820.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/hvm/e820.h 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,34 @@
+
+/*
@@ -2551,8 +2515,8 @@ Acked-by: jbeulich@novell.com
+#define HVM_BELOW_4G_MMIO_LENGTH ((1ULL << 32) - HVM_BELOW_4G_MMIO_START)
+
+#endif /* __XEN_PUBLIC_HVM_E820_H__ */
---- /dev/null
-+++ b/include/xen/interface/hvm/hvm_info_table.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/hvm/hvm_info_table.h 2009-04-07 13:58:49.000000000 +0200
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * hvm/hvm_info_table.h
@@ -2623,8 +2587,8 @@ Acked-by: jbeulich@novell.com
+};
+
+#endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */
---- /dev/null
-+++ b/include/xen/interface/hvm/hvm_op.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/hvm/hvm_op.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,133 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2759,8 +2723,8 @@ Acked-by: jbeulich@novell.com
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
+#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
---- /dev/null
-+++ b/include/xen/interface/hvm/ioreq.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/hvm/ioreq.h 2008-04-02 12:34:02.000000000 +0200
@@ -0,0 +1,127 @@
+/*
+ * ioreq.h: I/O request definitions for device models
@@ -2889,8 +2853,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/hvm/params.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/hvm/params.h 2009-04-07 13:58:49.000000000 +0200
@@ -0,0 +1,111 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -3003,8 +2967,8 @@ Acked-by: jbeulich@novell.com
+#define HVM_NR_PARAMS 17
+
+#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
---- /dev/null
-+++ b/include/xen/interface/hvm/save.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/hvm/save.h 2008-04-02 12:34:02.000000000 +0200
@@ -0,0 +1,88 @@
+/*
+ * hvm/save.h
@@ -3094,8 +3058,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
+#endif /* __XEN_PUBLIC_HVM_SAVE_H__ */
---- /dev/null
-+++ b/include/xen/interface/io/fsif.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/io/fsif.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,192 @@
+/******************************************************************************
+ * fsif.h
@@ -3289,8 +3253,8 @@ Acked-by: jbeulich@novell.com
+
+
+#endif
---- /dev/null
-+++ b/include/xen/interface/io/pciif.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/io/pciif.h 2009-04-07 13:58:49.000000000 +0200
@@ -0,0 +1,124 @@
+/*
+ * PCI Backend/Frontend Common Data Structures & Macros
@@ -3416,8 +3380,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/io/tpmif.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/io/tpmif.h 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * tpmif.h
@@ -3496,8 +3460,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/io/usbif.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/io/usbif.h 2009-10-15 11:45:41.000000000 +0200
@@ -0,0 +1,151 @@
+/*
+ * usbif.h
@@ -3650,8 +3614,8 @@ Acked-by: jbeulich@novell.com
+#define USB_CONN_RING_SIZE __RING_SIZE((struct usbif_conn_sring *)0, PAGE_SIZE)
+
+#endif /* __XEN_PUBLIC_IO_USBIF_H__ */
---- /dev/null
-+++ b/include/xen/interface/io/vscsiif.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/io/vscsiif.h 2008-07-21 11:00:33.000000000 +0200
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * vscsiif.h
@@ -3758,8 +3722,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/kexec.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/kexec.h 2008-11-25 12:22:34.000000000 +0100
@@ -0,0 +1,168 @@
+/******************************************************************************
+ * kexec.h - Public portion
@@ -3929,8 +3893,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/nmi.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/nmi.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * nmi.h
@@ -4012,8 +3976,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/platform.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/platform.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,346 @@
+/******************************************************************************
+ * platform.h
@@ -4361,8 +4325,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/sysctl.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/sysctl.h 2009-05-19 09:16:41.000000000 +0200
@@ -0,0 +1,490 @@
+/******************************************************************************
+ * sysctl.h
@@ -4854,8 +4818,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/tmem.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/tmem.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * tmem.h
@@ -4968,8 +4932,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/trace.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/trace.h 2009-06-23 09:28:21.000000000 +0200
@@ -0,0 +1,208 @@
+/******************************************************************************
+ * include/public/trace.h
@@ -5179,8 +5143,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/xen-compat.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/xen-compat.h 2008-09-01 12:07:31.000000000 +0200
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * xen-compat.h
@@ -5226,8 +5190,8 @@ Acked-by: jbeulich@novell.com
+#endif
+
+#endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
---- /dev/null
-+++ b/include/xen/interface/xenoprof.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/xenoprof.h 2007-06-12 13:14:19.000000000 +0200
@@ -0,0 +1,138 @@
+/******************************************************************************
+ * xenoprof.h
@@ -5367,8 +5331,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/xsm/acm.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/xsm/acm.h 2008-07-21 11:00:33.000000000 +0200
@@ -0,0 +1,235 @@
+/*
+ * acm.h: Xen access control module interface defintions
@@ -5605,8 +5569,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/xsm/acm_ops.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/xsm/acm_ops.h 2007-10-22 13:39:15.000000000 +0200
@@ -0,0 +1,159 @@
+/*
+ * acm_ops.h: Xen access control module hypervisor commands
@@ -5767,8 +5731,8 @@ Acked-by: jbeulich@novell.com
+ * indent-tabs-mode: nil
+ * End:
+ */
---- /dev/null
-+++ b/include/xen/interface/xsm/flask_op.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/include/xen/interface/xsm/flask_op.h 2008-09-01 12:07:31.000000000 +0200
@@ -0,0 +1,45 @@
+/*
+ * This file contains the flask_op hypercall commands and definitions.
diff --git a/patches.xen/xen3-auto-xen-arch.diff b/patches.xen/xen3-auto-xen-arch.diff
index b59288979f..f8cc4f3d27 100644
--- a/patches.xen/xen3-auto-xen-arch.diff
+++ b/patches.xen/xen3-auto-xen-arch.diff
@@ -1,5 +1,5 @@
Subject: xen3 xen-arch
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 938:cd453b4804b9)
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 941:9348c4535655)
Patch-mainline: obsolete
Acked-by: jbeulich@novell.com
@@ -119,8582 +119,8 @@ for reference, prefixed with the version the removal occured):
2.6.31/arch/x86/kernel/init_task-xen.c
2.6.32/arch/x86/include/mach-xen/asm/setup_arch.h
----
- arch/x86/ia32/ia32entry-xen.S | 666 ++++
- arch/x86/include/mach-xen/asm/agp.h | 44
- arch/x86/include/mach-xen/asm/desc_32.h | 166 +
- arch/x86/include/mach-xen/asm/desc_64.h | 265 +
- arch/x86/include/mach-xen/asm/fixmap_32.h | 155 +
- arch/x86/include/mach-xen/asm/fixmap_64.h | 112
- arch/x86/include/mach-xen/asm/gnttab_dma.h | 41
- arch/x86/include/mach-xen/asm/highmem.h | 97
- arch/x86/include/mach-xen/asm/hypercall_32.h | 415 ++
- arch/x86/include/mach-xen/asm/hypercall_64.h | 422 +++
- arch/x86/include/mach-xen/asm/hypervisor.h | 263 +
- arch/x86/include/mach-xen/asm/irqflags_32.h | 127
- arch/x86/include/mach-xen/asm/irqflags_64.h | 139
- arch/x86/include/mach-xen/asm/mach_traps.h | 33
- arch/x86/include/mach-xen/asm/maddr_32.h | 193 +
- arch/x86/include/mach-xen/asm/maddr_64.h | 161 +
- arch/x86/include/mach-xen/asm/mmu_context_32.h | 108
- arch/x86/include/mach-xen/asm/mmu_context_64.h | 136
- arch/x86/include/mach-xen/asm/pgalloc_32.h | 59
- arch/x86/include/mach-xen/asm/pgalloc_64.h | 204 +
- arch/x86/include/mach-xen/asm/pgtable-3level-defs.h | 24
- arch/x86/include/mach-xen/asm/pgtable-3level.h | 211 +
- arch/x86/include/mach-xen/asm/pgtable_32.h | 550 +++
- arch/x86/include/mach-xen/asm/pgtable_64.h | 585 ++++
- arch/x86/include/mach-xen/asm/processor_32.h | 743 +++++
- arch/x86/include/mach-xen/asm/processor_64.h | 502 +++
- arch/x86/include/mach-xen/asm/smp_32.h | 103
- arch/x86/include/mach-xen/asm/smp_64.h | 150 +
- arch/x86/include/mach-xen/asm/synch_bitops.h | 126
- arch/x86/include/mach-xen/asm/system_32.h | 488 +++
- arch/x86/include/mach-xen/asm/system_64.h | 256 +
- arch/x86/include/mach-xen/asm/tlbflush_32.h | 101
- arch/x86/include/mach-xen/asm/tlbflush_64.h | 103
- arch/x86/include/mach-xen/asm/vga.h | 20
- arch/x86/include/mach-xen/asm/xenoprof.h | 48
- arch/x86/include/mach-xen/asm/xor_64.h | 328 ++
- arch/x86/include/mach-xen/irq_vectors.h | 125
- arch/x86/include/mach-xen/setup_arch_post.h | 63
- arch/x86/include/mach-xen/setup_arch_pre.h | 5
- arch/x86/kernel/acpi/processor_extcntl_xen.c | 206 +
- arch/x86/kernel/acpi/sleep_32-xen.c | 113
- arch/x86/kernel/acpi/sleep_64-xen.c | 146 +
- arch/x86/kernel/apic_32-xen.c | 155 +
- arch/x86/kernel/apic_64-xen.c | 197 +
- arch/x86/kernel/cpu/common-xen.c | 745 +++++
- arch/x86/kernel/cpu/mcheck/mce_dom0.c | 134
- arch/x86/kernel/cpu/mtrr/main-xen.c | 198 +
- arch/x86/kernel/e820_64-xen.c | 798 +++++
- arch/x86/kernel/early_printk-xen.c | 302 ++
- arch/x86/kernel/entry_32-xen.S | 1242 ++++++++
- arch/x86/kernel/entry_64-xen.S | 1317 +++++++++
- arch/x86/kernel/fixup.c | 88
- arch/x86/kernel/head64-xen.c | 162 +
- arch/x86/kernel/head_32-xen.S | 207 +
- arch/x86/kernel/head_64-xen.S | 211 +
- arch/x86/kernel/io_apic_32-xen.c | 2786 ++++++++++++++++++++
- arch/x86/kernel/io_apic_64-xen.c | 2270 ++++++++++++++++
- arch/x86/kernel/ioport_32-xen.c | 123
- arch/x86/kernel/ioport_64-xen.c | 100
- arch/x86/kernel/irq_32-xen.c | 324 ++
- arch/x86/kernel/irq_64-xen.c | 197 +
- arch/x86/kernel/ldt_32-xen.c | 270 +
- arch/x86/kernel/ldt_64-xen.c | 282 ++
- arch/x86/kernel/microcode-xen.c | 144 +
- arch/x86/kernel/mpparse_32-xen.c | 1185 ++++++++
- arch/x86/kernel/mpparse_64-xen.c | 1011 +++++++
- arch/x86/kernel/pci-dma-xen.c | 409 ++
- arch/x86/kernel/process_32-xen.c | 877 ++++++
- arch/x86/kernel/process_64-xen.c | 848 ++++++
- arch/x86/kernel/quirks-xen.c | 47
- arch/x86/kernel/setup64-xen.c | 367 ++
- arch/x86/kernel/setup_32-xen.c | 1919 +++++++++++++
- arch/x86/kernel/setup_64-xen.c | 1656 +++++++++++
- arch/x86/kernel/smp_32-xen.c | 605 ++++
- arch/x86/kernel/smp_64-xen.c | 575 ++++
- arch/x86/kernel/time-xen.c | 1211 ++++++++
- arch/x86/kernel/traps_32-xen.c | 1190 ++++++++
- arch/x86/kernel/traps_64-xen.c | 1173 ++++++++
- arch/x86/kernel/vsyscall_64-xen.c | 227 +
- arch/x86/kernel/xen_entry_64.S | 36
- arch/x86/lib/scrub.c | 21
- arch/x86/mach-xen/Makefile | 5
- arch/x86/mach-xen/setup.c | 158 +
- arch/x86/mm/fault_32-xen.c | 779 +++++
- arch/x86/mm/fault_64-xen.c | 724 +++++
- arch/x86/mm/highmem_32-xen.c | 183 +
- arch/x86/mm/hypervisor.c | 579 ++++
- arch/x86/mm/init_32-xen.c | 840 ++++++
- arch/x86/mm/init_64-xen.c | 1231 ++++++++
- arch/x86/mm/ioremap_32-xen.c | 443 +++
- arch/x86/mm/pageattr_64-xen.c | 508 +++
- arch/x86/mm/pgtable_32-xen.c | 731 +++++
- arch/x86/oprofile/xenoprof.c | 179 +
- arch/x86/pci/irq-xen.c | 1211 ++++++++
- arch/x86/pci/pcifront.c | 57
- drivers/pci/msi-xen.c | 890 ++++++
- include/xen/balloon.h | 57
- include/xen/blkif.h | 123
- include/xen/compat_ioctl.h | 45
- include/xen/cpu_hotplug.h | 41
- include/xen/driver_util.h | 14
- include/xen/firmware.h | 10
- include/xen/gnttab.h | 164 +
- include/xen/hvm.h | 23
- include/xen/hypercall.h | 30
- include/xen/hypervisor_sysfs.h | 30
- include/xen/pcifront.h | 83
- include/xen/public/evtchn.h | 88
- include/xen/public/gntdev.h | 119
- include/xen/public/privcmd.h | 79
- include/xen/public/xenbus.h | 56
- include/xen/xen_proc.h | 12
- include/xen/xencons.h | 17
- include/xen/xenoprof.h | 42
- lib/swiotlb-xen.c | 739 +++++
- mm/tmem-xen.c | 41
- scripts/Makefile.xen.awk | 34
- 117 files changed, 44776 insertions(+)
-
---- /dev/null
-+++ b/arch/x86/ia32/ia32entry-xen.S
-@@ -0,0 +1,666 @@
-+/*
-+ * Compatibility mode system call entry point for x86-64.
-+ *
-+ * Copyright 2000-2002 Andi Kleen, SuSE Labs.
-+ */
-+
-+#include <asm/dwarf2.h>
-+#include <asm/calling.h>
-+#include <asm/asm-offsets.h>
-+#include <asm/current.h>
-+#include <asm/errno.h>
-+#include <asm/ia32_unistd.h>
-+#include <asm/thread_info.h>
-+#include <asm/segment.h>
-+#include <asm/vsyscall32.h>
-+#include <asm/irqflags.h>
-+#include <linux/linkage.h>
-+
-+#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
-+
-+ .macro IA32_ARG_FIXUP noebp=0
-+ movl %edi,%r8d
-+ .if \noebp
-+ .else
-+ movl %ebp,%r9d
-+ .endif
-+ xchg %ecx,%esi
-+ movl %ebx,%edi
-+ movl %edx,%edx /* zero extension */
-+ .endm
-+
-+ /* clobbers %eax */
-+ .macro CLEAR_RREGS
-+ xorl %eax,%eax
-+ movq %rax,R11(%rsp)
-+ movq %rax,R10(%rsp)
-+ movq %rax,R9(%rsp)
-+ movq %rax,R8(%rsp)
-+ .endm
-+
-+ .macro LOAD_ARGS32 offset
-+ movl \offset(%rsp),%r11d
-+ movl \offset+8(%rsp),%r10d
-+ movl \offset+16(%rsp),%r9d
-+ movl \offset+24(%rsp),%r8d
-+ movl \offset+40(%rsp),%ecx
-+ movl \offset+48(%rsp),%edx
-+ movl \offset+56(%rsp),%esi
-+ movl \offset+64(%rsp),%edi
-+ movl \offset+72(%rsp),%eax
-+ .endm
-+
-+ .macro CFI_STARTPROC32 simple
-+ CFI_STARTPROC \simple
-+ CFI_UNDEFINED r8
-+ CFI_UNDEFINED r9
-+ CFI_UNDEFINED r10
-+ CFI_UNDEFINED r11
-+ CFI_UNDEFINED r12
-+ CFI_UNDEFINED r13
-+ CFI_UNDEFINED r14
-+ CFI_UNDEFINED r15
-+ .endm
-+
-+/*
-+ * 32bit SYSENTER instruction entry.
-+ *
-+ * Arguments:
-+ * %eax System call number.
-+ * %ebx Arg1
-+ * %ecx Arg2
-+ * %edx Arg3
-+ * %esi Arg4
-+ * %edi Arg5
-+ * %ebp user stack
-+ * 0(%ebp) Arg6
-+ *
-+ * Interrupts on.
-+ *
-+ * This is purely a fast path. For anything complicated we use the int 0x80
-+ * path below. Set up a complete hardware stack frame to share code
-+ * with the int 0x80 path.
-+ */
-+ENTRY(ia32_sysenter_target)
-+ CFI_STARTPROC32 simple
-+ CFI_DEF_CFA rsp,SS+8-RIP+16
-+ /*CFI_REL_OFFSET ss,SS-RIP+16*/
-+ CFI_REL_OFFSET rsp,RSP-RIP+16
-+ /*CFI_REL_OFFSET rflags,EFLAGS-RIP+16*/
-+ /*CFI_REL_OFFSET cs,CS-RIP+16*/
-+ CFI_REL_OFFSET rip,RIP-RIP+16
-+ CFI_REL_OFFSET r11,8
-+ CFI_REL_OFFSET rcx,0
-+ movq 8(%rsp),%r11
-+ CFI_RESTORE r11
-+ popq %rcx
-+ CFI_ADJUST_CFA_OFFSET -8
-+ CFI_RESTORE rcx
-+ movl %ebp,%ebp /* zero extension */
-+ movl %eax,%eax
-+ movl $__USER32_DS,40(%rsp)
-+ movq %rbp,32(%rsp)
-+ movl $__USER32_CS,16(%rsp)
-+ movl $VSYSCALL32_SYSEXIT,8(%rsp)
-+ movq %rax,(%rsp)
-+ cld
-+ SAVE_ARGS 0,0,0
-+ /* no need to do an access_ok check here because rbp has been
-+ 32bit zero extended */
-+1: movl (%rbp),%r9d
-+ .section __ex_table,"a"
-+ .quad 1b,ia32_badarg
-+ .previous
-+ GET_THREAD_INFO(%r10)
-+ orl $TS_COMPAT,threadinfo_status(%r10)
-+ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10)
-+ jnz sysenter_tracesys
-+sysenter_do_call:
-+ cmpl $(IA32_NR_syscalls-1),%eax
-+ ja ia32_badsys
-+ IA32_ARG_FIXUP 1
-+ call *ia32_sys_call_table(,%rax,8)
-+ movq %rax,RAX-ARGOFFSET(%rsp)
-+ jmp int_ret_from_sys_call
-+
-+sysenter_tracesys:
-+ SAVE_REST
-+ CLEAR_RREGS
-+ movq $-ENOSYS,RAX(%rsp) /* really needed? */
-+ movq %rsp,%rdi /* &pt_regs -> arg1 */
-+ call syscall_trace_enter
-+ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
-+ RESTORE_REST
-+ movl %ebp, %ebp
-+ /* no need to do an access_ok check here because rbp has been
-+ 32bit zero extended */
-+1: movl (%rbp),%r9d
-+ .section __ex_table,"a"
-+ .quad 1b,ia32_badarg
-+ .previous
-+ jmp sysenter_do_call
-+ CFI_ENDPROC
-+ENDPROC(ia32_sysenter_target)
-+
-+/*
-+ * 32bit SYSCALL instruction entry.
-+ *
-+ * Arguments:
-+ * %eax System call number.
-+ * %ebx Arg1
-+ * %ecx return EIP
-+ * %edx Arg3
-+ * %esi Arg4
-+ * %edi Arg5
-+ * %ebp Arg2 [note: not saved in the stack frame, should not be touched]
-+ * %esp user stack
-+ * 0(%esp) Arg6
-+ *
-+ * Interrupts on.
-+ *
-+ * This is purely a fast path. For anything complicated we use the int 0x80
-+ * path below. Set up a complete hardware stack frame to share code
-+ * with the int 0x80 path.
-+ */
-+ENTRY(ia32_cstar_target)
-+ CFI_STARTPROC32 simple
-+ CFI_DEF_CFA rsp,SS+8-RIP+16
-+ /*CFI_REL_OFFSET ss,SS-RIP+16*/
-+ CFI_REL_OFFSET rsp,RSP-RIP+16
-+ /*CFI_REL_OFFSET rflags,EFLAGS-RIP+16*/
-+ /*CFI_REL_OFFSET cs,CS-RIP+16*/
-+ CFI_REL_OFFSET rip,RIP-RIP+16
-+ movl %eax,%eax /* zero extension */
-+ movl RSP-RIP+16(%rsp),%r8d
-+ SAVE_ARGS -8,1,1
-+ movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
-+ movq %rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */
-+ movl %ebp,%ecx
-+ movl $__USER32_CS,CS-ARGOFFSET(%rsp)
-+ movl $__USER32_DS,SS-ARGOFFSET(%rsp)
-+ /* no need to do an access_ok check here because r8 has been
-+ 32bit zero extended */
-+ /* hardware stack frame is complete now */
-+1: movl (%r8),%r9d
-+ .section __ex_table,"a"
-+ .quad 1b,ia32_badarg
-+ .previous
-+ GET_THREAD_INFO(%r10)
-+ orl $TS_COMPAT,threadinfo_status(%r10)
-+ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10)
-+ jnz cstar_tracesys
-+cstar_do_call:
-+ cmpl $IA32_NR_syscalls-1,%eax
-+ ja ia32_badsys
-+ IA32_ARG_FIXUP 1
-+ call *ia32_sys_call_table(,%rax,8)
-+ movq %rax,RAX-ARGOFFSET(%rsp)
-+ jmp int_ret_from_sys_call
-+
-+cstar_tracesys:
-+ SAVE_REST
-+ CLEAR_RREGS
-+ movq $-ENOSYS,RAX(%rsp) /* really needed? */
-+ movq %rsp,%rdi /* &pt_regs -> arg1 */
-+ call syscall_trace_enter
-+ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
-+ RESTORE_REST
-+ movl RSP-ARGOFFSET(%rsp), %r8d
-+ /* no need to do an access_ok check here because r8 has been
-+ 32bit zero extended */
-+1: movl (%r8),%r9d
-+ .section __ex_table,"a"
-+ .quad 1b,ia32_badarg
-+ .previous
-+ jmp cstar_do_call
-+END(ia32_cstar_target)
-+
-+ia32_badarg:
-+ movq $-EFAULT,%rax
-+ jmp ia32_sysret
-+ CFI_ENDPROC
-+
-+/*
-+ * Emulated IA32 system calls via int 0x80.
-+ *
-+ * Arguments:
-+ * %eax System call number.
-+ * %ebx Arg1
-+ * %ecx Arg2
-+ * %edx Arg3
-+ * %esi Arg4
-+ * %edi Arg5
-+ * %ebp Arg6 [note: not saved in the stack frame, should not be touched]
-+ *
-+ * Notes:
-+ * Uses the same stack frame as the x86-64 version.
-+ * All registers except %eax must be saved (but ptrace may violate that)
-+ * Arguments are zero extended. For system calls that want sign extension and
-+ * take long arguments a wrapper is needed. Most calls can just be called
-+ * directly.
-+ * Assumes it is only called from user space and entered with interrupts on.
-+ */
-+
-+ENTRY(ia32_syscall)
-+ CFI_STARTPROC simple
-+ CFI_DEF_CFA rsp,SS+8-RIP+16
-+ /*CFI_REL_OFFSET ss,SS-RIP+16*/
-+ CFI_REL_OFFSET rsp,RSP-RIP+16
-+ /*CFI_REL_OFFSET rflags,EFLAGS-RIP+16*/
-+ /*CFI_REL_OFFSET cs,CS-RIP+16*/
-+ CFI_REL_OFFSET rip,RIP-RIP+16
-+ CFI_REL_OFFSET r11,8
-+ CFI_REL_OFFSET rcx,0
-+ movq 8(%rsp),%r11
-+ CFI_RESTORE r11
-+ popq %rcx
-+ CFI_ADJUST_CFA_OFFSET -8
-+ CFI_RESTORE rcx
-+ movl %eax,%eax
-+ movq %rax,(%rsp)
-+ cld
-+ /* note the registers are not zero extended to the sf.
-+ this could be a problem. */
-+ SAVE_ARGS 0,0,1
-+ GET_THREAD_INFO(%r10)
-+ orl $TS_COMPAT,threadinfo_status(%r10)
-+ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10)
-+ jnz ia32_tracesys
-+ia32_do_syscall:
-+ cmpl $(IA32_NR_syscalls-1),%eax
-+ ja ia32_badsys
-+ IA32_ARG_FIXUP
-+ call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
-+ia32_sysret:
-+ movq %rax,RAX-ARGOFFSET(%rsp)
-+ jmp int_ret_from_sys_call
-+
-+ia32_tracesys:
-+ SAVE_REST
-+ movq $-ENOSYS,RAX(%rsp) /* really needed? */
-+ movq %rsp,%rdi /* &pt_regs -> arg1 */
-+ call syscall_trace_enter
-+ LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
-+ RESTORE_REST
-+ jmp ia32_do_syscall
-+END(ia32_syscall)
-+
-+ia32_badsys:
-+ movq $0,ORIG_RAX-ARGOFFSET(%rsp)
-+ movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
-+ jmp int_ret_from_sys_call
-+
-+quiet_ni_syscall:
-+ movq $-ENOSYS,%rax
-+ ret
-+ CFI_ENDPROC
-+
-+ .macro PTREGSCALL label, func, arg
-+ .globl \label
-+\label:
-+ leaq \func(%rip),%rax
-+ leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
-+ jmp ia32_ptregs_common
-+ .endm
-+
-+ CFI_STARTPROC32
-+
-+ PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
-+ PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
-+ PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
-+ PTREGSCALL stub32_sigsuspend, sys32_sigsuspend, %rcx
-+ PTREGSCALL stub32_execve, sys32_execve, %rcx
-+ PTREGSCALL stub32_fork, sys_fork, %rdi
-+ PTREGSCALL stub32_clone, sys32_clone, %rdx
-+ PTREGSCALL stub32_vfork, sys_vfork, %rdi
-+ PTREGSCALL stub32_iopl, sys_iopl, %rsi
-+ PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend, %rdx
-+
-+ENTRY(ia32_ptregs_common)
-+ popq %r11
-+ CFI_ENDPROC
-+ CFI_STARTPROC32 simple
-+ CFI_DEF_CFA rsp,SS+8-ARGOFFSET
-+ CFI_REL_OFFSET rax,RAX-ARGOFFSET
-+ CFI_REL_OFFSET rcx,RCX-ARGOFFSET
-+ CFI_REL_OFFSET rdx,RDX-ARGOFFSET
-+ CFI_REL_OFFSET rsi,RSI-ARGOFFSET
-+ CFI_REL_OFFSET rdi,RDI-ARGOFFSET
-+ CFI_REL_OFFSET rip,RIP-ARGOFFSET
-+/* CFI_REL_OFFSET cs,CS-ARGOFFSET*/
-+/* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
-+ CFI_REL_OFFSET rsp,RSP-ARGOFFSET
-+/* CFI_REL_OFFSET ss,SS-ARGOFFSET*/
-+ SAVE_REST
-+ call *%rax
-+ RESTORE_REST
-+ jmp ia32_sysret /* misbalances the return cache */
-+ CFI_ENDPROC
-+END(ia32_ptregs_common)
-+
-+ .section .rodata,"a"
-+ .align 8
-+ia32_sys_call_table:
-+ .quad sys_restart_syscall
-+ .quad sys_exit
-+ .quad stub32_fork
-+ .quad sys_read
-+ .quad sys_write
-+ .quad compat_sys_open /* 5 */
-+ .quad sys_close
-+ .quad sys32_waitpid
-+ .quad sys_creat
-+ .quad sys_link
-+ .quad sys_unlink /* 10 */
-+ .quad stub32_execve
-+ .quad sys_chdir
-+ .quad compat_sys_time
-+ .quad sys_mknod
-+ .quad sys_chmod /* 15 */
-+ .quad sys_lchown16
-+ .quad quiet_ni_syscall /* old break syscall holder */
-+ .quad sys_stat
-+ .quad sys32_lseek
-+ .quad sys_getpid /* 20 */
-+ .quad compat_sys_mount /* mount */
-+ .quad sys_oldumount /* old_umount */
-+ .quad sys_setuid16
-+ .quad sys_getuid16
-+ .quad compat_sys_stime /* stime */ /* 25 */
-+ .quad sys32_ptrace /* ptrace */
-+ .quad sys_alarm
-+ .quad sys_fstat /* (old)fstat */
-+ .quad sys_pause
-+ .quad compat_sys_utime /* 30 */
-+ .quad quiet_ni_syscall /* old stty syscall holder */
-+ .quad quiet_ni_syscall /* old gtty syscall holder */
-+ .quad sys_access
-+ .quad sys_nice
-+ .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */
-+ .quad sys_sync
-+ .quad sys32_kill
-+ .quad sys_rename
-+ .quad sys_mkdir
-+ .quad sys_rmdir /* 40 */
-+ .quad sys_dup
-+ .quad sys32_pipe
-+ .quad compat_sys_times
-+ .quad quiet_ni_syscall /* old prof syscall holder */
-+ .quad sys_brk /* 45 */
-+ .quad sys_setgid16
-+ .quad sys_getgid16
-+ .quad sys_signal
-+ .quad sys_geteuid16
-+ .quad sys_getegid16 /* 50 */
-+ .quad sys_acct
-+ .quad sys_umount /* new_umount */
-+ .quad quiet_ni_syscall /* old lock syscall holder */
-+ .quad compat_sys_ioctl
-+ .quad compat_sys_fcntl64 /* 55 */
-+ .quad quiet_ni_syscall /* old mpx syscall holder */
-+ .quad sys_setpgid
-+ .quad quiet_ni_syscall /* old ulimit syscall holder */
-+ .quad sys32_olduname
-+ .quad sys_umask /* 60 */
-+ .quad sys_chroot
-+ .quad sys32_ustat
-+ .quad sys_dup2
-+ .quad sys_getppid
-+ .quad sys_getpgrp /* 65 */
-+ .quad sys_setsid
-+ .quad sys32_sigaction
-+ .quad sys_sgetmask
-+ .quad sys_ssetmask
-+ .quad sys_setreuid16 /* 70 */
-+ .quad sys_setregid16
-+ .quad stub32_sigsuspend
-+ .quad compat_sys_sigpending
-+ .quad sys_sethostname
-+ .quad compat_sys_setrlimit /* 75 */
-+ .quad compat_sys_old_getrlimit /* old_getrlimit */
-+ .quad compat_sys_getrusage
-+ .quad sys32_gettimeofday
-+ .quad sys32_settimeofday
-+ .quad sys_getgroups16 /* 80 */
-+ .quad sys_setgroups16
-+ .quad sys32_old_select
-+ .quad sys_symlink
-+ .quad sys_lstat
-+ .quad sys_readlink /* 85 */
-+#ifdef CONFIG_IA32_AOUT
-+ .quad sys_uselib
-+#else
-+ .quad quiet_ni_syscall
-+#endif
-+ .quad sys_swapon
-+ .quad sys_reboot
-+ .quad compat_sys_old_readdir
-+ .quad sys32_mmap /* 90 */
-+ .quad sys_munmap
-+ .quad sys_truncate
-+ .quad sys_ftruncate
-+ .quad sys_fchmod
-+ .quad sys_fchown16 /* 95 */
-+ .quad sys_getpriority
-+ .quad sys_setpriority
-+ .quad quiet_ni_syscall /* old profil syscall holder */
-+ .quad compat_sys_statfs
-+ .quad compat_sys_fstatfs /* 100 */
-+ .quad sys_ioperm
-+ .quad compat_sys_socketcall
-+ .quad sys_syslog
-+ .quad compat_sys_setitimer
-+ .quad compat_sys_getitimer /* 105 */
-+ .quad compat_sys_newstat
-+ .quad compat_sys_newlstat
-+ .quad compat_sys_newfstat
-+ .quad sys32_uname
-+ .quad stub32_iopl /* 110 */
-+ .quad sys_vhangup
-+ .quad quiet_ni_syscall /* old "idle" system call */
-+ .quad sys32_vm86_warning /* vm86old */
-+ .quad compat_sys_wait4
-+ .quad sys_swapoff /* 115 */
-+ .quad sys32_sysinfo
-+ .quad sys32_ipc
-+ .quad sys_fsync
-+ .quad stub32_sigreturn
-+ .quad stub32_clone /* 120 */
-+ .quad sys_setdomainname
-+ .quad sys_uname
-+ .quad sys_modify_ldt
-+ .quad compat_sys_adjtimex
-+ .quad sys32_mprotect /* 125 */
-+ .quad compat_sys_sigprocmask
-+ .quad quiet_ni_syscall /* create_module */
-+ .quad sys_init_module
-+ .quad sys_delete_module
-+ .quad quiet_ni_syscall /* 130 get_kernel_syms */
-+ .quad sys_quotactl
-+ .quad sys_getpgid
-+ .quad sys_fchdir
-+ .quad quiet_ni_syscall /* bdflush */
-+ .quad sys_sysfs /* 135 */
-+ .quad sys_personality
-+ .quad quiet_ni_syscall /* for afs_syscall */
-+ .quad sys_setfsuid16
-+ .quad sys_setfsgid16
-+ .quad sys_llseek /* 140 */
-+ .quad compat_sys_getdents
-+ .quad compat_sys_select
-+ .quad sys_flock
-+ .quad sys_msync
-+ .quad compat_sys_readv /* 145 */
-+ .quad compat_sys_writev
-+ .quad sys_getsid
-+ .quad sys_fdatasync
-+ .quad sys32_sysctl /* sysctl */
-+ .quad sys_mlock /* 150 */
-+ .quad sys_munlock
-+ .quad sys_mlockall
-+ .quad sys_munlockall
-+ .quad sys_sched_setparam
-+ .quad sys_sched_getparam /* 155 */
-+ .quad sys_sched_setscheduler
-+ .quad sys_sched_getscheduler
-+ .quad sys_sched_yield
-+ .quad sys_sched_get_priority_max
-+ .quad sys_sched_get_priority_min /* 160 */
-+ .quad sys_sched_rr_get_interval
-+ .quad compat_sys_nanosleep
-+ .quad sys_mremap
-+ .quad sys_setresuid16
-+ .quad sys_getresuid16 /* 165 */
-+ .quad sys32_vm86_warning /* vm86 */
-+ .quad quiet_ni_syscall /* query_module */
-+ .quad sys_poll
-+ .quad compat_sys_nfsservctl
-+ .quad sys_setresgid16 /* 170 */
-+ .quad sys_getresgid16
-+ .quad sys_prctl
-+ .quad stub32_rt_sigreturn
-+ .quad sys32_rt_sigaction
-+ .quad sys32_rt_sigprocmask /* 175 */
-+ .quad sys32_rt_sigpending
-+ .quad compat_sys_rt_sigtimedwait
-+ .quad sys32_rt_sigqueueinfo
-+ .quad stub32_rt_sigsuspend
-+ .quad sys32_pread /* 180 */
-+ .quad sys32_pwrite
-+ .quad sys_chown16
-+ .quad sys_getcwd
-+ .quad sys_capget
-+ .quad sys_capset
-+ .quad stub32_sigaltstack
-+ .quad sys32_sendfile
-+ .quad quiet_ni_syscall /* streams1 */
-+ .quad quiet_ni_syscall /* streams2 */
-+ .quad stub32_vfork /* 190 */
-+ .quad compat_sys_getrlimit
-+ .quad sys32_mmap2
-+ .quad sys32_truncate64
-+ .quad sys32_ftruncate64
-+ .quad sys32_stat64 /* 195 */
-+ .quad sys32_lstat64
-+ .quad sys32_fstat64
-+ .quad sys_lchown
-+ .quad sys_getuid
-+ .quad sys_getgid /* 200 */
-+ .quad sys_geteuid
-+ .quad sys_getegid
-+ .quad sys_setreuid
-+ .quad sys_setregid
-+ .quad sys_getgroups /* 205 */
-+ .quad sys_setgroups
-+ .quad sys_fchown
-+ .quad sys_setresuid
-+ .quad sys_getresuid
-+ .quad sys_setresgid /* 210 */
-+ .quad sys_getresgid
-+ .quad sys_chown
-+ .quad sys_setuid
-+ .quad sys_setgid
-+ .quad sys_setfsuid /* 215 */
-+ .quad sys_setfsgid
-+ .quad sys_pivot_root
-+ .quad sys_mincore
-+ .quad sys_madvise
-+ .quad compat_sys_getdents64 /* 220 getdents64 */
-+ .quad compat_sys_fcntl64
-+ .quad quiet_ni_syscall /* tux */
-+ .quad quiet_ni_syscall /* security */
-+ .quad sys_gettid
-+ .quad sys_readahead /* 225 */
-+ .quad sys_setxattr
-+ .quad sys_lsetxattr
-+ .quad sys_fsetxattr
-+ .quad sys_getxattr
-+ .quad sys_lgetxattr /* 230 */
-+ .quad sys_fgetxattr
-+ .quad sys_listxattr
-+ .quad sys_llistxattr
-+ .quad sys_flistxattr
-+ .quad sys_removexattr /* 235 */
-+ .quad sys_lremovexattr
-+ .quad sys_fremovexattr
-+ .quad sys_tkill
-+ .quad sys_sendfile64
-+ .quad compat_sys_futex /* 240 */
-+ .quad compat_sys_sched_setaffinity
-+ .quad compat_sys_sched_getaffinity
-+ .quad sys32_set_thread_area
-+ .quad sys32_get_thread_area
-+ .quad compat_sys_io_setup /* 245 */
-+ .quad sys_io_destroy
-+ .quad compat_sys_io_getevents
-+ .quad compat_sys_io_submit
-+ .quad sys_io_cancel
-+ .quad sys_fadvise64 /* 250 */
-+ .quad quiet_ni_syscall /* free_huge_pages */
-+ .quad sys_exit_group
-+ .quad sys32_lookup_dcookie
-+ .quad sys_epoll_create
-+ .quad sys_epoll_ctl /* 255 */
-+ .quad sys_epoll_wait
-+ .quad sys_remap_file_pages
-+ .quad sys_set_tid_address
-+ .quad compat_sys_timer_create
-+ .quad compat_sys_timer_settime /* 260 */
-+ .quad compat_sys_timer_gettime
-+ .quad sys_timer_getoverrun
-+ .quad sys_timer_delete
-+ .quad compat_sys_clock_settime
-+ .quad compat_sys_clock_gettime /* 265 */
-+ .quad compat_sys_clock_getres
-+ .quad compat_sys_clock_nanosleep
-+ .quad compat_sys_statfs64
-+ .quad compat_sys_fstatfs64
-+ .quad sys_tgkill /* 270 */
-+ .quad compat_sys_utimes
-+ .quad sys32_fadvise64_64
-+ .quad quiet_ni_syscall /* sys_vserver */
-+ .quad sys_mbind
-+ .quad compat_sys_get_mempolicy /* 275 */
-+ .quad sys_set_mempolicy
-+ .quad compat_sys_mq_open
-+ .quad sys_mq_unlink
-+ .quad compat_sys_mq_timedsend
-+ .quad compat_sys_mq_timedreceive /* 280 */
-+ .quad compat_sys_mq_notify
-+ .quad compat_sys_mq_getsetattr
-+ .quad compat_sys_kexec_load /* reserved for kexec */
-+ .quad compat_sys_waitid
-+ .quad quiet_ni_syscall /* 285: sys_altroot */
-+ .quad sys_add_key
-+ .quad sys_request_key
-+ .quad sys_keyctl
-+ .quad sys_ioprio_set
-+ .quad sys_ioprio_get /* 290 */
-+ .quad sys_inotify_init
-+ .quad sys_inotify_add_watch
-+ .quad sys_inotify_rm_watch
-+ .quad sys_migrate_pages
-+ .quad compat_sys_openat /* 295 */
-+ .quad sys_mkdirat
-+ .quad sys_mknodat
-+ .quad sys_fchownat
-+ .quad compat_sys_futimesat
-+ .quad sys32_fstatat /* 300 */
-+ .quad sys_unlinkat
-+ .quad sys_renameat
-+ .quad sys_linkat
-+ .quad sys_symlinkat
-+ .quad sys_readlinkat /* 305 */
-+ .quad sys_fchmodat
-+ .quad sys_faccessat
-+ .quad quiet_ni_syscall /* pselect6 for now */
-+ .quad quiet_ni_syscall /* ppoll for now */
-+ .quad sys_unshare /* 310 */
-+ .quad compat_sys_set_robust_list
-+ .quad compat_sys_get_robust_list
-+ .quad sys_splice
-+ .quad sys_sync_file_range
-+ .quad sys_tee
-+ .quad compat_sys_vmsplice
-+ .quad compat_sys_move_pages
-+ia32_syscall_end:
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/agp.h
-@@ -0,0 +1,44 @@
-+#ifndef AGP_H
-+#define AGP_H 1
-+
-+#include <asm/pgtable.h>
-+#include <asm/cacheflush.h>
-+#include <asm/system.h>
-+
-+/*
-+ * Functions to keep the agpgart mappings coherent with the MMU.
-+ * The GART gives the CPU a physical alias of pages in memory. The alias region is
-+ * mapped uncacheable. Make sure there are no conflicting mappings
-+ * with different cachability attributes for the same page. This avoids
-+ * data corruption on some CPUs.
-+ */
-+
-+/* Caller's responsibility to call global_flush_tlb() for
-+ * performance reasons */
-+#define map_page_into_agp(page) ( \
-+ xen_create_contiguous_region((unsigned long)page_address(page), 0, 32) \
-+ ?: change_page_attr(page, 1, PAGE_KERNEL_NOCACHE))
-+#define unmap_page_from_agp(page) ( \
-+ xen_destroy_contiguous_region((unsigned long)page_address(page), 0), \
-+ /* only a fallback: xen_destroy_contiguous_region uses PAGE_KERNEL */ \
-+ change_page_attr(page, 1, PAGE_KERNEL))
-+#define flush_agp_mappings() global_flush_tlb()
-+
-+/* Could use CLFLUSH here if the cpu supports it. But then it would
-+ need to be called for each cacheline of the whole page so it may not be
-+ worth it. Would need a page for it. */
-+#define flush_agp_cache() wbinvd()
-+
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) phys_to_machine(x)
-+#define gart_to_phys(x) machine_to_phys(x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order) ({ \
-+ char *_t; dma_addr_t _d; \
-+ _t = dma_alloc_coherent(NULL,PAGE_SIZE<<(order),&_d,GFP_KERNEL); \
-+ _t; })
-+#define free_gatt_pages(table, order) \
-+ dma_free_coherent(NULL,PAGE_SIZE<<(order),(table),virt_to_bus(table))
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/desc_32.h
-@@ -0,0 +1,166 @@
-+#ifndef __ARCH_DESC_H
-+#define __ARCH_DESC_H
-+
-+#include <asm/ldt.h>
-+#include <asm/segment.h>
-+
-+#define CPU_16BIT_STACK_SIZE 1024
-+
-+#ifndef __ASSEMBLY__
-+
-+#include <linux/preempt.h>
-+#include <linux/smp.h>
-+
-+#include <asm/mmu.h>
-+
-+extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
-+
-+DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
-+
-+struct Xgt_desc_struct {
-+ unsigned short size;
-+ unsigned long address __attribute__((packed));
-+ unsigned short pad;
-+} __attribute__ ((packed));
-+
-+extern struct Xgt_desc_struct idt_descr;
-+DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr);
-+
-+
-+static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
-+{
-+ return (struct desc_struct *)per_cpu(cpu_gdt_descr, cpu).address;
-+}
-+
-+#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8))
-+#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8))
-+
-+#define load_gdt(dtr) __asm__ __volatile("lgdt %0"::"m" (*dtr))
-+#define load_idt(dtr) __asm__ __volatile("lidt %0"::"m" (*dtr))
-+#define load_tr(tr) __asm__ __volatile("ltr %0"::"mr" (tr))
-+#define load_ldt(ldt) __asm__ __volatile("lldt %0"::"mr" (ldt))
-+
-+#define store_gdt(dtr) __asm__ ("sgdt %0":"=m" (*dtr))
-+#define store_idt(dtr) __asm__ ("sidt %0":"=m" (*dtr))
-+#define store_tr(tr) __asm__ ("str %0":"=mr" (tr))
-+#define store_ldt(ldt) __asm__ ("sldt %0":"=mr" (ldt))
-+
-+/*
-+ * This is the ldt that every process will get unless we need
-+ * something other than this.
-+ */
-+extern struct desc_struct default_ldt[];
-+extern void set_intr_gate(unsigned int irq, void * addr);
-+
-+#define _set_tssldt_desc(n,addr,limit,type) \
-+__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
-+ "movw %w1,2(%2)\n\t" \
-+ "rorl $16,%1\n\t" \
-+ "movb %b1,4(%2)\n\t" \
-+ "movb %4,5(%2)\n\t" \
-+ "movb $0,6(%2)\n\t" \
-+ "movb %h1,7(%2)\n\t" \
-+ "rorl $16,%1" \
-+ : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type))
-+
-+#ifndef CONFIG_X86_NO_TSS
-+static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
-+{
-+ _set_tssldt_desc(&get_cpu_gdt_table(cpu)[entry], (int)addr,
-+ offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89);
-+}
-+
-+#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
-+#endif
-+
-+static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size)
-+{
-+ _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82);
-+}
-+
-+#define LDT_entry_a(info) \
-+ ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
-+
-+#define LDT_entry_b(info) \
-+ (((info)->base_addr & 0xff000000) | \
-+ (((info)->base_addr & 0x00ff0000) >> 16) | \
-+ ((info)->limit & 0xf0000) | \
-+ (((info)->read_exec_only ^ 1) << 9) | \
-+ ((info)->contents << 10) | \
-+ (((info)->seg_not_present ^ 1) << 15) | \
-+ ((info)->seg_32bit << 22) | \
-+ ((info)->limit_in_pages << 23) | \
-+ ((info)->useable << 20) | \
-+ 0x7000)
-+
-+#define LDT_empty(info) (\
-+ (info)->base_addr == 0 && \
-+ (info)->limit == 0 && \
-+ (info)->contents == 0 && \
-+ (info)->read_exec_only == 1 && \
-+ (info)->seg_32bit == 0 && \
-+ (info)->limit_in_pages == 0 && \
-+ (info)->seg_not_present == 1 && \
-+ (info)->useable == 0 )
-+
-+extern int write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b);
-+
-+#if TLS_SIZE != 24
-+# error update this code.
-+#endif
-+
-+static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
-+{
-+#define C(i) if (HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]), \
-+ *(u64 *)&t->tls_array[i])) \
-+ BUG();
-+ C(0); C(1); C(2);
-+#undef C
-+}
-+
-+static inline void clear_LDT(void)
-+{
-+ int cpu = get_cpu();
-+
-+ /*
-+ * NB. We load the default_ldt for lcall7/27 handling on demand, as
-+ * it slows down context switching. Noone uses it anyway.
-+ */
-+ cpu = cpu; /* XXX avoid compiler warning */
-+ xen_set_ldt(NULL, 0);
-+ put_cpu();
-+}
-+
-+/*
-+ * load one particular LDT into the current CPU
-+ */
-+static inline void load_LDT_nolock(mm_context_t *pc, int cpu)
-+{
-+ void *segments = pc->ldt;
-+ int count = pc->size;
-+
-+ if (likely(!count))
-+ segments = NULL;
-+
-+ xen_set_ldt(segments, count);
-+}
-+
-+static inline void load_LDT(mm_context_t *pc)
-+{
-+ int cpu = get_cpu();
-+ load_LDT_nolock(pc, cpu);
-+ put_cpu();
-+}
-+
-+static inline unsigned long get_desc_base(unsigned long *desc)
-+{
-+ unsigned long base;
-+ base = ((desc[0] >> 16) & 0x0000ffff) |
-+ ((desc[1] << 16) & 0x00ff0000) |
-+ (desc[1] & 0xff000000);
-+ return base;
-+}
-+
-+#endif /* !__ASSEMBLY__ */
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/desc_64.h
-@@ -0,0 +1,265 @@
-+/* Written 2000 by Andi Kleen */
-+#ifndef __ARCH_DESC_H
-+#define __ARCH_DESC_H
-+
-+#include <linux/threads.h>
-+#include <asm/ldt.h>
-+
-+#ifndef __ASSEMBLY__
-+
-+#include <linux/string.h>
-+#include <linux/smp.h>
-+
-+#include <asm/segment.h>
-+#include <asm/mmu.h>
-+
-+// 8 byte segment descriptor
-+struct desc_struct {
-+ u16 limit0;
-+ u16 base0;
-+ unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1;
-+ unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 : 8;
-+} __attribute__((packed));
-+
-+struct n_desc_struct {
-+ unsigned int a,b;
-+};
-+
-+enum {
-+ GATE_INTERRUPT = 0xE,
-+ GATE_TRAP = 0xF,
-+ GATE_CALL = 0xC,
-+};
-+
-+// 16byte gate
-+struct gate_struct {
-+ u16 offset_low;
-+ u16 segment;
-+ unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1;
-+ u16 offset_middle;
-+ u32 offset_high;
-+ u32 zero1;
-+} __attribute__((packed));
-+
-+#define PTR_LOW(x) ((unsigned long)(x) & 0xFFFF)
-+#define PTR_MIDDLE(x) (((unsigned long)(x) >> 16) & 0xFFFF)
-+#define PTR_HIGH(x) ((unsigned long)(x) >> 32)
-+
-+enum {
-+ DESC_TSS = 0x9,
-+ DESC_LDT = 0x2,
-+};
-+
-+// LDT or TSS descriptor in the GDT. 16 bytes.
-+struct ldttss_desc {
-+ u16 limit0;
-+ u16 base0;
-+ unsigned base1 : 8, type : 5, dpl : 2, p : 1;
-+ unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
-+ u32 base3;
-+ u32 zero1;
-+} __attribute__((packed));
-+
-+struct desc_ptr {
-+ unsigned short size;
-+ unsigned long address;
-+} __attribute__((packed)) ;
-+
-+extern struct desc_ptr idt_descr, cpu_gdt_descr[NR_CPUS];
-+
-+extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
-+
-+#define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
-+#define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))
-+
-+static inline void clear_LDT(void)
-+{
-+ int cpu = get_cpu();
-+
-+ /*
-+ * NB. We load the default_ldt for lcall7/27 handling on demand, as
-+ * it slows down context switching. Noone uses it anyway.
-+ */
-+ cpu = cpu; /* XXX avoid compiler warning */
-+ xen_set_ldt(NULL, 0);
-+ put_cpu();
-+}
-+
-+/*
-+ * This is the ldt that every process will get unless we need
-+ * something other than this.
-+ */
-+extern struct desc_struct default_ldt[];
-+#ifndef CONFIG_X86_NO_IDT
-+extern struct gate_struct idt_table[];
-+#endif
-+extern struct desc_ptr cpu_gdt_descr[];
-+
-+/* the cpu gdt accessor */
-+#define cpu_gdt(_cpu) ((struct desc_struct *)cpu_gdt_descr[_cpu].address)
-+
-+static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist)
-+{
-+ struct gate_struct s;
-+ s.offset_low = PTR_LOW(func);
-+ s.segment = __KERNEL_CS;
-+ s.ist = ist;
-+ s.p = 1;
-+ s.dpl = dpl;
-+ s.zero0 = 0;
-+ s.zero1 = 0;
-+ s.type = type;
-+ s.offset_middle = PTR_MIDDLE(func);
-+ s.offset_high = PTR_HIGH(func);
-+ /* does not need to be atomic because it is only done once at setup time */
-+ memcpy(adr, &s, 16);
-+}
-+
-+#ifndef CONFIG_X86_NO_IDT
-+static inline void set_intr_gate(int nr, void *func)
-+{
-+ BUG_ON((unsigned)nr > 0xFF);
-+ _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, 0);
-+}
-+
-+static inline void set_intr_gate_ist(int nr, void *func, unsigned ist)
-+{
-+ BUG_ON((unsigned)nr > 0xFF);
-+ _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, ist);
-+}
-+
-+static inline void set_system_gate(int nr, void *func)
-+{
-+ BUG_ON((unsigned)nr > 0xFF);
-+ _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, 0);
-+}
-+
-+static inline void set_system_gate_ist(int nr, void *func, unsigned ist)
-+{
-+ _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist);
-+}
-+#endif
-+
-+static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type,
-+ unsigned size)
-+{
-+ struct ldttss_desc d;
-+ memset(&d,0,sizeof(d));
-+ d.limit0 = size & 0xFFFF;
-+ d.base0 = PTR_LOW(tss);
-+ d.base1 = PTR_MIDDLE(tss) & 0xFF;
-+ d.type = type;
-+ d.p = 1;
-+ d.limit1 = (size >> 16) & 0xF;
-+ d.base2 = (PTR_MIDDLE(tss) >> 8) & 0xFF;
-+ d.base3 = PTR_HIGH(tss);
-+ memcpy(ptr, &d, 16);
-+}
-+
-+#ifndef CONFIG_X86_NO_TSS
-+static inline void set_tss_desc(unsigned cpu, void *addr)
-+{
-+ /*
-+ * sizeof(unsigned long) coming from an extra "long" at the end
-+ * of the iobitmap. See tss_struct definition in processor.h
-+ *
-+ * -1? seg base+limit should be pointing to the address of the
-+ * last valid byte
-+ */
-+ set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_TSS],
-+ (unsigned long)addr, DESC_TSS,
-+ IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1);
-+}
-+#endif
-+
-+static inline void set_ldt_desc(unsigned cpu, void *addr, int size)
-+{
-+ set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_LDT], (unsigned long)addr,
-+ DESC_LDT, size * 8 - 1);
-+}
-+
-+static inline void set_seg_base(unsigned cpu, int entry, void *base)
-+{
-+ struct desc_struct *d = &cpu_gdt(cpu)[entry];
-+ u32 addr = (u32)(u64)base;
-+ BUG_ON((u64)base >> 32);
-+ d->base0 = addr & 0xffff;
-+ d->base1 = (addr >> 16) & 0xff;
-+ d->base2 = (addr >> 24) & 0xff;
-+}
-+
-+#define LDT_entry_a(info) \
-+ ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
-+/* Don't allow setting of the lm bit. It is useless anyways because
-+ 64bit system calls require __USER_CS. */
-+#define LDT_entry_b(info) \
-+ (((info)->base_addr & 0xff000000) | \
-+ (((info)->base_addr & 0x00ff0000) >> 16) | \
-+ ((info)->limit & 0xf0000) | \
-+ (((info)->read_exec_only ^ 1) << 9) | \
-+ ((info)->contents << 10) | \
-+ (((info)->seg_not_present ^ 1) << 15) | \
-+ ((info)->seg_32bit << 22) | \
-+ ((info)->limit_in_pages << 23) | \
-+ ((info)->useable << 20) | \
-+ /* ((info)->lm << 21) | */ \
-+ 0x7000)
-+
-+#define LDT_empty(info) (\
-+ (info)->base_addr == 0 && \
-+ (info)->limit == 0 && \
-+ (info)->contents == 0 && \
-+ (info)->read_exec_only == 1 && \
-+ (info)->seg_32bit == 0 && \
-+ (info)->limit_in_pages == 0 && \
-+ (info)->seg_not_present == 1 && \
-+ (info)->useable == 0 && \
-+ (info)->lm == 0)
-+
-+#if TLS_SIZE != 24
-+# error update this code.
-+#endif
-+
-+static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
-+{
-+#if 0
-+ u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN);
-+ gdt[0] = t->tls_array[0];
-+ gdt[1] = t->tls_array[1];
-+ gdt[2] = t->tls_array[2];
-+#endif
-+#define C(i) \
-+ if (HYPERVISOR_update_descriptor(virt_to_machine(&cpu_gdt(cpu)[GDT_ENTRY_TLS_MIN + i]), \
-+ t->tls_array[i])) \
-+ BUG();
-+
-+ C(0); C(1); C(2);
-+#undef C
-+}
-+
-+/*
-+ * load one particular LDT into the current CPU
-+ */
-+static inline void load_LDT_nolock (mm_context_t *pc, int cpu)
-+{
-+ void *segments = pc->ldt;
-+ int count = pc->size;
-+
-+ if (likely(!count))
-+ segments = NULL;
-+
-+ xen_set_ldt(segments, count);
-+}
-+
-+static inline void load_LDT(mm_context_t *pc)
-+{
-+ int cpu = get_cpu();
-+ load_LDT_nolock(pc, cpu);
-+ put_cpu();
-+}
-+
-+extern struct desc_ptr idt_descr;
-+
-+#endif /* !__ASSEMBLY__ */
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/fixmap_32.h
-@@ -0,0 +1,155 @@
-+/*
-+ * fixmap.h: compile-time virtual memory allocation
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 1998 Ingo Molnar
-+ *
-+ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
-+ */
-+
-+#ifndef _ASM_FIXMAP_H
-+#define _ASM_FIXMAP_H
-+
-+
-+/* used by vmalloc.c, vsyscall.lds.S.
-+ *
-+ * Leave one empty page between vmalloc'ed areas and
-+ * the start of the fixmap.
-+ */
-+extern unsigned long __FIXADDR_TOP;
-+
-+#ifndef __ASSEMBLY__
-+#include <linux/kernel.h>
-+#include <asm/acpi.h>
-+#include <asm/apicdef.h>
-+#include <asm/page.h>
-+#ifdef CONFIG_HIGHMEM
-+#include <linux/threads.h>
-+#include <asm/kmap_types.h>
-+#endif
-+
-+/*
-+ * Here we define all the compile-time 'special' virtual
-+ * addresses. The point is to have a constant address at
-+ * compile time, but to set the physical address only
-+ * in the boot process. We allocate these special addresses
-+ * from the end of virtual memory (0xfffff000) backwards.
-+ * Also this lets us do fail-safe vmalloc(), we
-+ * can guarantee that these special addresses and
-+ * vmalloc()-ed addresses never overlap.
-+ *
-+ * these 'compile-time allocated' memory buffers are
-+ * fixed-size 4k pages. (or larger if used with an increment
-+ * highger than 1) use fixmap_set(idx,phys) to associate
-+ * physical memory with fixmap indices.
-+ *
-+ * TLB entries of such buffers will not be flushed across
-+ * task switches.
-+ */
-+enum fixed_addresses {
-+ FIX_HOLE,
-+ FIX_VDSO,
-+#ifdef CONFIG_X86_LOCAL_APIC
-+ FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
-+#endif
-+#ifdef CONFIG_X86_IO_APIC
-+ FIX_IO_APIC_BASE_0,
-+ FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
-+#endif
-+#ifdef CONFIG_X86_VISWS_APIC
-+ FIX_CO_CPU, /* Cobalt timer */
-+ FIX_CO_APIC, /* Cobalt APIC Redirection Table */
-+ FIX_LI_PCIA, /* Lithium PCI Bridge A */
-+ FIX_LI_PCIB, /* Lithium PCI Bridge B */
-+#endif
-+#ifdef CONFIG_X86_F00F_BUG
-+ FIX_F00F_IDT, /* Virtual mapping for IDT */
-+#endif
-+#ifdef CONFIG_X86_CYCLONE_TIMER
-+ FIX_CYCLONE_TIMER, /*cyclone timer register*/
-+#endif
-+#ifdef CONFIG_HIGHMEM
-+ FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
-+ FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
-+#endif
-+#ifdef CONFIG_ACPI
-+ FIX_ACPI_BEGIN,
-+ FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
-+#endif
-+#ifdef CONFIG_PCI_MMCONFIG
-+ FIX_PCIE_MCFG,
-+#endif
-+ FIX_SHARED_INFO,
-+#define NR_FIX_ISAMAPS 256
-+ FIX_ISAMAP_END,
-+ FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
-+ __end_of_permanent_fixed_addresses,
-+ /* temporary boot-time mappings, used before ioremap() is functional */
-+#define NR_FIX_BTMAPS 16
-+ FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
-+ FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
-+ FIX_WP_TEST,
-+ __end_of_fixed_addresses
-+};
-+
-+extern void set_fixaddr_top(unsigned long top);
-+
-+extern void __set_fixmap(enum fixed_addresses idx,
-+ maddr_t phys, pgprot_t flags);
-+
-+#define set_fixmap(idx, phys) \
-+ __set_fixmap(idx, phys, PAGE_KERNEL)
-+/*
-+ * Some hardware wants to get fixmapped without caching.
-+ */
-+#define set_fixmap_nocache(idx, phys) \
-+ __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
-+
-+#define clear_fixmap(idx) \
-+ __set_fixmap(idx, 0, __pgprot(0))
-+
-+#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
-+
-+#define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
-+#define __FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
-+#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
-+#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
-+
-+#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
-+#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
-+
-+extern void __this_fixmap_does_not_exist(void);
-+
-+/*
-+ * 'index to address' translation. If anyone tries to use the idx
-+ * directly without tranlation, we catch the bug with a NULL-deference
-+ * kernel oops. Illegal ranges of incoming indices are caught too.
-+ */
-+static __always_inline unsigned long fix_to_virt(const unsigned int idx)
-+{
-+ /*
-+ * this branch gets completely eliminated after inlining,
-+ * except when someone tries to use fixaddr indices in an
-+ * illegal way. (such as mixing up address types or using
-+ * out-of-range indices).
-+ *
-+ * If it doesn't get removed, the linker will complain
-+ * loudly with a reasonably clear error message..
-+ */
-+ if (idx >= __end_of_fixed_addresses)
-+ __this_fixmap_does_not_exist();
-+
-+ return __fix_to_virt(idx);
-+}
-+
-+static inline unsigned long virt_to_fix(const unsigned long vaddr)
-+{
-+ BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
-+ return __virt_to_fix(vaddr);
-+}
-+
-+#endif /* !__ASSEMBLY__ */
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/fixmap_64.h
-@@ -0,0 +1,112 @@
-+/*
-+ * fixmap.h: compile-time virtual memory allocation
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 1998 Ingo Molnar
-+ */
-+
-+#ifndef _ASM_FIXMAP_H
-+#define _ASM_FIXMAP_H
-+
-+#include <linux/kernel.h>
-+#include <asm/apicdef.h>
-+#include <asm/page.h>
-+#include <asm/vsyscall.h>
-+#include <asm/vsyscall32.h>
-+#include <asm/acpi.h>
-+
-+/*
-+ * Here we define all the compile-time 'special' virtual
-+ * addresses. The point is to have a constant address at
-+ * compile time, but to set the physical address only
-+ * in the boot process.
-+ *
-+ * these 'compile-time allocated' memory buffers are
-+ * fixed-size 4k pages. (or larger if used with an increment
-+ * highger than 1) use fixmap_set(idx,phys) to associate
-+ * physical memory with fixmap indices.
-+ *
-+ * TLB entries of such buffers will not be flushed across
-+ * task switches.
-+ */
-+
-+enum fixed_addresses {
-+ VSYSCALL_LAST_PAGE,
-+ VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
-+ VSYSCALL_HPET,
-+ FIX_HPET_BASE,
-+#ifdef CONFIG_X86_LOCAL_APIC
-+ FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
-+#endif
-+#ifdef CONFIG_X86_IO_APIC
-+ FIX_IO_APIC_BASE_0,
-+ FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
-+#endif
-+#ifdef CONFIG_ACPI
-+ FIX_ACPI_BEGIN,
-+ FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
-+#endif
-+ FIX_SHARED_INFO,
-+#define NR_FIX_ISAMAPS 256
-+ FIX_ISAMAP_END,
-+ FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
-+ __end_of_permanent_fixed_addresses,
-+ /* temporary boot-time mappings, used before ioremap() is functional */
-+#define NR_FIX_BTMAPS 16
-+ FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
-+ FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
-+ __end_of_fixed_addresses
-+};
-+
-+extern void __set_fixmap (enum fixed_addresses idx,
-+ unsigned long phys, pgprot_t flags);
-+
-+#define set_fixmap(idx, phys) \
-+ __set_fixmap(idx, phys, PAGE_KERNEL)
-+/*
-+ * Some hardware wants to get fixmapped without caching.
-+ */
-+#define set_fixmap_nocache(idx, phys) \
-+ __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
-+
-+#define clear_fixmap(idx) \
-+ __set_fixmap(idx, 0, __pgprot(0))
-+
-+#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
-+#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
-+#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
-+
-+/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
-+#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
-+#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
-+
-+#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
-+
-+extern void __this_fixmap_does_not_exist(void);
-+
-+/*
-+ * 'index to address' translation. If anyone tries to use the idx
-+ * directly without translation, we catch the bug with a NULL-deference
-+ * kernel oops. Illegal ranges of incoming indices are caught too.
-+ */
-+static __always_inline unsigned long fix_to_virt(const unsigned int idx)
-+{
-+ /*
-+ * this branch gets completely eliminated after inlining,
-+ * except when someone tries to use fixaddr indices in an
-+ * illegal way. (such as mixing up address types or using
-+ * out-of-range indices).
-+ *
-+ * If it doesn't get removed, the linker will complain
-+ * loudly with a reasonably clear error message..
-+ */
-+ if (idx >= __end_of_fixed_addresses)
-+ __this_fixmap_does_not_exist();
-+
-+ return __fix_to_virt(idx);
-+}
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/gnttab_dma.h
-@@ -0,0 +1,41 @@
-+/*
-+ * Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
-+ * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
-+ * VA Linux Systems Japan K.K.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ */
-+
-+#ifndef _ASM_I386_GNTTAB_DMA_H
-+#define _ASM_I386_GNTTAB_DMA_H
-+
-+static inline int gnttab_dma_local_pfn(struct page *page)
-+{
-+ /* Has it become a local MFN? */
-+ return pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));
-+}
-+
-+static inline maddr_t gnttab_dma_map_page(struct page *page)
-+{
-+ __gnttab_dma_map_page(page);
-+ return ((maddr_t)pfn_to_mfn(page_to_pfn(page)) << PAGE_SHIFT);
-+}
-+
-+static inline void gnttab_dma_unmap_page(maddr_t maddr)
-+{
-+ __gnttab_dma_unmap_page(virt_to_page(bus_to_virt(maddr)));
-+}
-+
-+#endif /* _ASM_I386_GNTTAB_DMA_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/highmem.h
-@@ -0,0 +1,97 @@
-+/*
-+ * highmem.h: virtual kernel memory mappings for high memory
-+ *
-+ * Used in CONFIG_HIGHMEM systems for memory pages which
-+ * are not addressable by direct kernel virtual addresses.
-+ *
-+ * Copyright (C) 1999 Gerhard Wichert, Siemens AG
-+ * Gerhard.Wichert@pdb.siemens.de
-+ *
-+ *
-+ * Redesigned the x86 32-bit VM architecture to deal with
-+ * up to 16 Terabyte physical memory. With current x86 CPUs
-+ * we now support up to 64 Gigabytes physical RAM.
-+ *
-+ * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
-+ */
-+
-+#ifndef _ASM_HIGHMEM_H
-+#define _ASM_HIGHMEM_H
-+
-+#ifdef __KERNEL__
-+
-+#include <linux/interrupt.h>
-+#include <linux/threads.h>
-+#include <asm/kmap_types.h>
-+#include <asm/tlbflush.h>
-+
-+/* declarations for highmem.c */
-+extern unsigned long highstart_pfn, highend_pfn;
-+
-+extern pte_t *kmap_pte;
-+extern pgprot_t kmap_prot;
-+extern pte_t *pkmap_page_table;
-+
-+/*
-+ * Right now we initialize only a single pte table. It can be extended
-+ * easily, subsequent pte tables have to be allocated in one physical
-+ * chunk of RAM.
-+ */
-+#ifdef CONFIG_X86_PAE
-+#define LAST_PKMAP 512
-+#else
-+#define LAST_PKMAP 1024
-+#endif
-+/*
-+ * Ordering is:
-+ *
-+ * FIXADDR_TOP
-+ * fixed_addresses
-+ * FIXADDR_START
-+ * temp fixed addresses
-+ * FIXADDR_BOOT_START
-+ * Persistent kmap area
-+ * PKMAP_BASE
-+ * VMALLOC_END
-+ * Vmalloc area
-+ * VMALLOC_START
-+ * high_memory
-+ */
-+#define PKMAP_BASE ( (FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK )
-+#define LAST_PKMAP_MASK (LAST_PKMAP-1)
-+#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
-+#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-+
-+extern void * FASTCALL(kmap_high(struct page *page));
-+extern void FASTCALL(kunmap_high(struct page *page));
-+
-+void *kmap(struct page *page);
-+void kunmap(struct page *page);
-+void *kmap_atomic(struct page *page, enum km_type type);
-+void *kmap_atomic_pte(struct page *page, enum km_type type);
-+void kunmap_atomic(void *kvaddr, enum km_type type);
-+void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
-+struct page *kmap_atomic_to_page(void *ptr);
-+
-+#define flush_cache_kmaps() do { } while (0)
-+
-+void clear_highpage(struct page *);
-+static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
-+{
-+ clear_highpage(page);
-+}
-+#define __HAVE_ARCH_CLEAR_HIGHPAGE
-+#define __HAVE_ARCH_CLEAR_USER_HIGHPAGE
-+
-+void copy_highpage(struct page *to, struct page *from);
-+static inline void copy_user_highpage(struct page *to, struct page *from,
-+ unsigned long vaddr)
-+{
-+ copy_highpage(to, from);
-+}
-+#define __HAVE_ARCH_COPY_HIGHPAGE
-+#define __HAVE_ARCH_COPY_USER_HIGHPAGE
-+
-+#endif /* __KERNEL__ */
-+
-+#endif /* _ASM_HIGHMEM_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/hypercall_32.h
-@@ -0,0 +1,415 @@
-+/******************************************************************************
-+ * hypercall.h
-+ *
-+ * Linux-specific hypervisor handling.
-+ *
-+ * Copyright (c) 2002-2004, K A Fraser
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License version 2
-+ * as published by the Free Software Foundation; or, when distributed
-+ * separately from the Linux kernel or incorporated into other
-+ * software packages, subject to the following license:
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a copy
-+ * of this source file (the "Software"), to deal in the Software without
-+ * restriction, including without limitation the rights to use, copy, modify,
-+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
-+ * and to permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-+ * IN THE SOFTWARE.
-+ */
-+
-+#ifndef __HYPERCALL_H__
-+#define __HYPERCALL_H__
-+
-+#include <linux/string.h> /* memcpy() */
-+#include <linux/stringify.h>
-+
-+#ifndef __HYPERVISOR_H__
-+# error "please don't include this file directly"
-+#endif
-+
-+#ifdef CONFIG_XEN
-+#define HYPERCALL_STR(name) \
-+ "call hypercall_page + ("__stringify(__HYPERVISOR_##name)" * 32)"
-+#else
-+#define HYPERCALL_STR(name) \
-+ "mov hypercall_stubs,%%eax; " \
-+ "add $("__stringify(__HYPERVISOR_##name)" * 32),%%eax; "\
-+ "call *%%eax"
-+#endif
-+
-+#define _hypercall0(type, name) \
-+({ \
-+ type __res; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res) \
-+ : \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall1(type, name, a1) \
-+({ \
-+ type __res; \
-+ long __ign1; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=b" (__ign1) \
-+ : "1" ((long)(a1)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall2(type, name, a1, a2) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall3(type, name, a1, a2, a3) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2, __ign3; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-+ "=d" (__ign3) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall4(type, name, a1, a2, a3, a4) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2, __ign3, __ign4; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-+ "=d" (__ign3), "=S" (__ign4) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)), "4" ((long)(a4)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2, __ign3, __ign4, __ign5; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-+ "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)), "4" ((long)(a4)), \
-+ "5" ((long)(a5)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+static inline int __must_check
-+HYPERVISOR_set_trap_table(
-+ const trap_info_t *table)
-+{
-+ return _hypercall1(int, set_trap_table, table);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_mmu_update(
-+ mmu_update_t *req, unsigned int count, unsigned int *success_count,
-+ domid_t domid)
-+{
-+ return _hypercall4(int, mmu_update, req, count, success_count, domid);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_mmuext_op(
-+ struct mmuext_op *op, unsigned int count, unsigned int *success_count,
-+ domid_t domid)
-+{
-+ return _hypercall4(int, mmuext_op, op, count, success_count, domid);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_set_gdt(
-+ unsigned long *frame_list, unsigned int entries)
-+{
-+ return _hypercall2(int, set_gdt, frame_list, entries);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_stack_switch(
-+ unsigned long ss, unsigned long esp)
-+{
-+ return _hypercall2(int, stack_switch, ss, esp);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_set_callbacks(
-+ unsigned long event_selector, unsigned long event_address,
-+ unsigned long failsafe_selector, unsigned long failsafe_address)
-+{
-+ return _hypercall4(int, set_callbacks,
-+ event_selector, event_address,
-+ failsafe_selector, failsafe_address);
-+}
-+
-+static inline int
-+HYPERVISOR_fpu_taskswitch(
-+ int set)
-+{
-+ return _hypercall1(int, fpu_taskswitch, set);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_sched_op_compat(
-+ int cmd, unsigned long arg)
-+{
-+ return _hypercall2(int, sched_op_compat, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_sched_op(
-+ int cmd, void *arg)
-+{
-+ return _hypercall2(int, sched_op, cmd, arg);
-+}
-+
-+static inline long __must_check
-+HYPERVISOR_set_timer_op(
-+ u64 timeout)
-+{
-+ unsigned long timeout_hi = (unsigned long)(timeout>>32);
-+ unsigned long timeout_lo = (unsigned long)timeout;
-+ return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_platform_op(
-+ struct xen_platform_op *platform_op)
-+{
-+ platform_op->interface_version = XENPF_INTERFACE_VERSION;
-+ return _hypercall1(int, platform_op, platform_op);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_set_debugreg(
-+ unsigned int reg, unsigned long value)
-+{
-+ return _hypercall2(int, set_debugreg, reg, value);
-+}
-+
-+static inline unsigned long __must_check
-+HYPERVISOR_get_debugreg(
-+ unsigned int reg)
-+{
-+ return _hypercall1(unsigned long, get_debugreg, reg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_update_descriptor(
-+ u64 ma, u64 desc)
-+{
-+ return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_memory_op(
-+ unsigned int cmd, void *arg)
-+{
-+ return _hypercall2(int, memory_op, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_multicall(
-+ multicall_entry_t *call_list, unsigned int nr_calls)
-+{
-+ return _hypercall2(int, multicall, call_list, nr_calls);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_update_va_mapping(
-+ unsigned long va, pte_t new_val, unsigned long flags)
-+{
-+ unsigned long pte_hi = 0;
-+#ifdef CONFIG_X86_PAE
-+ pte_hi = new_val.pte_high;
-+#endif
-+ return _hypercall4(int, update_va_mapping, va,
-+ new_val.pte_low, pte_hi, flags);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_event_channel_op(
-+ int cmd, void *arg)
-+{
-+ int rc = _hypercall2(int, event_channel_op, cmd, arg);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (unlikely(rc == -ENOSYS)) {
-+ struct evtchn_op op;
-+ op.cmd = cmd;
-+ memcpy(&op.u, arg, sizeof(op.u));
-+ rc = _hypercall1(int, event_channel_op_compat, &op);
-+ memcpy(arg, &op.u, sizeof(op.u));
-+ }
-+#endif
-+
-+ return rc;
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_xen_version(
-+ int cmd, void *arg)
-+{
-+ return _hypercall2(int, xen_version, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_console_io(
-+ int cmd, unsigned int count, char *str)
-+{
-+ return _hypercall3(int, console_io, cmd, count, str);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_physdev_op(
-+ int cmd, void *arg)
-+{
-+ int rc = _hypercall2(int, physdev_op, cmd, arg);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (unlikely(rc == -ENOSYS)) {
-+ struct physdev_op op;
-+ op.cmd = cmd;
-+ memcpy(&op.u, arg, sizeof(op.u));
-+ rc = _hypercall1(int, physdev_op_compat, &op);
-+ memcpy(arg, &op.u, sizeof(op.u));
-+ }
-+#endif
-+
-+ return rc;
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_grant_table_op(
-+ unsigned int cmd, void *uop, unsigned int count)
-+{
-+ return _hypercall3(int, grant_table_op, cmd, uop, count);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_update_va_mapping_otherdomain(
-+ unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
-+{
-+ unsigned long pte_hi = 0;
-+#ifdef CONFIG_X86_PAE
-+ pte_hi = new_val.pte_high;
-+#endif
-+ return _hypercall5(int, update_va_mapping_otherdomain, va,
-+ new_val.pte_low, pte_hi, flags, domid);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_vm_assist(
-+ unsigned int cmd, unsigned int type)
-+{
-+ return _hypercall2(int, vm_assist, cmd, type);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_vcpu_op(
-+ int cmd, unsigned int vcpuid, void *extra_args)
-+{
-+ return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_suspend(
-+ unsigned long srec)
-+{
-+ struct sched_shutdown sched_shutdown = {
-+ .reason = SHUTDOWN_suspend
-+ };
-+
-+ int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
-+ &sched_shutdown, srec);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (rc == -ENOSYS)
-+ rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
-+ SHUTDOWN_suspend, srec);
-+#endif
-+
-+ return rc;
-+}
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+static inline int
-+HYPERVISOR_nmi_op(
-+ unsigned long op, void *arg)
-+{
-+ return _hypercall2(int, nmi_op, op, arg);
-+}
-+#endif
-+
-+#ifndef CONFIG_XEN
-+static inline unsigned long __must_check
-+HYPERVISOR_hvm_op(
-+ int op, void *arg)
-+{
-+ return _hypercall2(unsigned long, hvm_op, op, arg);
-+}
-+#endif
-+
-+static inline int __must_check
-+HYPERVISOR_callback_op(
-+ int cmd, const void *arg)
-+{
-+ return _hypercall2(int, callback_op, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_xenoprof_op(
-+ int op, void *arg)
-+{
-+ return _hypercall2(int, xenoprof_op, op, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_kexec_op(
-+ unsigned long op, void *args)
-+{
-+ return _hypercall2(int, kexec_op, op, args);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_tmem_op(
-+ struct tmem_op *op)
-+{
-+ return _hypercall1(int, tmem_op, op);
-+}
-+
-+
-+#endif /* __HYPERCALL_H__ */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/hypercall_64.h
-@@ -0,0 +1,422 @@
-+/******************************************************************************
-+ * hypercall.h
-+ *
-+ * Linux-specific hypervisor handling.
-+ *
-+ * Copyright (c) 2002-2004, K A Fraser
-+ *
-+ * 64-bit updates:
-+ * Benjamin Liu <benjamin.liu@intel.com>
-+ * Jun Nakajima <jun.nakajima@intel.com>
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License version 2
-+ * as published by the Free Software Foundation; or, when distributed
-+ * separately from the Linux kernel or incorporated into other
-+ * software packages, subject to the following license:
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a copy
-+ * of this source file (the "Software"), to deal in the Software without
-+ * restriction, including without limitation the rights to use, copy, modify,
-+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
-+ * and to permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-+ * IN THE SOFTWARE.
-+ */
-+
-+#ifndef __HYPERCALL_H__
-+#define __HYPERCALL_H__
-+
-+#include <linux/string.h> /* memcpy() */
-+#include <linux/stringify.h>
-+#include <xen/interface/arch-x86/xen-mca.h>
-+
-+#ifndef __HYPERVISOR_H__
-+# error "please don't include this file directly"
-+#endif
-+
-+#ifdef CONFIG_XEN
-+#define HYPERCALL_STR(name) \
-+ "call hypercall_page + ("__stringify(__HYPERVISOR_##name)" * 32)"
-+#else
-+#define HYPERCALL_STR(name) \
-+ "mov $("__stringify(__HYPERVISOR_##name)" * 32),%%eax; "\
-+ "add hypercall_stubs(%%rip),%%rax; " \
-+ "call *%%rax"
-+#endif
-+
-+#define _hypercall0(type, name) \
-+({ \
-+ type __res; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res) \
-+ : \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall1(type, name, a1) \
-+({ \
-+ type __res; \
-+ long __ign1; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=D" (__ign1) \
-+ : "1" ((long)(a1)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall2(type, name, a1, a2) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=D" (__ign1), "=S" (__ign2) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall3(type, name, a1, a2, a3) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2, __ign3; \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
-+ "=d" (__ign3) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall4(type, name, a1, a2, a3, a4) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2, __ign3; \
-+ register long __arg4 asm("r10") = (long)(a4); \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
-+ "=d" (__ign3), "+r" (__arg4) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
-+({ \
-+ type __res; \
-+ long __ign1, __ign2, __ign3; \
-+ register long __arg4 asm("r10") = (long)(a4); \
-+ register long __arg5 asm("r8") = (long)(a5); \
-+ asm volatile ( \
-+ HYPERCALL_STR(name) \
-+ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
-+ "=d" (__ign3), "+r" (__arg4), "+r" (__arg5) \
-+ : "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)) \
-+ : "memory" ); \
-+ __res; \
-+})
-+
-+static inline int __must_check
-+HYPERVISOR_set_trap_table(
-+ const trap_info_t *table)
-+{
-+ return _hypercall1(int, set_trap_table, table);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_mmu_update(
-+ mmu_update_t *req, unsigned int count, unsigned int *success_count,
-+ domid_t domid)
-+{
-+ return _hypercall4(int, mmu_update, req, count, success_count, domid);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_mmuext_op(
-+ struct mmuext_op *op, unsigned int count, unsigned int *success_count,
-+ domid_t domid)
-+{
-+ return _hypercall4(int, mmuext_op, op, count, success_count, domid);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_set_gdt(
-+ unsigned long *frame_list, unsigned int entries)
-+{
-+ return _hypercall2(int, set_gdt, frame_list, entries);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_stack_switch(
-+ unsigned long ss, unsigned long esp)
-+{
-+ return _hypercall2(int, stack_switch, ss, esp);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_set_callbacks(
-+ unsigned long event_address, unsigned long failsafe_address,
-+ unsigned long syscall_address)
-+{
-+ return _hypercall3(int, set_callbacks,
-+ event_address, failsafe_address, syscall_address);
-+}
-+
-+static inline int
-+HYPERVISOR_fpu_taskswitch(
-+ int set)
-+{
-+ return _hypercall1(int, fpu_taskswitch, set);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_sched_op_compat(
-+ int cmd, unsigned long arg)
-+{
-+ return _hypercall2(int, sched_op_compat, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_sched_op(
-+ int cmd, void *arg)
-+{
-+ return _hypercall2(int, sched_op, cmd, arg);
-+}
-+
-+static inline long __must_check
-+HYPERVISOR_set_timer_op(
-+ u64 timeout)
-+{
-+ return _hypercall1(long, set_timer_op, timeout);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_platform_op(
-+ struct xen_platform_op *platform_op)
-+{
-+ platform_op->interface_version = XENPF_INTERFACE_VERSION;
-+ return _hypercall1(int, platform_op, platform_op);
-+}
-+static inline int __must_check
-+HYPERVISOR_mca(
-+ struct xen_mc *mc_op)
-+{
-+ mc_op->interface_version = XEN_MCA_INTERFACE_VERSION;
-+ return _hypercall1(int, mca, mc_op);
-+}
-+static inline int __must_check
-+HYPERVISOR_set_debugreg(
-+ unsigned int reg, unsigned long value)
-+{
-+ return _hypercall2(int, set_debugreg, reg, value);
-+}
-+
-+static inline unsigned long __must_check
-+HYPERVISOR_get_debugreg(
-+ unsigned int reg)
-+{
-+ return _hypercall1(unsigned long, get_debugreg, reg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_update_descriptor(
-+ unsigned long ma, unsigned long word)
-+{
-+ return _hypercall2(int, update_descriptor, ma, word);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_memory_op(
-+ unsigned int cmd, void *arg)
-+{
-+ return _hypercall2(int, memory_op, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_multicall(
-+ multicall_entry_t *call_list, unsigned int nr_calls)
-+{
-+ return _hypercall2(int, multicall, call_list, nr_calls);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_update_va_mapping(
-+ unsigned long va, pte_t new_val, unsigned long flags)
-+{
-+ return _hypercall3(int, update_va_mapping, va, new_val.pte, flags);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_event_channel_op(
-+ int cmd, void *arg)
-+{
-+ int rc = _hypercall2(int, event_channel_op, cmd, arg);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (unlikely(rc == -ENOSYS)) {
-+ struct evtchn_op op;
-+ op.cmd = cmd;
-+ memcpy(&op.u, arg, sizeof(op.u));
-+ rc = _hypercall1(int, event_channel_op_compat, &op);
-+ memcpy(arg, &op.u, sizeof(op.u));
-+ }
-+#endif
-+
-+ return rc;
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_xen_version(
-+ int cmd, void *arg)
-+{
-+ return _hypercall2(int, xen_version, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_console_io(
-+ int cmd, unsigned int count, char *str)
-+{
-+ return _hypercall3(int, console_io, cmd, count, str);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_physdev_op(
-+ int cmd, void *arg)
-+{
-+ int rc = _hypercall2(int, physdev_op, cmd, arg);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (unlikely(rc == -ENOSYS)) {
-+ struct physdev_op op;
-+ op.cmd = cmd;
-+ memcpy(&op.u, arg, sizeof(op.u));
-+ rc = _hypercall1(int, physdev_op_compat, &op);
-+ memcpy(arg, &op.u, sizeof(op.u));
-+ }
-+#endif
-+
-+ return rc;
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_grant_table_op(
-+ unsigned int cmd, void *uop, unsigned int count)
-+{
-+ return _hypercall3(int, grant_table_op, cmd, uop, count);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_update_va_mapping_otherdomain(
-+ unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
-+{
-+ return _hypercall4(int, update_va_mapping_otherdomain, va,
-+ new_val.pte, flags, domid);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_vm_assist(
-+ unsigned int cmd, unsigned int type)
-+{
-+ return _hypercall2(int, vm_assist, cmd, type);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_vcpu_op(
-+ int cmd, unsigned int vcpuid, void *extra_args)
-+{
-+ return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_set_segment_base(
-+ int reg, unsigned long value)
-+{
-+ return _hypercall2(int, set_segment_base, reg, value);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_suspend(
-+ unsigned long srec)
-+{
-+ struct sched_shutdown sched_shutdown = {
-+ .reason = SHUTDOWN_suspend
-+ };
-+
-+ int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
-+ &sched_shutdown, srec);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (rc == -ENOSYS)
-+ rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
-+ SHUTDOWN_suspend, srec);
-+#endif
-+
-+ return rc;
-+}
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+static inline int
-+HYPERVISOR_nmi_op(
-+ unsigned long op, void *arg)
-+{
-+ return _hypercall2(int, nmi_op, op, arg);
-+}
-+#endif
-+
-+#ifndef CONFIG_XEN
-+static inline unsigned long __must_check
-+HYPERVISOR_hvm_op(
-+ int op, void *arg)
-+{
-+ return _hypercall2(unsigned long, hvm_op, op, arg);
-+}
-+#endif
-+
-+static inline int __must_check
-+HYPERVISOR_callback_op(
-+ int cmd, const void *arg)
-+{
-+ return _hypercall2(int, callback_op, cmd, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_xenoprof_op(
-+ int op, void *arg)
-+{
-+ return _hypercall2(int, xenoprof_op, op, arg);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_kexec_op(
-+ unsigned long op, void *args)
-+{
-+ return _hypercall2(int, kexec_op, op, args);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_tmem_op(
-+ struct tmem_op *op)
-+{
-+ return _hypercall1(int, tmem_op, op);
-+}
-+
-+#endif /* __HYPERCALL_H__ */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/hypervisor.h
-@@ -0,0 +1,263 @@
-+/******************************************************************************
-+ * hypervisor.h
-+ *
-+ * Linux-specific hypervisor handling.
-+ *
-+ * Copyright (c) 2002-2004, K A Fraser
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License version 2
-+ * as published by the Free Software Foundation; or, when distributed
-+ * separately from the Linux kernel or incorporated into other
-+ * software packages, subject to the following license:
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a copy
-+ * of this source file (the "Software"), to deal in the Software without
-+ * restriction, including without limitation the rights to use, copy, modify,
-+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
-+ * and to permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-+ * IN THE SOFTWARE.
-+ */
-+
-+#ifndef __HYPERVISOR_H__
-+#define __HYPERVISOR_H__
-+
-+#include <linux/types.h>
-+#include <linux/kernel.h>
-+#include <linux/version.h>
-+#include <linux/errno.h>
-+#include <xen/interface/xen.h>
-+#include <xen/interface/platform.h>
-+#include <xen/interface/event_channel.h>
-+#include <xen/interface/physdev.h>
-+#include <xen/interface/sched.h>
-+#include <xen/interface/nmi.h>
-+#include <xen/interface/tmem.h>
-+#include <asm/ptrace.h>
-+#include <asm/page.h>
-+#if defined(__i386__)
-+# ifdef CONFIG_X86_PAE
-+# include <asm-generic/pgtable-nopud.h>
-+# else
-+# include <asm-generic/pgtable-nopmd.h>
-+# endif
-+#elif defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
-+# include <asm-generic/pgtable-nopud.h>
-+#endif
-+
-+extern shared_info_t *HYPERVISOR_shared_info;
-+
-+#define vcpu_info(cpu) (HYPERVISOR_shared_info->vcpu_info + (cpu))
-+#ifdef CONFIG_SMP
-+#define current_vcpu_info() vcpu_info(smp_processor_id())
-+#else
-+#define current_vcpu_info() vcpu_info(0)
-+#endif
-+
-+#ifdef CONFIG_X86_32
-+extern unsigned long hypervisor_virt_start;
-+#endif
-+
-+/* arch/xen/i386/kernel/setup.c */
-+extern start_info_t *xen_start_info;
-+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
-+#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
-+#else
-+#define is_initial_xendomain() 0
-+#endif
-+
-+/* arch/xen/kernel/evtchn.c */
-+/* Force a proper event-channel callback from Xen. */
-+void force_evtchn_callback(void);
-+
-+/* arch/xen/kernel/process.c */
-+void xen_cpu_idle (void);
-+
-+/* arch/xen/i386/kernel/hypervisor.c */
-+void do_hypervisor_callback(struct pt_regs *regs);
-+
-+/* arch/xen/i386/mm/hypervisor.c */
-+/*
-+ * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already
-+ * be MACHINE addresses.
-+ */
-+
-+void xen_pt_switch(unsigned long ptr);
-+void xen_new_user_pt(unsigned long ptr); /* x86_64 only */
-+void xen_load_gs(unsigned int selector); /* x86_64 only */
-+void xen_tlb_flush(void);
-+void xen_invlpg(unsigned long ptr);
-+
-+void xen_l1_entry_update(pte_t *ptr, pte_t val);
-+void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
-+void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
-+void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
-+void xen_pgd_pin(unsigned long ptr);
-+void xen_pgd_unpin(unsigned long ptr);
-+
-+void xen_set_ldt(const void *ptr, unsigned int ents);
-+
-+#ifdef CONFIG_SMP
-+#include <linux/cpumask.h>
-+void xen_tlb_flush_all(void);
-+void xen_invlpg_all(unsigned long ptr);
-+void xen_tlb_flush_mask(cpumask_t *mask);
-+void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr);
-+#else
-+#define xen_tlb_flush_all xen_tlb_flush
-+#define xen_invlpg_all xen_invlpg
-+#endif
-+
-+/* Returns zero on success else negative errno. */
-+int xen_create_contiguous_region(
-+ unsigned long vstart, unsigned int order, unsigned int address_bits);
-+void xen_destroy_contiguous_region(
-+ unsigned long vstart, unsigned int order);
-+
-+struct page;
-+
-+int xen_limit_pages_to_max_mfn(
-+ struct page *pages, unsigned int order, unsigned int address_bits);
-+
-+/* Turn jiffies into Xen system time. */
-+u64 jiffies_to_st(unsigned long jiffies);
-+
-+#ifdef CONFIG_XEN_SCRUB_PAGES
-+void scrub_pages(void *, unsigned int);
-+#else
-+#define scrub_pages(_p,_n) ((void)0)
-+#endif
-+
-+#include <xen/hypercall.h>
-+
-+#if defined(CONFIG_X86_64)
-+#define MULTI_UVMFLAGS_INDEX 2
-+#define MULTI_UVMDOMID_INDEX 3
-+#else
-+#define MULTI_UVMFLAGS_INDEX 3
-+#define MULTI_UVMDOMID_INDEX 4
-+#endif
-+
-+#ifdef CONFIG_XEN
-+#define is_running_on_xen() 1
-+#else
-+extern char *hypercall_stubs;
-+#define is_running_on_xen() (!!hypercall_stubs)
-+#endif
-+
-+static inline int
-+HYPERVISOR_yield(
-+ void)
-+{
-+ int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (rc == -ENOSYS)
-+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
-+#endif
-+
-+ return rc;
-+}
-+
-+static inline int
-+HYPERVISOR_block(
-+ void)
-+{
-+ int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL);
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (rc == -ENOSYS)
-+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0);
-+#endif
-+
-+ return rc;
-+}
-+
-+static inline void /*__noreturn*/
-+HYPERVISOR_shutdown(
-+ unsigned int reason)
-+{
-+ struct sched_shutdown sched_shutdown = {
-+ .reason = reason
-+ };
-+
-+ VOID(HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown));
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ VOID(HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason));
-+#endif
-+ /* Don't recurse needlessly. */
-+ BUG_ON(reason != SHUTDOWN_crash);
-+ for(;;);
-+}
-+
-+static inline int __must_check
-+HYPERVISOR_poll(
-+ evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
-+{
-+ int rc;
-+ struct sched_poll sched_poll = {
-+ .nr_ports = nr_ports,
-+ .timeout = jiffies_to_st(timeout)
-+ };
-+ set_xen_guest_handle(sched_poll.ports, ports);
-+
-+ rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (rc == -ENOSYS)
-+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
-+#endif
-+
-+ return rc;
-+}
-+
-+#ifdef CONFIG_XEN
-+
-+static inline void
-+MULTI_update_va_mapping(
-+ multicall_entry_t *mcl, unsigned long va,
-+ pte_t new_val, unsigned long flags)
-+{
-+ mcl->op = __HYPERVISOR_update_va_mapping;
-+ mcl->args[0] = va;
-+#if defined(CONFIG_X86_64)
-+ mcl->args[1] = new_val.pte;
-+#elif defined(CONFIG_X86_PAE)
-+ mcl->args[1] = new_val.pte_low;
-+ mcl->args[2] = new_val.pte_high;
-+#else
-+ mcl->args[1] = new_val.pte_low;
-+ mcl->args[2] = 0;
-+#endif
-+ mcl->args[MULTI_UVMFLAGS_INDEX] = flags;
-+}
-+
-+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;
-+}
-+
-+#else /* !defined(CONFIG_XEN) */
-+
-+/* Multicalls not supported for HVM guests. */
-+#define MULTI_update_va_mapping(a,b,c,d) ((void)0)
-+#define MULTI_grant_table_op(a,b,c,d) ((void)0)
-+
-+#endif
-+
-+#endif /* __HYPERVISOR_H__ */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/irqflags_32.h
-@@ -0,0 +1,127 @@
-+/*
-+ * include/asm-i386/irqflags.h
-+ *
-+ * IRQ flags handling
-+ *
-+ * This file gets included from lowlevel asm headers too, to provide
-+ * wrapped versions of the local_irq_*() APIs, based on the
-+ * raw_local_irq_*() functions from the lowlevel headers.
-+ */
-+#ifndef _ASM_IRQFLAGS_H
-+#define _ASM_IRQFLAGS_H
-+
-+#ifndef __ASSEMBLY__
-+
-+/*
-+ * The use of 'barrier' in the following reflects their use as local-lock
-+ * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
-+ * critical operations are executed. All critical operations must complete
-+ * /before/ reentrancy is permitted (e.g., __sti()). Alpha architecture also
-+ * includes these barriers, for example.
-+ */
-+
-+#define __raw_local_save_flags() (current_vcpu_info()->evtchn_upcall_mask)
-+
-+#define raw_local_save_flags(flags) \
-+ do { (flags) = __raw_local_save_flags(); } while (0)
-+
-+#define raw_local_irq_restore(x) \
-+do { \
-+ vcpu_info_t *_vcpu; \
-+ barrier(); \
-+ _vcpu = current_vcpu_info(); \
-+ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \
-+ barrier(); /* unmask then check (avoid races) */ \
-+ if (unlikely(_vcpu->evtchn_upcall_pending)) \
-+ force_evtchn_callback(); \
-+ } \
-+} while (0)
-+
-+#define raw_local_irq_disable() \
-+do { \
-+ current_vcpu_info()->evtchn_upcall_mask = 1; \
-+ barrier(); \
-+} while (0)
-+
-+#define raw_local_irq_enable() \
-+do { \
-+ vcpu_info_t *_vcpu; \
-+ barrier(); \
-+ _vcpu = current_vcpu_info(); \
-+ _vcpu->evtchn_upcall_mask = 0; \
-+ barrier(); /* unmask then check (avoid races) */ \
-+ if (unlikely(_vcpu->evtchn_upcall_pending)) \
-+ force_evtchn_callback(); \
-+} while (0)
-+
-+/*
-+ * Used in the idle loop; sti takes one instruction cycle
-+ * to complete:
-+ */
-+void raw_safe_halt(void);
-+
-+/*
-+ * Used when interrupts are already enabled or to
-+ * shutdown the processor:
-+ */
-+void halt(void);
-+
-+static inline int raw_irqs_disabled_flags(unsigned long flags)
-+{
-+ return (flags != 0);
-+}
-+
-+#define raw_irqs_disabled() \
-+({ \
-+ unsigned long flags = __raw_local_save_flags(); \
-+ \
-+ raw_irqs_disabled_flags(flags); \
-+})
-+
-+/*
-+ * For spinlocks, etc:
-+ */
-+#define __raw_local_irq_save() \
-+({ \
-+ unsigned long flags = __raw_local_save_flags(); \
-+ \
-+ raw_local_irq_disable(); \
-+ \
-+ flags; \
-+})
-+
-+#define raw_local_irq_save(flags) \
-+ do { (flags) = __raw_local_irq_save(); } while (0)
-+
-+#endif /* __ASSEMBLY__ */
-+
-+/*
-+ * Do the CPU's IRQ-state tracing from assembly code. We call a
-+ * C function, so save all the C-clobbered registers:
-+ */
-+#ifdef CONFIG_TRACE_IRQFLAGS
-+
-+# define TRACE_IRQS_ON \
-+ pushl %eax; \
-+ pushl %ecx; \
-+ pushl %edx; \
-+ call trace_hardirqs_on; \
-+ popl %edx; \
-+ popl %ecx; \
-+ popl %eax;
-+
-+# define TRACE_IRQS_OFF \
-+ pushl %eax; \
-+ pushl %ecx; \
-+ pushl %edx; \
-+ call trace_hardirqs_off; \
-+ popl %edx; \
-+ popl %ecx; \
-+ popl %eax;
-+
-+#else
-+# define TRACE_IRQS_ON
-+# define TRACE_IRQS_OFF
-+#endif
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/irqflags_64.h
-@@ -0,0 +1,139 @@
-+/*
-+ * include/asm-x86_64/irqflags.h
-+ *
-+ * IRQ flags handling
-+ *
-+ * This file gets included from lowlevel asm headers too, to provide
-+ * wrapped versions of the local_irq_*() APIs, based on the
-+ * raw_local_irq_*() functions from the lowlevel headers.
-+ */
-+#ifndef _ASM_IRQFLAGS_H
-+#define _ASM_IRQFLAGS_H
-+
-+#ifndef __ASSEMBLY__
-+/*
-+ * Interrupt control:
-+ */
-+
-+/*
-+ * The use of 'barrier' in the following reflects their use as local-lock
-+ * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
-+ * critical operations are executed. All critical operations must complete
-+ * /before/ reentrancy is permitted (e.g., __sti()). Alpha architecture also
-+ * includes these barriers, for example.
-+ */
-+
-+#define __raw_local_save_flags() (current_vcpu_info()->evtchn_upcall_mask)
-+
-+#define raw_local_save_flags(flags) \
-+ do { (flags) = __raw_local_save_flags(); } while (0)
-+
-+#define raw_local_irq_restore(x) \
-+do { \
-+ vcpu_info_t *_vcpu; \
-+ barrier(); \
-+ _vcpu = current_vcpu_info(); \
-+ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \
-+ barrier(); /* unmask then check (avoid races) */ \
-+ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \
-+ force_evtchn_callback(); \
-+ } \
-+} while (0)
-+
-+#ifdef CONFIG_X86_VSMP
-+
-+/*
-+ * Interrupt control for the VSMP architecture:
-+ */
-+
-+static inline void raw_local_irq_disable(void)
-+{
-+ unsigned long flags = __raw_local_save_flags();
-+
-+ raw_local_irq_restore((flags & ~(1 << 9)) | (1 << 18));
-+}
-+
-+static inline void raw_local_irq_enable(void)
-+{
-+ unsigned long flags = __raw_local_save_flags();
-+
-+ raw_local_irq_restore((flags | (1 << 9)) & ~(1 << 18));
-+}
-+
-+static inline int raw_irqs_disabled_flags(unsigned long flags)
-+{
-+ return !(flags & (1<<9)) || (flags & (1 << 18));
-+}
-+
-+#else /* CONFIG_X86_VSMP */
-+
-+#define raw_local_irq_disable() \
-+do { \
-+ current_vcpu_info()->evtchn_upcall_mask = 1; \
-+ barrier(); \
-+} while (0)
-+
-+#define raw_local_irq_enable() \
-+do { \
-+ vcpu_info_t *_vcpu; \
-+ barrier(); \
-+ _vcpu = current_vcpu_info(); \
-+ _vcpu->evtchn_upcall_mask = 0; \
-+ barrier(); /* unmask then check (avoid races) */ \
-+ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \
-+ force_evtchn_callback(); \
-+} while (0)
-+
-+static inline int raw_irqs_disabled_flags(unsigned long flags)
-+{
-+ return (flags != 0);
-+}
-+
-+#endif
-+
-+/*
-+ * For spinlocks, etc.:
-+ */
-+
-+#define __raw_local_irq_save() \
-+({ \
-+ unsigned long flags = __raw_local_save_flags(); \
-+ \
-+ raw_local_irq_disable(); \
-+ \
-+ flags; \
-+})
-+
-+#define raw_local_irq_save(flags) \
-+ do { (flags) = __raw_local_irq_save(); } while (0)
-+
-+#define raw_irqs_disabled() \
-+({ \
-+ unsigned long flags = __raw_local_save_flags(); \
-+ \
-+ raw_irqs_disabled_flags(flags); \
-+})
-+
-+/*
-+ * Used in the idle loop; sti takes one instruction cycle
-+ * to complete:
-+ */
-+void raw_safe_halt(void);
-+
-+/*
-+ * Used when interrupts are already enabled or to
-+ * shutdown the processor:
-+ */
-+void halt(void);
-+
-+#else /* __ASSEMBLY__: */
-+# ifdef CONFIG_TRACE_IRQFLAGS
-+# define TRACE_IRQS_ON call trace_hardirqs_on_thunk
-+# define TRACE_IRQS_OFF call trace_hardirqs_off_thunk
-+# else
-+# define TRACE_IRQS_ON
-+# define TRACE_IRQS_OFF
-+# endif
-+#endif
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/mach_traps.h
-@@ -0,0 +1,33 @@
-+/*
-+ * include/asm-xen/asm-i386/mach-xen/mach_traps.h
-+ *
-+ * Machine specific NMI handling for Xen
-+ */
-+#ifndef _MACH_TRAPS_H
-+#define _MACH_TRAPS_H
-+
-+#include <linux/bitops.h>
-+#include <xen/interface/nmi.h>
-+
-+static inline void clear_mem_error(unsigned char reason) {}
-+static inline void clear_io_check_error(unsigned char reason) {}
-+
-+static inline unsigned char get_nmi_reason(void)
-+{
-+ shared_info_t *s = HYPERVISOR_shared_info;
-+ unsigned char reason = 0;
-+
-+ /* construct a value which looks like it came from
-+ * port 0x61.
-+ */
-+ if (test_bit(_XEN_NMIREASON_io_error, &s->arch.nmi_reason))
-+ reason |= 0x40;
-+ if (test_bit(_XEN_NMIREASON_parity_error, &s->arch.nmi_reason))
-+ reason |= 0x80;
-+
-+ return reason;
-+}
-+
-+static inline void reassert_nmi(void) {}
-+
-+#endif /* !_MACH_TRAPS_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/maddr_32.h
-@@ -0,0 +1,193 @@
-+#ifndef _I386_MADDR_H
-+#define _I386_MADDR_H
-+
-+#include <xen/features.h>
-+#include <xen/interface/xen.h>
-+
-+/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
-+#define INVALID_P2M_ENTRY (~0UL)
-+#define FOREIGN_FRAME_BIT (1UL<<31)
-+#define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT)
-+
-+/* Definitions for machine and pseudophysical addresses. */
-+#ifdef CONFIG_X86_PAE
-+typedef unsigned long long paddr_t;
-+typedef unsigned long long maddr_t;
-+#else
-+typedef unsigned long paddr_t;
-+typedef unsigned long maddr_t;
-+#endif
-+
-+#ifdef CONFIG_XEN
-+
-+extern unsigned long *phys_to_machine_mapping;
-+extern unsigned long max_mapnr;
-+
-+#undef machine_to_phys_mapping
-+extern unsigned long *machine_to_phys_mapping;
-+extern unsigned int machine_to_phys_order;
-+
-+static inline unsigned long pfn_to_mfn(unsigned long pfn)
-+{
-+ if (xen_feature(XENFEAT_auto_translated_physmap))
-+ return pfn;
-+ BUG_ON(max_mapnr && pfn >= max_mapnr);
-+ return phys_to_machine_mapping[pfn] & ~FOREIGN_FRAME_BIT;
-+}
-+
-+static inline int phys_to_machine_mapping_valid(unsigned long pfn)
-+{
-+ if (xen_feature(XENFEAT_auto_translated_physmap))
-+ return 1;
-+ BUG_ON(max_mapnr && pfn >= max_mapnr);
-+ return (phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY);
-+}
-+
-+static inline unsigned long mfn_to_pfn(unsigned long mfn)
-+{
-+ unsigned long pfn;
-+
-+ if (xen_feature(XENFEAT_auto_translated_physmap))
-+ return mfn;
-+
-+ if (unlikely((mfn >> machine_to_phys_order) != 0))
-+ return max_mapnr;
-+
-+ /* The array access can fail (e.g., device space beyond end of RAM). */
-+ asm (
-+ "1: movl %1,%0\n"
-+ "2:\n"
-+ ".section .fixup,\"ax\"\n"
-+ "3: movl %2,%0\n"
-+ " jmp 2b\n"
-+ ".previous\n"
-+ ".section __ex_table,\"a\"\n"
-+ " .align 4\n"
-+ " .long 1b,3b\n"
-+ ".previous"
-+ : "=r" (pfn)
-+ : "m" (machine_to_phys_mapping[mfn]), "m" (max_mapnr) );
-+
-+ return pfn;
-+}
-+
-+/*
-+ * We detect special mappings in one of two ways:
-+ * 1. If the MFN is an I/O page then Xen will set the m2p entry
-+ * to be outside our maximum possible pseudophys range.
-+ * 2. If the MFN belongs to a different domain then we will certainly
-+ * not have MFN in our p2m table. Conversely, if the page is ours,
-+ * then we'll have p2m(m2p(MFN))==MFN.
-+ * If we detect a special mapping then it doesn't have a 'struct page'.
-+ * We force !pfn_valid() by returning an out-of-range pointer.
-+ *
-+ * NB. These checks require that, for any MFN that is not in our reservation,
-+ * there is no PFN such that p2m(PFN) == MFN. Otherwise we can get confused if
-+ * we are foreign-mapping the MFN, and the other domain as m2p(MFN) == PFN.
-+ * Yikes! Various places must poke in INVALID_P2M_ENTRY for safety.
-+ *
-+ * NB2. When deliberately mapping foreign pages into the p2m table, you *must*
-+ * use FOREIGN_FRAME(). This will cause pte_pfn() to choke on it, as we
-+ * require. In all the cases we care about, the FOREIGN_FRAME bit is
-+ * masked (e.g., pfn_to_mfn()) so behaviour there is correct.
-+ */
-+static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
-+{
-+ unsigned long pfn = mfn_to_pfn(mfn);
-+ if ((pfn < max_mapnr)
-+ && !xen_feature(XENFEAT_auto_translated_physmap)
-+ && (phys_to_machine_mapping[pfn] != mfn))
-+ return max_mapnr; /* force !pfn_valid() */
-+ return pfn;
-+}
-+
-+static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
-+{
-+ BUG_ON(max_mapnr && pfn >= max_mapnr);
-+ if (xen_feature(XENFEAT_auto_translated_physmap)) {
-+ BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
-+ return;
-+ }
-+ phys_to_machine_mapping[pfn] = mfn;
-+}
-+
-+static inline maddr_t phys_to_machine(paddr_t phys)
-+{
-+ maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT);
-+ machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
-+ return machine;
-+}
-+
-+static inline paddr_t machine_to_phys(maddr_t machine)
-+{
-+ paddr_t phys = mfn_to_pfn(machine >> PAGE_SHIFT);
-+ phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
-+ return phys;
-+}
-+
-+#ifdef CONFIG_X86_PAE
-+static inline paddr_t pte_phys_to_machine(paddr_t phys)
-+{
-+ /*
-+ * In PAE mode, the NX bit needs to be dealt with in the value
-+ * passed to pfn_to_mfn(). On x86_64, we need to mask it off,
-+ * but for i386 the conversion to ulong for the argument will
-+ * clip it off.
-+ */
-+ maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT);
-+ machine = (machine << PAGE_SHIFT) | (phys & ~PHYSICAL_PAGE_MASK);
-+ return machine;
-+}
-+
-+static inline paddr_t pte_machine_to_phys(maddr_t machine)
-+{
-+ /*
-+ * In PAE mode, the NX bit needs to be dealt with in the value
-+ * passed to mfn_to_pfn(). On x86_64, we need to mask it off,
-+ * but for i386 the conversion to ulong for the argument will
-+ * clip it off.
-+ */
-+ paddr_t phys = mfn_to_pfn(machine >> PAGE_SHIFT);
-+ phys = (phys << PAGE_SHIFT) | (machine & ~PHYSICAL_PAGE_MASK);
-+ return phys;
-+}
-+#endif
-+
-+#ifdef CONFIG_X86_PAE
-+#define __pte_ma(x) ((pte_t) { (x), (maddr_t)(x) >> 32 } )
-+static inline pte_t pfn_pte_ma(unsigned long page_nr, pgprot_t pgprot)
-+{
-+ pte_t pte;
-+
-+ pte.pte_high = (page_nr >> (32 - PAGE_SHIFT)) | \
-+ (pgprot_val(pgprot) >> 32);
-+ pte.pte_high &= (__supported_pte_mask >> 32);
-+ pte.pte_low = ((page_nr << PAGE_SHIFT) | pgprot_val(pgprot)) & \
-+ __supported_pte_mask;
-+ return pte;
-+}
-+#else
-+#define __pte_ma(x) ((pte_t) { (x) } )
-+#define pfn_pte_ma(pfn, prot) __pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
-+#endif
-+
-+#else /* !CONFIG_XEN */
-+
-+#define pfn_to_mfn(pfn) (pfn)
-+#define mfn_to_pfn(mfn) (mfn)
-+#define mfn_to_local_pfn(mfn) (mfn)
-+#define set_phys_to_machine(pfn, mfn) ((void)0)
-+#define phys_to_machine_mapping_valid(pfn) (1)
-+#define phys_to_machine(phys) ((maddr_t)(phys))
-+#define machine_to_phys(mach) ((paddr_t)(mach))
-+#define pfn_pte_ma(pfn, prot) pfn_pte(pfn, prot)
-+#define __pte_ma(x) __pte(x)
-+
-+#endif /* !CONFIG_XEN */
-+
-+/* 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))
-+
-+#endif /* _I386_MADDR_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/maddr_64.h
-@@ -0,0 +1,161 @@
-+#ifndef _X86_64_MADDR_H
-+#define _X86_64_MADDR_H
-+
-+#include <xen/features.h>
-+#include <xen/interface/xen.h>
-+
-+/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
-+#define INVALID_P2M_ENTRY (~0UL)
-+#define FOREIGN_FRAME_BIT (1UL<<63)
-+#define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT)
-+
-+/* Definitions for machine and pseudophysical addresses. */
-+typedef unsigned long paddr_t;
-+typedef unsigned long maddr_t;
-+
-+#ifdef CONFIG_XEN
-+
-+extern unsigned long *phys_to_machine_mapping;
-+
-+#undef machine_to_phys_mapping
-+extern unsigned long *machine_to_phys_mapping;
-+extern unsigned int machine_to_phys_order;
-+
-+static inline unsigned long pfn_to_mfn(unsigned long pfn)
-+{
-+ if (xen_feature(XENFEAT_auto_translated_physmap))
-+ return pfn;
-+ BUG_ON(end_pfn && pfn >= end_pfn);
-+ return phys_to_machine_mapping[pfn] & ~FOREIGN_FRAME_BIT;
-+}
-+
-+static inline int phys_to_machine_mapping_valid(unsigned long pfn)
-+{
-+ if (xen_feature(XENFEAT_auto_translated_physmap))
-+ return 1;
-+ BUG_ON(end_pfn && pfn >= end_pfn);
-+ return (phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY);
-+}
-+
-+static inline unsigned long mfn_to_pfn(unsigned long mfn)
-+{
-+ unsigned long pfn;
-+
-+ if (xen_feature(XENFEAT_auto_translated_physmap))
-+ return mfn;
-+
-+ if (unlikely((mfn >> machine_to_phys_order) != 0))
-+ return end_pfn;
-+
-+ /* The array access can fail (e.g., device space beyond end of RAM). */
-+ asm (
-+ "1: movq %1,%0\n"
-+ "2:\n"
-+ ".section .fixup,\"ax\"\n"
-+ "3: movq %2,%0\n"
-+ " jmp 2b\n"
-+ ".previous\n"
-+ ".section __ex_table,\"a\"\n"
-+ " .align 8\n"
-+ " .quad 1b,3b\n"
-+ ".previous"
-+ : "=r" (pfn)
-+ : "m" (machine_to_phys_mapping[mfn]), "m" (end_pfn) );
-+
-+ return pfn;
-+}
-+
-+/*
-+ * We detect special mappings in one of two ways:
-+ * 1. If the MFN is an I/O page then Xen will set the m2p entry
-+ * to be outside our maximum possible pseudophys range.
-+ * 2. If the MFN belongs to a different domain then we will certainly
-+ * not have MFN in our p2m table. Conversely, if the page is ours,
-+ * then we'll have p2m(m2p(MFN))==MFN.
-+ * If we detect a special mapping then it doesn't have a 'struct page'.
-+ * We force !pfn_valid() by returning an out-of-range pointer.
-+ *
-+ * NB. These checks require that, for any MFN that is not in our reservation,
-+ * there is no PFN such that p2m(PFN) == MFN. Otherwise we can get confused if
-+ * we are foreign-mapping the MFN, and the other domain as m2p(MFN) == PFN.
-+ * Yikes! Various places must poke in INVALID_P2M_ENTRY for safety.
-+ *
-+ * NB2. When deliberately mapping foreign pages into the p2m table, you *must*
-+ * use FOREIGN_FRAME(). This will cause pte_pfn() to choke on it, as we
-+ * require. In all the cases we care about, the FOREIGN_FRAME bit is
-+ * masked (e.g., pfn_to_mfn()) so behaviour there is correct.
-+ */
-+static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
-+{
-+ unsigned long pfn = mfn_to_pfn(mfn);
-+ if ((pfn < end_pfn)
-+ && !xen_feature(XENFEAT_auto_translated_physmap)
-+ && (phys_to_machine_mapping[pfn] != mfn))
-+ return end_pfn; /* force !pfn_valid() */
-+ return pfn;
-+}
-+
-+static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
-+{
-+ BUG_ON(end_pfn && pfn >= end_pfn);
-+ if (xen_feature(XENFEAT_auto_translated_physmap)) {
-+ BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
-+ return;
-+ }
-+ phys_to_machine_mapping[pfn] = mfn;
-+}
-+
-+static inline maddr_t phys_to_machine(paddr_t phys)
-+{
-+ maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT);
-+ machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
-+ return machine;
-+}
-+
-+static inline paddr_t machine_to_phys(maddr_t machine)
-+{
-+ paddr_t phys = mfn_to_pfn(machine >> PAGE_SHIFT);
-+ phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
-+ return phys;
-+}
-+
-+static inline paddr_t pte_phys_to_machine(paddr_t phys)
-+{
-+ maddr_t machine;
-+ machine = pfn_to_mfn((phys & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT);
-+ machine = (machine << PAGE_SHIFT) | (phys & ~PHYSICAL_PAGE_MASK);
-+ return machine;
-+}
-+
-+static inline paddr_t pte_machine_to_phys(maddr_t machine)
-+{
-+ paddr_t phys;
-+ phys = mfn_to_pfn((machine & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT);
-+ phys = (phys << PAGE_SHIFT) | (machine & ~PHYSICAL_PAGE_MASK);
-+ return phys;
-+}
-+
-+#define __pte_ma(x) ((pte_t) { (x) } )
-+#define pfn_pte_ma(pfn, prot) __pte_ma((((pfn) << PAGE_SHIFT) | pgprot_val(prot)) & __supported_pte_mask)
-+
-+#else /* !CONFIG_XEN */
-+
-+#define pfn_to_mfn(pfn) (pfn)
-+#define mfn_to_pfn(mfn) (mfn)
-+#define mfn_to_local_pfn(mfn) (mfn)
-+#define set_phys_to_machine(pfn, mfn) ((void)0)
-+#define phys_to_machine_mapping_valid(pfn) (1)
-+#define phys_to_machine(phys) ((maddr_t)(phys))
-+#define machine_to_phys(mach) ((paddr_t)(mach))
-+#define pfn_pte_ma(pfn, prot) pfn_pte(pfn, prot)
-+#define __pte_ma(x) __pte(x)
-+
-+#endif /* !CONFIG_XEN */
-+
-+/* 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))
-+
-+#endif /* _X86_64_MADDR_H */
-+
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/mmu_context_32.h
-@@ -0,0 +1,108 @@
-+#ifndef __I386_SCHED_H
-+#define __I386_SCHED_H
-+
-+#include <asm/desc.h>
-+#include <asm/atomic.h>
-+#include <asm/pgalloc.h>
-+#include <asm/tlbflush.h>
-+
-+/*
-+ * Used for LDT copy/destruction.
-+ */
-+int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
-+void destroy_context(struct mm_struct *mm);
-+
-+
-+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-+{
-+#if 0 /* XEN: no lazy tlb */
-+ unsigned cpu = smp_processor_id();
-+ if (per_cpu(cpu_tlbstate, cpu).state == TLBSTATE_OK)
-+ per_cpu(cpu_tlbstate, cpu).state = TLBSTATE_LAZY;
-+#endif
-+}
-+
-+#define prepare_arch_switch(next) __prepare_arch_switch()
-+
-+static inline void __prepare_arch_switch(void)
-+{
-+ /*
-+ * Save away %fs and %gs. No need to save %es and %ds, as those
-+ * are always kernel segments while inside the kernel. Must
-+ * happen before reload of cr3/ldt (i.e., not in __switch_to).
-+ */
-+ asm volatile ( "mov %%fs,%0 ; mov %%gs,%1"
-+ : "=m" (current->thread.fs),
-+ "=m" (current->thread.gs));
-+ asm volatile ( "movl %0,%%fs ; movl %0,%%gs"
-+ : : "r" (0) );
-+}
-+
-+extern void mm_pin(struct mm_struct *mm);
-+extern void mm_unpin(struct mm_struct *mm);
-+void mm_pin_all(void);
-+
-+static inline void switch_mm(struct mm_struct *prev,
-+ struct mm_struct *next,
-+ struct task_struct *tsk)
-+{
-+ int cpu = smp_processor_id();
-+ struct mmuext_op _op[2], *op = _op;
-+
-+ if (likely(prev != next)) {
-+ BUG_ON(!xen_feature(XENFEAT_writable_page_tables) &&
-+ !test_bit(PG_pinned, &virt_to_page(next->pgd)->flags));
-+
-+ /* stop flush ipis for the previous mm */
-+ cpu_clear(cpu, prev->cpu_vm_mask);
-+#if 0 /* XEN: no lazy tlb */
-+ per_cpu(cpu_tlbstate, cpu).state = TLBSTATE_OK;
-+ per_cpu(cpu_tlbstate, cpu).active_mm = next;
-+#endif
-+ cpu_set(cpu, next->cpu_vm_mask);
-+
-+ /* Re-load page tables: load_cr3(next->pgd) */
-+ op->cmd = MMUEXT_NEW_BASEPTR;
-+ op->arg1.mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
-+ op++;
-+
-+ /*
-+ * load the LDT, if the LDT is different:
-+ */
-+ if (unlikely(prev->context.ldt != next->context.ldt)) {
-+ /* load_LDT_nolock(&next->context, cpu) */
-+ op->cmd = MMUEXT_SET_LDT;
-+ op->arg1.linear_addr = (unsigned long)next->context.ldt;
-+ op->arg2.nr_ents = next->context.size;
-+ op++;
-+ }
-+
-+ BUG_ON(HYPERVISOR_mmuext_op(_op, op-_op, NULL, DOMID_SELF));
-+ }
-+#if 0 /* XEN: no lazy tlb */
-+ else {
-+ per_cpu(cpu_tlbstate, cpu).state = TLBSTATE_OK;
-+ BUG_ON(per_cpu(cpu_tlbstate, cpu).active_mm != next);
-+
-+ if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
-+ /* We were in lazy tlb mode and leave_mm disabled
-+ * tlb flush IPI delivery. We must reload %cr3.
-+ */
-+ load_cr3(next->pgd);
-+ load_LDT_nolock(&next->context, cpu);
-+ }
-+ }
-+#endif
-+}
-+
-+#define deactivate_mm(tsk, mm) \
-+ asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0))
-+
-+static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
-+{
-+ if (!test_bit(PG_pinned, &virt_to_page(next->pgd)->flags))
-+ mm_pin(next);
-+ switch_mm(prev, next, NULL);
-+}
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/mmu_context_64.h
-@@ -0,0 +1,136 @@
-+#ifndef __X86_64_MMU_CONTEXT_H
-+#define __X86_64_MMU_CONTEXT_H
-+
-+#include <asm/desc.h>
-+#include <asm/atomic.h>
-+#include <asm/pgalloc.h>
-+#include <asm/page.h>
-+#include <asm/pda.h>
-+#include <asm/pgtable.h>
-+#include <asm/tlbflush.h>
-+
-+/*
-+ * possibly do the LDT unload here?
-+ */
-+int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
-+void destroy_context(struct mm_struct *mm);
-+
-+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-+{
-+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
-+ if (read_pda(mmu_state) == TLBSTATE_OK)
-+ write_pda(mmu_state, TLBSTATE_LAZY);
-+#endif
-+}
-+
-+#define prepare_arch_switch(next) __prepare_arch_switch()
-+
-+static inline void __prepare_arch_switch(void)
-+{
-+ /*
-+ * Save away %es, %ds, %fs and %gs. Must happen before reload
-+ * of cr3/ldt (i.e., not in __switch_to).
-+ */
-+ __asm__ __volatile__ (
-+ "mov %%es,%0 ; mov %%ds,%1 ; mov %%fs,%2 ; mov %%gs,%3"
-+ : "=m" (current->thread.es),
-+ "=m" (current->thread.ds),
-+ "=m" (current->thread.fsindex),
-+ "=m" (current->thread.gsindex) );
-+
-+ if (current->thread.ds)
-+ __asm__ __volatile__ ( "movl %0,%%ds" : : "r" (0) );
-+
-+ if (current->thread.es)
-+ __asm__ __volatile__ ( "movl %0,%%es" : : "r" (0) );
-+
-+ if (current->thread.fsindex) {
-+ __asm__ __volatile__ ( "movl %0,%%fs" : : "r" (0) );
-+ current->thread.fs = 0;
-+ }
-+
-+ if (current->thread.gsindex) {
-+ load_gs_index(0);
-+ current->thread.gs = 0;
-+ }
-+}
-+
-+extern void mm_pin(struct mm_struct *mm);
-+extern void mm_unpin(struct mm_struct *mm);
-+void mm_pin_all(void);
-+
-+static inline void load_cr3(pgd_t *pgd)
-+{
-+ asm volatile("movq %0,%%cr3" :: "r" (phys_to_machine(__pa(pgd))) :
-+ "memory");
-+}
-+
-+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
-+ struct task_struct *tsk)
-+{
-+ unsigned cpu = smp_processor_id();
-+ struct mmuext_op _op[3], *op = _op;
-+
-+ if (likely(prev != next)) {
-+ BUG_ON(!xen_feature(XENFEAT_writable_page_tables) &&
-+ !next->context.pinned);
-+
-+ /* stop flush ipis for the previous mm */
-+ cpu_clear(cpu, prev->cpu_vm_mask);
-+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
-+ write_pda(mmu_state, TLBSTATE_OK);
-+ write_pda(active_mm, next);
-+#endif
-+ cpu_set(cpu, next->cpu_vm_mask);
-+
-+ /* load_cr3(next->pgd) */
-+ op->cmd = MMUEXT_NEW_BASEPTR;
-+ op->arg1.mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
-+ op++;
-+
-+ /* xen_new_user_pt(__pa(__user_pgd(next->pgd))) */
-+ op->cmd = MMUEXT_NEW_USER_BASEPTR;
-+ op->arg1.mfn = pfn_to_mfn(__pa(__user_pgd(next->pgd)) >> PAGE_SHIFT);
-+ op++;
-+
-+ if (unlikely(next->context.ldt != prev->context.ldt)) {
-+ /* load_LDT_nolock(&next->context, cpu) */
-+ op->cmd = MMUEXT_SET_LDT;
-+ op->arg1.linear_addr = (unsigned long)next->context.ldt;
-+ op->arg2.nr_ents = next->context.size;
-+ op++;
-+ }
-+
-+ BUG_ON(HYPERVISOR_mmuext_op(_op, op-_op, NULL, DOMID_SELF));
-+ }
-+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
-+ else {
-+ write_pda(mmu_state, TLBSTATE_OK);
-+ if (read_pda(active_mm) != next)
-+ out_of_line_bug();
-+ if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
-+ /* We were in lazy tlb mode and leave_mm disabled
-+ * tlb flush IPI delivery. We must reload CR3
-+ * to make sure to use no freed page tables.
-+ */
-+ load_cr3(next->pgd);
-+ xen_new_user_pt(__pa(__user_pgd(next->pgd)));
-+ load_LDT_nolock(&next->context, cpu);
-+ }
-+ }
-+#endif
-+}
-+
-+#define deactivate_mm(tsk,mm) do { \
-+ load_gs_index(0); \
-+ asm volatile("movl %0,%%fs"::"r"(0)); \
-+} while(0)
-+
-+static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
-+{
-+ if (!next->context.pinned)
-+ mm_pin(next);
-+ switch_mm(prev, next, NULL);
-+}
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/pgalloc_32.h
-@@ -0,0 +1,59 @@
-+#ifndef _I386_PGALLOC_H
-+#define _I386_PGALLOC_H
-+
-+#include <asm/fixmap.h>
-+#include <linux/threads.h>
-+#include <linux/mm.h> /* for struct page */
-+#include <asm/io.h> /* for phys_to_virt and page_to_pseudophys */
-+
-+#define pmd_populate_kernel(mm, pmd, pte) \
-+ set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
-+
-+#define pmd_populate(mm, pmd, pte) \
-+do { \
-+ unsigned long pfn = page_to_pfn(pte); \
-+ if (test_bit(PG_pinned, &virt_to_page((mm)->pgd)->flags)) { \
-+ if (!PageHighMem(pte)) \
-+ BUG_ON(HYPERVISOR_update_va_mapping( \
-+ (unsigned long)__va(pfn << PAGE_SHIFT), \
-+ pfn_pte(pfn, PAGE_KERNEL_RO), 0)); \
-+ else if (!test_and_set_bit(PG_pinned, &pte->flags)) \
-+ kmap_flush_unused(); \
-+ set_pmd(pmd, \
-+ __pmd(_PAGE_TABLE + ((paddr_t)pfn << PAGE_SHIFT))); \
-+ } else \
-+ *(pmd) = __pmd(_PAGE_TABLE + ((paddr_t)pfn << PAGE_SHIFT)); \
-+} while (0)
-+
-+/*
-+ * Allocate and free page tables.
-+ */
-+extern pgd_t *pgd_alloc(struct mm_struct *);
-+extern void pgd_free(pgd_t *pgd);
-+
-+extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
-+extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
-+
-+static inline void pte_free_kernel(pte_t *pte)
-+{
-+ make_lowmem_page_writable(pte, XENFEAT_writable_page_tables);
-+ free_page((unsigned long)pte);
-+}
-+
-+extern void pte_free(struct page *pte);
-+
-+#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
-+
-+#ifdef CONFIG_X86_PAE
-+/*
-+ * In the PAE case we free the pmds as part of the pgd.
-+ */
-+#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
-+#define pmd_free(x) do { } while (0)
-+#define __pmd_free_tlb(tlb,x) do { } while (0)
-+#define pud_populate(mm, pmd, pte) BUG()
-+#endif
-+
-+#define check_pgt_cache() do { } while (0)
-+
-+#endif /* _I386_PGALLOC_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/pgalloc_64.h
-@@ -0,0 +1,204 @@
-+#ifndef _X86_64_PGALLOC_H
-+#define _X86_64_PGALLOC_H
-+
-+#include <asm/fixmap.h>
-+#include <asm/pda.h>
-+#include <linux/threads.h>
-+#include <linux/mm.h>
-+#include <asm/io.h> /* for phys_to_virt and page_to_pseudophys */
-+
-+#include <xen/features.h>
-+void make_page_readonly(void *va, unsigned int feature);
-+void make_page_writable(void *va, unsigned int feature);
-+void make_pages_readonly(void *va, unsigned int nr, unsigned int feature);
-+void make_pages_writable(void *va, unsigned int nr, unsigned int feature);
-+
-+#define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
-+
-+static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
-+{
-+ set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte)));
-+}
-+
-+static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
-+{
-+ if (unlikely((mm)->context.pinned)) {
-+ BUG_ON(HYPERVISOR_update_va_mapping(
-+ (unsigned long)__va(page_to_pfn(pte) << PAGE_SHIFT),
-+ pfn_pte(page_to_pfn(pte), PAGE_KERNEL_RO), 0));
-+ set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT)));
-+ } else {
-+ *(pmd) = __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT));
-+ }
-+}
-+
-+static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
-+{
-+ if (unlikely((mm)->context.pinned)) {
-+ BUG_ON(HYPERVISOR_update_va_mapping(
-+ (unsigned long)pmd,
-+ pfn_pte(virt_to_phys(pmd)>>PAGE_SHIFT,
-+ PAGE_KERNEL_RO), 0));
-+ set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd)));
-+ } else {
-+ *(pud) = __pud(_PAGE_TABLE | __pa(pmd));
-+ }
-+}
-+
-+/*
-+ * We need to use the batch mode here, but pgd_pupulate() won't be
-+ * be called frequently.
-+ */
-+static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
-+{
-+ if (unlikely((mm)->context.pinned)) {
-+ BUG_ON(HYPERVISOR_update_va_mapping(
-+ (unsigned long)pud,
-+ pfn_pte(virt_to_phys(pud)>>PAGE_SHIFT,
-+ PAGE_KERNEL_RO), 0));
-+ set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud)));
-+ set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(pud)));
-+ } else {
-+ *(pgd) = __pgd(_PAGE_TABLE | __pa(pud));
-+ *(__user_pgd(pgd)) = *(pgd);
-+ }
-+}
-+
-+extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr);
-+extern void pte_free(struct page *pte);
-+
-+static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
-+{
-+ struct page *pg;
-+
-+ pg = pte_alloc_one(mm, addr);
-+ return pg ? page_address(pg) : NULL;
-+}
-+
-+static inline void pmd_free(pmd_t *pmd)
-+{
-+ BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
-+ pte_free(virt_to_page(pmd));
-+}
-+
-+static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
-+{
-+ struct page *pg;
-+
-+ pg = pte_alloc_one(mm, addr);
-+ return pg ? page_address(pg) : NULL;
-+}
-+
-+static inline void pud_free(pud_t *pud)
-+{
-+ BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
-+ pte_free(virt_to_page(pud));
-+}
-+
-+static inline void pgd_list_add(pgd_t *pgd)
-+{
-+ struct page *page = virt_to_page(pgd);
-+
-+ spin_lock(&pgd_lock);
-+ page->index = (pgoff_t)pgd_list;
-+ if (pgd_list)
-+ pgd_list->private = (unsigned long)&page->index;
-+ pgd_list = page;
-+ page->private = (unsigned long)&pgd_list;
-+ spin_unlock(&pgd_lock);
-+}
-+
-+static inline void pgd_list_del(pgd_t *pgd)
-+{
-+ struct page *next, **pprev, *page = virt_to_page(pgd);
-+
-+ spin_lock(&pgd_lock);
-+ next = (struct page *)page->index;
-+ pprev = (struct page **)page->private;
-+ *pprev = next;
-+ if (next)
-+ next->private = (unsigned long)pprev;
-+ spin_unlock(&pgd_lock);
-+}
-+
-+static inline pgd_t *pgd_alloc(struct mm_struct *mm)
-+{
-+ /*
-+ * We allocate two contiguous pages for kernel and user.
-+ */
-+ unsigned boundary;
-+ pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT, 1);
-+ if (!pgd)
-+ return NULL;
-+ pgd_list_add(pgd);
-+ /*
-+ * Copy kernel pointers in from init.
-+ * Could keep a freelist or slab cache of those because the kernel
-+ * part never changes.
-+ */
-+ boundary = pgd_index(__PAGE_OFFSET);
-+ memset(pgd, 0, boundary * sizeof(pgd_t));
-+ memcpy(pgd + boundary,
-+ init_level4_pgt + boundary,
-+ (PTRS_PER_PGD - boundary) * sizeof(pgd_t));
-+
-+ memset(__user_pgd(pgd), 0, PAGE_SIZE); /* clean up user pgd */
-+ /*
-+ * Set level3_user_pgt for vsyscall area
-+ */
-+ __user_pgd(pgd)[pgd_index(VSYSCALL_START)] =
-+ __pgd(__pa_symbol(level3_user_pgt) | _PAGE_TABLE);
-+ return pgd;
-+}
-+
-+static inline void pgd_free(pgd_t *pgd)
-+{
-+ pte_t *ptep = virt_to_ptep(pgd);
-+
-+ if (!pte_write(*ptep)) {
-+ xen_pgd_unpin(__pa(pgd));
-+ BUG_ON(HYPERVISOR_update_va_mapping(
-+ (unsigned long)pgd,
-+ pfn_pte(virt_to_phys(pgd)>>PAGE_SHIFT, PAGE_KERNEL),
-+ 0));
-+ }
-+
-+ ptep = virt_to_ptep(__user_pgd(pgd));
-+
-+ if (!pte_write(*ptep)) {
-+ xen_pgd_unpin(__pa(__user_pgd(pgd)));
-+ BUG_ON(HYPERVISOR_update_va_mapping(
-+ (unsigned long)__user_pgd(pgd),
-+ pfn_pte(virt_to_phys(__user_pgd(pgd))>>PAGE_SHIFT,
-+ PAGE_KERNEL),
-+ 0));
-+ }
-+
-+ pgd_list_del(pgd);
-+ free_pages((unsigned long)pgd, 1);
-+}
-+
-+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
-+{
-+ pte_t *pte = (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
-+ if (pte)
-+ make_page_readonly(pte, XENFEAT_writable_page_tables);
-+
-+ return pte;
-+}
-+
-+/* Should really implement gc for free page table pages. This could be
-+ done with a reference count in struct page. */
-+
-+static inline void pte_free_kernel(pte_t *pte)
-+{
-+ BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
-+ make_page_writable(pte, XENFEAT_writable_page_tables);
-+ free_page((unsigned long)pte);
-+}
-+
-+#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
-+#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
-+#define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
-+
-+#endif /* _X86_64_PGALLOC_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/pgtable-3level-defs.h
-@@ -0,0 +1,24 @@
-+#ifndef _I386_PGTABLE_3LEVEL_DEFS_H
-+#define _I386_PGTABLE_3LEVEL_DEFS_H
-+
-+#define HAVE_SHARED_KERNEL_PMD 0
-+
-+/*
-+ * PGDIR_SHIFT determines what a top-level page table entry can map
-+ */
-+#define PGDIR_SHIFT 30
-+#define PTRS_PER_PGD 4
-+
-+/*
-+ * PMD_SHIFT determines the size of the area a middle-level
-+ * page table can map
-+ */
-+#define PMD_SHIFT 21
-+#define PTRS_PER_PMD 512
-+
-+/*
-+ * entries per page directory level
-+ */
-+#define PTRS_PER_PTE 512
-+
-+#endif /* _I386_PGTABLE_3LEVEL_DEFS_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/pgtable-3level.h
-@@ -0,0 +1,211 @@
-+#ifndef _I386_PGTABLE_3LEVEL_H
-+#define _I386_PGTABLE_3LEVEL_H
-+
-+#include <asm-generic/pgtable-nopud.h>
-+
-+/*
-+ * Intel Physical Address Extension (PAE) Mode - three-level page
-+ * tables on PPro+ CPUs.
-+ *
-+ * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
-+ */
-+
-+#define pte_ERROR(e) \
-+ printk("%s:%d: bad pte %p(%016Lx pfn %08lx).\n", __FILE__, __LINE__, \
-+ &(e), __pte_val(e), pte_pfn(e))
-+#define pmd_ERROR(e) \
-+ printk("%s:%d: bad pmd %p(%016Lx pfn %08Lx).\n", __FILE__, __LINE__, \
-+ &(e), __pmd_val(e), (pmd_val(e) & PTE_MASK) >> PAGE_SHIFT)
-+#define pgd_ERROR(e) \
-+ printk("%s:%d: bad pgd %p(%016Lx pfn %08Lx).\n", __FILE__, __LINE__, \
-+ &(e), __pgd_val(e), (pgd_val(e) & PTE_MASK) >> PAGE_SHIFT)
-+
-+#define pud_none(pud) 0
-+#define pud_bad(pud) 0
-+#define pud_present(pud) 1
-+
-+/*
-+ * Is the pte executable?
-+ */
-+static inline int pte_x(pte_t pte)
-+{
-+ return !(__pte_val(pte) & _PAGE_NX);
-+}
-+
-+/*
-+ * All present user-pages with !NX bit are user-executable:
-+ */
-+static inline int pte_exec(pte_t pte)
-+{
-+ return pte_user(pte) && pte_x(pte);
-+}
-+/*
-+ * All present pages with !NX bit are kernel-executable:
-+ */
-+static inline int pte_exec_kernel(pte_t pte)
-+{
-+ return pte_x(pte);
-+}
-+
-+/* Rules for using set_pte: the pte being assigned *must* be
-+ * either not present or in a state where the hardware will
-+ * not attempt to update the pte. In places where this is
-+ * not possible, use pte_get_and_clear to obtain the old pte
-+ * value and then use set_pte to update it. -ben
-+ */
-+#define __HAVE_ARCH_SET_PTE_ATOMIC
-+
-+static inline void set_pte(pte_t *ptep, pte_t pte)
-+{
-+ ptep->pte_high = pte.pte_high;
-+ smp_wmb();
-+ ptep->pte_low = pte.pte_low;
-+}
-+#define set_pte_atomic(pteptr,pteval) \
-+ set_64bit((unsigned long long *)(pteptr),__pte_val(pteval))
-+
-+#define set_pte_at(_mm,addr,ptep,pteval) do { \
-+ if (((_mm) != current->mm && (_mm) != &init_mm) || \
-+ HYPERVISOR_update_va_mapping((addr), (pteval), 0)) \
-+ set_pte((ptep), (pteval)); \
-+} while (0)
-+
-+#define set_pte_at_sync(_mm,addr,ptep,pteval) do { \
-+ if (((_mm) != current->mm && (_mm) != &init_mm) || \
-+ HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
-+ set_pte((ptep), (pteval)); \
-+ xen_invlpg((addr)); \
-+ } \
-+} while (0)
-+
-+#define set_pmd(pmdptr,pmdval) \
-+ xen_l2_entry_update((pmdptr), (pmdval))
-+#define set_pud(pudptr,pudval) \
-+ xen_l3_entry_update((pudptr), (pudval))
-+
-+/*
-+ * Pentium-II erratum A13: in PAE mode we explicitly have to flush
-+ * the TLB via cr3 if the top-level pgd is changed...
-+ * We do not let the generic code free and clear pgd entries due to
-+ * this erratum.
-+ */
-+static inline void pud_clear (pud_t * pud) { }
-+
-+#define pud_page(pud) \
-+((struct page *) __va(pud_val(pud) & PAGE_MASK))
-+
-+#define pud_page_kernel(pud) \
-+((unsigned long) __va(pud_val(pud) & PAGE_MASK))
-+
-+
-+/* Find an entry in the second-level page table.. */
-+#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \
-+ pmd_index(address))
-+
-+static inline int pte_none(pte_t pte)
-+{
-+ return !(pte.pte_low | pte.pte_high);
-+}
-+
-+/*
-+ * For PTEs and PDEs, we must clear the P-bit first when clearing a page table
-+ * entry, so clear the bottom half first and enforce ordering with a compiler
-+ * barrier.
-+ */
-+static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-+{
-+ if ((mm != current->mm && mm != &init_mm)
-+ || HYPERVISOR_update_va_mapping(addr, __pte(0), 0)) {
-+ ptep->pte_low = 0;
-+ smp_wmb();
-+ ptep->pte_high = 0;
-+ }
-+}
-+
-+#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
-+
-+static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-+{
-+ pte_t pte = *ptep;
-+ if (!pte_none(pte)) {
-+ if ((mm != &init_mm) ||
-+ HYPERVISOR_update_va_mapping(addr, __pte(0), 0)) {
-+ uint64_t val = __pte_val(pte);
-+ if (__cmpxchg64(ptep, val, 0) != val) {
-+ /* xchg acts as a barrier before the setting of the high bits */
-+ pte.pte_low = xchg(&ptep->pte_low, 0);
-+ pte.pte_high = ptep->pte_high;
-+ ptep->pte_high = 0;
-+ }
-+ }
-+ }
-+ return pte;
-+}
-+
-+#define ptep_clear_flush(vma, addr, ptep) \
-+({ \
-+ pte_t *__ptep = (ptep); \
-+ pte_t __res = *__ptep; \
-+ if (!pte_none(__res) && \
-+ ((vma)->vm_mm != current->mm || \
-+ HYPERVISOR_update_va_mapping(addr, __pte(0), \
-+ (unsigned long)(vma)->vm_mm->cpu_vm_mask.bits| \
-+ UVMF_INVLPG|UVMF_MULTI))) { \
-+ __ptep->pte_low = 0; \
-+ smp_wmb(); \
-+ __ptep->pte_high = 0; \
-+ flush_tlb_page(vma, addr); \
-+ } \
-+ __res; \
-+})
-+
-+static inline int pte_same(pte_t a, pte_t b)
-+{
-+ return a.pte_low == b.pte_low && a.pte_high == b.pte_high;
-+}
-+
-+#define pte_page(x) pfn_to_page(pte_pfn(x))
-+
-+#define __pte_mfn(_pte) (((_pte).pte_low >> PAGE_SHIFT) | \
-+ ((_pte).pte_high << (32-PAGE_SHIFT)))
-+#define pte_mfn(_pte) ((_pte).pte_low & _PAGE_PRESENT ? \
-+ __pte_mfn(_pte) : pfn_to_mfn(__pte_mfn(_pte)))
-+#define pte_pfn(_pte) ((_pte).pte_low & _PAGE_IO ? max_mapnr : \
-+ (_pte).pte_low & _PAGE_PRESENT ? \
-+ mfn_to_local_pfn(__pte_mfn(_pte)) : \
-+ __pte_mfn(_pte))
-+
-+extern unsigned long long __supported_pte_mask;
-+
-+static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
-+{
-+ return __pte((((unsigned long long)page_nr << PAGE_SHIFT) |
-+ pgprot_val(pgprot)) & __supported_pte_mask);
-+}
-+
-+static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
-+{
-+ return __pmd((((unsigned long long)page_nr << PAGE_SHIFT) |
-+ pgprot_val(pgprot)) & __supported_pte_mask);
-+}
-+
-+/*
-+ * Bits 0, 6 and 7 are taken in the low part of the pte,
-+ * put the 32 bits of offset into the high part.
-+ */
-+#define pte_to_pgoff(pte) ((pte).pte_high)
-+#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) })
-+#define PTE_FILE_MAX_BITS 32
-+
-+/* Encode and de-code a swap entry */
-+#define __swp_type(x) (((x).val) & 0x1f)
-+#define __swp_offset(x) ((x).val >> 5)
-+#define __swp_entry(type, offset) ((swp_entry_t){(type) | (offset) << 5})
-+#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high })
-+#define __swp_entry_to_pte(x) ((pte_t){ 0, (x).val })
-+
-+#define __pmd_free_tlb(tlb, x) do { } while (0)
-+
-+void vmalloc_sync_all(void);
-+
-+#endif /* _I386_PGTABLE_3LEVEL_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/pgtable_32.h
-@@ -0,0 +1,550 @@
-+#ifndef _I386_PGTABLE_H
-+#define _I386_PGTABLE_H
-+
-+#include <asm/hypervisor.h>
-+
-+/*
-+ * The Linux memory management assumes a three-level page table setup. On
-+ * the i386, we use that, but "fold" the mid level into the top-level page
-+ * table, so that we physically have the same two-level page table as the
-+ * i386 mmu expects.
-+ *
-+ * This file contains the functions and defines necessary to modify and use
-+ * the i386 page table tree.
-+ */
-+#ifndef __ASSEMBLY__
-+#include <asm/processor.h>
-+#include <asm/fixmap.h>
-+#include <linux/threads.h>
-+
-+#ifndef _I386_BITOPS_H
-+#include <asm/bitops.h>
-+#endif
-+
-+#include <linux/slab.h>
-+#include <linux/list.h>
-+#include <linux/spinlock.h>
-+
-+/* Is this pagetable pinned? */
-+#define PG_pinned PG_arch_1
-+
-+struct mm_struct;
-+struct vm_area_struct;
-+
-+/*
-+ * ZERO_PAGE is a global shared page that is always zero: used
-+ * for zero-mapped memory areas etc..
-+ */
-+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
-+extern unsigned long empty_zero_page[1024];
-+extern pgd_t *swapper_pg_dir;
-+extern kmem_cache_t *pgd_cache;
-+extern kmem_cache_t *pmd_cache;
-+extern spinlock_t pgd_lock;
-+extern struct page *pgd_list;
-+
-+void pmd_ctor(void *, kmem_cache_t *, unsigned long);
-+void pgd_ctor(void *, kmem_cache_t *, unsigned long);
-+void pgd_dtor(void *, kmem_cache_t *, unsigned long);
-+void pgtable_cache_init(void);
-+void paging_init(void);
-+
-+/*
-+ * The Linux x86 paging architecture is 'compile-time dual-mode', it
-+ * implements both the traditional 2-level x86 page tables and the
-+ * newer 3-level PAE-mode page tables.
-+ */
-+#ifdef CONFIG_X86_PAE
-+# include <asm/pgtable-3level-defs.h>
-+# define PMD_SIZE (1UL << PMD_SHIFT)
-+# define PMD_MASK (~(PMD_SIZE-1))
-+#else
-+# include <asm/pgtable-2level-defs.h>
-+#endif
-+
-+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
-+#define PGDIR_MASK (~(PGDIR_SIZE-1))
-+
-+#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
-+#define FIRST_USER_ADDRESS 0
-+
-+#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
-+#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
-+
-+#define TWOLEVEL_PGDIR_SHIFT 22
-+#define BOOT_USER_PGD_PTRS (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)
-+#define BOOT_KERNEL_PGD_PTRS (1024-BOOT_USER_PGD_PTRS)
-+
-+/* Just any arbitrary offset to the start of the vmalloc VM area: the
-+ * current 8MB value just means that there will be a 8MB "hole" after the
-+ * physical memory until the kernel virtual memory starts. That means that
-+ * any out-of-bounds memory accesses will hopefully be caught.
-+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
-+ * area for the same reason. ;)
-+ */
-+#define VMALLOC_OFFSET (8*1024*1024)
-+#define VMALLOC_START (((unsigned long) high_memory + vmalloc_earlyreserve + \
-+ 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
-+#ifdef CONFIG_HIGHMEM
-+# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
-+#else
-+# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
-+#endif
-+
-+/*
-+ * _PAGE_PSE set in the page directory entry just means that
-+ * the page directory entry points directly to a 4MB-aligned block of
-+ * memory.
-+ */
-+#define _PAGE_BIT_PRESENT 0
-+#define _PAGE_BIT_RW 1
-+#define _PAGE_BIT_USER 2
-+#define _PAGE_BIT_PWT 3
-+#define _PAGE_BIT_PCD 4
-+#define _PAGE_BIT_ACCESSED 5
-+#define _PAGE_BIT_DIRTY 6
-+#define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page, Pentium+, if present.. */
-+#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
-+/*#define _PAGE_BIT_UNUSED1 9*/ /* available for programmer */
-+#define _PAGE_BIT_UNUSED2 10
-+#define _PAGE_BIT_UNUSED3 11
-+#define _PAGE_BIT_NX 63
-+
-+#define _PAGE_PRESENT 0x001
-+#define _PAGE_RW 0x002
-+#define _PAGE_USER 0x004
-+#define _PAGE_PWT 0x008
-+#define _PAGE_PCD 0x010
-+#define _PAGE_ACCESSED 0x020
-+#define _PAGE_DIRTY 0x040
-+#define _PAGE_PSE 0x080 /* 4 MB (or 2MB) page, Pentium+, if present.. */
-+#define _PAGE_GLOBAL 0x100 /* Global TLB entry PPro+ */
-+/*#define _PAGE_UNUSED1 0x200*/ /* available for programmer */
-+#define _PAGE_UNUSED2 0x400
-+#define _PAGE_UNUSED3 0x800
-+
-+/* If _PAGE_PRESENT is clear, we use these: */
-+#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */
-+#define _PAGE_PROTNONE 0x080 /* if the user mapped it with PROT_NONE;
-+ pte_present gives true */
-+#ifdef CONFIG_X86_PAE
-+#define _PAGE_NX (1ULL<<_PAGE_BIT_NX)
-+#else
-+#define _PAGE_NX 0
-+#endif
-+
-+/* Mapped page is I/O or foreign and has no associated page struct. */
-+#define _PAGE_IO 0x200
-+
-+#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 _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_IO)
-+
-+#define PAGE_NONE \
-+ __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
-+#define PAGE_SHARED \
-+ __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
-+
-+#define PAGE_SHARED_EXEC \
-+ __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
-+#define PAGE_COPY_NOEXEC \
-+ __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
-+#define PAGE_COPY_EXEC \
-+ __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
-+#define PAGE_COPY \
-+ PAGE_COPY_NOEXEC
-+#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)
-+#define _PAGE_KERNEL_EXEC \
-+ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
-+
-+extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
-+#define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
-+#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD)
-+#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
-+#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
-+
-+#define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
-+#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
-+#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
-+#define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
-+#define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
-+#define PAGE_KERNEL_LARGE_EXEC __pgprot(__PAGE_KERNEL_LARGE_EXEC)
-+
-+/*
-+ * The i386 can't do page protection for execute, and considers that
-+ * the same are read. Also, write permissions imply read permissions.
-+ * This is the closest we can get..
-+ */
-+#define __P000 PAGE_NONE
-+#define __P001 PAGE_READONLY
-+#define __P010 PAGE_COPY
-+#define __P011 PAGE_COPY
-+#define __P100 PAGE_READONLY_EXEC
-+#define __P101 PAGE_READONLY_EXEC
-+#define __P110 PAGE_COPY_EXEC
-+#define __P111 PAGE_COPY_EXEC
-+
-+#define __S000 PAGE_NONE
-+#define __S001 PAGE_READONLY
-+#define __S010 PAGE_SHARED
-+#define __S011 PAGE_SHARED
-+#define __S100 PAGE_READONLY_EXEC
-+#define __S101 PAGE_READONLY_EXEC
-+#define __S110 PAGE_SHARED_EXEC
-+#define __S111 PAGE_SHARED_EXEC
-+
-+/*
-+ * Define this if things work differently on an i386 and an i486:
-+ * it will (on an i486) warn about kernel memory accesses that are
-+ * done without a 'access_ok(VERIFY_WRITE,..)'
-+ */
-+#undef TEST_ACCESS_OK
-+
-+/* The boot page tables (all created as a single array) */
-+extern unsigned long pg0[];
-+
-+#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
-+
-+/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
-+#define pmd_none(x) (!(unsigned long)__pmd_val(x))
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+/* pmd_present doesn't just test the _PAGE_PRESENT bit since wr.p.t.
-+ can temporarily clear it. */
-+#define pmd_present(x) (__pmd_val(x))
-+#define pmd_bad(x) ((__pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PRESENT)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
-+#else
-+#define pmd_present(x) (__pmd_val(x) & _PAGE_PRESENT)
-+#define pmd_bad(x) ((__pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
-+#endif
-+
-+
-+#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
-+
-+/*
-+ * The following only work if pte_present() is true.
-+ * Undefined behaviour if not..
-+ */
-+static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
-+static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
-+static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; }
-+static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; }
-+static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; }
-+static inline int pte_huge(pte_t pte) { return (pte).pte_low & _PAGE_PSE; }
-+
-+/*
-+ * The following only works if pte_present() is not true.
-+ */
-+static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; }
-+
-+static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; }
-+static inline pte_t pte_exprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; }
-+static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; }
-+static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; }
-+static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; }
-+static inline pte_t pte_mkread(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; }
-+static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; }
-+static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; }
-+static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; }
-+static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; }
-+static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return pte; }
-+
-+#ifdef CONFIG_X86_PAE
-+# include <asm/pgtable-3level.h>
-+#else
-+# include <asm/pgtable-2level.h>
-+#endif
-+
-+#define ptep_test_and_clear_dirty(vma, addr, ptep) \
-+({ \
-+ pte_t __pte = *(ptep); \
-+ int __ret = pte_dirty(__pte); \
-+ if (__ret) { \
-+ __pte = pte_mkclean(__pte); \
-+ if ((vma)->vm_mm != current->mm || \
-+ HYPERVISOR_update_va_mapping(addr, __pte, 0)) \
-+ (ptep)->pte_low = __pte.pte_low; \
-+ } \
-+ __ret; \
-+})
-+
-+#define ptep_test_and_clear_young(vma, addr, ptep) \
-+({ \
-+ pte_t __pte = *(ptep); \
-+ int __ret = pte_young(__pte); \
-+ if (__ret) \
-+ __pte = pte_mkold(__pte); \
-+ if ((vma)->vm_mm != current->mm || \
-+ HYPERVISOR_update_va_mapping(addr, __pte, 0)) \
-+ (ptep)->pte_low = __pte.pte_low; \
-+ __ret; \
-+})
-+
-+#define ptep_get_and_clear_full(mm, addr, ptep, full) \
-+ ((full) ? ({ \
-+ pte_t __res = *(ptep); \
-+ if (test_bit(PG_pinned, &virt_to_page((mm)->pgd)->flags)) \
-+ xen_l1_entry_update(ptep, __pte(0)); \
-+ else \
-+ *(ptep) = __pte(0); \
-+ __res; \
-+ }) : \
-+ ptep_get_and_clear(mm, addr, ptep))
-+
-+static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-+{
-+ pte_t pte = *ptep;
-+ if (pte_write(pte))
-+ set_pte_at(mm, addr, ptep, pte_wrprotect(pte));
-+}
-+
-+/*
-+ * clone_pgd_range(pgd_t *dst, pgd_t *src, int count);
-+ *
-+ * dst - pointer to pgd range anwhere on a pgd page
-+ * src - ""
-+ * count - the number of pgds to copy.
-+ *
-+ * dst and src can be on the same page, but the range must not overlap,
-+ * and must not cross a page boundary.
-+ */
-+static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
-+{
-+ memcpy(dst, src, count * sizeof(pgd_t));
-+}
-+
-+/*
-+ * Macro to mark a page protection value as "uncacheable". On processors which do not support
-+ * it, this is a no-op.
-+ */
-+#define pgprot_noncached(prot) ((boot_cpu_data.x86 > 3) \
-+ ? (__pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT)) : (prot))
-+
-+/*
-+ * Conversion functions: convert a page and protection to a page entry,
-+ * and a page entry and page directory to the page they refer to.
-+ */
-+
-+#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
-+
-+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-+{
-+ /*
-+ * Since this might change the present bit (which controls whether
-+ * a pte_t object has undergone p2m translation), we must use
-+ * pte_val() on the input pte and __pte() for the return value.
-+ */
-+ paddr_t pteval = pte_val(pte);
-+
-+ pteval &= _PAGE_CHG_MASK;
-+ pteval |= pgprot_val(newprot);
-+#ifdef CONFIG_X86_PAE
-+ pteval &= __supported_pte_mask;
-+#endif
-+ return __pte(pteval);
-+}
-+
-+#define pmd_large(pmd) \
-+((__pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT))
-+
-+/*
-+ * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
-+ *
-+ * this macro returns the index of the entry in the pgd page which would
-+ * control the given virtual address
-+ */
-+#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-+#define pgd_index_k(addr) pgd_index(addr)
-+
-+/*
-+ * pgd_offset() returns a (pgd_t *)
-+ * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
-+ */
-+#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
-+
-+/*
-+ * a shortcut which implies the use of the kernel's pgd, instead
-+ * of a process's
-+ */
-+#define pgd_offset_k(address) pgd_offset(&init_mm, address)
-+
-+/*
-+ * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
-+ *
-+ * this macro returns the index of the entry in the pmd page which would
-+ * control the given virtual address
-+ */
-+#define pmd_index(address) \
-+ (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-+
-+/*
-+ * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
-+ *
-+ * this macro returns the index of the entry in the pte page which would
-+ * control the given virtual address
-+ */
-+#define pte_index(address) \
-+ (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-+#define pte_offset_kernel(dir, address) \
-+ ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address))
-+
-+#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
-+
-+#define pmd_page_kernel(pmd) \
-+ ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-+
-+/*
-+ * Helper function that returns the kernel pagetable entry controlling
-+ * the virtual address 'address'. NULL means no pagetable entry present.
-+ * NOTE: the return type is pte_t but if the pmd is PSE then we return it
-+ * as a pte too.
-+ */
-+extern pte_t *lookup_address(unsigned long address);
-+
-+/*
-+ * Make a given kernel text page executable/non-executable.
-+ * Returns the previous executability setting of that page (which
-+ * is used to restore the previous state). Used by the SMP bootup code.
-+ * NOTE: this is an __init function for security reasons.
-+ */
-+#ifdef CONFIG_X86_PAE
-+ extern int set_kernel_exec(unsigned long vaddr, int enable);
-+#else
-+ static inline int set_kernel_exec(unsigned long vaddr, int enable) { return 0;}
-+#endif
-+
-+extern void noexec_setup(const char *str);
-+
-+#if defined(CONFIG_HIGHPTE)
-+#define pte_offset_map(dir, address) \
-+ ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)),KM_PTE0) + \
-+ pte_index(address))
-+#define pte_offset_map_nested(dir, address) \
-+ ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)),KM_PTE1) + \
-+ pte_index(address))
-+#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
-+#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
-+#else
-+#define pte_offset_map(dir, address) \
-+ ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-+#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
-+#define pte_unmap(pte) do { } while (0)
-+#define pte_unmap_nested(pte) do { } while (0)
-+#endif
-+
-+#define __HAVE_ARCH_PTEP_ESTABLISH
-+#define ptep_establish(vma, address, ptep, pteval) \
-+ do { \
-+ if ( likely((vma)->vm_mm == current->mm) ) { \
-+ BUG_ON(HYPERVISOR_update_va_mapping(address, \
-+ pteval, \
-+ (unsigned long)(vma)->vm_mm->cpu_vm_mask.bits| \
-+ UVMF_INVLPG|UVMF_MULTI)); \
-+ } else { \
-+ xen_l1_entry_update(ptep, pteval); \
-+ flush_tlb_page(vma, address); \
-+ } \
-+ } while (0)
-+
-+/*
-+ * The i386 doesn't have any external MMU info: the kernel page
-+ * tables contain all the necessary information.
-+ *
-+ * Also, we only update the dirty/accessed state if we set
-+ * the dirty bit by hand in the kernel, since the hardware
-+ * will do the accessed bit for us, and we don't want to
-+ * race with other CPU's that might be updating the dirty
-+ * bit at the same time.
-+ */
-+#define update_mmu_cache(vma,address,pte) do { } while (0)
-+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
-+#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \
-+ do { \
-+ if (dirty) \
-+ ptep_establish(vma, address, ptep, entry); \
-+ } while (0)
-+
-+#include <xen/features.h>
-+void make_lowmem_page_readonly(void *va, unsigned int feature);
-+void make_lowmem_page_writable(void *va, unsigned int feature);
-+void make_page_readonly(void *va, unsigned int feature);
-+void make_page_writable(void *va, unsigned int feature);
-+void make_pages_readonly(void *va, unsigned int nr, unsigned int feature);
-+void make_pages_writable(void *va, unsigned int nr, unsigned int feature);
-+
-+#define virt_to_ptep(va) \
-+({ \
-+ pte_t *__ptep = lookup_address((unsigned long)(va)); \
-+ BUG_ON(!__ptep || !pte_present(*__ptep)); \
-+ __ptep; \
-+})
-+
-+#define arbitrary_virt_to_machine(va) \
-+ (((maddr_t)pte_mfn(*virt_to_ptep(va)) << PAGE_SHIFT) \
-+ | ((unsigned long)(va) & (PAGE_SIZE - 1)))
-+
-+#ifdef CONFIG_HIGHPTE
-+#include <asm/io.h>
-+struct page *kmap_atomic_to_page(void *);
-+#define ptep_to_machine(ptep) \
-+({ \
-+ pte_t *__ptep = (ptep); \
-+ page_to_phys(kmap_atomic_to_page(__ptep)) \
-+ | ((unsigned long)__ptep & (PAGE_SIZE - 1)); \
-+})
-+#else
-+#define ptep_to_machine(ptep) virt_to_machine(ptep)
-+#endif
-+
-+#endif /* !__ASSEMBLY__ */
-+
-+#ifdef CONFIG_FLATMEM
-+#define kern_addr_valid(addr) (1)
-+#endif /* CONFIG_FLATMEM */
-+
-+int direct_remap_pfn_range(struct vm_area_struct *vma,
-+ unsigned long address,
-+ unsigned long mfn,
-+ unsigned long size,
-+ pgprot_t prot,
-+ domid_t domid);
-+int direct_kernel_remap_pfn_range(unsigned long address,
-+ unsigned long mfn,
-+ unsigned long size,
-+ pgprot_t prot,
-+ domid_t domid);
-+int create_lookup_pte_addr(struct mm_struct *mm,
-+ unsigned long address,
-+ uint64_t *ptep);
-+int touch_pte_range(struct mm_struct *mm,
-+ unsigned long address,
-+ unsigned long size);
-+
-+int xen_change_pte_range(struct mm_struct *mm, pmd_t *pmd,
-+ unsigned long addr, unsigned long end, pgprot_t newprot);
-+
-+#define arch_change_pte_range(mm, pmd, addr, end, newprot) \
-+ xen_change_pte_range(mm, pmd, addr, end, newprot)
-+
-+#define io_remap_pfn_range(vma,from,pfn,size,prot) \
-+direct_remap_pfn_range(vma,from,pfn,size,prot,DOMID_IO)
-+
-+#define MK_IOSPACE_PFN(space, pfn) (pfn)
-+#define GET_IOSPACE(pfn) 0
-+#define GET_PFN(pfn) (pfn)
-+
-+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
-+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
-+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
-+#define __HAVE_ARCH_PTEP_CLEAR_FLUSH
-+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
-+#define __HAVE_ARCH_PTE_SAME
-+#include <asm-generic/pgtable.h>
-+
-+#endif /* _I386_PGTABLE_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/pgtable_64.h
-@@ -0,0 +1,585 @@
-+#ifndef _X86_64_PGTABLE_H
-+#define _X86_64_PGTABLE_H
-+
-+/*
-+ * This file contains the functions and defines necessary to modify and use
-+ * the x86-64 page table tree.
-+ */
-+#include <asm/processor.h>
-+#include <asm/fixmap.h>
-+#include <asm/bitops.h>
-+#include <linux/threads.h>
-+#include <linux/sched.h>
-+#include <asm/pda.h>
-+#ifdef CONFIG_XEN
-+#include <asm/hypervisor.h>
-+
-+extern pud_t level3_user_pgt[512];
-+
-+extern void xen_init_pt(void);
-+
-+extern pte_t *lookup_address(unsigned long address);
-+
-+#define virt_to_ptep(va) \
-+({ \
-+ pte_t *__ptep = lookup_address((unsigned long)(va)); \
-+ BUG_ON(!__ptep || !pte_present(*__ptep)); \
-+ __ptep; \
-+})
-+
-+#define arbitrary_virt_to_machine(va) \
-+ (((maddr_t)pte_mfn(*virt_to_ptep(va)) << PAGE_SHIFT) \
-+ | ((unsigned long)(va) & (PAGE_SIZE - 1)))
-+
-+#define ptep_to_machine(ptep) virt_to_machine(ptep)
-+#endif
-+
-+extern pud_t level3_kernel_pgt[512];
-+extern pud_t level3_physmem_pgt[512];
-+extern pud_t level3_ident_pgt[512];
-+extern pmd_t level2_kernel_pgt[512];
-+extern pgd_t init_level4_pgt[];
-+extern pgd_t boot_level4_pgt[];
-+extern unsigned long __supported_pte_mask;
-+
-+#define swapper_pg_dir init_level4_pgt
-+
-+extern int nonx_setup(char *str);
-+extern void paging_init(void);
-+extern void clear_kernel_mapping(unsigned long addr, unsigned long size);
-+
-+extern unsigned long pgkern_mask;
-+
-+/*
-+ * ZERO_PAGE is a global shared page that is always zero: used
-+ * for zero-mapped memory areas etc..
-+ */
-+extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
-+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
-+
-+/*
-+ * PGDIR_SHIFT determines what a top-level page table entry can map
-+ */
-+#define PGDIR_SHIFT 39
-+#define PTRS_PER_PGD 512
-+
-+/*
-+ * 3rd level page
-+ */
-+#define PUD_SHIFT 30
-+#define PTRS_PER_PUD 512
-+
-+/*
-+ * PMD_SHIFT determines the size of the area a middle-level
-+ * page table can map
-+ */
-+#define PMD_SHIFT 21
-+#define PTRS_PER_PMD 512
-+
-+/*
-+ * entries per page directory level
-+ */
-+#define PTRS_PER_PTE 512
-+
-+#define pte_ERROR(e) \
-+ printk("%s:%d: bad pte %p(%016lx pfn %010lx).\n", __FILE__, __LINE__, \
-+ &(e), __pte_val(e), pte_pfn(e))
-+#define pmd_ERROR(e) \
-+ printk("%s:%d: bad pmd %p(%016lx pfn %010lx).\n", __FILE__, __LINE__, \
-+ &(e), __pmd_val(e), pmd_pfn(e))
-+#define pud_ERROR(e) \
-+ printk("%s:%d: bad pud %p(%016lx pfn %010lx).\n", __FILE__, __LINE__, \
-+ &(e), __pud_val(e), (pud_val(e) & __PHYSICAL_MASK) >> PAGE_SHIFT)
-+#define pgd_ERROR(e) \
-+ printk("%s:%d: bad pgd %p(%016lx pfn %010lx).\n", __FILE__, __LINE__, \
-+ &(e), __pgd_val(e), (pgd_val(e) & __PHYSICAL_MASK) >> PAGE_SHIFT)
-+
-+#define pgd_none(x) (!__pgd_val(x))
-+#define pud_none(x) (!__pud_val(x))
-+
-+static inline void set_pte(pte_t *dst, pte_t val)
-+{
-+ *dst = val;
-+}
-+
-+#define set_pmd(pmdptr, pmdval) xen_l2_entry_update(pmdptr, (pmdval))
-+#define set_pud(pudptr, pudval) xen_l3_entry_update(pudptr, (pudval))
-+#define set_pgd(pgdptr, pgdval) xen_l4_entry_update(pgdptr, (pgdval))
-+
-+static inline void pud_clear (pud_t * pud)
-+{
-+ set_pud(pud, __pud(0));
-+}
-+
-+#define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
-+
-+static inline void pgd_clear (pgd_t * pgd)
-+{
-+ set_pgd(pgd, __pgd(0));
-+ set_pgd(__user_pgd(pgd), __pgd(0));
-+}
-+
-+#define pud_page(pud) \
-+ ((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK))
-+
-+#define pte_same(a, b) ((a).pte == (b).pte)
-+
-+#define pte_pgprot(a) (__pgprot((a).pte & ~PHYSICAL_PAGE_MASK))
-+
-+#define PMD_SIZE (1UL << PMD_SHIFT)
-+#define PMD_MASK (~(PMD_SIZE-1))
-+#define PUD_SIZE (1UL << PUD_SHIFT)
-+#define PUD_MASK (~(PUD_SIZE-1))
-+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
-+#define PGDIR_MASK (~(PGDIR_SIZE-1))
-+
-+#define USER_PTRS_PER_PGD ((TASK_SIZE-1)/PGDIR_SIZE+1)
-+#define FIRST_USER_ADDRESS 0
-+
-+#ifndef __ASSEMBLY__
-+#define MAXMEM 0x6fffffffffUL
-+#define VMALLOC_START 0xffffc20000000000UL
-+#define VMALLOC_END 0xffffe1ffffffffffUL
-+#define MODULES_VADDR 0xffffffff88000000UL
-+#define MODULES_END 0xffffffffff000000UL
-+#define MODULES_LEN (MODULES_END - MODULES_VADDR)
-+
-+#define _PAGE_BIT_PRESENT 0
-+#define _PAGE_BIT_RW 1
-+#define _PAGE_BIT_USER 2
-+#define _PAGE_BIT_PWT 3
-+#define _PAGE_BIT_PCD 4
-+#define _PAGE_BIT_ACCESSED 5
-+#define _PAGE_BIT_DIRTY 6
-+#define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page */
-+#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
-+#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
-+
-+#define _PAGE_PRESENT 0x001
-+#define _PAGE_RW 0x002
-+#define _PAGE_USER 0x004
-+#define _PAGE_PWT 0x008
-+#define _PAGE_PCD 0x010
-+#define _PAGE_ACCESSED 0x020
-+#define _PAGE_DIRTY 0x040
-+#define _PAGE_PSE 0x080 /* 2MB page */
-+#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */
-+#define _PAGE_GLOBAL 0x100 /* Global TLB entry */
-+
-+#define _PAGE_PROTNONE 0x080 /* If not present */
-+#define _PAGE_NX (1UL<<_PAGE_BIT_NX)
-+
-+/* Mapped page is I/O or foreign and has no associated page struct. */
-+#define _PAGE_IO 0x200
-+
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+extern unsigned int __kernel_page_user;
-+#else
-+#define __kernel_page_user 0
-+#endif
-+
-+#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
-+#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY | __kernel_page_user)
-+
-+#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_IO)
-+
-+#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
-+#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
-+#define PAGE_SHARED_EXEC __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
-+#define PAGE_COPY_NOEXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
-+#define PAGE_COPY PAGE_COPY_NOEXEC
-+#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
-+#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 | __kernel_page_user)
-+#define __PAGE_KERNEL_EXEC \
-+ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | __kernel_page_user)
-+#define __PAGE_KERNEL_NOCACHE \
-+ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED | _PAGE_NX | __kernel_page_user)
-+#define __PAGE_KERNEL_RO \
-+ (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX | __kernel_page_user)
-+#define __PAGE_KERNEL_VSYSCALL \
-+ (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
-+#define __PAGE_KERNEL_VSYSCALL_NOCACHE \
-+ (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD)
-+#define __PAGE_KERNEL_LARGE \
-+ (__PAGE_KERNEL | _PAGE_PSE)
-+#define __PAGE_KERNEL_LARGE_EXEC \
-+ (__PAGE_KERNEL_EXEC | _PAGE_PSE)
-+
-+/*
-+ * We don't support GLOBAL page in xenolinux64
-+ */
-+#define MAKE_GLOBAL(x) __pgprot((x))
-+
-+#define PAGE_KERNEL MAKE_GLOBAL(__PAGE_KERNEL)
-+#define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)
-+#define PAGE_KERNEL_RO MAKE_GLOBAL(__PAGE_KERNEL_RO)
-+#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE)
-+#define PAGE_KERNEL_VSYSCALL32 __pgprot(__PAGE_KERNEL_VSYSCALL)
-+#define PAGE_KERNEL_VSYSCALL MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL)
-+#define PAGE_KERNEL_LARGE MAKE_GLOBAL(__PAGE_KERNEL_LARGE)
-+#define PAGE_KERNEL_VSYSCALL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL_NOCACHE)
-+
-+/* xwr */
-+#define __P000 PAGE_NONE
-+#define __P001 PAGE_READONLY
-+#define __P010 PAGE_COPY
-+#define __P011 PAGE_COPY
-+#define __P100 PAGE_READONLY_EXEC
-+#define __P101 PAGE_READONLY_EXEC
-+#define __P110 PAGE_COPY_EXEC
-+#define __P111 PAGE_COPY_EXEC
-+
-+#define __S000 PAGE_NONE
-+#define __S001 PAGE_READONLY
-+#define __S010 PAGE_SHARED
-+#define __S011 PAGE_SHARED
-+#define __S100 PAGE_READONLY_EXEC
-+#define __S101 PAGE_READONLY_EXEC
-+#define __S110 PAGE_SHARED_EXEC
-+#define __S111 PAGE_SHARED_EXEC
-+
-+static inline unsigned long pgd_bad(pgd_t pgd)
-+{
-+ unsigned long val = __pgd_val(pgd);
-+ val &= ~PTE_MASK;
-+ val &= ~(_PAGE_USER | _PAGE_DIRTY);
-+ return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);
-+}
-+
-+static inline unsigned long pud_bad(pud_t pud)
-+{
-+ unsigned long val = __pud_val(pud);
-+ val &= ~PTE_MASK;
-+ val &= ~(_PAGE_USER | _PAGE_DIRTY);
-+ return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);
-+}
-+
-+#define set_pte_at(_mm,addr,ptep,pteval) do { \
-+ if (((_mm) != current->mm && (_mm) != &init_mm) || \
-+ HYPERVISOR_update_va_mapping((addr), (pteval), 0)) \
-+ set_pte((ptep), (pteval)); \
-+} while (0)
-+
-+#define pte_none(x) (!(x).pte)
-+#define pte_present(x) ((x).pte & (_PAGE_PRESENT | _PAGE_PROTNONE))
-+#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
-+
-+#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
-+
-+#define __pte_mfn(_pte) (((_pte).pte & PTE_MASK) >> PAGE_SHIFT)
-+#define pte_mfn(_pte) ((_pte).pte & _PAGE_PRESENT ? \
-+ __pte_mfn(_pte) : pfn_to_mfn(__pte_mfn(_pte)))
-+#define pte_pfn(_pte) ((_pte).pte & _PAGE_IO ? end_pfn : \
-+ (_pte).pte & _PAGE_PRESENT ? \
-+ mfn_to_local_pfn(__pte_mfn(_pte)) : \
-+ __pte_mfn(_pte))
-+
-+#define pte_page(x) pfn_to_page(pte_pfn(x))
-+
-+static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
-+{
-+ unsigned long pte = page_nr << PAGE_SHIFT;
-+ pte |= pgprot_val(pgprot);
-+ pte &= __supported_pte_mask;
-+ return __pte(pte);
-+}
-+
-+static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-+{
-+ pte_t pte = *ptep;
-+ if (!pte_none(pte)) {
-+ if ((mm != &init_mm) ||
-+ HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
-+ pte = __pte_ma(xchg(&ptep->pte, 0));
-+ }
-+ return pte;
-+}
-+
-+static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
-+{
-+ if (full) {
-+ pte_t pte = *ptep;
-+ if (mm->context.pinned)
-+ xen_l1_entry_update(ptep, __pte(0));
-+ else
-+ *ptep = __pte(0);
-+ return pte;
-+ }
-+ return ptep_get_and_clear(mm, addr, ptep);
-+}
-+
-+#define ptep_clear_flush(vma, addr, ptep) \
-+({ \
-+ pte_t *__ptep = (ptep); \
-+ pte_t __res = *__ptep; \
-+ if (!pte_none(__res) && \
-+ ((vma)->vm_mm != current->mm || \
-+ HYPERVISOR_update_va_mapping(addr, __pte(0), \
-+ (unsigned long)(vma)->vm_mm->cpu_vm_mask.bits| \
-+ UVMF_INVLPG|UVMF_MULTI))) { \
-+ __ptep->pte = 0; \
-+ flush_tlb_page(vma, addr); \
-+ } \
-+ __res; \
-+})
-+
-+/*
-+ * The following only work if pte_present() is true.
-+ * Undefined behaviour if not..
-+ */
-+#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT)
-+static inline int pte_user(pte_t pte) { return __pte_val(pte) & _PAGE_USER; }
-+static inline int pte_read(pte_t pte) { return __pte_val(pte) & _PAGE_USER; }
-+static inline int pte_exec(pte_t pte) { return __pte_val(pte) & _PAGE_USER; }
-+static inline int pte_dirty(pte_t pte) { return __pte_val(pte) & _PAGE_DIRTY; }
-+static inline int pte_young(pte_t pte) { return __pte_val(pte) & _PAGE_ACCESSED; }
-+static inline int pte_write(pte_t pte) { return __pte_val(pte) & _PAGE_RW; }
-+static inline int pte_file(pte_t pte) { return __pte_val(pte) & _PAGE_FILE; }
-+static inline int pte_huge(pte_t pte) { return __pte_val(pte) & _PAGE_PSE; }
-+
-+static inline pte_t pte_rdprotect(pte_t pte) { __pte_val(pte) &= ~_PAGE_USER; return pte; }
-+static inline pte_t pte_exprotect(pte_t pte) { __pte_val(pte) &= ~_PAGE_USER; return pte; }
-+static inline pte_t pte_mkclean(pte_t pte) { __pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
-+static inline pte_t pte_mkold(pte_t pte) { __pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
-+static inline pte_t pte_wrprotect(pte_t pte) { __pte_val(pte) &= ~_PAGE_RW; return pte; }
-+static inline pte_t pte_mkread(pte_t pte) { __pte_val(pte) |= _PAGE_USER; return pte; }
-+static inline pte_t pte_mkexec(pte_t pte) { __pte_val(pte) |= _PAGE_USER; return pte; }
-+static inline pte_t pte_mkdirty(pte_t pte) { __pte_val(pte) |= _PAGE_DIRTY; return pte; }
-+static inline pte_t pte_mkyoung(pte_t pte) { __pte_val(pte) |= _PAGE_ACCESSED; return pte; }
-+static inline pte_t pte_mkwrite(pte_t pte) { __pte_val(pte) |= _PAGE_RW; return pte; }
-+static inline pte_t pte_mkhuge(pte_t pte) { __pte_val(pte) |= _PAGE_PSE; return pte; }
-+
-+#define ptep_test_and_clear_dirty(vma, addr, ptep) \
-+({ \
-+ pte_t __pte = *(ptep); \
-+ int __ret = pte_dirty(__pte); \
-+ if (__ret) \
-+ set_pte_at((vma)->vm_mm, addr, ptep, pte_mkclean(__pte)); \
-+ __ret; \
-+})
-+
-+#define ptep_test_and_clear_young(vma, addr, ptep) \
-+({ \
-+ pte_t __pte = *(ptep); \
-+ int __ret = pte_young(__pte); \
-+ if (__ret) \
-+ set_pte_at((vma)->vm_mm, addr, ptep, pte_mkold(__pte)); \
-+ __ret; \
-+})
-+
-+static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-+{
-+ pte_t pte = *ptep;
-+ if (pte_write(pte))
-+ set_pte_at(mm, addr, ptep, pte_wrprotect(pte));
-+}
-+
-+/*
-+ * Macro to mark a page protection value as "uncacheable".
-+ */
-+#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT))
-+
-+static inline int pmd_large(pmd_t pte) {
-+ return (__pmd_val(pte) & __LARGE_PTE) == __LARGE_PTE;
-+}
-+
-+
-+/*
-+ * Conversion functions: convert a page and protection to a page entry,
-+ * and a page entry and page directory to the page they refer to.
-+ */
-+
-+/*
-+ * Level 4 access.
-+ * Never use these in the common code.
-+ */
-+#define pgd_page(pgd) ((unsigned long) __va(pgd_val(pgd) & PTE_MASK))
-+#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-+#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
-+#define pgd_offset_k(address) (init_level4_pgt + pgd_index(address))
-+#define pgd_present(pgd) (__pgd_val(pgd) & _PAGE_PRESENT)
-+#define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
-+
-+/* PUD - Level3 access */
-+/* to find an entry in a page-table-directory. */
-+#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-+#define pud_offset(pgd, address) ((pud_t *) pgd_page(*(pgd)) + pud_index(address))
-+#define pud_present(pud) (__pud_val(pud) & _PAGE_PRESENT)
-+
-+/* PMD - Level 2 access */
-+#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK))
-+#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
-+
-+#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
-+#define pmd_offset(dir, address) ((pmd_t *) pud_page(*(dir)) + \
-+ pmd_index(address))
-+#define pmd_none(x) (!__pmd_val(x))
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+/* pmd_present doesn't just test the _PAGE_PRESENT bit since wr.p.t.
-+ can temporarily clear it. */
-+#define pmd_present(x) (__pmd_val(x))
-+#else
-+#define pmd_present(x) (__pmd_val(x) & _PAGE_PRESENT)
-+#endif
-+#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
-+#define pmd_bad(x) ((__pmd_val(x) & ~(PTE_MASK | _PAGE_USER | _PAGE_PRESENT)) \
-+ != (_KERNPG_TABLE & ~(_PAGE_USER | _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)
-+
-+#define pte_to_pgoff(pte) ((__pte_val(pte) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT)
-+#define pgoff_to_pte(off) ((pte_t) { ((off) << PAGE_SHIFT) | _PAGE_FILE })
-+#define PTE_FILE_MAX_BITS __PHYSICAL_MASK_SHIFT
-+
-+/* PTE - Level 1 access. */
-+
-+/* page, protection -> pte */
-+#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
-+#define mk_pte_huge(entry) (__pte_val(entry) |= _PAGE_PRESENT | _PAGE_PSE)
-+
-+/* physical address -> PTE */
-+static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
-+{
-+ unsigned long pteval;
-+ pteval = physpage | pgprot_val(pgprot);
-+ return __pte(pteval);
-+}
-+
-+/* Change flags of a PTE */
-+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-+{
-+ /*
-+ * Since this might change the present bit (which controls whether
-+ * a pte_t object has undergone p2m translation), we must use
-+ * pte_val() on the input pte and __pte() for the return value.
-+ */
-+ unsigned long pteval = pte_val(pte);
-+
-+ pteval &= _PAGE_CHG_MASK;
-+ pteval |= pgprot_val(newprot);
-+ pteval &= __supported_pte_mask;
-+ return __pte(pteval);
-+}
-+
-+#define pte_index(address) \
-+ (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
-+#define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_kernel(*(dir)) + \
-+ pte_index(address))
-+
-+/* x86-64 always has all page tables mapped. */
-+#define pte_offset_map(dir,address) pte_offset_kernel(dir,address)
-+#define pte_offset_map_nested(dir,address) pte_offset_kernel(dir,address)
-+#define pte_unmap(pte) /* NOP */
-+#define pte_unmap_nested(pte) /* NOP */
-+
-+#define update_mmu_cache(vma,address,pte) do { } while (0)
-+
-+/*
-+ * Rules for using ptep_establish: the pte MUST be a user pte, and
-+ * must be a present->present transition.
-+ */
-+#define __HAVE_ARCH_PTEP_ESTABLISH
-+#define ptep_establish(vma, address, ptep, pteval) \
-+ do { \
-+ if ( likely((vma)->vm_mm == current->mm) ) { \
-+ BUG_ON(HYPERVISOR_update_va_mapping(address, \
-+ pteval, \
-+ (unsigned long)(vma)->vm_mm->cpu_vm_mask.bits| \
-+ UVMF_INVLPG|UVMF_MULTI)); \
-+ } else { \
-+ xen_l1_entry_update(ptep, pteval); \
-+ flush_tlb_page(vma, address); \
-+ } \
-+ } while (0)
-+
-+/* We only update the dirty/accessed state if we set
-+ * the dirty bit by hand in the kernel, since the hardware
-+ * will do the accessed bit for us, and we don't want to
-+ * race with other CPU's that might be updating the dirty
-+ * bit at the same time. */
-+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
-+#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \
-+ do { \
-+ if (dirty) \
-+ ptep_establish(vma, address, ptep, entry); \
-+ } while (0)
-+
-+/* Encode and de-code a swap entry */
-+#define __swp_type(x) (((x).val >> 1) & 0x3f)
-+#define __swp_offset(x) ((x).val >> 8)
-+#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
-+#define __pte_to_swp_entry(pte) ((swp_entry_t) { __pte_val(pte) })
-+#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
-+
-+extern spinlock_t pgd_lock;
-+extern struct page *pgd_list;
-+void vmalloc_sync_all(void);
-+
-+#endif /* !__ASSEMBLY__ */
-+
-+extern int kern_addr_valid(unsigned long addr);
-+
-+#define DOMID_LOCAL (0xFFFFU)
-+
-+struct vm_area_struct;
-+
-+int direct_remap_pfn_range(struct vm_area_struct *vma,
-+ unsigned long address,
-+ unsigned long mfn,
-+ unsigned long size,
-+ pgprot_t prot,
-+ domid_t domid);
-+
-+int direct_kernel_remap_pfn_range(unsigned long address,
-+ unsigned long mfn,
-+ unsigned long size,
-+ pgprot_t prot,
-+ domid_t domid);
-+
-+int create_lookup_pte_addr(struct mm_struct *mm,
-+ unsigned long address,
-+ uint64_t *ptep);
-+
-+int touch_pte_range(struct mm_struct *mm,
-+ unsigned long address,
-+ unsigned long size);
-+
-+int xen_change_pte_range(struct mm_struct *mm, pmd_t *pmd,
-+ unsigned long addr, unsigned long end, pgprot_t newprot);
-+
-+#define arch_change_pte_range(mm, pmd, addr, end, newprot) \
-+ xen_change_pte_range(mm, pmd, addr, end, newprot)
-+
-+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
-+ direct_remap_pfn_range(vma,vaddr,pfn,size,prot,DOMID_IO)
-+
-+#define MK_IOSPACE_PFN(space, pfn) (pfn)
-+#define GET_IOSPACE(pfn) 0
-+#define GET_PFN(pfn) (pfn)
-+
-+#define HAVE_ARCH_UNMAPPED_AREA
-+
-+#define pgtable_cache_init() do { } while (0)
-+#define check_pgt_cache() do { } while (0)
-+
-+#define PAGE_AGP PAGE_KERNEL_NOCACHE
-+#define HAVE_PAGE_AGP 1
-+
-+/* fs/proc/kcore.c */
-+#define kc_vaddr_to_offset(v) ((v) & __VIRTUAL_MASK)
-+#define kc_offset_to_vaddr(o) \
-+ (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o))
-+
-+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
-+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
-+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
-+#define __HAVE_ARCH_PTEP_CLEAR_FLUSH
-+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
-+#define __HAVE_ARCH_PTE_SAME
-+#include <asm-generic/pgtable.h>
-+
-+#endif /* _X86_64_PGTABLE_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/processor_32.h
-@@ -0,0 +1,743 @@
-+/*
-+ * include/asm-i386/processor.h
-+ *
-+ * Copyright (C) 1994 Linus Torvalds
-+ */
-+
-+#ifndef __ASM_I386_PROCESSOR_H
-+#define __ASM_I386_PROCESSOR_H
-+
-+#include <asm/vm86.h>
-+#include <asm/math_emu.h>
-+#include <asm/segment.h>
-+#include <asm/page.h>
-+#include <asm/types.h>
-+#include <asm/sigcontext.h>
-+#include <asm/cpufeature.h>
-+#include <asm/msr.h>
-+#include <asm/system.h>
-+#include <linux/cache.h>
-+#include <linux/threads.h>
-+#include <asm/percpu.h>
-+#include <linux/cpumask.h>
-+#include <xen/interface/physdev.h>
-+
-+/* flag for disabling the tsc */
-+extern int tsc_disable;
-+
-+struct desc_struct {
-+ unsigned long a,b;
-+};
-+
-+#define desc_empty(desc) \
-+ (!((desc)->a | (desc)->b))
-+
-+#define desc_equal(desc1, desc2) \
-+ (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
-+/*
-+ * Default implementation of macro that returns current
-+ * instruction pointer ("program counter").
-+ */
-+#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
-+
-+/*
-+ * CPU type and hardware bug flags. Kept separately for each CPU.
-+ * Members of this structure are referenced in head.S, so think twice
-+ * before touching them. [mj]
-+ */
-+
-+struct cpuinfo_x86 {
-+ __u8 x86; /* CPU family */
-+ __u8 x86_vendor; /* CPU vendor */
-+ __u8 x86_model;
-+ __u8 x86_mask;
-+ char wp_works_ok; /* It doesn't on 386's */
-+ char hlt_works_ok; /* Problems on some 486Dx4's and old 386's */
-+ char hard_math;
-+ char rfu;
-+ int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */
-+ unsigned long x86_capability[NCAPINTS];
-+ char x86_vendor_id[16];
-+ char x86_model_id[64];
-+ int x86_cache_size; /* in KB - valid for CPUS which support this
-+ call */
-+ int x86_cache_alignment; /* In bytes */
-+ char fdiv_bug;
-+ char f00f_bug;
-+ char coma_bug;
-+ char pad0;
-+ int x86_power;
-+ unsigned long loops_per_jiffy;
-+#ifdef CONFIG_SMP
-+ cpumask_t llc_shared_map; /* cpus sharing the last level cache */
-+#endif
-+ unsigned char x86_max_cores; /* cpuid returned max cores value */
-+ unsigned char apicid;
-+#ifdef CONFIG_SMP
-+ unsigned char booted_cores; /* number of cores as seen by OS */
-+ __u8 phys_proc_id; /* Physical processor id. */
-+ __u8 cpu_core_id; /* Core id */
-+#endif
-+} __attribute__((__aligned__(SMP_CACHE_BYTES)));
-+
-+#define X86_VENDOR_INTEL 0
-+#define X86_VENDOR_CYRIX 1
-+#define X86_VENDOR_AMD 2
-+#define X86_VENDOR_UMC 3
-+#define X86_VENDOR_NEXGEN 4
-+#define X86_VENDOR_CENTAUR 5
-+#define X86_VENDOR_RISE 6
-+#define X86_VENDOR_TRANSMETA 7
-+#define X86_VENDOR_NSC 8
-+#define X86_VENDOR_NUM 9
-+#define X86_VENDOR_UNKNOWN 0xff
-+
-+/*
-+ * capabilities of CPUs
-+ */
-+
-+extern struct cpuinfo_x86 boot_cpu_data;
-+extern struct cpuinfo_x86 new_cpu_data;
-+#ifndef CONFIG_X86_NO_TSS
-+extern struct tss_struct doublefault_tss;
-+DECLARE_PER_CPU(struct tss_struct, init_tss);
-+#endif
-+
-+#ifdef CONFIG_SMP
-+extern struct cpuinfo_x86 cpu_data[];
-+#define current_cpu_data cpu_data[smp_processor_id()]
-+#else
-+#define cpu_data (&boot_cpu_data)
-+#define current_cpu_data boot_cpu_data
-+#endif
-+
-+extern int cpu_llc_id[NR_CPUS];
-+extern char ignore_fpu_irq;
-+
-+extern void identify_cpu(struct cpuinfo_x86 *);
-+extern void print_cpu_info(struct cpuinfo_x86 *);
-+extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
-+extern unsigned short num_cache_leaves;
-+
-+#ifdef CONFIG_X86_HT
-+extern void detect_ht(struct cpuinfo_x86 *c);
-+#else
-+static inline void detect_ht(struct cpuinfo_x86 *c) {}
-+#endif
-+
-+/*
-+ * EFLAGS bits
-+ */
-+#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */
-+#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */
-+#define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */
-+#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */
-+#define X86_EFLAGS_SF 0x00000080 /* Sign Flag */
-+#define X86_EFLAGS_TF 0x00000100 /* Trap Flag */
-+#define X86_EFLAGS_IF 0x00000200 /* Interrupt Flag */
-+#define X86_EFLAGS_DF 0x00000400 /* Direction Flag */
-+#define X86_EFLAGS_OF 0x00000800 /* Overflow Flag */
-+#define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */
-+#define X86_EFLAGS_NT 0x00004000 /* Nested Task */
-+#define X86_EFLAGS_RF 0x00010000 /* Resume Flag */
-+#define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */
-+#define X86_EFLAGS_AC 0x00040000 /* Alignment Check */
-+#define X86_EFLAGS_VIF 0x00080000 /* Virtual Interrupt Flag */
-+#define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */
-+#define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */
-+
-+/*
-+ * Generic CPUID function
-+ * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
-+ * resulting in stale register contents being returned.
-+ */
-+static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx)
-+{
-+ __asm__(XEN_CPUID
-+ : "=a" (*eax),
-+ "=b" (*ebx),
-+ "=c" (*ecx),
-+ "=d" (*edx)
-+ : "0" (op), "c"(0));
-+}
-+
-+/* Some CPUID calls want 'count' to be placed in ecx */
-+static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
-+ int *edx)
-+{
-+ __asm__(XEN_CPUID
-+ : "=a" (*eax),
-+ "=b" (*ebx),
-+ "=c" (*ecx),
-+ "=d" (*edx)
-+ : "0" (op), "c" (count));
-+}
-+
-+/*
-+ * CPUID functions returning a single datum
-+ */
-+static inline unsigned int cpuid_eax(unsigned int op)
-+{
-+ unsigned int eax;
-+
-+ __asm__(XEN_CPUID
-+ : "=a" (eax)
-+ : "0" (op)
-+ : "bx", "cx", "dx");
-+ return eax;
-+}
-+static inline unsigned int cpuid_ebx(unsigned int op)
-+{
-+ unsigned int eax, ebx;
-+
-+ __asm__(XEN_CPUID
-+ : "=a" (eax), "=b" (ebx)
-+ : "0" (op)
-+ : "cx", "dx" );
-+ return ebx;
-+}
-+static inline unsigned int cpuid_ecx(unsigned int op)
-+{
-+ unsigned int eax, ecx;
-+
-+ __asm__(XEN_CPUID
-+ : "=a" (eax), "=c" (ecx)
-+ : "0" (op)
-+ : "bx", "dx" );
-+ return ecx;
-+}
-+static inline unsigned int cpuid_edx(unsigned int op)
-+{
-+ unsigned int eax, edx;
-+
-+ __asm__(XEN_CPUID
-+ : "=a" (eax), "=d" (edx)
-+ : "0" (op)
-+ : "bx", "cx");
-+ return edx;
-+}
-+
-+#define load_cr3(pgdir) write_cr3(__pa(pgdir))
-+
-+/*
-+ * Intel CPU features in CR4
-+ */
-+#define X86_CR4_VME 0x0001 /* enable vm86 extensions */
-+#define X86_CR4_PVI 0x0002 /* virtual interrupts flag enable */
-+#define X86_CR4_TSD 0x0004 /* disable time stamp at ipl 3 */
-+#define X86_CR4_DE 0x0008 /* enable debugging extensions */
-+#define X86_CR4_PSE 0x0010 /* enable page size extensions */
-+#define X86_CR4_PAE 0x0020 /* enable physical address extensions */
-+#define X86_CR4_MCE 0x0040 /* Machine check enable */
-+#define X86_CR4_PGE 0x0080 /* enable global pages */
-+#define X86_CR4_PCE 0x0100 /* enable performance counters at ipl 3 */
-+#define X86_CR4_OSFXSR 0x0200 /* enable fast FPU save and restore */
-+#define X86_CR4_OSXMMEXCPT 0x0400 /* enable unmasked SSE exceptions */
-+
-+/*
-+ * Save the cr4 feature set we're using (ie
-+ * Pentium 4MB enable and PPro Global page
-+ * enable), so that any CPU's that boot up
-+ * after us can get the correct flags.
-+ */
-+extern unsigned long mmu_cr4_features;
-+
-+static inline void set_in_cr4 (unsigned long mask)
-+{
-+ unsigned cr4;
-+ mmu_cr4_features |= mask;
-+ cr4 = read_cr4();
-+ cr4 |= mask;
-+ write_cr4(cr4);
-+}
-+
-+static inline void clear_in_cr4 (unsigned long mask)
-+{
-+ unsigned cr4;
-+ mmu_cr4_features &= ~mask;
-+ cr4 = read_cr4();
-+ cr4 &= ~mask;
-+ write_cr4(cr4);
-+}
-+
-+/*
-+ * NSC/Cyrix CPU configuration register indexes
-+ */
-+
-+#define CX86_PCR0 0x20
-+#define CX86_GCR 0xb8
-+#define CX86_CCR0 0xc0
-+#define CX86_CCR1 0xc1
-+#define CX86_CCR2 0xc2
-+#define CX86_CCR3 0xc3
-+#define CX86_CCR4 0xe8
-+#define CX86_CCR5 0xe9
-+#define CX86_CCR6 0xea
-+#define CX86_CCR7 0xeb
-+#define CX86_PCR1 0xf0
-+#define CX86_DIR0 0xfe
-+#define CX86_DIR1 0xff
-+#define CX86_ARR_BASE 0xc4
-+#define CX86_RCR_BASE 0xdc
-+
-+/*
-+ * NSC/Cyrix CPU indexed register access macros
-+ */
-+
-+#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
-+
-+#define setCx86(reg, data) do { \
-+ outb((reg), 0x22); \
-+ outb((data), 0x23); \
-+} while (0)
-+
-+/* Stop speculative execution */
-+static inline void sync_core(void)
-+{
-+ int tmp;
-+ asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory");
-+}
-+
-+static inline void __monitor(const void *eax, unsigned long ecx,
-+ unsigned long edx)
-+{
-+ /* "monitor %eax,%ecx,%edx;" */
-+ asm volatile(
-+ ".byte 0x0f,0x01,0xc8;"
-+ : :"a" (eax), "c" (ecx), "d"(edx));
-+}
-+
-+static inline void __mwait(unsigned long eax, unsigned long ecx)
-+{
-+ /* "mwait %eax,%ecx;" */
-+ asm volatile(
-+ ".byte 0x0f,0x01,0xc9;"
-+ : :"a" (eax), "c" (ecx));
-+}
-+
-+/* from system description table in BIOS. Mostly for MCA use, but
-+others may find it useful. */
-+extern unsigned int machine_id;
-+extern unsigned int machine_submodel_id;
-+extern unsigned int BIOS_revision;
-+extern unsigned int mca_pentium_flag;
-+
-+/* Boot loader type from the setup header */
-+extern int bootloader_type;
-+
-+/*
-+ * User space process size: 3GB (default).
-+ */
-+#define TASK_SIZE (PAGE_OFFSET)
-+
-+/* This decides where the kernel will search for a free chunk of vm
-+ * space during mmap's.
-+ */
-+#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
-+
-+#define HAVE_ARCH_PICK_MMAP_LAYOUT
-+
-+/*
-+ * Size of io_bitmap.
-+ */
-+#define IO_BITMAP_BITS 65536
-+#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
-+#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
-+#ifndef CONFIG_X86_NO_TSS
-+#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
-+#endif
-+#define INVALID_IO_BITMAP_OFFSET 0x8000
-+#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000
-+
-+struct i387_fsave_struct {
-+ long cwd;
-+ long swd;
-+ long twd;
-+ long fip;
-+ long fcs;
-+ long foo;
-+ long fos;
-+ long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
-+ long status; /* software status information */
-+};
-+
-+struct i387_fxsave_struct {
-+ unsigned short cwd;
-+ unsigned short swd;
-+ unsigned short twd;
-+ unsigned short fop;
-+ long fip;
-+ long fcs;
-+ long foo;
-+ long fos;
-+ long mxcsr;
-+ long mxcsr_mask;
-+ long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
-+ long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
-+ long padding[56];
-+} __attribute__ ((aligned (16)));
-+
-+struct i387_soft_struct {
-+ long cwd;
-+ long swd;
-+ long twd;
-+ long fip;
-+ long fcs;
-+ long foo;
-+ long fos;
-+ long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
-+ unsigned char ftop, changed, lookahead, no_update, rm, alimit;
-+ struct info *info;
-+ unsigned long entry_eip;
-+};
-+
-+union i387_union {
-+ struct i387_fsave_struct fsave;
-+ struct i387_fxsave_struct fxsave;
-+ struct i387_soft_struct soft;
-+};
-+
-+typedef struct {
-+ unsigned long seg;
-+} mm_segment_t;
-+
-+struct thread_struct;
-+
-+#ifndef CONFIG_X86_NO_TSS
-+struct tss_struct {
-+ unsigned short back_link,__blh;
-+ unsigned long esp0;
-+ unsigned short ss0,__ss0h;
-+ unsigned long esp1;
-+ unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */
-+ unsigned long esp2;
-+ unsigned short ss2,__ss2h;
-+ unsigned long __cr3;
-+ unsigned long eip;
-+ unsigned long eflags;
-+ unsigned long eax,ecx,edx,ebx;
-+ unsigned long esp;
-+ unsigned long ebp;
-+ unsigned long esi;
-+ unsigned long edi;
-+ unsigned short es, __esh;
-+ unsigned short cs, __csh;
-+ unsigned short ss, __ssh;
-+ unsigned short ds, __dsh;
-+ unsigned short fs, __fsh;
-+ unsigned short gs, __gsh;
-+ unsigned short ldt, __ldth;
-+ unsigned short trace, io_bitmap_base;
-+ /*
-+ * The extra 1 is there because the CPU will access an
-+ * additional byte beyond the end of the IO permission
-+ * bitmap. The extra byte must be all 1 bits, and must
-+ * be within the limit.
-+ */
-+ unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
-+ /*
-+ * Cache the current maximum and the last task that used the bitmap:
-+ */
-+ unsigned long io_bitmap_max;
-+ struct thread_struct *io_bitmap_owner;
-+ /*
-+ * pads the TSS to be cacheline-aligned (size is 0x100)
-+ */
-+ unsigned long __cacheline_filler[35];
-+ /*
-+ * .. and then another 0x100 bytes for emergency kernel stack
-+ */
-+ unsigned long stack[64];
-+} __attribute__((packed));
-+#endif
-+
-+#define ARCH_MIN_TASKALIGN 16
-+
-+struct thread_struct {
-+/* cached TLS descriptors. */
-+ struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
-+ unsigned long esp0;
-+ unsigned long sysenter_cs;
-+ unsigned long eip;
-+ unsigned long esp;
-+ unsigned long fs;
-+ unsigned long gs;
-+/* Hardware debugging registers */
-+ unsigned long debugreg[8]; /* %%db0-7 debug registers */
-+/* fault info */
-+ unsigned long cr2, trap_no, error_code;
-+/* floating point info */
-+ union i387_union i387;
-+/* virtual 86 mode info */
-+ struct vm86_struct __user * vm86_info;
-+ unsigned long screen_bitmap;
-+ unsigned long v86flags, v86mask, saved_esp0;
-+ unsigned int saved_fs, saved_gs;
-+/* IO permissions */
-+ unsigned long *io_bitmap_ptr;
-+ unsigned long iopl;
-+/* max allowed port in the bitmap, in bytes: */
-+ unsigned long io_bitmap_max;
-+};
-+
-+#define INIT_THREAD { \
-+ .vm86_info = NULL, \
-+ .sysenter_cs = __KERNEL_CS, \
-+ .io_bitmap_ptr = NULL, \
-+}
-+
-+#ifndef CONFIG_X86_NO_TSS
-+/*
-+ * Note that the .io_bitmap member must be extra-big. This is because
-+ * the CPU will access an additional byte beyond the end of the IO
-+ * permission bitmap. The extra byte must be all 1 bits, and must
-+ * be within the limit.
-+ */
-+#define INIT_TSS { \
-+ .esp0 = sizeof(init_stack) + (long)&init_stack, \
-+ .ss0 = __KERNEL_DS, \
-+ .ss1 = __KERNEL_CS, \
-+ .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \
-+ .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \
-+}
-+
-+static inline void __load_esp0(struct tss_struct *tss, struct thread_struct *thread)
-+{
-+ tss->esp0 = thread->esp0;
-+ /* This can only happen when SEP is enabled, no need to test "SEP"arately */
-+ if (unlikely(tss->ss1 != thread->sysenter_cs)) {
-+ tss->ss1 = thread->sysenter_cs;
-+ wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
-+ }
-+}
-+#define load_esp0(tss, thread) \
-+ __load_esp0(tss, thread)
-+#else
-+#define load_esp0(tss, thread) do { \
-+ if (HYPERVISOR_stack_switch(__KERNEL_DS, (thread)->esp0)) \
-+ BUG(); \
-+} while (0)
-+#endif
-+
-+#define start_thread(regs, new_eip, new_esp) do { \
-+ __asm__("movl %0,%%fs ; movl %0,%%gs": :"r" (0)); \
-+ set_fs(USER_DS); \
-+ regs->xds = __USER_DS; \
-+ regs->xes = __USER_DS; \
-+ regs->xss = __USER_DS; \
-+ regs->xcs = __USER_CS; \
-+ regs->eip = new_eip; \
-+ regs->esp = new_esp; \
-+} while (0)
-+
-+/*
-+ * These special macros can be used to get or set a debugging register
-+ */
-+#define get_debugreg(var, register) \
-+ (var) = HYPERVISOR_get_debugreg((register))
-+#define set_debugreg(value, register) \
-+ WARN_ON(HYPERVISOR_set_debugreg((register), (value)))
-+
-+/*
-+ * Set IOPL bits in EFLAGS from given mask
-+ */
-+static inline void set_iopl_mask(unsigned mask)
-+{
-+ struct physdev_set_iopl set_iopl;
-+
-+ /* Force the change at ring 0. */
-+ set_iopl.iopl = (mask == 0) ? 1 : (mask >> 12) & 3;
-+ WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl));
-+}
-+
-+/* Forward declaration, a strange C thing */
-+struct task_struct;
-+struct mm_struct;
-+
-+/* Free all resources held by a thread. */
-+extern void release_thread(struct task_struct *);
-+
-+/* Prepare to copy thread state - unlazy all lazy status */
-+extern void prepare_to_copy(struct task_struct *tsk);
-+
-+/*
-+ * create a kernel thread without removing it from tasklists
-+ */
-+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-+
-+extern unsigned long thread_saved_pc(struct task_struct *tsk);
-+void show_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack);
-+
-+unsigned long get_wchan(struct task_struct *p);
-+
-+#define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
-+#define KSTK_TOP(info) \
-+({ \
-+ unsigned long *__ptr = (unsigned long *)(info); \
-+ (unsigned long)(&__ptr[THREAD_SIZE_LONGS]); \
-+})
-+
-+/*
-+ * The below -8 is to reserve 8 bytes on top of the ring0 stack.
-+ * This is necessary to guarantee that the entire "struct pt_regs"
-+ * is accessable even if the CPU haven't stored the SS/ESP registers
-+ * on the stack (interrupt gate does not save these registers
-+ * when switching to the same priv ring).
-+ * Therefore beware: accessing the xss/esp fields of the
-+ * "struct pt_regs" is possible, but they may contain the
-+ * completely wrong values.
-+ */
-+#define task_pt_regs(task) \
-+({ \
-+ struct pt_regs *__regs__; \
-+ __regs__ = (struct pt_regs *)(KSTK_TOP(task_stack_page(task))-8); \
-+ __regs__ - 1; \
-+})
-+
-+#define KSTK_EIP(task) (task_pt_regs(task)->eip)
-+#define KSTK_ESP(task) (task_pt_regs(task)->esp)
-+
-+
-+struct microcode_header {
-+ unsigned int hdrver;
-+ unsigned int rev;
-+ unsigned int date;
-+ unsigned int sig;
-+ unsigned int cksum;
-+ unsigned int ldrver;
-+ unsigned int pf;
-+ unsigned int datasize;
-+ unsigned int totalsize;
-+ unsigned int reserved[3];
-+};
-+
-+struct microcode {
-+ struct microcode_header hdr;
-+ unsigned int bits[0];
-+};
-+
-+typedef struct microcode microcode_t;
-+typedef struct microcode_header microcode_header_t;
-+
-+/* microcode format is extended from prescott processors */
-+struct extended_signature {
-+ unsigned int sig;
-+ unsigned int pf;
-+ unsigned int cksum;
-+};
-+
-+struct extended_sigtable {
-+ unsigned int count;
-+ unsigned int cksum;
-+ unsigned int reserved[3];
-+ struct extended_signature sigs[0];
-+};
-+
-+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
-+static inline void rep_nop(void)
-+{
-+ __asm__ __volatile__("rep;nop": : :"memory");
-+}
-+
-+#define cpu_relax() rep_nop()
-+
-+/* generic versions from gas */
-+#define GENERIC_NOP1 ".byte 0x90\n"
-+#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
-+#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
-+#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
-+#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
-+#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
-+#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
-+#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
-+
-+/* Opteron nops */
-+#define K8_NOP1 GENERIC_NOP1
-+#define K8_NOP2 ".byte 0x66,0x90\n"
-+#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
-+#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
-+#define K8_NOP5 K8_NOP3 K8_NOP2
-+#define K8_NOP6 K8_NOP3 K8_NOP3
-+#define K8_NOP7 K8_NOP4 K8_NOP3
-+#define K8_NOP8 K8_NOP4 K8_NOP4
-+
-+/* K7 nops */
-+/* uses eax dependencies (arbitary choice) */
-+#define K7_NOP1 GENERIC_NOP1
-+#define K7_NOP2 ".byte 0x8b,0xc0\n"
-+#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
-+#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
-+#define K7_NOP5 K7_NOP4 ASM_NOP1
-+#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
-+#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
-+#define K7_NOP8 K7_NOP7 ASM_NOP1
-+
-+#ifdef CONFIG_MK8
-+#define ASM_NOP1 K8_NOP1
-+#define ASM_NOP2 K8_NOP2
-+#define ASM_NOP3 K8_NOP3
-+#define ASM_NOP4 K8_NOP4
-+#define ASM_NOP5 K8_NOP5
-+#define ASM_NOP6 K8_NOP6
-+#define ASM_NOP7 K8_NOP7
-+#define ASM_NOP8 K8_NOP8
-+#elif defined(CONFIG_MK7)
-+#define ASM_NOP1 K7_NOP1
-+#define ASM_NOP2 K7_NOP2
-+#define ASM_NOP3 K7_NOP3
-+#define ASM_NOP4 K7_NOP4
-+#define ASM_NOP5 K7_NOP5
-+#define ASM_NOP6 K7_NOP6
-+#define ASM_NOP7 K7_NOP7
-+#define ASM_NOP8 K7_NOP8
-+#else
-+#define ASM_NOP1 GENERIC_NOP1
-+#define ASM_NOP2 GENERIC_NOP2
-+#define ASM_NOP3 GENERIC_NOP3
-+#define ASM_NOP4 GENERIC_NOP4
-+#define ASM_NOP5 GENERIC_NOP5
-+#define ASM_NOP6 GENERIC_NOP6
-+#define ASM_NOP7 GENERIC_NOP7
-+#define ASM_NOP8 GENERIC_NOP8
-+#endif
-+
-+#define ASM_NOP_MAX 8
-+
-+/* Prefetch instructions for Pentium III and AMD Athlon */
-+/* It's not worth to care about 3dnow! prefetches for the K6
-+ because they are microcoded there and very slow.
-+ However we don't do prefetches for pre XP Athlons currently
-+ That should be fixed. */
-+#define ARCH_HAS_PREFETCH
-+static inline void prefetch(const void *x)
-+{
-+ alternative_input(ASM_NOP4,
-+ "prefetchnta (%1)",
-+ X86_FEATURE_XMM,
-+ "r" (x));
-+}
-+
-+#define ARCH_HAS_PREFETCH
-+#define ARCH_HAS_PREFETCHW
-+#define ARCH_HAS_SPINLOCK_PREFETCH
-+
-+/* 3dnow! prefetch to get an exclusive cache line. Useful for
-+ spinlocks to avoid one state transition in the cache coherency protocol. */
-+static inline void prefetchw(const void *x)
-+{
-+ alternative_input(ASM_NOP4,
-+ "prefetchw (%1)",
-+ X86_FEATURE_3DNOW,
-+ "r" (x));
-+}
-+#define spin_lock_prefetch(x) prefetchw(x)
-+
-+extern void select_idle_routine(const struct cpuinfo_x86 *c);
-+
-+#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
-+
-+extern unsigned long boot_option_idle_override;
-+extern void enable_sep_cpu(void);
-+extern int sysenter_setup(void);
-+
-+#endif /* __ASM_I386_PROCESSOR_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/processor_64.h
-@@ -0,0 +1,502 @@
-+/*
-+ * include/asm-x86_64/processor.h
-+ *
-+ * Copyright (C) 1994 Linus Torvalds
-+ */
-+
-+#ifndef __ASM_X86_64_PROCESSOR_H
-+#define __ASM_X86_64_PROCESSOR_H
-+
-+#include <asm/segment.h>
-+#include <asm/page.h>
-+#include <asm/types.h>
-+#include <asm/sigcontext.h>
-+#include <asm/cpufeature.h>
-+#include <linux/threads.h>
-+#include <asm/msr.h>
-+#include <asm/current.h>
-+#include <asm/system.h>
-+#include <asm/mmsegment.h>
-+#include <asm/percpu.h>
-+#include <linux/personality.h>
-+#include <linux/cpumask.h>
-+
-+#define TF_MASK 0x00000100
-+#define IF_MASK 0x00000200
-+#define IOPL_MASK 0x00003000
-+#define NT_MASK 0x00004000
-+#define VM_MASK 0x00020000
-+#define AC_MASK 0x00040000
-+#define VIF_MASK 0x00080000 /* virtual interrupt flag */
-+#define VIP_MASK 0x00100000 /* virtual interrupt pending */
-+#define ID_MASK 0x00200000
-+
-+#define desc_empty(desc) \
-+ (!((desc)->a | (desc)->b))
-+
-+#define desc_equal(desc1, desc2) \
-+ (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
-+
-+/*
-+ * Default implementation of macro that returns current
-+ * instruction pointer ("program counter").
-+ */
-+#define current_text_addr() ({ void *pc; asm volatile("leaq 1f(%%rip),%0\n1:":"=r"(pc)); pc; })
-+
-+/*
-+ * CPU type and hardware bug flags. Kept separately for each CPU.
-+ */
-+
-+struct cpuinfo_x86 {
-+ __u8 x86; /* CPU family */
-+ __u8 x86_vendor; /* CPU vendor */
-+ __u8 x86_model;
-+ __u8 x86_mask;
-+ int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */
-+ __u32 x86_capability[NCAPINTS];
-+ char x86_vendor_id[16];
-+ char x86_model_id[64];
-+ int x86_cache_size; /* in KB */
-+ int x86_clflush_size;
-+ int x86_cache_alignment;
-+ int x86_tlbsize; /* number of 4K pages in DTLB/ITLB combined(in pages)*/
-+ __u8 x86_virt_bits, x86_phys_bits;
-+ __u8 x86_max_cores; /* cpuid returned max cores value */
-+ __u32 x86_power;
-+ __u32 extended_cpuid_level; /* Max extended CPUID function supported */
-+ unsigned long loops_per_jiffy;
-+#ifdef CONFIG_SMP
-+ cpumask_t llc_shared_map; /* cpus sharing the last level cache */
-+#endif
-+ __u8 apicid;
-+#ifdef CONFIG_SMP
-+ __u8 booted_cores; /* number of cores as seen by OS */
-+ __u8 phys_proc_id; /* Physical Processor id. */
-+ __u8 cpu_core_id; /* Core id. */
-+#endif
-+} ____cacheline_aligned;
-+
-+#define X86_VENDOR_INTEL 0
-+#define X86_VENDOR_CYRIX 1
-+#define X86_VENDOR_AMD 2
-+#define X86_VENDOR_UMC 3
-+#define X86_VENDOR_NEXGEN 4
-+#define X86_VENDOR_CENTAUR 5
-+#define X86_VENDOR_RISE 6
-+#define X86_VENDOR_TRANSMETA 7
-+#define X86_VENDOR_NUM 8
-+#define X86_VENDOR_UNKNOWN 0xff
-+
-+#ifdef CONFIG_SMP
-+extern struct cpuinfo_x86 cpu_data[];
-+#define current_cpu_data cpu_data[smp_processor_id()]
-+#else
-+#define cpu_data (&boot_cpu_data)
-+#define current_cpu_data boot_cpu_data
-+#endif
-+
-+extern char ignore_irq13;
-+
-+extern void identify_cpu(struct cpuinfo_x86 *);
-+extern void print_cpu_info(struct cpuinfo_x86 *);
-+extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
-+extern unsigned short num_cache_leaves;
-+
-+/*
-+ * EFLAGS bits
-+ */
-+#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */
-+#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */
-+#define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */
-+#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */
-+#define X86_EFLAGS_SF 0x00000080 /* Sign Flag */
-+#define X86_EFLAGS_TF 0x00000100 /* Trap Flag */
-+#define X86_EFLAGS_IF 0x00000200 /* Interrupt Flag */
-+#define X86_EFLAGS_DF 0x00000400 /* Direction Flag */
-+#define X86_EFLAGS_OF 0x00000800 /* Overflow Flag */
-+#define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */
-+#define X86_EFLAGS_NT 0x00004000 /* Nested Task */
-+#define X86_EFLAGS_RF 0x00010000 /* Resume Flag */
-+#define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */
-+#define X86_EFLAGS_AC 0x00040000 /* Alignment Check */
-+#define X86_EFLAGS_VIF 0x00080000 /* Virtual Interrupt Flag */
-+#define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */
-+#define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */
-+
-+/*
-+ * Intel CPU features in CR4
-+ */
-+#define X86_CR4_VME 0x0001 /* enable vm86 extensions */
-+#define X86_CR4_PVI 0x0002 /* virtual interrupts flag enable */
-+#define X86_CR4_TSD 0x0004 /* disable time stamp at ipl 3 */
-+#define X86_CR4_DE 0x0008 /* enable debugging extensions */
-+#define X86_CR4_PSE 0x0010 /* enable page size extensions */
-+#define X86_CR4_PAE 0x0020 /* enable physical address extensions */
-+#define X86_CR4_MCE 0x0040 /* Machine check enable */
-+#define X86_CR4_PGE 0x0080 /* enable global pages */
-+#define X86_CR4_PCE 0x0100 /* enable performance counters at ipl 3 */
-+#define X86_CR4_OSFXSR 0x0200 /* enable fast FPU save and restore */
-+#define X86_CR4_OSXMMEXCPT 0x0400 /* enable unmasked SSE exceptions */
-+
-+/*
-+ * Save the cr4 feature set we're using (ie
-+ * Pentium 4MB enable and PPro Global page
-+ * enable), so that any CPU's that boot up
-+ * after us can get the correct flags.
-+ */
-+extern unsigned long mmu_cr4_features;
-+
-+static inline void set_in_cr4 (unsigned long mask)
-+{
-+ mmu_cr4_features |= mask;
-+ __asm__("movq %%cr4,%%rax\n\t"
-+ "orq %0,%%rax\n\t"
-+ "movq %%rax,%%cr4\n"
-+ : : "irg" (mask)
-+ :"ax");
-+}
-+
-+static inline void clear_in_cr4 (unsigned long mask)
-+{
-+ mmu_cr4_features &= ~mask;
-+ __asm__("movq %%cr4,%%rax\n\t"
-+ "andq %0,%%rax\n\t"
-+ "movq %%rax,%%cr4\n"
-+ : : "irg" (~mask)
-+ :"ax");
-+}
-+
-+
-+/*
-+ * User space process size. 47bits minus one guard page.
-+ */
-+#define TASK_SIZE64 (0x800000000000UL - 4096)
-+
-+/* This decides where the kernel will search for a free chunk of vm
-+ * space during mmap's.
-+ */
-+#define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000)
-+
-+#define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64)
-+#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64)
-+
-+#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE/3)
-+
-+/*
-+ * Size of io_bitmap.
-+ */
-+#define IO_BITMAP_BITS 65536
-+#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
-+#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
-+#ifndef CONFIG_X86_NO_TSS
-+#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
-+#endif
-+#define INVALID_IO_BITMAP_OFFSET 0x8000
-+
-+struct i387_fxsave_struct {
-+ u16 cwd;
-+ u16 swd;
-+ u16 twd;
-+ u16 fop;
-+ u64 rip;
-+ u64 rdp;
-+ u32 mxcsr;
-+ u32 mxcsr_mask;
-+ u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
-+ u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 128 bytes */
-+ u32 padding[24];
-+} __attribute__ ((aligned (16)));
-+
-+union i387_union {
-+ struct i387_fxsave_struct fxsave;
-+};
-+
-+#ifndef CONFIG_X86_NO_TSS
-+struct tss_struct {
-+ u32 reserved1;
-+ u64 rsp0;
-+ u64 rsp1;
-+ u64 rsp2;
-+ u64 reserved2;
-+ u64 ist[7];
-+ u32 reserved3;
-+ u32 reserved4;
-+ u16 reserved5;
-+ u16 io_bitmap_base;
-+ /*
-+ * The extra 1 is there because the CPU will access an
-+ * additional byte beyond the end of the IO permission
-+ * bitmap. The extra byte must be all 1 bits, and must
-+ * be within the limit. Thus we have:
-+ *
-+ * 128 bytes, the bitmap itself, for ports 0..0x3ff
-+ * 8 bytes, for an extra "long" of ~0UL
-+ */
-+ unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
-+} __attribute__((packed)) ____cacheline_aligned;
-+
-+DECLARE_PER_CPU(struct tss_struct,init_tss);
-+#endif
-+
-+
-+extern struct cpuinfo_x86 boot_cpu_data;
-+#ifndef CONFIG_X86_NO_TSS
-+/* Save the original ist values for checking stack pointers during debugging */
-+struct orig_ist {
-+ unsigned long ist[7];
-+};
-+DECLARE_PER_CPU(struct orig_ist, orig_ist);
-+#endif
-+
-+#ifdef CONFIG_X86_VSMP
-+#define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT)
-+#define ARCH_MIN_MMSTRUCT_ALIGN (1 << INTERNODE_CACHE_SHIFT)
-+#else
-+#define ARCH_MIN_TASKALIGN 16
-+#define ARCH_MIN_MMSTRUCT_ALIGN 0
-+#endif
-+
-+struct thread_struct {
-+ unsigned long rsp0;
-+ unsigned long rsp;
-+ unsigned long userrsp; /* Copy from PDA */
-+ unsigned long fs;
-+ unsigned long gs;
-+ unsigned short es, ds, fsindex, gsindex;
-+/* Hardware debugging registers */
-+ unsigned long debugreg0;
-+ unsigned long debugreg1;
-+ unsigned long debugreg2;
-+ unsigned long debugreg3;
-+ unsigned long debugreg6;
-+ unsigned long debugreg7;
-+/* fault info */
-+ unsigned long cr2, trap_no, error_code;
-+/* floating point info */
-+ union i387_union i387 __attribute__((aligned(16)));
-+/* IO permissions. the bitmap could be moved into the GDT, that would make
-+ switch faster for a limited number of ioperm using tasks. -AK */
-+ int ioperm;
-+ unsigned long *io_bitmap_ptr;
-+ unsigned io_bitmap_max;
-+/* cached TLS descriptors. */
-+ u64 tls_array[GDT_ENTRY_TLS_ENTRIES];
-+ unsigned int iopl;
-+} __attribute__((aligned(16)));
-+
-+#define INIT_THREAD { \
-+ .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \
-+}
-+
-+#ifndef CONFIG_X86_NO_TSS
-+#define INIT_TSS { \
-+ .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \
-+}
-+#endif
-+
-+#define INIT_MMAP \
-+{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
-+
-+#define start_thread(regs,new_rip,new_rsp) do { \
-+ asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \
-+ load_gs_index(0); \
-+ (regs)->rip = (new_rip); \
-+ (regs)->rsp = (new_rsp); \
-+ write_pda(oldrsp, (new_rsp)); \
-+ (regs)->cs = __USER_CS; \
-+ (regs)->ss = __USER_DS; \
-+ (regs)->eflags = 0x200; \
-+ set_fs(USER_DS); \
-+} while(0)
-+
-+#define get_debugreg(var, register) \
-+ var = HYPERVISOR_get_debugreg(register)
-+#define set_debugreg(value, register) do { \
-+ if (HYPERVISOR_set_debugreg(register, value)) \
-+ BUG(); \
-+} while (0)
-+
-+struct task_struct;
-+struct mm_struct;
-+
-+/* Free all resources held by a thread. */
-+extern void release_thread(struct task_struct *);
-+
-+/* Prepare to copy thread state - unlazy all lazy status */
-+extern void prepare_to_copy(struct task_struct *tsk);
-+
-+/*
-+ * create a kernel thread without removing it from tasklists
-+ */
-+extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-+
-+/*
-+ * Return saved PC of a blocked thread.
-+ * What is this good for? it will be always the scheduler or ret_from_fork.
-+ */
-+#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.rsp - 8))
-+
-+extern unsigned long get_wchan(struct task_struct *p);
-+#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.rsp0 - 1)
-+#define KSTK_EIP(tsk) (task_pt_regs(tsk)->rip)
-+#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */
-+
-+
-+struct microcode_header {
-+ unsigned int hdrver;
-+ unsigned int rev;
-+ unsigned int date;
-+ unsigned int sig;
-+ unsigned int cksum;
-+ unsigned int ldrver;
-+ unsigned int pf;
-+ unsigned int datasize;
-+ unsigned int totalsize;
-+ unsigned int reserved[3];
-+};
-+
-+struct microcode {
-+ struct microcode_header hdr;
-+ unsigned int bits[0];
-+};
-+
-+typedef struct microcode microcode_t;
-+typedef struct microcode_header microcode_header_t;
-+
-+/* microcode format is extended from prescott processors */
-+struct extended_signature {
-+ unsigned int sig;
-+ unsigned int pf;
-+ unsigned int cksum;
-+};
-+
-+struct extended_sigtable {
-+ unsigned int count;
-+ unsigned int cksum;
-+ unsigned int reserved[3];
-+ struct extended_signature sigs[0];
-+};
-+
-+
-+#define ASM_NOP1 K8_NOP1
-+#define ASM_NOP2 K8_NOP2
-+#define ASM_NOP3 K8_NOP3
-+#define ASM_NOP4 K8_NOP4
-+#define ASM_NOP5 K8_NOP5
-+#define ASM_NOP6 K8_NOP6
-+#define ASM_NOP7 K8_NOP7
-+#define ASM_NOP8 K8_NOP8
-+
-+/* Opteron nops */
-+#define K8_NOP1 ".byte 0x90\n"
-+#define K8_NOP2 ".byte 0x66,0x90\n"
-+#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
-+#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
-+#define K8_NOP5 K8_NOP3 K8_NOP2
-+#define K8_NOP6 K8_NOP3 K8_NOP3
-+#define K8_NOP7 K8_NOP4 K8_NOP3
-+#define K8_NOP8 K8_NOP4 K8_NOP4
-+
-+#define ASM_NOP_MAX 8
-+
-+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
-+static inline void rep_nop(void)
-+{
-+ __asm__ __volatile__("rep;nop": : :"memory");
-+}
-+
-+/* Stop speculative execution */
-+static inline void sync_core(void)
-+{
-+ int tmp;
-+ asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory");
-+}
-+
-+#define cpu_has_fpu 1
-+
-+#define ARCH_HAS_PREFETCH
-+static inline void prefetch(void *x)
-+{
-+ asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x));
-+}
-+
-+#define ARCH_HAS_PREFETCHW 1
-+static inline void prefetchw(void *x)
-+{
-+ alternative_input("prefetcht0 (%1)",
-+ "prefetchw (%1)",
-+ X86_FEATURE_3DNOW,
-+ "r" (x));
-+}
-+
-+#define ARCH_HAS_SPINLOCK_PREFETCH 1
-+
-+#define spin_lock_prefetch(x) prefetchw(x)
-+
-+#define cpu_relax() rep_nop()
-+
-+/*
-+ * NSC/Cyrix CPU configuration register indexes
-+ */
-+#define CX86_CCR0 0xc0
-+#define CX86_CCR1 0xc1
-+#define CX86_CCR2 0xc2
-+#define CX86_CCR3 0xc3
-+#define CX86_CCR4 0xe8
-+#define CX86_CCR5 0xe9
-+#define CX86_CCR6 0xea
-+#define CX86_CCR7 0xeb
-+#define CX86_DIR0 0xfe
-+#define CX86_DIR1 0xff
-+#define CX86_ARR_BASE 0xc4
-+#define CX86_RCR_BASE 0xdc
-+
-+/*
-+ * NSC/Cyrix CPU indexed register access macros
-+ */
-+
-+#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
-+
-+#define setCx86(reg, data) do { \
-+ outb((reg), 0x22); \
-+ outb((data), 0x23); \
-+} while (0)
-+
-+static inline void serialize_cpu(void)
-+{
-+ __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
-+}
-+
-+static inline void __monitor(const void *eax, unsigned long ecx,
-+ unsigned long edx)
-+{
-+ /* "monitor %eax,%ecx,%edx;" */
-+ asm volatile(
-+ ".byte 0x0f,0x01,0xc8;"
-+ : :"a" (eax), "c" (ecx), "d"(edx));
-+}
-+
-+static inline void __mwait(unsigned long eax, unsigned long ecx)
-+{
-+ /* "mwait %eax,%ecx;" */
-+ asm volatile(
-+ ".byte 0x0f,0x01,0xc9;"
-+ : :"a" (eax), "c" (ecx));
-+}
-+
-+#define stack_current() \
-+({ \
-+ struct thread_info *ti; \
-+ asm("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \
-+ ti->task; \
-+})
-+
-+#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
-+
-+extern unsigned long boot_option_idle_override;
-+/* Boot loader type from the setup header */
-+extern int bootloader_type;
-+
-+#define HAVE_ARCH_PICK_MMAP_LAYOUT 1
-+
-+#endif /* __ASM_X86_64_PROCESSOR_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/smp_32.h
-@@ -0,0 +1,103 @@
-+#ifndef __ASM_SMP_H
-+#define __ASM_SMP_H
-+
-+/*
-+ * We need the APIC definitions automatically as part of 'smp.h'
-+ */
-+#ifndef __ASSEMBLY__
-+#include <linux/kernel.h>
-+#include <linux/threads.h>
-+#include <linux/cpumask.h>
-+#endif
-+
-+#ifdef CONFIG_X86_LOCAL_APIC
-+#ifndef __ASSEMBLY__
-+#include <asm/fixmap.h>
-+#include <asm/bitops.h>
-+#include <asm/mpspec.h>
-+#ifdef CONFIG_X86_IO_APIC
-+#include <asm/io_apic.h>
-+#endif
-+#include <asm/apic.h>
-+#endif
-+#endif
-+
-+#define BAD_APICID 0xFFu
-+#ifdef CONFIG_SMP
-+#ifndef __ASSEMBLY__
-+
-+/*
-+ * Private routines/data
-+ */
-+
-+extern void smp_alloc_memory(void);
-+extern int pic_mode;
-+extern int smp_num_siblings;
-+extern cpumask_t cpu_sibling_map[];
-+extern cpumask_t cpu_core_map[];
-+
-+extern void (*mtrr_hook) (void);
-+extern void zap_low_mappings (void);
-+extern void lock_ipi_call_lock(void);
-+extern void unlock_ipi_call_lock(void);
-+
-+#define MAX_APICID 256
-+extern u8 x86_cpu_to_apicid[];
-+
-+#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
-+
-+#ifdef CONFIG_HOTPLUG_CPU
-+extern void cpu_exit_clear(void);
-+extern void cpu_uninit(void);
-+#endif
-+
-+/*
-+ * This function is needed by all SMP systems. It must _always_ be valid
-+ * from the initial startup. We map APIC_BASE very early in page_setup(),
-+ * so this is correct in the x86 case.
-+ */
-+#define raw_smp_processor_id() (current_thread_info()->cpu)
-+
-+extern cpumask_t cpu_possible_map;
-+#define cpu_callin_map cpu_possible_map
-+
-+/* We don't mark CPUs online until __cpu_up(), so we need another measure */
-+static inline int num_booting_cpus(void)
-+{
-+ return cpus_weight(cpu_possible_map);
-+}
-+
-+#ifdef CONFIG_X86_LOCAL_APIC
-+
-+#ifdef APIC_DEFINITION
-+extern int hard_smp_processor_id(void);
-+#else
-+#include <mach_apicdef.h>
-+static inline int hard_smp_processor_id(void)
-+{
-+ /* we don't want to mark this access volatile - bad code generation */
-+ return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID));
-+}
-+#endif
-+
-+static __inline int logical_smp_processor_id(void)
-+{
-+ /* we don't want to mark this access volatile - bad code generation */
-+ return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR));
-+}
-+
-+#endif
-+
-+extern int __cpu_disable(void);
-+extern void __cpu_die(unsigned int cpu);
-+extern void prefill_possible_map(void);
-+#endif /* !__ASSEMBLY__ */
-+
-+#else /* CONFIG_SMP */
-+
-+#define cpu_physical_id(cpu) boot_cpu_physical_apicid
-+
-+#define NO_PROC_ID 0xFF /* No processor magic marker */
-+
-+#endif
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/smp_64.h
-@@ -0,0 +1,150 @@
-+#ifndef __ASM_SMP_H
-+#define __ASM_SMP_H
-+
-+/*
-+ * We need the APIC definitions automatically as part of 'smp.h'
-+ */
-+#ifndef __ASSEMBLY__
-+#include <linux/threads.h>
-+#include <linux/cpumask.h>
-+#include <linux/bitops.h>
-+extern int disable_apic;
-+#endif
-+
-+#ifdef CONFIG_X86_LOCAL_APIC
-+#ifndef __ASSEMBLY__
-+#include <asm/fixmap.h>
-+#include <asm/mpspec.h>
-+#ifdef CONFIG_X86_IO_APIC
-+#include <asm/io_apic.h>
-+#endif
-+#include <asm/apic.h>
-+#include <asm/thread_info.h>
-+#endif
-+#endif
-+
-+#ifdef CONFIG_SMP
-+#ifndef ASSEMBLY
-+
-+#include <asm/pda.h>
-+
-+struct pt_regs;
-+
-+extern cpumask_t cpu_present_mask;
-+extern cpumask_t cpu_possible_map;
-+extern cpumask_t cpu_online_map;
-+extern cpumask_t cpu_initialized;
-+
-+/*
-+ * Private routines/data
-+ */
-+
-+extern void smp_alloc_memory(void);
-+extern volatile unsigned long smp_invalidate_needed;
-+extern int pic_mode;
-+extern void lock_ipi_call_lock(void);
-+extern void unlock_ipi_call_lock(void);
-+extern int smp_num_siblings;
-+extern void smp_send_reschedule(int cpu);
-+void smp_stop_cpu(void);
-+extern int smp_call_function_single(int cpuid, void (*func) (void *info),
-+ void *info, int retry, int wait);
-+
-+extern cpumask_t cpu_sibling_map[NR_CPUS];
-+extern cpumask_t cpu_core_map[NR_CPUS];
-+extern u8 cpu_llc_id[NR_CPUS];
-+
-+#define SMP_TRAMPOLINE_BASE 0x6000
-+
-+/*
-+ * On x86 all CPUs are mapped 1:1 to the APIC space.
-+ * This simplifies scheduling and IPI sending and
-+ * compresses data structures.
-+ */
-+
-+static inline int num_booting_cpus(void)
-+{
-+ return cpus_weight(cpu_possible_map);
-+}
-+
-+#define raw_smp_processor_id() read_pda(cpunumber)
-+
-+#ifdef CONFIG_X86_LOCAL_APIC
-+static inline int hard_smp_processor_id(void)
-+{
-+ /* we don't want to mark this access volatile - bad code generation */
-+ return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID));
-+}
-+#endif
-+
-+extern int safe_smp_processor_id(void);
-+extern int __cpu_disable(void);
-+extern void __cpu_die(unsigned int cpu);
-+extern void prefill_possible_map(void);
-+extern unsigned num_processors;
-+extern unsigned disabled_cpus;
-+
-+#endif /* !ASSEMBLY */
-+
-+#define NO_PROC_ID 0xFF /* No processor magic marker */
-+
-+#endif
-+
-+#ifndef ASSEMBLY
-+/*
-+ * Some lowlevel functions might want to know about
-+ * the real APIC ID <-> CPU # mapping.
-+ */
-+extern u8 x86_cpu_to_apicid[NR_CPUS]; /* physical ID */
-+extern u8 x86_cpu_to_log_apicid[NR_CPUS];
-+extern u8 bios_cpu_apicid[];
-+
-+#ifdef CONFIG_X86_LOCAL_APIC
-+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
-+{
-+ return cpus_addr(cpumask)[0];
-+}
-+
-+static inline int cpu_present_to_apicid(int mps_cpu)
-+{
-+ if (mps_cpu < NR_CPUS)
-+ return (int)bios_cpu_apicid[mps_cpu];
-+ else
-+ return BAD_APICID;
-+}
-+#endif
-+
-+#endif /* !ASSEMBLY */
-+
-+#ifndef CONFIG_SMP
-+#define stack_smp_processor_id() 0
-+#define safe_smp_processor_id() 0
-+#define cpu_logical_map(x) (x)
-+#else
-+#include <asm/thread_info.h>
-+#define stack_smp_processor_id() \
-+({ \
-+ struct thread_info *ti; \
-+ __asm__("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \
-+ ti->cpu; \
-+})
-+#endif
-+
-+#ifndef __ASSEMBLY__
-+#ifdef CONFIG_X86_LOCAL_APIC
-+static __inline int logical_smp_processor_id(void)
-+{
-+ /* we don't want to mark this access volatile - bad code generation */
-+ return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR));
-+}
-+#endif
-+#endif
-+
-+#ifdef CONFIG_SMP
-+#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
-+#else
-+#define cpu_physical_id(cpu) boot_cpu_id
-+#endif
-+
-+#endif
-+
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/synch_bitops.h
-@@ -0,0 +1,126 @@
-+#ifndef __XEN_SYNCH_BITOPS_H__
-+#define __XEN_SYNCH_BITOPS_H__
-+
-+/*
-+ * Copyright 1992, Linus Torvalds.
-+ * Heavily modified to provide guaranteed strong synchronisation
-+ * when communicating with Xen or other guest OSes running on other CPUs.
-+ */
-+
-+#ifdef HAVE_XEN_PLATFORM_COMPAT_H
-+#include <xen/platform-compat.h>
-+#endif
-+
-+#define ADDR (*(volatile long *) addr)
-+
-+static __inline__ void synch_set_bit(int nr, volatile void * addr)
-+{
-+ __asm__ __volatile__ (
-+ "lock btsl %1,%0"
-+ : "+m" (ADDR) : "Ir" (nr) : "memory" );
-+}
-+
-+static __inline__ void synch_clear_bit(int nr, volatile void * addr)
-+{
-+ __asm__ __volatile__ (
-+ "lock btrl %1,%0"
-+ : "+m" (ADDR) : "Ir" (nr) : "memory" );
-+}
-+
-+static __inline__ void synch_change_bit(int nr, volatile void * addr)
-+{
-+ __asm__ __volatile__ (
-+ "lock btcl %1,%0"
-+ : "+m" (ADDR) : "Ir" (nr) : "memory" );
-+}
-+
-+static __inline__ int synch_test_and_set_bit(int nr, volatile void * addr)
-+{
-+ int oldbit;
-+ __asm__ __volatile__ (
-+ "lock btsl %2,%1\n\tsbbl %0,%0"
-+ : "=r" (oldbit), "+m" (ADDR) : "Ir" (nr) : "memory");
-+ return oldbit;
-+}
-+
-+static __inline__ int synch_test_and_clear_bit(int nr, volatile void * addr)
-+{
-+ int oldbit;
-+ __asm__ __volatile__ (
-+ "lock btrl %2,%1\n\tsbbl %0,%0"
-+ : "=r" (oldbit), "+m" (ADDR) : "Ir" (nr) : "memory");
-+ return oldbit;
-+}
-+
-+static __inline__ int synch_test_and_change_bit(int nr, volatile void * addr)
-+{
-+ int oldbit;
-+
-+ __asm__ __volatile__ (
-+ "lock btcl %2,%1\n\tsbbl %0,%0"
-+ : "=r" (oldbit), "+m" (ADDR) : "Ir" (nr) : "memory");
-+ return oldbit;
-+}
-+
-+struct __synch_xchg_dummy { unsigned long a[100]; };
-+#define __synch_xg(x) ((struct __synch_xchg_dummy *)(x))
-+
-+#define synch_cmpxchg(ptr, old, new) \
-+((__typeof__(*(ptr)))__synch_cmpxchg((ptr),\
-+ (unsigned long)(old), \
-+ (unsigned long)(new), \
-+ sizeof(*(ptr))))
-+
-+static inline unsigned long __synch_cmpxchg(volatile void *ptr,
-+ unsigned long old,
-+ unsigned long new, int size)
-+{
-+ unsigned long prev;
-+ switch (size) {
-+ case 1:
-+ __asm__ __volatile__("lock; cmpxchgb %b1,%2"
-+ : "=a"(prev)
-+ : "q"(new), "m"(*__synch_xg(ptr)),
-+ "0"(old)
-+ : "memory");
-+ return prev;
-+ case 2:
-+ __asm__ __volatile__("lock; cmpxchgw %w1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__synch_xg(ptr)),
-+ "0"(old)
-+ : "memory");
-+ return prev;
-+#ifdef CONFIG_X86_64
-+ case 4:
-+ __asm__ __volatile__("lock; cmpxchgl %k1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__synch_xg(ptr)),
-+ "0"(old)
-+ : "memory");
-+ return prev;
-+ case 8:
-+ __asm__ __volatile__("lock; cmpxchgq %1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__synch_xg(ptr)),
-+ "0"(old)
-+ : "memory");
-+ return prev;
-+#else
-+ case 4:
-+ __asm__ __volatile__("lock; cmpxchgl %1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__synch_xg(ptr)),
-+ "0"(old)
-+ : "memory");
-+ return prev;
-+#endif
-+ }
-+ return old;
-+}
-+
-+#define synch_test_bit test_bit
-+
-+#define synch_cmpxchg_subword synch_cmpxchg
-+
-+#endif /* __XEN_SYNCH_BITOPS_H__ */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/system_32.h
-@@ -0,0 +1,488 @@
-+#ifndef __ASM_SYSTEM_H
-+#define __ASM_SYSTEM_H
-+
-+#include <linux/kernel.h>
-+#include <asm/segment.h>
-+#include <asm/cpufeature.h>
-+#include <linux/bitops.h> /* for LOCK_PREFIX */
-+#include <asm/synch_bitops.h>
-+#include <asm/hypervisor.h>
-+
-+#ifdef __KERNEL__
-+
-+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("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 */ \
-+ "pushl %6\n\t" /* restore EIP */ \
-+ "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), \
-+ "2" (prev), "d" (next)); \
-+} while (0)
-+
-+#define _set_base(addr,base) do { unsigned long __pr; \
-+__asm__ __volatile__ ("movw %%dx,%1\n\t" \
-+ "rorl $16,%%edx\n\t" \
-+ "movb %%dl,%2\n\t" \
-+ "movb %%dh,%3" \
-+ :"=&d" (__pr) \
-+ :"m" (*((addr)+2)), \
-+ "m" (*((addr)+4)), \
-+ "m" (*((addr)+7)), \
-+ "0" (base) \
-+ ); } while(0)
-+
-+#define _set_limit(addr,limit) do { unsigned long __lr; \
-+__asm__ __volatile__ ("movw %%dx,%1\n\t" \
-+ "rorl $16,%%edx\n\t" \
-+ "movb %2,%%dh\n\t" \
-+ "andb $0xf0,%%dh\n\t" \
-+ "orb %%dh,%%dl\n\t" \
-+ "movb %%dl,%2" \
-+ :"=&d" (__lr) \
-+ :"m" (*(addr)), \
-+ "m" (*((addr)+6)), \
-+ "0" (limit) \
-+ ); } while(0)
-+
-+#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) )
-+#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , ((limit)-1) )
-+
-+/*
-+ * Load a segment. Fall back on loading the zero
-+ * segment if something goes wrong..
-+ */
-+#define loadsegment(seg,value) \
-+ asm volatile("\n" \
-+ "1:\t" \
-+ "mov %0,%%" #seg "\n" \
-+ "2:\n" \
-+ ".section .fixup,\"ax\"\n" \
-+ "3:\t" \
-+ "pushl $0\n\t" \
-+ "popl %%" #seg "\n\t" \
-+ "jmp 2b\n" \
-+ ".previous\n" \
-+ ".section __ex_table,\"a\"\n\t" \
-+ ".align 4\n\t" \
-+ ".long 1b,3b\n" \
-+ ".previous" \
-+ : :"rm" (value))
-+
-+/*
-+ * Save a segment register away
-+ */
-+#define savesegment(seg, value) \
-+ asm volatile("mov %%" #seg ",%0":"=rm" (value))
-+
-+#define read_cr0() ({ \
-+ unsigned int __dummy; \
-+ __asm__ __volatile__( \
-+ "movl %%cr0,%0\n\t" \
-+ :"=r" (__dummy)); \
-+ __dummy; \
-+})
-+#define write_cr0(x) \
-+ __asm__ __volatile__("movl %0,%%cr0": :"r" (x))
-+
-+#define read_cr2() (current_vcpu_info()->arch.cr2)
-+#define write_cr2(x) \
-+ __asm__ __volatile__("movl %0,%%cr2": :"r" (x))
-+
-+#define read_cr3() ({ \
-+ unsigned int __dummy; \
-+ __asm__ ( \
-+ "movl %%cr3,%0\n\t" \
-+ :"=r" (__dummy)); \
-+ __dummy = xen_cr3_to_pfn(__dummy); \
-+ mfn_to_pfn(__dummy) << PAGE_SHIFT; \
-+})
-+#define write_cr3(x) ({ \
-+ unsigned int __dummy = pfn_to_mfn((x) >> PAGE_SHIFT); \
-+ __dummy = xen_pfn_to_cr3(__dummy); \
-+ __asm__ __volatile__("movl %0,%%cr3": :"r" (__dummy)); \
-+})
-+#define read_cr4() ({ \
-+ unsigned int __dummy; \
-+ __asm__( \
-+ "movl %%cr4,%0\n\t" \
-+ :"=r" (__dummy)); \
-+ __dummy; \
-+})
-+#define read_cr4_safe() ({ \
-+ unsigned int __dummy; \
-+ /* This could fault if %cr4 does not exist */ \
-+ __asm__("1: movl %%cr4, %0 \n" \
-+ "2: \n" \
-+ ".section __ex_table,\"a\" \n" \
-+ ".long 1b,2b \n" \
-+ ".previous \n" \
-+ : "=r" (__dummy): "0" (0)); \
-+ __dummy; \
-+})
-+
-+#define write_cr4(x) \
-+ __asm__ __volatile__("movl %0,%%cr4": :"r" (x))
-+
-+/*
-+ * Clear and set 'TS' bit respectively
-+ */
-+#define clts() (HYPERVISOR_fpu_taskswitch(0))
-+#define stts() (HYPERVISOR_fpu_taskswitch(1))
-+
-+#endif /* __KERNEL__ */
-+
-+#define wbinvd() \
-+ __asm__ __volatile__ ("wbinvd": : :"memory")
-+
-+static inline unsigned long get_limit(unsigned long segment)
-+{
-+ unsigned long __limit;
-+ __asm__("lsll %1,%0"
-+ :"=r" (__limit):"r" (segment));
-+ return __limit+1;
-+}
-+
-+#define nop() __asm__ __volatile__ ("nop")
-+
-+#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
-+
-+#define tas(ptr) (xchg((ptr),1))
-+
-+struct __xchg_dummy { unsigned long a[100]; };
-+#define __xg(x) ((struct __xchg_dummy *)(x))
-+
-+
-+#ifdef CONFIG_X86_CMPXCHG64
-+
-+/*
-+ * The semantics of XCHGCMP8B are a bit strange, this is why
-+ * there is a loop and the loading of %%eax and %%edx has to
-+ * be inside. This inlines well in most cases, the cached
-+ * cost is around ~38 cycles. (in the future we might want
-+ * to do an SIMD/3DNOW!/MMX/FPU 64-bit store here, but that
-+ * might have an implicit FPU-save as a cost, so it's not
-+ * clear which path to go.)
-+ *
-+ * cmpxchg8b must be used with the lock prefix here to allow
-+ * the instruction to be executed atomically, see page 3-102
-+ * of the instruction set reference 24319102.pdf. We need
-+ * the reader side to see the coherent 64bit value.
-+ */
-+static inline void __set_64bit (unsigned long long * ptr,
-+ unsigned int low, unsigned int high)
-+{
-+ __asm__ __volatile__ (
-+ "\n1:\t"
-+ "movl (%0), %%eax\n\t"
-+ "movl 4(%0), %%edx\n\t"
-+ "lock cmpxchg8b (%0)\n\t"
-+ "jnz 1b"
-+ : /* no outputs */
-+ : "D"(ptr),
-+ "b"(low),
-+ "c"(high)
-+ : "ax","dx","memory");
-+}
-+
-+static inline void __set_64bit_constant (unsigned long long *ptr,
-+ unsigned long long value)
-+{
-+ __set_64bit(ptr,(unsigned int)(value), (unsigned int)((value)>>32ULL));
-+}
-+#define ll_low(x) *(((unsigned int*)&(x))+0)
-+#define ll_high(x) *(((unsigned int*)&(x))+1)
-+
-+static inline void __set_64bit_var (unsigned long long *ptr,
-+ unsigned long long value)
-+{
-+ __set_64bit(ptr,ll_low(value), ll_high(value));
-+}
-+
-+#define set_64bit(ptr,value) \
-+(__builtin_constant_p(value) ? \
-+ __set_64bit_constant(ptr, value) : \
-+ __set_64bit_var(ptr, value) )
-+
-+#define _set_64bit(ptr,value) \
-+(__builtin_constant_p(value) ? \
-+ __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \
-+ __set_64bit(ptr, ll_low(value), ll_high(value)) )
-+
-+#endif
-+
-+/*
-+ * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
-+ * Note 2: xchg has side effect, so that attribute volatile is necessary,
-+ * but generally the primitive is invalid, *ptr is output argument. --ANK
-+ */
-+static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
-+{
-+ switch (size) {
-+ case 1:
-+ __asm__ __volatile__("xchgb %b0,%1"
-+ :"=q" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ case 2:
-+ __asm__ __volatile__("xchgw %w0,%1"
-+ :"=r" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ case 4:
-+ __asm__ __volatile__("xchgl %0,%1"
-+ :"=r" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ }
-+ return x;
-+}
-+
-+/*
-+ * Atomic compare and exchange. Compare OLD with MEM, if identical,
-+ * store NEW in MEM. Return the initial value in MEM. Success is
-+ * indicated by comparing RETURN with OLD.
-+ */
-+
-+#ifdef CONFIG_X86_CMPXCHG
-+#define __HAVE_ARCH_CMPXCHG 1
-+#define cmpxchg(ptr,o,n)\
-+ ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
-+ (unsigned long)(n),sizeof(*(ptr))))
-+#endif
-+
-+static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-+ unsigned long new, int size)
-+{
-+ unsigned long prev;
-+ switch (size) {
-+ case 1:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
-+ : "=a"(prev)
-+ : "q"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ case 2:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ case 4:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ }
-+ return old;
-+}
-+
-+#ifndef CONFIG_X86_CMPXCHG
-+/*
-+ * Building a kernel capable running on 80386. It may be necessary to
-+ * simulate the cmpxchg on the 80386 CPU. For that purpose we define
-+ * a function for each of the sizes we support.
-+ */
-+
-+extern unsigned long cmpxchg_386_u8(volatile void *, u8, u8);
-+extern unsigned long cmpxchg_386_u16(volatile void *, u16, u16);
-+extern unsigned long cmpxchg_386_u32(volatile void *, u32, u32);
-+
-+static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
-+ unsigned long new, int size)
-+{
-+ switch (size) {
-+ case 1:
-+ return cmpxchg_386_u8(ptr, old, new);
-+ case 2:
-+ return cmpxchg_386_u16(ptr, old, new);
-+ case 4:
-+ return cmpxchg_386_u32(ptr, old, new);
-+ }
-+ return old;
-+}
-+
-+#define cmpxchg(ptr,o,n) \
-+({ \
-+ __typeof__(*(ptr)) __ret; \
-+ if (likely(boot_cpu_data.x86 > 3)) \
-+ __ret = __cmpxchg((ptr), (unsigned long)(o), \
-+ (unsigned long)(n), sizeof(*(ptr))); \
-+ else \
-+ __ret = cmpxchg_386((ptr), (unsigned long)(o), \
-+ (unsigned long)(n), sizeof(*(ptr))); \
-+ __ret; \
-+})
-+#endif
-+
-+#ifdef CONFIG_X86_CMPXCHG64
-+
-+static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old,
-+ unsigned long long new)
-+{
-+ unsigned long long prev;
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3"
-+ : "=A"(prev)
-+ : "b"((unsigned long)new),
-+ "c"((unsigned long)(new >> 32)),
-+ "m"(*__xg(ptr)),
-+ "0"(old)
-+ : "memory");
-+ return prev;
-+}
-+
-+#define cmpxchg64(ptr,o,n)\
-+ ((__typeof__(*(ptr)))__cmpxchg64((ptr),(unsigned long long)(o),\
-+ (unsigned long long)(n)))
-+
-+#endif
-+
-+/*
-+ * Force strict CPU ordering.
-+ * And yes, this is required on UP too when we're talking
-+ * to devices.
-+ *
-+ * For now, "wmb()" doesn't actually do anything, as all
-+ * Intel CPU's follow what Intel calls a *Processor Order*,
-+ * in which all writes are seen in the program order even
-+ * outside the CPU.
-+ *
-+ * I expect future Intel CPU's to have a weaker ordering,
-+ * but I'd also expect them to finally get their act together
-+ * and add some real memory barriers if so.
-+ *
-+ * Some non intel clones support out of order store. wmb() ceases to be a
-+ * nop for these.
-+ */
-+
-+
-+/*
-+ * Actually only lfence would be needed for mb() because all stores done
-+ * by the kernel should be already ordered. But keep a full barrier for now.
-+ */
-+
-+#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
-+#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
-+
-+/**
-+ * read_barrier_depends - Flush all pending reads that subsequents reads
-+ * depend on.
-+ *
-+ * No data-dependent reads from memory-like regions are ever reordered
-+ * over this barrier. All reads preceding this primitive are guaranteed
-+ * to access memory (but not necessarily other CPUs' caches) before any
-+ * reads following this primitive that depend on the data return by
-+ * any of the preceding reads. This primitive is much lighter weight than
-+ * rmb() on most CPUs, and is never heavier weight than is
-+ * rmb().
-+ *
-+ * These ordering constraints are respected by both the local CPU
-+ * and the compiler.
-+ *
-+ * Ordering is not guaranteed by anything other than these primitives,
-+ * not even by data dependencies. See the documentation for
-+ * memory_barrier() for examples and URLs to more information.
-+ *
-+ * For example, the following code would force ordering (the initial
-+ * value of "a" is zero, "b" is one, and "p" is "&a"):
-+ *
-+ * <programlisting>
-+ * CPU 0 CPU 1
-+ *
-+ * b = 2;
-+ * memory_barrier();
-+ * p = &b; q = p;
-+ * read_barrier_depends();
-+ * d = *q;
-+ * </programlisting>
-+ *
-+ * because the read of "*q" depends on the read of "p" and these
-+ * two reads are separated by a read_barrier_depends(). However,
-+ * the following code, with the same initial values for "a" and "b":
-+ *
-+ * <programlisting>
-+ * CPU 0 CPU 1
-+ *
-+ * a = 2;
-+ * memory_barrier();
-+ * b = 3; y = b;
-+ * read_barrier_depends();
-+ * x = a;
-+ * </programlisting>
-+ *
-+ * does not enforce ordering, since there is no data dependency between
-+ * the read of "a" and the read of "b". Therefore, on some CPUs, such
-+ * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
-+ * in cases like this where there are no data dependencies.
-+ **/
-+
-+#define read_barrier_depends() do { } while(0)
-+
-+#ifdef CONFIG_X86_OOSTORE
-+/* Actually there are no OOO store capable CPUs for now that do SSE,
-+ but make it already an possibility. */
-+#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
-+#else
-+#define wmb() __asm__ __volatile__ ("": : :"memory")
-+#endif
-+
-+#ifdef CONFIG_SMP
-+#define smp_mb() mb()
-+#define smp_rmb() rmb()
-+#define smp_wmb() wmb()
-+#define smp_read_barrier_depends() read_barrier_depends()
-+#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
-+#else
-+#define smp_mb() barrier()
-+#define smp_rmb() barrier()
-+#define smp_wmb() barrier()
-+#define smp_read_barrier_depends() do { } while(0)
-+#define set_mb(var, value) do { var = value; barrier(); } while (0)
-+#endif
-+
-+#include <linux/irqflags.h>
-+
-+/*
-+ * disable hlt during certain critical i/o operations
-+ */
-+#define HAVE_DISABLE_HLT
-+void disable_hlt(void);
-+void enable_hlt(void);
-+
-+extern int es7000_plat;
-+void cpu_idle_wait(void);
-+
-+/*
-+ * On SMP systems, when the scheduler does migration-cost autodetection,
-+ * it needs a way to flush as much of the CPU's caches as possible:
-+ */
-+static inline void sched_cacheflush(void)
-+{
-+ wbinvd();
-+}
-+
-+extern unsigned long arch_align_stack(unsigned long sp);
-+extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
-+
-+void default_idle(void);
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/system_64.h
-@@ -0,0 +1,256 @@
-+#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>
-+
-+#ifdef __KERNEL__
-+
-+#define __STR(x) #x
-+#define STR(x) __STR(x)
-+
-+#define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
-+#define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
-+
-+/* frame pointer must be last for get_wchan */
-+#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
-+#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\n\t"
-+
-+#define __EXTRA_CLOBBER \
-+ ,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15"
-+
-+#define switch_to(prev,next,last) \
-+ asm volatile(SAVE_CONTEXT \
-+ "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
-+ "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
-+ "call __switch_to\n\t" \
-+ ".globl thread_return\n" \
-+ "thread_return:\n\t" \
-+ "movq %%gs:%P[pda_pcurrent],%%rsi\n\t" \
-+ "movq %P[thread_info](%%rsi),%%r8\n\t" \
-+ LOCK_PREFIX "btr %[tif_fork],%P[ti_flags](%%r8)\n\t" \
-+ "movq %%rax,%%rdi\n\t" \
-+ "jc ret_from_fork\n\t" \
-+ RESTORE_CONTEXT \
-+ : "=a" (last) \
-+ : [next] "S" (next), [prev] "D" (prev), \
-+ [threadrsp] "i" (offsetof(struct task_struct, thread.rsp)), \
-+ [ti_flags] "i" (offsetof(struct thread_info, flags)),\
-+ [tif_fork] "i" (TIF_FORK), \
-+ [thread_info] "i" (offsetof(struct task_struct, thread_info)), \
-+ [pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent)) \
-+ : "memory", "cc" __EXTRA_CLOBBER)
-+
-+extern void load_gs_index(unsigned);
-+
-+/*
-+ * Load a segment. Fall back on loading the zero
-+ * segment if something goes wrong..
-+ */
-+#define loadsegment(seg,value) \
-+ asm volatile("\n" \
-+ "1:\t" \
-+ "movl %k0,%%" #seg "\n" \
-+ "2:\n" \
-+ ".section .fixup,\"ax\"\n" \
-+ "3:\t" \
-+ "movl %1,%%" #seg "\n\t" \
-+ "jmp 2b\n" \
-+ ".previous\n" \
-+ ".section __ex_table,\"a\"\n\t" \
-+ ".align 8\n\t" \
-+ ".quad 1b,3b\n" \
-+ ".previous" \
-+ : :"r" (value), "r" (0))
-+
-+/*
-+ * Clear and set 'TS' bit respectively
-+ */
-+#define clts() (HYPERVISOR_fpu_taskswitch(0))
-+
-+static inline unsigned long read_cr0(void)
-+{
-+ unsigned long cr0;
-+ asm volatile("movq %%cr0,%0" : "=r" (cr0));
-+ return cr0;
-+}
-+
-+static inline void write_cr0(unsigned long val)
-+{
-+ asm volatile("movq %0,%%cr0" :: "r" (val));
-+}
-+
-+#define read_cr3() ({ \
-+ unsigned long __dummy; \
-+ asm("movq %%cr3,%0" : "=r" (__dummy)); \
-+ machine_to_phys(__dummy); \
-+})
-+
-+static inline unsigned long read_cr4(void)
-+{
-+ unsigned long cr4;
-+ asm("movq %%cr4,%0" : "=r" (cr4));
-+ return cr4;
-+}
-+
-+static inline void write_cr4(unsigned long val)
-+{
-+ asm volatile("movq %0,%%cr4" :: "r" (val));
-+}
-+
-+#define stts() (HYPERVISOR_fpu_taskswitch(1))
-+
-+#define wbinvd() \
-+ __asm__ __volatile__ ("wbinvd": : :"memory");
-+
-+/*
-+ * On SMP systems, when the scheduler does migration-cost autodetection,
-+ * it needs a way to flush as much of the CPU's caches as possible.
-+ */
-+static inline void sched_cacheflush(void)
-+{
-+ wbinvd();
-+}
-+
-+#endif /* __KERNEL__ */
-+
-+#define nop() __asm__ __volatile__ ("nop")
-+
-+#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
-+
-+#define tas(ptr) (xchg((ptr),1))
-+
-+#define __xg(x) ((volatile long *)(x))
-+
-+static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
-+{
-+ *ptr = val;
-+}
-+
-+#define _set_64bit set_64bit
-+
-+/*
-+ * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
-+ * Note 2: xchg has side effect, so that attribute volatile is necessary,
-+ * but generally the primitive is invalid, *ptr is output argument. --ANK
-+ */
-+static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
-+{
-+ switch (size) {
-+ case 1:
-+ __asm__ __volatile__("xchgb %b0,%1"
-+ :"=q" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ case 2:
-+ __asm__ __volatile__("xchgw %w0,%1"
-+ :"=r" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ case 4:
-+ __asm__ __volatile__("xchgl %k0,%1"
-+ :"=r" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ case 8:
-+ __asm__ __volatile__("xchgq %0,%1"
-+ :"=r" (x)
-+ :"m" (*__xg(ptr)), "0" (x)
-+ :"memory");
-+ break;
-+ }
-+ return x;
-+}
-+
-+/*
-+ * Atomic compare and exchange. Compare OLD with MEM, if identical,
-+ * store NEW in MEM. Return the initial value in MEM. Success is
-+ * indicated by comparing RETURN with OLD.
-+ */
-+
-+#define __HAVE_ARCH_CMPXCHG 1
-+
-+static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-+ unsigned long new, int size)
-+{
-+ unsigned long prev;
-+ switch (size) {
-+ case 1:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
-+ : "=a"(prev)
-+ : "q"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ case 2:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ case 4:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ case 8:
-+ __asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
-+ : "=a"(prev)
-+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
-+ : "memory");
-+ return prev;
-+ }
-+ return old;
-+}
-+
-+#define cmpxchg(ptr,o,n)\
-+ ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
-+ (unsigned long)(n),sizeof(*(ptr))))
-+
-+#ifdef CONFIG_SMP
-+#define smp_mb() mb()
-+#define smp_rmb() rmb()
-+#define smp_wmb() wmb()
-+#define smp_read_barrier_depends() do {} while(0)
-+#else
-+#define smp_mb() barrier()
-+#define smp_rmb() barrier()
-+#define smp_wmb() barrier()
-+#define smp_read_barrier_depends() do {} while(0)
-+#endif
-+
-+
-+/*
-+ * Force strict CPU ordering.
-+ * And yes, this is required on UP too when we're talking
-+ * to devices.
-+ */
-+#define mb() asm volatile("mfence":::"memory")
-+#define rmb() asm volatile("lfence":::"memory")
-+
-+#ifdef CONFIG_UNORDERED_IO
-+#define wmb() asm volatile("sfence" ::: "memory")
-+#else
-+#define wmb() asm volatile("" ::: "memory")
-+#endif
-+#define read_barrier_depends() do {} while(0)
-+#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
-+
-+#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0)
-+
-+#include <linux/irqflags.h>
-+
-+void cpu_idle_wait(void);
-+
-+extern unsigned long arch_align_stack(unsigned long sp);
-+extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/tlbflush_32.h
-@@ -0,0 +1,101 @@
-+#ifndef _I386_TLBFLUSH_H
-+#define _I386_TLBFLUSH_H
-+
-+#include <linux/mm.h>
-+#include <asm/processor.h>
-+
-+#define __flush_tlb() xen_tlb_flush()
-+#define __flush_tlb_global() xen_tlb_flush()
-+#define __flush_tlb_all() xen_tlb_flush()
-+
-+extern unsigned long pgkern_mask;
-+
-+#define cpu_has_invlpg (boot_cpu_data.x86 > 3)
-+
-+#define __flush_tlb_single(addr) xen_invlpg(addr)
-+
-+#define __flush_tlb_one(addr) __flush_tlb_single(addr)
-+
-+/*
-+ * TLB flushing:
-+ *
-+ * - flush_tlb() flushes the current mm struct TLBs
-+ * - flush_tlb_all() flushes all processes TLBs
-+ * - flush_tlb_mm(mm) flushes the specified mm context TLB's
-+ * - flush_tlb_page(vma, vmaddr) flushes one page
-+ * - flush_tlb_range(vma, start, end) flushes a range of pages
-+ * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
-+ * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
-+ *
-+ * ..but the i386 has somewhat limited tlb flushing capabilities,
-+ * and page-granular flushes are available only on i486 and up.
-+ */
-+
-+#ifndef CONFIG_SMP
-+
-+#define flush_tlb() __flush_tlb()
-+#define flush_tlb_all() __flush_tlb_all()
-+#define local_flush_tlb() __flush_tlb()
-+
-+static inline void flush_tlb_mm(struct mm_struct *mm)
-+{
-+ if (mm == current->active_mm)
-+ __flush_tlb();
-+}
-+
-+static inline void flush_tlb_page(struct vm_area_struct *vma,
-+ unsigned long addr)
-+{
-+ if (vma->vm_mm == current->active_mm)
-+ __flush_tlb_one(addr);
-+}
-+
-+static inline void flush_tlb_range(struct vm_area_struct *vma,
-+ unsigned long start, unsigned long end)
-+{
-+ if (vma->vm_mm == current->active_mm)
-+ __flush_tlb();
-+}
-+
-+#else
-+
-+#include <asm/smp.h>
-+
-+#define local_flush_tlb() \
-+ __flush_tlb()
-+
-+#define flush_tlb_all xen_tlb_flush_all
-+#define flush_tlb_current_task() xen_tlb_flush_mask(&current->mm->cpu_vm_mask)
-+#define flush_tlb_mm(mm) xen_tlb_flush_mask(&(mm)->cpu_vm_mask)
-+#define flush_tlb_page(vma, va) xen_invlpg_mask(&(vma)->vm_mm->cpu_vm_mask, va)
-+
-+#define flush_tlb() flush_tlb_current_task()
-+
-+static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
-+{
-+ flush_tlb_mm(vma->vm_mm);
-+}
-+
-+#define TLBSTATE_OK 1
-+#define TLBSTATE_LAZY 2
-+
-+struct tlb_state
-+{
-+ struct mm_struct *active_mm;
-+ int state;
-+ char __cacheline_padding[L1_CACHE_BYTES-8];
-+};
-+DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
-+
-+
-+#endif
-+
-+#define flush_tlb_kernel_range(start, end) flush_tlb_all()
-+
-+static inline void flush_tlb_pgtables(struct mm_struct *mm,
-+ unsigned long start, unsigned long end)
-+{
-+ /* i386 does not keep any page table caches in TLB */
-+}
-+
-+#endif /* _I386_TLBFLUSH_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/tlbflush_64.h
-@@ -0,0 +1,103 @@
-+#ifndef _X8664_TLBFLUSH_H
-+#define _X8664_TLBFLUSH_H
-+
-+#include <linux/mm.h>
-+#include <asm/processor.h>
-+
-+#define __flush_tlb() xen_tlb_flush()
-+
-+/*
-+ * Global pages have to be flushed a bit differently. Not a real
-+ * performance problem because this does not happen often.
-+ */
-+#define __flush_tlb_global() xen_tlb_flush()
-+
-+
-+extern unsigned long pgkern_mask;
-+
-+#define __flush_tlb_all() __flush_tlb_global()
-+
-+#define __flush_tlb_one(addr) xen_invlpg((unsigned long)addr)
-+
-+
-+/*
-+ * TLB flushing:
-+ *
-+ * - flush_tlb() flushes the current mm struct TLBs
-+ * - flush_tlb_all() flushes all processes TLBs
-+ * - flush_tlb_mm(mm) flushes the specified mm context TLB's
-+ * - flush_tlb_page(vma, vmaddr) flushes one page
-+ * - flush_tlb_range(vma, start, end) flushes a range of pages
-+ * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
-+ * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
-+ *
-+ * x86-64 can only flush individual pages or full VMs. For a range flush
-+ * we always do the full VM. Might be worth trying if for a small
-+ * range a few INVLPGs in a row are a win.
-+ */
-+
-+#ifndef CONFIG_SMP
-+
-+#define flush_tlb() __flush_tlb()
-+#define flush_tlb_all() __flush_tlb_all()
-+#define local_flush_tlb() __flush_tlb()
-+
-+static inline void flush_tlb_mm(struct mm_struct *mm)
-+{
-+ if (mm == current->active_mm)
-+ __flush_tlb();
-+}
-+
-+static inline void flush_tlb_page(struct vm_area_struct *vma,
-+ unsigned long addr)
-+{
-+ if (vma->vm_mm == current->active_mm)
-+ __flush_tlb_one(addr);
-+}
-+
-+static inline void flush_tlb_range(struct vm_area_struct *vma,
-+ unsigned long start, unsigned long end)
-+{
-+ if (vma->vm_mm == current->active_mm)
-+ __flush_tlb();
-+}
-+
-+#else
-+
-+#include <asm/smp.h>
-+
-+#define local_flush_tlb() \
-+ __flush_tlb()
-+
-+#define flush_tlb_all xen_tlb_flush_all
-+#define flush_tlb_current_task() xen_tlb_flush_mask(&current->mm->cpu_vm_mask)
-+#define flush_tlb_mm(mm) xen_tlb_flush_mask(&(mm)->cpu_vm_mask)
-+#define flush_tlb_page(vma, va) xen_invlpg_mask(&(vma)->vm_mm->cpu_vm_mask, va)
-+
-+#define flush_tlb() flush_tlb_current_task()
-+
-+static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
-+{
-+ flush_tlb_mm(vma->vm_mm);
-+}
-+
-+#define TLBSTATE_OK 1
-+#define TLBSTATE_LAZY 2
-+
-+/* Roughly an IPI every 20MB with 4k pages for freeing page table
-+ ranges. Cost is about 42k of memory for each CPU. */
-+#define ARCH_FREE_PTE_NR 5350
-+
-+#endif
-+
-+#define flush_tlb_kernel_range(start, end) flush_tlb_all()
-+
-+static inline void flush_tlb_pgtables(struct mm_struct *mm,
-+ unsigned long start, unsigned long end)
-+{
-+ /* x86_64 does not keep any page table caches in a software TLB.
-+ The CPUs do in their hardware TLBs, but they are handled
-+ by the normal TLB flushing algorithms. */
-+}
-+
-+#endif /* _X8664_TLBFLUSH_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/vga.h
-@@ -0,0 +1,20 @@
-+/*
-+ * Access to VGA videoram
-+ *
-+ * (c) 1998 Martin Mares <mj@ucw.cz>
-+ */
-+
-+#ifndef _LINUX_ASM_VGA_H_
-+#define _LINUX_ASM_VGA_H_
-+
-+/*
-+ * On the PC, we can just recalculate addresses and then
-+ * access the videoram directly without any black magic.
-+ */
-+
-+#define VGA_MAP_MEM(x,s) (unsigned long)isa_bus_to_virt(x)
-+
-+#define vga_readb(x) (*(x))
-+#define vga_writeb(x,y) (*(y) = (x))
-+
-+#endif
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/xenoprof.h
-@@ -0,0 +1,48 @@
-+/******************************************************************************
-+ * asm-i386/mach-xen/asm/xenoprof.h
-+ *
-+ * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
-+ * VA Linux Systems Japan K.K.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ *
-+ */
-+#ifndef __ASM_XENOPROF_H__
-+#define __ASM_XENOPROF_H__
-+#ifdef CONFIG_XEN
-+
-+struct super_block;
-+struct dentry;
-+int xenoprof_create_files(struct super_block * sb, struct dentry * root);
-+#define HAVE_XENOPROF_CREATE_FILES
-+
-+struct xenoprof_init;
-+void xenoprof_arch_init_counter(struct xenoprof_init *init);
-+void xenoprof_arch_counter(void);
-+void xenoprof_arch_start(void);
-+void xenoprof_arch_stop(void);
-+
-+struct xenoprof_arch_shared_buffer {
-+ /* nothing */
-+};
-+struct xenoprof_shared_buffer;
-+void xenoprof_arch_unmap_shared_buffer(struct xenoprof_shared_buffer* sbuf);
-+struct xenoprof_get_buffer;
-+int xenoprof_arch_map_shared_buffer(struct xenoprof_get_buffer* get_buffer, struct xenoprof_shared_buffer* sbuf);
-+struct xenoprof_passive;
-+int xenoprof_arch_set_passive(struct xenoprof_passive* pdomain, struct xenoprof_shared_buffer* sbuf);
-+
-+#endif /* CONFIG_XEN */
-+#endif /* __ASM_XENOPROF_H__ */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/asm/xor_64.h
-@@ -0,0 +1,328 @@
-+/*
-+ * x86-64 changes / gcc fixes from Andi Kleen.
-+ * Copyright 2002 Andi Kleen, SuSE Labs.
-+ *
-+ * This hasn't been optimized for the hammer yet, but there are likely
-+ * no advantages to be gotten from x86-64 here anyways.
-+ */
-+
-+typedef struct { unsigned long a,b; } __attribute__((aligned(16))) xmm_store_t;
-+
-+/* Doesn't use gcc to save the XMM registers, because there is no easy way to
-+ tell it to do a clts before the register saving. */
-+#define XMMS_SAVE do { \
-+ preempt_disable(); \
-+ if (!(current_thread_info()->status & TS_USEDFPU)) \
-+ clts(); \
-+ __asm__ __volatile__ ( \
-+ "movups %%xmm0,(%1) ;\n\t" \
-+ "movups %%xmm1,0x10(%1) ;\n\t" \
-+ "movups %%xmm2,0x20(%1) ;\n\t" \
-+ "movups %%xmm3,0x30(%1) ;\n\t" \
-+ : "=&r" (cr0) \
-+ : "r" (xmm_save) \
-+ : "memory"); \
-+} while(0)
-+
-+#define XMMS_RESTORE do { \
-+ asm volatile ( \
-+ "sfence ;\n\t" \
-+ "movups (%1),%%xmm0 ;\n\t" \
-+ "movups 0x10(%1),%%xmm1 ;\n\t" \
-+ "movups 0x20(%1),%%xmm2 ;\n\t" \
-+ "movups 0x30(%1),%%xmm3 ;\n\t" \
-+ : \
-+ : "r" (cr0), "r" (xmm_save) \
-+ : "memory"); \
-+ if (!(current_thread_info()->status & TS_USEDFPU)) \
-+ stts(); \
-+ preempt_enable(); \
-+} while(0)
-+
-+#define OFFS(x) "16*("#x")"
-+#define PF_OFFS(x) "256+16*("#x")"
-+#define PF0(x) " prefetchnta "PF_OFFS(x)"(%[p1]) ;\n"
-+#define LD(x,y) " movaps "OFFS(x)"(%[p1]), %%xmm"#y" ;\n"
-+#define ST(x,y) " movaps %%xmm"#y", "OFFS(x)"(%[p1]) ;\n"
-+#define PF1(x) " prefetchnta "PF_OFFS(x)"(%[p2]) ;\n"
-+#define PF2(x) " prefetchnta "PF_OFFS(x)"(%[p3]) ;\n"
-+#define PF3(x) " prefetchnta "PF_OFFS(x)"(%[p4]) ;\n"
-+#define PF4(x) " prefetchnta "PF_OFFS(x)"(%[p5]) ;\n"
-+#define PF5(x) " prefetchnta "PF_OFFS(x)"(%[p6]) ;\n"
-+#define XO1(x,y) " xorps "OFFS(x)"(%[p2]), %%xmm"#y" ;\n"
-+#define XO2(x,y) " xorps "OFFS(x)"(%[p3]), %%xmm"#y" ;\n"
-+#define XO3(x,y) " xorps "OFFS(x)"(%[p4]), %%xmm"#y" ;\n"
-+#define XO4(x,y) " xorps "OFFS(x)"(%[p5]), %%xmm"#y" ;\n"
-+#define XO5(x,y) " xorps "OFFS(x)"(%[p6]), %%xmm"#y" ;\n"
-+
-+
-+static void
-+xor_sse_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
-+{
-+ unsigned int lines = bytes >> 8;
-+ unsigned long cr0;
-+ xmm_store_t xmm_save[4];
-+
-+ XMMS_SAVE;
-+
-+ asm volatile (
-+#undef BLOCK
-+#define BLOCK(i) \
-+ LD(i,0) \
-+ LD(i+1,1) \
-+ PF1(i) \
-+ PF1(i+2) \
-+ LD(i+2,2) \
-+ LD(i+3,3) \
-+ PF0(i+4) \
-+ PF0(i+6) \
-+ XO1(i,0) \
-+ XO1(i+1,1) \
-+ XO1(i+2,2) \
-+ XO1(i+3,3) \
-+ ST(i,0) \
-+ ST(i+1,1) \
-+ ST(i+2,2) \
-+ ST(i+3,3) \
-+
-+
-+ PF0(0)
-+ PF0(2)
-+
-+ " .align 32 ;\n"
-+ " 1: ;\n"
-+
-+ BLOCK(0)
-+ BLOCK(4)
-+ BLOCK(8)
-+ BLOCK(12)
-+
-+ " addq %[inc], %[p1] ;\n"
-+ " addq %[inc], %[p2] ;\n"
-+ " decl %[cnt] ; jnz 1b"
-+ : [p1] "+r" (p1), [p2] "+r" (p2), [cnt] "+r" (lines)
-+ : [inc] "r" (256UL)
-+ : "memory");
-+
-+ XMMS_RESTORE;
-+}
-+
-+static void
-+xor_sse_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
-+ unsigned long *p3)
-+{
-+ unsigned int lines = bytes >> 8;
-+ xmm_store_t xmm_save[4];
-+ unsigned long cr0;
-+
-+ XMMS_SAVE;
-+
-+ __asm__ __volatile__ (
-+#undef BLOCK
-+#define BLOCK(i) \
-+ PF1(i) \
-+ PF1(i+2) \
-+ LD(i,0) \
-+ LD(i+1,1) \
-+ LD(i+2,2) \
-+ LD(i+3,3) \
-+ PF2(i) \
-+ PF2(i+2) \
-+ PF0(i+4) \
-+ PF0(i+6) \
-+ XO1(i,0) \
-+ XO1(i+1,1) \
-+ XO1(i+2,2) \
-+ XO1(i+3,3) \
-+ XO2(i,0) \
-+ XO2(i+1,1) \
-+ XO2(i+2,2) \
-+ XO2(i+3,3) \
-+ ST(i,0) \
-+ ST(i+1,1) \
-+ ST(i+2,2) \
-+ ST(i+3,3) \
-+
-+
-+ PF0(0)
-+ PF0(2)
-+
-+ " .align 32 ;\n"
-+ " 1: ;\n"
-+
-+ BLOCK(0)
-+ BLOCK(4)
-+ BLOCK(8)
-+ BLOCK(12)
-+
-+ " addq %[inc], %[p1] ;\n"
-+ " addq %[inc], %[p2] ;\n"
-+ " addq %[inc], %[p3] ;\n"
-+ " decl %[cnt] ; jnz 1b"
-+ : [cnt] "+r" (lines),
-+ [p1] "+r" (p1), [p2] "+r" (p2), [p3] "+r" (p3)
-+ : [inc] "r" (256UL)
-+ : "memory");
-+ XMMS_RESTORE;
-+}
-+
-+static void
-+xor_sse_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
-+ unsigned long *p3, unsigned long *p4)
-+{
-+ unsigned int lines = bytes >> 8;
-+ xmm_store_t xmm_save[4];
-+ unsigned long cr0;
-+
-+ XMMS_SAVE;
-+
-+ __asm__ __volatile__ (
-+#undef BLOCK
-+#define BLOCK(i) \
-+ PF1(i) \
-+ PF1(i+2) \
-+ LD(i,0) \
-+ LD(i+1,1) \
-+ LD(i+2,2) \
-+ LD(i+3,3) \
-+ PF2(i) \
-+ PF2(i+2) \
-+ XO1(i,0) \
-+ XO1(i+1,1) \
-+ XO1(i+2,2) \
-+ XO1(i+3,3) \
-+ PF3(i) \
-+ PF3(i+2) \
-+ PF0(i+4) \
-+ PF0(i+6) \
-+ XO2(i,0) \
-+ XO2(i+1,1) \
-+ XO2(i+2,2) \
-+ XO2(i+3,3) \
-+ XO3(i,0) \
-+ XO3(i+1,1) \
-+ XO3(i+2,2) \
-+ XO3(i+3,3) \
-+ ST(i,0) \
-+ ST(i+1,1) \
-+ ST(i+2,2) \
-+ ST(i+3,3) \
-+
-+
-+ PF0(0)
-+ PF0(2)
-+
-+ " .align 32 ;\n"
-+ " 1: ;\n"
-+
-+ BLOCK(0)
-+ BLOCK(4)
-+ BLOCK(8)
-+ BLOCK(12)
-+
-+ " addq %[inc], %[p1] ;\n"
-+ " addq %[inc], %[p2] ;\n"
-+ " addq %[inc], %[p3] ;\n"
-+ " addq %[inc], %[p4] ;\n"
-+ " decl %[cnt] ; jnz 1b"
-+ : [cnt] "+c" (lines),
-+ [p1] "+r" (p1), [p2] "+r" (p2), [p3] "+r" (p3), [p4] "+r" (p4)
-+ : [inc] "r" (256UL)
-+ : "memory" );
-+
-+ XMMS_RESTORE;
-+}
-+
-+static void
-+xor_sse_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
-+ unsigned long *p3, unsigned long *p4, unsigned long *p5)
-+{
-+ unsigned int lines = bytes >> 8;
-+ xmm_store_t xmm_save[4];
-+ unsigned long cr0;
-+
-+ XMMS_SAVE;
-+
-+ __asm__ __volatile__ (
-+#undef BLOCK
-+#define BLOCK(i) \
-+ PF1(i) \
-+ PF1(i+2) \
-+ LD(i,0) \
-+ LD(i+1,1) \
-+ LD(i+2,2) \
-+ LD(i+3,3) \
-+ PF2(i) \
-+ PF2(i+2) \
-+ XO1(i,0) \
-+ XO1(i+1,1) \
-+ XO1(i+2,2) \
-+ XO1(i+3,3) \
-+ PF3(i) \
-+ PF3(i+2) \
-+ XO2(i,0) \
-+ XO2(i+1,1) \
-+ XO2(i+2,2) \
-+ XO2(i+3,3) \
-+ PF4(i) \
-+ PF4(i+2) \
-+ PF0(i+4) \
-+ PF0(i+6) \
-+ XO3(i,0) \
-+ XO3(i+1,1) \
-+ XO3(i+2,2) \
-+ XO3(i+3,3) \
-+ XO4(i,0) \
-+ XO4(i+1,1) \
-+ XO4(i+2,2) \
-+ XO4(i+3,3) \
-+ ST(i,0) \
-+ ST(i+1,1) \
-+ ST(i+2,2) \
-+ ST(i+3,3) \
-+
-+
-+ PF0(0)
-+ PF0(2)
-+
-+ " .align 32 ;\n"
-+ " 1: ;\n"
-+
-+ BLOCK(0)
-+ BLOCK(4)
-+ BLOCK(8)
-+ BLOCK(12)
-+
-+ " addq %[inc], %[p1] ;\n"
-+ " addq %[inc], %[p2] ;\n"
-+ " addq %[inc], %[p3] ;\n"
-+ " addq %[inc], %[p4] ;\n"
-+ " addq %[inc], %[p5] ;\n"
-+ " decl %[cnt] ; jnz 1b"
-+ : [cnt] "+c" (lines),
-+ [p1] "+r" (p1), [p2] "+r" (p2), [p3] "+r" (p3), [p4] "+r" (p4),
-+ [p5] "+r" (p5)
-+ : [inc] "r" (256UL)
-+ : "memory");
-+
-+ XMMS_RESTORE;
-+}
-+
-+static struct xor_block_template xor_block_sse = {
-+ .name = "generic_sse",
-+ .do_2 = xor_sse_2,
-+ .do_3 = xor_sse_3,
-+ .do_4 = xor_sse_4,
-+ .do_5 = xor_sse_5,
-+};
-+
-+#undef XOR_TRY_TEMPLATES
-+#define XOR_TRY_TEMPLATES \
-+ do { \
-+ xor_speed(&xor_block_sse); \
-+ } while (0)
-+
-+/* We force the use of the SSE xor block because it can write around L2.
-+ 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)
---- /dev/null
-+++ b/arch/x86/include/mach-xen/irq_vectors.h
-@@ -0,0 +1,125 @@
-+/*
-+ * This file should contain #defines for all of the interrupt vector
-+ * numbers used by this architecture.
-+ *
-+ * In addition, there are some standard defines:
-+ *
-+ * FIRST_EXTERNAL_VECTOR:
-+ * The first free place for external interrupts
-+ *
-+ * SYSCALL_VECTOR:
-+ * The IRQ vector a syscall makes the user to kernel transition
-+ * under.
-+ *
-+ * TIMER_IRQ:
-+ * The IRQ number the timer interrupt comes in at.
-+ *
-+ * NR_IRQS:
-+ * The total number of interrupt vectors (including all the
-+ * architecture specific interrupts) needed.
-+ *
-+ */
-+#ifndef _ASM_IRQ_VECTORS_H
-+#define _ASM_IRQ_VECTORS_H
-+
-+/*
-+ * IDT vectors usable for external interrupt sources start
-+ * at 0x20:
-+ */
-+#define FIRST_EXTERNAL_VECTOR 0x20
-+
-+#define SYSCALL_VECTOR 0x80
-+
-+/*
-+ * Vectors 0x20-0x2f are used for ISA interrupts.
-+ */
-+
-+#if 0
-+/*
-+ * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
-+ *
-+ * some of the following vectors are 'rare', they are merged
-+ * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
-+ * TLB, reschedule and local APIC vectors are performance-critical.
-+ *
-+ * Vectors 0xf0-0xfa are free (reserved for future Linux use).
-+ */
-+#define SPURIOUS_APIC_VECTOR 0xff
-+#define ERROR_APIC_VECTOR 0xfe
-+#define INVALIDATE_TLB_VECTOR 0xfd
-+#define RESCHEDULE_VECTOR 0xfc
-+#define CALL_FUNCTION_VECTOR 0xfb
-+
-+#define THERMAL_APIC_VECTOR 0xf0
-+/*
-+ * Local APIC timer IRQ vector is on a different priority level,
-+ * to work around the 'lost local interrupt if more than 2 IRQ
-+ * sources per level' errata.
-+ */
-+#define LOCAL_TIMER_VECTOR 0xef
-+#endif
-+
-+#define SPURIOUS_APIC_VECTOR 0xff
-+#define ERROR_APIC_VECTOR 0xfe
-+
-+/*
-+ * First APIC vector available to drivers: (vectors 0x30-0xee)
-+ * we start at 0x31 to spread out vectors evenly between priority
-+ * levels. (0x80 is the syscall vector)
-+ */
-+#define FIRST_DEVICE_VECTOR 0x31
-+#define FIRST_SYSTEM_VECTOR 0xef
-+
-+/*
-+ * 16 8259A IRQ's, 208 potential APIC interrupt sources.
-+ * Right now the APIC is mostly only used for SMP.
-+ * 256 vectors is an architectural limit. (we can have
-+ * more than 256 devices theoretically, but they will
-+ * have to use shared interrupts)
-+ * Since vectors 0x00-0x1f are used/reserved for the CPU,
-+ * the usable vector space is 0x20-0xff (224 vectors)
-+ */
-+
-+#define RESCHEDULE_VECTOR 0
-+#define CALL_FUNCTION_VECTOR 1
-+#define NR_IPIS 2
-+
-+/*
-+ * The maximum number of vectors supported by i386 processors
-+ * is limited to 256. For processors other than i386, NR_VECTORS
-+ * should be changed accordingly.
-+ */
-+#define NR_VECTORS 256
-+
-+#define FPU_IRQ 13
-+
-+#define FIRST_VM86_IRQ 3
-+#define LAST_VM86_IRQ 15
-+#define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15)
-+
-+/*
-+ * The flat IRQ space is divided into two regions:
-+ * 1. A one-to-one mapping of real physical IRQs. This space is only used
-+ * if we have physical device-access privilege. This region is at the
-+ * start of the IRQ space so that existing device drivers do not need
-+ * to be modified to translate physical IRQ numbers into our IRQ space.
-+ * 3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
-+ * are bound using the provided bind/unbind functions.
-+ */
-+
-+#define PIRQ_BASE 0
-+#if !defined(MAX_IO_APICS)
-+# define NR_PIRQS (NR_VECTORS + 32 * NR_CPUS)
-+#elif NR_CPUS < MAX_IO_APICS
-+# define NR_PIRQS (NR_VECTORS + 32 * NR_CPUS)
-+#else
-+# define NR_PIRQS (NR_VECTORS + 32 * MAX_IO_APICS)
-+#endif
-+
-+#define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS)
-+#define NR_DYNIRQS 256
-+
-+#define NR_IRQS (NR_PIRQS + NR_DYNIRQS)
-+#define NR_IRQ_VECTORS NR_IRQS
-+
-+#endif /* _ASM_IRQ_VECTORS_H */
---- /dev/null
-+++ b/arch/x86/include/mach-xen/setup_arch_post.h
-@@ -0,0 +1,63 @@
-+/**
-+ * machine_specific_* - Hooks for machine specific setup.
-+ *
-+ * Description:
-+ * This is included late in kernel/setup.c so that it can make
-+ * use of all of the static functions.
-+ **/
-+
-+#include <xen/interface/callback.h>
-+
-+extern void hypervisor_callback(void);
-+extern void failsafe_callback(void);
-+extern void nmi(void);
-+
-+static void __init machine_specific_arch_setup(void)
-+{
-+ int ret;
-+ static struct callback_register __initdata event = {
-+ .type = CALLBACKTYPE_event,
-+ .address = (unsigned long) hypervisor_callback,
-+ };
-+ static struct callback_register __initdata failsafe = {
-+ .type = CALLBACKTYPE_failsafe,
-+ .address = (unsigned long)failsafe_callback,
-+ };
-+ static struct callback_register __initdata syscall = {
-+ .type = CALLBACKTYPE_syscall,
-+ .address = (unsigned long)system_call,
-+ };
-+#ifdef CONFIG_X86_LOCAL_APIC
-+ static struct callback_register __initdata nmi_cb = {
-+ .type = CALLBACKTYPE_nmi,
-+ .address = (unsigned long)nmi,
-+ };
-+#endif
-+
-+ ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event);
-+ if (ret == 0)
-+ ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
-+ if (ret == 0)
-+ ret = HYPERVISOR_callback_op(CALLBACKOP_register, &syscall);
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (ret == -ENOSYS)
-+ ret = HYPERVISOR_set_callbacks(
-+ event.address,
-+ failsafe.address,
-+ syscall.address);
-+#endif
-+ BUG_ON(ret);
-+
-+#ifdef CONFIG_X86_LOCAL_APIC
-+ ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb);
-+#if CONFIG_XEN_COMPAT <= 0x030002
-+ if (ret == -ENOSYS) {
-+ static struct xennmi_callback __initdata cb = {
-+ .handler_address = (unsigned long)nmi
-+ };
-+
-+ HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
-+ }
-+#endif
-+#endif
-+}
---- /dev/null
-+++ b/arch/x86/include/mach-xen/setup_arch_pre.h
-@@ -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);
---- /dev/null
-+++ b/arch/x86/kernel/acpi/processor_extcntl_xen.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-13 14:25:35.000000000 +0200
@@ -0,0 +1,206 @@
+/*
+ * processor_extcntl_xen.c - interface to notify Xen
@@ -8902,8 +328,8 @@ for reference, prefixed with the version the removal occured):
+ *ops = &xen_extcntl_ops;
+}
+EXPORT_SYMBOL(arch_acpi_processor_init_extcntl);
---- /dev/null
-+++ b/arch/x86/kernel/acpi/sleep_32-xen.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/acpi/sleep_32-xen.c 2008-04-15 09:29:41.000000000 +0200
@@ -0,0 +1,113 @@
+/*
+ * sleep.c - x86-specific ACPI sleep support.
@@ -9018,157 +444,8 @@ for reference, prefixed with the version the removal occured):
+
+core_initcall(acpisleep_dmi_init);
+#endif /* CONFIG_ACPI_PV_SLEEP */
---- /dev/null
-+++ b/arch/x86/kernel/acpi/sleep_64-xen.c
-@@ -0,0 +1,146 @@
-+/*
-+ * acpi.c - Architecture-Specific Low-Level ACPI Support
-+ *
-+ * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
-+ * Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
-+ * Copyright (C) 2001 Patrick Mochel <mochel@osdl.org>
-+ * Copyright (C) 2002 Andi Kleen, SuSE Labs (x86-64 port)
-+ * Copyright (C) 2003 Pavel Machek, SuSE Labs
-+ *
-+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ *
-+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/types.h>
-+#include <linux/stddef.h>
-+#include <linux/slab.h>
-+#include <linux/pci.h>
-+#include <linux/bootmem.h>
-+#include <linux/acpi.h>
-+#include <linux/cpumask.h>
-+
-+#include <asm/mpspec.h>
-+#include <asm/io.h>
-+#include <asm/apic.h>
-+#include <asm/apicdef.h>
-+#include <asm/page.h>
-+#include <asm/pgtable.h>
-+#include <asm/pgalloc.h>
-+#include <asm/io_apic.h>
-+#include <asm/proto.h>
-+#include <asm/tlbflush.h>
-+
-+/* --------------------------------------------------------------------------
-+ Low-Level Sleep Support
-+ -------------------------------------------------------------------------- */
-+
-+#ifdef CONFIG_ACPI_SLEEP
-+
-+#ifndef CONFIG_ACPI_PV_SLEEP
-+/* address in low memory of the wakeup routine. */
-+unsigned long acpi_wakeup_address = 0;
-+unsigned long acpi_video_flags;
-+extern char wakeup_start, wakeup_end;
-+
-+extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
-+
-+static pgd_t low_ptr;
-+
-+static void init_low_mapping(void)
-+{
-+ pgd_t *slot0 = pgd_offset(current->mm, 0UL);
-+ low_ptr = *slot0;
-+ set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET));
-+ WARN_ON(num_online_cpus() != 1);
-+ local_flush_tlb();
-+}
-+#endif
-+
-+/**
-+ * acpi_save_state_mem - save kernel state
-+ *
-+ * Create an identity mapped page table and copy the wakeup routine to
-+ * low memory.
-+ */
-+int acpi_save_state_mem(void)
-+{
-+#ifndef CONFIG_ACPI_PV_SLEEP
-+ init_low_mapping();
-+
-+ memcpy((void *)acpi_wakeup_address, &wakeup_start,
-+ &wakeup_end - &wakeup_start);
-+ acpi_copy_wakeup_routine(acpi_wakeup_address);
-+#endif
-+ return 0;
-+}
-+
-+/*
-+ * acpi_restore_state
-+ */
-+void acpi_restore_state_mem(void)
-+{
-+#ifndef CONFIG_ACPI_PV_SLEEP
-+ set_pgd(pgd_offset(current->mm, 0UL), low_ptr);
-+ local_flush_tlb();
-+#endif
-+}
-+
-+/**
-+ * acpi_reserve_bootmem - do _very_ early ACPI initialisation
-+ *
-+ * We allocate a page in low memory for the wakeup
-+ * routine for when we come back from a sleep state. The
-+ * runtime allocator allows specification of <16M pages, but not
-+ * <1M pages.
-+ */
-+void __init acpi_reserve_bootmem(void)
-+{
-+#ifndef CONFIG_ACPI_PV_SLEEP
-+ acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
-+ if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
-+ printk(KERN_CRIT
-+ "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
-+#endif
-+}
-+
-+#ifndef CONFIG_ACPI_PV_SLEEP
-+static int __init acpi_sleep_setup(char *str)
-+{
-+ while ((str != NULL) && (*str != '\0')) {
-+ if (strncmp(str, "s3_bios", 7) == 0)
-+ acpi_video_flags = 1;
-+ if (strncmp(str, "s3_mode", 7) == 0)
-+ acpi_video_flags |= 2;
-+ str = strchr(str, ',');
-+ if (str != NULL)
-+ str += strspn(str, ", \t");
-+ }
-+
-+ return 1;
-+}
-+
-+__setup("acpi_sleep=", acpi_sleep_setup);
-+#endif /* CONFIG_ACPI_PV_SLEEP */
-+
-+#endif /*CONFIG_ACPI_SLEEP */
-+
-+void acpi_pci_link_exit(void)
-+{
-+}
---- /dev/null
-+++ b/arch/x86/kernel/apic_32-xen.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/apic_32-xen.c 2007-06-12 13:12:48.000000000 +0200
@@ -0,0 +1,155 @@
+/*
+ * Local APIC handling, local APIC timers
@@ -9325,208 +602,8 @@ for reference, prefixed with the version the removal occured):
+
+ return 0;
+}
---- /dev/null
-+++ b/arch/x86/kernel/apic_64-xen.c
-@@ -0,0 +1,197 @@
-+/*
-+ * Local APIC handling, local APIC timers
-+ *
-+ * (c) 1999, 2000 Ingo Molnar <mingo@redhat.com>
-+ *
-+ * Fixes
-+ * Maciej W. Rozycki : Bits for genuine 82489DX APICs;
-+ * thanks to Eric Gilmore
-+ * and Rolf G. Tews
-+ * for testing these extensively.
-+ * Maciej W. Rozycki : Various updates and fixes.
-+ * Mikael Pettersson : Power Management for UP-APIC.
-+ * Pavel Machek and
-+ * Mikael Pettersson : PM converted to driver model.
-+ */
-+
-+#include <linux/init.h>
-+
-+#include <linux/mm.h>
-+#include <linux/delay.h>
-+#include <linux/bootmem.h>
-+#include <linux/smp_lock.h>
-+#include <linux/interrupt.h>
-+#include <linux/mc146818rtc.h>
-+#include <linux/kernel_stat.h>
-+#include <linux/sysdev.h>
-+#include <linux/module.h>
-+
-+#include <asm/atomic.h>
-+#include <asm/smp.h>
-+#include <asm/mtrr.h>
-+#include <asm/mpspec.h>
-+#include <asm/desc.h>
-+#include <asm/arch_hooks.h>
-+#include <asm/hpet.h>
-+#include <asm/idle.h>
-+
-+int apic_verbosity;
-+
-+/*
-+ * 'what should we do if we get a hw irq event on an illegal vector'.
-+ * each architecture has to answer this themselves.
-+ */
-+void ack_bad_irq(unsigned int irq)
-+{
-+ printk("unexpected IRQ trap at vector %02x\n", irq);
-+ /*
-+ * Currently unexpected vectors happen only on SMP and APIC.
-+ * We _must_ ack these because every local APIC has only N
-+ * irq slots per priority level, and a 'hanging, unacked' IRQ
-+ * holds up an irq slot - in excessive cases (when multiple
-+ * unexpected vectors occur) that might lock up the APIC
-+ * completely.
-+ * But don't ack when the APIC is disabled. -AK
-+ */
-+ if (!disable_apic)
-+ ack_APIC_irq();
-+}
-+
-+int setup_profiling_timer(unsigned int multiplier)
-+{
-+ return -EINVAL;
-+}
-+
-+void smp_local_timer_interrupt(struct pt_regs *regs)
-+{
-+ profile_tick(CPU_PROFILING, regs);
-+#ifndef CONFIG_XEN
-+#ifdef CONFIG_SMP
-+ update_process_times(user_mode(regs));
-+#endif
-+#endif
-+ /*
-+ * We take the 'long' return path, and there every subsystem
-+ * grabs the appropriate locks (kernel lock/ irq lock).
-+ *
-+ * we might want to decouple profiling from the 'long path',
-+ * and do the profiling totally in assembly.
-+ *
-+ * Currently this isn't too much of an issue (performance wise),
-+ * we can take more than 100K local irqs per second on a 100 MHz P5.
-+ */
-+}
-+
-+/*
-+ * Local APIC timer interrupt. This is the most natural way for doing
-+ * local interrupts, but local timer interrupts can be emulated by
-+ * broadcast interrupts too. [in case the hw doesn't support APIC timers]
-+ *
-+ * [ if a single-CPU system runs an SMP kernel then we call the local
-+ * interrupt as well. Thus we cannot inline the local irq ... ]
-+ */
-+void smp_apic_timer_interrupt(struct pt_regs *regs)
-+{
-+ /*
-+ * the NMI deadlock-detector uses this.
-+ */
-+ add_pda(apic_timer_irqs, 1);
-+
-+ /*
-+ * NOTE! We'd better ACK the irq immediately,
-+ * because timer handling can be slow.
-+ */
-+ ack_APIC_irq();
-+ /*
-+ * update_process_times() expects us to have done irq_enter().
-+ * Besides, if we don't timer interrupts ignore the global
-+ * interrupt lock, which is the WrongThing (tm) to do.
-+ */
-+ exit_idle();
-+ irq_enter();
-+ smp_local_timer_interrupt(regs);
-+ irq_exit();
-+}
-+
-+/*
-+ * This interrupt should _never_ happen with our APIC/SMP architecture
-+ */
-+asmlinkage void smp_spurious_interrupt(void)
-+{
-+ unsigned int v;
-+ exit_idle();
-+ irq_enter();
-+ /*
-+ * Check if this really is a spurious interrupt and ACK it
-+ * if it is a vectored one. Just in case...
-+ * Spurious interrupts should not be ACKed.
-+ */
-+ v = apic_read(APIC_ISR + ((SPURIOUS_APIC_VECTOR & ~0x1f) >> 1));
-+ if (v & (1 << (SPURIOUS_APIC_VECTOR & 0x1f)))
-+ ack_APIC_irq();
-+
-+#if 0
-+ static unsigned long last_warning;
-+ static unsigned long skipped;
-+
-+ /* see sw-dev-man vol 3, chapter 7.4.13.5 */
-+ if (time_before(last_warning+30*HZ,jiffies)) {
-+ printk(KERN_INFO "spurious APIC interrupt on CPU#%d, %ld skipped.\n",
-+ smp_processor_id(), skipped);
-+ last_warning = jiffies;
-+ skipped = 0;
-+ } else {
-+ skipped++;
-+ }
-+#endif
-+ irq_exit();
-+}
-+
-+/*
-+ * This interrupt should never happen with our APIC/SMP architecture
-+ */
-+
-+asmlinkage void smp_error_interrupt(void)
-+{
-+ unsigned int v, v1;
-+
-+ exit_idle();
-+ irq_enter();
-+ /* First tickle the hardware, only then report what went on. -- REW */
-+ v = apic_read(APIC_ESR);
-+ apic_write(APIC_ESR, 0);
-+ v1 = apic_read(APIC_ESR);
-+ ack_APIC_irq();
-+ atomic_inc(&irq_err_count);
-+
-+ /* Here is what the APIC error bits mean:
-+ 0: Send CS error
-+ 1: Receive CS error
-+ 2: Send accept error
-+ 3: Receive accept error
-+ 4: Reserved
-+ 5: Send illegal vector
-+ 6: Received illegal vector
-+ 7: Illegal register address
-+ */
-+ printk (KERN_DEBUG "APIC error on CPU%d: %02x(%02x)\n",
-+ smp_processor_id(), v , v1);
-+ irq_exit();
-+}
-+
-+int disable_apic;
-+
-+/*
-+ * This initializes the IO-APIC and APIC hardware if this is
-+ * a UP kernel.
-+ */
-+int __init APIC_init_uniprocessor (void)
-+{
-+#ifdef CONFIG_X86_IO_APIC
-+ if (smp_found_config)
-+ if (!skip_ioapic_setup && nr_ioapics)
-+ setup_IO_APIC();
-+#endif
-+
-+ return 1;
-+}
---- /dev/null
-+++ b/arch/x86/kernel/cpu/common-xen.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/cpu/common-xen.c 2009-05-19 09:16:41.000000000 +0200
@@ -0,0 +1,745 @@
+#include <linux/init.h>
+#include <linux/string.h>
@@ -10273,8 +1350,8 @@ for reference, prefixed with the version the removal occured):
+ per_cpu(cpu_tlbstate, cpu).active_mm = &init_mm;
+}
+#endif
---- /dev/null
-+++ b/arch/x86/kernel/cpu/mcheck/mce_dom0.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/cpu/mcheck/mce_dom0.c 2009-10-01 11:00:47.000000000 +0200
@@ -0,0 +1,134 @@
+#include <linux/init.h>
+#include <linux/types.h>
@@ -10410,8 +1487,8 @@ for reference, prefixed with the version the removal occured):
+ mce_dom0_interrupt(VIRQ_MCA, NULL, NULL);
+}
+
---- /dev/null
-+++ b/arch/x86/kernel/cpu/mtrr/main-xen.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/cpu/mtrr/main-xen.c 2008-01-28 12:24:18.000000000 +0100
@@ -0,0 +1,198 @@
+#include <linux/init.h>
+#include <linux/proc_fs.h>
@@ -10611,1114 +1688,8 @@ for reference, prefixed with the version the removal occured):
+}
+
+subsys_initcall(mtrr_init);
---- /dev/null
-+++ b/arch/x86/kernel/e820_64-xen.c
-@@ -0,0 +1,798 @@
-+/*
-+ * Handle the memory map.
-+ * The functions here do the job until bootmem takes over.
-+ *
-+ * Getting sanitize_e820_map() in sync with i386 version by applying change:
-+ * - Provisions for empty E820 memory regions (reported by certain BIOSes).
-+ * Alex Achenbach <xela@slit.de>, December 2002.
-+ * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
-+ *
-+ */
-+#include <linux/kernel.h>
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/bootmem.h>
-+#include <linux/ioport.h>
-+#include <linux/string.h>
-+#include <linux/kexec.h>
-+#include <linux/module.h>
-+
-+#include <asm/pgtable.h>
-+#include <asm/page.h>
-+#include <asm/e820.h>
-+#include <asm/proto.h>
-+#include <asm/bootsetup.h>
-+#include <asm/sections.h>
-+#include <xen/interface/memory.h>
-+
-+/*
-+ * PFN of last memory page.
-+ */
-+unsigned long end_pfn;
-+EXPORT_SYMBOL(end_pfn);
-+
-+/*
-+ * end_pfn only includes RAM, while end_pfn_map includes all e820 entries.
-+ * The direct mapping extends to end_pfn_map, so that we can directly access
-+ * apertures, ACPI and other tables without having to play with fixmaps.
-+ */
-+unsigned long end_pfn_map;
-+
-+/*
-+ * Last pfn which the user wants to use.
-+ */
-+unsigned long end_user_pfn = MAXMEM>>PAGE_SHIFT;
-+
-+extern struct resource code_resource, data_resource;
-+
-+#ifdef CONFIG_XEN
-+extern struct e820map machine_e820;
-+#endif
-+
-+/* Check for some hardcoded bad areas that early boot is not allowed to touch */
-+static inline int bad_addr(unsigned long *addrp, unsigned long size)
-+{
-+ unsigned long addr = *addrp, last = addr + size;
-+
-+#ifndef CONFIG_XEN
-+ /* various gunk below that needed for SMP startup */
-+ if (addr < 0x8000) {
-+ *addrp = 0x8000;
-+ return 1;
-+ }
-+
-+ /* direct mapping tables of the kernel */
-+ if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) {
-+ *addrp = table_end << PAGE_SHIFT;
-+ return 1;
-+ }
-+
-+ /* initrd */
-+#ifdef CONFIG_BLK_DEV_INITRD
-+ if (LOADER_TYPE && INITRD_START && last >= INITRD_START &&
-+ addr < INITRD_START+INITRD_SIZE) {
-+ *addrp = INITRD_START + INITRD_SIZE;
-+ return 1;
-+ }
-+#endif
-+ /* kernel code + 640k memory hole (later should not be needed, but
-+ be paranoid for now) */
-+ if (last >= 640*1024 && addr < 1024*1024) {
-+ *addrp = 1024*1024;
-+ return 1;
-+ }
-+ if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) {
-+ *addrp = __pa_symbol(&_end);
-+ return 1;
-+ }
-+
-+ if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
-+ *addrp = ebda_addr + ebda_size;
-+ return 1;
-+ }
-+
-+ /* XXX ramdisk image here? */
-+#else
-+ if (last < (table_end<<PAGE_SHIFT)) {
-+ *addrp = table_end << PAGE_SHIFT;
-+ return 1;
-+ }
-+#endif
-+ return 0;
-+}
-+
-+/*
-+ * This function checks if any part of the range <start,end> is mapped
-+ * with type.
-+ */
-+int e820_any_mapped(unsigned long start, unsigned long end, unsigned type)
-+{
-+ int i;
-+
-+#ifndef CONFIG_XEN
-+ for (i = 0; i < e820.nr_map; i++) {
-+ struct e820entry *ei = &e820.map[i];
-+#else
-+ if (!is_initial_xendomain())
-+ return 0;
-+ for (i = 0; i < machine_e820.nr_map; i++) {
-+ const struct e820entry *ei = &machine_e820.map[i];
-+#endif
-+
-+ if (type && ei->type != type)
-+ continue;
-+ if (ei->addr >= end || ei->addr + ei->size <= start)
-+ continue;
-+ return 1;
-+ }
-+ return 0;
-+}
-+EXPORT_SYMBOL_GPL(e820_any_mapped);
-+
-+/*
-+ * 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;
-+
-+#ifndef CONFIG_XEN
-+ for (i = 0; i < e820.nr_map; i++) {
-+ struct e820entry *ei = &e820.map[i];
-+#else
-+ if (!is_initial_xendomain())
-+ return 0;
-+ for (i = 0; i < machine_e820.nr_map; i++) {
-+ const struct e820entry *ei = &machine_e820.map[i];
-+#endif
-+
-+ 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.
-+ */
-+unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsigned size)
-+{
-+ int i;
-+ for (i = 0; i < e820.nr_map; i++) {
-+ struct e820entry *ei = &e820.map[i];
-+ unsigned long addr = ei->addr, last;
-+ if (ei->type != E820_RAM)
-+ continue;
-+ if (addr < start)
-+ addr = start;
-+ if (addr > ei->addr + ei->size)
-+ continue;
-+ while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
-+ ;
-+ last = addr + size;
-+ if (last > ei->addr + ei->size)
-+ continue;
-+ if (last > end)
-+ continue;
-+ return addr;
-+ }
-+ return -1UL;
-+}
-+
-+/*
-+ * Free bootmem based on the e820 table for a node.
-+ */
-+void __init e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end)
-+{
-+ int i;
-+ for (i = 0; i < e820.nr_map; i++) {
-+ struct e820entry *ei = &e820.map[i];
-+ unsigned long last, addr;
-+
-+ if (ei->type != E820_RAM ||
-+ ei->addr+ei->size <= start ||
-+ ei->addr >= end)
-+ continue;
-+
-+ addr = round_up(ei->addr, PAGE_SIZE);
-+ if (addr < start)
-+ addr = start;
-+
-+ last = round_down(ei->addr + ei->size, PAGE_SIZE);
-+ if (last >= end)
-+ last = end;
-+
-+ if (last > addr && last-addr >= PAGE_SIZE)
-+ free_bootmem_node(pgdat, addr, last-addr);
-+ }
-+}
-+
-+/*
-+ * Find the highest page frame number we have available
-+ */
-+unsigned long __init e820_end_of_ram(void)
-+{
-+ int i;
-+ unsigned long end_pfn = 0;
-+
-+ for (i = 0; i < e820.nr_map; i++) {
-+ struct e820entry *ei = &e820.map[i];
-+ unsigned long start, end;
-+
-+ start = round_up(ei->addr, PAGE_SIZE);
-+ end = round_down(ei->addr + ei->size, PAGE_SIZE);
-+ if (start >= end)
-+ continue;
-+ if (ei->type == E820_RAM) {
-+ if (end > end_pfn<<PAGE_SHIFT)
-+ end_pfn = end>>PAGE_SHIFT;
-+ } else {
-+ if (end > end_pfn_map<<PAGE_SHIFT)
-+ end_pfn_map = end>>PAGE_SHIFT;
-+ }
-+ }
-+
-+ if (end_pfn > end_pfn_map)
-+ end_pfn_map = end_pfn;
-+ if (end_pfn_map > MAXMEM>>PAGE_SHIFT)
-+ end_pfn_map = MAXMEM>>PAGE_SHIFT;
-+ if (end_pfn > end_user_pfn)
-+ end_pfn = end_user_pfn;
-+ if (end_pfn > end_pfn_map)
-+ end_pfn = end_pfn_map;
-+
-+ return end_pfn;
-+}
-+
-+/*
-+ * Compute how much memory is missing in a range.
-+ * Unlike the other functions in this file the arguments are in page numbers.
-+ */
-+unsigned long __init
-+e820_hole_size(unsigned long start_pfn, unsigned long end_pfn)
-+{
-+ unsigned long ram = 0;
-+ unsigned long start = start_pfn << PAGE_SHIFT;
-+ unsigned long end = end_pfn << PAGE_SHIFT;
-+ int i;
-+ for (i = 0; i < e820.nr_map; i++) {
-+ struct e820entry *ei = &e820.map[i];
-+ unsigned long last, addr;
-+
-+ if (ei->type != E820_RAM ||
-+ ei->addr+ei->size <= start ||
-+ ei->addr >= end)
-+ continue;
-+
-+ addr = round_up(ei->addr, PAGE_SIZE);
-+ if (addr < start)
-+ addr = start;
-+
-+ last = round_down(ei->addr + ei->size, PAGE_SIZE);
-+ if (last >= end)
-+ last = end;
-+
-+ if (last > addr)
-+ ram += last - addr;
-+ }
-+ return ((end - start) - ram) >> PAGE_SHIFT;
-+}
-+
-+/*
-+ * Mark e820 reserved areas as busy for the resource manager.
-+ */
-+void __init e820_reserve_resources(struct e820entry *e820, int nr_map)
-+{
-+ int i;
-+ for (i = 0; i < nr_map; i++) {
-+ struct resource *res;
-+ res = alloc_bootmem_low(sizeof(struct resource));
-+ switch (e820[i].type) {
-+ case E820_RAM: res->name = "System RAM"; break;
-+ case E820_ACPI: res->name = "ACPI Tables"; break;
-+ case E820_NVS: res->name = "ACPI Non-volatile Storage"; break;
-+ default: res->name = "reserved";
-+ }
-+ res->start = e820[i].addr;
-+ res->end = res->start + e820[i].size - 1;
-+ res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-+ request_resource(&iomem_resource, res);
-+ if (e820[i].type == E820_RAM) {
-+ /*
-+ * We don't know which RAM region contains kernel data,
-+ * 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
-+ if (crashk_res.start != crashk_res.end)
-+ request_resource(res, &crashk_res);
-+#ifdef CONFIG_XEN
-+ xen_machine_kexec_register_resources(res);
-+#endif
-+#endif
-+ }
-+ }
-+}
-+
-+/*
-+ * Add a memory region to the kernel e820 map.
-+ */
-+void __init add_memory_region(unsigned long start, unsigned long size, int type)
-+{
-+ int x = e820.nr_map;
-+
-+ if (x == E820MAX) {
-+ printk(KERN_ERR "Ooops! Too many entries in the memory map!\n");
-+ return;
-+ }
-+
-+ e820.map[x].addr = start;
-+ e820.map[x].size = size;
-+ e820.map[x].type = type;
-+ e820.nr_map++;
-+}
-+
-+void __init e820_print_map(char *who)
-+{
-+ int i;
-+
-+ for (i = 0; i < e820.nr_map; i++) {
-+ printk(" %s: %016Lx - %016Lx ", who,
-+ (unsigned long long) e820.map[i].addr,
-+ (unsigned long long) (e820.map[i].addr + e820.map[i].size));
-+ switch (e820.map[i].type) {
-+ case E820_RAM: printk("(usable)\n");
-+ break;
-+ case E820_RESERVED:
-+ printk("(reserved)\n");
-+ break;
-+ case E820_ACPI:
-+ printk("(ACPI data)\n");
-+ break;
-+ case E820_NVS:
-+ printk("(ACPI NVS)\n");
-+ break;
-+ default: printk("type %u\n", e820.map[i].type);
-+ break;
-+ }
-+ }
-+}
-+
-+/*
-+ * Sanitize the BIOS e820 map.
-+ *
-+ * Some e820 responses include overlapping entries. The following
-+ * replaces the original e820 map with a new one, removing overlaps.
-+ *
-+ */
-+static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
-+{
-+ struct change_member {
-+ struct e820entry *pbios; /* pointer to original bios entry */
-+ unsigned long long addr; /* address for this change point */
-+ };
-+ static struct change_member change_point_list[2*E820MAX] __initdata;
-+ static struct change_member *change_point[2*E820MAX] __initdata;
-+ static struct e820entry *overlap_list[E820MAX] __initdata;
-+ static struct e820entry new_bios[E820MAX] __initdata;
-+ struct change_member *change_tmp;
-+ unsigned long current_type, last_type;
-+ unsigned long long last_addr;
-+ int chgidx, still_changing;
-+ int overlap_entries;
-+ int new_bios_entry;
-+ int old_nr, new_nr, chg_nr;
-+ int i;
-+
-+ /*
-+ Visually we're performing the following (1,2,3,4 = memory types)...
-+
-+ Sample memory map (w/overlaps):
-+ ____22__________________
-+ ______________________4_
-+ ____1111________________
-+ _44_____________________
-+ 11111111________________
-+ ____________________33__
-+ ___________44___________
-+ __________33333_________
-+ ______________22________
-+ ___________________2222_
-+ _________111111111______
-+ _____________________11_
-+ _________________4______
-+
-+ Sanitized equivalent (no overlap):
-+ 1_______________________
-+ _44_____________________
-+ ___1____________________
-+ ____22__________________
-+ ______11________________
-+ _________1______________
-+ __________3_____________
-+ ___________44___________
-+ _____________33_________
-+ _______________2________
-+ ________________1_______
-+ _________________4______
-+ ___________________2____
-+ ____________________33__
-+ ______________________4_
-+ */
-+
-+ /* if there's only one memory region, don't bother */
-+ if (*pnr_map < 2)
-+ return -1;
-+
-+ old_nr = *pnr_map;
-+
-+ /* bail out if we find any unreasonable addresses in bios map */
-+ for (i=0; i<old_nr; i++)
-+ if (biosmap[i].addr + biosmap[i].size < biosmap[i].addr)
-+ return -1;
-+
-+ /* create pointers for initial change-point information (for sorting) */
-+ for (i=0; i < 2*old_nr; i++)
-+ change_point[i] = &change_point_list[i];
-+
-+ /* record all known change-points (starting and ending addresses),
-+ omitting those that are for empty memory regions */
-+ chgidx = 0;
-+ for (i=0; i < old_nr; i++) {
-+ if (biosmap[i].size != 0) {
-+ change_point[chgidx]->addr = biosmap[i].addr;
-+ change_point[chgidx++]->pbios = &biosmap[i];
-+ change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size;
-+ change_point[chgidx++]->pbios = &biosmap[i];
-+ }
-+ }
-+ chg_nr = chgidx;
-+
-+ /* sort change-point list by memory addresses (low -> high) */
-+ still_changing = 1;
-+ while (still_changing) {
-+ still_changing = 0;
-+ for (i=1; i < chg_nr; i++) {
-+ /* if <current_addr> > <last_addr>, swap */
-+ /* or, if current=<start_addr> & last=<end_addr>, swap */
-+ if ((change_point[i]->addr < change_point[i-1]->addr) ||
-+ ((change_point[i]->addr == change_point[i-1]->addr) &&
-+ (change_point[i]->addr == change_point[i]->pbios->addr) &&
-+ (change_point[i-1]->addr != change_point[i-1]->pbios->addr))
-+ )
-+ {
-+ change_tmp = change_point[i];
-+ change_point[i] = change_point[i-1];
-+ change_point[i-1] = change_tmp;
-+ still_changing=1;
-+ }
-+ }
-+ }
-+
-+ /* create a new bios memory map, removing overlaps */
-+ overlap_entries=0; /* number of entries in the overlap table */
-+ new_bios_entry=0; /* index for creating new bios map entries */
-+ last_type = 0; /* start with undefined memory type */
-+ last_addr = 0; /* start with 0 as last starting address */
-+ /* loop through change-points, determining affect on the new bios map */
-+ for (chgidx=0; chgidx < chg_nr; chgidx++)
-+ {
-+ /* keep track of all overlapping bios entries */
-+ if (change_point[chgidx]->addr == change_point[chgidx]->pbios->addr)
-+ {
-+ /* add map entry to overlap list (> 1 entry implies an overlap) */
-+ overlap_list[overlap_entries++]=change_point[chgidx]->pbios;
-+ }
-+ else
-+ {
-+ /* remove entry from list (order independent, so swap with last) */
-+ for (i=0; i<overlap_entries; i++)
-+ {
-+ if (overlap_list[i] == change_point[chgidx]->pbios)
-+ overlap_list[i] = overlap_list[overlap_entries-1];
-+ }
-+ overlap_entries--;
-+ }
-+ /* if there are overlapping entries, decide which "type" to use */
-+ /* (larger value takes precedence -- 1=usable, 2,3,4,4+=unusable) */
-+ current_type = 0;
-+ for (i=0; i<overlap_entries; i++)
-+ if (overlap_list[i]->type > current_type)
-+ current_type = overlap_list[i]->type;
-+ /* continue building up new bios map based on this information */
-+ if (current_type != last_type) {
-+ if (last_type != 0) {
-+ new_bios[new_bios_entry].size =
-+ change_point[chgidx]->addr - last_addr;
-+ /* move forward only if the new size was non-zero */
-+ if (new_bios[new_bios_entry].size != 0)
-+ if (++new_bios_entry >= E820MAX)
-+ break; /* no more space left for new bios entries */
-+ }
-+ if (current_type != 0) {
-+ new_bios[new_bios_entry].addr = change_point[chgidx]->addr;
-+ new_bios[new_bios_entry].type = current_type;
-+ last_addr=change_point[chgidx]->addr;
-+ }
-+ last_type = current_type;
-+ }
-+ }
-+ new_nr = new_bios_entry; /* retain count for new bios entries */
-+
-+ /* copy new bios mapping into original location */
-+ memcpy(biosmap, new_bios, new_nr*sizeof(struct e820entry));
-+ *pnr_map = new_nr;
-+
-+ return 0;
-+}
-+
-+/*
-+ * Copy the BIOS e820 map into a safe place.
-+ *
-+ * Sanity-check it while we're at it..
-+ *
-+ * If we're lucky and live on a modern system, the setup code
-+ * will have given us a memory map that we can use to properly
-+ * set up memory. If we aren't, we'll fake a memory map.
-+ *
-+ * We check to see that the memory map contains at least 2 elements
-+ * before we'll use it, because the detection code in setup.S may
-+ * not be perfect and most every PC known to man has two memory
-+ * regions: one from 0 to 640k, and one from 1mb up. (The IBM
-+ * thinkpad 560x, for example, does not cooperate with the memory
-+ * detection code.)
-+ */
-+static int __init copy_e820_map(struct e820entry * biosmap, int nr_map)
-+{
-+#ifndef CONFIG_XEN
-+ /* Only one memory region (or negative)? Ignore it */
-+ if (nr_map < 2)
-+ return -1;
-+#else
-+ BUG_ON(nr_map < 1);
-+#endif
-+
-+ do {
-+ unsigned long start = biosmap->addr;
-+ unsigned long size = biosmap->size;
-+ unsigned long end = start + size;
-+ unsigned long type = biosmap->type;
-+
-+ /* Overflow in 64 bits? Ignore the memory map. */
-+ if (start > end)
-+ return -1;
-+
-+#ifndef CONFIG_XEN
-+ /*
-+ * Some BIOSes claim RAM in the 640k - 1M region.
-+ * Not right. Fix it up.
-+ *
-+ * This should be removed on Hammer which is supposed to not
-+ * have non e820 covered ISA mappings there, but I had some strange
-+ * problems so it stays for now. -AK
-+ */
-+ if (type == E820_RAM) {
-+ if (start < 0x100000ULL && end > 0xA0000ULL) {
-+ if (start < 0xA0000ULL)
-+ add_memory_region(start, 0xA0000ULL-start, type);
-+ if (end <= 0x100000ULL)
-+ continue;
-+ start = 0x100000ULL;
-+ size = end - start;
-+ }
-+ }
-+#endif
-+
-+ add_memory_region(start, size, type);
-+ } while (biosmap++,--nr_map);
-+
-+#ifdef CONFIG_XEN
-+ if (is_initial_xendomain()) {
-+ struct xen_memory_map memmap;
-+
-+ memmap.nr_entries = E820MAX;
-+ set_xen_guest_handle(memmap.buffer, machine_e820.map);
-+
-+ if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
-+ BUG();
-+ machine_e820.nr_map = memmap.nr_entries;
-+ } else
-+ machine_e820 = e820;
-+#endif
-+
-+ return 0;
-+}
-+
-+#ifndef CONFIG_XEN
-+void __init setup_memory_region(void)
-+{
-+ char *who = "BIOS-e820";
-+
-+ /*
-+ * Try to copy the BIOS-supplied E820-map.
-+ *
-+ * Otherwise fake a memory map; one section from 0k->640k,
-+ * the next section from 1mb->appropriate_mem_k
-+ */
-+ sanitize_e820_map(E820_MAP, &E820_MAP_NR);
-+ if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
-+ unsigned long mem_size;
-+
-+ /* compare results from other methods and take the greater */
-+ if (ALT_MEM_K < EXT_MEM_K) {
-+ mem_size = EXT_MEM_K;
-+ who = "BIOS-88";
-+ } else {
-+ mem_size = ALT_MEM_K;
-+ who = "BIOS-e801";
-+ }
-+
-+ e820.nr_map = 0;
-+ add_memory_region(0, LOWMEMSIZE(), E820_RAM);
-+ add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
-+ }
-+ printk(KERN_INFO "BIOS-provided physical RAM map:\n");
-+ e820_print_map(who);
-+}
-+
-+#else /* CONFIG_XEN */
-+
-+void __init setup_memory_region(void)
-+{
-+ int rc;
-+ struct xen_memory_map memmap;
-+ /*
-+ * This is rather large for a stack variable but this early in
-+ * the boot process we know we have plenty slack space.
-+ */
-+ struct e820entry map[E820MAX];
-+
-+ memmap.nr_entries = E820MAX;
-+ set_xen_guest_handle(memmap.buffer, map);
-+
-+ rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);
-+ if ( rc == -ENOSYS ) {
-+ memmap.nr_entries = 1;
-+ map[0].addr = 0ULL;
-+ map[0].size = xen_start_info->nr_pages << PAGE_SHIFT;
-+ /* 8MB slack (to balance backend allocations). */
-+ map[0].size += 8 << 20;
-+ map[0].type = E820_RAM;
-+ rc = 0;
-+ }
-+ BUG_ON(rc);
-+
-+ sanitize_e820_map(map, (char *)&memmap.nr_entries);
-+
-+ BUG_ON(copy_e820_map(map, (char)memmap.nr_entries) < 0);
-+
-+ printk(KERN_INFO "BIOS-provided physical RAM map:\n");
-+ e820_print_map("Xen");
-+}
-+#endif
-+
-+void __init parse_memopt(char *p, char **from)
-+{
-+ int i;
-+ unsigned long current_end;
-+ unsigned long end;
-+
-+ end_user_pfn = memparse(p, from);
-+ end_user_pfn >>= PAGE_SHIFT;
-+
-+ end = end_user_pfn<<PAGE_SHIFT;
-+ i = e820.nr_map-1;
-+ current_end = e820.map[i].addr + e820.map[i].size;
-+
-+ if (current_end < end) {
-+ /*
-+ * The e820 map ends before our requested size so
-+ * extend the final entry to the requested address.
-+ */
-+ if (e820.map[i].type == E820_RAM)
-+ e820.map[i].size = end - e820.map[i].addr;
-+ else
-+ add_memory_region(current_end, end - current_end, E820_RAM);
-+ }
-+}
-+
-+void __init parse_memmapopt(char *p, char **from)
-+{
-+ unsigned long long start_at, mem_size;
-+
-+ mem_size = memparse(p, from);
-+ p = *from;
-+ if (*p == '@') {
-+ start_at = memparse(p+1, from);
-+ add_memory_region(start_at, mem_size, E820_RAM);
-+ } else if (*p == '#') {
-+ start_at = memparse(p+1, from);
-+ add_memory_region(start_at, mem_size, E820_ACPI);
-+ } else if (*p == '$') {
-+ start_at = memparse(p+1, from);
-+ add_memory_region(start_at, mem_size, E820_RESERVED);
-+ } else {
-+ end_user_pfn = (mem_size >> PAGE_SHIFT);
-+ }
-+ p = *from;
-+}
-+
-+unsigned long pci_mem_start = 0xaeedbabe;
-+EXPORT_SYMBOL(pci_mem_start);
-+
-+/*
-+ * Search for the biggest gap in the low 32 bits of the e820
-+ * memory space. We pass this space to PCI to assign MMIO resources
-+ * for hotplug or unconfigured devices in.
-+ * Hopefully the BIOS let enough space left.
-+ */
-+__init void e820_setup_gap(struct e820entry *e820, int nr_map)
-+{
-+ unsigned long gapstart, gapsize, round;
-+ unsigned long last;
-+ int i;
-+ int found = 0;
-+
-+ last = 0x100000000ull;
-+ gapstart = 0x10000000;
-+ gapsize = 0x400000;
-+ i = nr_map;
-+ while (--i >= 0) {
-+ unsigned long long start = e820[i].addr;
-+ unsigned long long end = start + e820[i].size;
-+
-+ /*
-+ * Since "last" is at most 4GB, we know we'll
-+ * fit in 32 bits if this condition is true
-+ */
-+ if (last > end) {
-+ unsigned long gap = last - end;
-+
-+ if (gap > gapsize) {
-+ gapsize = gap;
-+ gapstart = end;
-+ found = 1;
-+ }
-+ }
-+ if (start < last)
-+ last = start;
-+ }
-+
-+ if (!found) {
-+ gapstart = (end_pfn << PAGE_SHIFT) + 1024*1024;
-+ printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit address range\n"
-+ KERN_ERR "PCI: Unassigned devices with 32bit resource registers may break!\n");
-+ }
-+
-+ /*
-+ * See how much we want to round up: start off with
-+ * rounding to the next 1MB area.
-+ */
-+ round = 0x100000;
-+ while ((gapsize >> 4) > round)
-+ round += round;
-+ /* Fun with two's complement */
-+ pci_mem_start = (gapstart + round) & -round;
-+
-+ printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n",
-+ pci_mem_start, gapstart, gapsize);
-+}
---- /dev/null
-+++ b/arch/x86/kernel/early_printk-xen.c
-@@ -0,0 +1,302 @@
-+#include <linux/console.h>
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/string.h>
-+#include <linux/screen_info.h>
-+#include <asm/io.h>
-+#include <asm/processor.h>
-+#include <asm/fcntl.h>
-+
-+/* Simple VGA output */
-+
-+#ifdef __i386__
-+#include <asm/setup.h>
-+#define VGABASE (__ISA_IO_base + 0xb8000)
-+#else
-+#include <asm/bootsetup.h>
-+#define VGABASE ((void __iomem *)0xffffffff800b8000UL)
-+#endif
-+
-+#ifndef CONFIG_XEN
-+static int max_ypos = 25, max_xpos = 80;
-+static int current_ypos = 25, current_xpos = 0;
-+
-+static void early_vga_write(struct console *con, const char *str, unsigned n)
-+{
-+ char c;
-+ int i, k, j;
-+
-+ while ((c = *str++) != '\0' && n-- > 0) {
-+ if (current_ypos >= max_ypos) {
-+ /* scroll 1 line up */
-+ for (k = 1, j = 0; k < max_ypos; k++, j++) {
-+ for (i = 0; i < max_xpos; i++) {
-+ writew(readw(VGABASE+2*(max_xpos*k+i)),
-+ VGABASE + 2*(max_xpos*j + i));
-+ }
-+ }
-+ for (i = 0; i < max_xpos; i++)
-+ writew(0x720, VGABASE + 2*(max_xpos*j + i));
-+ current_ypos = max_ypos-1;
-+ }
-+ if (c == '\n') {
-+ current_xpos = 0;
-+ current_ypos++;
-+ } else if (c != '\r') {
-+ writew(((0x7 << 8) | (unsigned short) c),
-+ VGABASE + 2*(max_xpos*current_ypos +
-+ current_xpos++));
-+ if (current_xpos >= max_xpos) {
-+ current_xpos = 0;
-+ current_ypos++;
-+ }
-+ }
-+ }
-+}
-+
-+static struct console early_vga_console = {
-+ .name = "earlyvga",
-+ .write = early_vga_write,
-+ .flags = CON_PRINTBUFFER,
-+ .index = -1,
-+};
-+
-+/* Serial functions loosely based on a similar package from Klaus P. Gerlicher */
-+
-+static int early_serial_base = 0x3f8; /* ttyS0 */
-+
-+#define XMTRDY 0x20
-+
-+#define DLAB 0x80
-+
-+#define TXR 0 /* Transmit register (WRITE) */
-+#define RXR 0 /* Receive register (READ) */
-+#define IER 1 /* Interrupt Enable */
-+#define IIR 2 /* Interrupt ID */
-+#define FCR 2 /* FIFO control */
-+#define LCR 3 /* Line control */
-+#define MCR 4 /* Modem control */
-+#define LSR 5 /* Line Status */
-+#define MSR 6 /* Modem Status */
-+#define DLL 0 /* Divisor Latch Low */
-+#define DLH 1 /* Divisor latch High */
-+
-+static int early_serial_putc(unsigned char ch)
-+{
-+ unsigned timeout = 0xffff;
-+ while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout)
-+ cpu_relax();
-+ outb(ch, early_serial_base + TXR);
-+ return timeout ? 0 : -1;
-+}
-+
-+static void early_serial_write(struct console *con, const char *s, unsigned n)
-+{
-+ while (*s && n-- > 0) {
-+ early_serial_putc(*s);
-+ if (*s == '\n')
-+ early_serial_putc('\r');
-+ s++;
-+ }
-+}
-+
-+#define DEFAULT_BAUD 9600
-+
-+static __init void early_serial_init(char *s)
-+{
-+ unsigned char c;
-+ unsigned divisor;
-+ unsigned baud = DEFAULT_BAUD;
-+ char *e;
-+
-+ if (*s == ',')
-+ ++s;
-+
-+ if (*s) {
-+ unsigned port;
-+ if (!strncmp(s,"0x",2)) {
-+ early_serial_base = simple_strtoul(s, &e, 16);
-+ } else {
-+ static int bases[] = { 0x3f8, 0x2f8 };
-+
-+ if (!strncmp(s,"ttyS",4))
-+ s += 4;
-+ port = simple_strtoul(s, &e, 10);
-+ if (port > 1 || s == e)
-+ port = 0;
-+ early_serial_base = bases[port];
-+ }
-+ s += strcspn(s, ",");
-+ if (*s == ',')
-+ s++;
-+ }
-+
-+ outb(0x3, early_serial_base + LCR); /* 8n1 */
-+ outb(0, early_serial_base + IER); /* no interrupt */
-+ outb(0, early_serial_base + FCR); /* no fifo */
-+ outb(0x3, early_serial_base + MCR); /* DTR + RTS */
-+
-+ if (*s) {
-+ baud = simple_strtoul(s, &e, 0);
-+ if (baud == 0 || s == e)
-+ baud = DEFAULT_BAUD;
-+ }
-+
-+ divisor = 115200 / baud;
-+ c = inb(early_serial_base + LCR);
-+ outb(c | DLAB, early_serial_base + LCR);
-+ outb(divisor & 0xff, early_serial_base + DLL);
-+ outb((divisor >> 8) & 0xff, early_serial_base + DLH);
-+ outb(c & ~DLAB, early_serial_base + LCR);
-+}
-+
-+#else /* CONFIG_XEN */
-+
-+static void
-+early_serial_write(struct console *con, const char *s, unsigned count)
-+{
-+ int n;
-+
-+ while (count > 0) {
-+ n = HYPERVISOR_console_io(CONSOLEIO_write, count, (char *)s);
-+ if (n <= 0)
-+ break;
-+ count -= n;
-+ s += n;
-+ }
-+}
-+
-+static __init void early_serial_init(char *s)
-+{
-+}
-+
-+/*
-+ * No early VGA console on Xen, as we do not have convenient ISA-space
-+ * mappings. Someone should fix this for domain 0. For now, use fake serial.
-+ */
-+#define early_vga_console early_serial_console
-+
-+#endif
-+
-+static struct console early_serial_console = {
-+ .name = "earlyser",
-+ .write = early_serial_write,
-+ .flags = CON_PRINTBUFFER,
-+ .index = -1,
-+};
-+
-+/* Console interface to a host file on AMD's SimNow! */
-+
-+static int simnow_fd;
-+
-+enum {
-+ MAGIC1 = 0xBACCD00A,
-+ MAGIC2 = 0xCA110000,
-+ XOPEN = 5,
-+ XWRITE = 4,
-+};
-+
-+static noinline long simnow(long cmd, long a, long b, long c)
-+{
-+ long ret;
-+ asm volatile("cpuid" :
-+ "=a" (ret) :
-+ "b" (a), "c" (b), "d" (c), "0" (MAGIC1), "D" (cmd + MAGIC2));
-+ return ret;
-+}
-+
-+void __init simnow_init(char *str)
-+{
-+ char *fn = "klog";
-+ if (*str == '=')
-+ fn = ++str;
-+ /* error ignored */
-+ simnow_fd = simnow(XOPEN, (unsigned long)fn, O_WRONLY|O_APPEND|O_CREAT, 0644);
-+}
-+
-+static void simnow_write(struct console *con, const char *s, unsigned n)
-+{
-+ simnow(XWRITE, simnow_fd, (unsigned long)s, n);
-+}
-+
-+static struct console simnow_console = {
-+ .name = "simnow",
-+ .write = simnow_write,
-+ .flags = CON_PRINTBUFFER,
-+ .index = -1,
-+};
-+
-+/* Direct interface for emergencies */
-+struct console *early_console = &early_vga_console;
-+static int early_console_initialized = 0;
-+
-+void early_printk(const char *fmt, ...)
-+{
-+ char buf[512];
-+ int n;
-+ va_list ap;
-+
-+ va_start(ap,fmt);
-+ n = vscnprintf(buf,512,fmt,ap);
-+ early_console->write(early_console,buf,n);
-+ va_end(ap);
-+}
-+
-+static int __initdata keep_early;
-+
-+int __init setup_early_printk(char *opt)
-+{
-+ char *space;
-+ char buf[256];
-+
-+ if (early_console_initialized)
-+ return 1;
-+
-+ strlcpy(buf,opt,sizeof(buf));
-+ space = strchr(buf, ' ');
-+ if (space)
-+ *space = 0;
-+
-+ if (strstr(buf,"keep"))
-+ keep_early = 1;
-+
-+ if (!strncmp(buf, "serial", 6)) {
-+ early_serial_init(buf + 6);
-+ early_console = &early_serial_console;
-+ } else if (!strncmp(buf, "ttyS", 4)) {
-+ early_serial_init(buf);
-+ early_console = &early_serial_console;
-+ } else if (!strncmp(buf, "vga", 3)
-+#ifndef CONFIG_XEN
-+ && SCREEN_INFO.orig_video_isVGA == 1) {
-+ max_xpos = SCREEN_INFO.orig_video_cols;
-+ max_ypos = SCREEN_INFO.orig_video_lines;
-+ current_ypos = SCREEN_INFO.orig_y;
-+#else
-+ || !strncmp(buf, "xen", 3)) {
-+#endif
-+ early_console = &early_vga_console;
-+ } else if (!strncmp(buf, "simnow", 6)) {
-+ simnow_init(buf + 6);
-+ early_console = &simnow_console;
-+ keep_early = 1;
-+ }
-+ early_console_initialized = 1;
-+ register_console(early_console);
-+ return 0;
-+}
-+
-+void __init disable_early_printk(void)
-+{
-+ if (!early_console_initialized || !early_console)
-+ return;
-+ if (!keep_early) {
-+ printk("disabling early console\n");
-+ unregister_console(early_console);
-+ early_console_initialized = 0;
-+ } else {
-+ printk("keeping early console\n");
-+ }
-+}
-+
-+__setup("earlyprintk=", setup_early_printk);
---- /dev/null
-+++ b/arch/x86/kernel/entry_32-xen.S
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ head-2009-11-06/arch/x86/kernel/entry_32-xen.S 2009-05-19 09:16:41.000000000 +0200
@@ -0,0 +1,1242 @@
+/*
+ * linux/arch/i386/entry.S
@@ -12962,1328 +2933,8 @@ for reference, prefixed with the version the removal occured):
+#include "syscall_table.S"
+
+syscall_table_size=(.-sys_call_table)
---- /dev/null
-+++ b/arch/x86/kernel/entry_64-xen.S
-@@ -0,0 +1,1317 @@
-+/*
-+ * linux/arch/x86_64/entry.S
-+ *
-+ * Copyright (C) 1991, 1992 Linus Torvalds
-+ * Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs
-+ * Copyright (C) 2000 Pavel Machek <pavel@suse.cz>
-+ *
-+ * $Id$
-+ *
-+ * Jun Nakajima <jun.nakajima@intel.com>
-+ * Asit Mallick <asit.k.mallick@intel.com>
-+ * Modified for Xen
-+ */
-+
-+/*
-+ * entry.S contains the system-call and fault low-level handling routines.
-+ *
-+ * NOTE: This code handles signal-recognition, which happens every time
-+ * after an interrupt and after each system call.
-+ *
-+ * Normal syscalls and interrupts don't save a full stack frame, this is
-+ * only done for syscall tracing, signals or fork/exec et.al.
-+ *
-+ * A note on terminology:
-+ * - top of stack: Architecture defined interrupt frame from SS to RIP
-+ * at the top of the kernel process stack.
-+ * - partial stack frame: partially saved registers upto R11.
-+ * - full stack frame: Like partial stack frame, but all register saved.
-+ *
-+ * TODO:
-+ * - schedule it carefully for the final hardware.
-+ */
-+
-+#define ASSEMBLY 1
-+#include <linux/linkage.h>
-+#include <asm/segment.h>
-+#include <asm/smp.h>
-+#include <asm/cache.h>
-+#include <asm/errno.h>
-+#include <asm/dwarf2.h>
-+#include <asm/calling.h>
-+#include <asm/asm-offsets.h>
-+#include <asm/msr.h>
-+#include <asm/unistd.h>
-+#include <asm/thread_info.h>
-+#include <asm/hw_irq.h>
-+#include <asm/page.h>
-+#include <asm/irqflags.h>
-+#include <asm/errno.h>
-+#include <xen/interface/arch-x86_64.h>
-+#include <xen/interface/features.h>
-+
-+#include "xen_entry.S"
-+
-+ .code64
-+
-+#ifndef CONFIG_PREEMPT
-+#define retint_kernel retint_restore_args
-+#endif
-+
-+
-+.macro TRACE_IRQS_IRETQ offset=ARGOFFSET
-+#ifdef CONFIG_TRACE_IRQFLAGS
-+ bt $9,EFLAGS-\offset(%rsp) /* interrupts off? */
-+ jnc 1f
-+ TRACE_IRQS_ON
-+1:
-+#endif
-+.endm
-+
-+NMI_MASK = 0x80000000
-+
-+/*
-+ * C code is not supposed to know about undefined top of stack. Every time
-+ * a C function with an pt_regs argument is called from the SYSCALL based
-+ * fast path FIXUP_TOP_OF_STACK is needed.
-+ * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs
-+ * manipulation.
-+ */
-+
-+ /* %rsp:at FRAMEEND */
-+ .macro FIXUP_TOP_OF_STACK tmp
-+ movq $__USER_CS,CS(%rsp)
-+ movq $-1,RCX(%rsp)
-+ .endm
-+
-+ .macro RESTORE_TOP_OF_STACK tmp,offset=0
-+ .endm
-+
-+ .macro FAKE_STACK_FRAME child_rip
-+ /* push in order ss, rsp, eflags, cs, rip */
-+ xorl %eax, %eax
-+ pushq %rax /* ss */
-+ CFI_ADJUST_CFA_OFFSET 8
-+ /*CFI_REL_OFFSET ss,0*/
-+ pushq %rax /* rsp */
-+ CFI_ADJUST_CFA_OFFSET 8
-+ CFI_REL_OFFSET rsp,0
-+ pushq $(1<<9) /* eflags - interrupts on */
-+ CFI_ADJUST_CFA_OFFSET 8
-+ /*CFI_REL_OFFSET rflags,0*/
-+ pushq $__KERNEL_CS /* cs */
-+ CFI_ADJUST_CFA_OFFSET 8
-+ /*CFI_REL_OFFSET cs,0*/
-+ pushq \child_rip /* rip */
-+ CFI_ADJUST_CFA_OFFSET 8
-+ CFI_REL_OFFSET rip,0
-+ pushq %rax /* orig rax */
-+ CFI_ADJUST_CFA_OFFSET 8
-+ .endm
-+
-+ .macro UNFAKE_STACK_FRAME
-+ addq $8*6, %rsp
-+ CFI_ADJUST_CFA_OFFSET -(6*8)
-+ .endm
-+
-+ .macro CFI_DEFAULT_STACK start=1,adj=0
-+ .if \start
-+ CFI_STARTPROC simple
-+ CFI_DEF_CFA rsp,SS+8 - \adj*ARGOFFSET
-+ .else
-+ CFI_DEF_CFA_OFFSET SS+8 - \adj*ARGOFFSET
-+ .endif
-+ .if \adj == 0
-+ CFI_REL_OFFSET r15,R15
-+ CFI_REL_OFFSET r14,R14
-+ CFI_REL_OFFSET r13,R13
-+ CFI_REL_OFFSET r12,R12
-+ CFI_REL_OFFSET rbp,RBP
-+ CFI_REL_OFFSET rbx,RBX
-+ .endif
-+ CFI_REL_OFFSET r11,R11 - \adj*ARGOFFSET
-+ CFI_REL_OFFSET r10,R10 - \adj*ARGOFFSET
-+ CFI_REL_OFFSET r9,R9 - \adj*ARGOFFSET
-+ CFI_REL_OFFSET r8,R8 - \adj*ARGOFFSET
-+ CFI_REL_OFFSET rax,RAX - \adj*ARGOFFSET
-+ CFI_REL_OFFSET rcx,RCX - \adj*ARGOFFSET
-+ CFI_REL_OFFSET rdx,RDX - \adj*ARGOFFSET
-+ CFI_REL_OFFSET rsi,RSI - \adj*ARGOFFSET
-+ CFI_REL_OFFSET rdi,RDI - \adj*ARGOFFSET
-+ CFI_REL_OFFSET rip,RIP - \adj*ARGOFFSET
-+ /*CFI_REL_OFFSET cs,CS - \adj*ARGOFFSET*/
-+ /*CFI_REL_OFFSET rflags,EFLAGS - \adj*ARGOFFSET*/
-+ CFI_REL_OFFSET rsp,RSP - \adj*ARGOFFSET
-+ /*CFI_REL_OFFSET ss,SS - \adj*ARGOFFSET*/
-+ .endm
-+
-+ /*
-+ * Must be consistent with the definition in arch-x86/xen-x86_64.h:
-+ * struct iret_context {
-+ * u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
-+ * };
-+ * with rax, r11, and rcx being taken care of in the hypercall stub.
-+ */
-+ .macro HYPERVISOR_IRET flag
-+ testb $3,1*8(%rsp)
-+ jnz 2f
-+ testl $NMI_MASK,2*8(%rsp)
-+ jnz 2f
-+
-+ cmpb $0,(xen_features+XENFEAT_supervisor_mode_kernel)(%rip)
-+ jne 1f
-+
-+ /* Direct iret to kernel space. Correct CS and SS. */
-+ orl $3,1*8(%rsp)
-+ orl $3,4*8(%rsp)
-+1: iretq
-+
-+2: /* Slow iret via hypervisor. */
-+ andl $~NMI_MASK, 2*8(%rsp)
-+ pushq $\flag
-+ jmp hypercall_page + (__HYPERVISOR_iret * 32)
-+ .endm
-+
-+/*
-+ * A newly forked process directly context switches into this.
-+ */
-+/* rdi: prev */
-+ENTRY(ret_from_fork)
-+ CFI_DEFAULT_STACK
-+ push kernel_eflags(%rip)
-+ CFI_ADJUST_CFA_OFFSET 4
-+ popf # reset kernel eflags
-+ CFI_ADJUST_CFA_OFFSET -4
-+ call schedule_tail
-+ GET_THREAD_INFO(%rcx)
-+ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
-+ jnz rff_trace
-+rff_action:
-+ RESTORE_REST
-+ testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread?
-+ je int_ret_from_sys_call
-+ testl $_TIF_IA32,threadinfo_flags(%rcx)
-+ jnz int_ret_from_sys_call
-+ RESTORE_TOP_OF_STACK %rdi,ARGOFFSET
-+ jmp ret_from_sys_call
-+rff_trace:
-+ movq %rsp,%rdi
-+ call syscall_trace_leave
-+ GET_THREAD_INFO(%rcx)
-+ jmp rff_action
-+ CFI_ENDPROC
-+END(ret_from_fork)
-+
-+/*
-+ * initial frame state for interrupts and exceptions
-+ */
-+ .macro _frame ref
-+ CFI_STARTPROC simple
-+ CFI_DEF_CFA rsp,SS+8-\ref
-+ /*CFI_REL_OFFSET ss,SS-\ref*/
-+ CFI_REL_OFFSET rsp,RSP-\ref
-+ /*CFI_REL_OFFSET rflags,EFLAGS-\ref*/
-+ /*CFI_REL_OFFSET cs,CS-\ref*/
-+ CFI_REL_OFFSET rip,RIP-\ref
-+ .endm
-+
-+/*
-+ * System call entry. Upto 6 arguments in registers are supported.
-+ *
-+ * SYSCALL does not save anything on the stack and does not change the
-+ * stack pointer.
-+ */
-+
-+/*
-+ * Register setup:
-+ * rax system call number
-+ * rdi arg0
-+ * rcx return address for syscall/sysret, C arg3
-+ * rsi arg1
-+ * rdx arg2
-+ * r10 arg3 (--> moved to rcx for C)
-+ * r8 arg4
-+ * r9 arg5
-+ * r11 eflags for syscall/sysret, temporary for C
-+ * r12-r15,rbp,rbx saved by C code, not touched.
-+ *
-+ * Interrupts are enabled on entry.
-+ * Only called from user space.
-+ *
-+ * XXX if we had a free scratch register we could save the RSP into the stack frame
-+ * and report it properly in ps. Unfortunately we haven't.
-+ *
-+ * When user can change the frames always force IRET. That is because
-+ * it deals with uncanonical addresses better. SYSRET has trouble
-+ * with them due to bugs in both AMD and Intel CPUs.
-+ */
-+
-+ENTRY(system_call)
-+ _frame (RIP-0x10)
-+ SAVE_ARGS -8,0
-+ movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
-+ GET_THREAD_INFO(%rcx)
-+ testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
-+ CFI_REMEMBER_STATE
-+ jnz tracesys
-+ cmpq $__NR_syscall_max,%rax
-+ ja badsys
-+ movq %r10,%rcx
-+ call *sys_call_table(,%rax,8) # XXX: rip relative
-+ movq %rax,RAX-ARGOFFSET(%rsp)
-+/*
-+ * Syscall return path ending with SYSRET (fast path)
-+ * Has incomplete stack frame and undefined top of stack.
-+ */
-+ .globl ret_from_sys_call
-+ret_from_sys_call:
-+ movl $_TIF_ALLWORK_MASK,%edi
-+ /* edi: flagmask */
-+sysret_check:
-+ GET_THREAD_INFO(%rcx)
-+ XEN_BLOCK_EVENTS(%rsi)
-+ TRACE_IRQS_OFF
-+ movl threadinfo_flags(%rcx),%edx
-+ andl %edi,%edx
-+ CFI_REMEMBER_STATE
-+ jnz sysret_careful
-+ /*
-+ * sysretq will re-enable interrupts:
-+ */
-+ TRACE_IRQS_ON
-+ XEN_UNBLOCK_EVENTS(%rsi)
-+ RESTORE_ARGS 0,8,0
-+ HYPERVISOR_IRET VGCF_IN_SYSCALL
-+
-+ /* Handle reschedules */
-+ /* edx: work, edi: workmask */
-+sysret_careful:
-+ CFI_RESTORE_STATE
-+ bt $TIF_NEED_RESCHED,%edx
-+ jnc sysret_signal
-+ TRACE_IRQS_ON
-+ XEN_UNBLOCK_EVENTS(%rsi)
-+ pushq %rdi
-+ CFI_ADJUST_CFA_OFFSET 8
-+ call schedule
-+ popq %rdi
-+ CFI_ADJUST_CFA_OFFSET -8
-+ jmp sysret_check
-+
-+ /* Handle a signal */
-+sysret_signal:
-+ TRACE_IRQS_ON
-+/* sti */
-+ XEN_UNBLOCK_EVENTS(%rsi)
-+ testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
-+ jz 1f
-+
-+ /* Really a signal */
-+ /* edx: work flags (arg3) */
-+ leaq do_notify_resume(%rip),%rax
-+ leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
-+ xorl %esi,%esi # oldset -> arg2
-+ call ptregscall_common
-+1: movl $_TIF_NEED_RESCHED,%edi
-+ /* Use IRET because user could have changed frame. This
-+ works because ptregscall_common has called FIXUP_TOP_OF_STACK. */
-+ XEN_BLOCK_EVENTS(%rsi)
-+ TRACE_IRQS_OFF
-+ jmp int_with_check
-+
-+badsys:
-+ movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
-+ jmp ret_from_sys_call
-+
-+ /* Do syscall tracing */
-+tracesys:
-+ CFI_RESTORE_STATE
-+ SAVE_REST
-+ movq $-ENOSYS,RAX(%rsp)
-+ FIXUP_TOP_OF_STACK %rdi
-+ movq %rsp,%rdi
-+ call syscall_trace_enter
-+ LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
-+ RESTORE_REST
-+ cmpq $__NR_syscall_max,%rax
-+ ja 1f
-+ movq %r10,%rcx /* fixup for C */
-+ call *sys_call_table(,%rax,8)
-+1: movq %rax,RAX-ARGOFFSET(%rsp)
-+ /* Use IRET because user could have changed frame */
-+ jmp int_ret_from_sys_call
-+ CFI_ENDPROC
-+END(system_call)
-+
-+/*
-+ * Syscall return path ending with IRET.
-+ * Has correct top of stack, but partial stack frame.
-+ */
-+ENTRY(int_ret_from_sys_call)
-+ CFI_ST