direct-io.hg

changeset 5686:5ead5ffa04c2

Fix SMP_ALTERNATIVES to cope with discarded init data.
Signed-off-by: steven.smith@cl.cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Wed Jul 06 18:33:27 2005 +0000 (2005-07-06)
parents 189c87adf876
children bd1642e8599e
files patches/linux-2.6.11/smp-alts.patch
line diff
     1.1 --- a/patches/linux-2.6.11/smp-alts.patch	Wed Jul 06 10:46:29 2005 +0000
     1.2 +++ b/patches/linux-2.6.11/smp-alts.patch	Wed Jul 06 18:33:27 2005 +0000
     1.3 @@ -35,7 +35,7 @@ diff -Naur linux-2.6.11/arch/i386/kernel
     1.4  diff -Naur linux-2.6.11/arch/i386/kernel/smpalts.c linux-2.6.11.post/arch/i386/kernel/smpalts.c
     1.5  --- linux-2.6.11/arch/i386/kernel/smpalts.c	1970-01-01 01:00:00.000000000 +0100
     1.6  +++ linux-2.6.11.post/arch/i386/kernel/smpalts.c	2005-06-16 11:23:39.300902424 +0100
     1.7 -@@ -0,0 +1,76 @@
     1.8 +@@ -0,0 +1,85 @@
     1.9  +#include <linux/kernel.h>
    1.10  +#include <asm/system.h>
    1.11  +#include <asm/smp_alt.h>
    1.12 @@ -58,6 +58,7 @@ diff -Naur linux-2.6.11/arch/i386/kernel
    1.13  +
    1.14  +extern struct smp_alternative_record __start_smp_alternatives_table,
    1.15  +  __stop_smp_alternatives_table;
    1.16 ++extern unsigned long __init_begin, __init_end;
    1.17  +
    1.18  +void prepare_for_smp(void)
    1.19  +{
    1.20 @@ -69,6 +70,10 @@ diff -Naur linux-2.6.11/arch/i386/kernel
    1.21  +		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
    1.22  +		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
    1.23  +		BUG_ON(r->repl->targ_size < r->repl->up_size);
    1.24 ++               if (system_state == SYSTEM_RUNNING &&
    1.25 ++                   r->targ_start >= (void *)&__init_begin &&
    1.26 ++                   r->targ_start < (void *)&__init_end)
    1.27 ++                       continue;
    1.28  +		if (r->repl->feature != (unsigned char)-1 &&
    1.29  +		    boot_cpu_has(r->repl->feature)) {
    1.30  +			memcpy(r->targ_start,
    1.31 @@ -101,6 +106,10 @@ diff -Naur linux-2.6.11/arch/i386/kernel
    1.32  +		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
    1.33  +		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
    1.34  +		BUG_ON(r->repl->targ_size < r->repl->up_size);
    1.35 ++               if (system_state == SYSTEM_RUNNING &&
    1.36 ++                   r->targ_start >= (void *)&__init_begin &&
    1.37 ++                   r->targ_start < (void *)&__init_end)
    1.38 ++                       continue;
    1.39  +		memcpy(r->targ_start,
    1.40  +		       r->repl->data + r->repl->smp1_size + r->repl->smp2_size,
    1.41  +		       r->repl->up_size);