- Add early detection of UV system types
PATCH 1/1 - Add early detection of UV system types
Portions of system boot needs to know if a system is a UV system prior to genapic initialization. This patch adds a call from acpi_boot_table_init() to the UV code to parse the MADT to determine if the system is a UV system.
--- arch/x86/kernel/acpi/boot.c | 4 ++++ arch/x86/kernel/genx2apic_uv_x.c | 21 ++++++++++++--------- arch/x86/mm/srat_64.c | 2 +- include/asm-x86/genapic_64.h | 2 ++ 4 files changed, 19 insertions(+), 10 deletions(-)
arch/x86/kernel/acpi/boot.c +4 -0
@@ -1667,6 +1667,10 @@ int __init acpi_boot_table_init(void)acpi_table_parse (ACPI_SIG_BOOT , acpi_parse_sbf); +#ifdef CONFIG_X86_64 +acpi_table_parse (ACPI_SIG_MADT , uv_early_madt_oem_check); +#endif +/* * blacklist may disable ACPI entirely */
arch/x86/kernel/genx2apic_uv_x.c +12 -9
@@ -18,6 +18,7 @@#include <linux/bootmem.h> #include <linux/module.h> #include <linux/hardirq.h> +#include <linux/acpi.h> #include <asm/smp.h> #include <asm/ipi.h> #include <asm/genapic.h>
@@ -25,26 +26,28 @@#include <asm/uv/uv_mmrs.h> #include <asm/uv/uv_hub.h> #include <asm/uv/bios.h> -DEFINE_PER_CPU (int, x2apic_extra_bits);static enum uv_system_type uv_system_type; -static int __init uv_acpi_madt_oem_check (char *oem_id,char *oem_table_id) +int __init uv_early_madt_oem_check (struct acpi_table_header *table) { -if (!strcmp (oem_id,"SGI" )) { -if (!strcmp (oem_table_id,"UVL" )) +if (!strcmp (table->oem_id,"SGI" )) { +if (!strcmp (table->oem_table_id,"UVL" )) uv_system_type =UV_LEGACY_APIC ; -else if (!strcmp (oem_table_id,"UVX" )) +else if (!strcmp (table->oem_table_id,"UVX" )) uv_system_type =UV_X2APIC ; -else if (!strcmp (oem_table_id,"UVH" )) { +else if (!strcmp (table->oem_table_id,"UVH" )) uv_system_type =UV_NON_UNIQUE_APIC ; -return 1 ; - } }return 0 ; } +static int is_uv_apic (char *oem_id,char *oem_table_id) +{ +return uv_system_type ==UV_NON_UNIQUE_APIC ; +} +enum uv_system_type get_uv_system_type (void ) {return uv_system_type;
@@ -211,7 +214,7 @@ static void uv_send_IPI_self(int vector)struct genapic apic_x2apic_uv_x = { .name ="UV large system" , - .acpi_madt_oem_check = uv_acpi_madt_oem_check, + .acpi_madt_oem_check = is_uv_apic, .int_delivery_mode = dest_Fixed, .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), .target_cpus = uv_target_cpus,
arch/x86/mm/srat_64.c +1 -1
@@ -138,7 +138,7 @@ acpi_numa_processor_affinity_init(structreturn ; } -if (is_uv_system ()) +if (get_uv_system_type () >=UV_X2APIC ) apic_id = (pa->apic_id <<8 ) | pa->local_sapic_eid;else apic_id = pa->apic_id;
include/asm-x86/genapic_64.h +2 -0
@@ -46,6 +46,8 @@ extern void apic_send_IPI_self(int vectoenum uv_system_type {UV_NONE ,UV_LEGACY_APIC ,UV_X2APIC ,UV_NON_UNIQUE_APIC };extern enum uv_system_type get_uv_system_type (void );extern int is_uv_system (void ); +struct acpi_table_header ; +extern int uv_early_madt_oem_check (struct acpi_table_header *table);extern struct genapic apic_x2apic_uv_x;DECLARE_PER_CPU (int, x2apic_extra_bits);
Quoted 18 lines · Jack Steiner
Portions of system boot needs to know if a system is a UV system prior to genapic initialization. This patch adds a call from
acpi_boot_table_init()to the UV code to parse the MADT to determine if the system is a UV system.Signed-off-by Jack Steiner <[email protected]>--- arch/x86/kernel/acpi/boot.c | 4 ++++ arch/x86/kernel/genx2apic_uv_x.c | 21 ++++++++++++--------- arch/x86/mm/srat_64.c | 2 +- include/asm-x86/genapic_64.h | 2 ++ 4 files changed, 19 insertions(+), 10 deletions(-)Index:
linux/arch/x86/kernel/acpi/boot.c
===================================================================
arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500 int __init acpi_boot_table_init(void) · line 1676
Quoted 10 lines
arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500 renamed from arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:15.000000000 -0500 +4
-0@@ -1667,6 +1667,10 @@ int __init acpi_boot_table_init(void) acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); +#ifdef CONFIG_X86_64 + acpi_table_parse(ACPI_SIG_MADT, uv_early_madt_oem_check); +#endif + /* * blacklist may disable ACPI entirely */
you don't need to that.
please call early_acpi_boot_init instead
sth like
arch/x86/kernel/setup.c +2 -0
@@ -997,6 +997,8 @@ void __init setup_arch(char **cmdline_p)*/ acpi_boot_table_init (); +early_acpi_boot_init (); +#ifdef CONFIG_ACPI_NUMA /* * Parse SRAT to discover nodes.
YH
Quoted 32 lines · Yinghai Lu
Quoted 18 lines · Jack Steiner
Portions of system boot needs to know if a system is a UV system prior to genapic initialization. This patch adds a call from
acpi_boot_table_init()to the UV code to parse the MADT to determine if the system is a UV system.Signed-off-by Jack Steiner <[email protected]>--- arch/x86/kernel/acpi/boot.c | 4 ++++ arch/x86/kernel/genx2apic_uv_x.c | 21 ++++++++++++--------- arch/x86/mm/srat_64.c | 2 +- include/asm-x86/genapic_64.h | 2 ++ 4 files changed, 19 insertions(+), 10 deletions(-)Index:
linux/arch/x86/kernel/acpi/boot.c
===================================================================arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500 int __init acpi_boot_table_init(void) · line 1676
Quoted 10 lines
arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500 renamed from arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:15.000000000 -0500 +4
-0@@ -1667,6 +1667,10 @@ int __init acpi_boot_table_init(void) acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); +#ifdef CONFIG_X86_64 + acpi_table_parse(ACPI_SIG_MADT, uv_early_madt_oem_check); +#endif + /* * blacklist may disable ACPI entirely */you don't need to that.
Quoted 1 line
please call
early_acpi_boot_initinstead
I don't mind moving the new call from acpi_boot_table_init() to early_acpi_boot_init(), but I still need to determine the UV type very early in boot. System type is needed prior to parsing the SRAT.
Quoted 18 lines
sth like
arch/x86/kernel/setup.c +2
-0@@ -997,6 +997,8 @@ void __init setup_arch(char **cmdline_p)*/ acpi_boot_table_init (); +early_acpi_boot_init (); +#ifdef CONFIG_ACPI_NUMA /* * Parse SRAT to discover nodes. YH
Quoted 50 lines · Jack Steiner
Quoted 32 lines · Yinghai Lu
Quoted 18 lines · Jack Steiner
Portions of system boot needs to know if a system is a UV system prior to genapic initialization. This patch adds a call from
acpi_boot_table_init()to the UV code to parse the MADT to determine if the system is a UV system.Signed-off-by Jack Steiner <[email protected]>--- arch/x86/kernel/acpi/boot.c | 4 ++++ arch/x86/kernel/genx2apic_uv_x.c | 21 ++++++++++++--------- arch/x86/mm/srat_64.c | 2 +- include/asm-x86/genapic_64.h | 2 ++ 4 files changed, 19 insertions(+), 10 deletions(-)Index:
linux/arch/x86/kernel/acpi/boot.c
===================================================================arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500 int __init acpi_boot_table_init(void) · line 1676
Quoted 10 lines
arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500 renamed from arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:15.000000000 -0500 +4
-0@@ -1667,6 +1667,10 @@ int __init acpi_boot_table_init(void) acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); +#ifdef CONFIG_X86_64 + acpi_table_parse(ACPI_SIG_MADT, uv_early_madt_oem_check); +#endif + /* * blacklist may disable ACPI entirely */you don't need to that.
Quoted 1 line
please call
early_acpi_boot_initinsteadI don't mind moving the new call from
acpi_boot_table_init()toearly_acpi_boot_init(), but I still need to determine the UV type very early in boot. System type is needed prior to parsing the SRAT.Quoted 11 lines
sth like
arch/x86/kernel/setup.c +0
-0@@ -997,6 +997,8 @@ void __init setup_arch(char **cmdline_p)*/ acpi_boot_table_init ();
Quoted 8 lines
Quoted 7 lines
arch/x86/kernel/setup.c +2
-0+early_acpi_boot_init (); +#ifdef CONFIG_ACPI_NUMA /* * Parse SRAT to discover nodes. YH
early_acpi_boot_init ==> early_acpi_process_madt ==> acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt) ==> acpi_parse_madt ==> acpi_madt_oem_check
==> at last
int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
int i;
for (i = 0; apic_probe[i]; ++i) {
if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
genapic = apic_probe[i];
printk(KERN_INFO "Setting APIC routing to %s.\n",
genapic->name);
return 1;
}
}
return 0;
}and
static struct genapic *apic_probe[] __initdata = {
&apic_x2apic_uv_x,
&apic_x2apic_phys,
&apic_x2apic_cluster,
&apic_physflat,
NULL,
};so apic_x2apic_uv_x's uv_acpi_madt_oem_check is called at first.
YH
Re: [PATCH] - V2 Add early detection of UV system types
Portions of the ACPI code needs to know if a system is a UV system prior to genapic initialization. This patch adds a call early_acpi_boot_init() so that the apic type is discovered earlier.
---
V2 of the patch adding fixes from Yinghai Lu.
Much cleaner and smaller.
arch/x86/kernel/setup.c | 2 ++ arch/x86/mm/srat_64.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/setup.c +2 -0
@@ -960,6 +960,8 @@ void __init setup_arch(char **cmdline_p)*/ acpi_boot_table_init (); +early_acpi_boot_init (); +#ifdef CONFIG_ACPI_NUMA /* * Parse SRAT to discover nodes.
arch/x86/mm/srat_64.c +1 -1
@@ -138,7 +138,7 @@ acpi_numa_processor_affinity_init(structreturn ; } -if (is_uv_system ()) +if (get_uv_system_type () >=UV_X2APIC ) apic_id = (pa->apic_id <<8 ) | pa->local_sapic_eid;else apic_id = pa->apic_id;
Ingo Molnar
AppliedRe: [PATCH] - V2 Add early detection of UV system types
Quoted 10 lines · Jack Steiner
Portions of the ACPI code needs to know if a system is a UV system prior to genapic initialization. This patch adds a call
early_acpi_boot_init()so that the apic type is discovered earlier.Signed-off-by Jack Steiner <[email protected]>---
V2 of the patch adding fixes from Yinghai Lu.
Much cleaner and smaller.
applied to tip/x86/uv, thanks!
Ingo