]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: use platform numbering of cpus for hypervisor calls.
authorPaul Mackerras <paulus@samba.org>
Mon, 23 Aug 2004 05:29:56 +0000 (22:29 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 05:29:56 +0000 (22:29 -0700)
We were using Linux's cpu numbering for cpu-related hypervisor calls (e.g.
vpa registration, H_CONFER).  It happened to work most of the time because
Linux and the hypervisor usually, but not always, have the same numbering
for cpus.

Signed-off-by: Nathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/smp.c
arch/ppc64/lib/locks.c

index 99bb6ab11d9e14e9c45605efe036741986179732..514b0ef6c6c523af7068d55fc95c6840f68f7524 100644 (file)
@@ -487,11 +487,11 @@ static void __init smp_space_timers(unsigned int max_cpus)
 #ifdef CONFIG_PPC_PSERIES
 void vpa_init(int cpu)
 {
-       unsigned long flags;
+       unsigned long flags, pcpu = get_hard_smp_processor_id(cpu);
 
        /* Register the Virtual Processor Area (VPA) */
        flags = 1UL << (63 - 18);
-       register_vpa(flags, cpu, __pa((unsigned long)&(paca[cpu].lppaca)));
+       register_vpa(flags, pcpu, __pa((unsigned long)&(paca[cpu].lppaca)));
 }
 
 static inline void smp_xics_do_message(int cpu, int msg)
index 58e973cc8f57a2bf7c132f4e2630fdfb73e18434..703118d6a1ef4c20b194d9891fb76f139b560e67 100644 (file)
@@ -63,7 +63,8 @@ void __spin_yield(spinlock_t *lock)
        HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
                ((u64)holder_cpu << 32) | yield_count);
 #else
-       plpar_hcall_norets(H_CONFER, holder_cpu, yield_count);
+       plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu),
+                          yield_count);
 #endif
 }
 
@@ -179,7 +180,8 @@ void __rw_yield(rwlock_t *rw)
        HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
                ((u64)holder_cpu << 32) | yield_count);
 #else
-       plpar_hcall_norets(H_CONFER, holder_cpu, yield_count);
+       plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu),
+                          yield_count);
 #endif
 }