diff options
author | Sachin Gupta <sgupta2m@in.ibm.com> | 2018-01-15 06:52:24 -0600 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2018-01-19 07:57:04 -0500 |
commit | 5d57ec968d47e2093c71452d5052cba482a09a68 (patch) | |
tree | 5aee43e6718e572197c333850dc88efc89ea9772 /src/sbefw/core | |
parent | d43ff15ada7dd3cb313de3aa91a3996b2ef06a69 (diff) | |
download | talos-sbe-5d57ec968d47e2093c71452d5052cba482a09a68.tar.gz talos-sbe-5d57ec968d47e2093c71452d5052cba482a09a68.zip |
Do not allow invalid scom via sbe fifo path
Change-Id: I5255e89c75243486acdd74ca9e07c9a680db6677
CQ: SW410020
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51952
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw/core')
-rw-r--r-- | src/sbefw/core/sbescom.C | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/sbefw/core/sbescom.C b/src/sbefw/core/sbescom.C index 7c4105a0..fcefcbbc 100644 --- a/src/sbefw/core/sbescom.C +++ b/src/sbefw/core/sbescom.C @@ -5,7 +5,8 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -57,6 +58,8 @@ static const uint32_t MAX_INDSCOM_TIMEOUT_NS = 100000; //0.1 ns static const uint64_t DIRECT_SCOM_ADDR_MASK = 0x8000000000000000; static const uint64_t INDIRECT_SCOM_NEW_ADDR_MASK = 0x9000000000000000; +static const uint64_t SCOM_SBE_ADDR_MASK = 0x80000000; +static const uint64_t SCOM_MASTER_ID_MASK = 0x00F00000; // Scom types enum sbeScomType @@ -80,6 +83,17 @@ void checkIndirectAndDoScom( const bool i_isRead, ReturnCode fapiRc = FAPI2_RC_SUCCESS; do { + // Do address validation + // SBE throws data storage exception if Master ID field is not 0. Also + // we halt sbe for SBE address space errors. So check these registers + // at top level so that we do not halt SBE in these cases. + if(( i_addr & SCOM_SBE_ADDR_MASK) || ( i_addr & SCOM_MASTER_ID_MASK )) + { + SBE_ERROR(SBE_FUNC "Invalid scom"); + o_hdr->primaryStatus = SBE_PRI_USER_ERROR ; + o_hdr->secondaryStatus = SBE_SEC_INVALID_ADDRESS_PASSED ; + break; + } // If the indirect scom bit is 0, then doing a regular scom if( (i_addr & DIRECT_SCOM_ADDR_MASK) == 0) { |