Commit a1e78db3 authored by Tony Luck's avatar Tony Luck

Pull define-node-cleanup into release branch

parents fbbb0bd1 59c42235
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include "xtalk/hubdev.h" #include "xtalk/hubdev.h"
#include "xtalk/xwidgetdev.h" #include "xtalk/xwidgetdev.h"
nasid_t master_nasid = INVALID_NASID; /* Partition Master */
static struct list_head sn_sysdata_list; static struct list_head sn_sysdata_list;
/* sysdata list struct */ /* sysdata list struct */
...@@ -165,7 +163,7 @@ static void sn_fixup_ionodes(void) ...@@ -165,7 +163,7 @@ static void sn_fixup_ionodes(void)
* Get SGI Specific HUB chipset information. * Get SGI Specific HUB chipset information.
* Inform Prom that this kernel can support domain bus numbering. * Inform Prom that this kernel can support domain bus numbering.
*/ */
for (i = 0; i < numionodes; i++) { for (i = 0; i < num_cnodes; i++) {
hubdev = (struct hubdev_info *)(NODEPDA(i)->pdinfo); hubdev = (struct hubdev_info *)(NODEPDA(i)->pdinfo);
nasid = cnodeid_to_nasid(i); nasid = cnodeid_to_nasid(i);
hubdev->max_segment_number = 0xffffffff; hubdev->max_segment_number = 0xffffffff;
......
...@@ -59,8 +59,6 @@ DEFINE_PER_CPU(struct pda_s, pda_percpu); ...@@ -59,8 +59,6 @@ DEFINE_PER_CPU(struct pda_s, pda_percpu);
#define MAX_PHYS_MEMORY (1UL << IA64_MAX_PHYS_BITS) /* Max physical address supported */ #define MAX_PHYS_MEMORY (1UL << IA64_MAX_PHYS_BITS) /* Max physical address supported */
lboard_t *root_lboard[MAX_COMPACT_NODES];
extern void bte_init_node(nodepda_t *, cnodeid_t); extern void bte_init_node(nodepda_t *, cnodeid_t);
extern void sn_timer_init(void); extern void sn_timer_init(void);
...@@ -97,15 +95,15 @@ u8 sn_region_size; ...@@ -97,15 +95,15 @@ u8 sn_region_size;
EXPORT_SYMBOL(sn_region_size); EXPORT_SYMBOL(sn_region_size);
int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */ int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
short physical_node_map[MAX_PHYSNODE_ID]; short physical_node_map[MAX_NUMALINK_NODES];
static unsigned long sn_prom_features[MAX_PROM_FEATURE_SETS]; static unsigned long sn_prom_features[MAX_PROM_FEATURE_SETS];
EXPORT_SYMBOL(physical_node_map); EXPORT_SYMBOL(physical_node_map);
int numionodes; int num_cnodes;
static void sn_init_pdas(char **); static void sn_init_pdas(char **);
static void scan_for_ionodes(void); static void build_cnode_tables(void);
static nodepda_t *nodepdaindr[MAX_COMPACT_NODES]; static nodepda_t *nodepdaindr[MAX_COMPACT_NODES];
...@@ -139,19 +137,6 @@ extern char drive_info[4 * 16]; ...@@ -139,19 +137,6 @@ extern char drive_info[4 * 16];
char drive_info[4 * 16]; char drive_info[4 * 16];
#endif #endif
/*
* Get nasid of current cpu early in boot before nodepda is initialized
*/
static int
boot_get_nasid(void)
{
int nasid;
if (ia64_sn_get_sapic_info(get_sapicid(), &nasid, NULL, NULL))
BUG();
return nasid;
}
/* /*
* This routine can only be used during init, since * This routine can only be used during init, since
* smp_boot_data is an init data structure. * smp_boot_data is an init data structure.
...@@ -223,7 +208,6 @@ void __init early_sn_setup(void) ...@@ -223,7 +208,6 @@ void __init early_sn_setup(void)
} }
extern int platform_intr_list[]; extern int platform_intr_list[];
extern nasid_t master_nasid;
static int __initdata shub_1_1_found = 0; static int __initdata shub_1_1_found = 0;
/* /*
...@@ -269,7 +253,6 @@ static void __init sn_check_for_wars(void) ...@@ -269,7 +253,6 @@ static void __init sn_check_for_wars(void)
void __init sn_setup(char **cmdline_p) void __init sn_setup(char **cmdline_p)
{ {
long status, ticks_per_sec, drift; long status, ticks_per_sec, drift;
int pxm;
u32 version = sn_sal_rev(); u32 version = sn_sal_rev();
extern void sn_cpu_init(void); extern void sn_cpu_init(void);
...@@ -300,11 +283,10 @@ void __init sn_setup(char **cmdline_p) ...@@ -300,11 +283,10 @@ void __init sn_setup(char **cmdline_p)
MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY; MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY;
memset(physical_node_map, -1, sizeof(physical_node_map)); /*
for (pxm = 0; pxm < MAX_PXM_DOMAINS; pxm++) * Build the tables for managing cnodes.
if (pxm_to_nid_map[pxm] != -1) */
physical_node_map[pxm_to_nasid(pxm)] = build_cnode_tables();
pxm_to_nid_map[pxm];
/* /*
* Old PROMs do not provide an ACPI FADT. Disable legacy keyboard * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard
...@@ -319,8 +301,6 @@ void __init sn_setup(char **cmdline_p) ...@@ -319,8 +301,6 @@ void __init sn_setup(char **cmdline_p)
printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF);
master_nasid = boot_get_nasid();
status = status =
ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec,
&drift); &drift);
...@@ -378,15 +358,6 @@ static void __init sn_init_pdas(char **cmdline_p) ...@@ -378,15 +358,6 @@ static void __init sn_init_pdas(char **cmdline_p)
{ {
cnodeid_t cnode; cnodeid_t cnode;
memset(sn_cnodeid_to_nasid, -1,
sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
for_each_online_node(cnode)
sn_cnodeid_to_nasid[cnode] =
pxm_to_nasid(nid_to_pxm_map[cnode]);
numionodes = num_online_nodes();
scan_for_ionodes();
/* /*
* Allocate & initalize the nodepda for each node. * Allocate & initalize the nodepda for each node.
*/ */
...@@ -402,7 +373,7 @@ static void __init sn_init_pdas(char **cmdline_p) ...@@ -402,7 +373,7 @@ static void __init sn_init_pdas(char **cmdline_p)
/* /*
* Allocate & initialize nodepda for TIOs. For now, put them on node 0. * Allocate & initialize nodepda for TIOs. For now, put them on node 0.
*/ */
for (cnode = num_online_nodes(); cnode < numionodes; cnode++) { for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++) {
nodepdaindr[cnode] = nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t)); alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
...@@ -411,7 +382,7 @@ static void __init sn_init_pdas(char **cmdline_p) ...@@ -411,7 +382,7 @@ static void __init sn_init_pdas(char **cmdline_p)
/* /*
* Now copy the array of nodepda pointers to each nodepda. * Now copy the array of nodepda pointers to each nodepda.
*/ */
for (cnode = 0; cnode < numionodes; cnode++) for (cnode = 0; cnode < num_cnodes; cnode++)
memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr,
sizeof(nodepdaindr)); sizeof(nodepdaindr));
...@@ -428,7 +399,7 @@ static void __init sn_init_pdas(char **cmdline_p) ...@@ -428,7 +399,7 @@ static void __init sn_init_pdas(char **cmdline_p)
* Initialize the per node hubdev. This includes IO Nodes and * Initialize the per node hubdev. This includes IO Nodes and
* headless/memless nodes. * headless/memless nodes.
*/ */
for (cnode = 0; cnode < numionodes; cnode++) { for (cnode = 0; cnode < num_cnodes; cnode++) {
hubdev_init_node(nodepdaindr[cnode], cnode); hubdev_init_node(nodepdaindr[cnode], cnode);
} }
} }
...@@ -553,87 +524,58 @@ void __init sn_cpu_init(void) ...@@ -553,87 +524,58 @@ void __init sn_cpu_init(void)
} }
/* /*
* Scan klconfig for ionodes. Add the nasids to the * Build tables for converting between NASIDs and cnodes.
* physical_node_map and the pda and increment numionodes.
*/ */
static inline int __init board_needs_cnode(int type)
{
return (type == KLTYPE_SNIA || type == KLTYPE_TIO);
}
static void __init scan_for_ionodes(void) void __init build_cnode_tables(void)
{ {
int nasid = 0; int nasid;
int node;
lboard_t *brd; lboard_t *brd;
/* fakeprom does not support klgraph */ memset(physical_node_map, -1, sizeof(physical_node_map));
if (IS_RUNNING_ON_FAKE_PROM()) memset(sn_cnodeid_to_nasid, -1,
return; sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
/* Setup ionodes with memory */
for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
char *klgraph_header;
cnodeid_t cnodeid;
if (physical_node_map[nasid] == -1)
continue;
cnodeid = -1; /*
klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); * First populate the tables with C/M bricks. This ensures that
if (!klgraph_header) { * cnode == node for all C & M bricks.
BUG(); /* All nodes must have klconfig tables! */ */
} for_each_online_node(node) {
cnodeid = nasid_to_cnodeid(nasid); nasid = pxm_to_nasid(nid_to_pxm_map[node]);
root_lboard[cnodeid] = (lboard_t *) sn_cnodeid_to_nasid[node] = nasid;
NODE_OFFSET_TO_LBOARD((nasid), physical_node_map[nasid] = node;
((kl_config_hdr_t
*) (klgraph_header))->
ch_board_info);
} }
/* Scan headless/memless IO Nodes. */ /*
for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { * num_cnodes is total number of C/M/TIO bricks. Because of the 256 node
/* if there's no nasid, don't try to read the klconfig on the node */ * limit on the number of nodes, we can't use the generic node numbers
if (physical_node_map[nasid] == -1) * for this. Note that num_cnodes is incremented below as TIOs or
continue; * headless/memoryless nodes are discovered.
brd = find_lboard_any((lboard_t *) */
root_lboard[nasid_to_cnodeid(nasid)], num_cnodes = num_online_nodes();
KLTYPE_SNIA);
if (brd) {
brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */
if (!brd)
continue;
}
brd = find_lboard_any(brd, KLTYPE_SNIA);
while (brd) { /* fakeprom does not support klgraph */
sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid; if (IS_RUNNING_ON_FAKE_PROM())
physical_node_map[brd->brd_nasid] = numionodes; return;
root_lboard[numionodes] = brd;
numionodes++;
brd = KLCF_NEXT_ANY(brd);
if (!brd)
break;
brd = find_lboard_any(brd, KLTYPE_SNIA);
}
}
/* Scan for TIO nodes. */ /* Find TIOs & headless/memoryless nodes and add them to the tables */
for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { for_each_online_node(node) {
/* if there's no nasid, don't try to read the klconfig on the node */ kl_config_hdr_t *klgraph_header;
if (physical_node_map[nasid] == -1) nasid = cnodeid_to_nasid(node);
continue; if ((klgraph_header = ia64_sn_get_klconfig_addr(nasid)) == NULL)
brd = find_lboard_any((lboard_t *) BUG();
root_lboard[nasid_to_cnodeid(nasid)], brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info);
KLTYPE_TIO);
while (brd) { while (brd) {
sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid; if (board_needs_cnode(brd->brd_type) && physical_node_map[brd->brd_nasid] < 0) {
physical_node_map[brd->brd_nasid] = numionodes; sn_cnodeid_to_nasid[num_cnodes] = brd->brd_nasid;
root_lboard[numionodes] = brd; physical_node_map[brd->brd_nasid] = num_cnodes++;
numionodes++; }
brd = KLCF_NEXT_ANY(brd); brd = find_lboard_next(brd);
if (!brd)
break;
brd = find_lboard_any(brd, KLTYPE_TIO);
} }
} }
} }
......
...@@ -476,8 +476,8 @@ static int sn_topology_show(struct seq_file *s, void *d) ...@@ -476,8 +476,8 @@ static int sn_topology_show(struct seq_file *s, void *d)
for_each_online_cpu(j) { for_each_online_cpu(j) {
seq_printf(s, j ? ":%d" : ", dist %d", seq_printf(s, j ? ":%d" : ", dist %d",
node_distance( node_distance(
cpuid_to_cnodeid(i), cpu_to_node(i),
cpuid_to_cnodeid(j))); cpu_to_node(j)));
} }
seq_putc(s, '\n'); seq_putc(s, '\n');
} }
......
...@@ -489,12 +489,11 @@ static int __init tiocx_init(void) ...@@ -489,12 +489,11 @@ static int __init tiocx_init(void)
bus_register(&tiocx_bus_type); bus_register(&tiocx_bus_type);
for (cnodeid = 0; cnodeid < MAX_COMPACT_NODES; cnodeid++) { for (cnodeid = 0; cnodeid < num_cnodes; cnodeid++) {
nasid_t nasid; nasid_t nasid;
int bt; int bt;
if ((nasid = cnodeid_to_nasid(cnodeid)) < 0) nasid = cnodeid_to_nasid(cnodeid);
break; /* No more nasids .. bail out of loop */
if ((nasid & 0x1) && is_fpga_tio(nasid, &bt)) { if ((nasid & 0x1) && is_fpga_tio(nasid, &bt)) {
struct hubdev_info *hubdev; struct hubdev_info *hubdev;
......
...@@ -44,7 +44,7 @@ static u64 xpc_sh2_IPI_access3; ...@@ -44,7 +44,7 @@ static u64 xpc_sh2_IPI_access3;
/* original protection values for each node */ /* original protection values for each node */
u64 xpc_prot_vec[MAX_COMPACT_NODES]; u64 xpc_prot_vec[MAX_NUMNODES];
/* this partition's reserved page */ /* this partition's reserved page */
......
...@@ -441,7 +441,7 @@ static irqreturn_t ...@@ -441,7 +441,7 @@ static irqreturn_t
mmtimer_interrupt(int irq, void *dev_id, struct pt_regs *regs) mmtimer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
int i; int i;
mmtimer_t *base = timers + cpuid_to_cnodeid(smp_processor_id()) * mmtimer_t *base = timers + cpu_to_node(smp_processor_id()) *
NUM_COMPARATORS; NUM_COMPARATORS;
unsigned long expires = 0; unsigned long expires = 0;
int result = IRQ_NONE; int result = IRQ_NONE;
...@@ -608,7 +608,7 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, ...@@ -608,7 +608,7 @@ static int sgi_timer_set(struct k_itimer *timr, int flags,
*/ */
preempt_disable(); preempt_disable();
nodeid = cpuid_to_cnodeid(smp_processor_id()); nodeid = cpu_to_node(smp_processor_id());
base = timers + nodeid * NUM_COMPARATORS; base = timers + nodeid * NUM_COMPARATORS;
retry: retry:
/* Don't use an allocated timer, or a deleted one that's pending */ /* Don't use an allocated timer, or a deleted one that's pending */
......
...@@ -377,7 +377,7 @@ scdrv_init(void) ...@@ -377,7 +377,7 @@ scdrv_init(void)
dev_t first_dev, dev; dev_t first_dev, dev;
nasid_t event_nasid = ia64_sn_get_console_nasid(); nasid_t event_nasid = ia64_sn_get_console_nasid();
if (alloc_chrdev_region(&first_dev, 0, numionodes, if (alloc_chrdev_region(&first_dev, 0, num_cnodes,
SYSCTL_BASENAME) < 0) { SYSCTL_BASENAME) < 0) {
printk("%s: failed to register SN system controller device\n", printk("%s: failed to register SN system controller device\n",
__FUNCTION__); __FUNCTION__);
...@@ -385,7 +385,7 @@ scdrv_init(void) ...@@ -385,7 +385,7 @@ scdrv_init(void)
} }
snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME); snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME);
for (cnode = 0; cnode < numionodes; cnode++) { for (cnode = 0; cnode < num_cnodes; cnode++) {
geoid = cnodeid_get_geoid(cnode); geoid = cnodeid_get_geoid(cnode);
devnamep = devname; devnamep = devname;
format_module_id(devnamep, geo_module(geoid), format_module_id(devnamep, geo_module(geoid),
......
...@@ -17,6 +17,32 @@ ...@@ -17,6 +17,32 @@
#include <asm/sn/types.h> #include <asm/sn/types.h>
#include <asm/sn/sn_cpuid.h> #include <asm/sn/sn_cpuid.h>
/*
* This is the maximum number of NUMALINK nodes that can be part of a single
* SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in
* remote partitions are NOT included in this number.
* The number of compact nodes cannot exceed size of a coherency domain.
* The purpose of this define is to specify a node count that includes
* all C/M/TIO nodes in an SSI system.
*
* SGI system can currently support up to 256 C/M nodes plus additional TIO nodes.
*
* Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade
* to ACPI3.0, this limit will be removed. The notion of "compact nodes"
* should be deleted and TIOs should be included in MAX_NUMNODES.
*/
#define MAX_COMPACT_NODES 512
/*
* Maximum number of nodes in all partitions and in all coherency domains.
* This is the total number of nodes accessible in the numalink fabric. It
* includes all C & M bricks, plus all TIOs.
*
* This value is also the value of the maximum number of NASIDs in the numalink
* fabric.
*/
#define MAX_NUMALINK_NODES 16384
/* /*
* The following defines attributes of the HUB chip. These attributes are * The following defines attributes of the HUB chip. These attributes are
* frequently referenced. They are kept in the per-cpu data areas of each cpu. * frequently referenced. They are kept in the per-cpu data areas of each cpu.
...@@ -40,15 +66,6 @@ DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); ...@@ -40,15 +66,6 @@ DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
#define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found) #define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found)
/*
* This is the maximum number of nodes that can be part of a kernel.
* Effectively, it's the maximum number of compact node ids (cnodeid_t).
* This is not necessarily the same as MAX_NASIDS.
*/
#define MAX_COMPACT_NODES 2048
#define CPUS_PER_NODE 4
/* /*
* Compact node ID to nasid mappings kept in the per-cpu data areas of each * Compact node ID to nasid mappings kept in the per-cpu data areas of each
* cpu. * cpu.
...@@ -57,7 +74,6 @@ DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); ...@@ -57,7 +74,6 @@ DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
#define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0])) #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
extern u8 sn_partition_id; extern u8 sn_partition_id;
extern u8 sn_system_size; extern u8 sn_system_size;
extern u8 sn_sharing_domain_size; extern u8 sn_sharing_domain_size;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */ extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
extern void __sn_mmiowb(void); /* Forward definition */ extern void __sn_mmiowb(void); /* Forward definition */
extern int numionodes; extern int num_cnodes;
#define __sn_mf_a() ia64_mfa() #define __sn_mf_a() ia64_mfa()
......
...@@ -208,19 +208,6 @@ typedef struct lboard_s { ...@@ -208,19 +208,6 @@ typedef struct lboard_s {
klconf_off_t brd_next_same; /* Next BOARD with same nasid */ klconf_off_t brd_next_same; /* Next BOARD with same nasid */
} lboard_t; } lboard_t;
#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
#define NODE_OFFSET_TO_KLINFO(n,off) ((klinfo_t*) TO_NODE_CAC(n,off))
#define KLCF_NEXT(_brd) \
((_brd)->brd_next_same ? \
(NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL)
#define KLCF_NEXT_ANY(_brd) \
((_brd)->brd_next_any ? \
(NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL)
#define KLCF_COMP(_brd, _ndx) \
((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \
(NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)])))
/* /*
* Generic info structure. This stores common info about a * Generic info structure. This stores common info about a
* component. * component.
...@@ -249,24 +236,11 @@ typedef struct klinfo_s { /* Generic info */ ...@@ -249,24 +236,11 @@ typedef struct klinfo_s { /* Generic info */
} klinfo_t ; } klinfo_t ;
static inline lboard_t *find_lboard_any(lboard_t * start, unsigned char brd_type) static inline lboard_t *find_lboard_next(lboard_t * brd)
{ {
/* Search all boards stored on this node. */ if (brd && brd->brd_next_any)
return NODE_OFFSET_TO_LBOARD(NASID_GET(brd), brd->brd_next_any);
while (start) { return NULL;
if (start->brd_type == brd_type)
return start;
start = KLCF_NEXT_ANY(start);
}
/* Didn't find it. */
return (lboard_t *) NULL;
} }
/* external declarations of Linux kernel functions. */
extern lboard_t *root_lboard[];
extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
#endif /* _ASM_IA64_SN_KLCONFIG_H */ #endif /* _ASM_IA64_SN_KLCONFIG_H */
...@@ -105,7 +105,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */ ...@@ -105,7 +105,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */
#define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid) #define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid)
#define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode) #define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode)
#define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice) #define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice)
#define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)])
/* /*
...@@ -113,8 +112,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */ ...@@ -113,8 +112,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */
* of potentially large tables. * of potentially large tables.
*/ */
extern int nasid_slice_to_cpuid(int, int); extern int nasid_slice_to_cpuid(int, int);
#define nasid_slice_to_cpu_physical_id(nasid, slice) \
cpu_physical_id(nasid_slice_to_cpuid(nasid, slice))
/* /*
* cnodeid_to_nasid - convert a cnodeid to a NASID * cnodeid_to_nasid - convert a cnodeid to a NASID
......
...@@ -206,26 +206,16 @@ ia64_sn_get_master_baseio_nasid(void) ...@@ -206,26 +206,16 @@ ia64_sn_get_master_baseio_nasid(void)
return ret_stuff.v0; return ret_stuff.v0;
} }
static inline char * static inline void *
ia64_sn_get_klconfig_addr(nasid_t nasid) ia64_sn_get_klconfig_addr(nasid_t nasid)
{ {
struct ia64_sal_retval ret_stuff; struct ia64_sal_retval ret_stuff;
int cnodeid;
cnodeid = nasid_to_cnodeid(nasid);
ret_stuff.status = 0; ret_stuff.status = 0;
ret_stuff.v0 = 0; ret_stuff.v0 = 0;
ret_stuff.v1 = 0; ret_stuff.v1 = 0;
ret_stuff.v2 = 0; ret_stuff.v2 = 0;
SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0); SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
/*
* We should panic if a valid cnode nasid does not produce
* a klconfig address.
*/
if (ret_stuff.status != 0) {
panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status);
}
return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL; return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
} }
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
* C-brick nasids, thus the need for bitmaps which don't account for * C-brick nasids, thus the need for bitmaps which don't account for
* odd-numbered (non C-brick) nasids. * odd-numbered (non C-brick) nasids.
*/ */
#define XP_MAX_PHYSNODE_ID (MAX_PHYSNODE_ID / 2) #define XP_MAX_PHYSNODE_ID (MAX_NUMALINK_NODES / 2)
#define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8) #define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8)
#define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64) #define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment