summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Marineau <marineam@gentoo.org>2007-10-15 23:31:43 +0000
committerMichael Marineau <marineam@gentoo.org>2007-10-15 23:31:43 +0000
commitaaeb7c9dc1abc750fa9bb29844965c602d885bf3 (patch)
treedeed2814bd76c018b6b6bc019b6ec63b5eb48fd8
parentReleasing 2.6.18-6 (diff)
downloadxen-aaeb7c9dc1abc750fa9bb29844965c602d885bf3.tar.gz
xen-aaeb7c9dc1abc750fa9bb29844965c602d885bf3.tar.bz2
xen-aaeb7c9dc1abc750fa9bb29844965c602d885bf3.zip
Resync 2.6.20 patches with RedHat's 2936.fc7 kernel. Add highpte fix and remove disable patch. Fixup the tls warning.
svn path=/patches/; revision=56
-rw-r--r--trunk/2.6.20/00000_README13
-rw-r--r--trunk/2.6.20/20965_linux-2.6-xen-sleazy-fpu-i386.patch96
-rw-r--r--trunk/2.6.20/20966_linux-2.6-xen-sleazy-fpu-x86_64.patch93
-rw-r--r--trunk/2.6.20/40001_i386-fix-xen_l1_entry_update-for-highptes.patch26
-rw-r--r--trunk/2.6.20/50007_disable-highpte.patch13
-rw-r--r--trunk/2.6.20/50008_reenable-tls-warning.patch23
-rw-r--r--trunk/2.6.20/50009_gentooify-tls-warning.patch16
7 files changed, 264 insertions, 16 deletions
diff --git a/trunk/2.6.20/00000_README b/trunk/2.6.20/00000_README
index 6838273..3807690 100644
--- a/trunk/2.6.20/00000_README
+++ b/trunk/2.6.20/00000_README
@@ -14,6 +14,7 @@ Numbering
1xxxx XenSource, upstream Xen patch for 2.6.18
2xxxx Redhat, we use their Xen patch for >=2.6.20
3xxxx Debian, we use their security fixes for 2.6.18
+4xxxx Misc
5xxxx Gentoo, Xen and other fixes for Redhat and/or Debian patches.
Patches
@@ -30,6 +31,10 @@ Patches
(Xen).
See CVE-2007-4573
+40001_i386-fix-xen_l1_entry_update-for-highptes.patch
+ Fix for kernels compiled with CONFIG_HIGHPTE.
+ Pulled from linux-2.6.18-xen.hg, changeset e79729740288.
+
50001_make-install.patch
Handle make install in a semi-sane way that plays nice with
split domU/dom0 kernels.
@@ -48,6 +53,8 @@ Patches
50006_pgetable-build-fix.patch
Fix a function re-definition error when PAE is not enabled.
-50007_disable-highpte.patch
- CONFIG_HIGHPTE can cause serious problems so lets save people's
- sanity, avoid killing kittens, and end all war by disabling it.
+50008_reenable-tls-warning.patch
+ Issue only one big fat tls warning as upstream xen does.
+
+50009_gentooify-tls-warning.patch
+ Change tls warning instructions to apply directly to Gentoo.
diff --git a/trunk/2.6.20/20965_linux-2.6-xen-sleazy-fpu-i386.patch b/trunk/2.6.20/20965_linux-2.6-xen-sleazy-fpu-i386.patch
new file mode 100644
index 0000000..0145385
--- /dev/null
+++ b/trunk/2.6.20/20965_linux-2.6-xen-sleazy-fpu-i386.patch
@@ -0,0 +1,96 @@
+# HG changeset patch
+# User "Eduardo Habkost <ehabkost@redhat.com>"
+# Date 1190313016 10800
+# Node ID 8792a16b6dd531cad0ed28d9bef86e3e597ea8db
+# Parent 35983eae211a531bd50bcd177a9da77d48631e2c
+Fix sleazy-fpu under Xen
+
+- Make it reset fpu_counter when needed (like __unlazy_fpu() does)
+- Make it call clts() before restoring the fpu state during task switch
+ (clts() will still not be called during the device_not_available trap,
+ because it is not needed under Xen)
+
+diff -r 35983eae211a -r 8792a16b6dd5 arch/i386/kernel/entry-xen.S
+--- a/arch/i386/kernel/entry-xen.S Wed Aug 08 16:15:30 2007 -0300
++++ b/arch/i386/kernel/entry-xen.S Thu Sep 20 15:30:16 2007 -0300
+@@ -950,7 +950,9 @@ device_available_emulate:
+ device_available_emulate:
+ #endif
+ preempt_stop(CLBR_ANY)
+- call math_state_restore
++ # 'clts' is done by Xen during virtual trap, so we can call
++ # __math_state_restore instead of math_state_restore
++ call __math_state_restore
+ jmp ret_from_exception
+ CFI_ENDPROC
+
+diff -r 35983eae211a -r 8792a16b6dd5 arch/i386/kernel/process-xen.c
+--- a/arch/i386/kernel/process-xen.c Wed Aug 08 16:15:30 2007 -0300
++++ b/arch/i386/kernel/process-xen.c Thu Sep 20 15:30:16 2007 -0300
+@@ -597,7 +597,9 @@ struct task_struct fastcall * __switch_t
+ mcl->op = __HYPERVISOR_fpu_taskswitch;
+ mcl->args[0] = 1;
+ mcl++;
+- }
++ } else
++ prev_p->fpu_counter = 0;
++
+ #if 0 /* lazy fpu sanity check */
+ else BUG_ON(!(read_cr0() & 8));
+ #endif
+diff -r 35983eae211a -r 8792a16b6dd5 arch/i386/kernel/traps-xen.c
+--- a/arch/i386/kernel/traps-xen.c Wed Aug 08 16:15:30 2007 -0300
++++ b/arch/i386/kernel/traps-xen.c Thu Sep 20 15:30:16 2007 -0300
+@@ -1012,17 +1012,22 @@ fastcall unsigned long patch_espfix_desc
+ * Must be called with kernel preemption disabled (in this case,
+ * local interrupts are disabled at the call-site in entry.S).
+ */
+-asmlinkage void math_state_restore(void)
++asmlinkage void __math_state_restore(void)
+ {
+ struct thread_info *thread = current_thread_info();
+ struct task_struct *tsk = thread->task;
+
+- /* NB. 'clts' is done for us by Xen during virtual trap. */
+ if (!tsk_used_math(tsk))
+ init_fpu(tsk);
+ restore_fpu(tsk);
+ thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
+ tsk->fpu_counter++;
++}
++
++asmlinkage void math_state_restore(void)
++{
++ clts(); /* Allow maths ops (or we recurse) */
++ __math_state_restore();
+ }
+
+ #ifndef CONFIG_MATH_EMULATION
+diff -r 35983eae211a -r 8792a16b6dd5 arch/i386/kernel/traps.c
+--- a/arch/i386/kernel/traps.c Wed Aug 08 16:15:30 2007 -0300
++++ b/arch/i386/kernel/traps.c Thu Sep 20 15:30:16 2007 -0300
+@@ -1041,17 +1041,22 @@ fastcall unsigned long patch_espfix_desc
+ * Must be called with kernel preemption disabled (in this case,
+ * local interrupts are disabled at the call-site in entry.S).
+ */
+-asmlinkage void math_state_restore(void)
++asmlinkage void __math_state_restore(void)
+ {
+ struct thread_info *thread = current_thread_info();
+ struct task_struct *tsk = thread->task;
+
+- clts(); /* Allow maths ops (or we recurse) */
+ if (!tsk_used_math(tsk))
+ init_fpu(tsk);
+ restore_fpu(tsk);
+ thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
+ tsk->fpu_counter++;
++}
++
++asmlinkage void math_state_restore(void)
++{
++ clts(); /* Allow maths ops (or we recurse) */
++ __math_state_restore();
+ }
+
+ #ifndef CONFIG_MATH_EMULATION
diff --git a/trunk/2.6.20/20966_linux-2.6-xen-sleazy-fpu-x86_64.patch b/trunk/2.6.20/20966_linux-2.6-xen-sleazy-fpu-x86_64.patch
new file mode 100644
index 0000000..198182d
--- /dev/null
+++ b/trunk/2.6.20/20966_linux-2.6-xen-sleazy-fpu-x86_64.patch
@@ -0,0 +1,93 @@
+# HG changeset patch
+# User "Eduardo Habkost <ehabkost@redhat.com>"
+# Date 1190317568 10800
+# Node ID ab958de6e67d1b4f6c321cd46d2793d2409b91fd
+# Parent 8792a16b6dd531cad0ed28d9bef86e3e597ea8db
+x86_64: Fix sleazy-fpu under Xen
+
+- Make it reset fpu_counter when needed (like __unlazy_fpu() does)
+- Make it call clts() before restoring the fpu state during task switch
+ (clts() will still not be called during the device_not_available trap,
+ because it is not needed under Xen)
+
+diff -r 8792a16b6dd5 -r ab958de6e67d arch/x86_64/kernel/entry-xen.S
+--- a/arch/x86_64/kernel/entry-xen.S Thu Sep 20 15:30:16 2007 -0300
++++ b/arch/x86_64/kernel/entry-xen.S Thu Sep 20 16:46:08 2007 -0300
+@@ -1071,7 +1071,9 @@ END(simd_coprocessor_error)
+ END(simd_coprocessor_error)
+
+ ENTRY(device_not_available)
+- zeroentry math_state_restore
++ # 'clts' is done by Xen during virtual trap, so we can call
++ # __math_state_restore instead of math_state_restore
++ zeroentry __math_state_restore
+ END(device_not_available)
+
+ /* runs on exception stack */
+diff -r 8792a16b6dd5 -r ab958de6e67d arch/x86_64/kernel/process-xen.c
+--- a/arch/x86_64/kernel/process-xen.c Thu Sep 20 15:30:16 2007 -0300
++++ b/arch/x86_64/kernel/process-xen.c Thu Sep 20 16:46:08 2007 -0300
+@@ -637,7 +637,8 @@ __switch_to(struct task_struct *prev_p,
+ if (prev_p->thread_info->status & TS_USEDFPU) {
+ __save_init_fpu(prev_p); /* _not_ save_init_fpu() */
+ HYPERVISOR_fpu_taskswitch(1);
+- }
++ } else
++ prev_p->fpu_counter = 0;
+
+ /*
+ * Switch the PDA context.
+diff -r 8792a16b6dd5 -r ab958de6e67d arch/x86_64/kernel/traps-xen.c
+--- a/arch/x86_64/kernel/traps-xen.c Thu Sep 20 15:30:16 2007 -0300
++++ b/arch/x86_64/kernel/traps-xen.c Thu Sep 20 16:46:08 2007 -0300
+@@ -1064,16 +1064,21 @@ asmlinkage void __attribute__((weak)) mc
+ * Careful.. There are problems with IBM-designed IRQ13 behaviour.
+ * Don't touch unless you *really* know how it works.
+ */
+-asmlinkage void math_state_restore(void)
++asmlinkage void __math_state_restore(void)
+ {
+ struct task_struct *me = current;
+- /* clts(); */ /* 'clts' is done for us by Xen during virtual trap. */
+
+ if (!used_math())
+ init_fpu(me);
+ restore_fpu_checking(&me->thread.i387.fxsave);
+ task_thread_info(me)->status |= TS_USEDFPU;
+ me->fpu_counter++;
++}
++
++asmlinkage void math_state_restore(void)
++{
++ clts(); /* Allow maths ops (or we recurse) */
++ __math_state_restore();
+ }
+
+
+diff -r 8792a16b6dd5 -r ab958de6e67d arch/x86_64/kernel/traps.c
+--- a/arch/x86_64/kernel/traps.c Thu Sep 20 15:30:16 2007 -0300
++++ b/arch/x86_64/kernel/traps.c Thu Sep 20 16:46:08 2007 -0300
+@@ -1056,16 +1056,21 @@ asmlinkage void __attribute__((weak)) mc
+ * Careful.. There are problems with IBM-designed IRQ13 behaviour.
+ * Don't touch unless you *really* know how it works.
+ */
+-asmlinkage void math_state_restore(void)
++asmlinkage void __math_state_restore(void)
+ {
+ struct task_struct *me = current;
+- clts(); /* Allow maths ops (or we recurse) */
+
+ if (!used_math())
+ init_fpu(me);
+ restore_fpu_checking(&me->thread.i387.fxsave);
+ task_thread_info(me)->status |= TS_USEDFPU;
+ me->fpu_counter++;
++}
++
++asmlinkage void math_state_restore(void)
++{
++ clts(); /* Allow maths ops (or we recurse) */
++ __math_state_restore();
+ }
+
+ void __init trap_init(void)
diff --git a/trunk/2.6.20/40001_i386-fix-xen_l1_entry_update-for-highptes.patch b/trunk/2.6.20/40001_i386-fix-xen_l1_entry_update-for-highptes.patch
new file mode 100644
index 0000000..15a62eb
--- /dev/null
+++ b/trunk/2.6.20/40001_i386-fix-xen_l1_entry_update-for-highptes.patch
@@ -0,0 +1,26 @@
+# HG changeset patch
+# User Keir Fraser <keir@xensource.com>
+# Date 1192114936 -3600
+# Node ID e797297402885cc19e0799c7bcaf3e1acb427523
+# Parent 48a6d8bc31b8717c4218fc5e3c5bc9d848703db4
+i386: Fix xen_l1_entry_update() for highptes.
+Signed-off-by: Keir Fraser <keir@xensource.com>
+
+(Tweaked for 2.6.20)
+
+diff -r 48a6d8bc31b8 -r e79729740288 arch/i386/mm/hypervisor.c
+--- a/arch/i386/mm/hypervisor.c Wed Oct 10 11:32:15 2007 +0100
++++ b/arch/i386/mm/hypervisor.c Thu Oct 11 16:02:16 2007 +0100
+@@ -47,7 +47,12 @@ void xen_l1_entry_update(pte_t *ptr, pte
+ void xen_l1_entry_update(pte_t *ptr, pte_t val)
+ {
+ mmu_update_t u;
++#ifdef CONFIG_HIGHPTE
++ u.ptr = ((unsigned long)ptr >= (unsigned long)high_memory) ?
++ arbitrary_virt_to_machine(ptr) : virt_to_machine(ptr);
++#else
+ u.ptr = virt_to_machine(ptr);
++#endif
+ u.val = pte_val_ma(val);
+ BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
+ }
diff --git a/trunk/2.6.20/50007_disable-highpte.patch b/trunk/2.6.20/50007_disable-highpte.patch
deleted file mode 100644
index 3d829fc..0000000
--- a/trunk/2.6.20/50007_disable-highpte.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: linux-2.6.18/arch/i386/Kconfig
-===================================================================
---- linux-2.6.18.orig/arch/i386/Kconfig
-+++ linux-2.6.18/arch/i386/Kconfig
-@@ -624,7 +624,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
diff --git a/trunk/2.6.20/50008_reenable-tls-warning.patch b/trunk/2.6.20/50008_reenable-tls-warning.patch
new file mode 100644
index 0000000..c2bfdbe
--- /dev/null
+++ b/trunk/2.6.20/50008_reenable-tls-warning.patch
@@ -0,0 +1,23 @@
+--- linux-2.6.20-xen-r6.orig/arch/i386/kernel/fixup.c 2007-10-15 15:22:09.000000000 -0700
++++ linux-2.6.20-xen-r6/arch/i386/kernel/fixup.c 2007-10-15 16:04:23.000000000 -0700
+@@ -38,7 +38,6 @@
+
+ fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
+ {
+-#if 0
+ static unsigned long printed = 0;
+ char info[100];
+ int i;
+@@ -78,12 +77,6 @@
+ }
+
+ printk("Continuing...\n\n");
+-#else
+- if (printk_ratelimit())
+- printk(KERN_WARNING
+- "4gb seg fixup, process %s (pid %d), cs:ip %02x:%08lx\n",
+- current->comm, current->tgid, regs->xcs, regs->eip);
+-#endif
+ }
+
+ static int __init fixup_init(void)
diff --git a/trunk/2.6.20/50009_gentooify-tls-warning.patch b/trunk/2.6.20/50009_gentooify-tls-warning.patch
new file mode 100644
index 0000000..3c3db12
--- /dev/null
+++ b/trunk/2.6.20/50009_gentooify-tls-warning.patch
@@ -0,0 +1,16 @@
+--- linux-2.6.20-xen-r6.orig/arch/i386/kernel/fixup.c 2007-10-15 16:07:58.000000000 -0700
++++ linux-2.6.20-xen-r6/arch/i386/kernel/fixup.c 2007-10-15 16:15:01.000000000 -0700
+@@ -60,10 +60,9 @@
+ DP("** WARNING: Currently emulating unsupported memory accesses **");
+ DP("** in /lib/tls glibc libraries. The emulation is **");
+ DP("** slow. To ensure full performance you should **");
+- DP("** install a 'xen-friendly' (nosegneg) version of **");
+- DP("** the library, or disable tls support by executing **");
+- DP("** the following as root: **");
+- DP("** mv /lib/tls /lib/tls.disabled **");
++ DP("** add -mno-tls-direct-seg-refs to your CFLAGS and **");
++ DP("** re-emerge glibc and any staticly linked programs **");
++ DP("** or emerge -e world to catch everything. **");
+ DP("** Offending process: %-38.38s **", info);
+ DP("***************************************************************");
+ DP("***************************************************************");