Commit 04aff4ba authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc64: use platform numbering of cpus for hypervisor calls.

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: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1092beac
...@@ -487,11 +487,11 @@ static void __init smp_space_timers(unsigned int max_cpus) ...@@ -487,11 +487,11 @@ static void __init smp_space_timers(unsigned int max_cpus)
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
void vpa_init(int cpu) void vpa_init(int cpu)
{ {
unsigned long flags; unsigned long flags, pcpu = get_hard_smp_processor_id(cpu);
/* Register the Virtual Processor Area (VPA) */ /* Register the Virtual Processor Area (VPA) */
flags = 1UL << (63 - 18); 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) static inline void smp_xics_do_message(int cpu, int msg)
......
...@@ -63,7 +63,8 @@ void __spin_yield(spinlock_t *lock) ...@@ -63,7 +63,8 @@ void __spin_yield(spinlock_t *lock)
HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
((u64)holder_cpu << 32) | yield_count); ((u64)holder_cpu << 32) | yield_count);
#else #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 #endif
} }
...@@ -179,7 +180,8 @@ void __rw_yield(rwlock_t *rw) ...@@ -179,7 +180,8 @@ void __rw_yield(rwlock_t *rw)
HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
((u64)holder_cpu << 32) | yield_count); ((u64)holder_cpu << 32) | yield_count);
#else #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 #endif
} }
......
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