* [PATCH 0/3] UV: Update UV APIC checks for new systems.
@ 2015-04-09 18:26 Mike Travis
2015-04-09 18:26 ` [PATCH 1/3] X86, UV: Update UV APIC OEM check Mike Travis
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Mike Travis @ 2015-04-09 18:26 UTC (permalink / raw)
To: Ingo Molnar, Andrew Morton, Thomas Gleixner, H. Peter Anvin
Cc: Hedi Berriche, Dimitri Sivanich, x86, linux-kernel
In preparation for new UV systems, update various APIC checks
to prevent incompatible hardware/BIOS/kernel conflicts.
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] X86, UV: Update UV APIC OEM check 2015-04-09 18:26 [PATCH 0/3] UV: Update UV APIC checks for new systems Mike Travis @ 2015-04-09 18:26 ` Mike Travis 2015-04-10 17:43 ` [tip:x86/apic] x86/apic/uv: Update the APIC UV " tip-bot for Mike Travis 2015-04-09 18:26 ` [PATCH 2/3] X86, UV: Update UV APIC driver check Mike Travis 2015-04-09 18:26 ` [PATCH 3/3] X86, UV: Update UV APIC HUB check Mike Travis 2 siblings, 1 reply; 7+ messages in thread From: Mike Travis @ 2015-04-09 18:26 UTC (permalink / raw) To: Ingo Molnar, Andrew Morton, Thomas Gleixner, H. Peter Anvin Cc: Hedi Berriche, Dimitri Sivanich, x86, linux-kernel [-- Attachment #1: update-uv-apic-oem-check --] [-- Type: text/plain, Size: 711 bytes --] Optimize the first "SGI" OEM check to return faster if the system is not an SGI or UV system. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Hedi Berriche <hedi@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> --- arch/x86/kernel/apic/x2apic_uv_x.c | 3 +++ 1 file changed, 3 insertions(+) --- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c +++ linux/arch/x86/kernel/apic/x2apic_uv_x.c @@ -146,6 +146,9 @@ static int __init uv_acpi_madt_oem_check { int pnodeid, is_uv1, is_uv2, is_uv3; + if (strncmp(oem_id, "SGI", 3) != 0) + return 0; + is_uv1 = !strcmp(oem_id, "SGI"); is_uv2 = !strcmp(oem_id, "SGI2"); is_uv3 = !strncmp(oem_id, "SGI3", 4); /* there are varieties of UV3 */ -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:x86/apic] x86/apic/uv: Update the APIC UV OEM check 2015-04-09 18:26 ` [PATCH 1/3] X86, UV: Update UV APIC OEM check Mike Travis @ 2015-04-10 17:43 ` tip-bot for Mike Travis 0 siblings, 0 replies; 7+ messages in thread From: tip-bot for Mike Travis @ 2015-04-10 17:43 UTC (permalink / raw) To: linux-tip-commits; +Cc: hedi, mingo, tglx, linux-kernel, sivanich, hpa, travis Commit-ID: 7a4e017041136de05527722b97e0c1f8702a5cbe Gitweb: http://git.kernel.org/tip/7a4e017041136de05527722b97e0c1f8702a5cbe Author: Mike Travis <travis@sgi.com> AuthorDate: Thu, 9 Apr 2015 13:26:29 -0500 Committer: Ingo Molnar <mingo@kernel.org> CommitDate: Fri, 10 Apr 2015 10:16:07 +0200 x86/apic/uv: Update the APIC UV OEM check Optimize the first "SGI" OEM check to return faster if the system is not an SGI or UV system. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Hedi Berriche <hedi@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> Link: http://lkml.kernel.org/r/20150409182628.952357922@asylum.americas.sgi.com Signed-off-by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/apic/x2apic_uv_x.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 8e9dcfd..2a739a9 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -146,6 +146,9 @@ static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { int pnodeid, is_uv1, is_uv2, is_uv3; + if (strncmp(oem_id, "SGI", 3) != 0) + return 0; + is_uv1 = !strcmp(oem_id, "SGI"); is_uv2 = !strcmp(oem_id, "SGI2"); is_uv3 = !strncmp(oem_id, "SGI3", 4); /* there are varieties of UV3 */ ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] X86, UV: Update UV APIC driver check 2015-04-09 18:26 [PATCH 0/3] UV: Update UV APIC checks for new systems Mike Travis 2015-04-09 18:26 ` [PATCH 1/3] X86, UV: Update UV APIC OEM check Mike Travis @ 2015-04-09 18:26 ` Mike Travis 2015-04-10 17:43 ` [tip:x86/apic] x86/apic/uv: Update the " tip-bot for Mike Travis 2015-04-09 18:26 ` [PATCH 3/3] X86, UV: Update UV APIC HUB check Mike Travis 2 siblings, 1 reply; 7+ messages in thread From: Mike Travis @ 2015-04-09 18:26 UTC (permalink / raw) To: Ingo Molnar, Andrew Morton, Thomas Gleixner, H. Peter Anvin Cc: Hedi Berriche, Dimitri Sivanich, x86, linux-kernel [-- Attachment #1: update-uv-apic-driver-check --] [-- Type: text/plain, Size: 3279 bytes --] Fix a bug in the oem check function that determines if the system is a UV system and the BIOS is compatible with the kernel's UV apic driver. This prevents some possibly obscure panics and guards the system against being started on SGI hardware that does not have the required kernel support. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Hedi Berriche <hedi@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> --- arch/x86/kernel/apic/x2apic_uv_x.c | 74 ++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 25 deletions(-) --- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c +++ linux/arch/x86/kernel/apic/x2apic_uv_x.c @@ -144,36 +144,60 @@ static void __init uv_set_apicid_hibit(v static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { - int pnodeid, is_uv1, is_uv2, is_uv3; + int pnodeid; + int uv_apic; if (strncmp(oem_id, "SGI", 3) != 0) return 0; - is_uv1 = !strcmp(oem_id, "SGI"); - is_uv2 = !strcmp(oem_id, "SGI2"); - is_uv3 = !strncmp(oem_id, "SGI3", 4); /* there are varieties of UV3 */ - if (is_uv1 || is_uv2 || is_uv3) { - uv_hub_info->hub_revision = - (is_uv1 ? UV1_HUB_REVISION_BASE : - (is_uv2 ? UV2_HUB_REVISION_BASE : - UV3_HUB_REVISION_BASE)); - pnodeid = early_get_pnodeid(); - early_get_apic_pnode_shift(); - x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; - x86_platform.nmi_init = uv_nmi_init; - if (!strcmp(oem_table_id, "UVL")) - uv_system_type = UV_LEGACY_APIC; - else if (!strcmp(oem_table_id, "UVX")) - uv_system_type = UV_X2APIC; - else if (!strcmp(oem_table_id, "UVH")) { - __this_cpu_write(x2apic_extra_bits, - pnodeid << uvh_apicid.s.pnode_shift); - uv_system_type = UV_NON_UNIQUE_APIC; - uv_set_apicid_hibit(); - return 1; - } + /* + * Determine UV arch type. + * SGI: UV100/1000 + * SGI2: UV2000/3000 + * SGI3: UV300 (truncated to 4 chars because of different varieties) + */ + uv_hub_info->hub_revision = + !strncmp(oem_id, "SGI3", 4) ? UV3_HUB_REVISION_BASE : + !strcmp(oem_id, "SGI2") ? UV2_HUB_REVISION_BASE : + !strcmp(oem_id, "SGI") ? UV1_HUB_REVISION_BASE : 0; + + if (uv_hub_info->hub_revision == 0) + goto badbios; + + pnodeid = early_get_pnodeid(); + early_get_apic_pnode_shift(); + x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; + x86_platform.nmi_init = uv_nmi_init; + + if (!strcmp(oem_table_id, "UVX")) { /* most common */ + uv_system_type = UV_X2APIC; + uv_apic = 0; + + } else if (!strcmp(oem_table_id, "UVH")) { /* only UV1 systems */ + uv_system_type = UV_NON_UNIQUE_APIC; + __this_cpu_write(x2apic_extra_bits, + pnodeid << uvh_apicid.s.pnode_shift); + uv_set_apicid_hibit(); + uv_apic = 1; + + } else if (!strcmp(oem_table_id, "UVL")) { /* only used for */ + uv_system_type = UV_LEGACY_APIC; /* very small systems */ + uv_apic = 0; + + } else { + goto badbios; } - return 0; + + pr_info("UV: OEM IDs %s/%s, System/HUB Types %d/%d, uv_apic %d\n", + oem_id, oem_table_id, uv_system_type, + uv_min_hub_revision_id, uv_apic); + + return uv_apic; + +badbios: + pr_err("UV: OEM_ID:%s OEM_TABLE_ID:%s\n", oem_id, oem_table_id); + pr_err("Current BIOS not supported, update kernel and/or BIOS\n"); + BUG(); } enum uv_system_type get_uv_system_type(void) -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:x86/apic] x86/apic/uv: Update the UV APIC driver check 2015-04-09 18:26 ` [PATCH 2/3] X86, UV: Update UV APIC driver check Mike Travis @ 2015-04-10 17:43 ` tip-bot for Mike Travis 0 siblings, 0 replies; 7+ messages in thread From: tip-bot for Mike Travis @ 2015-04-10 17:43 UTC (permalink / raw) To: linux-tip-commits; +Cc: tglx, linux-kernel, hedi, sivanich, mingo, hpa, travis Commit-ID: 379b97e280971ef7673db5166c7e0f7ab49b81de Gitweb: http://git.kernel.org/tip/379b97e280971ef7673db5166c7e0f7ab49b81de Author: Mike Travis <travis@sgi.com> AuthorDate: Thu, 9 Apr 2015 13:26:30 -0500 Committer: Ingo Molnar <mingo@kernel.org> CommitDate: Fri, 10 Apr 2015 10:16:07 +0200 x86/apic/uv: Update the UV APIC driver check Fix a bug in the OEM check function that determines if the system is a UV system and the BIOS is compatible with the kernel's UV apic driver. This prevents some possibly obscure panics and guards the system against being started on SGI hardware that does not have the required kernel support. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Hedi Berriche <hedi@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> Link: http://lkml.kernel.org/r/20150409182629.112998930@asylum.americas.sgi.com Signed-off-by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/apic/x2apic_uv_x.c | 74 +++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 2a739a9..e18962c 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -144,36 +144,60 @@ static void __init uv_set_apicid_hibit(void) static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { - int pnodeid, is_uv1, is_uv2, is_uv3; + int pnodeid; + int uv_apic; if (strncmp(oem_id, "SGI", 3) != 0) return 0; - is_uv1 = !strcmp(oem_id, "SGI"); - is_uv2 = !strcmp(oem_id, "SGI2"); - is_uv3 = !strncmp(oem_id, "SGI3", 4); /* there are varieties of UV3 */ - if (is_uv1 || is_uv2 || is_uv3) { - uv_hub_info->hub_revision = - (is_uv1 ? UV1_HUB_REVISION_BASE : - (is_uv2 ? UV2_HUB_REVISION_BASE : - UV3_HUB_REVISION_BASE)); - pnodeid = early_get_pnodeid(); - early_get_apic_pnode_shift(); - x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; - x86_platform.nmi_init = uv_nmi_init; - if (!strcmp(oem_table_id, "UVL")) - uv_system_type = UV_LEGACY_APIC; - else if (!strcmp(oem_table_id, "UVX")) - uv_system_type = UV_X2APIC; - else if (!strcmp(oem_table_id, "UVH")) { - __this_cpu_write(x2apic_extra_bits, - pnodeid << uvh_apicid.s.pnode_shift); - uv_system_type = UV_NON_UNIQUE_APIC; - uv_set_apicid_hibit(); - return 1; - } + /* + * Determine UV arch type. + * SGI: UV100/1000 + * SGI2: UV2000/3000 + * SGI3: UV300 (truncated to 4 chars because of different varieties) + */ + uv_hub_info->hub_revision = + !strncmp(oem_id, "SGI3", 4) ? UV3_HUB_REVISION_BASE : + !strcmp(oem_id, "SGI2") ? UV2_HUB_REVISION_BASE : + !strcmp(oem_id, "SGI") ? UV1_HUB_REVISION_BASE : 0; + + if (uv_hub_info->hub_revision == 0) + goto badbios; + + pnodeid = early_get_pnodeid(); + early_get_apic_pnode_shift(); + x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; + x86_platform.nmi_init = uv_nmi_init; + + if (!strcmp(oem_table_id, "UVX")) { /* most common */ + uv_system_type = UV_X2APIC; + uv_apic = 0; + + } else if (!strcmp(oem_table_id, "UVH")) { /* only UV1 systems */ + uv_system_type = UV_NON_UNIQUE_APIC; + __this_cpu_write(x2apic_extra_bits, + pnodeid << uvh_apicid.s.pnode_shift); + uv_set_apicid_hibit(); + uv_apic = 1; + + } else if (!strcmp(oem_table_id, "UVL")) { /* only used for */ + uv_system_type = UV_LEGACY_APIC; /* very small systems */ + uv_apic = 0; + + } else { + goto badbios; } - return 0; + + pr_info("UV: OEM IDs %s/%s, System/HUB Types %d/%d, uv_apic %d\n", + oem_id, oem_table_id, uv_system_type, + uv_min_hub_revision_id, uv_apic); + + return uv_apic; + +badbios: + pr_err("UV: OEM_ID:%s OEM_TABLE_ID:%s\n", oem_id, oem_table_id); + pr_err("Current BIOS not supported, update kernel and/or BIOS\n"); + BUG(); } enum uv_system_type get_uv_system_type(void) ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] X86, UV: Update UV APIC HUB check 2015-04-09 18:26 [PATCH 0/3] UV: Update UV APIC checks for new systems Mike Travis 2015-04-09 18:26 ` [PATCH 1/3] X86, UV: Update UV APIC OEM check Mike Travis 2015-04-09 18:26 ` [PATCH 2/3] X86, UV: Update UV APIC driver check Mike Travis @ 2015-04-09 18:26 ` Mike Travis 2015-04-10 17:44 ` [tip:x86/apic] x86/apic/uv: Update the " tip-bot for Mike Travis 2 siblings, 1 reply; 7+ messages in thread From: Mike Travis @ 2015-04-09 18:26 UTC (permalink / raw) To: Ingo Molnar, Andrew Morton, Thomas Gleixner, H. Peter Anvin Cc: Hedi Berriche, Dimitri Sivanich, x86, linux-kernel [-- Attachment #1: update-uv-apic-hub-check --] [-- Type: text/plain, Size: 903 bytes --] Update check for UV2000/3000. Note when HUB is not recognized. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Hedi Berriche <hedi@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> --- arch/x86/kernel/apic/x2apic_uv_x.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c +++ linux/arch/x86/kernel/apic/x2apic_uv_x.c @@ -881,10 +881,14 @@ void __init uv_system_init(void) unsigned long mmr_base, present, paddr; unsigned short pnode_mask; unsigned char n_lshift; - char *hub = (is_uv1_hub() ? "UV1" : - (is_uv2_hub() ? "UV2" : - "UV3")); + char *hub = (is_uv1_hub() ? "UV100/1000" : + (is_uv2_hub() ? "UV2000/3000" : + (is_uv3_hub() ? "UV300" : NULL))); + if (!hub) { + pr_err("UV: Unknown/unsupported UV hub\n"); + return; + } pr_info("UV: Found %s hub\n", hub); map_low_mmrs(); -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:x86/apic] x86/apic/uv: Update the UV APIC HUB check 2015-04-09 18:26 ` [PATCH 3/3] X86, UV: Update UV APIC HUB check Mike Travis @ 2015-04-10 17:44 ` tip-bot for Mike Travis 0 siblings, 0 replies; 7+ messages in thread From: tip-bot for Mike Travis @ 2015-04-10 17:44 UTC (permalink / raw) To: linux-tip-commits; +Cc: tglx, linux-kernel, hpa, mingo, sivanich, travis, hedi Commit-ID: 1912c7afa39d2683a574011ff455fe49ada8016c Gitweb: http://git.kernel.org/tip/1912c7afa39d2683a574011ff455fe49ada8016c Author: Mike Travis <travis@sgi.com> AuthorDate: Thu, 9 Apr 2015 13:26:31 -0500 Committer: Ingo Molnar <mingo@kernel.org> CommitDate: Fri, 10 Apr 2015 10:16:08 +0200 x86/apic/uv: Update the UV APIC HUB check Update the check for UV2000/3000. Note when the HUB is not recognized. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Hedi Berriche <hedi@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> Link: http://lkml.kernel.org/r/20150409182629.267239403@asylum.americas.sgi.com Signed-off-by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/apic/x2apic_uv_x.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index e18962c..c8d9295 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -881,10 +881,14 @@ void __init uv_system_init(void) unsigned long mmr_base, present, paddr; unsigned short pnode_mask; unsigned char n_lshift; - char *hub = (is_uv1_hub() ? "UV1" : - (is_uv2_hub() ? "UV2" : - "UV3")); + char *hub = (is_uv1_hub() ? "UV100/1000" : + (is_uv2_hub() ? "UV2000/3000" : + (is_uv3_hub() ? "UV300" : NULL))); + if (!hub) { + pr_err("UV: Unknown/unsupported UV hub\n"); + return; + } pr_info("UV: Found %s hub\n", hub); map_low_mmrs(); ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-04-10 17:44 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-04-09 18:26 [PATCH 0/3] UV: Update UV APIC checks for new systems Mike Travis 2015-04-09 18:26 ` [PATCH 1/3] X86, UV: Update UV APIC OEM check Mike Travis 2015-04-10 17:43 ` [tip:x86/apic] x86/apic/uv: Update the APIC UV " tip-bot for Mike Travis 2015-04-09 18:26 ` [PATCH 2/3] X86, UV: Update UV APIC driver check Mike Travis 2015-04-10 17:43 ` [tip:x86/apic] x86/apic/uv: Update the " tip-bot for Mike Travis 2015-04-09 18:26 ` [PATCH 3/3] X86, UV: Update UV APIC HUB check Mike Travis 2015-04-10 17:44 ` [tip:x86/apic] x86/apic/uv: Update the " tip-bot for Mike Travis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome