diff options
author | Jack Steiner <steiner@sgi.com> | 2009-03-30 10:01:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-03 13:49:58 -0400 |
commit | 6a891a24e4d0056c365a90ff2d71c38fd366b0d0 (patch) | |
tree | 1aba8d7f336ce83aab9611e4411401716c02a92b | |
parent | 1a544e659cbfce178395e9a090a47d1907d0cfa8 (diff) |
x86, UV: Fix for nodes with memory and no cpus
Fix initialization of UV blade information for systems that have
nodes with memory but no cpus.
Signed-off-by: Jack Steiner <steiner@sgi.com>
LKML-Reference: <20090330140111.GA18461@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 1248318436e8..de1a50af807b 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -549,7 +549,8 @@ void __init uv_system_init(void) | |||
549 | unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size; | 549 | unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size; |
550 | int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val; | 550 | int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val; |
551 | int max_pnode = 0; | 551 | int max_pnode = 0; |
552 | unsigned long mmr_base, present; | 552 | unsigned long mmr_base, present, paddr; |
553 | unsigned short pnode_mask; | ||
553 | 554 | ||
554 | map_low_mmrs(); | 555 | map_low_mmrs(); |
555 | 556 | ||
@@ -592,6 +593,7 @@ void __init uv_system_init(void) | |||
592 | } | 593 | } |
593 | } | 594 | } |
594 | 595 | ||
596 | pnode_mask = (1 << n_val) - 1; | ||
595 | node_id.v = uv_read_local_mmr(UVH_NODE_ID); | 597 | node_id.v = uv_read_local_mmr(UVH_NODE_ID); |
596 | gnode_upper = (((unsigned long)node_id.s.node_id) & | 598 | gnode_upper = (((unsigned long)node_id.s.node_id) & |
597 | ~((1 << n_val) - 1)) << m_val; | 599 | ~((1 << n_val) - 1)) << m_val; |
@@ -615,7 +617,7 @@ void __init uv_system_init(void) | |||
615 | uv_cpu_hub_info(cpu)->numa_blade_id = blade; | 617 | uv_cpu_hub_info(cpu)->numa_blade_id = blade; |
616 | uv_cpu_hub_info(cpu)->blade_processor_id = lcpu; | 618 | uv_cpu_hub_info(cpu)->blade_processor_id = lcpu; |
617 | uv_cpu_hub_info(cpu)->pnode = pnode; | 619 | uv_cpu_hub_info(cpu)->pnode = pnode; |
618 | uv_cpu_hub_info(cpu)->pnode_mask = (1 << n_val) - 1; | 620 | uv_cpu_hub_info(cpu)->pnode_mask = pnode_mask; |
619 | uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1; | 621 | uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1; |
620 | uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper; | 622 | uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper; |
621 | uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base; | 623 | uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base; |
@@ -631,6 +633,16 @@ void __init uv_system_init(void) | |||
631 | lcpu, blade); | 633 | lcpu, blade); |
632 | } | 634 | } |
633 | 635 | ||
636 | /* Add blade/pnode info for nodes without cpus */ | ||
637 | for_each_online_node(nid) { | ||
638 | if (uv_node_to_blade[nid] >= 0) | ||
639 | continue; | ||
640 | paddr = node_start_pfn(nid) << PAGE_SHIFT; | ||
641 | pnode = (paddr >> m_val) & pnode_mask; | ||
642 | blade = boot_pnode_to_blade(pnode); | ||
643 | uv_node_to_blade[nid] = blade; | ||
644 | } | ||
645 | |||
634 | map_gru_high(max_pnode); | 646 | map_gru_high(max_pnode); |
635 | map_mmr_high(max_pnode); | 647 | map_mmr_high(max_pnode); |
636 | map_config_high(max_pnode); | 648 | map_config_high(max_pnode); |