Skip to content

Commit a3f6792

Browse files
jjmcgillsannerd
authored andcommitted
updates for thread control, ramming with STOP enabled
remove pre-stop checks in p9_thread_control_stop, just attempt stop and confirm final expected state is reached: - after special wakeup from STOP2, existing threads_stopped check will fail given that the thread does not reach maintenance mode - the threads_running check will also fail assert ram_active in ram_setup function, if the thread is found to be inactive at the time ram is requested Change-Id: Iad8fd9e8a14395102b6c1b31d6595300a2da111f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42674 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Kevin F. Reick <reick@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42679 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
1 parent def5f05 commit a3f6792

File tree

2 files changed

+42
-65
lines changed

2 files changed

+42
-65
lines changed

src/import/chips/p9/procedures/hwp/core/p9_thread_control.C

Lines changed: 33 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -585,79 +585,48 @@ fapi2::ReturnCode p9_thread_control_stop(
585585
FAPI_DBG("p9_thread_control_stop : Initiating stop command to core PC logic for threads 0x%x",
586586
i_threads);
587587

588-
// Check if the thread is already stopped, in that condition the procedure
589-
// should simply say thread stop success and no error.
590-
bool l_isStopped = false;
591-
FAPI_TRY(threads_stopped(i_target, i_threads, o_rasStatusReg, l_isStopped),
592-
"p9_thread_control_stop: unable to determine if threads are stopped. threads: 0x%x",
593-
i_threads);
594-
595-
if(false == l_isStopped)
588+
// Block interrupts while stopped
596589
{
597-
// Pre-condition for stopping is that the threads are running (see figure 5.3 in the workbook)
598-
// How to reconcile with 5.5.1 which says "invalid in maint mode?" Is that just a sub-precondition?
599-
{
600-
bool l_running = false;
601-
FAPI_TRY(threads_running(i_target, i_threads, o_rasStatusReg, l_running),
602-
"p9_thread_control_stop: unable to determine if threads are running. threads: 0x%x",
603-
i_threads);
604-
605-
PTC_ASSERT_WARN(l_running == true,
606-
i_warncheck,
607-
fapi2::P9_THREAD_CONTROL_STOP_PRE_NOTRUNNING()
608-
.set_CORE_TARGET(i_target)
609-
.set_THREAD(i_threads),
610-
"p9_thread_control_stop: ERROR: Threads cannot be stopped because they aren't running (threads=%x).", i_threads);
611-
}
612-
613-
// Block interrupts while stopped
614-
{
615-
fapi2::buffer<uint64_t> l_mode_data;
616-
617-
// SW375288: Reads to C_RAS_MODEREG causes SPR corruption. For now, the code will assume no other
618-
// bits are set and only set/clear mr_fence_interrupts
619-
//FAPI_TRY(fapi2::getScom(i_target, C_RAS_MODEREG, l_mode_data),
620-
// "p9_thread_control_step: getScom error when reading ras_modreg for threads 0x%x",
621-
// i_threads);
622-
623-
l_mode_data.setBit<RAS_MODE_MR_FENCE_INTERRUPTS>();
624-
FAPI_TRY(fapi2::putScom(i_target, C_RAS_MODEREG, l_mode_data),
625-
"p9_thread_control_step: putScom error when issuing ras_modreg step mode for threads 0x%x",
626-
i_threads);
627-
}
590+
fapi2::buffer<uint64_t> l_mode_data;
628591

629-
// Stop the threads
630-
{
631-
fapi2::buffer<uint64_t> l_scom_data(g_control_reg_map[i_threads] >> CORE_STOP);
592+
// SW375288: Reads to C_RAS_MODEREG causes SPR corruption. For now, the code will assume no other
593+
// bits are set and only set/clear mr_fence_interrupts
594+
//FAPI_TRY(fapi2::getScom(i_target, C_RAS_MODEREG, l_mode_data),
595+
// "p9_thread_control_step: getScom error when reading ras_modreg for threads 0x%x",
596+
// i_threads);
632597

633-
FAPI_TRY(fapi2::putScom(i_target, C_DIRECT_CONTROLS, l_scom_data),
634-
"p9_thread_control_stop: putScom error when issuing sp_stop for threads 0x%x",
635-
i_threads);
636-
}
598+
l_mode_data.setBit<RAS_MODE_MR_FENCE_INTERRUPTS>();
599+
FAPI_TRY(fapi2::putScom(i_target, C_RAS_MODEREG, l_mode_data),
600+
"p9_thread_control_step: putScom error when issuing ras_modreg step mode for threads 0x%x",
601+
i_threads);
602+
}
637603

638-
// Post-conditions check
639-
{
640-
bool l_stopped = false;
641-
FAPI_TRY(threads_stopped(i_target, i_threads, o_rasStatusReg, l_stopped),
642-
"p9_thread_control_stop: unable to determine if threads are stopped. threads: 0x%x",
643-
i_threads);
604+
// Stop the threads
605+
{
606+
fapi2::buffer<uint64_t> l_scom_data(g_control_reg_map[i_threads] >> CORE_STOP);
644607

645-
PTC_ASSERT_WARN(l_stopped == true,
646-
i_warncheck,
647-
fapi2::P9_THREAD_CONTROL_STOP_FAIL()
648-
.set_CORE_TARGET(i_target)
649-
.set_THREAD(i_threads),
650-
"p9_thread_control_stop: ERROR: Thread Stop issued, but the threads are running. "
651-
"Stop might have failed for threads 0x%x", i_threads);
652-
}
653-
FAPI_INF("p9_thread_control_stop : stop command issued for threads 0x%x",
608+
FAPI_TRY(fapi2::putScom(i_target, C_DIRECT_CONTROLS, l_scom_data),
609+
"p9_thread_control_stop: putScom error when issuing sp_stop for threads 0x%x",
654610
i_threads);
655611
}
656-
else
612+
613+
// Post-conditions check
657614
{
658-
FAPI_INF("p9_thread_control_stop : skipped calling stop cmd, since "
659-
"thread [0x%x] already in stop mode", i_threads);
615+
bool l_stopped = false;
616+
FAPI_TRY(threads_stopped(i_target, i_threads, o_rasStatusReg, l_stopped),
617+
"p9_thread_control_stop: unable to determine if threads are stopped. threads: 0x%x",
618+
i_threads);
619+
620+
PTC_ASSERT_WARN(l_stopped == true,
621+
i_warncheck,
622+
fapi2::P9_THREAD_CONTROL_STOP_FAIL()
623+
.set_CORE_TARGET(i_target)
624+
.set_THREAD(i_threads),
625+
"p9_thread_control_stop: ERROR: Thread Stop issued, but the threads are running. "
626+
"Stop might have failed for threads 0x%x", i_threads);
660627
}
628+
FAPI_INF("p9_thread_control_stop : stop command issued for threads 0x%x",
629+
i_threads);
661630

662631
fapi_try_exit:
663632
return fapi2::current_err;

src/import/chips/p9/procedures/hwp/perv/p9_ram_core.C

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -180,6 +180,14 @@ fapi2::ReturnCode RamCore::ram_setup()
180180
FAPI_DBG("THREAD_INFO:%#lx", l_data());
181181
FAPI_TRY(l_data.extractToRight(l_thread_active, C_THREAD_INFO_VTID0_ACTIVE + iv_thread, 1));
182182

183+
if (!l_thread_active)
184+
{
185+
FAPI_TRY(l_data.setBit(C_THREAD_INFO_RAM_THREAD_ACTIVE + iv_thread));
186+
FAPI_TRY(fapi2::putScom(iv_target, C_THREAD_INFO, l_data));
187+
FAPI_TRY(fapi2::getScom(iv_target, C_THREAD_INFO, l_data));
188+
FAPI_TRY(l_data.extractToRight(l_thread_active, C_THREAD_INFO_VTID0_ACTIVE + iv_thread, 1));
189+
}
190+
183191
FAPI_ASSERT(l_thread_active,
184192
fapi2::P9_RAM_THREAD_INACTIVE_ERR()
185193
.set_THREAD(iv_thread),

0 commit comments

Comments
 (0)