2003-09-24 01:02:52

by john stultz

[permalink] [raw]
Subject: [PATCH] linux-2.4.23-pre5_nrcpus-fix_A0

Marcelo, all,
This is a backported patch from 2.5 that fixes array overflows and
memory corruption when booting on boxes with more processors then
CONFIG_NR_CPUS.

Please consider for acceptance.

thanks
-john

diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c Tue Sep 23 17:54:34 2003
+++ b/arch/i386/kernel/mpparse.c Tue Sep 23 17:54:34 2003
@@ -229,6 +229,11 @@
boot_cpu_logical_apicid = logical_apicid;
}

+ if (num_processors >= NR_CPUS){
+ printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot "
+ "boot CPU(apicid 0x%d).\n", NR_CPUS, m->mpc_apicid);
+ return;
+ }
num_processors++;

if (m->mpc_apicid > MAX_APICS) {




2003-09-24 22:10:47

by john stultz

[permalink] [raw]
Subject: [PATCH] linux-2.4.23-pre5_nrcpus-fix_A1

On Tue, 2003-09-23 at 17:59, john stultz wrote:
> Marcelo, all,
> This is a backported patch from 2.5 that fixes array overflows and
> memory corruption when booting on boxes with more processors then
> CONFIG_NR_CPUS.
>

Marcelo, All,
James Cleverdon pointed out that I had a printk formatting typo in the
last revision of this patch ( "0x%d" - doh!).

Anyway, this revision corrects the error, changing 0x%d -> 0x%x.

thanks
-john

diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c Wed Sep 24 15:02:51 2003
+++ b/arch/i386/kernel/mpparse.c Wed Sep 24 15:02:51 2003
@@ -229,6 +229,11 @@
boot_cpu_logical_apicid = logical_apicid;
}

+ if (num_processors >= NR_CPUS){
+ printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot "
+ "boot CPU(apicid 0x%x).\n", NR_CPUS, m->mpc_apicid);
+ return;
+ }
num_processors++;

if (m->mpc_apicid > MAX_APICS) {



2003-09-29 01:44:32

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: [PATCH] linux-2.4.23-pre5_nrcpus-fix_A1



On 24 Sep 2003, john stultz wrote:

> On Tue, 2003-09-23 at 17:59, john stultz wrote:
> > Marcelo, all,
> > This is a backported patch from 2.5 that fixes array overflows and
> > memory corruption when booting on boxes with more processors then
> > CONFIG_NR_CPUS.
> >
>
> Marcelo, All,
> James Cleverdon pointed out that I had a printk formatting typo in the
> last revision of this patch ( "0x%d" - doh!).
>
> Anyway, this revision corrects the error, changing 0x%d -> 0x%x.
>
> thanks
> -john
>
> diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
> --- a/arch/i386/kernel/mpparse.c Wed Sep 24 15:02:51 2003
> +++ b/arch/i386/kernel/mpparse.c Wed Sep 24 15:02:51 2003
> @@ -229,6 +229,11 @@
> boot_cpu_logical_apicid = logical_apicid;
> }
>
> + if (num_processors >= NR_CPUS){
> + printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot "
> + "boot CPU(apicid 0x%x).\n", NR_CPUS, m->mpc_apicid);
> + return;
> + }
> num_processors++;
>
> if (m->mpc_apicid > MAX_APICS) {

Applied thanks.