summaryrefslogtreecommitdiffstats
path: root/src/build/security/securityRegListGen.py
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2017-05-25 05:48:51 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2017-10-04 00:41:48 -0400
commit4b8ed3f80f35d4de9e913f1fee92a0a95e8f8834 (patch)
tree35206384c3b93e4a8cbe54410e5df6bd98ed8799 /src/build/security/securityRegListGen.py
parentfcecddd101106826ad916ce91b5dd79ede53cd0b (diff)
downloadtalos-sbe-4b8ed3f80f35d4de9e913f1fee92a0a95e8f8834.tar.gz
talos-sbe-4b8ed3f80f35d4de9e913f1fee92a0a95e8f8834.zip
[Whitelist/Blacklist] - Algorithm implementation
Added data structures for the tables Added framework for Security algorithm implementation Added generated file for the security table Implemented the source code for the algorithm Incremental size with current csv - 1500bytes Change-Id: Ifb9f2ee4a406c61488c0f3ccaab58318126550f1 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41821 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Diffstat (limited to 'src/build/security/securityRegListGen.py')
-rw-r--r--src/build/security/securityRegListGen.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/build/security/securityRegListGen.py b/src/build/security/securityRegListGen.py
index 8006bea0..0b9fc591 100644
--- a/src/build/security/securityRegListGen.py
+++ b/src/build/security/securityRegListGen.py
@@ -101,18 +101,18 @@ namespace """+namespace+"""
{
/*
table 1:
- keys = unique 2byte - formed as (start | end) of
+ keys = 2byte - (start , end) of
the ranges in bit 0-7 of the 32-bit address
values = running count of the paths to table2
for example - if ranges are 0x20-0x37, 0x01-0x01, 0x10-0x17 and has
1, 2 and 3 paths respectively to table 2
- then table 1 will have 0x2037 = 01, 0x0101 = 3, 0x1017 = 7
+ then table 1 will have {0x20,0x37} = 01, {0x01,0x01} = 3, {0x10,0x17} = 7
1 byte for running count - we are good with uint8_t till the
total paths are less than 256
*/
- map_t< range_t<uint16_t, uint8_t>, uint8_t > _t1[] = {
+ map_t< range_t<uint8_t>, uint8_t > _t1[] = {
// length of the table = """+s_list_len(table[0])+"""
"""+s_table1_gen(tablename, table[0])+"""
};
@@ -376,13 +376,13 @@ def get_tables(id, list):
# -----------------------------------------------------------------#
"""
table 1:
- keys = unique 2byte - formed as (start | end) of
+ keys = 2byte - (start , end) of
the ranges in bit 0-7 of the 32-bit address
values = running count of the paths to table2
for example - if ranges are 0x20-0x37, 0x01-0x01, 0x10-0x17 and has
1, 2 and 3 paths respectively to table 2
- then table 1 will have 0x2037 = 01, 0x0101 = 3, 0x1017 = 7
+ then table 1 will have {0x20,0x37} = 01, {0x01,0x01} = 3, {0x10,0x17} = 7
1 byte for running count - we are good with uint8_t till the
total paths are less than 256
@@ -443,7 +443,9 @@ def s_table1_gen(id, table):
# write table 1 string
str_table1 = ""
for i,(key, value) in enumerate(table):
- str_table1 += '{{0x%04x}, 0x%02x}, ' % (key, value)
+ str_table1 += '{{0x%02x, 0x%02x}, 0x%02x}, ' % ((key & 0xFF00 >> 8),
+ (key & 0x00FF),
+ value)
if(0 == ((i+1) % 4)):
str_table1 = str_table1[:-1]
str_table1 += '\n'
OpenPOWER on IntegriCloud