rpms/kernel/devel linux-2.6-xen-i386-mach-io-check-nmi.patch, 1.1, 1.2 linux-2.6-xen-move-vdso-fixmap.patch, 1.1, 1.2 linux-2.6-xen-net-csum.patch, 1.1, 1.2 linux-2.6-xen-pmd-shared.patch, 1.1, 1.2 linux-2.6-xen-smp-alts.patch, 1.1, 1.2 linux-2.6-xen-vsyscall_base.patch, 1.1, 1.2 linux-2.6-xen.patch, 1.3, 1.4 .cvsignore, 1.371, 1.372 kernel-2.6.spec, 1.2016, 1.2017 linux-2.6-crashdump-common.patch, 1.9, 1.10 linux-2.6-execshield-fixes.patch, 1.5, 1.6 linux-2.6-execshield-vdso.patch, 1.2, 1.3 linux-2.6-execshield-xen.patch, 1.2, 1.3 linux-2.6-execshield.patch, 1.10, 1.11 linux-2.6-xen-compile-fixes.patch, 1.1, 1.2 sources, 1.312, 1.313 linux-2.6-xen-acpi.patch, 1.1, NONE linux-2.6-xen-cpusteal-kernel.patch, 1.2, NONE linux-2.6-xen-gcc-4.1-compile-fix.patch, 1.1, NONE linux-2.6-xen-guest-enable-char-devices.patch, 1.1, NONE linux-2.6-xen-merge.patch, 1.3, NONE linux-2.6-xen-x86_64-fixes.patch, 1.1, NONE linux-2.6-xen_net_read_mac_export.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Mar 6 16:32:54 UTC 2006


Author: sct

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv9215

Modified Files:
	.cvsignore kernel-2.6.spec linux-2.6-crashdump-common.patch 
	linux-2.6-execshield-fixes.patch 
	linux-2.6-execshield-vdso.patch linux-2.6-execshield-xen.patch 
	linux-2.6-execshield.patch linux-2.6-xen-compile-fixes.patch 
	sources 
Added Files:
	linux-2.6-xen-i386-mach-io-check-nmi.patch 
	linux-2.6-xen-move-vdso-fixmap.patch 
	linux-2.6-xen-net-csum.patch linux-2.6-xen-pmd-shared.patch 
	linux-2.6-xen-smp-alts.patch linux-2.6-xen-vsyscall_base.patch 
	linux-2.6-xen.patch 
Removed Files:
	linux-2.6-xen-acpi.patch linux-2.6-xen-cpusteal-kernel.patch 
	linux-2.6-xen-gcc-4.1-compile-fix.patch 
	linux-2.6-xen-guest-enable-char-devices.patch 
	linux-2.6-xen-merge.patch linux-2.6-xen-x86_64-fixes.patch 
	linux-2.6-xen_net_read_mac_export.patch 
Log Message:
Checkin xen rebase to main distCVS HEAD: HEAD now follows xen-unstable.hg
upstream, not linux-2.6-merge.hg.
(Merged from private-xen-rebased-2009-branch.)



linux-2.6-xen-i386-mach-io-check-nmi.patch:
 arch/i386/kernel/traps.c                   |    9 +--------
 include/asm-i386/mach-default/mach_traps.h |   12 ++++++++++++
 2 files changed, 13 insertions(+), 8 deletions(-)

