From 0883fb85d489b31b7caec780a3180a08b7d2623a Mon Sep 17 00:00:00 2001 From: Ilya Smirnov Date: Fri, 23 Mar 2018 17:02:12 -0500 Subject: Pass SBE Security Backdoor Bit to HB Bootloader Add a "SBE security backdoor" bit to reflect the state of the SBE security backdoor; the bit is passed to the hostboot bootloader from SBE. The new bit is the inverse of the ATTR_SECURITY_MODE attribute. Also bump the version of SBE/bootloader to reflect the change. Change-Id: Idf3009447c51c66306c043daf7f8189b8cbf2f36 RTC:188961 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56309 Tested-by: FSP CI Jenkins Reviewed-by: Nicholas E. Bofferding Reviewed-by: Michael Baiocchi Tested-by: Jenkins Server Tested-by: PPE CI Tested-by: Hostboot CI Reviewed-by: Sachin Gupta Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56318 --- src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H | 6 ++++-- src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C | 4 ++-- src/import/chips/p9/procedures/hwp/perv/p9_sbe_attr_setup.C | 5 +++++ .../xml/attribute_info/p9_sbe_load_bootloader_attributes.xml | 5 +++-- 4 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/import/chips/p9') diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H index 2a4ca38c..3780b3bb 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H +++ b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -60,6 +60,7 @@ enum SbeBootloaderVersion SAB_ADDED = 0x00090002, MMIO_BARS_ADDED = 0x00090003, ADDR_STASH_SUPPORT_ADDED = 0x00090004, + SBE_BACKDOOR_BIT_ADDED = 0x00090005, }; union BootloaderSecureSettings @@ -68,7 +69,8 @@ union BootloaderSecureSettings struct { // Bit Breakdown - sync with ATTR_SECURE_SETTINGS - uint8_t reserved : 5; // reserved + uint8_t reserved : 4; // reserved + uint8_t secBackdoorBit : 1; // SBE Security Backdoor Bit uint8_t allowAttrOverrides : 1; // Allow Attribute Overrides in // Secure Mode uint8_t securityOverride : 1; // Security Override diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C index fed5330f..74d35da0 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C +++ b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -413,7 +413,7 @@ get_bootloader_config_data( l_chip_base_address_mmio), "Error from p9_fbc_utils_get_chip_base_address (chip)"); - l_bootloader_config_data.version = ADDR_STASH_SUPPORT_ADDED; + l_bootloader_config_data.version = SBE_BACKDOOR_BIT_ADDED; // XSCOM BAR offset FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_XSCOM_BAR_BASE_ADDR_OFFSET, diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_attr_setup.C b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_attr_setup.C index 03ed40bb..522a5fd2 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_attr_setup.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_attr_setup.C @@ -129,6 +129,11 @@ fapi2::ReturnCode p9_sbe_attr_setup(const FAPI_DBG("Reading ATTR_SECURITY_MODE"); FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SECURITY_MODE, FAPI_SYSTEM, l_read_1)); + + //Transfer SBE Security Backdoor Bit + //Need to invert the bit since 1 == Secure mode == Backdoor disabled + // 0 == Unsecure mode == Backdoor enabled + l_secure_settings.secBackdoorBit = !l_read_1; //Getting CBS_CS register value FAPI_TRY(fapi2::getScom(i_target_chip, PERV_CBS_CS_SCOM, read_cbs_reg)); diff --git a/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_load_bootloader_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_load_bootloader_attributes.xml index 0fd5d891..348d37d4 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_load_bootloader_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_load_bootloader_attributes.xml @@ -5,7 +5,7 @@ - + @@ -81,7 +81,8 @@ ATTR_SECURE_SETTINGS TARGET_TYPE_SYSTEM Byte collecting Security Overrides - bits 0:4 - reserved + bits 0:3 - reserved + bit 4 - SBE Security Backdoor Enabled bit 5 - Allow Attribute Overrides in Securemode bit 6 - Override Security Setting bit 7 - Secure Access Bit -- cgit v1.2.1