[patch 1/4] Use platform numbering of cpus for hypervisor calls.

nathanl at austin.ibm.com nathanl at austin.ibm.com
Sat Jul 31 07:45:50 EST 2004


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 at austin.ibm.com>


---


diff -puN arch/ppc64/kernel/smp.c~ppc64_fix_hcall_cpuids arch/ppc64/kernel/smp.c
--- 2.6.8-rc2-mm1/arch/ppc64/kernel/smp.c~ppc64_fix_hcall_cpuids	2004-07-30 10:16:57.000000000 -0500
+++ 2.6.8-rc2-mm1-nathanl/arch/ppc64/kernel/smp.c	2004-07-30 16:44:39.000000000 -0500
@@ -501,11 +501,11 @@ static void __init smp_space_timers(unsi
 #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)
diff -puN arch/ppc64/lib/locks.c~ppc64_fix_hcall_cpuids arch/ppc64/lib/locks.c
--- 2.6.8-rc2-mm1/arch/ppc64/lib/locks.c~ppc64_fix_hcall_cpuids	2004-07-30 10:16:57.000000000 -0500
+++ 2.6.8-rc2-mm1-nathanl/arch/ppc64/lib/locks.c	2004-07-30 10:16:57.000000000 -0500
@@ -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
 }


_

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list