aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/asm-offsets.c1
-rw-r--r--arch/powerpc/kernel/cputable.c19
-rw-r--r--arch/powerpc/kernel/dt_cpu_ftrs.c4
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S4
-rw-r--r--arch/powerpc/kernel/idle_book3s.S50
-rw-r--r--arch/powerpc/kernel/process.c10
6 files changed, 3 insertions, 85 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 0a0544335950..89cf15566c4e 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -766,7 +766,6 @@ int main(void)
766 OFFSET(PACA_THREAD_IDLE_STATE, paca_struct, thread_idle_state); 766 OFFSET(PACA_THREAD_IDLE_STATE, paca_struct, thread_idle_state);
767 OFFSET(PACA_THREAD_MASK, paca_struct, thread_mask); 767 OFFSET(PACA_THREAD_MASK, paca_struct, thread_mask);
768 OFFSET(PACA_SUBCORE_SIBLING_MASK, paca_struct, subcore_sibling_mask); 768 OFFSET(PACA_SUBCORE_SIBLING_MASK, paca_struct, subcore_sibling_mask);
769 OFFSET(PACA_SIBLING_PACA_PTRS, paca_struct, thread_sibling_pacas);
770 OFFSET(PACA_REQ_PSSCR, paca_struct, requested_psscr); 769 OFFSET(PACA_REQ_PSSCR, paca_struct, requested_psscr);
771 OFFSET(PACA_DONT_STOP, paca_struct, dont_stop); 770 OFFSET(PACA_DONT_STOP, paca_struct, dont_stop);
772#define STOP_SPR(x, f) OFFSET(x, paca_struct, stop_sprs.f) 771#define STOP_SPR(x, f) OFFSET(x, paca_struct, stop_sprs.f)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index c8fc9691f8c7..bc75a2908a7e 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -485,25 +485,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
485 .machine_check_early = __machine_check_early_realmode_p8, 485 .machine_check_early = __machine_check_early_realmode_p8,
486 .platform = "power8", 486 .platform = "power8",
487 }, 487 },
488 { /* Power9 DD1*/
489 .pvr_mask = 0xffffff00,
490 .pvr_value = 0x004e0100,
491 .cpu_name = "POWER9 (raw)",
492 .cpu_features = CPU_FTRS_POWER9_DD1,
493 .cpu_user_features = COMMON_USER_POWER9,
494 .cpu_user_features2 = COMMON_USER2_POWER9,
495 .mmu_features = MMU_FTRS_POWER9,
496 .icache_bsize = 128,
497 .dcache_bsize = 128,
498 .num_pmcs = 6,
499 .pmc_type = PPC_PMC_IBM,
500 .oprofile_cpu_type = "ppc64/power9",
501 .oprofile_type = PPC_OPROFILE_INVALID,
502 .cpu_setup = __setup_cpu_power9,
503 .cpu_restore = __restore_cpu_power9,
504 .machine_check_early = __machine_check_early_realmode_p9,
505 .platform = "power9",
506 },
507 { /* Power9 DD2.0 */ 488 { /* Power9 DD2.0 */
508 .pvr_mask = 0xffffefff, 489 .pvr_mask = 0xffffefff,
509 .pvr_value = 0x004e0200, 490 .pvr_value = 0x004e0200,
diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 4be1c0de9406..98c373a4c1cf 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -701,9 +701,7 @@ static __init void cpufeatures_cpu_quirks(void)
701 /* 701 /*
702 * Not all quirks can be derived from the cpufeatures device tree. 702 * Not all quirks can be derived from the cpufeatures device tree.
703 */ 703 */
704 if ((version & 0xffffff00) == 0x004e0100) 704 if ((version & 0xffffefff) == 0x004e0200)
705 cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD1;
706 else if ((version & 0xffffefff) == 0x004e0200)
707 ; /* DD2.0 has no feature flag */ 705 ; /* DD2.0 has no feature flag */
708 else if ((version & 0xffffefff) == 0x004e0201) 706 else if ((version & 0xffffefff) == 0x004e0201)
709 cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1; 707 cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 285c6465324a..76a14702cb9c 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -276,9 +276,7 @@ BEGIN_FTR_SECTION
276 * 276 *
277 * This interrupt can wake directly from idle. If that is the case, 277 * This interrupt can wake directly from idle. If that is the case,
278 * the machine check is handled then the idle wakeup code is called 278 * the machine check is handled then the idle wakeup code is called
279 * to restore state. In that case, the POWER9 DD1 idle PACA workaround 279 * to restore state.
280 * is not applied in the early machine check code, which will cause
281 * bugs.
282 */ 280 */
283 mr r11,r1 /* Save r1 */ 281 mr r11,r1 /* Save r1 */
284 lhz r10,PACA_IN_MCE(r13) 282 lhz r10,PACA_IN_MCE(r13)
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index e734f6e45abc..d85d5515a091 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -467,43 +467,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_P9_TM_XER_SO_BUG)
467#endif 467#endif
468 468
469/* 469/*
470 * On waking up from stop 0,1,2 with ESL=1 on POWER9 DD1,
471 * HSPRG0 will be set to the HSPRG0 value of one of the
472 * threads in this core. Thus the value we have in r13
473 * may not be this thread's paca pointer.
474 *
475 * Fortunately, the TIR remains invariant. Since this thread's
476 * paca pointer is recorded in all its sibling's paca, we can
477 * correctly recover this thread's paca pointer if we
478 * know the index of this thread in the core.
479 *
480 * This index can be obtained from the TIR.
481 *
482 * i.e, thread's position in the core = TIR.
483 * If this value is i, then this thread's paca is
484 * paca->thread_sibling_pacas[i].
485 */
486power9_dd1_recover_paca:
487 mfspr r4, SPRN_TIR
488 /*
489 * Since each entry in thread_sibling_pacas is 8 bytes
490 * we need to left-shift by 3 bits. Thus r4 = i * 8
491 */
492 sldi r4, r4, 3
493 /* Get &paca->thread_sibling_pacas[0] in r5 */
494 ld r5, PACA_SIBLING_PACA_PTRS(r13)
495 /* Load paca->thread_sibling_pacas[i] into r13 */
496 ldx r13, r4, r5
497 SET_PACA(r13)
498 /*
499 * Indicate that we have lost NVGPR state
500 * which needs to be restored from the stack.
501 */
502 li r3, 1
503 stb r3,PACA_NAPSTATELOST(r13)
504 blr
505
506/*
507 * Called from machine check handler for powersave wakeups. 470 * Called from machine check handler for powersave wakeups.
508 * Low level machine check processing has already been done. Now just 471 * Low level machine check processing has already been done. Now just
509 * go through the wake up path to get everything in order. 472 * go through the wake up path to get everything in order.
@@ -537,9 +500,6 @@ pnv_powersave_wakeup:
537 ld r2, PACATOC(r13) 500 ld r2, PACATOC(r13)
538 501
539BEGIN_FTR_SECTION 502BEGIN_FTR_SECTION
540BEGIN_FTR_SECTION_NESTED(70)
541 bl power9_dd1_recover_paca
542END_FTR_SECTION_NESTED_IFSET(CPU_FTR_POWER9_DD1, 70)
543 bl pnv_restore_hyp_resource_arch300 503 bl pnv_restore_hyp_resource_arch300
544FTR_SECTION_ELSE 504FTR_SECTION_ELSE
545 bl pnv_restore_hyp_resource_arch207 505 bl pnv_restore_hyp_resource_arch207
@@ -602,22 +562,12 @@ END_FTR_SECTION_IFCLR(CPU_FTR_POWER9_DD2_1)
602 LOAD_REG_ADDRBASE(r5,pnv_first_deep_stop_state) 562 LOAD_REG_ADDRBASE(r5,pnv_first_deep_stop_state)
603 ld r4,ADDROFF(pnv_first_deep_stop_state)(r5) 563 ld r4,ADDROFF(pnv_first_deep_stop_state)(r5)
604 564
605BEGIN_FTR_SECTION_NESTED(71)
606 /*
607 * Assume that we are waking up from the state
608 * same as the Requested Level (RL) in the PSSCR
609 * which are Bits 60-63
610 */
611 ld r5,PACA_REQ_PSSCR(r13)
612 rldicl r5,r5,0,60
613FTR_SECTION_ELSE_NESTED(71)
614 /* 565 /*
615 * 0-3 bits correspond to Power-Saving Level Status 566 * 0-3 bits correspond to Power-Saving Level Status
616 * which indicates the idle state we are waking up from 567 * which indicates the idle state we are waking up from
617 */ 568 */
618 mfspr r5, SPRN_PSSCR 569 mfspr r5, SPRN_PSSCR
619 rldicl r5,r5,4,60 570 rldicl r5,r5,4,60
620ALT_FTR_SECTION_END_NESTED_IFSET(CPU_FTR_POWER9_DD1, 71)
621 li r0, 0 /* clear requested_psscr to say we're awake */ 571 li r0, 0 /* clear requested_psscr to say we're awake */
622 std r0, PACA_REQ_PSSCR(r13) 572 std r0, PACA_REQ_PSSCR(r13)
623 cmpd cr4,r5,r4 573 cmpd cr4,r5,r4
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 9ef4aea9fffe..27f0caee55ea 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1250,17 +1250,9 @@ struct task_struct *__switch_to(struct task_struct *prev,
1250 * mappings. If the new process has the foreign real address 1250 * mappings. If the new process has the foreign real address
1251 * mappings, we must issue a cp_abort to clear any state and 1251 * mappings, we must issue a cp_abort to clear any state and
1252 * prevent snooping, corruption or a covert channel. 1252 * prevent snooping, corruption or a covert channel.
1253 *
1254 * DD1 allows paste into normal system memory so we do an
1255 * unpaired copy, rather than cp_abort, to clear the buffer,
1256 * since cp_abort is quite expensive.
1257 */ 1253 */
1258 if (current_thread_info()->task->thread.used_vas) { 1254 if (current_thread_info()->task->thread.used_vas)
1259 asm volatile(PPC_CP_ABORT); 1255 asm volatile(PPC_CP_ABORT);
1260 } else if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
1261 asm volatile(PPC_COPY(%0, %1)
1262 : : "r"(dummy_copy_buffer), "r"(0));
1263 }
1264 } 1256 }
1265#endif /* CONFIG_PPC_BOOK3S_64 */ 1257#endif /* CONFIG_PPC_BOOK3S_64 */
1266 1258