Lines Matching +full:gpa +full:- +full:1
9 * Copyright (C) 2007-2014 Silicon Graphics, Inc. All rights reserved.
33 * M - The low M bits of a physical address represent the offset
38 * N - Number of bits in the node portion of a socket physical
41 * NASID - network ID of a router, Mbrick or Cbrick. Nasid values of
42 * routers always have low bit of 1, C/MBricks have low bit
44 * right shift the NASID by 1 to exclude the always-zero bit.
47 * GNODE - NASID right shifted by 1 bit. Most mmrs contain gnodes instead
50 * PNODE - the low N bits of the GNODE. The PNODE is the most useful variant
53 * GPA - (global physical address) a socket physical address converted
55 * physical addresses 1) need additional NASID (node) bits added
58 * UV2 rev 1, GPAs need the gnode left shifted to bits 39 or 40.
62 * +--------------------------------+---------------------+
64 * +--------------------------------+---------------------+
65 * |<-------53 - M bits --->|<--------M bits ----->
67 * M - number of node offset bits (35 .. 40)
70 * Memory/UV-HUB Processor Socket Address Format:
71 * +----------------+---------------+---------------------+
73 * +----------------+---------------+---------------------+
74 * <--- N bits --->|<--------M bits ----->
76 * M - number of node offset bits (35 .. 40)
77 * N - number of PNODE bits (0 .. 10)
91 * pppppppppplc0cch Nehalem-EX (12 bits in hdw reg)
92 * ppppppppplcc0cch Westmere-EX (12 bits in hdw reg)
115 * This value is also the value of the maximum number of non-router NASIDs
118 * NOTE: a brick may contain 1 or 2 OS nodes. Don't get these confused.
203 return (struct uv_hub_info_s *)uv_cpu_info->p_uv_hub_info; in _uv_hub_info()
209 return (struct uv_hub_info_s *)uv_cpu_info_per(cpu)->p_uv_hub_info; in uv_cpu_hub_info()
214 return uv_hub_info->hub_type; in uv_hub_type()
219 uv_hub_info->hub_type = uvmask; in uv_hub_type_set()
225 * This is a software convention - NOT the hardware revision numbers in
273 * in this file - not by other kernel code.
274 * n - NASID (full 15-bit global nasid)
275 * g - GNODE (full 15-bit global nasid, right shifted 1)
276 * p - PNODE (local part of nsids, right shifted 1)
279 (((n) >> uv_hub_info->nasid_shift) & uv_hub_info->pnode_mask)
280 #define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra)
282 (UV_PNODE_TO_GNODE(p) << uv_hub_info->nasid_shift)
332 #define UV_GLOBAL_MMR64_BASE (uv_hub_info->global_mmr_base)
338 #define UV_GLOBAL_MMR64_PNODE_SHIFT (uv_hub_info->global_mmr_shift)
356 * used by the system controller to monitor system-wide operation.
365 LOCAL_BUS_SIZE - \
383 /* global bits offset - number of local address bits in gpa for this UV arch */
386 return uv_hub_info->gpa_shift; in uv_gpa_shift()
393 struct uv_gam_range_s *gr = uv_hub_info->gr_table; in uv_gam_range()
394 unsigned long pal = (pa & uv_hub_info->gpa_mask) >> UV_GAM_RANGE_SHFT; in uv_gam_range()
395 int i, num = uv_hub_info->gr_table_len; in uv_gam_range()
399 if (pal < gr->limit) in uv_gam_range()
411 int base = gr->base; in uv_gam_range_base()
416 return uv_hub_info->gr_table[base].limit; in uv_gam_range_base()
419 /* socket phys RAM --> UV global NASID (UV4+) */
422 return uv_gam_range(paddr)->nasid; in uv_soc_phys_ram_to_nasid()
426 /* socket virtual --> UV global NASID (UV4+) */
432 /* socket phys RAM --> UV global physical address */
435 unsigned int m_val = uv_hub_info->m_val; in uv_soc_phys_ram_to_gpa()
437 if (paddr < uv_hub_info->lowmem_remap_top) in uv_soc_phys_ram_to_gpa()
438 paddr |= uv_hub_info->lowmem_remap_base; in uv_soc_phys_ram_to_gpa()
441 paddr |= uv_hub_info->gnode_upper; in uv_soc_phys_ram_to_gpa()
442 paddr = ((paddr << uv_hub_info->m_shift) in uv_soc_phys_ram_to_gpa()
443 >> uv_hub_info->m_shift) | in uv_soc_phys_ram_to_gpa()
444 ((paddr >> uv_hub_info->m_val) in uv_soc_phys_ram_to_gpa()
445 << uv_hub_info->n_lshift); in uv_soc_phys_ram_to_gpa()
448 << uv_hub_info->gpa_shift; in uv_soc_phys_ram_to_gpa()
453 /* socket virtual --> UV global physical address */
461 uv_gpa_in_mmr_space(unsigned long gpa) in uv_gpa_in_mmr_space() argument
463 return (gpa >> 62) == 0x3UL; in uv_gpa_in_mmr_space()
466 /* UV global physical address --> socket phys RAM */
467 static inline unsigned long uv_gpa_to_soc_phys_ram(unsigned long gpa) in uv_gpa_to_soc_phys_ram() argument
470 unsigned long remap_base = uv_hub_info->lowmem_remap_base; in uv_gpa_to_soc_phys_ram()
471 unsigned long remap_top = uv_hub_info->lowmem_remap_top; in uv_gpa_to_soc_phys_ram()
472 unsigned int m_val = uv_hub_info->m_val; in uv_gpa_to_soc_phys_ram()
475 gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) | in uv_gpa_to_soc_phys_ram()
476 ((gpa >> uv_hub_info->n_lshift) << uv_hub_info->m_val); in uv_gpa_to_soc_phys_ram()
478 paddr = gpa & uv_hub_info->gpa_mask; in uv_gpa_to_soc_phys_ram()
480 paddr -= remap_base; in uv_gpa_to_soc_phys_ram()
484 /* gpa -> gnode */
485 static inline unsigned long uv_gpa_to_gnode(unsigned long gpa) in uv_gpa_to_gnode() argument
487 unsigned int n_lshift = uv_hub_info->n_lshift; in uv_gpa_to_gnode()
490 return gpa >> n_lshift; in uv_gpa_to_gnode()
492 return uv_gam_range(gpa)->nasid >> 1; in uv_gpa_to_gnode()
495 /* gpa -> pnode */
496 static inline int uv_gpa_to_pnode(unsigned long gpa) in uv_gpa_to_pnode() argument
498 return uv_gpa_to_gnode(gpa) & uv_hub_info->pnode_mask; in uv_gpa_to_pnode()
501 /* gpa -> node offset */
502 static inline unsigned long uv_gpa_to_offset(unsigned long gpa) in uv_gpa_to_offset() argument
504 unsigned int m_shift = uv_hub_info->m_shift; in uv_gpa_to_offset()
507 return (gpa << m_shift) >> m_shift; in uv_gpa_to_offset()
509 return (gpa & uv_hub_info->gpa_mask) - uv_gam_range_base(gpa); in uv_gpa_to_offset()
515 return s2nid ? s2nid[socket - uv_hub_info->min_socket] : socket; in _uv_socket_to_node()
520 return _uv_socket_to_node(socket, uv_hub_info->socket_to_node); in uv_socket_to_node()
525 unsigned short *p2s = uv_hub_info->pnode_to_socket; in uv_pnode_to_socket()
527 return p2s ? p2s[pnode - uv_hub_info->min_pnode] : pnode; in uv_pnode_to_socket()
530 /* pnode, offset --> socket virtual */
533 unsigned int m_val = uv_hub_info->m_val; in uv_pnode_offset_to_vaddr()
546 base = (unsigned long)(uv_hub_info->gr_table[sockid - 1].limit); in uv_pnode_offset_to_vaddr()
553 int pnode = apicid >> uv_hub_info->apic_pnode_shift; in uv_apicid_to_pnode()
554 unsigned short *s2pn = uv_hub_info->socket_to_pnode; in uv_apicid_to_pnode()
556 return s2pn ? s2pn[pnode - uv_hub_info->min_socket] : pnode; in uv_apicid_to_pnode()
638 /* Blade-local cpu number of current cpu. Numbered 0 .. <# cpus on the blade> */
641 return uv_cpu_info->blade_cpu_id; in uv_blade_processor_id()
644 /* Blade-local cpu number of cpu N. Numbered 0 .. <# cpus on the blade> */
647 return uv_cpu_info_per(cpu)->blade_cpu_id; in uv_cpu_blade_processor_id()
650 /* Blade number to Node number (UV2..UV4 is 1:1) */
656 /* Blade number of current cpu. Numnbered 0 .. <#blades -1> */
659 return uv_hub_info->numa_blade_id; in uv_numa_blade_id()
665 * .. UV5 needs conversion when sub-numa clustering is enabled.
669 unsigned short *n2s = uv_hub_info->node_to_socket; in uv_node_to_blade_id()
677 return uv_cpu_hub_info(cpu)->numa_blade_id; in uv_cpu_to_blade_id()
683 unsigned short *s2p = uv_hub_info->socket_to_pnode; in uv_blade_to_pnode()
688 /* Nid of memory node on blade. -1 if no blade-local memory */
691 return uv_hub_info_list(uv_blade_to_node(bid))->memory_nid; in uv_blade_to_memory_nid()
697 return uv_hub_info_list(uv_blade_to_node(bid))->nr_possible_cpus; in uv_blade_nr_possible_cpus()
703 return uv_hub_info_list(uv_blade_to_node(bid))->nr_online_cpus; in uv_blade_nr_online_cpus()
709 return uv_cpu_hub_info(cpu)->pnode; in uv_cpu_to_pnode()
715 return uv_hub_info_list(nid)->pnode; in uv_node_to_pnode()
742 /* BMC sets a bit this MMR non-zero before sending an NMI */
775 #define UV_NMI_STATE_IN 1
785 return uv_hub_info->hub_revision; in uv_get_min_hub_revision_id()