2003-09-11 22:21:25

by Mikael Pettersson

[permalink] [raw]
Subject: [PATCH][2.4.23-pre3] repair mpparse for default MP systems

Mathieu,

This patch for 2.4.23-pre3 should fix the problems your dual
P5 with default MP config has been having since 2.4.21-pre2.
Please let us know if it works or not.

/Mikael

--- linux-2.4.23-pre3/arch/i386/kernel/mpparse.c.~1~ 2003-09-11 19:49:56.000000000 +0200
+++ linux-2.4.23-pre3/arch/i386/kernel/mpparse.c 2003-09-11 23:31:32.000000000 +0200
@@ -683,6 +683,24 @@
struct mpc_config_lintsrc lintsrc;
int linttypes[2] = { mp_ExtINT, mp_NMI };
int i;
+ struct {
+ int mp_bus_id_to_type[MAX_MP_BUSSES];
+ int mp_bus_id_to_node[MAX_MP_BUSSES];
+ int mp_bus_id_to_local[MAX_MP_BUSSES];
+ int mp_bus_id_to_pci_bus[MAX_MP_BUSSES];
+ struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
+ } *bus_data;
+
+ bus_data = alloc_bootmem(sizeof(*bus_data));
+ if (!bus_data)
+ panic("SMP mptable: out of memory!\n");
+ mp_bus_id_to_type = bus_data->mp_bus_id_to_type;
+ mp_bus_id_to_node = bus_data->mp_bus_id_to_node;
+ mp_bus_id_to_local = bus_data->mp_bus_id_to_local;
+ mp_bus_id_to_pci_bus = bus_data->mp_bus_id_to_pci_bus;
+ mp_irqs = bus_data->mp_irqs;
+ for (i = 0; i < MAX_MP_BUSSES; ++i)
+ mp_bus_id_to_pci_bus[i] = -1;

/*
* local APIC has default address


2003-09-12 03:16:25

by Mathieu Desnoyers

[permalink] [raw]
Subject: Re: [PATCH][2.4.23-pre3] repair mpparse for default MP systems

* Mikael Pettersson ([email protected]) wrote:
> Mathieu,
>
> This patch for 2.4.23-pre3 should fix the problems your dual
> P5 with default MP config has been having since 2.4.21-pre2.
> Please let us know if it works or not.
>
> /Mikael
>

Yes, I just tested this patch, and everything seems to work fine. Thank
you. :)

The only point I see, which is not triggered on my machine (because of
the absence of ACPI) is this one :

There is also an initialization of this mp_irqs variable in
mp_config_acpi_legacy_irqs from mpparse.c. It only seems to be called
from within acpi_boot_init in acpi.c. So I wonder if it's possible that
we do use default configuration and then also go into
mp_config_acpi_legacy_irqs during the acpi init, thus reserving the
memory twice and forgetting the old pointer, which could lead to an
erratic result.

If it's possible, then there is still a problem in there.

OpenPGP public key: http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

2003-09-12 09:31:17

by Mikael Pettersson

[permalink] [raw]
Subject: Re: [PATCH][2.4.23-pre3] repair mpparse for default MP systems

Mathieu Desnoyers writes:
> * Mikael Pettersson ([email protected]) wrote:
> > Mathieu,
> >
> > This patch for 2.4.23-pre3 should fix the problems your dual
> > P5 with default MP config has been having since 2.4.21-pre2.
> > Please let us know if it works or not.
> >
> > /Mikael
> >
>
> Yes, I just tested this patch, and everything seems to work fine. Thank
> you. :)
>
> The only point I see, which is not triggered on my machine (because of
> the absence of ACPI) is this one :
>
> There is also an initialization of this mp_irqs variable in
> mp_config_acpi_legacy_irqs from mpparse.c. It only seems to be called
> from within acpi_boot_init in acpi.c. So I wonder if it's possible that
> we do use default configuration and then also go into
> mp_config_acpi_legacy_irqs during the acpi init, thus reserving the
> memory twice and forgetting the old pointer, which could lead to an
> erratic result.
>
> If it's possible, then there is still a problem in there.

I looked through acpi/mpparse/setup and I don't think there is
a problem. acpi does mp_config_acpi_legacy_irqs if it found its
tables, but this is done before get_smp_config, and get_smp_config
bails out early if ACPI already has done the deed. If it were a
problem, it would affect _all_ MP configs not just yours.

I'll submit the patch to Marcelo then, with appropriate explaination.
(No forward port to 2.6 is needed, since the arrays-to-pointers
change hasn't been done there (yet).)

/Mikael

2003-09-12 11:59:05

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: [PATCH][2.4.23-pre3] repair mpparse for default MP systems

On Fri, 12 Sep 2003, Mikael Pettersson wrote:

> I'll submit the patch to Marcelo then, with appropriate explaination.

Thanks a lot for your work -- the changes look just fine.

--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: [email protected], PGP key available +