X86, UV: Update UV APIC driver check
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 X86, UV: Update 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. Also add update for new UV3000 system.
The first "OEM" check was also optimized to return faster if the system is not an SGI or UV system.
--- arch/x86/kernel/apic/x2apic_uv_x.c | 84 ++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 28 deletions(-)
arch/x86/kernel/apic/x2apic_uv_x.c +56 -28
@@ -144,33 +144,60 @@ static void __init uv_set_apicid_hibit(vstatic 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 ret; - 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 ; - } +if (strncmp (oem_id,"SGI" ,3 ) !=0 ) +return 0 ; + +/* +* 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 ; + ret =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 (); + ret =1 ; + + }else if (!strcmp (oem_table_id,"UVL" )) {/* only used for */ + uv_system_type =UV_LEGACY_APIC ;/* very small systems */ + ret =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, ret); + +return ret; + +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 )
@@ -854,9 +881,10 @@ 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" : +"Unknown UV" )));pr_info ("UV: Found %s hub\n" , hub);map_low_mmrs ();
Quoted 5 lines · Mike Travis
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. [...]
This would be one patch ...
Quoted 1 line
[...] Also add update for new UV3000 system.
... and that's a second patch.
Quoted 2 lines
The first "OEM" check was also optimized to return faster if the system is not an SGI or UV system.
Looks like this mixes up with the fix and can be part of the first patch - although ideally it would have been good to create a 3 patch series to preserve the separation of the various changes.
Thanks,
Ingo
Quoted 9 lines · Ingo Molnar
Quoted 5 lines · Mike Travis
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. [...]
Quoted 5 lines
This would be one patch ...
Quoted 1 line
[...] Also add update for new UV3000 system.
... and that's a second patch.
The second one is purely cosmetic. The same UV HUB is used for UV2000 and UV3000 so all this is doing is avoiding confusion when someone thinks the kernel should be supporting UV3000.
Quoted 7 lines
n
Quoted 2 lines
The first "OEM" check was also optimized to return faster if the system is not an SGI or UV system.
Looks like this mixes up with the fix and can be part of the first patch - although ideally it would have been good to create a 3 patch series to preserve the separation of the various changes.
If you think that's necessary, then I can do that. Overall the changes are very minimal and basically guard against whatever changes will be in UV4 or possible non-UV SGI systems (using the "SGI" OEM label in BIOS).
Quoted 5 lines
Thanks,
Ingo