Commit 5e2a7337 authored by Jesse Barnes's avatar Jesse Barnes Committed by Tony Luck

[IA64-SGI] fix bogus address dereference in sn/setup.c

Some code in sn/setup.c was trying to dereference a physical address, which
usually doesn't work (esp. not with the region register init patch I posted).
This patch converts the function used to find the klconfig to return virtual
char * instead of a physical address and updates the caller to deal with it.
Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent f00fb0ec
...@@ -505,15 +505,15 @@ static void __init scan_for_ionodes(void) ...@@ -505,15 +505,15 @@ static void __init scan_for_ionodes(void)
/* Setup ionodes with memory */ /* Setup ionodes with memory */
for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
u64 klgraph_header; char *klgraph_header;
cnodeid_t cnodeid; cnodeid_t cnodeid;
if (physical_node_map[nasid] == -1) if (physical_node_map[nasid] == -1)
continue; continue;
klgraph_header = cnodeid = -1; cnodeid = -1;
klgraph_header = ia64_sn_get_klconfig_addr(nasid); klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid));
if (klgraph_header <= 0) { if (!klgraph_header) {
if (IS_RUNNING_ON_SIMULATOR()) if (IS_RUNNING_ON_SIMULATOR())
continue; continue;
BUG(); /* All nodes must have klconfig tables! */ BUG(); /* All nodes must have klconfig tables! */
......
...@@ -203,7 +203,7 @@ ia64_sn_get_master_baseio_nasid(void) ...@@ -203,7 +203,7 @@ ia64_sn_get_master_baseio_nasid(void)
return ret_stuff.v0; return ret_stuff.v0;
} }
static inline u64 static inline char *
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;
...@@ -223,7 +223,7 @@ ia64_sn_get_klconfig_addr(nasid_t nasid) ...@@ -223,7 +223,7 @@ ia64_sn_get_klconfig_addr(nasid_t nasid)
if (ret_stuff.status != 0) { if (ret_stuff.status != 0) {
panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status); panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status);
} }
return(ret_stuff.v0); return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
} }
/* /*
......
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