Skip to content

Commit

Permalink
Invoke P9 TIs correctly
Browse files Browse the repository at this point in the history
Prior to this change, the assembly code to invoke p9 attentions did not
flush the instruction cache, which led to the alternative behavior of the
attn instruction, namely invoking the hypervisor emulation assistance
interrupt / illegal instruction handler.  This caused chaos in the shutdown
path, especially after the CPUs come online in istep 16.

Change-Id: I7c5bf4342a41136e82326da285eed059d4fb17a3
CQ: SW419736
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61351
Tested-by: Jenkins Server <pfd-jenkins+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: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Nick Bofferding authored and dcrowell77 committed Jun 27, 2018
1 parent a729adb commit fd642c6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
16 changes: 10 additions & 6 deletions src/kernel/forceattn_p8.S → src/kernel/forceattn_p9.S
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/kernel/forceattn_p8.S $
# $Source: src/kernel/forceattn_p9.S $
#
# OpenPOWER HostBoot Project
#
Expand All @@ -25,20 +25,24 @@
.include "kernel/ppcconsts.S"


.global p8_force_attn
p8_force_attn:
li r0, 1
.global p9_force_attn
p9_force_attn:
# Update HID0 to enable attentions
li r0, 3
mfspr r9, HID0
insrdi r9,r0,1,3 /* Turn on bit 3 */
rldimi r9,r0,60,2 /* Turn on bits 2 (flush icache) + 3 (enable attn) */
sync
mtspr HID0,r9 /* Enable attentions */
mtspr HID0,r9 /* Enable attentions */
mfspr r9, HID0
mfspr r9, HID0
mfspr r9, HID0
mfspr r9, HID0
mfspr r9, HID0
mfspr r9, HID0
isync
# Invoke attention instruction
sync
isync
rlwimi 31,31,0,4,22 /* MAGIC_SIMICS_SHUTDOWN */
attn
b 0
4 changes: 2 additions & 2 deletions src/kernel/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2010,2017
# Contributors Listed Below - COPYRIGHT 2010,2018
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -59,7 +59,7 @@ OBJS += intmsghandler.o
OBJS += deferred.o

OBJS += shutdown.o
OBJS += forceattn_p8.o
OBJS += forceattn_p9.o
OBJS += terminate.o
OBJS += ipc.o
OBJS += machchk.o
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/terminate.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <kernel/kernel_reasoncodes.H>
#endif // BOOTLOADER

extern "C" void p8_force_attn() NO_RETURN;
extern "C" void p9_force_attn() NO_RETURN;


#ifndef BOOTLOADER
Expand All @@ -55,7 +55,7 @@ HB_Descriptor kernel_hbDescriptor =
void terminateExecuteTI()
{
// Call the function that actually executes the TI code.
p8_force_attn();
p9_force_attn();
}

#ifndef BOOTLOADER
Expand Down
4 changes: 2 additions & 2 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ BOOTLDR_OBJECTS += bl_pnorAccess.o
BOOTLDR_OBJECTS += bl_pnor_utils.o
BOOTLDR_OBJECTS += bl_pnor_ecc.o
BOOTLDR_OBJECTS += bl_terminate.o
BOOTLDR_OBJECTS += forceattn_p8.o
BOOTLDR_OBJECTS += forceattn_p9.o
BOOTLDR_OBJECTS += bl_string_utils.o
BOOTLDR_OBJECTS += rom_entry.o

Expand Down Expand Up @@ -116,7 +116,7 @@ DIRECT_BOOT_OBJECTS += blockmsghdlr.o
DIRECT_BOOT_OBJECTS += stacksegment.o
DIRECT_BOOT_OBJECTS += softpatch_p8.o
DIRECT_BOOT_OBJECTS += shutdown.o
DIRECT_BOOT_OBJECTS += forceattn_p8.o
DIRECT_BOOT_OBJECTS += forceattn_p9.o
DIRECT_BOOT_OBJECTS += terminate.o
DIRECT_BOOT_OBJECTS += ipc.o
DIRECT_BOOT_OBJECTS += machchk.o
Expand Down

0 comments on commit fd642c6

Please sign in to comment.