Index: linux-2.6-xen-i386-mach-io-check-nmi.patch
===================================================================
RCS file: linux-2.6-xen-i386-mach-io-check-nmi.patch
diff -N linux-2.6-xen-i386-mach-io-check-nmi.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-i386-mach-io-check-nmi.patch	6 Mar 2006 16:31:47 -0000	1.2
@@ -0,0 +1,45 @@
+diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/traps.c ./arch/i386/kernel/traps.c
+--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/traps.c	2006-02-15 20:38:51.000000000 +0000
++++ ./arch/i386/kernel/traps.c	2006-02-15 20:40:43.000000000 +0000
+@@ -567,18 +567,11 @@ static void mem_parity_error(unsigned ch
+ 
+ static void io_check_error(unsigned char reason, struct pt_regs * regs)
+ {
+-	unsigned long i;
+-
+ 	printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
+ 	show_registers(regs);
+ 
+ 	/* Re-enable the IOCK line, wait for a few seconds */
+-	reason = (reason & 0xf) | 8;
+-	outb(reason, 0x61);
+-	i = 2000;
+-	while (--i) udelay(1000);
+-	reason &= ~8;
+-	outb(reason, 0x61);
++	clear_io_check_error(reason);
+ }
+ 
+ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/mach-default/mach_traps.h ./include/asm-i386/mach-default/mach_traps.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/mach-default/mach_traps.h	2006-01-03 03:21:10.000000000 +0000
++++ ./include/asm-i386/mach-default/mach_traps.h	2006-02-15 20:40:43.000000000 +0000
+@@ -15,6 +15,18 @@ static inline void clear_mem_error(unsig
+ 	outb(reason, 0x61);
+ }
+ 
++static inline void clear_io_check_error(unsigned char reason)
++{
++	unsigned long i;
++
++	reason = (reason & 0xf) | 8;
++	outb(reason, 0x61);
++	i = 2000;
++	while (--i) udelay(1000);
++	reason &= ~8;
++	outb(reason, 0x61);
++}
++
+ static inline unsigned char get_nmi_reason(void)
+ {
+ 	return inb(0x61);

linux-2.6-xen-move-vdso-fixmap.patch:
 arch/i386/kernel/asm-offsets.c         |    3 -
 arch/i386/kernel/sysenter.c            |   76 ++++++++++++++++++++++++++++++---
 arch/i386/mm/pgtable-xen.c             |    1 
 include/asm-i386/a.out.h               |    2 
 include/asm-i386/elf.h                 |    7 ++-
 include/asm-i386/fixmap.h              |    9 ---
 include/asm-i386/mach-xen/asm/fixmap.h |    9 ---
 include/asm-i386/mach-xen/asm/page.h   |    2 
 include/asm-i386/page.h                |    2 
 9 files changed, 84 insertions(+), 27 deletions(-)

Index: linux-2.6-xen-move-vdso-fixmap.patch
===================================================================
RCS file: linux-2.6-xen-move-vdso-fixmap.patch
diff -N linux-2.6-xen-move-vdso-fixmap.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-move-vdso-fixmap.patch	6 Mar 2006 16:31:48 -0000	1.2
@@ -0,0 +1,264 @@
+# HG changeset patch
+# User cl349 at firebug.cl.cam.ac.uk
+# Node ID 822a27d28afeab1ffdf8ca8e8e8a11de5e7c7aec
+# Parent  875e0e96e574cc8216394b7eb6eaa22474d0f216
+Move the gate page (vsyscall) out of the fixmap area into user address space,
+just below PAGE_OFFSET.
+
+From: Gerd Hoffmann <kraxel at suse.de>
+Signed-off-by: Christian Limpach <Christian.Limpach at cl.cam.ac.uk>
+
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c
+--- a/linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c	Thu Feb 23 15:22:19 2006 +0000
+@@ -13,6 +13,7 @@
+ #include <asm/fixmap.h>
+ #include <asm/processor.h>
+ #include <asm/thread_info.h>
++#include <asm/elf.h>
+ 
+ #define DEFINE(sym, val) \
+         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+@@ -70,5 +71,5 @@ void foo(void)
+ #endif
+ 
+ 	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+-	DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL));
++	DEFINE(VSYSCALL_BASE, VSYSCALL_BASE);
+ }
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c
+--- a/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c	Thu Feb 23 15:22:19 2006 +0000
+@@ -13,6 +13,7 @@
+ #include <linux/gfp.h>
+ #include <linux/string.h>
+ #include <linux/elf.h>
++#include <linux/mm.h>
+ 
+ #include <asm/cpufeature.h>
+ #include <asm/msr.h>
+@@ -47,25 +48,90 @@ void enable_sep_cpu(void)
+  */
+ extern const char vsyscall_int80_start, vsyscall_int80_end;
+ extern const char vsyscall_sysenter_start, vsyscall_sysenter_end;
++static void *syscall_page;
+ 
+ int __init sysenter_setup(void)
+ {
+-	void *page = (void *)get_zeroed_page(GFP_ATOMIC);
+-
+-	__set_fixmap(FIX_VSYSCALL, __pa(page), PAGE_READONLY_EXEC);
++	syscall_page = (void *)get_zeroed_page(GFP_ATOMIC);
+ 
+ #ifdef CONFIG_X86_SYSENTER
+ 	if (boot_cpu_has(X86_FEATURE_SEP)) {
+-		memcpy(page,
++		memcpy(syscall_page,
+ 		       &vsyscall_sysenter_start,
+ 		       &vsyscall_sysenter_end - &vsyscall_sysenter_start);
+ 		return 0;
+ 	}
+ #endif
+ 
+-	memcpy(page,
++	memcpy(syscall_page,
+ 	       &vsyscall_int80_start,
+ 	       &vsyscall_int80_end - &vsyscall_int80_start);
+ 
+ 	return 0;
+ }
++
++static struct page*
++syscall_nopage(struct vm_area_struct *vma, unsigned long adr, int *type)
++{
++	struct page *p = virt_to_page(adr - vma->vm_start + syscall_page);
++	get_page(p);
++	return p;
++}
++
++/* Prevent VMA merging */
++static void syscall_vma_close(struct vm_area_struct *vma)
++{
++}
++
++static struct vm_operations_struct syscall_vm_ops = {
++	.close = syscall_vma_close,
++	.nopage = syscall_nopage,
++};
++
++/* Setup a VMA at program startup for the vsyscall page */
++int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
++{
++	struct vm_area_struct *vma;
++	struct mm_struct *mm = current->mm;
++	int ret;
++
++	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
++	if (!vma)
++		return -ENOMEM;
++
++	memset(vma, 0, sizeof(struct vm_area_struct));
++	/* Could randomize here */
++	vma->vm_start = VSYSCALL_BASE;
++	vma->vm_end = VSYSCALL_BASE + PAGE_SIZE;
++	/* MAYWRITE to allow gdb to COW and set breakpoints */
++	vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE;
++	vma->vm_flags |= mm->def_flags;
++	vma->vm_page_prot = protection_map[vma->vm_flags & 7];
++	vma->vm_ops = &syscall_vm_ops;
++	vma->vm_mm = mm;
++
++	down_write(&mm->mmap_sem);
++	if ((ret = insert_vm_struct(mm, vma))) {
++		up_write(&mm->mmap_sem);
++		kmem_cache_free(vm_area_cachep, vma);
++		return ret;
++	}
++	mm->total_vm++;
++	up_write(&mm->mmap_sem);
++	return 0;
++}
++
++struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
++{
++	return NULL;
++}
++
++int in_gate_area(struct task_struct *task, unsigned long addr)
++{
++	return 0;
++}
++
++int in_gate_area_no_task(unsigned long addr)
++{
++	return 0;
++}
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c
+--- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Thu Feb 23 15:22:19 2006 +0000
+@@ -194,7 +194,6 @@ void __set_fixmap (enum fixed_addresses 
+ 	}
+ 	switch (idx) {
+ 	case FIX_WP_TEST:
+-	case FIX_VSYSCALL:
+ #ifdef CONFIG_X86_F00F_BUG
+ 	case FIX_F00F_IDT:
+ #endif
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/include/asm-i386/a.out.h
+--- a/linux-2.6-xen-sparse/include/asm-i386/a.out.h	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/include/asm-i386/a.out.h	Thu Feb 23 15:22:19 2006 +0000
+@@ -19,7 +19,7 @@ struct exec
+ 
+ #ifdef __KERNEL__
+ 
+-#define STACK_TOP	TASK_SIZE
++#define STACK_TOP	(TASK_SIZE - 3*PAGE_SIZE)
+ 
+ #endif
+ 
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/include/asm-i386/elf.h
+--- a/linux-2.6-xen-sparse/include/asm-i386/elf.h	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/include/asm-i386/elf.h	Thu Feb 23 15:22:19 2006 +0000
+@@ -129,10 +129,15 @@ extern int dump_task_extended_fpu (struc
+ #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
+ #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
+ 
+-#define VSYSCALL_BASE	(__fix_to_virt(FIX_VSYSCALL))
++#define VSYSCALL_BASE	(PAGE_OFFSET - 2*PAGE_SIZE)
+ #define VSYSCALL_EHDR	((const struct elfhdr *) VSYSCALL_BASE)
+ #define VSYSCALL_ENTRY	((unsigned long) &__kernel_vsyscall)
+ extern void __kernel_vsyscall;
++
++#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
++struct linux_binprm;
++extern int arch_setup_additional_pages(struct linux_binprm *bprm,
++                                       int executable_stack);
+ 
+ #define ARCH_DLINFO						\
+ do {								\
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/fixmap.h
+--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/fixmap.h	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/fixmap.h	Thu Feb 23 15:22:19 2006 +0000
+@@ -53,7 +53,6 @@
+  */
+ enum fixed_addresses {
+ 	FIX_HOLE,
+-	FIX_VSYSCALL,
+ #ifdef CONFIG_X86_LOCAL_APIC
+ 	FIX_APIC_BASE,	/* local (CPU) APIC) -- required for SMP or not */
+ #endif
+@@ -123,14 +122,6 @@ extern void __set_fixmap(
+ #define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
+ #define __virt_to_fix(x)	((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+ 
+-/*
+- * This is the range that is readable by user mode, and things
+- * acting like user mode such as get_user_pages.
+- */
+-#define FIXADDR_USER_START	(__fix_to_virt(FIX_VSYSCALL))
+-#define FIXADDR_USER_END	(FIXADDR_USER_START + PAGE_SIZE)
+-
+-
+ extern void __this_fixmap_does_not_exist(void);
+ 
+ /*
+diff -r 875e0e96e574 -r 822a27d28afe linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h
+--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h	Thu Feb 23 15:22:17 2006 +0000
++++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h	Thu Feb 23 15:22:19 2006 +0000
+@@ -317,6 +317,8 @@ extern int page_is_ram(unsigned long pag
+ #define virt_to_mfn(v)		(pfn_to_mfn(__pa(v) >> PAGE_SHIFT))
+ #define mfn_to_virt(m)		(__va(mfn_to_pfn(m) << PAGE_SHIFT))
+ 
++#define __HAVE_ARCH_GATE_AREA 1
++
+ #endif /* __KERNEL__ */
+ 
+ #include <asm-generic/page.h>
+# HG changeset patch
+# User cl349 at firebug.cl.cam.ac.uk
+# Node ID 55f597e929f341eade781048db9da77a0352820d
+# Parent  dbec76a720f8d79aa9dfcdb9e91684b7426a23f9
+Fix non-xen build for: Move the gate page (vsyscall) out of the fixmap area
+into user address space, just below PAGE_OFFSET.
+
+From: Gerd Hoffmann <kraxel at suse.de>
+Signed-off-by: Christian Limpach <Christian.Limpach at cl.cam.ac.uk>
+
+diff -r dbec76a720f8 -r 55f597e929f3 linux-2.6-xen-sparse/include/asm-i386/fixmap.h
+--- a/linux-2.6-xen-sparse/include/asm-i386/fixmap.h	Mon Feb 27 10:26:01 2006 +0000
++++ b/linux-2.6-xen-sparse/include/asm-i386/fixmap.h	Mon Feb 27 10:27:57 2006 +0000
+@@ -52,7 +52,6 @@
+  */
+ enum fixed_addresses {
+ 	FIX_HOLE,
+-	FIX_VSYSCALL,
+ #ifdef CONFIG_X86_LOCAL_APIC
+ 	FIX_APIC_BASE,	/* local (CPU) APIC) -- required for SMP or not */
+ #endif
+@@ -116,14 +115,6 @@ extern void __set_fixmap (enum fixed_add
+ #define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
+ #define __virt_to_fix(x)	((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+ 
+-/*
+- * This is the range that is readable by user mode, and things
+- * acting like user mode such as get_user_pages.
+- */
+-#define FIXADDR_USER_START	(__fix_to_virt(FIX_VSYSCALL))
+-#define FIXADDR_USER_END	(FIXADDR_USER_START + PAGE_SIZE)
+-
+-
+ extern void __this_fixmap_does_not_exist(void);
+ 
+ /*
+diff -r dbec76a720f8 -r 55f597e929f3 linux-2.6-xen-sparse/include/asm-i386/page.h
+--- a/linux-2.6-xen-sparse/include/asm-i386/page.h	Mon Feb 27 10:26:01 2006 +0000
++++ b/linux-2.6-xen-sparse/include/asm-i386/page.h	Mon Feb 27 10:27:57 2006 +0000
+@@ -139,6 +139,8 @@ extern int page_is_ram(unsigned long pag
+ 	((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+ 		 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+ 
++#define __HAVE_ARCH_GATE_AREA 1
++
+ #endif /* __KERNEL__ */
+ 
+ #include <asm-generic/page.h>

linux-2.6-xen-net-csum.patch:
 ip_nat_proto_tcp.c |    6 +++++-
 ip_nat_proto_udp.c |    9 +++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

Index: linux-2.6-xen-net-csum.patch
===================================================================
RCS file: linux-2.6-xen-net-csum.patch
diff -N linux-2.6-xen-net-csum.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-net-csum.patch	6 Mar 2006 16:31:48 -0000	1.2
@@ -0,0 +1,41 @@
+diff -pruN ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
+--- ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-02-02 17:39:51.000000000 +0000
++++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-02-02 17:44:18.000000000 +0000
+@@ -129,10 +129,14 @@ tcp_manip_pkt(struct sk_buff **pskb,
+ 	if (hdrsize < sizeof(*hdr))
+ 		return 1;
+ 
+-	hdr->check = ip_nat_cheat_check(~oldip, newip,
++	if ((*pskb)->proto_csum_blank) {
++		hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
++	} else {
++		hdr->check = ip_nat_cheat_check(~oldip, newip,
+ 					ip_nat_cheat_check(oldport ^ 0xFFFF,
+ 							   newport,
+ 							   hdr->check));
++	}
+ 	return 1;
+ }
+
+diff -pruN ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
+--- ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-02-02 17:39:51.000000000 +0000
++++ ./net/ipv4/netfilter/ip_nat_proto_udp.c	2006-02-02 17:44:18.000000000 +0000
+@@ -113,11 +113,16 @@ udp_manip_pkt(struct sk_buff **pskb,
+ 		newport = tuple->dst.u.udp.port;
+ 		portptr = &hdr->dest;
+ 	}
+-	if (hdr->check) /* 0 is a special case meaning no checksum */
+-		hdr->check = ip_nat_cheat_check(~oldip, newip,
++	if (hdr->check) { /* 0 is a special case meaning no checksum */
++		if ((*pskb)->proto_csum_blank) {
++			hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
++		} else {
++			hdr->check = ip_nat_cheat_check(~oldip, newip,
+ 					ip_nat_cheat_check(*portptr ^ 0xFFFF,
+ 							   newport,
+ 							   hdr->check));
++		}
++	}
+ 	*portptr = newport;
+ 	return 1;
+ }

linux-2.6-xen-pmd-shared.patch:
 arch/i386/mm/pageattr.c                |    2 -
 arch/i386/mm/pgtable.c                 |   51 +++++++++++++++++++++++++++++----
 include/asm-i386/pgtable-2level-defs.h |    2 +
 include/asm-i386/pgtable-3level-defs.h |    2 +
 4 files changed, 50 insertions(+), 7 deletions(-)

Index: linux-2.6-xen-pmd-shared.patch
===================================================================
RCS file: linux-2.6-xen-pmd-shared.patch
diff -N linux-2.6-xen-pmd-shared.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-pmd-shared.patch	6 Mar 2006 16:31:48 -0000	1.2
@@ -0,0 +1,111 @@
+diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pageattr.c ./arch/i386/mm/pageattr.c
+--- ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pageattr.c	2006-02-02 17:39:29.000000000 +0000
++++ ./arch/i386/mm/pageattr.c	2006-02-02 17:45:14.000000000 +0000
+@@ -78,7 +78,7 @@ static void set_pmd_pte(pte_t *kpte, uns
+ 	unsigned long flags;
+ 
+ 	set_pte_atomic(kpte, pte); 	/* change init_mm */
+-	if (PTRS_PER_PMD > 1)
++	if (HAVE_SHARED_KERNEL_PMD)
+ 		return;
+ 
+ 	spin_lock_irqsave(&pgd_lock, flags);
+diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pgtable.c ./arch/i386/mm/pgtable.c
+--- ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pgtable.c	2006-01-03 03:21:10.000000000 +0000
++++ ./arch/i386/mm/pgtable.c	2006-02-02 17:45:14.000000000 +0000
+@@ -215,9 +215,10 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
+ 		spin_lock_irqsave(&pgd_lock, flags);
+ 	}
+ 
+-	clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
+-			swapper_pg_dir + USER_PTRS_PER_PGD,
+-			KERNEL_PGD_PTRS);
++	if (PTRS_PER_PMD == 1 || HAVE_SHARED_KERNEL_PMD)
++		clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
++				swapper_pg_dir + USER_PTRS_PER_PGD,
++				KERNEL_PGD_PTRS);
+ 	if (PTRS_PER_PMD > 1)
+ 		return;
+ 
+@@ -249,6 +250,30 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
+ 			goto out_oom;
+ 		set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
+ 	}
++
++	if (!HAVE_SHARED_KERNEL_PMD) {
++		unsigned long flags;
++
++		for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
++			pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
++			if (!pmd)
++				goto out_oom;
++			set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
++		}
++
++		spin_lock_irqsave(&pgd_lock, flags);
++		for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
++			unsigned long v = (unsigned long)i << PGDIR_SHIFT;
++			pgd_t *kpgd = pgd_offset_k(v);
++			pud_t *kpud = pud_offset(kpgd, v);
++			pmd_t *kpmd = pmd_offset(kpud, v);
++			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
++			memcpy(pmd, kpmd, PAGE_SIZE);
++		}
++		pgd_list_add(pgd);
++		spin_unlock_irqrestore(&pgd_lock, flags);
++	}
++
+ 	return pgd;
+ 
+ out_oom:
+@@ -263,9 +288,23 @@ void pgd_free(pgd_t *pgd)
+ 	int i;
+ 
+ 	/* in the PAE case user pgd entries are overwritten before usage */
+-	if (PTRS_PER_PMD > 1)
+-		for (i = 0; i < USER_PTRS_PER_PGD; ++i)
+-			kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
++	if (PTRS_PER_PMD > 1) {
++		for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
++			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
++			kmem_cache_free(pmd_cache, pmd);
++		}
++		if (!HAVE_SHARED_KERNEL_PMD) {
++			unsigned long flags;
++			spin_lock_irqsave(&pgd_lock, flags);
++			pgd_list_del(pgd);
++			spin_unlock_irqrestore(&pgd_lock, flags);
++			for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
++				pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
++				memset(pmd, 0, PTRS_PER_PMD*sizeof(pmd_t));
++				kmem_cache_free(pmd_cache, pmd);
++			}
++		}
++	}
+ 	/* in the non-PAE case, free_pgtables() clears user pgd entries */
+ 	kmem_cache_free(pgd_cache, pgd);
+ }
+diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-2level-defs.h ./include/asm-i386/pgtable-2level-defs.h
+--- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-2level-defs.h	2006-01-03 03:21:10.000000000 +0000
++++ ./include/asm-i386/pgtable-2level-defs.h	2006-02-02 17:45:14.000000000 +0000
+@@ -1,6 +1,8 @@
+ #ifndef _I386_PGTABLE_2LEVEL_DEFS_H
+ #define _I386_PGTABLE_2LEVEL_DEFS_H
+ 
++#define HAVE_SHARED_KERNEL_PMD 0
++
+ /*
+  * traditional i386 two-level paging structure:
+  */
+diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-3level-defs.h ./include/asm-i386/pgtable-3level-defs.h
+--- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-3level-defs.h	2006-01-03 03:21:10.000000000 +0000
++++ ./include/asm-i386/pgtable-3level-defs.h	2006-02-02 17:45:14.000000000 +0000
+@@ -1,6 +1,8 @@
+ #ifndef _I386_PGTABLE_3LEVEL_DEFS_H
+ #define _I386_PGTABLE_3LEVEL_DEFS_H
+ 
++#define HAVE_SHARED_KERNEL_PMD 1
++
+ /*
+  * PGDIR_SHIFT determines what a top-level page table entry can map
+  */

linux-2.6-xen-smp-alts.patch:
 arch/i386/Kconfig              |   13 ++++++
 arch/i386/kernel/Makefile      |    1 
 arch/i386/kernel/smpalts.c     |   85 +++++++++++++++++++++++++++++++++++++++++
 arch/i386/kernel/smpboot.c     |   10 ++++
 arch/i386/kernel/vmlinux.lds.S |    7 +++
 include/asm-i386/atomic.h      |    7 ---
 include/asm-i386/bitops.h      |   19 +++------
 include/asm-i386/futex.h       |    4 -
 include/asm-i386/rwsem.h       |   17 ++++----
 include/asm-i386/smp_alt.h     |   32 +++++++++++++++
 include/asm-i386/spinlock.h    |   37 +++++++++++++++--
 include/asm-i386/system.h      |   56 ++++++++++++++++++++++++---
 12 files changed, 249 insertions(+), 39 deletions(-)

Index: linux-2.6-xen-smp-alts.patch
===================================================================
RCS file: linux-2.6-xen-smp-alts.patch
diff -N linux-2.6-xen-smp-alts.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-smp-alts.patch	6 Mar 2006 16:31:48 -0000	1.2
@@ -0,0 +1,591 @@
+diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/Kconfig ./arch/i386/Kconfig
+--- ../pristine-linux-2.6.16-rc3/arch/i386/Kconfig	2006-02-15 20:38:51.000000000 +0000
++++ ./arch/i386/Kconfig	2006-02-15 20:45:57.000000000 +0000
+@@ -202,6 +202,19 @@ config SMP
+ 
+ 	  If you don't know what to do here, say N.
+ 
++config SMP_ALTERNATIVES
++	bool "SMP alternatives support (EXPERIMENTAL)"
++	depends on SMP && EXPERIMENTAL
++	help
++	  Try to reduce the overhead of running an SMP kernel on a uniprocessor
++	  host slightly by replacing certain key instruction sequences
++	  according to whether we currently have more than one CPU available.
++	  This should provide a noticeable boost to performance when
++	  running SMP kernels on UP machines, and have negligible impact
++	  when running on an true SMP host.
++
++          If unsure, say N.
++	  
+ config NR_CPUS
+ 	int "Maximum number of CPUs (2-255)"
+ 	range 2 255
+diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/Makefile ./arch/i386/kernel/Makefile
+--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/Makefile	2006-02-15 20:38:51.000000000 +0000
++++ ./arch/i386/kernel/Makefile	2006-02-15 20:45:57.000000000 +0000
+@@ -37,6 +37,7 @@ obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
+ obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault.o
+ obj-$(CONFIG_VM86)		+= vm86.o
+ obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
++obj-$(CONFIG_SMP_ALTERNATIVES)  += smpalts.o
+ 
+ EXTRA_AFLAGS   := -traditional
+ 
+diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpalts.c ./arch/i386/kernel/smpalts.c
+--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpalts.c	1970-01-01 01:00:00.000000000 +0100
++++ ./arch/i386/kernel/smpalts.c	2006-02-15 20:45:57.000000000 +0000
+@@ -0,0 +1,85 @@
++#include <linux/kernel.h>
++#include <asm/system.h>
++#include <asm/smp_alt.h>
++#include <asm/processor.h>
++#include <asm/string.h>
++
++struct smp_replacement_record {
++	unsigned char targ_size;
++	unsigned char smp1_size;
++	unsigned char smp2_size;
++	unsigned char up_size;
++	unsigned char feature;
++	unsigned char data[0];
++};
++
++struct smp_alternative_record {
++	void *targ_start;
++	struct smp_replacement_record *repl;
++};
++
++extern struct smp_alternative_record __start_smp_alternatives_table,
++  __stop_smp_alternatives_table;
++extern unsigned long __init_begin, __init_end;
++
++void prepare_for_smp(void)
++{
++	struct smp_alternative_record *r;
++	printk(KERN_INFO "Enabling SMP...\n");
++	for (r = &__start_smp_alternatives_table;
++	     r != &__stop_smp_alternatives_table;
++	     r++) {
++		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
++		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
++		BUG_ON(r->repl->targ_size < r->repl->up_size);
++               if (system_state == SYSTEM_RUNNING &&
++                   r->targ_start >= (void *)&__init_begin &&
++                   r->targ_start < (void *)&__init_end)
++                       continue;
++		if (r->repl->feature != (unsigned char)-1 &&
++		    boot_cpu_has(r->repl->feature)) {
++			memcpy(r->targ_start,
++			       r->repl->data + r->repl->smp1_size,
++			       r->repl->smp2_size);
++			memset(r->targ_start + r->repl->smp2_size,
++			       0x90,
++			       r->repl->targ_size - r->repl->smp2_size);
++		} else {
++			memcpy(r->targ_start,
++			       r->repl->data,
++			       r->repl->smp1_size);
++			memset(r->targ_start + r->repl->smp1_size,
++			       0x90,
++			       r->repl->targ_size - r->repl->smp1_size);
++		}
++	}
++	/* Paranoia */
++	asm volatile ("jmp 1f\n1:");
++	mb();
++}
++
++void unprepare_for_smp(void)
++{
++	struct smp_alternative_record *r;
++	printk(KERN_INFO "Disabling SMP...\n");
++	for (r = &__start_smp_alternatives_table;
++	     r != &__stop_smp_alternatives_table;
++	     r++) {
++		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
++		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
++		BUG_ON(r->repl->targ_size < r->repl->up_size);
++               if (system_state == SYSTEM_RUNNING &&
++                   r->targ_start >= (void *)&__init_begin &&
++                   r->targ_start < (void *)&__init_end)
++                       continue;
++		memcpy(r->targ_start,
++		       r->repl->data + r->repl->smp1_size + r->repl->smp2_size,
++		       r->repl->up_size);
++		memset(r->targ_start + r->repl->up_size,
++		       0x90,
++		       r->repl->targ_size - r->repl->up_size);
++	}
++	/* Paranoia */
++	asm volatile ("jmp 1f\n1:");
++	mb();
++}
+diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpboot.c ./arch/i386/kernel/smpboot.c
+--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpboot.c	2006-02-15 20:38:51.000000000 +0000
++++ ./arch/i386/kernel/smpboot.c	2006-02-15 20:45:57.000000000 +0000
+@@ -1214,6 +1214,11 @@ static void __init smp_boot_cpus(unsigne
+ 		if (max_cpus <= cpucount+1)
+ 			continue;
+ 
++#ifdef CONFIG_SMP_ALTERNATIVES
++		if (kicked == 1)
++			prepare_for_smp();
++#endif
++
+ 		if (((cpu = alloc_cpu_id()) <= 0) || do_boot_cpu(apicid, cpu))
+ 			printk("CPU #%d not responding - cannot use it.\n",
+ 								apicid);
+@@ -1392,6 +1397,11 @@ int __devinit __cpu_up(unsigned int cpu)
+ 		return -EIO;
+ 	}
+ 
++#ifdef CONFIG_SMP_ALTERNATIVES
++	if (num_online_cpus() == 1)
++		prepare_for_smp();
++#endif
++
+ 	local_irq_enable();
+ 	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
+ 	/* Unleash the CPU! */
+diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/vmlinux.lds.S ./arch/i386/kernel/vmlinux.lds.S
+--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/vmlinux.lds.S	2006-01-03 03:21:10.000000000 +0000
++++ ./arch/i386/kernel/vmlinux.lds.S	2006-02-15 20:45:57.000000000 +0000
+@@ -34,6 +34,13 @@ SECTIONS
+   __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
+   __stop___ex_table = .;
+ 
++  . = ALIGN(16);
++  __start_smp_alternatives_table = .;
++  __smp_alternatives : { *(__smp_alternatives) }
++  __stop_smp_alternatives_table = .;
++
++  __smp_replacements : { *(__smp_replacements) }
++
+   RODATA
+ 
+   /* writeable */
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/atomic.h ./include/asm-i386/atomic.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/atomic.h	2006-02-15 20:38:57.000000000 +0000
++++ ./include/asm-i386/atomic.h	2006-02-15 20:45:57.000000000 +0000
+@@ -4,18 +4,13 @@
+ #include <linux/config.h>
+ #include <linux/compiler.h>
+ #include <asm/processor.h>
++#include <asm/smp_alt.h>
+ 
+ /*
+  * Atomic operations that C can't guarantee us.  Useful for
+  * resource counting etc..
+  */
+ 
+-#ifdef CONFIG_SMP
+-#define LOCK "lock ; "
+-#else
+-#define LOCK ""
+-#endif
+-
+ /*
+  * Make sure gcc doesn't try to be clever and move things around
+  * on us. We need to use _exactly_ the address the user gave us,
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/bitops.h ./include/asm-i386/bitops.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/bitops.h	2006-02-15 20:38:57.000000000 +0000
++++ ./include/asm-i386/bitops.h	2006-02-15 20:45:57.000000000 +0000
+@@ -7,6 +7,7 @@
+ 
+ #include <linux/config.h>
+ #include <linux/compiler.h>
++#include <asm/smp_alt.h>
+ 
+ /*
+  * These have to be done with inline assembly: that way the bit-setting
+@@ -16,12 +17,6 @@
+  * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
+  */
+ 
+-#ifdef CONFIG_SMP
+-#define LOCK_PREFIX "lock ; "
+-#else
+-#define LOCK_PREFIX ""
+-#endif
+-
+ #define ADDR (*(volatile long *) addr)
+ 
+ /**
+@@ -41,7 +36,7 @@
+  */
+ static inline void set_bit(int nr, volatile unsigned long * addr)
+ {
+-	__asm__ __volatile__( LOCK_PREFIX
++	__asm__ __volatile__( LOCK
+ 		"btsl %1,%0"
+ 		:"+m" (ADDR)
+ 		:"Ir" (nr));
+@@ -76,7 +71,7 @@ static inline void __set_bit(int nr, vol
+  */
+ static inline void clear_bit(int nr, volatile unsigned long * addr)
+ {
+-	__asm__ __volatile__( LOCK_PREFIX
++	__asm__ __volatile__( LOCK
+ 		"btrl %1,%0"
+ 		:"+m" (ADDR)
+ 		:"Ir" (nr));
+@@ -121,7 +116,7 @@ static inline void __change_bit(int nr, 
+  */
+ static inline void change_bit(int nr, volatile unsigned long * addr)
+ {
+-	__asm__ __volatile__( LOCK_PREFIX
++	__asm__ __volatile__( LOCK
+ 		"btcl %1,%0"
+ 		:"+m" (ADDR)
+ 		:"Ir" (nr));
+@@ -140,7 +135,7 @@ static inline int test_and_set_bit(int n
+ {
+ 	int oldbit;
+ 
+-	__asm__ __volatile__( LOCK_PREFIX
++	__asm__ __volatile__( LOCK
+ 		"btsl %2,%1\n\tsbbl %0,%0"
+ 		:"=r" (oldbit),"+m" (ADDR)
+ 		:"Ir" (nr) : "memory");
+@@ -180,7 +175,7 @@ static inline int test_and_clear_bit(int
+ {
+ 	int oldbit;
+ 
+-	__asm__ __volatile__( LOCK_PREFIX
++	__asm__ __volatile__( LOCK
+ 		"btrl %2,%1\n\tsbbl %0,%0"
+ 		:"=r" (oldbit),"+m" (ADDR)
+ 		:"Ir" (nr) : "memory");
+@@ -231,7 +226,7 @@ static inline int test_and_change_bit(in
+ {
+ 	int oldbit;
+ 
+-	__asm__ __volatile__( LOCK_PREFIX
++	__asm__ __volatile__( LOCK
+ 		"btcl %2,%1\n\tsbbl %0,%0"
+ 		:"=r" (oldbit),"+m" (ADDR)
+ 		:"Ir" (nr) : "memory");
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/futex.h ./include/asm-i386/futex.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/futex.h	2006-02-15 20:38:57.000000000 +0000
++++ ./include/asm-i386/futex.h	2006-02-15 20:45:57.000000000 +0000
+@@ -28,7 +28,7 @@
+ "1:	movl	%2, %0\n\
+ 	movl	%0, %3\n"					\
+ 	insn "\n"						\
+-"2:	" LOCK_PREFIX "cmpxchgl %3, %2\n\
++"2:	" LOCK "cmpxchgl %3, %2\n\
+ 	jnz	1b\n\
+ 3:	.section .fixup,\"ax\"\n\
+ 4:	mov	%5, %1\n\
+@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op, 
+ #endif
+ 		switch (op) {
+ 		case FUTEX_OP_ADD:
+-			__futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
++			__futex_atomic_op1(LOCK "xaddl %0, %2", ret,
+ 					   oldval, uaddr, oparg);
+ 			break;
+ 		case FUTEX_OP_OR:
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/rwsem.h ./include/asm-i386/rwsem.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/rwsem.h	2006-01-03 03:21:10.000000000 +0000
++++ ./include/asm-i386/rwsem.h	2006-02-15 20:45:57.000000000 +0000
+@@ -40,6 +40,7 @@
+ 
+ #include <linux/list.h>
+ #include <linux/spinlock.h>
++#include <asm/smp_alt.h>
+ 
+ struct rwsem_waiter;
+ 
+@@ -99,7 +100,7 @@ static inline void __down_read(struct rw
+ {
+ 	__asm__ __volatile__(
+ 		"# beginning down_read\n\t"
+-LOCK_PREFIX	"  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
++LOCK	        "  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
+ 		"  js        2f\n\t" /* jump if we weren't granted the lock */
+ 		"1:\n\t"
+ 		LOCK_SECTION_START("")
+@@ -130,7 +131,7 @@ static inline int __down_read_trylock(st
+ 		"  movl	     %1,%2\n\t"
+ 		"  addl      %3,%2\n\t"
+ 		"  jle	     2f\n\t"
+-LOCK_PREFIX	"  cmpxchgl  %2,%0\n\t"
++LOCK	        "  cmpxchgl  %2,%0\n\t"
+ 		"  jnz	     1b\n\t"
+ 		"2:\n\t"
+ 		"# ending __down_read_trylock\n\t"
+@@ -150,7 +151,7 @@ static inline void __down_write(struct r
+ 	tmp = RWSEM_ACTIVE_WRITE_BIAS;
+ 	__asm__ __volatile__(
+ 		"# beginning down_write\n\t"
+-LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
++LOCK	        "  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
+ 		"  testl     %%edx,%%edx\n\t" /* was the count 0 before? */
+ 		"  jnz       2f\n\t" /* jump if we weren't granted the lock */
+ 		"1:\n\t"
+@@ -188,7 +189,7 @@ static inline void __up_read(struct rw_s
+ 	__s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
+ 	__asm__ __volatile__(
+ 		"# beginning __up_read\n\t"
+-LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
++LOCK	        "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
+ 		"  js        2f\n\t" /* jump if the lock is being waited upon */
+ 		"1:\n\t"
+ 		LOCK_SECTION_START("")
+@@ -214,7 +215,7 @@ static inline void __up_write(struct rw_
+ 	__asm__ __volatile__(
+ 		"# beginning __up_write\n\t"
+ 		"  movl      %2,%%edx\n\t"
+-LOCK_PREFIX	"  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
++LOCK	        "  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
+ 		"  jnz       2f\n\t" /* jump if the lock is being waited upon */
+ 		"1:\n\t"
+ 		LOCK_SECTION_START("")
+@@ -239,7 +240,7 @@ static inline void __downgrade_write(str
+ {
+ 	__asm__ __volatile__(
+ 		"# beginning __downgrade_write\n\t"
+-LOCK_PREFIX	"  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
++LOCK	        "  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
+ 		"  js        2f\n\t" /* jump if the lock is being waited upon */
+ 		"1:\n\t"
+ 		LOCK_SECTION_START("")
+@@ -263,7 +264,7 @@ LOCK_PREFIX	"  addl      %2,(%%eax)\n\t"
+ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
+ {
+ 	__asm__ __volatile__(
+-LOCK_PREFIX	"addl %1,%0"
++LOCK	          "addl %1,%0"
+ 		: "=m"(sem->count)
+ 		: "ir"(delta), "m"(sem->count));
+ }
+@@ -276,7 +277,7 @@ static inline int rwsem_atomic_update(in
+ 	int tmp = delta;
+ 
+ 	__asm__ __volatile__(
+-LOCK_PREFIX	"xadd %0,(%2)"
++LOCK  	          "xadd %0,(%2)"
+ 		: "+r"(tmp), "=m"(sem->count)
+ 		: "r"(sem), "m"(sem->count)
+ 		: "memory");
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/smp_alt.h ./include/asm-i386/smp_alt.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/smp_alt.h	1970-01-01 01:00:00.000000000 +0100
++++ ./include/asm-i386/smp_alt.h	2006-02-15 20:45:57.000000000 +0000
+@@ -0,0 +1,32 @@
++#ifndef __ASM_SMP_ALT_H__
++#define __ASM_SMP_ALT_H__
++
++#include <linux/config.h>
++
++#ifdef CONFIG_SMP
++#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
++#define LOCK \
++        "6677: nop\n" \
++	".section __smp_alternatives,\"a\"\n" \
++	".long 6677b\n" \
++	".long 6678f\n" \
++	".previous\n" \
++	".section __smp_replacements,\"a\"\n" \
++	"6678: .byte 1\n" \
++	".byte 1\n" \
++	".byte 0\n" \
++        ".byte 1\n" \
++	".byte -1\n" \
++	"lock\n" \
++	"nop\n" \
++	".previous\n"
++void prepare_for_smp(void);
++void unprepare_for_smp(void);
++#else
++#define LOCK "lock ; "
++#endif
++#else
++#define LOCK ""
++#endif
++
++#endif /* __ASM_SMP_ALT_H__ */
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/spinlock.h ./include/asm-i386/spinlock.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/spinlock.h	2006-01-03 03:21:10.000000000 +0000
++++ ./include/asm-i386/spinlock.h	2006-02-15 20:45:57.000000000 +0000
+@@ -6,6 +6,7 @@
+ #include <asm/page.h>
+ #include <linux/config.h>
+ #include <linux/compiler.h>
++#include <asm/smp_alt.h>
+ 
+ /*
+  * Your basic SMP spinlocks, allowing only a single CPU anywhere
+@@ -23,7 +24,8 @@
+ 
+ #define __raw_spin_lock_string \
+ 	"\n1:\t" \
+-	"lock ; decb %0\n\t" \
++	LOCK \
++	"decb %0\n\t" \
+ 	"jns 3f\n" \
+ 	"2:\t" \
+ 	"rep;nop\n\t" \
+@@ -34,7 +36,8 @@
+ 
+ #define __raw_spin_lock_string_flags \
+ 	"\n1:\t" \
+-	"lock ; decb %0\n\t" \
++	LOCK \
++	"decb %0\n\t" \
+ 	"jns 4f\n\t" \
+ 	"2:\t" \
+ 	"testl $0x200, %1\n\t" \
+@@ -65,10 +68,34 @@ static inline void __raw_spin_lock_flags
+ static inline int __raw_spin_trylock(raw_spinlock_t *lock)
+ {
+ 	char oldval;
++#ifdef CONFIG_SMP_ALTERNATIVES
+ 	__asm__ __volatile__(
+-		"xchgb %b0,%1"
++		"1:movb %1,%b0\n"
++		"movb $0,%1\n"
++		"2:"
++		".section __smp_alternatives,\"a\"\n"
++		".long 1b\n"
++		".long 3f\n"
++		".previous\n"
++		".section __smp_replacements,\"a\"\n"
++		"3: .byte 2b - 1b\n"
++		".byte 5f-4f\n"
++		".byte 0\n"
++		".byte 6f-5f\n"
++		".byte -1\n"
++		"4: xchgb %b0,%1\n"
++		"5: movb %1,%b0\n"
++		"movb $0,%1\n"
++		"6:\n"
++		".previous\n"
+ 		:"=q" (oldval), "=m" (lock->slock)
+ 		:"0" (0) : "memory");
++#else
++	__asm__ __volatile__(
++		"xchgb %b0,%1\n"
++		:"=q" (oldval), "=m" (lock->slock)
++		:"0" (0) : "memory");
++#endif
+ 	return oldval > 0;
+ }
+ 
+@@ -178,12 +205,12 @@ static inline int __raw_write_trylock(ra
+ 
+ static inline void __raw_read_unlock(raw_rwlock_t *rw)
+ {
+-	asm volatile("lock ; incl %0" :"=m" (rw->lock) : : "memory");
++	asm volatile(LOCK "incl %0" :"=m" (rw->lock) : : "memory");
+ }
+ 
+ static inline void __raw_write_unlock(raw_rwlock_t *rw)
+ {
+-	asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ", %0"
++	asm volatile(LOCK "addl $" RW_LOCK_BIAS_STR ", %0"
+ 				 : "=m" (rw->lock) : : "memory");
+ }
+ 
+diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/system.h ./include/asm-i386/system.h
+--- ../pristine-linux-2.6.16-rc3/include/asm-i386/system.h	2006-02-15 20:38:57.000000000 +0000
++++ ./include/asm-i386/system.h	2006-02-15 20:45:57.000000000 +0000
+@@ -5,7 +5,7 @@
+ #include <linux/kernel.h>
+ #include <asm/segment.h>
+ #include <asm/cpufeature.h>
+-#include <linux/bitops.h> /* for LOCK_PREFIX */
++#include <asm/smp_alt.h>
+ 
+ #ifdef __KERNEL__
+ 
+@@ -271,19 +271,19 @@ static inline unsigned long __cmpxchg(vo
+ 	unsigned long prev;
+ 	switch (size) {
+ 	case 1:
+-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
++		__asm__ __volatile__(LOCK "cmpxchgb %b1,%2"
+ 				     : "=a"(prev)
+ 				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ 				     : "memory");
+ 		return prev;
+ 	case 2:
+-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
++		__asm__ __volatile__(LOCK "cmpxchgw %w1,%2"
+ 				     : "=a"(prev)
+ 				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
+ 				     : "memory");
+ 		return prev;
+ 	case 4:
+-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
++		__asm__ __volatile__(LOCK "cmpxchgl %1,%2"
+ 				     : "=a"(prev)
+ 				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
+ 				     : "memory");
+@@ -336,7 +336,7 @@ static inline unsigned long long __cmpxc
+ 				      unsigned long long new)
+ {
+ 	unsigned long long prev;
+-	__asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3"
++	__asm__ __volatile__(LOCK "cmpxchg8b %3"
+ 			     : "=A"(prev)
+ 			     : "b"((unsigned long)new),
+ 			       "c"((unsigned long)(new >> 32)),
+@@ -503,11 +503,55 @@ struct alt_instr { 
+ #endif
+ 
+ #ifdef CONFIG_SMP
++#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
++#define smp_alt_mb(instr)                                           \
++__asm__ __volatile__("6667:\nnop\nnop\nnop\nnop\nnop\nnop\n6668:\n" \
++		     ".section __smp_alternatives,\"a\"\n"          \
++		     ".long 6667b\n"                                \
++                     ".long 6673f\n"                                \
++		     ".previous\n"                                  \
++		     ".section __smp_replacements,\"a\"\n"          \
++		     "6673:.byte 6668b-6667b\n"                     \
++		     ".byte 6670f-6669f\n"                          \
++		     ".byte 6671f-6670f\n"                          \
++                     ".byte 0\n"                                    \
++		     ".byte %c0\n"                                  \
++		     "6669:lock;addl $0,0(%%esp)\n"                 \
++		     "6670:" instr "\n"                             \
++		     "6671:\n"                                      \
++		     ".previous\n"                                  \
++		     :                                              \
++		     : "i" (X86_FEATURE_XMM2)                       \
++		     : "memory")
++#define smp_rmb() smp_alt_mb("lfence")
++#define smp_mb()  smp_alt_mb("mfence")
++#define set_mb(var, value) do {                                     \
++unsigned long __set_mb_temp;                                        \
++__asm__ __volatile__("6667:movl %1, %0\n6668:\n"                    \
++		     ".section __smp_alternatives,\"a\"\n"          \
++		     ".long 6667b\n"                                \
++		     ".long 6673f\n"                                \
++		     ".previous\n"                                  \
++		     ".section __smp_replacements,\"a\"\n"          \
++		     "6673: .byte 6668b-6667b\n"                    \
++		     ".byte 6670f-6669f\n"                          \
++		     ".byte 0\n"                                    \
++		     ".byte 6671f-6670f\n"                          \
++		     ".byte -1\n"                                   \
++		     "6669: xchg %1, %0\n"                          \
++		     "6670:movl %1, %0\n"                           \
++		     "6671:\n"                                      \
++		     ".previous\n"                                  \
++		     : "=m" (var), "=r" (__set_mb_temp)             \
++		     : "1" (value)                                  \
++		     : "memory"); } while (0)
++#else
+ #define smp_mb()	mb()
+ #define smp_rmb()	rmb()
++#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
++#endif
+ #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()

linux-2.6-xen-vsyscall_base.patch:
 asm-offsets.c |    1 -
 1 files changed, 1 deletion(-)

Index: linux-2.6-xen-vsyscall_base.patch
===================================================================
RCS file: linux-2.6-xen-vsyscall_base.patch
diff -N linux-2.6-xen-vsyscall_base.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-vsyscall_base.patch	6 Mar 2006 16:31:49 -0000	1.2
@@ -0,0 +1,18 @@
+Xen's patches to make the fixmap area movable cause conflicts with non-xen
+builds, as the FIX_VSYSCALL define is no longer constant so cannot
+sensibly be handled by asm-offsets.c.
+
+But with execshield/vdso, we've got per-process maps to get to this memory,
+so we don't actually need the fixmap area's base address from assembly any
+more.  Nuke it.
+
+--sct
+
+--- linux-2.6.15.i586/arch/i386/kernel/asm-offsets.c.vsys	2006-03-02 12:13:23.000000000 -0500
++++ linux-2.6.15.i586/arch/i386/kernel/asm-offsets.c	2006-03-02 12:13:33.000000000 -0500
+@@ -71,5 +71,4 @@
+ #endif
+ 
+ 	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+-	DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL));
+ }

linux-2.6-xen.patch:
 arch/i386/Kconfig                                   |   98 
 arch/i386/Kconfig.cpu                               |    2 
 arch/i386/Makefile                                  |   18 
 arch/i386/boot-xen/Makefile                         |   21 
 arch/i386/kernel/Makefile                           |   33 
 arch/i386/kernel/acpi/Makefile                      |    4 
 arch/i386/kernel/acpi/boot-xen.c                    | 1161 ++++++++
 arch/i386/kernel/apic-xen.c                         |  140 +
 arch/i386/kernel/asm-offsets.c                      |    5 
 arch/i386/kernel/cpu/Makefile                       |    5 
 arch/i386/kernel/cpu/common-xen.c                   |  719 +++++
 arch/i386/kernel/cpu/mtrr/Makefile                  |    7 
 arch/i386/kernel/cpu/mtrr/main-xen.c                |  187 +
 arch/i386/kernel/early_printk-xen.c                 |    2 
 arch/i386/kernel/entry-xen.S                        |  857 ++++++
 arch/i386/kernel/fixup.c                            |   95 
 arch/i386/kernel/head-xen.S                         |  173 +
 arch/i386/kernel/init_task-xen.c                    |   51 
 arch/i386/kernel/io_apic-xen.c                      | 2730 ++++++++++++++++++++
 arch/i386/kernel/ioport-xen.c                       |  122 
 arch/i386/kernel/irq-xen.c                          |  306 ++
 arch/i386/kernel/ldt-xen.c                          |  269 +
 arch/i386/kernel/microcode-xen.c                    |  164 +
 arch/i386/kernel/mpparse-xen.c                      | 1188 ++++++++
 arch/i386/kernel/pci-dma-xen.c                      |  344 ++
 arch/i386/kernel/process-xen.c                      |  833 ++++++
 arch/i386/kernel/quirks-xen.c                       |   48 
 arch/i386/kernel/setup-xen.c                        | 1888 +++++++++++++
 arch/i386/kernel/smp-xen.c                          |  617 ++++
 arch/i386/kernel/swiotlb.c                          |  674 ++++
 arch/i386/kernel/sysenter.c                         |   90 
 arch/i386/kernel/time-xen.c                         | 1067 +++++++
 arch/i386/kernel/traps-xen.c                        | 1094 ++++++++
 arch/i386/kernel/vm86.c                             |    8 
 arch/i386/kernel/vmlinux.lds.S                      |    4 
 arch/i386/kernel/vsyscall-note-xen.S                |   32 
 arch/i386/kernel/vsyscall.S                         |    2 
 arch/i386/mach-xen/Makefile                         |    5 
 arch/i386/mach-xen/setup.c                          |   37 
 arch/i386/mm/Makefile                               |    8 
 arch/i386/mm/fault-xen.c                            |  617 ++++
 arch/i386/mm/highmem-xen.c                          |  123 
 arch/i386/mm/hypervisor.c                           |  471 +++
 arch/i386/mm/init-xen.c                             |  846 ++++++
 arch/i386/mm/ioremap-xen.c                          |  462 +++
 arch/i386/mm/pgtable-xen.c                          |  646 ++++
 arch/i386/mm/pgtable.c                              |   63 
 arch/i386/pci/Makefile                              |    9 
 arch/i386/pci/irq-xen.c                             | 1202 ++++++++
 arch/i386/pci/pcifront.c                            |   55 
 arch/i386/power/Makefile                            |    4 
 arch/ia64/Kconfig                                   |   43 
 arch/ia64/Makefile                                  |   10 
 arch/ia64/hp/sim/Makefile                           |    2 
 arch/ia64/kernel/entry.S                            |   32 
 arch/ia64/kernel/head.S                             |    4 
 arch/ia64/kernel/pal.S                              |    5 
 arch/ia64/kernel/sal.c                              |    3 
 arch/ia64/kernel/setup.c                            |    4 
 arch/ia64/xen-mkbuildtree-post                      |    2 
 arch/ia64/xen-mkbuildtree-pre                       |   50 
 arch/ia64/xen/Makefile                              |    5 
 arch/ia64/xen/drivers/Makefile                      |   20 
 arch/ia64/xen/drivers/README                        |    2 
 arch/ia64/xen/drivers/coreMakefile                  |   24 
 arch/ia64/xen/drivers/evtchn_ia64.c                 |  266 +
 arch/ia64/xen/drivers/patches/blkback.c.patch       |   33 
 arch/ia64/xen/drivers/patches/console.c.patch       |   11 
 arch/ia64/xen/drivers/patches/devmem.c.patch        |    2 
 arch/ia64/xen/drivers/patches/gnttab.c.patch        |   33 
 arch/ia64/xen/drivers/patches/privcmd.c.patch       |   30 
 arch/ia64/xen/drivers/xenia64_init.c                |   55 
 arch/ia64/xen/hypercall.S                           |  323 ++
 arch/ia64/xen/xen_ksyms.c                           |   12 
 arch/ia64/xen/xenconsole.c                          |   19 
 arch/ia64/xen/xenentry.S                            |  850 ++++++
 arch/ia64/xen/xenhpski.c                            |   19 
 arch/ia64/xen/xenivt.S                              | 2044 ++++++++++++++
 arch/ia64/xen/xenminstate.h                         |  367 ++
 arch/ia64/xen/xenpal.S                              |   73 
 arch/ia64/xen/xensetup.S                            |   33 
 arch/um/kernel/physmem.c                            |    4 
 arch/x86_64/Kconfig                                 |   60 
 arch/x86_64/Makefile                                |   16 
 arch/x86_64/ia32/Makefile                           |   20 
 arch/x86_64/ia32/ia32entry-xen.S                    |  721 +++++
 arch/x86_64/ia32/syscall32-xen.c                    |  128 
 arch/x86_64/ia32/syscall32_syscall-xen.S            |   28 
 arch/x86_64/ia32/vsyscall-int80.S                   |   58 
 arch/x86_64/ia32/vsyscall-sigreturn.S               |    2 
 arch/x86_64/kernel/Makefile                         |   18 
 arch/x86_64/kernel/acpi/Makefile                    |    1 
 arch/x86_64/kernel/apic-xen.c                       |  200 +
 arch/x86_64/kernel/asm-offsets.c                    |    2 
 arch/x86_64/kernel/e820-xen.c                       |  744 +++++
 arch/x86_64/kernel/early_printk-xen.c               |  306 ++
 arch/x86_64/kernel/entry-xen.S                      | 1140 ++++++++
 arch/x86_64/kernel/genapic-xen.c                    |  144 +
 arch/x86_64/kernel/genapic_xen.c                    |  162 +
 arch/x86_64/kernel/head-xen.S                       |  156 +
 arch/x86_64/kernel/head64-xen.c                     |  140 +
 arch/x86_64/kernel/init_task.c                      |    3 
 arch/x86_64/kernel/io_apic-xen.c                    | 2231 ++++++++++++++++
 arch/x86_64/kernel/ioport-xen.c                     |   58 
 arch/x86_64/kernel/irq-xen.c                        |  168 +
 arch/x86_64/kernel/ldt-xen.c                        |  282 ++
 arch/x86_64/kernel/mpparse-xen.c                    | 1005 +++++++
 arch/x86_64/kernel/pci-swiotlb-xen.c                |   54 
 arch/x86_64/kernel/process-xen.c                    |  810 +++++
 arch/x86_64/kernel/setup-xen.c                      | 1635 +++++++++++
 arch/x86_64/kernel/setup64-xen.c                    |  360 ++
 arch/x86_64/kernel/smp-xen.c                        |  596 ++++
 arch/x86_64/kernel/traps-xen.c                      | 1023 +++++++
 arch/x86_64/kernel/vsyscall-xen.c                   |  239 +
 arch/x86_64/kernel/x8664_ksyms-xen.c                |  172 +
 arch/x86_64/kernel/xen_entry.S                      |   41 
 arch/x86_64/mm/Makefile                             |   10 
 arch/x86_64/mm/fault-xen.c                          |  595 ++++
 arch/x86_64/mm/init-xen.c                           | 1107 ++++++++
 arch/x86_64/mm/pageattr-xen.c                       |  392 ++
 arch/x86_64/pci/Makefile                            |   12 
 drivers/Makefile                                    |    1 
 drivers/acpi/Kconfig                                |    3 
 drivers/acpi/tables.c                               |    7 
 drivers/char/mem.c                                  |    6 
 drivers/char/tpm/Kconfig                            |   14 
 drivers/char/tpm/Makefile                           |    1 
 drivers/char/tpm/tpm.c                              |   44 
 drivers/char/tpm/tpm.h                              |    7 
 drivers/char/tpm/tpm_xen.c                          |  536 +++
 drivers/char/tty_io.c                               |    7 
 drivers/firmware/Kconfig                            |    2 
 drivers/pci/Kconfig                                 |    1 
 drivers/serial/Kconfig                              |    1 
 drivers/video/Kconfig                               |    2 
 drivers/xen/Kconfig                                 |  200 +
 drivers/xen/Makefile                                |   22 
 drivers/xen/balloon/Makefile                        |    2 
 drivers/xen/balloon/balloon.c                       |  585 ++++
 drivers/xen/blkback/Makefile                        |    3 
 drivers/xen/blkback/blkback.c                       |  596 ++++
 drivers/xen/blkback/common.h                        |  123 
 drivers/xen/blkback/interface.c                     |  164 +
 drivers/xen/blkback/vbd.c                           |  102 
 drivers/xen/blkback/xenbus.c                        |  421 +++
 drivers/xen/blkfront/Makefile                       |    5 
 drivers/xen/blkfront/blkfront.c                     |  834 ++++++
 drivers/xen/blkfront/block.h                        |  162 +
 drivers/xen/blkfront/vbd.c                          |  323 ++
 drivers/xen/blktap/Makefile                         |    3 
 drivers/xen/blktap/blktap.c                         |  910 ++++++
 drivers/xen/blktap/common.h                         |  110 
 drivers/xen/blktap/interface.c                      |  146 +
 drivers/xen/blktap/xenbus.c                         |  234 +
 drivers/xen/char/Makefile                           |    2 
 drivers/xen/char/mem.c                              |  156 +
 drivers/xen/console/Makefile                        |    2 
 drivers/xen/console/console.c                       |  647 ++++
 drivers/xen/console/xencons_ring.c                  |  125 
 drivers/xen/core/Makefile                           |    9 
 drivers/xen/core/evtchn.c                           |  823 ++++++
 drivers/xen/core/features.c                         |   29 
 drivers/xen/core/gnttab.c                           |  429 +++
 drivers/xen/core/reboot.c                           |  442 +++
 drivers/xen/core/skbuff.c                           |  144 +
 drivers/xen/core/smpboot.c                          |  464 +++
 drivers/xen/core/xen_proc.c                         |   29 
 drivers/xen/evtchn/Makefile                         |    2 
 drivers/xen/evtchn/evtchn.c                         |  459 +++
 drivers/xen/net_driver_util.c                       |   68 
 drivers/xen/netback/Makefile                        |    5 
 drivers/xen/netback/common.h                        |  110 
 drivers/xen/netback/interface.c                     |  320 ++
 drivers/xen/netback/loopback.c                      |  231 +
 drivers/xen/netback/netback.c                       |  835 ++++++
 drivers/xen/netback/xenbus.c                        |  327 ++
 drivers/xen/netfront/Makefile                       |    4 
 drivers/xen/netfront/netfront.c                     | 1504 +++++++++++
 drivers/xen/pciback/Makefile                        |   10 
 drivers/xen/pciback/conf_space.c                    |  324 ++
 drivers/xen/pciback/conf_space.h                    |   97 
 drivers/xen/pciback/conf_space_header.c             |  269 +
 drivers/xen/pciback/passthrough.c                   |  116 
 drivers/xen/pciback/pci_stub.c                      |  377 ++
 drivers/xen/pciback/pciback.h                       |   73 
 drivers/xen/pciback/pciback_ops.c                   |   84 
 drivers/xen/pciback/vpci.c                          |  163 +
 drivers/xen/pciback/xenbus.c                        |  439 +++
 drivers/xen/pcifront/Makefile                       |    7 
 drivers/xen/pcifront/pci.c                          |   44 
 drivers/xen/pcifront/pci_op.c                       |  245 +
 drivers/xen/pcifront/pcifront.h                     |   40 
 drivers/xen/pcifront/xenbus.c                       |  295 ++
 drivers/xen/privcmd/Makefile                        |    2 
 drivers/xen/privcmd/privcmd.c                       |  302 ++
 drivers/xen/tpmback/Makefile                        |    4 
 drivers/xen/tpmback/common.h                        |   91 
 drivers/xen/tpmback/interface.c                     |  203 +
 drivers/xen/tpmback/tpmback.c                       | 1118 ++++++++
 drivers/xen/tpmback/xenbus.c                        |  333 ++
 drivers/xen/tpmfront/Makefile                       |    2 
 drivers/xen/tpmfront/tpmfront.c                     |  729 +++++
 drivers/xen/tpmfront/tpmfront.h                     |   40 
 drivers/xen/util.c                                  |   80 
 drivers/xen/xenbus/Makefile                         |    8 
 drivers/xen/xenbus/xenbus_client.c                  |  403 ++
 drivers/xen/xenbus/xenbus_comms.c                   |  203 +
 drivers/xen/xenbus/xenbus_comms.h                   |   50 
 drivers/xen/xenbus/xenbus_dev.c                     |  238 +
 drivers/xen/xenbus/xenbus_probe.c                   | 1015 +++++++
 drivers/xen/xenbus/xenbus_xs.c                      |  821 ++++++
 fs/Kconfig                                          |    1 
 include/asm-i386/a.out.h                            |    2 
 include/asm-i386/apic.h                             |    2 
 include/asm-i386/elf.h                              |    7 
 include/asm-i386/fixmap.h                           |   13 
 include/asm-i386/mach-xen/asm/agp.h                 |   37 
 include/asm-i386/mach-xen/asm/desc.h                |  164 +
 include/asm-i386/mach-xen/asm/dma-mapping.h         |  156 +
 include/asm-i386/mach-xen/asm/fixmap.h              |  158 +
 include/asm-i386/mach-xen/asm/floppy.h              |  147 +
 include/asm-i386/mach-xen/asm/highmem.h             |   81 
 include/asm-i386/mach-xen/asm/hw_irq.h              |   73 
 include/asm-i386/mach-xen/asm/hypercall.h           |  323 ++
 include/asm-i386/mach-xen/asm/hypervisor.h          |  163 +
 include/asm-i386/mach-xen/asm/io.h                  |  401 ++
 include/asm-i386/mach-xen/asm/kmap_types.h          |   32 
 include/asm-i386/mach-xen/asm/mmu.h                 |   21 
 include/asm-i386/mach-xen/asm/mmu_context.h         |  105 
 include/asm-i386/mach-xen/asm/page.h                |  326 ++
 include/asm-i386/mach-xen/asm/param.h               |   24 
 include/asm-i386/mach-xen/asm/pci.h                 |  154 +
 include/asm-i386/mach-xen/asm/pgalloc.h             |   64 
 include/asm-i386/mach-xen/asm/pgtable-2level-defs.h |   21 
 include/asm-i386/mach-xen/asm/pgtable-2level.h      |   83 
 include/asm-i386/mach-xen/asm/pgtable-3level-defs.h |   25 
 include/asm-i386/mach-xen/asm/pgtable-3level.h      |  181 +
 include/asm-i386/mach-xen/asm/pgtable.h             |  512 +++
 include/asm-i386/mach-xen/asm/processor.h           |  762 +++++
 include/asm-i386/mach-xen/asm/ptrace.h              |   90 
 include/asm-i386/mach-xen/asm/scatterlist.h         |   22 
 include/asm-i386/mach-xen/asm/segment.h             |  117 
 include/asm-i386/mach-xen/asm/setup.h               |   66 
 include/asm-i386/mach-xen/asm/smp.h                 |  103 
 include/asm-i386/mach-xen/asm/spinlock.h            |  217 +
 include/asm-i386/mach-xen/asm/swiotlb.h             |   43 
 include/asm-i386/mach-xen/asm/synch_bitops.h        |  141 +
 include/asm-i386/mach-xen/asm/system.h              |  679 ++++
 include/asm-i386/mach-xen/asm/tlbflush.h            |  102 
 include/asm-i386/mach-xen/asm/vga.h                 |   20 
 include/asm-i386/mach-xen/irq_vectors.h             |  125 
 include/asm-i386/mach-xen/mach_traps.h              |   33 
 include/asm-i386/mach-xen/setup_arch_post.h         |   50 
 include/asm-i386/mach-xen/setup_arch_pre.h          |    5 
 include/asm-i386/page.h                             |    4 
 include/asm-i386/spinlock.h                         |    6 
 include/asm-i386/system.h                           |    2 
 include/asm-ia64/fixmap.h                           |    2 
 include/asm-ia64/gcc_intrin.h                       |   60 
 include/asm-ia64/hypercall.h                        |  500 +++
 include/asm-ia64/hypervisor.h                       |   70 
 include/asm-ia64/intel_intrin.h                     |   68 
 include/asm-ia64/pal.h                              |    1 
 include/asm-ia64/privop.h                           |   59 
 include/asm-ia64/processor.h                        |    1 
 include/asm-ia64/synch_bitops.h                     |   61 
 include/asm-ia64/system.h                           |    4 
 include/asm-ia64/xen/privop.h                       |  272 +
 include/asm-um/page.h                               |    2 
 include/asm-x86_64/apic.h                           |    2 
 include/asm-x86_64/mach-xen/asm/arch_hooks.h        |   27 
 include/asm-x86_64/mach-xen/asm/bootsetup.h         |   42 
 include/asm-x86_64/mach-xen/asm/desc.h              |  263 +
 include/asm-x86_64/mach-xen/asm/dma-mapping.h       |  191 +
 include/asm-x86_64/mach-xen/asm/fixmap.h            |  111 
 include/asm-x86_64/mach-xen/asm/floppy.h            |  206 +
 include/asm-x86_64/mach-xen/asm/hw_irq.h            |  141 +
 include/asm-x86_64/mach-xen/asm/hypercall.h         |  323 ++
 include/asm-x86_64/mach-xen/asm/hypervisor.h        |    2 
 include/asm-x86_64/mach-xen/asm/io.h                |  359 ++
 include/asm-x86_64/mach-xen/asm/irq.h               |   39 
 include/asm-x86_64/mach-xen/asm/mmu.h               |   33 
 include/asm-x86_64/mach-xen/asm/mmu_context.h       |  134 
 include/asm-x86_64/mach-xen/asm/nmi.h               |   75 
 include/asm-x86_64/mach-xen/asm/page.h              |  317 ++
 include/asm-x86_64/mach-xen/asm/pci.h               |  174 +
 include/asm-x86_64/mach-xen/asm/pgalloc.h           |  199 +
 include/asm-x86_64/mach-xen/asm/pgtable.h           |  560 ++++
 include/asm-x86_64/mach-xen/asm/processor.h         |  503 +++
 include/asm-x86_64/mach-xen/asm/ptrace.h            |  125 
 include/asm-x86_64/mach-xen/asm/smp.h               |  152 +
 include/asm-x86_64/mach-xen/asm/synch_bitops.h      |    2 
 include/asm-x86_64/mach-xen/asm/system.h            |  434 +++
 include/asm-x86_64/mach-xen/asm/timer.h             |   67 
 include/asm-x86_64/mach-xen/asm/tlbflush.h          |  104 
 include/asm-x86_64/mach-xen/asm/vga.h               |   20 
 include/asm-x86_64/mach-xen/asm/xor.h               |  328 ++
 include/asm-x86_64/mach-xen/irq_vectors.h           |  123 
 include/asm-x86_64/mach-xen/mach_time.h             |  122 
 include/asm-x86_64/mach-xen/mach_timer.h            |   48 
 include/asm-x86_64/mach-xen/setup_arch_post.h       |   52 
 include/asm-x86_64/mach-xen/setup_arch_pre.h        |    5 
 include/linux/gfp.h                                 |    6 
 include/linux/highmem.h                             |    6 
 include/linux/irq.h                                 |    3 
 include/linux/mm.h                                  |   13 
 include/linux/skbuff.h                              |   13 
 include/xen/balloon.h                               |   70 
 include/xen/driver_util.h                           |   26 
 include/xen/evtchn.h                                |  123 
 include/xen/features.h                              |   20 
 include/xen/foreign_page.h                          |   40 
 include/xen/gnttab.h                                |  120 
 include/xen/interface/COPYING                       |   28 
 include/xen/interface/acm.h                         |  181 +
 include/xen/interface/acm_ops.h                     |   96 
 include/xen/interface/arch-ia64.h                   |  314 ++
 include/xen/interface/arch-x86_32.h                 |  158 +
 include/xen/interface/arch-x86_64.h                 |  243 +
 include/xen/interface/dom0_ops.h                    |  488 +++
 include/xen/interface/event_channel.h               |  203 +
 include/xen/interface/features.h                    |   53 
 include/xen/interface/grant_table.h                 |  306 ++
 include/xen/interface/hvm/hvm_info_table.h          |   24 
 include/xen/interface/hvm/ioreq.h                   |   93 
 include/xen/interface/hvm/vmx_assist.h              |   97 
 include/xen/interface/io/blkif.h                    |   85 
 include/xen/interface/io/console.h                  |   33 
 include/xen/interface/io/netif.h                    |   76 
 include/xen/interface/io/pciif.h                    |   55 
 include/xen/interface/io/ring.h                     |  270 +
 include/xen/interface/io/tpmif.h                    |   56 
 include/xen/interface/io/xenbus.h                   |   44 
 include/xen/interface/io/xs_wire.h                  |   97 
 include/xen/interface/memory.h                      |  153 +
 include/xen/interface/nmi.h                         |   54 
 include/xen/interface/physdev.h                     |   70 
 include/xen/interface/sched.h                       |   60 
 include/xen/interface/sched_ctl.h                   |   68 
 include/xen/interface/trace.h                       |   90 
 include/xen/interface/vcpu.h                        |  119 
 include/xen/interface/version.h                     |   64 
 include/xen/interface/xen.h                         |  463 +++
 include/xen/net_driver_util.h                       |   56 
 include/xen/pcifront.h                              |   39 
 include/xen/public/evtchn.h                         |   98 
 include/xen/public/privcmd.h                        |   91 
 include/xen/public/xenstored.h                      |   89 
 include/xen/tpmfe.h                                 |   40 
 include/xen/xen_proc.h                              |   23 
 include/xen/xenbus.h                                |  298 ++
 include/xen/xencons.h                               |   14 
 kernel/Kconfig.preempt                              |    1 
 kernel/irq/manage.c                                 |   84 
 lib/Kconfig.debug                                   |    2 
 lib/Makefile                                        |    3 
 mm/Kconfig                                          |    3 
 mm/highmem.c                                        |   11 
 mm/memory.c                                         |  112 
 mm/mmap.c                                           |    4 
 mm/page_alloc.c                                     |    6 
 net/core/dev.c                                      |   50 
 net/core/skbuff.c                                   |   41 
 scripts/Makefile.xen                                |   14 
 364 files changed, 77454 insertions(+), 245 deletions(-)

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.3 -r 1.4 linux-2.6-xen.patch
Index: linux-2.6-xen.patch
===================================================================
RCS file: linux-2.6-xen.patch
diff -N linux-2.6-xen.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen.patch	6 Mar 2006 16:31:49 -0000	1.4
@@ -0,0 +1,80787 @@
+diff -Nru -p --exclude='.*' ref-linux-2.6.16-rc5/arch/i386/boot-xen/Makefile linux-2.6.16-rc5-xen0/arch/i386/boot-xen/Makefile
+--- ref-linux-2.6.16-rc5/arch/i386/boot-xen/Makefile	1969-12-31 19:00:00.000000000 -0500
++++ linux-2.6.16-rc5-xen0/arch/i386/boot-xen/Makefile	2006-03-01 11:09:36.000000000 -0500
+@@ -0,0 +1,21 @@
++
++OBJCOPYFLAGS := -g --strip-unneeded
++
++vmlinuz: vmlinux-stripped FORCE
++	$(call if_changed,gzip)
++
++vmlinux-stripped: vmlinux FORCE
++	$(call if_changed,objcopy)
++
++INSTALL_ROOT := $(patsubst %/boot,%,$(INSTALL_PATH))
++
++XINSTALL_NAME ?= $(KERNELRELEASE)
++install:
++	mkdir -p $(INSTALL_ROOT)/boot
++	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
++	rm -f $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
++	install -m0644 vmlinuz $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
++	install -m0644 vmlinux $(INSTALL_ROOT)/boot/vmlinux-syms-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
++	install -m0664 .config $(INSTALL_ROOT)/boot/config-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
++	install -m0664 System.map $(INSTALL_ROOT)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
++	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
+diff -Nru -p --exclude='.*' ref-linux-2.6.16-rc5/arch/i386/Kconfig linux-2.6.16-rc5-xen0/arch/i386/Kconfig
+--- ref-linux-2.6.16-rc5/arch/i386/Kconfig	2006-03-01 11:12:36.000000000 -0500
++++ linux-2.6.16-rc5-xen0/arch/i386/Kconfig	2006-03-01 11:09:36.000000000 -0500
+@@ -58,6 +58,15 @@ config X86_PC
+ 	help
+ 	  Choose this option if your computer is a standard PC or compatible.
+ 
++config X86_XEN
++	bool "Xen-compatible"
++	select X86_UP_APIC if !SMP && XEN_PRIVILEGED_GUEST
++	select X86_UP_IOAPIC if !SMP && XEN_PRIVILEGED_GUEST
++	select SWIOTLB
++	help
++	  Choose this option if you plan to run this kernel on top of the
++	  Xen Hypervisor.
++
+ config X86_ELAN
+ 	bool "AMD Elan"
+ 	help
+@@ -159,6 +168,7 @@ source "arch/i386/Kconfig.cpu"
+ 
+ config HPET_TIMER
+ 	bool "HPET Timer Support"
++	depends on !X86_XEN
+ 	help
+ 	  This enables the use of the HPET for the kernel's internal timer.
+ 	  HPET is the next generation timer replacing legacy 8254s.
+@@ -231,7 +241,7 @@ config NR_CPUS
+ 
+ config SCHED_SMT
+ 	bool "SMT (Hyperthreading) scheduler support"
+-	depends on SMP
++	depends on SMP && !X86_XEN
+ 	default off
+ 	help
+ 	  SMT scheduler support improves the CPU scheduler's decision making
+@@ -243,7 +253,7 @@ source "kernel/Kconfig.preempt"
+ 
+ config X86_UP_APIC
+ 	bool "Local APIC support on uniprocessors"
+-	depends on !SMP && !(X86_VISWS || X86_VOYAGER)
++	depends on !SMP && !(X86_VISWS || X86_VOYAGER || XEN_UNPRIVILEGED_GUEST)
+ 	help
+ 	  A local APIC (Advanced Programmable Interrupt Controller) is an
+ 	  integrated interrupt controller in the CPU. If you have a single-CPU
+@@ -268,12 +278,12 @@ config X86_UP_IOAPIC
+ 
+ config X86_LOCAL_APIC
+ 	bool
+-	depends on X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER)
++	depends on X86_UP_APIC || ((X86_VISWS || SMP) && !(X86_VOYAGER || XEN_UNPRIVILEGED_GUEST))
+ 	default y
+ 
+ config X86_IO_APIC
+ 	bool
+-	depends on X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER))
++	depends on X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER || XEN_UNPRIVILEGED_GUEST))
+ 	default y
+ 
+ config X86_VISWS_APIC
+@@ -281,9 +291,14 @@ config X86_VISWS_APIC
+ 	depends on X86_VISWS
+ 	default y
+ 
++config X86_TSC
++	bool
++	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ && !X86_XEN
++	default y
++
+ config X86_MCE
+ 	bool "Machine Check Exception"
+-	depends on !X86_VOYAGER
++	depends on !(X86_VOYAGER || X86_XEN)
+ 	---help---
+ 	  Machine Check Exception support allows the processor to notify the
+ 	  kernel if it detects a problem (e.g. overheating, component failure).
+@@ -373,6 +388,7 @@ config X86_REBOOTFIXUPS
+ 
+ config MICROCODE
+ 	tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
++	depends on !XEN_UNPRIVILEGED_GUEST
+ 	---help---
+ 	  If you say Y here and also to "/dev file system support" in the
+ 	  'File systems' section, you will be able to update the microcode on
+@@ -390,6 +406,7 @@ config MICROCODE
+ 
+ config X86_MSR
+ 	tristate "/dev/cpu/*/msr - Model-specific register support"
++	depends on !X86_XEN
+ 	help
+ 	  This device gives privileged processes access to the x86
+ 	  Model-Specific Registers (MSRs).  It is a character device with
+@@ -405,6 +422,10 @@ config X86_CPUID
+ 	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
+ 	  /dev/cpu/31/cpuid.
+ 
++config SWIOTLB
++	bool
++	default n
++
+ source "drivers/firmware/Kconfig"
+ 
+ choice
+@@ -573,7 +594,7 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
+ 
+ config HIGHPTE
+ 	bool "Allocate 3rd-level pagetables from highmem"
+-	depends on HIGHMEM4G || HIGHMEM64G
++	depends on (HIGHMEM4G || HIGHMEM64G) && !X86_XEN
+ 	help
+ 	  The VM uses one page table entry for each page of physical memory.
+ 	  For systems with a lot of RAM, this can be wasteful of precious
+@@ -582,6 +603,7 @@ config HIGHPTE
+ 
+ config MATH_EMULATION
+ 	bool "Math emulation"
++	depends on !X86_XEN
+ 	---help---
+ 	  Linux can emulate a math coprocessor (used for floating point
+ 	  operations) if you don't have one. 486DX and Pentium processors have
+@@ -607,6 +629,8 @@ config MATH_EMULATION
+ 
+ config MTRR
+ 	bool "MTRR (Memory Type Range Register) support"
++	depends on !XEN_UNPRIVILEGED_GUEST
++	default y if X86_XEN
+ 	---help---
+ 	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
+ 	  the Memory Type Range Registers (MTRRs) may be used to control
+@@ -641,7 +665,7 @@ config MTRR
+ 
+ config EFI
+ 	bool "Boot from EFI support (EXPERIMENTAL)"
+-	depends on ACPI
++	depends on ACPI && !X86_XEN
+ 	default n
+ 	---help---
+ 	This enables the the kernel to boot on EFI platforms using
+@@ -659,7 +683,7 @@ config EFI
+ 
+ config IRQBALANCE
+  	bool "Enable kernel irq balancing"
+-	depends on SMP && X86_IO_APIC
++	depends on SMP && X86_IO_APIC && !X86_XEN
+ 	default y
+ 	help
+  	  The default yes will allow the kernel to do irq load balancing.
+@@ -702,7 +726,7 @@ source kernel/Kconfig.hz
+ 
+ config KEXEC
+ 	bool "kexec system call (EXPERIMENTAL)"
+-	depends on EXPERIMENTAL
++	depends on EXPERIMENTAL && !X86_XEN
+ 	help
+ 	  kexec is a system call that implements the ability to shutdown your
+ 	  current kernel, and to start another kernel.  It is like a reboot
+@@ -756,6 +780,7 @@ config HOTPLUG_CPU
+ config DOUBLEFAULT
+ 	default y
+ 	bool "Enable doublefault exception handler" if EMBEDDED
++	depends on !X86_NO_TSS
+ 	help
+           This option allows trapping of rare doublefault exceptions that
+           would otherwise cause a system to silently reboot. Disabling this
+@@ -766,18 +791,20 @@ endmenu
+ 
+ 
+ menu "Power management options (ACPI, APM)"
[...80394 lines suppressed...]
+@@ -418,7 +418,8 @@ static void __free_pages_ok(struct page 
+ 	int i;
+ 	int reserved = 0;
+ 
+-	arch_free_page(page, order);
++	if (arch_free_page(page, order))
++		return;
+ 	if (!PageHighMem(page))
+ 		mutex_debug_check_no_locks_freed(page_address(page),
+ 						 PAGE_SIZE<<order);
+@@ -712,7 +713,8 @@ static void fastcall free_hot_cold_page(
+ 	struct per_cpu_pages *pcp;
+ 	unsigned long flags;
+ 
+-	arch_free_page(page, 0);
++	if (arch_free_page(page, 0))
++		return;
+ 
+ 	if (PageAnon(page))
+ 		page->mapping = NULL;
+diff -Nru -p --exclude='.*' ref-linux-2.6.16-rc5/net/core/dev.c linux-2.6.16-rc5-xen0/net/core/dev.c
+--- ref-linux-2.6.16-rc5/net/core/dev.c	2006-03-01 11:12:32.000000000 -0500
++++ linux-2.6.16-rc5-xen0/net/core/dev.c	2006-03-01 11:09:38.000000000 -0500
+@@ -116,6 +116,12 @@
+ #endif	/* CONFIG_NET_RADIO */
+ #include <asm/current.h>
+ 
++#ifdef CONFIG_XEN
++#include <net/ip.h>
++#include <linux/tcp.h>
++#include <linux/udp.h>
++#endif
++
+ /*
+  *	The list of packet types we will receive (as opposed to discard)
+  *	and the routines to invoke.
+@@ -1260,6 +1266,37 @@ int dev_queue_xmit(struct sk_buff *skb)
+ 	    __skb_linearize(skb, GFP_ATOMIC))
+ 		goto out_kfree_skb;
+ 
++#ifdef CONFIG_XEN
++	/* If a checksum-deferred packet is forwarded to a device that needs a
++	 * checksum, correct the pointers and force checksumming.
++	 */
++	if (skb->proto_csum_blank) {
++		if (skb->protocol != htons(ETH_P_IP))
++			goto out_kfree_skb;
++		skb->h.raw = (unsigned char *)skb->nh.iph + 4*skb->nh.iph->ihl;
++		if (skb->h.raw >= skb->tail)
++			goto out_kfree_skb;
++		switch (skb->nh.iph->protocol) {
++		case IPPROTO_TCP:
++			skb->csum = offsetof(struct tcphdr, check);
++			break;
++		case IPPROTO_UDP:
++			skb->csum = offsetof(struct udphdr, check);
++			break;
++		default:
++			if (net_ratelimit())
++				printk(KERN_ERR "Attempting to checksum a non-"
++				       "TCP/UDP packet, dropping a protocol"
++				       " %d packet", skb->nh.iph->protocol);
++			rc = -EPROTO;
++			goto out_kfree_skb;
++		}
++		if ((skb->h.raw + skb->csum + 2) > skb->tail)
++			goto out_kfree_skb;
++		skb->ip_summed = CHECKSUM_HW;
++	}
++#endif
++
+ 	/* If packet is not checksummed and device does not support
+ 	 * checksumming for this protocol, complete checksumming here.
+ 	 */
+@@ -1609,6 +1646,19 @@ int netif_receive_skb(struct sk_buff *sk
+ 	}
+ #endif
+ 
++#ifdef CONFIG_XEN
++	switch (skb->ip_summed) {
++	case CHECKSUM_UNNECESSARY:
++		skb->proto_csum_valid = 1;
++		break;
++	case CHECKSUM_HW:
++		/* XXX Implement me. */
++	default:
++		skb->proto_csum_valid = 0;
++		break;
++	}
++#endif
++
+ 	list_for_each_entry_rcu(ptype, &ptype_all, list) {
+ 		if (!ptype->dev || ptype->dev == skb->dev) {
+ 			if (pt_prev) 
+diff -Nru -p --exclude='.*' ref-linux-2.6.16-rc5/net/core/skbuff.c linux-2.6.16-rc5-xen0/net/core/skbuff.c
+--- ref-linux-2.6.16-rc5/net/core/skbuff.c	2006-03-01 11:12:32.000000000 -0500
++++ linux-2.6.16-rc5-xen0/net/core/skbuff.c	2006-03-01 11:09:39.000000000 -0500
+@@ -132,6 +132,7 @@ void skb_under_panic(struct sk_buff *skb
+  *	Buffers may only be allocated from interrupts using a @gfp_mask of
+  *	%GFP_ATOMIC.
+  */
++#ifndef CONFIG_HAVE_ARCH_ALLOC_SKB
+ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
+ 			    int fclone)
+ {
+@@ -186,6 +187,7 @@ nodata:
+ 	skb = NULL;
+ 	goto out;
+ }
++#endif /* !CONFIG_HAVE_ARCH_ALLOC_SKB */
+ 
+ /**
+  *	alloc_skb_from_cache	-	allocate a network buffer
+@@ -203,14 +205,18 @@ nodata:
+  */
+ struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
+ 				     unsigned int size,
+-				     gfp_t gfp_mask)
++				     gfp_t gfp_mask,
++				     int fclone)
+ {
++	kmem_cache_t *cache;
++	struct skb_shared_info *shinfo;
+ 	struct sk_buff *skb;
+ 	u8 *data;
+ 
++	cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
++
+ 	/* Get the HEAD */
+-	skb = kmem_cache_alloc(skbuff_head_cache,
+-			       gfp_mask & ~__GFP_DMA);
++	skb = kmem_cache_alloc(cache, gfp_mask & ~__GFP_DMA);
+ 	if (!skb)
+ 		goto out;
+ 
+@@ -227,16 +233,29 @@ struct sk_buff *alloc_skb_from_cache(kme
+ 	skb->data = data;
+ 	skb->tail = data;
+ 	skb->end  = data + size;
++	/* make sure we initialize shinfo sequentially */
++	shinfo = skb_shinfo(skb);
++	atomic_set(&shinfo->dataref, 1);
++	shinfo->nr_frags  = 0;
++	shinfo->tso_size = 0;
++	shinfo->tso_segs = 0;
++	shinfo->ufo_size = 0;
++	shinfo->ip6_frag_id = 0;
++	shinfo->frag_list = NULL;
+ 
+-	atomic_set(&(skb_shinfo(skb)->dataref), 1);
+-	skb_shinfo(skb)->nr_frags  = 0;
+-	skb_shinfo(skb)->tso_size = 0;
+-	skb_shinfo(skb)->tso_segs = 0;
+-	skb_shinfo(skb)->frag_list = NULL;
++	if (fclone) {
++		struct sk_buff *child = skb + 1;
++		atomic_t *fclone_ref = (atomic_t *) (child + 1);
++
++		skb->fclone = SKB_FCLONE_ORIG;
++		atomic_set(fclone_ref, 1);
++
++		child->fclone = SKB_FCLONE_UNAVAILABLE;
++	}
+ out:
+ 	return skb;
+ nodata:
+-	kmem_cache_free(skbuff_head_cache, skb);
++	kmem_cache_free(cache, skb);
+ 	skb = NULL;
+ 	goto out;
+ }
+@@ -408,6 +427,10 @@ struct sk_buff *skb_clone(struct sk_buff
+ 	C(local_df);
+ 	n->cloned = 1;
+ 	n->nohdr = 0;
++#ifdef CONFIG_XEN
++	C(proto_csum_valid);
++	C(proto_csum_blank);
++#endif
+ 	C(pkt_type);
+ 	C(ip_summed);
+ 	C(priority);
+diff -Nru -p --exclude='.*' ref-linux-2.6.16-rc5/scripts/Makefile.xen linux-2.6.16-rc5-xen0/scripts/Makefile.xen
+--- ref-linux-2.6.16-rc5/scripts/Makefile.xen	1969-12-31 19:00:00.000000000 -0500
++++ linux-2.6.16-rc5-xen0/scripts/Makefile.xen	2006-03-01 11:09:39.000000000 -0500
+@@ -0,0 +1,14 @@
++
++# cherrypickxen($1 = allobj)
++cherrypickxen = $(foreach var, $(1), \
++		$(shell o=$(var); \
++			c=$${o/%.o/-xen.c}; \
++			s=$${o/%.o/-xen.S}; \
++			oxen=$${o/%.o/-xen.o}; \
++			[ -f $(srctree)/$(src)/$${c} ] || \
++			   [ -f $(srctree)/$(src)/$${s} ] \
++				&& echo $$oxen \
++				|| echo $(var) ) \
++	  )
++# filterxen($1 = allobj, $2 = noobjs)
++filterxen = $(filter-out $(2), $(1))


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/.cvsignore,v
retrieving revision 1.371
retrieving revision 1.372
diff -u -r1.371 -r1.372
--- .cvsignore	5 Mar 2006 08:52:50 -0000	1.371
+++ .cvsignore	6 Mar 2006 16:31:46 -0000	1.372
@@ -2,6 +2,6 @@
 temp-*
 kernel-2.6.15
 linux-2.6.15.tar.bz2
-xen-20060208.tar.bz2
 patch-2.6.16-rc5.bz2
+xen-20060301.tar.bz2
 patch-2.6.16-rc5-git8.bz2


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.2016
retrieving revision 1.2017
diff -u -r1.2016 -r1.2017
--- kernel-2.6.spec	5 Mar 2006 08:52:50 -0000	1.2016
+++ kernel-2.6.spec	6 Mar 2006 16:31:46 -0000	1.2017
@@ -8,7 +8,7 @@
 # Whether to apply the Xen patches, leave this enabled.
 %define includexen 1
 # Whether to build the Xen kernels, disable if you want.
-%define buildxen 0
+%define buildxen 1
 %define buildxenPAE 0
 %define builddoc 0
 %define buildkdump 1
@@ -162,7 +162,8 @@
 License: GPLv2
 Version: %{rpmversion}
 Release: %{release}
-ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ia64 sparc sparc64 ppc64iseries s390 s390x
+#ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ia64 sparc sparc64 ppc64iseries s390 s390x
+ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 sparc sparc64 ppc64iseries s390 s390x
 ExclusiveOS: Linux
 Provides: kernel = %{version}
 Provides: kernel-drm = 4.3.0
@@ -185,7 +186,7 @@
 
 
 Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-%{kversion}.tar.bz2
-Source1: xen-20060208.tar.bz2
+Source1: xen-20060301.tar.bz2
 Source2: Config.mk
 
 Source10: COPYING.modules
@@ -249,18 +250,20 @@
 # 500 - 599   s390(x)
 # 600 - 699   sparc(64)
 
+# 690 - 699 xen patches already split in their system
+Patch690: linux-2.6-xen-i386-mach-io-check-nmi.patch
+Patch691: linux-2.6-xen-net-csum.patch
+Patch692: linux-2.6-xen-pmd-shared.patch
+Patch693: linux-2.6-xen-smp-alts.patch
 # 700 - 799 Xen
-Patch700: linux-2.6-xen-merge.patch
+Patch700: linux-2.6-xen.patch
 Patch701: linux-2.6-xen-compile-fixes.patch
 Patch702: linux-2.6-xen-no-tls-warn.patch
-Patch704: linux-2.6-xen-guest-enable-char-devices.patch
-Patch705: linux-2.6-xen_net_read_mac_export.patch
+Patch703: linux-2.6-xen-move-vdso-fixmap.patch
+Patch704: linux-2.6-xen-vsyscall_base.patch
 Patch706: linux-2.6-xen_remap_vma_flags.patch
-Patch707: linux-2.6-xen-acpi.patch
-Patch708: linux-2.6-xen-x86_64-fixes.patch
 Patch709: linux-2.6-percpu-NR_CPUS-hotplug-fix.patch
 Patch710: linux-2.6-xen-module-fault.patch
-Patch711: linux-2.6-xen-cpusteal-kernel.patch
 
 #
 # Patches 800 through 899 are reserved for bugfixes to the core system
@@ -417,9 +420,6 @@
 # Do not add anything non-trivial here.
 Patch10001: linux-2.6-random-patches.patch
 
-Patch20000: linux-2.6-xen-gcc-4.1-compile-fix.patch
-Patch20010: linux-2.6-xen-cpusteal-hv.patch
-
 # END OF PATCH DEFINITIONS
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -681,10 +681,12 @@
 %prep
 if [ ! -d kernel-%{kversion}/vanilla ]; then
   # Ok, first time we do a make prep.
-%setup -q -n %{name}-%{version} -c -a1
   rm -f pax_global_header
+%setup -q -n %{name}-%{version} -c -a1
   cp %{SOURCE2} .
   mv linux-%{kversion} vanilla
+  mv xen xen-vanilla
+  cp %{SOURCE2} .
 else
   # We already have a vanilla dir.
   cd kernel-%{kversion}
@@ -692,13 +694,17 @@
      mv linux-%{kversion}.%{_target_cpu} deleteme
      rm -rf deleteme &
   fi
+  if [ -d xen ]; then
+     mv xen deleteme2
+     rm -rf deleteme2 &
+  fi
 fi
 cp -rl vanilla linux-%{kversion}.%{_target_cpu}
+cp -rl xen-vanilla xen
 
 %if %{buildxen}
 cd xen
-%patch20000 -p1
-%patch20010 -p2
+# Any necessary hypervisor patches go here
 cd ..
 %endif
 cd linux-%{kversion}.%{_target_cpu}
@@ -771,17 +777,31 @@
 #
 %if %{includexen}
 # Base Xen patch from linux-2.6-merge.hg
+%patch690 -p1
+# Conflict with non-xen kernels
+#%patch691 -p1
+%patch692 -p1
+%patch693 -p1
 %patch700 -p1
+
+#
+# Xen includes a patch which moves the vsyscall fixmap into a user-space VA,
+# freeing user-space from reliance on an absolute fixmap area and so allowing
+# the fixmap area to become dynamic.
+#
+# Execshield already does this, making the fixmap area invisible to the user
+# and adding a new randomised vdso for it in user VA, so there's no point in
+# having both: revert the Xen changeset so that execsheild applies cleanly.
+#
+%patch703 -p2 -R
+
 %patch701 -p1
 %patch702 -p1
 %patch704 -p1
-%patch705 -p1
 %patch706 -p1
-%patch707 -p1
-%patch708 -p2
 %patch709 -p1
-%patch710 -p1
-%patch711 -p2
+#%patch710 -p1
+
 %endif
 
 #
@@ -1609,6 +1629,9 @@
 %endif
 
 %changelog
+* Mon Mar  6 2006 Stephen Tweedie <sct at redhat.com>
+- Merge xen rebase with 1.2016 kernel
+
 * Sun Mar  5 2006 Dave Jones <davej at redhat.com>
 - 2.6.16rc5-git8
 - Add a safety net to softlockup so that it doesn't prevent installs.
@@ -1623,11 +1646,42 @@
 * Thu Mar  2 2006 John W. Linville <linville at redhat.com>
 - Update to current bcm43xx code
 
+* Thu Mar  2 2006 Stephen Tweedie <sct at redhat.com>
+- Rebase to rawhide 1.2009
+- Disable xen PAE build again
+
 * Thu Mar  2 2006 Dave Jones <davej at redhat.com>
 - 2.6.16rc5-git6
 - Fix acpi_os_acquire_object() with IRQs disabled debug msgs.
 - Mark unwind info for signal trampolines in vDSOs
 
+* Thu Mar  2 2006 Juan Quintela <quintela at redhat.com>
+- rebase with rawhide 2008.
+
+* Thu Mar  2 2006 Stephen Tweedie <sct at redhat.com>
+- Fix xen/execshield VSYSCALL_BASE conflict
+
+* Thu Mar  2 2006 Dave Jones <davej at redhat.com>
+- Fix acpi_os_acquire_object() with IRQs disabled debug msgs.
+- Mark unwind info for signal trampolines in vDSOs
+
+* Wed Mar  1 2006 Juan Quintela <quintela at redhat.com>
+- disable ia64 build again.
+
+* Wed Mar  1 2006 Stephen Tweedie <sct at redhat.com>
+- Rebase to xen kernel patches and HV from xen-unstable cset 9022
+- Delete xen cpu steal patches (now upstream)
+- Delete xen_net_read_mac export patch (now upstream)
+- Revert xen cset 8948 (vdso updates which execshield already performs)
+- Delete unneeded linux-2.6-xen-gcc-4.1-compile-fix.patch
+
+* Wed Mar  1 2006 Juan Quintela <quintela at redhat.com>
+- remove xen ia64 bits, they break ia64 build.
+- riel cpusteal hv fix.
+
+* Wed Mar  1 2006 Juan Quintela <quintela at redhat.com>
+- enable ia64 again
+
 * Wed Mar  1 2006 Dave Jones <davej at redhat.com>
 - 2.6.16rc5-git4
 - Fix leak in RAID1
@@ -1635,6 +1689,14 @@
 - Enable PATA ports on Promise SATA. (#179369)
 - NFS: writes should not clobber utimes() calls. (#183208)
 
+* Tue Feb 28 2006 Juan Quintela <quintela at redhat.com>
+- fix x86_64 xen build.
+
+* Tue Feb 28 2006 Juan Quintela <quintela at redhat.com>
+- rebase with rawhide 1.1993.
+- enable ia64 again.
+- rebase with rawhide 1.1991.
+
 * Tue Feb 28 2006 Dave Jones <davej at redhat.com>
 - 2.6.16rc5-git3
 
@@ -1651,6 +1713,11 @@
 * Sat Feb 25 2006 Dave Jones <davej at redhat.com>
 - 2.6.16rc4-git8
 
+* Fri Feb 24 2006 Stephen Tweedie <sct at redhat.com>
+- Disable ia64 until we work out the Xen interactions
+- Fix config confusion on ia64
+- Execshield/vdso fixes (quintela at redhat.com)
+
 * Fri Feb 24 2006 Dave Jones <davej at redhat.com>
 - 2.6.16rc4-git7
 
@@ -1673,6 +1740,9 @@
 - Make it possible to disable xen and kdump builds.
 - Add Xen cpu steal accounting code.
 
+* Mon Feb 20 2006 Stephen Tweedie <sct at redhat.com>
+- Rebase kernel xen patches to xen-unstable cset 8907
+
 * Sun Feb 20 2006 Dave Jones <davej at redhat.com>
 - Fix incorrect hardlink count in selinuxfs (#182001)
 

linux-2.6-crashdump-common.patch:
 linux-2.6.12/Documentation/sysrq.txt         |    8 
 linux-2.6.12/arch/i386/kernel/nmi.c          |    1 
 linux-2.6.12/arch/i386/kernel/traps.c        |    3 
 linux-2.6.12/arch/i386/mm/init.c             |   47 +++++
 linux-2.6.12/arch/i386/mm/pgtable.c          |    2 
 linux-2.6.12/arch/ia64/kernel/process.c      |   30 ++-
 linux-2.6.12/arch/ia64/kernel/traps.c        |    6 
 linux-2.6.12/arch/ia64/mm/contig.c           |    3 
 linux-2.6.12/arch/ia64/mm/discontig.c        |    3 
 linux-2.6.12/arch/ia64/mm/init.c             |   90 +++++++++
 linux-2.6.12/arch/powerpc/kernel/process.c   |    1 
 linux-2.6.12/arch/powerpc/kernel/traps.c     |    3 
 linux-2.6.12/arch/powerpc/mm/mem.c           |   29 +++
 linux-2.6.12/arch/s390/kernel/traps.c        |    6 
 linux-2.6.12/arch/x86_64/kernel/process.c    |    2 
 linux-2.6.12/arch/x86_64/kernel/traps.c      |    6 
 linux-2.6.12/arch/x86_64/mm/init.c           |   32 +++
 linux-2.6.12/drivers/char/sysrq.c            |    2 
 linux-2.6.12/include/asm-generic/crashdump.h |   47 +++++
 linux-2.6.12/include/asm-i386/crashdump.h    |  123 +++++++++++++
 linux-2.6.12/include/asm-i386/kmap_types.h   |    4 
 linux-2.6.12/include/asm-ia64/crashdump.h    |   72 +++++++
 linux-2.6.12/include/asm-powerpc/crashdump.h |   61 ++++++
 linux-2.6.12/include/asm-x86_64/crashdump.h  |   86 +++++++++
 linux-2.6.12/include/linux/kernel.h          |   18 +
 linux-2.6.12/kernel/Makefile                 |    2 
 linux-2.6.12/kernel/dump.c                   |  246 +++++++++++++++++++++++++++
 linux-2.6.12/kernel/panic.c                  |    4 
 linux-2.6.12/kernel/printk.c                 |   20 ++
 linux-2.6.12/kernel/sched.c                  |    2 
 linux-2.6.13/arch/x86_64/mm/fault.c          |    1 
 linux-2.6.13/drivers/char/sysrq.c            |    5 
 32 files changed, 951 insertions(+), 14 deletions(-)

Index: linux-2.6-crashdump-common.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-crashdump-common.patch,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- linux-2.6-crashdump-common.patch	13 Feb 2006 21:17:47 -0000	1.9
+++ linux-2.6-crashdump-common.patch	6 Mar 2006 16:31:46 -0000	1.10
@@ -239,15 +239,14 @@
 +#endif /* _ASM_X86_64_CRASHDUMP_H */
 --- linux-2.6.12/include/asm-i386/kmap_types.h.orig	2005-06-17 15:48:29.000000000 -0400
 +++ linux-2.6.12/include/asm-i386/kmap_types.h	2005-08-18 14:23:59.000000000 -0400
-@@ -23,8 +23,10 @@
+@@ -23,7 +23,9 @@
  D(10)	KM_IRQ1,
  D(11)	KM_SOFTIRQ0,
  D(12)	KM_SOFTIRQ1,
- D(13)	KM_SWIOTLB,
--D(14)	KM_TYPE_NR
-+D(14)	KM_CRASHDUMP,
-+D(15)	KM_UNUSED,
-+D(16)	KM_TYPE_NR
+-D(13)	KM_TYPE_NR
++D(13)	KM_CRASHDUMP,
++D(14)	KM_UNUSED,
++D(15)	KM_TYPE_NR
  };
  
  #undef D
@@ -890,14 +889,6 @@
   * valid. The argument is a physical page number.
 --- linux-2.6.12/arch/i386/mm/pgtable.c.orig	2005-08-18 12:39:56.000000000 -0400
 +++ linux-2.6.12/arch/i386/mm/pgtable.c	2005-08-18 14:23:58.000000000 -0400
-@@ -13,6 +13,7 @@
- #include <linux/slab.h>
- #include <linux/pagemap.h>
- #include <linux/spinlock.h>
-+#include <linux/module.h>
- 
- #include <asm/system.h>
- #include <asm/pgtable.h>
 @@ -63,6 +64,8 @@
  	printk(KERN_INFO "%lu pages pagetables\n", ps.nr_page_table_pages);
  }

linux-2.6-execshield-fixes.patch:
 linux-2.6.15.noarch/include/asm-i386/desc.h       |    2 +-
 linux-exec-shield-curr.q/arch/i386/kernel/traps.c |    2 +-
 linux-exec-shield-curr.q/fs/proc/base.c           |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6-execshield-fixes.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-execshield-fixes.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-execshield-fixes.patch	15 Feb 2006 17:44:53 -0000	1.5
+++ linux-2.6-execshield-fixes.patch	6 Mar 2006 16:31:46 -0000	1.6
@@ -30,15 +30,15 @@
  #endif
  #ifdef CONFIG_SECURITY
  	E(PROC_TGID_ATTR,      "attr",    S_IFDIR|S_IRUGO|S_IXUGO),
-diff -uNp linux-2.6.15.i686/include/asm-i386/desc.h.orig linux-2.6.15.i686/include/asm-i386/desc.h
---- linux-2.6.15.i686/include/asm-i386/desc.h.orig	2006-01-25 17:57:49.000000000 -0500
-+++ linux-2.6.15.i686/include/asm-i386/desc.h	2006-01-25 18:00:02.000000000 -0500
-@@ -208,7 +208,7 @@ static inline void set_user_cs(struct de
+diff -uNp linux-2.6.15.noarch/include/asm-i386/desc.h.orig linux-2.6.15.noarch/include/asm-i386/desc.h
+--- linux-2.6.15.noarch/include/asm-i386/desc.h.orig	2006-02-22 21:05:44.000000000 +0100
++++ linux-2.6.15.noarch/include/asm-i386/desc.h	2006-02-22 21:09:15.000000000 +0100
+@@ -168,7 +168,7 @@ static inline void set_user_cs(struct de
+ }
  
- #ifndef CONFIG_X86_XEN
  #define load_user_cs_desc(cpu, mm) \
 -    	per_cpu(cpu_gdt_table, (cpu))[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
-+ 	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
- #else
- #define load_user_cs_desc(cpu, mm) \
- 	HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS]), (u64)(mm)->context.user_cs.a | ((u64)(mm)->context.user_cs.b) << 32);
++    	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
+ 
+ extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
+ extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);

linux-2.6-execshield-vdso.patch:
 linux-2.6.15.noarch/arch/i386/kernel/sysenter.c    |   71 +++++++++++--------
 linux-2.6.15.xen/arch/i386/kernel/cpu/common-xen.c |    6 +
 linux/fs/binfmt_elf.c                              |   15 +---
 linux/fs/proc/task_mmu.c                           |    9 +-
 linux/include/asm-i386/elf.h                       |    7 +
 linux/include/asm-i386/page.h                      |    5 +
 linux/include/linux/mm.h                           |    5 +
 linux/kernel/sysctl.c                              |   10 ++
 linux/mm/mmap.c                                    |   78 +++++++++++++++++++++
 9 files changed, 163 insertions(+), 43 deletions(-)

Index: linux-2.6-execshield-vdso.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-execshield-vdso.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-execshield-vdso.patch	9 Jan 2006 19:24:08 -0000	1.2
+++ linux-2.6-execshield-vdso.patch	6 Mar 2006 16:31:46 -0000	1.3
@@ -8,11 +8,10 @@
  mm/mmap.c                   |   78 ++++++++++++++++++++++++++++++++++++++++++++
  8 files changed, 155 insertions(+), 43 deletions(-)
 
-Index: linux/arch/i386/kernel/sysenter.c
-===================================================================
---- linux.orig/arch/i386/kernel/sysenter.c
-+++ linux/arch/i386/kernel/sysenter.c
-@@ -47,20 +47,13 @@ void enable_sep_cpu(void)
+diff -uNp linux-2.6.15.noarch/arch/i386/kernel/sysenter.c.orig linux-2.6.15.noarch/arch/i386/kernel/sysenter.c
+--- linux-2.6.15.noarch/arch/i386/kernel/sysenter.c.orig	2006-02-22 20:56:56.000000000 +0100
++++ linux-2.6.15.noarch/arch/i386/kernel/sysenter.c	2006-02-22 21:04:49.000000000 +0100
+@@ -49,20 +49,13 @@ void enable_sep_cpu(void)
  extern const char vsyscall_int80_start, vsyscall_int80_end;
  extern const char vsyscall_sysenter_start, vsyscall_sysenter_end;
  
@@ -33,9 +32,9 @@
 -	sysenter_page = virt_to_page(page);
 +	sysenter_pages[0] = virt_to_page(page);
  
- 	if (!boot_cpu_has(X86_FEATURE_SEP)) {
- 		memcpy(page,
-@@ -78,42 +71,58 @@ int __init sysenter_setup(void)
+ #ifdef CONFIG_X86_SYSENTER
+ 	if (boot_cpu_has(X86_FEATURE_SEP)) {
+@@ -78,42 +71,60 @@ int __init sysenter_setup(void)
  
  extern void SYSENTER_RETURN_OFFSET;
  
@@ -98,6 +97,7 @@
  }
  
 -static int __init vdso_setup(char *str)
++#ifndef CONFIG_XEN
 +int in_gate_area_no_task(unsigned long addr)
  {
 -        vdso_enabled = simple_strtoul(str, NULL, 0);
@@ -115,6 +115,23 @@
 +{
 +	return NULL;
 +}
++#endif
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/i386/kernel/cpu/common-xen.c linux-2.6.15.xen/arch/i386/kernel/cpu/common-xen.c
+--- linux-2.6.15.orig/arch/i386/kernel/cpu/common-xen.c	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/arch/i386/kernel/cpu/common-xen.c	2006-02-22 18:26:45.000000000 +0100
+@@ -409,6 +409,12 @@ void __devinit identify_cpu(struct cpuin
+ 	if (disable_pse)
+ 		clear_bit(X86_FEATURE_PSE, c->x86_capability);
+ 
++	if (exec_shield != 0) {
++#ifdef CONFIG_HIGHMEM64G   /* NX implies PAE */
++		if (!test_bit(X86_FEATURE_NX, c->x86_capability))
++#endif
++		clear_bit(X86_FEATURE_SEP, c->x86_capability);
++	}
+ 	/* If the model name is still unset, do table lookup. */
+ 	if ( !c->x86_model_id[0] ) {
+ 		char *p;
 Index: linux/fs/binfmt_elf.c
 ===================================================================
 --- linux.orig/fs/binfmt_elf.c

linux-2.6-execshield-xen.patch:
 arch/i386/kernel/entry-xen.S                                |    8 -
 arch/i386/kernel/process-xen.c                              |   58 +++++++
 arch/i386/kernel/smp-xen.c                                  |    2 
 arch/i386/kernel/traps-xen.c                                |   92 +++++++++++-
 arch/i386/mm/init-xen.c                                     |   11 +
 linux-2.6.15.i686/include/asm-x86_64/mach-xen/asm/pgtable.h |    2 
 linux-2.6.15.noarch/arch/x86_64/kernel/setup64-xen.c        |   23 ---
 7 files changed, 166 insertions(+), 30 deletions(-)

Index: linux-2.6-execshield-xen.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-execshield-xen.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-execshield-xen.patch	13 Feb 2006 21:17:47 -0000	1.2
+++ linux-2.6-execshield-xen.patch	6 Mar 2006 16:31:47 -0000	1.3
@@ -120,10 +120,10 @@
 index 0f7199b..878c084 100644
 --- a/arch/i386/kernel/traps-xen.c
 +++ b/arch/i386/kernel/traps-xen.c
-@@ -459,11 +459,89 @@ DO_ERROR_INFO(17, SIGBUS, "alignment che
- #ifdef CONFIG_X86_MCE
- DO_ERROR(18, SIGBUS, "machine check", machine_check)
- #endif
+@@ -459,13 +459,99 @@ DO_ERROR_INFO(17, SIGBUS, "alignment che
+ DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
+ DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
+ DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
 -DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
 +
 +
@@ -205,24 +205,11 @@
  fastcall void __kprobes do_general_protection(struct pt_regs * regs,
  					      long error_code)
  {
+-	current->thread.error_code = error_code;
+-	current->thread.trap_no = 13;
 +	int cpu = get_cpu();
 +	int ok;
 +
- 	/*
- 	 * If we trapped on an LDT access then ensure that the default_ldt is
- 	 * loaded, if nothing else. We load default_ldt lazily because LDT
-@@ -473,13 +551,22 @@ fastcall void __kprobes do_general_prote
- 		unsigned long ldt;
- 		__asm__ __volatile__ ("sldt %0" : "=r" (ldt));
- 		if (ldt == 0) {
-+			put_cpu();
- 			xen_set_ldt((unsigned long)&default_ldt[0], 5);
- 			return;
- 		}
- 	}
- 
--	current->thread.error_code = error_code;
--	current->thread.trap_no = 13;
 +	ok = check_lazy_exec_limit(cpu, regs, error_code);
 +	put_cpu();
 +
@@ -280,22 +267,6 @@
  
  	pagetable_init();
  
---- linux-2.6.14/include/asm-i386/desc.h~	2006-01-06 17:09:44.000000000 -0500
-+++ linux-2.6.14/include/asm-i386/desc.h	2006-01-06 17:22:41.000000000 -0500
-@@ -210,8 +210,13 @@
- 	desc->b = (limit & 0xf0000) | 0x00c0fb00;
- }
- 
-+#ifndef CONFIG_X86_XEN
- #define load_user_cs_desc(cpu, mm) \
-     	per_cpu(cpu_gdt_table, (cpu))[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
-+#else
-+#define load_user_cs_desc(cpu, mm) \
-+	HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS]), (u64)(mm)->context.user_cs.a | ((u64)(mm)->context.user_cs.b) << 32);
-+#endif
- 
- extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
- extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
 diff -urNp --exclude-from=/home/mitica/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/x86_64/kernel/setup64-xen.c linux-2.6.15.noarch/arch/x86_64/kernel/setup64-xen.c
 --- linux-2.6.15.orig/arch/x86_64/kernel/setup64-xen.c	2006-02-10 20:25:28.000000000 +0100
 +++ linux-2.6.15.noarch/arch/x86_64/kernel/setup64-xen.c	2006-02-10 21:27:22.000000000 +0100
@@ -337,3 +308,15 @@
  
  /*
   * Great future plan:
+diff -uNp linux-2.6.15.i686/include/asm-x86_64/mach-xen/asm/pgtable.h.orig linux-2.6.15.i686/include/asm-x86_64/mach-xen/asm/pgtable.h
+--- linux-2.6.15.i686/include/asm-x86_64/mach-xen/asm/pgtable.h.orig	2006-02-23 16:50:14.000000000 +0100
++++ linux-2.6.15.i686/include/asm-x86_64/mach-xen/asm/pgtable.h	2006-02-23 16:59:04.000000000 +0100
+@@ -44,7 +44,7 @@ extern unsigned long __supported_pte_mas
+ 
+ #define swapper_pg_dir init_level4_pgt
+ 
+-extern void nonx_setup(char *str);
++extern void nonx_setup(const char *str);
+ extern void paging_init(void);
+ extern void clear_kernel_mapping(unsigned long addr, unsigned long size);
+ 

linux-2.6-execshield.patch:
 arch/i386/kernel/asm-offsets.c       |    1 
 arch/i386/kernel/cpu/common.c        |    7 +
 arch/i386/kernel/entry.S             |    8 +-
 arch/i386/kernel/process.c           |   59 +++++++++++++++
 arch/i386/kernel/signal.c            |    4 -
 arch/i386/kernel/smp.c               |    3 
 arch/i386/kernel/sysenter.c          |   56 ++++++++++++++-
 arch/i386/kernel/traps.c             |   93 ++++++++++++++++++++++++-
 arch/i386/kernel/vsyscall-sysenter.S |    6 -
 arch/i386/kernel/vsyscall.lds.S      |    4 -
 arch/i386/mm/init.c                  |    6 +
 arch/i386/mm/mmap.c                  |    6 +
 arch/ia64/ia32/binfmt_elf32.c        |    2 
 arch/x86_64/ia32/ia32_binfmt.c       |    4 -
 arch/x86_64/kernel/process.c         |    6 -
 arch/x86_64/kernel/setup64.c         |   23 ------
 arch/x86_64/mm/fault.c               |    2 
 drivers/char/random.c                |    7 +
 fs/binfmt_elf.c                      |  130 ++++++++++++++++++++++++++++-------
 fs/proc/array.c                      |    8 +-
 fs/proc/base.c                       |    4 -
 fs/proc/task_mmu.c                   |   25 +++++-
 include/asm-i386/desc.h              |   14 +++
 include/asm-i386/elf.h               |   42 +++++++----
 include/asm-i386/mmu.h               |    6 +
 include/asm-i386/pgalloc.h           |    1 
 include/asm-i386/processor.h         |    7 +
 include/asm-i386/thread_info.h       |    1 
 include/asm-ia64/pgalloc.h           |    4 +
 include/asm-powerpc/pgalloc.h        |    5 +
 include/asm-ppc/pgalloc.h            |    5 +
 include/asm-s390/pgalloc.h           |    4 +
 include/asm-sparc/pgalloc.h          |    4 +
 include/asm-sparc64/pgalloc.h        |    4 +
 include/asm-x86_64/pgalloc.h         |    7 +
 include/asm-x86_64/pgtable.h         |    2 
 include/asm-x86_64/processor.h       |    2 
 include/linux/mm.h                   |   11 ++
 include/linux/resource.h             |    5 +
 include/linux/sched.h                |    9 ++
 include/linux/sysctl.h               |    3 
 kernel/signal.c                      |   38 ++++++++++
 kernel/sysctl.c                      |   39 ++++++++++
 mm/fremap.c                          |   16 ++--
 mm/mmap.c                            |  105 ++++++++++++++++++++++++++--
 mm/mprotect.c                        |    5 +
 mm/mremap.c                          |    4 -
 47 files changed, 684 insertions(+), 123 deletions(-)

Index: linux-2.6-execshield.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-execshield.patch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- linux-2.6-execshield.patch	18 Jan 2006 06:03:01 -0000	1.10
+++ linux-2.6-execshield.patch	6 Mar 2006 16:31:47 -0000	1.11
@@ -227,12 +227,13 @@
  
  #include <asm/cpufeature.h>
  #include <asm/msr.h>
-@@ -36,7 +37,7 @@ void enable_sep_cpu(void)
+@@ -36,8 +37,8 @@ void enable_sep_cpu(void)
  	wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
  	wrmsr(MSR_IA32_SYSENTER_ESP, tss->esp1, 0);
  	wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) sysenter_entry, 0);
 -	put_cpu();	
 +	put_cpu();
+ #endif
  }
  
  /*

linux-2.6-xen-compile-fixes.patch:
 arch/i386/kernel/acpi/boot-xen.c                             |    3 +-
 linux-2.6.15.ia64/fs/Kconfig                                 |    1 
 linux-2.6.15.xen/arch/i386/kernel/Makefile                   |    3 --
 linux-2.6.15.xen/arch/i386/kernel/smp-xen.c                  |    1 
 linux-2.6.15.xen/arch/i386/mm/init-xen.c                     |    1 
 linux-2.6.15.xen/arch/x86_64/kernel/pmtimer.c                |    2 +
 linux-2.6.15.xen/arch/x86_64/kernel/process-xen.c            |    6 ----
 linux-2.6.15.xen/arch/x86_64/mm/fault-xen.c                  |    2 -
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/desc.h        |   14 +++++++++++
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/mmu.h         |    7 +++++
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/pgalloc.h     |    1 
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/processor.h   |    7 ++++-
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/swiotlb.h     |    1 
 linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgalloc.h   |    7 +++++
 linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgtable.h   |    2 -
 linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/processor.h |    2 +
 16 files changed, 47 insertions(+), 13 deletions(-)

Index: linux-2.6-xen-compile-fixes.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-xen-compile-fixes.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-xen-compile-fixes.patch	13 Feb 2006 21:17:47 -0000	1.1
+++ linux-2.6-xen-compile-fixes.patch	6 Mar 2006 16:31:47 -0000	1.2
@@ -1,51 +1,233 @@
-diff -urNp --exclude-from=/home/mitica/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/x86_64/kernel/apic-xen.c linux-2.6.15.noarch/arch/x86_64/kernel/apic-xen.c
---- linux-2.6.15.orig/arch/x86_64/kernel/apic-xen.c	2006-02-10 20:25:27.000000000 +0100
-+++ linux-2.6.15.noarch/arch/x86_64/kernel/apic-xen.c	2006-02-11 03:11:49.000000000 +0100
-@@ -42,6 +42,15 @@
- int apic_verbosity;
- int disable_apic;
- 
-+/*
-+ * '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)
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/i386/mm/init-xen.c linux-2.6.15.xen/arch/i386/mm/init-xen.c
+--- linux-2.6.15.orig/arch/i386/mm/init-xen.c	2006-02-22 15:56:24.000000000 +0100
++++ linux-2.6.15.xen/arch/i386/mm/init-xen.c	2006-02-22 18:56:27.000000000 +0100
+@@ -34,6 +34,7 @@
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+ #include <asm/pgtable.h>
++#include <asm-i386/mach-xen/asm/swiotlb.h>
+ #include <asm/dma.h>
+ #include <asm/fixmap.h>
+ #include <asm/e820.h>
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/x86_64/kernel/process-xen.c linux-2.6.15.xen/arch/x86_64/kernel/process-xen.c
+--- linux-2.6.15.orig/arch/x86_64/kernel/process-xen.c	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/arch/x86_64/kernel/process-xen.c	2006-02-22 18:32:50.000000000 +0100
+@@ -618,12 +618,6 @@ void set_personality_64bit(void)
+ 
+ 	/* Make sure to be in 64bit mode */
+ 	clear_thread_flag(TIF_IA32); 
+-
+-	/* TBD: overwrites user setup. Should have two bits.
+-	   But 64bit processes have always behaved this way,
+-	   so it's not too bad. The main problem is just that
+-   	   32bit childs are affected again. */
+-	current->personality &= ~READ_IMPLIES_EXEC;
+ }
+ 
+ asmlinkage long sys_fork(struct pt_regs *regs)
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/x86_64/mm/fault-xen.c linux-2.6.15.xen/arch/x86_64/mm/fault-xen.c
+--- linux-2.6.15.orig/arch/x86_64/mm/fault-xen.c	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/arch/x86_64/mm/fault-xen.c	2006-02-22 18:34:19.000000000 +0100
+@@ -80,7 +80,7 @@ static noinline int is_prefetch(struct p
+ 	instr = (unsigned char *)convert_rip_to_linear(current, regs);
+ 	max_instr = instr + 15;
+ 
+-	if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE)
++	if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE64)
+ 		return 0;
+ 
+ 	while (scan_more && instr < max_instr) { 
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-i386/mach-xen/asm/desc.h linux-2.6.15.xen/include/asm-i386/mach-xen/asm/desc.h
+--- linux-2.6.15.orig/include/asm-i386/mach-xen/asm/desc.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-i386/mach-xen/asm/desc.h	2006-02-22 18:46:35.000000000 +0100
+@@ -157,6 +157,20 @@ static inline unsigned long get_desc_bas
+ 	return base;
+ }
+ 
++static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
 +{
-+	printk("unexpected IRQ trap at vector %02x\n", irq);
++	limit = (limit - 1) / PAGE_SIZE;
++	desc->a = limit & 0xffff;
++	desc->b = (limit & 0xf0000) | 0x00c0fb00;
 +}
 +
- void smp_local_timer_interrupt(struct pt_regs *regs)
- {
- 	profile_tick(CPU_PROFILING, regs);
-diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.x86_64/arch/i386/mm/init-xen.c linux-2.6.15.new/arch/i386/mm/init-xen.c
---- linux-2.6.15.x86_64/arch/i386/mm/init-xen.c	2006-02-11 19:15:39.000000000 +0100
-+++ linux-2.6.15.new/arch/i386/mm/init-xen.c	2006-02-11 16:24:12.000000000 +0100
-@@ -459,6 +459,7 @@ void zap_low_mappings (void)
- 
- static int disable_nx __initdata = 0;
- u64 __supported_pte_mask __read_mostly = ~_PAGE_NX;
-+EXPORT_SYMBOL(__supported_pte_mask);
++#define load_user_cs_desc(cpu, mm) \
++	HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS]), (u64)(mm)->context.user_cs.a | ((u64)(mm)->context.user_cs.b) << 32);
++
++extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
++extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
++extern void arch_flush_exec_range(struct mm_struct *mm);
++
+ #endif /* !__ASSEMBLY__ */
  
- /*
-  * noexec = on|off
-diff -uNp linux-2.6.15.noarch/arch/x86_64/kernel/genapic-xen.c.orig linux-2.6.15.noarch/arch/x86_64/kernel/genapic-xen.c
---- linux-2.6.15.noarch/arch/x86_64/kernel/genapic-xen.c.orig	2006-02-11 20:17:49.000000000 +0100
-+++ linux-2.6.15.noarch/arch/x86_64/kernel/genapic-xen.c	2006-02-11 20:18:09.000000000 +0100
-@@ -39,6 +39,17 @@ extern struct genapic apic_xen;
- struct genapic *genapic = &apic_xen;
  #endif
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-i386/mach-xen/asm/mmu.h linux-2.6.15.xen/include/asm-i386/mach-xen/asm/mmu.h
+--- linux-2.6.15.orig/include/asm-i386/mach-xen/asm/mmu.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-i386/mach-xen/asm/mmu.h	2006-02-22 18:17:34.000000000 +0100
+@@ -7,11 +7,18 @@
+  * we put the segment information here.
+  *
+  * cpu_vm_mask is used to optimize ldt flushing.
++ +
++ * exec_limit is used to track the range PROT_EXEC
++ * mappings span.
+  */
+ typedef struct { 
+ 	int size;
+ 	struct semaphore sem;
+ 	void *ldt;
++	struct desc_struct user_cs;
++	unsigned long exec_limit;
++	void *vdso;
++
+ } mm_context_t;
  
-+#ifndef CONFIG_X86_LOCAL_APIC
-+/*
-+ * '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);
-+}
-+#endif
+ /* mm/memory.c:exit_mmap hook */
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-i386/mach-xen/asm/pgalloc.h linux-2.6.15.xen/include/asm-i386/mach-xen/asm/pgalloc.h
+--- linux-2.6.15.orig/include/asm-i386/mach-xen/asm/pgalloc.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-i386/mach-xen/asm/pgalloc.h	2006-02-22 18:17:59.000000000 +0100
+@@ -3,6 +3,7 @@
+ 
+ #include <linux/config.h>
+ #include <asm/fixmap.h>
++#include <asm/desc.h>
+ #include <linux/threads.h>
+ #include <linux/mm.h>		/* for struct page */
+ #include <asm/io.h>		/* for phys_to_virt and page_to_pseudophys */
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-i386/mach-xen/asm/processor.h linux-2.6.15.xen/include/asm-i386/mach-xen/asm/processor.h
+--- linux-2.6.15.orig/include/asm-i386/mach-xen/asm/processor.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-i386/mach-xen/asm/processor.h	2006-02-22 18:42:49.000000000 +0100
+@@ -335,7 +335,9 @@ extern int bootloader_type;
+ /* 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 TASK_UNMAPPED_BASE	PAGE_ALIGN(TASK_SIZE/3)
 +
++#define __HAVE_ARCH_ALIGN_STACK
+ 
+ #define HAVE_ARCH_PICK_MMAP_LAYOUT
+ 
+@@ -530,6 +532,9 @@ static inline void __load_esp0(struct ts
+ 	regs->xcs = __USER_CS;					\
+ 	regs->eip = new_eip;					\
+ 	regs->esp = new_esp;					\
++	preempt_disable();					\
++	load_user_cs_desc(smp_processor_id(), current->mm);	\
++	preempt_enable();					\
+ } while (0)
  
  /*
-  * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-i386/mach-xen/asm/swiotlb.h linux-2.6.15.xen/include/asm-i386/mach-xen/asm/swiotlb.h
+--- linux-2.6.15.orig/include/asm-i386/mach-xen/asm/swiotlb.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-i386/mach-xen/asm/swiotlb.h	2006-02-22 19:53:16.000000000 +0100
+@@ -2,6 +2,7 @@
+ #define _ASM_SWIOTLB_H 1
+ 
+ #include <linux/config.h>
++#include <asm/scatterlist.h>
+ 
+ /* SWIOTLB interface */
+ 
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-x86_64/mach-xen/asm/pgalloc.h linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgalloc.h
+--- linux-2.6.15.orig/include/asm-x86_64/mach-xen/asm/pgalloc.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgalloc.h	2006-02-22 18:24:18.000000000 +0100
+@@ -7,6 +7,13 @@
+ #include <linux/mm.h>
+ #include <asm/io.h>		/* for phys_to_virt and page_to_pseudophys */
+ 
++#define arch_add_exec_range(mm, limit) \
++		do { (void)(mm), (void)(limit); } while (0)
++#define arch_flush_exec_range(mm) \
++		do { (void)(mm); } while (0)
++#define arch_remove_exec_range(mm, limit) \
++		do { (void)(mm), (void)(limit); } while (0)
++
+ #include <xen/features.h>
+ void make_page_readonly(void *va, unsigned int feature);
+ void make_page_writable(void *va, unsigned int feature);
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-x86_64/mach-xen/asm/pgtable.h linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgtable.h
+--- linux-2.6.15.orig/include/asm-x86_64/mach-xen/asm/pgtable.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgtable.h	2006-02-22 18:24:57.000000000 +0100
+@@ -44,7 +44,7 @@ extern unsigned long __supported_pte_mas
+ 
+ #define swapper_pg_dir init_level4_pgt
+ 
+-extern int nonx_setup(char *str);
++extern void nonx_setup(char *str);
+ extern void paging_init(void);
+ extern void clear_kernel_mapping(unsigned long addr, unsigned long size);
+ 
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/include/asm-x86_64/mach-xen/asm/processor.h linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/processor.h
+--- linux-2.6.15.orig/include/asm-x86_64/mach-xen/asm/processor.h	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/processor.h	2006-02-22 18:25:18.000000000 +0100
+@@ -180,6 +180,8 @@ static inline void clear_in_cr4 (unsigne
+  */
+ #define TASK_SIZE64	(0x800000000000UL - 4096)
+ 
++#define __HAVE_ARCH_ALIGN_STACK
++
+ /* This decides where the kernel will search for a free chunk of vm
+  * space during mmap's.
+  */
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/i386/kernel/Makefile linux-2.6.15.xen/arch/i386/kernel/Makefile
+--- linux-2.6.15.orig/arch/i386/kernel/Makefile	2006-02-22 15:56:20.000000000 +0100
++++ linux-2.6.15.xen/arch/i386/kernel/Makefile	2006-02-22 17:08:31.000000000 +0100
+@@ -83,8 +83,7 @@ $(obj)/built-in.o: ld_flags += -R $(obj)
+ 
+ SYSCFLAGS_vsyscall-syms.o = -r
+ $(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
+-			$(foreach F,$(VSYSCALL_TYPES-y),$(obj)/vsyscall-$F.o) \
+-			$(obj)/$(vsyscall_note) FORCE
++			$(obj)/vsyscall-sysenter.o $(obj)/$(vsyscall_note) FORCE
+ 	$(call if_changed,syscall)
+ 
+ ifdef CONFIG_XEN
+diff -urNp --exclude-from=/home/quintela/config/misc/dontdiff linux-2.6.15.orig/arch/i386/kernel/smp-xen.c linux-2.6.15.xen/arch/i386/kernel/smp-xen.c
+--- linux-2.6.15.orig/arch/i386/kernel/smp-xen.c	2006-02-22 15:56:21.000000000 +0100
++++ linux-2.6.15.xen/arch/i386/kernel/smp-xen.c	2006-02-22 18:29:12.000000000 +0100
+@@ -23,6 +23,7 @@
+ 
+ #include <asm/mtrr.h>
+ #include <asm/tlbflush.h>
++#include <asm/desc.h>
+ #if 0
+ #include <mach_apic.h>
+ #endif
+--- linux-2.6.15.ia64/fs/Kconfig~	2006-02-24 14:14:42.000000000 -0500
++++ linux-2.6.15.ia64/fs/Kconfig	2006-02-24 14:38:17.000000000 -0500
+@@ -841,7 +841,6 @@
+ config HUGETLBFS
+ 	bool "HugeTLB file system support"
+ 	depends X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN
+-	depends !XEN
+ 
+ config HUGETLB_PAGE
+ 	def_bool HUGETLBFS
+diff -urNp --exclude-from=/home/mitica/quintela/config/misc/dontdiff kernel-2.6.15/linux-2.6.15.noarch/arch/x86_64/kernel/pmtimer.c linux-2.6.15.xen/arch/x86_64/kernel/pmtimer.c
+--- kernel-2.6.15/linux-2.6.15.noarch/arch/x86_64/kernel/pmtimer.c	2006-02-28 22:47:11.000000000 +0100
++++ linux-2.6.15.xen/arch/x86_64/kernel/pmtimer.c	2006-02-28 22:37:45.000000000 +0100
+@@ -60,8 +60,10 @@ int pmtimer_mark_offset(void)
+ 	delta = cyc2us((tick - last_pmtmr_tick) & ACPI_PM_MASK);
+ 
+ 	last_pmtmr_tick = tick;
++#ifndef CONFIG_XEN
+ 	monotonic_base += delta * NSEC_PER_USEC;
++#endif
+ 
+ 	delta += offset_delay;
+ 
+ 
+--- linux-2.6.15.i686/arch/i386/kernel/acpi/boot-xen.c	2006-03-02 19:47:26.000000000 +0100
++++ linux-2.6.15.noarch/arch/i386/kernel/acpi/boot-xen.c	2006-03-02 22:00:11.000000000 +0100
+@@ -230,8 +230,9 @@ static int __init acpi_parse_madt(unsign
+ 		       madt->lapic_address);
+ 	}
+ 
++#ifndef CONFIG_X86_64
+ 	acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
+-
++#endif
+ 	return 0;
+ }
+ 


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/sources,v
retrieving revision 1.312
retrieving revision 1.313
diff -u -r1.312 -r1.313
--- sources	5 Mar 2006 08:52:50 -0000	1.312
+++ sources	6 Mar 2006 16:32:22 -0000	1.313
@@ -1,4 +1,4 @@
 cdf95e00f5111e31f78e1d97304d9522  linux-2.6.15.tar.bz2
-30f4ef37dbc4d0bce9366e8716e8b51b  xen-20060208.tar.bz2
 1740ae34807f687a93adf2469ea5c4fc  patch-2.6.16-rc5.bz2
+cdfde609af8adcf58d7ff626599b2d90  xen-20060301.tar.bz2
 ac2274a7e960b780325805e050ad5cee  patch-2.6.16-rc5-git8.bz2


--- linux-2.6-xen-acpi.patch DELETED ---


--- linux-2.6-xen-cpusteal-kernel.patch DELETED ---


--- linux-2.6-xen-gcc-4.1-compile-fix.patch DELETED ---


--- linux-2.6-xen-guest-enable-char-devices.patch DELETED ---


--- linux-2.6-xen-merge.patch DELETED ---


--- linux-2.6-xen-x86_64-fixes.patch DELETED ---


--- linux-2.6-xen_net_read_mac_export.patch DELETED ---




More information about the fedora-cvs-commits mailing list