summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/idle.c
diff options
context:
space:
mode:
authorMichael Ellerman2018-03-30 15:11:24 +0200
committerMichael Ellerman2018-03-31 00:09:36 +0200
commitf437c51748fa1dd423a878c870ad203843a51c8d (patch)
treed1593fe45c0341f88eecd26568bb913ac74c64a1 /arch/powerpc/platforms/powernv/idle.c
parentpowerpc/mm/hash: Don't memset pgd table if not needed (diff)
parentpowerpc/mm: Pass node id into create_section_mapping (diff)
downloadkernel-qcow2-linux-f437c51748fa1dd423a878c870ad203843a51c8d.tar.gz
kernel-qcow2-linux-f437c51748fa1dd423a878c870ad203843a51c8d.tar.xz
kernel-qcow2-linux-f437c51748fa1dd423a878c870ad203843a51c8d.zip
Merge branch 'topic/paca' into next
Bring in yet another series that touches KVM code, and might need to be merged into the kvm-ppc branch to resolve conflicts. This required some changes in pnv_power9_force_smt4_catch/release() due to the paca array becomming an array of pointers.
Diffstat (limited to 'arch/powerpc/platforms/powernv/idle.c')
-rw-r--r--arch/powerpc/platforms/powernv/idle.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
index 99a760eae964..d9e366bb23da 100644
--- a/arch/powerpc/platforms/powernv/idle.c
+++ b/arch/powerpc/platforms/powernv/idle.c
@@ -81,7 +81,7 @@ static int pnv_save_sprs_for_deep_states(void)
for_each_possible_cpu(cpu) {
uint64_t pir = get_hard_smp_processor_id(cpu);
- uint64_t hsprg0_val = (uint64_t)&paca[cpu];
+ uint64_t hsprg0_val = (uint64_t)paca_ptrs[cpu];
rc = opal_slw_set_reg(pir, SPRN_HSPRG0, hsprg0_val);
if (rc != 0)
@@ -174,12 +174,12 @@ static void pnv_alloc_idle_core_states(void)
for (j = 0; j < threads_per_core; j++) {
int cpu = first_cpu + j;
- paca[cpu].core_idle_state_ptr = core_idle_state;
- paca[cpu].thread_idle_state = PNV_THREAD_RUNNING;
- paca[cpu].thread_mask = 1 << j;
+ paca_ptrs[cpu]->core_idle_state_ptr = core_idle_state;
+ paca_ptrs[cpu]->thread_idle_state = PNV_THREAD_RUNNING;
+ paca_ptrs[cpu]->thread_mask = 1 << j;
if (!cpu_has_feature(CPU_FTR_POWER9_DD1))
continue;
- paca[cpu].thread_sibling_pacas =
+ paca_ptrs[cpu]->thread_sibling_pacas =
kmalloc_node(paca_ptr_array_size,
GFP_KERNEL, node);
}
@@ -405,22 +405,20 @@ void power9_idle(void)
void pnv_power9_force_smt4_catch(void)
{
int cpu, cpu0, thr;
- struct paca_struct *tpaca;
int awake_threads = 1; /* this thread is awake */
int poke_threads = 0;
int need_awake = threads_per_core;
cpu = smp_processor_id();
cpu0 = cpu & ~(threads_per_core - 1);
- tpaca = &paca[cpu0];
for (thr = 0; thr < threads_per_core; ++thr) {
if (cpu != cpu0 + thr)
- atomic_inc(&tpaca[thr].dont_stop);
+ atomic_inc(&paca_ptrs[cpu0+thr]->dont_stop);
}
/* order setting dont_stop vs testing requested_psscr */
mb();
for (thr = 0; thr < threads_per_core; ++thr) {
- if (!tpaca[thr].requested_psscr)
+ if (!paca_ptrs[cpu0+thr]->requested_psscr)
++awake_threads;
else
poke_threads |= (1 << thr);
@@ -433,14 +431,14 @@ void pnv_power9_force_smt4_catch(void)
if (poke_threads & (1 << thr)) {
ppc_msgsnd_sync();
ppc_msgsnd(PPC_DBELL_MSGTYPE, 0,
- tpaca[thr].hw_cpu_id);
+ paca_ptrs[cpu0+thr]->hw_cpu_id);
}
}
/* now spin until at least 3 threads are awake */
do {
for (thr = 0; thr < threads_per_core; ++thr) {
if ((poke_threads & (1 << thr)) &&
- !tpaca[thr].requested_psscr) {
+ !paca_ptrs[cpu0+thr]->requested_psscr) {
++awake_threads;
poke_threads &= ~(1 << thr);
}
@@ -453,16 +451,14 @@ EXPORT_SYMBOL_GPL(pnv_power9_force_smt4_catch);
void pnv_power9_force_smt4_release(void)
{
int cpu, cpu0, thr;
- struct paca_struct *tpaca;
cpu = smp_processor_id();
cpu0 = cpu & ~(threads_per_core - 1);
- tpaca = &paca[cpu0];
/* clear all the dont_stop flags */
for (thr = 0; thr < threads_per_core; ++thr) {
if (cpu != cpu0 + thr)
- atomic_dec(&tpaca[thr].dont_stop);
+ atomic_dec(&paca_ptrs[cpu0+thr]->dont_stop);
}
}
EXPORT_SYMBOL_GPL(pnv_power9_force_smt4_release);
@@ -830,7 +826,8 @@ static int __init pnv_init_idle_states(void)
for (i = 0; i < threads_per_core; i++) {
int j = base_cpu + i;
- paca[j].thread_sibling_pacas[idx] = &paca[cpu];
+ paca_ptrs[j]->thread_sibling_pacas[idx] =
+ paca_ptrs[cpu];
}
}
}