summaryrefslogtreecommitdiffstats
path: root/src/usr/secureboot/base
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2016-05-03 11:54:36 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-10 22:27:35 -0400
commit9be8174da5f2e1d804d2d84b5891adda01c7de75 (patch)
tree44ed9ae4a1cae2d03d73ce2d102e10e0ffe0a3ff /src/usr/secureboot/base
parent30a0eb25085ecffacfa5825906068d56a875f8c3 (diff)
downloadtalos-hostboot-9be8174da5f2e1d804d2d84b5891adda01c7de75.tar.gz
talos-hostboot-9be8174da5f2e1d804d2d84b5891adda01c7de75.zip
Update purge of L3 cache during initial boot
Change-Id: Ic6cfabbdfe8f10cf5fa1cd9a4a13093452b61978 RTC:118832 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24021 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot/base')
-rw-r--r--src/usr/secureboot/base/makefile1
-rw-r--r--src/usr/secureboot/base/purge.C163
-rw-r--r--src/usr/secureboot/base/service.C17
3 files changed, 7 insertions, 174 deletions
diff --git a/src/usr/secureboot/base/makefile b/src/usr/secureboot/base/makefile
index f33416568..63e7fa826 100644
--- a/src/usr/secureboot/base/makefile
+++ b/src/usr/secureboot/base/makefile
@@ -29,7 +29,6 @@ SUBDIRS += test.d
OBJS += service.o
OBJS += settings.o
OBJS += header.o
-OBJS += purge.o
OBJS += securerom.o
OBJS += rom_entry.o
OBJS += trustedboot_base.o
diff --git a/src/usr/secureboot/base/purge.C b/src/usr/secureboot/base/purge.C
deleted file mode 100644
index 5d9b7b624..000000000
--- a/src/usr/secureboot/base/purge.C
+++ /dev/null
@@ -1,163 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/secureboot/base/purge.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#include <stdint.h>
-#include <sys/task.h>
-#include <sys/time.h>
-#include <devicefw/userif.H>
-#include <secureboot/secure_reasoncodes.H>
-
-#include "purge.H"
-
-namespace SECUREBOOT
-{
- errlHndl_t issueBlindPurge()
- {
- errlHndl_t l_errl = NULL;
-// @todo-RTC:118832 Remove with purge update
-#if (0)
- static const uint64_t PURGE_REG = 0x1001080e;
-
- // Bits : Value
- // 0 : 0b1 = Initiate Purge
- // 1:4 : 0b0100 = Full Blind Purge
- // 13:28 : 0x1000 = CGC is (512k / 128 byte line size)
- // CGC means "Congruence Class", ie. cache row.
- static const uint64_t PURGE_VALUE = 0xa000800000000000;
-
- // Bit 0 - Purge Pending.
- static const uint64_t PURGE_PENDING = 0x8000000000000000;
-
- static const size_t RETRY_COUNT = 100;
- static const size_t RETRY_WAIT_NS = ONE_CTX_SWITCH_NS;
-
- do
- {
- size_t coreId = (task_getcpuid() / 8) & 0xF;
- uint64_t regAddr = PURGE_REG + 0x01000000 * coreId;
-
- uint64_t data = 0;
- size_t size = sizeof(data);
-
- // Read purge register to ensure no operation is pending.
- l_errl =
- deviceRead(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
- &data, size,
- DEVICE_SCOM_ADDRESS(regAddr));
- if (l_errl)
- {
- break;
- }
-
- if (data & PURGE_PENDING)
- {
- /*@
- * @errortype
- * @moduleid SECUREBOOT::MOD_SECURE_BLINDPURGE
- * @reasoncode SECUREBOOT::RC_PURGEOP_PENDING
- * @userdata1 SCOM value.
- * @userdata2 CPU ID (PIR) encountering failure.
- * @devdesc Attempted to purge cache while purge operation
- * was pending.
- */
- l_errl =
- new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_SECURE_BLINDPURGE,
- RC_PURGEOP_PENDING,
- data, task_getcpuid());
- // Probably a code bug
- l_errl->addProcedureCallout( HWAS::EPUB_PRC_HB_CODE,
- HWAS::SRCI_PRIORITY_HIGH );
- // But there might be something wrong with the chip
- // or the SBE image
- l_errl->addHwCallout(
- TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
- HWAS::SRCI_PRIORITY_LOW,
- HWAS::NO_DECONFIG,
- HWAS::GARD_NULL );
- break;
- }
-
- // Initiate purge operation
- data = PURGE_VALUE;
- l_errl =
- deviceWrite(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
- &data, size,
- DEVICE_SCOM_ADDRESS(regAddr));
- if (l_errl)
- {
- break;
- }
-
- // Wait for purge to complete.
- for(size_t i = 0; i < RETRY_COUNT; i++)
- {
- l_errl =
- deviceRead(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
- &data, size,
- DEVICE_SCOM_ADDRESS(regAddr));
-
- if ((l_errl) || !(data & PURGE_PENDING))
- {
- break;
- }
-
- nanosleep(0, RETRY_WAIT_NS);
- }
- if (l_errl)
- {
- break;
- }
- if (data & PURGE_PENDING) // Ensure op did complete.
- {
- /*@
- * @errortype
- * @moduleid SECUREBOOT::MOD_SECURE_BLINDPURGE
- * @reasoncode SECUREBOOT::RC_PURGEOP_FAIL_COMPLETE
- * @userdata1 SCOM value of Reg 0x1001080E
- * @devdesc Purge operation never completed.
- */
- l_errl =
- new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_SECURE_BLINDPURGE,
- RC_PURGEOP_FAIL_COMPLETE,
- data);
- // Most likely a hardware issue of some sort
- l_errl->addHwCallout(
- TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
- HWAS::SRCI_PRIORITY_HIGH,
- HWAS::NO_DECONFIG,
- HWAS::GARD_NULL );
- // Could also be a code bug
- l_errl->addProcedureCallout( HWAS::EPUB_PRC_HB_CODE,
- HWAS::SRCI_PRIORITY_MED );
- break;
- }
-
- } while(0);
-#endif
- return l_errl;
- }
-
-}
diff --git a/src/usr/secureboot/base/service.C b/src/usr/secureboot/base/service.C
index d3159c1f2..215094041 100644
--- a/src/usr/secureboot/base/service.C
+++ b/src/usr/secureboot/base/service.C
@@ -32,6 +32,7 @@
#include "settings.H"
#include "header.H"
#include "purge.H"
+#include <kernel/misc.H>
namespace SECUREBOOT
{
@@ -51,17 +52,13 @@ namespace SECUREBOOT
Singleton<Header>::instance().loadBaseHeader();
}
- // Blind-purge lower portion of cache.
- l_errl = issueBlindPurge();
- if (l_errl)
- {
- break;
- }
-#endif
+ // Run dcbz on the entire 10MB cache
+ assert(0 == mm_extend(MM_EXTEND_FULL_CACHE));
+#else
// Extend memory footprint into lower portion of cache.
- // This can only fail is someone has already called to extend
- // to post-secureboot state. Major coding bug, so just assert.
- assert(0 == mm_extend(MM_EXTEND_POST_SECUREBOOT));
+ assert(0 == mm_extend(MM_EXTEND_PARTIAL_CACHE));
+
+#endif
// Disable SecureROM in VPO
#ifndef CONFIG_P9_VPO_COMPILE
OpenPOWER on IntegriCloud