uv_hub.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * SGI UV architectural definitions
  7. *
  8. * Copyright (C) 2007-2010 Silicon Graphics, Inc. All rights reserved.
  9. */
  10. #ifndef _ASM_X86_UV_UV_HUB_H
  11. #define _ASM_X86_UV_UV_HUB_H
  12. #ifdef CONFIG_X86_64
  13. #include <linux/numa.h>
  14. #include <linux/percpu.h>
  15. #include <linux/timer.h>
  16. #include <linux/io.h>
  17. #include <asm/types.h>
  18. #include <asm/percpu.h>
  19. #include <asm/uv/uv_mmrs.h>
  20. #include <asm/irq_vectors.h>
  21. #include <asm/io_apic.h>
  22. /*
  23. * Addressing Terminology
  24. *
  25. * M - The low M bits of a physical address represent the offset
  26. * into the blade local memory. RAM memory on a blade is physically
  27. * contiguous (although various IO spaces may punch holes in
  28. * it)..
  29. *
  30. * N - Number of bits in the node portion of a socket physical
  31. * address.
  32. *
  33. * NASID - network ID of a router, Mbrick or Cbrick. Nasid values of
  34. * routers always have low bit of 1, C/MBricks have low bit
  35. * equal to 0. Most addressing macros that target UV hub chips
  36. * right shift the NASID by 1 to exclude the always-zero bit.
  37. * NASIDs contain up to 15 bits.
  38. *
  39. * GNODE - NASID right shifted by 1 bit. Most mmrs contain gnodes instead
  40. * of nasids.
  41. *
  42. * PNODE - the low N bits of the GNODE. The PNODE is the most useful variant
  43. * of the nasid for socket usage.
  44. *
  45. * GPA - (global physical address) a socket physical address converted
  46. * so that it can be used by the GRU as a global address. Socket
  47. * physical addresses 1) need additional NASID (node) bits added
  48. * to the high end of the address, and 2) unaliased if the
  49. * partition does not have a physical address 0. In addition, on
  50. * UV2 rev 1, GPAs need the gnode left shifted to bits 39 or 40.
  51. *
  52. *
  53. * NumaLink Global Physical Address Format:
  54. * +--------------------------------+---------------------+
  55. * |00..000| GNODE | NodeOffset |
  56. * +--------------------------------+---------------------+
  57. * |<-------53 - M bits --->|<--------M bits ----->
  58. *
  59. * M - number of node offset bits (35 .. 40)
  60. *
  61. *
  62. * Memory/UV-HUB Processor Socket Address Format:
  63. * +----------------+---------------+---------------------+
  64. * |00..000000000000| PNODE | NodeOffset |
  65. * +----------------+---------------+---------------------+
  66. * <--- N bits --->|<--------M bits ----->
  67. *
  68. * M - number of node offset bits (35 .. 40)
  69. * N - number of PNODE bits (0 .. 10)
  70. *
  71. * Note: M + N cannot currently exceed 44 (x86_64) or 46 (IA64).
  72. * The actual values are configuration dependent and are set at
  73. * boot time. M & N values are set by the hardware/BIOS at boot.
  74. *
  75. *
  76. * APICID format
  77. * NOTE!!!!!! This is the current format of the APICID. However, code
  78. * should assume that this will change in the future. Use functions
  79. * in this file for all APICID bit manipulations and conversion.
  80. *
  81. * 1111110000000000
  82. * 5432109876543210
  83. * pppppppppplc0cch Nehalem-EX (12 bits in hdw reg)
  84. * ppppppppplcc0cch Westmere-EX (12 bits in hdw reg)
  85. * pppppppppppcccch SandyBridge (15 bits in hdw reg)
  86. * sssssssssss
  87. *
  88. * p = pnode bits
  89. * l = socket number on board
  90. * c = core
  91. * h = hyperthread
  92. * s = bits that are in the SOCKET_ID CSR
  93. *
  94. * Note: Processor may support fewer bits in the APICID register. The ACPI
  95. * tables hold all 16 bits. Software needs to be aware of this.
  96. *
  97. * Unless otherwise specified, all references to APICID refer to
  98. * the FULL value contained in ACPI tables, not the subset in the
  99. * processor APICID register.
  100. */
  101. /*
  102. * Maximum number of bricks in all partitions and in all coherency domains.
  103. * This is the total number of bricks accessible in the numalink fabric. It
  104. * includes all C & M bricks. Routers are NOT included.
  105. *
  106. * This value is also the value of the maximum number of non-router NASIDs
  107. * in the numalink fabric.
  108. *
  109. * NOTE: a brick may contain 1 or 2 OS nodes. Don't get these confused.
  110. */
  111. #define UV_MAX_NUMALINK_BLADES 16384
  112. /*
  113. * Maximum number of C/Mbricks within a software SSI (hardware may support
  114. * more).
  115. */
  116. #define UV_MAX_SSI_BLADES 256
  117. /*
  118. * The largest possible NASID of a C or M brick (+ 2)
  119. */
  120. #define UV_MAX_NASID_VALUE (UV_MAX_NUMALINK_BLADES * 2)
  121. struct uv_scir_s {
  122. struct timer_list timer;
  123. unsigned long offset;
  124. unsigned long last;
  125. unsigned long idle_on;
  126. unsigned long idle_off;
  127. unsigned char state;
  128. unsigned char enabled;
  129. };
  130. /*
  131. * The following defines attributes of the HUB chip. These attributes are
  132. * frequently referenced and are kept in the per-cpu data areas of each cpu.
  133. * They are kept together in a struct to minimize cache misses.
  134. */
  135. struct uv_hub_info_s {
  136. unsigned long global_mmr_base;
  137. unsigned long gpa_mask;
  138. unsigned int gnode_extra;
  139. unsigned char hub_revision;
  140. unsigned char apic_pnode_shift;
  141. unsigned char m_shift;
  142. unsigned char n_lshift;
  143. unsigned long gnode_upper;
  144. unsigned long lowmem_remap_top;
  145. unsigned long lowmem_remap_base;
  146. unsigned short pnode;
  147. unsigned short pnode_mask;
  148. unsigned short coherency_domain_number;
  149. unsigned short numa_blade_id;
  150. unsigned char blade_processor_id;
  151. unsigned char m_val;
  152. unsigned char n_val;
  153. struct uv_scir_s scir;
  154. };
  155. DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
  156. #define uv_hub_info (&__get_cpu_var(__uv_hub_info))
  157. #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu))
  158. /*
  159. * Hub revisions less than UV2_HUB_REVISION_BASE are UV1 hubs. All UV2
  160. * hubs have revision numbers greater than or equal to UV2_HUB_REVISION_BASE.
  161. * This is a software convention - NOT the hardware revision numbers in
  162. * the hub chip.
  163. */
  164. #define UV1_HUB_REVISION_BASE 1
  165. #define UV2_HUB_REVISION_BASE 3
  166. static inline int is_uv1_hub(void)
  167. {
  168. return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE;
  169. }
  170. static inline int is_uv2_hub(void)
  171. {
  172. return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE;
  173. }
  174. static inline int is_uv2_1_hub(void)
  175. {
  176. return uv_hub_info->hub_revision == UV2_HUB_REVISION_BASE;
  177. }
  178. static inline int is_uv2_2_hub(void)
  179. {
  180. return uv_hub_info->hub_revision == UV2_HUB_REVISION_BASE + 1;
  181. }
  182. union uvh_apicid {
  183. unsigned long v;
  184. struct uvh_apicid_s {
  185. unsigned long local_apic_mask : 24;
  186. unsigned long local_apic_shift : 5;
  187. unsigned long unused1 : 3;
  188. unsigned long pnode_mask : 24;
  189. unsigned long pnode_shift : 5;
  190. unsigned long unused2 : 3;
  191. } s;
  192. };
  193. /*
  194. * Local & Global MMR space macros.
  195. * Note: macros are intended to be used ONLY by inline functions
  196. * in this file - not by other kernel code.
  197. * n - NASID (full 15-bit global nasid)
  198. * g - GNODE (full 15-bit global nasid, right shifted 1)
  199. * p - PNODE (local part of nsids, right shifted 1)
  200. */
  201. #define UV_NASID_TO_PNODE(n) (((n) >> 1) & uv_hub_info->pnode_mask)
  202. #define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra)
  203. #define UV_PNODE_TO_NASID(p) (UV_PNODE_TO_GNODE(p) << 1)
  204. #define UV1_LOCAL_MMR_BASE 0xf4000000UL
  205. #define UV1_GLOBAL_MMR32_BASE 0xf8000000UL
  206. #define UV1_LOCAL_MMR_SIZE (64UL * 1024 * 1024)
  207. #define UV1_GLOBAL_MMR32_SIZE (64UL * 1024 * 1024)
  208. #define UV2_LOCAL_MMR_BASE 0xfa000000UL
  209. #define UV2_GLOBAL_MMR32_BASE 0xfc000000UL
  210. #define UV2_LOCAL_MMR_SIZE (32UL * 1024 * 1024)
  211. #define UV2_GLOBAL_MMR32_SIZE (32UL * 1024 * 1024)
  212. #define UV_LOCAL_MMR_BASE (is_uv1_hub() ? UV1_LOCAL_MMR_BASE \
  213. : UV2_LOCAL_MMR_BASE)
  214. #define UV_GLOBAL_MMR32_BASE (is_uv1_hub() ? UV1_GLOBAL_MMR32_BASE \
  215. : UV2_GLOBAL_MMR32_BASE)
  216. #define UV_LOCAL_MMR_SIZE (is_uv1_hub() ? UV1_LOCAL_MMR_SIZE : \
  217. UV2_LOCAL_MMR_SIZE)
  218. #define UV_GLOBAL_MMR32_SIZE (is_uv1_hub() ? UV1_GLOBAL_MMR32_SIZE :\
  219. UV2_GLOBAL_MMR32_SIZE)
  220. #define UV_GLOBAL_MMR64_BASE (uv_hub_info->global_mmr_base)
  221. #define UV_GLOBAL_GRU_MMR_BASE 0x4000000
  222. #define UV_GLOBAL_MMR32_PNODE_SHIFT 15
  223. #define UV_GLOBAL_MMR64_PNODE_SHIFT 26
  224. #define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))
  225. #define UV_GLOBAL_MMR64_PNODE_BITS(p) \
  226. (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT)
  227. #define UVH_APICID 0x002D0E00L
  228. #define UV_APIC_PNODE_SHIFT 6
  229. #define UV_APICID_HIBIT_MASK 0xffff0000
  230. /* Local Bus from cpu's perspective */
  231. #define LOCAL_BUS_BASE 0x1c00000
  232. #define LOCAL_BUS_SIZE (4 * 1024 * 1024)
  233. /*
  234. * System Controller Interface Reg
  235. *
  236. * Note there are NO leds on a UV system. This register is only
  237. * used by the system controller to monitor system-wide operation.
  238. * There are 64 regs per node. With Nahelem cpus (2 cores per node,
  239. * 8 cpus per core, 2 threads per cpu) there are 32 cpu threads on
  240. * a node.
  241. *
  242. * The window is located at top of ACPI MMR space
  243. */
  244. #define SCIR_WINDOW_COUNT 64
  245. #define SCIR_LOCAL_MMR_BASE (LOCAL_BUS_BASE + \
  246. LOCAL_BUS_SIZE - \
  247. SCIR_WINDOW_COUNT)
  248. #define SCIR_CPU_HEARTBEAT 0x01 /* timer interrupt */
  249. #define SCIR_CPU_ACTIVITY 0x02 /* not idle */
  250. #define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */
  251. /* Loop through all installed blades */
  252. #define for_each_possible_blade(bid) \
  253. for ((bid) = 0; (bid) < uv_num_possible_blades(); (bid)++)
  254. /*
  255. * Macros for converting between kernel virtual addresses, socket local physical
  256. * addresses, and UV global physical addresses.
  257. * Note: use the standard __pa() & __va() macros for converting
  258. * between socket virtual and socket physical addresses.
  259. */
  260. /* socket phys RAM --> UV global physical address */
  261. static inline unsigned long uv_soc_phys_ram_to_gpa(unsigned long paddr)
  262. {
  263. if (paddr < uv_hub_info->lowmem_remap_top)
  264. paddr |= uv_hub_info->lowmem_remap_base;
  265. paddr |= uv_hub_info->gnode_upper;
  266. paddr = ((paddr << uv_hub_info->m_shift) >> uv_hub_info->m_shift) |
  267. ((paddr >> uv_hub_info->m_val) << uv_hub_info->n_lshift);
  268. return paddr;
  269. }
  270. /* socket virtual --> UV global physical address */
  271. static inline unsigned long uv_gpa(void *v)
  272. {
  273. return uv_soc_phys_ram_to_gpa(__pa(v));
  274. }
  275. /* Top two bits indicate the requested address is in MMR space. */
  276. static inline int
  277. uv_gpa_in_mmr_space(unsigned long gpa)
  278. {
  279. return (gpa >> 62) == 0x3UL;
  280. }
  281. /* UV global physical address --> socket phys RAM */
  282. static inline unsigned long uv_gpa_to_soc_phys_ram(unsigned long gpa)
  283. {
  284. unsigned long paddr;
  285. unsigned long remap_base = uv_hub_info->lowmem_remap_base;
  286. unsigned long remap_top = uv_hub_info->lowmem_remap_top;
  287. gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) |
  288. ((gpa >> uv_hub_info->n_lshift) << uv_hub_info->m_val);
  289. paddr = gpa & uv_hub_info->gpa_mask;
  290. if (paddr >= remap_base && paddr < remap_base + remap_top)
  291. paddr -= remap_base;
  292. return paddr;
  293. }
  294. /* gpa -> pnode */
  295. static inline unsigned long uv_gpa_to_gnode(unsigned long gpa)
  296. {
  297. return gpa >> uv_hub_info->n_lshift;
  298. }
  299. /* gpa -> pnode */
  300. static inline int uv_gpa_to_pnode(unsigned long gpa)
  301. {
  302. unsigned long n_mask = (1UL << uv_hub_info->n_val) - 1;
  303. return uv_gpa_to_gnode(gpa) & n_mask;
  304. }
  305. /* gpa -> node offset*/
  306. static inline unsigned long uv_gpa_to_offset(unsigned long gpa)
  307. {
  308. return (gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift;
  309. }
  310. /* pnode, offset --> socket virtual */
  311. static inline void *uv_pnode_offset_to_vaddr(int pnode, unsigned long offset)
  312. {
  313. return __va(((unsigned long)pnode << uv_hub_info->m_val) | offset);
  314. }
  315. /*
  316. * Extract a PNODE from an APICID (full apicid, not processor subset)
  317. */
  318. static inline int uv_apicid_to_pnode(int apicid)
  319. {
  320. return (apicid >> uv_hub_info->apic_pnode_shift);
  321. }
  322. /*
  323. * Convert an apicid to the socket number on the blade
  324. */
  325. static inline int uv_apicid_to_socket(int apicid)
  326. {
  327. if (is_uv1_hub())
  328. return (apicid >> (uv_hub_info->apic_pnode_shift - 1)) & 1;
  329. else
  330. return 0;
  331. }
  332. /*
  333. * Access global MMRs using the low memory MMR32 space. This region supports
  334. * faster MMR access but not all MMRs are accessible in this space.
  335. */
  336. static inline unsigned long *uv_global_mmr32_address(int pnode, unsigned long offset)
  337. {
  338. return __va(UV_GLOBAL_MMR32_BASE |
  339. UV_GLOBAL_MMR32_PNODE_BITS(pnode) | offset);
  340. }
  341. static inline void uv_write_global_mmr32(int pnode, unsigned long offset, unsigned long val)
  342. {
  343. writeq(val, uv_global_mmr32_address(pnode, offset));
  344. }
  345. static inline unsigned long uv_read_global_mmr32(int pnode, unsigned long offset)
  346. {
  347. return readq(uv_global_mmr32_address(pnode, offset));
  348. }
  349. /*
  350. * Access Global MMR space using the MMR space located at the top of physical
  351. * memory.
  352. */
  353. static inline volatile void __iomem *uv_global_mmr64_address(int pnode, unsigned long offset)
  354. {
  355. return __va(UV_GLOBAL_MMR64_BASE |
  356. UV_GLOBAL_MMR64_PNODE_BITS(pnode) | offset);
  357. }
  358. static inline void uv_write_global_mmr64(int pnode, unsigned long offset, unsigned long val)
  359. {
  360. writeq(val, uv_global_mmr64_address(pnode, offset));
  361. }
  362. static inline unsigned long uv_read_global_mmr64(int pnode, unsigned long offset)
  363. {
  364. return readq(uv_global_mmr64_address(pnode, offset));
  365. }
  366. /*
  367. * Global MMR space addresses when referenced by the GRU. (GRU does
  368. * NOT use socket addressing).
  369. */
  370. static inline unsigned long uv_global_gru_mmr_address(int pnode, unsigned long offset)
  371. {
  372. return UV_GLOBAL_GRU_MMR_BASE | offset |
  373. ((unsigned long)pnode << uv_hub_info->m_val);
  374. }
  375. static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val)
  376. {
  377. writeb(val, uv_global_mmr64_address(pnode, offset));
  378. }
  379. static inline unsigned char uv_read_global_mmr8(int pnode, unsigned long offset)
  380. {
  381. return readb(uv_global_mmr64_address(pnode, offset));
  382. }
  383. /*
  384. * Access hub local MMRs. Faster than using global space but only local MMRs
  385. * are accessible.
  386. */
  387. static inline unsigned long *uv_local_mmr_address(unsigned long offset)
  388. {
  389. return __va(UV_LOCAL_MMR_BASE | offset);
  390. }
  391. static inline unsigned long uv_read_local_mmr(unsigned long offset)
  392. {
  393. return readq(uv_local_mmr_address(offset));
  394. }
  395. static inline void uv_write_local_mmr(unsigned long offset, unsigned long val)
  396. {
  397. writeq(val, uv_local_mmr_address(offset));
  398. }
  399. static inline unsigned char uv_read_local_mmr8(unsigned long offset)
  400. {
  401. return readb(uv_local_mmr_address(offset));
  402. }
  403. static inline void uv_write_local_mmr8(unsigned long offset, unsigned char val)
  404. {
  405. writeb(val, uv_local_mmr_address(offset));
  406. }
  407. /*
  408. * Structures and definitions for converting between cpu, node, pnode, and blade
  409. * numbers.
  410. */
  411. struct uv_blade_info {
  412. unsigned short nr_possible_cpus;
  413. unsigned short nr_online_cpus;
  414. unsigned short pnode;
  415. short memory_nid;
  416. spinlock_t nmi_lock;
  417. unsigned long nmi_count;
  418. };
  419. extern struct uv_blade_info *uv_blade_info;
  420. extern short *uv_node_to_blade;
  421. extern short *uv_cpu_to_blade;
  422. extern short uv_possible_blades;
  423. /* Blade-local cpu number of current cpu. Numbered 0 .. <# cpus on the blade> */
  424. static inline int uv_blade_processor_id(void)
  425. {
  426. return uv_hub_info->blade_processor_id;
  427. }
  428. /* Blade number of current cpu. Numnbered 0 .. <#blades -1> */
  429. static inline int uv_numa_blade_id(void)
  430. {
  431. return uv_hub_info->numa_blade_id;
  432. }
  433. /* Convert a cpu number to the the UV blade number */
  434. static inline int uv_cpu_to_blade_id(int cpu)
  435. {
  436. return uv_cpu_to_blade[cpu];
  437. }
  438. /* Convert linux node number to the UV blade number */
  439. static inline int uv_node_to_blade_id(int nid)
  440. {
  441. return uv_node_to_blade[nid];
  442. }
  443. /* Convert a blade id to the PNODE of the blade */
  444. static inline int uv_blade_to_pnode(int bid)
  445. {
  446. return uv_blade_info[bid].pnode;
  447. }
  448. /* Nid of memory node on blade. -1 if no blade-local memory */
  449. static inline int uv_blade_to_memory_nid(int bid)
  450. {
  451. return uv_blade_info[bid].memory_nid;
  452. }
  453. /* Determine the number of possible cpus on a blade */
  454. static inline int uv_blade_nr_possible_cpus(int bid)
  455. {
  456. return uv_blade_info[bid].nr_possible_cpus;
  457. }
  458. /* Determine the number of online cpus on a blade */
  459. static inline int uv_blade_nr_online_cpus(int bid)
  460. {
  461. return uv_blade_info[bid].nr_online_cpus;
  462. }
  463. /* Convert a cpu id to the PNODE of the blade containing the cpu */
  464. static inline int uv_cpu_to_pnode(int cpu)
  465. {
  466. return uv_blade_info[uv_cpu_to_blade_id(cpu)].pnode;
  467. }
  468. /* Convert a linux node number to the PNODE of the blade */
  469. static inline int uv_node_to_pnode(int nid)
  470. {
  471. return uv_blade_info[uv_node_to_blade_id(nid)].pnode;
  472. }
  473. /* Maximum possible number of blades */
  474. static inline int uv_num_possible_blades(void)
  475. {
  476. return uv_possible_blades;
  477. }
  478. /* Update SCIR state */
  479. static inline void uv_set_scir_bits(unsigned char value)
  480. {
  481. if (uv_hub_info->scir.state != value) {
  482. uv_hub_info->scir.state = value;
  483. uv_write_local_mmr8(uv_hub_info->scir.offset, value);
  484. }
  485. }
  486. static inline unsigned long uv_scir_offset(int apicid)
  487. {
  488. return SCIR_LOCAL_MMR_BASE | (apicid & 0x3f);
  489. }
  490. static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
  491. {
  492. if (uv_cpu_hub_info(cpu)->scir.state != value) {
  493. uv_write_global_mmr8(uv_cpu_to_pnode(cpu),
  494. uv_cpu_hub_info(cpu)->scir.offset, value);
  495. uv_cpu_hub_info(cpu)->scir.state = value;
  496. }
  497. }
  498. extern unsigned int uv_apicid_hibits;
  499. static unsigned long uv_hub_ipi_value(int apicid, int vector, int mode)
  500. {
  501. apicid |= uv_apicid_hibits;
  502. return (1UL << UVH_IPI_INT_SEND_SHFT) |
  503. ((apicid) << UVH_IPI_INT_APIC_ID_SHFT) |
  504. (mode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
  505. (vector << UVH_IPI_INT_VECTOR_SHFT);
  506. }
  507. static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
  508. {
  509. unsigned long val;
  510. unsigned long dmode = dest_Fixed;
  511. if (vector == NMI_VECTOR)
  512. dmode = dest_NMI;
  513. val = uv_hub_ipi_value(apicid, vector, dmode);
  514. uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
  515. }
  516. /*
  517. * Get the minimum revision number of the hub chips within the partition.
  518. * 1 - UV1 rev 1.0 initial silicon
  519. * 2 - UV1 rev 2.0 production silicon
  520. * 3 - UV2 rev 1.0 initial silicon
  521. */
  522. static inline int uv_get_min_hub_revision_id(void)
  523. {
  524. return uv_hub_info->hub_revision;
  525. }
  526. #endif /* CONFIG_X86_64 */
  527. #endif /* _ASM_X86_UV_UV_HUB_H */