aboutsummaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>2005-07-06 18:33:27 +0000
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>2005-07-06 18:33:27 +0000
commit7f8b4ff21e0e643a61d78bae27be457f0b14b70c (patch)
treecb35b8fdec5888eb12bd1a9f787d26fa5fc6cf14 /patches
parentb7d34829a343a9fcc9e5d6a64d6138bc6ce0d160 (diff)
downloadxen-7f8b4ff21e0e643a61d78bae27be457f0b14b70c.tar.gz
xen-7f8b4ff21e0e643a61d78bae27be457f0b14b70c.tar.bz2
xen-7f8b4ff21e0e643a61d78bae27be457f0b14b70c.zip
Fix SMP_ALTERNATIVES to cope with discarded init data.
Signed-off-by: steven.smith@cl.cam.ac.uk
Diffstat (limited to 'patches')
-rw-r--r--patches/linux-2.6.11/smp-alts.patch11
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/linux-2.6.11/smp-alts.patch b/patches/linux-2.6.11/smp-alts.patch
index db71ab1e56..5d18c5e71a 100644
--- a/patches/linux-2.6.11/smp-alts.patch
+++ b/patches/linux-2.6.11/smp-alts.patch
@@ -35,7 +35,7 @@ diff -Naur linux-2.6.11/arch/i386/kernel/Makefile linux-2.6.11.post/arch/i386/ke
diff -Naur linux-2.6.11/arch/i386/kernel/smpalts.c linux-2.6.11.post/arch/i386/kernel/smpalts.c
--- linux-2.6.11/arch/i386/kernel/smpalts.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.11.post/arch/i386/kernel/smpalts.c 2005-06-16 11:23:39.300902424 +0100
-@@ -0,0 +1,76 @@
+@@ -0,0 +1,85 @@
+#include <linux/kernel.h>
+#include <asm/system.h>
+#include <asm/smp_alt.h>
@@ -58,6 +58,7 @@ diff -Naur linux-2.6.11/arch/i386/kernel/smpalts.c linux-2.6.11.post/arch/i386/k
+
+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)
+{
@@ -69,6 +70,10 @@ diff -Naur linux-2.6.11/arch/i386/kernel/smpalts.c linux-2.6.11.post/arch/i386/k
+ 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,
@@ -101,6 +106,10 @@ diff -Naur linux-2.6.11/arch/i386/kernel/smpalts.c linux-2.6.11.post/arch/i386/k
+ 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);