sgi-xp: xpc needs to pass the physical address, not virtual
authorRuss Anderson <rja@sgi.com>
Fri, 12 Dec 2008 17:07:00 +0000 (11:07 -0600)
committerIngo Molnar <mingo@elte.hu>
Tue, 16 Dec 2008 22:04:24 +0000 (23:04 +0100)
Impact: fix crash

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.

Signed-off-by: Russ Anderson <rja@sgi.com>
Acked-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/uv/bios.h
arch/x86/kernel/bios_uv.c
drivers/misc/sgi-xp/xpc_uv.c

index da1c4e8e78fcc9b39b78675f5f999c37626f59db..7ed17ff502b9edd76afb96fe682609a4df1afffe 100644 (file)
@@ -100,7 +100,7 @@ extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64);
 
 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);
index d22d0f1bbea04c652c6cd3dbad12c1bcc0b864fa..2a0a2a3cac263a87edc38f12894185749a1b9dd5 100644 (file)
@@ -101,15 +101,13 @@ s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher,
 }
 
 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;
 
index 684b2dd17583f76433f51f2b5befba3d4473394a..91a55b1b1037011c5e403b19dac8c710d18632d5 100644 (file)
@@ -119,16 +119,16 @@ xpc_gru_mq_watchlist_alloc_uv(struct xpc_gru_mq_uv *mq)
        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);