Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Oct 2011 12:43:56 +0000 (05:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Oct 2011 12:43:56 +0000 (05:43 -0700)
* 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: uv2: Workaround for UV2 Hub bug (system global address format)

1  2 
arch/x86/include/asm/uv/uv_bau.h
arch/x86/kernel/apic/x2apic_uv_x.c

index c568ccca6e0ef4c0ec549ce6ba7283a0f03b68c4,0c767a8e000ee8c32ecd9ef222dca19b6ed7281e..8e862aaf0d905555e23265df00e139346d9b6649
@@@ -55,6 -55,7 +55,7 @@@
  #define UV_BAU_TUNABLES_DIR           "sgi_uv"
  #define UV_BAU_TUNABLES_FILE          "bau_tunables"
  #define WHITESPACE                    " \t\n"
+ #define uv_mmask                      ((1UL << uv_hub_info->m_val) - 1)
  #define uv_physnodeaddr(x)            ((__pa((unsigned long)(x)) & uv_mmask))
  #define cpubit_isset(cpu, bau_local_cpumask) \
        test_bit((cpu), (bau_local_cpumask).bits)
@@@ -656,7 -657,11 +657,7 @@@ static inline int atomic_read_short(con
   */
  static inline int atom_asr(short i, struct atomic_short *v)
  {
 -      short __i = i;
 -      asm volatile(LOCK_PREFIX "xaddw %0, %1"
 -                      : "+r" (i), "+m" (v->counter)
 -                      : : "memory");
 -      return i + __i;
 +      return i + xadd(&v->counter, i);
  }
  
  /*
index 75be00ecfff2bac0b5651dfa92ae44de59850dae,cfeb978f49fd4c56fbb4e543a74ce893ed7c05a7..62ae3001ae02c4348d640dc01f67fd055718deb0
@@@ -672,11 -672,18 +672,11 @@@ void __cpuinit uv_cpu_init(void
  /*
   * When NMI is received, print a stack trace.
   */
 -int uv_handle_nmi(struct notifier_block *self, unsigned long reason, void *data)
 +int uv_handle_nmi(unsigned int reason, struct pt_regs *regs)
  {
        unsigned long real_uv_nmi;
        int bid;
  
 -      if (reason != DIE_NMIUNKNOWN)
 -              return NOTIFY_OK;
 -
 -      if (in_crash_kexec)
 -              /* do nothing if entering the crash kernel */
 -              return NOTIFY_OK;
 -
        /*
         * Each blade has an MMR that indicates when an NMI has been sent
         * to cpus on the blade. If an NMI is detected, atomically
        }
  
        if (likely(__get_cpu_var(cpu_last_nmi_count) == uv_blade_info[bid].nmi_count))
 -              return NOTIFY_DONE;
 +              return NMI_DONE;
  
        __get_cpu_var(cpu_last_nmi_count) = uv_blade_info[bid].nmi_count;
  
        dump_stack();
        spin_unlock(&uv_nmi_lock);
  
 -      return NOTIFY_STOP;
 +      return NMI_HANDLED;
  }
  
 -static struct notifier_block uv_dump_stack_nmi_nb = {
 -      .notifier_call  = uv_handle_nmi,
 -      .priority = NMI_LOCAL_LOW_PRIOR - 1,
 -};
 -
  void uv_register_nmi_notifier(void)
  {
 -      if (register_die_notifier(&uv_dump_stack_nmi_nb))
 +      if (register_nmi_handler(NMI_UNKNOWN, uv_handle_nmi, 0, "uv"))
                printk(KERN_WARNING "UV NMI handler failed to register\n");
  }
  
@@@ -820,6 -832,10 +820,10 @@@ void __init uv_system_init(void
                uv_cpu_hub_info(cpu)->apic_pnode_shift = uvh_apicid.s.pnode_shift;
                uv_cpu_hub_info(cpu)->hub_revision = uv_hub_info->hub_revision;
  
+               uv_cpu_hub_info(cpu)->m_shift = 64 - m_val;
+               uv_cpu_hub_info(cpu)->n_lshift = is_uv2_1_hub() ?
+                               (m_val == 40 ? 40 : 39) : m_val;
                pnode = uv_apicid_to_pnode(apicid);
                blade = boot_pnode_to_blade(pnode);
                lcpu = uv_blade_info[blade].nr_possible_cpus;
                if (uv_node_to_blade[nid] >= 0)
                        continue;
                paddr = node_start_pfn(nid) << PAGE_SHIFT;
-               paddr = uv_soc_phys_ram_to_gpa(paddr);
-               pnode = (paddr >> m_val) & pnode_mask;
+               pnode = uv_gpa_to_pnode(uv_soc_phys_ram_to_gpa(paddr));
                blade = boot_pnode_to_blade(pnode);
                uv_node_to_blade[nid] = blade;
        }