Skip to contentSkip to conversation

sgi-xp: xpc needs to pass the physical address, not virtual

PATCH Applied Russ Anderson 2 participants 2 messages Dec 12, 2008 – Dec 16, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sgi-xp: xpc needs to pass the physical address, not virtual

xpc needs to pass the physical address, not virtual.

---
Testing uncovered this problem. The virtual address happens to work most of the time due to the way bios was masking off the node bits. Passing the physical address makes it work all of the time.

 arch/x86/include/asm/uv/bios.h |    2 +-
 arch/x86/kernel/bios_uv.c      |    4 +---
 drivers/misc/sgi-xp/xpc_uv.c   |    8 ++++----
 3 files changed, 6 insertions(+), 8 deletions(-)
drivers/misc/sgi-xp/xpc_uv.c +4 -4
Index: linux/drivers/misc/sgi-xp/xpc_uv.c
===================================================================
@@ -119,16 +119,16 @@ xpc_gru_mq_watchlist_alloc_uv(struct xpc
 	int ret;
 
 #if defined CONFIG_X86_64
-	ret = uv_bios_mq_watchlist_alloc(mq->mmr_blade, mq->address, mq->order,
-					 &mq->mmr_offset);
+	ret = uv_bios_mq_watchlist_alloc(mq->mmr_blade, uv_gpa(mq->address),
+					 mq->order, &mq->mmr_offset);
 	if (ret < 0) {
 		dev_err(xpc_part, "uv_bios_mq_watchlist_alloc() failed, "
 			"ret=%d\n", ret);
 		return ret;
 	}
 #elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV
-	ret = sn_mq_watchlist_alloc(mq->mmr_blade, mq->address, mq->order,
-				    &mq->mmr_offset);
+	ret = sn_mq_watchlist_alloc(mq->mmr_blade, uv_gpa(mq->address),
+				    mq->order, &mq->mmr_offset);
 	if (ret < 0) {
 		dev_err(xpc_part, "sn_mq_watchlist_alloc() failed, ret=%d\n",
 			ret);
arch/x86/include/asm/uv/bios.h +1 -1
Index: linux/arch/x86/include/asm/uv/bios.h
===================================================================
@@ -100,7 +100,7 @@ extern s64 uv_bios_call_reentrant(enum u
 
 extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *);
 extern s64 uv_bios_freq_base(u64, u64 *);
-extern int uv_bios_mq_watchlist_alloc(int, void *, unsigned int,
+extern int uv_bios_mq_watchlist_alloc(int, unsigned long, unsigned int,
 					unsigned long *);
 extern int uv_bios_mq_watchlist_free(int, int);
 extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect);
arch/x86/kernel/bios_uv.c +1 -3
Index: linux/arch/x86/kernel/bios_uv.c
===================================================================
@@ -101,15 +101,13 @@ s64 uv_bios_get_sn_info(int fc, int *uvt
 }
 
 int
-uv_bios_mq_watchlist_alloc(int blade, void *mq, unsigned int mq_size,
+uv_bios_mq_watchlist_alloc(int blade, unsigned long addr, unsigned int mq_size,
 			   unsigned long *intr_mmr_offset)
 {
 	union uv_watchlist_u size_blade;
-	unsigned long addr;
 	u64 watchlist;
 	s64 ret;
 
-	addr = (unsigned long)mq;
 	size_blade.size = mq_size;
 	size_blade.blade = blade;
 
Signature · 2 lines
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          [email protected]
Applied
#1 lore raw
Quoted 11 lines · Russ Anderson

xpc needs to pass the physical address, not virtual.

---
Testing uncovered this problem. The virtual address happens to work most of the time due to the way bios was masking off the node bits. Passing the physical address makes it work all of the time.

Quoted 4 lines
 arch/x86/include/asm/uv/bios.h |    2 +-
 arch/x86/kernel/bios_uv.c      |    4 +---
 drivers/misc/sgi-xp/xpc_uv.c   |    8 ++++----
 3 files changed, 6 insertions(+), 8 deletions(-)

applied to tip/x86/uv, thanks Russ!

Ingo