From: Jack Steiner <steiner@sgi.com>
To: mingo@elte.hu, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] - Add early detection of UV system types
Date: Tue, 23 Sep 2008 13:28:17 -0500 [thread overview]
Message-ID: <20080923182817.GA6335@sgi.com> (raw)
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 <steiner@sgi.com>
---
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
===================================================================
--- linux.orig/arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:15.000000000 -0500
+++ linux/arch/x86/kernel/acpi/boot.c 2008-09-23 12:55:19.000000000 -0500
@@ -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
*/
Index: linux/arch/x86/kernel/genx2apic_uv_x.c
===================================================================
--- linux.orig/arch/x86/kernel/genx2apic_uv_x.c 2008-09-23 12:55:19.000000000 -0500
+++ linux/arch/x86/kernel/genx2apic_uv_x.c 2008-09-23 12:56:15.000000000 -0500
@@ -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,
Index: linux/arch/x86/mm/srat_64.c
===================================================================
--- linux.orig/arch/x86/mm/srat_64.c 2008-09-23 12:55:15.000000000 -0500
+++ linux/arch/x86/mm/srat_64.c 2008-09-23 12:55:19.000000000 -0500
@@ -138,7 +138,7 @@ acpi_numa_processor_affinity_init(struct
return;
}
- 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;
Index: linux/include/asm-x86/genapic_64.h
===================================================================
--- linux.orig/include/asm-x86/genapic_64.h 2008-09-23 12:55:15.000000000 -0500
+++ linux/include/asm-x86/genapic_64.h 2008-09-23 12:55:19.000000000 -0500
@@ -46,6 +46,8 @@ extern void apic_send_IPI_self(int vecto
enum 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);
next reply other threads:[~2008-09-23 18:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 18:28 Jack Steiner [this message]
2008-09-23 18:59 ` [PATCH] - Add early detection of UV system types Yinghai Lu
2008-09-23 19:30 ` Jack Steiner
2008-09-23 19:39 ` Yinghai Lu
2008-09-23 20:37 ` [PATCH] - V2 " Jack Steiner
2008-09-24 8:34 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080923182817.GA6335@sgi.com \
--to=steiner@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.