Re: [PATCH] x86: add apic probe for genapic 64bit v2

From: Yinghai Lu
Date: Tue Jul 22 2008 - 04:10:01 EST


On Tue, Jul 22, 2008 at 12:13 AM, Ingo Molnar <mingo@xxxxxxx> wrote:
>
> * Ingo Molnar <mingo@xxxxxxx> wrote:
>
>> > v2: fix compiling when CONFIG_ACPI is not set
>>
>> applied to tip/x86/x2apic - thanks Yinghai.
>>
>> > +static struct genapic *apic_probe[] __initdata = {
>> > + &apic_x2apic_uv_x,
>> > + &apic_x2apic_phys,
>> > + &apic_x2apic_cluster,
>> > + &apic_physflat,
>> > + NULL,
>> > +};
>>
>> very nice generalization!
>
> btw.:
>
> apic_probe[i]->acpi_madt_oem_check
>
> should probably be renamed to something more neutral like "->probe" -
> there's nothing ACPI about it and some weird boxes could use PCI or
> other probing mechanisms to discover the type of APIC they want to use.

32bit has acpi_madt_oem_check and mps_oem_check
64bit should only have acpi_madt_oem_check

>
> plus i guess genapic_32.h and genapic_64.h should be unified and struct
> apic_ops should be put into struct genapic?

yes.

hope to call acpi_madt_oem_check and mps_oem_check right after
acpi_boot_table_init
to decide apic_ops and genapic as early as possible.


Jack/Mike,
does your big box support SRAT? it seems it calling is_uv_system
before acpi_madt_oem_check is called.
I like to call early_acpi_boot_init, before acpi_numa_init so
acpi_madt_oem_check is called before srat is used. can you check
attached patch on your system?

YH
[PATCH] x86: call early_acpi_boot_init before acpi_numa_init

so could call acpi_madt_oem_check early to find out if it uv system.
and acpi_numa_init could call is_uv_system()

Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>

---
arch/x86/kernel/setup.c | 4 ++++
1 file changed, 4 insertions(+)

Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -785,6 +785,10 @@ void __init setup_arch(char **cmdline_p)
acpi_boot_table_init();

#ifdef CONFIG_ACPI_NUMA
+#ifdef CONFIG_X86_64
+ /* try to call acpi_madt_oem_check here */
+ early_acpi_boot_init();
+#endif
/*
* Parse SRAT to discover nodes.
*/