diff options
| author | Stephen Cprek <smcprek@us.ibm.com> | 2017-06-19 16:29:24 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-07-20 15:54:36 -0400 |
| commit | 6744879ceba92b2b2a060cff929bfaaf5d26d762 (patch) | |
| tree | 6d123a4311459fc0aecf3ecd6133d2c1652eec25 /src/include | |
| parent | 0b680113fbc55b91bc7785ef235df32df6103eda (diff) | |
| download | blackbird-hostboot-6744879ceba92b2b2a060cff929bfaaf5d26d762.tar.gz blackbird-hostboot-6744879ceba92b2b2a060cff929bfaaf5d26d762.zip | |
Relocate bl to hb preserved data and page table in VMM
Relocate Page Manager Page Table to 256K alignment after preserved area
Simplify page manager initialize
Change-Id: Ic90584437fa68843a7ebe3818d48c3fe4f5157d8
RTC: 175114
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42154
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@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>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/bootloader/bootloader_data.H | 2 | ||||
| -rw-r--r-- | src/include/bootloader/bootloaderif.H | 12 | ||||
| -rw-r--r-- | src/include/kernel/bltohbdatamgr.H | 16 | ||||
| -rw-r--r-- | src/include/kernel/vmmmgr.H | 29 |
4 files changed, 49 insertions, 10 deletions
diff --git a/src/include/bootloader/bootloader_data.H b/src/include/bootloader/bootloader_data.H index a6f4654e1..289e1c20d 100644 --- a/src/include/bootloader/bootloader_data.H +++ b/src/include/bootloader/bootloader_data.H @@ -91,7 +91,7 @@ namespace Bootloader{ // Object that will be stored where the SBE HB structure indicates BlToHbData blToHbData; uint8_t bl_reserved5[(512 - sizeof(BlToHbData)) % 16]; - static_assert( sizeof(BlToHbData) == 91, "BlToHbData " + static_assert( sizeof(BlToHbData) == 99, "BlToHbData " "size changed. Check bootloader_data.H alignment. " "Fix BlData.pm processing."); } blData_t; diff --git a/src/include/bootloader/bootloaderif.H b/src/include/bootloader/bootloaderif.H index 25b3520e8..fc810dc4b 100644 --- a/src/include/bootloader/bootloaderif.H +++ b/src/include/bootloader/bootloaderif.H @@ -60,8 +60,15 @@ enum BlToHbDataVersion BLTOHB_SAB = 0x0000000900000002, BLTOHB_MMIOBARS = 0x0000000900000003, BLTOHB_SECURE_OVERRIDES = 0x0000000900000004, + BLTOHB_SIZE = 0x0000000900000005, }; +enum +{ + // Arbitrary size larger than the current structure size 8 byte aligned. + // This will only be used when there is a BL/HB mismatch + INITIAL_BLTOHB_PADDED_SIZE = 256 +}; /** @struct BlToHbData * @brief Shared data between bootloader and Hostboot. @@ -81,7 +88,8 @@ struct BlToHbData hbbHeaderSize(0), secureAccessBit(0), xscomBAR(MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR), lpcBAR(MMIO_GROUP0_CHIP0_LPC_BASE_ADDR), - securityOverride(0), allowAttrOverrides(0) {} + securityOverride(0), allowAttrOverrides(0), + sizeOfStructure(0) {} // Simple way to tell if data is valid uint64_t eyeCatch; @@ -111,6 +119,8 @@ struct BlToHbData bool securityOverride; // Secure Setting - Allow Attribute Overrides in Securemode bool allowAttrOverrides; + // Size of this structure (Use for backwards compatibility) + size_t sizeOfStructure; } __attribute__((packed)); /** diff --git a/src/include/kernel/bltohbdatamgr.H b/src/include/kernel/bltohbdatamgr.H index 3e701b01b..6b6f8b831 100644 --- a/src/include/kernel/bltohbdatamgr.H +++ b/src/include/kernel/bltohbdatamgr.H @@ -93,6 +93,15 @@ class BlToHbDataManager */ void initInvalid(); + /** + * @brief Relocates preserved data to a location in cache that will not + * be flushed + * NOTE: Asserts that it's only called during initialization + * + * @return N/A + */ + void relocatePreservedArea(); + /* * @brief Returns internal branchtable offset * @@ -191,6 +200,13 @@ class BlToHbDataManager * @return size_t XSCP< BAR */ const uint64_t getXscomBAR() const; + + /* + * @brief Returns internal BlToHbData size + * + * @return size_t BlToHbData size + */ + const size_t getBlToHbDataSize() const; }; // Extern global instance of the class diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H index 9c437fe23..5cc370e69 100644 --- a/src/include/kernel/vmmmgr.H +++ b/src/include/kernel/vmmmgr.H @@ -45,21 +45,14 @@ class VmmManager INITIAL_MEM_SIZE = 4*MEGABYTE, // Place the page table at the top side of the cache, 256k in size. - INITIAL_PT_OFFSET = INITIAL_MEM_SIZE - 1*MEGABYTE, PTSIZE = 256*KILOBYTE, + PT_ALIGNMENT = 256*KILOBYTE, // Put the DMA Pages just after the Page Table MBOX_DMA_PAGES = 64, // must be <= 64 MBOX_DMA_PAGESIZE = (1 * KILOBYTE), MBOX_DMA_SIZE = MBOX_DMA_PAGES * MBOX_DMA_PAGESIZE, - /** We need to reserve a hole in heap memory for the page table, - * etc. Use these constants to define the hole. */ - FIRST_RESERVED_PAGE = INITIAL_PT_OFFSET, - END_RESERVED_PAGE = INITIAL_PT_OFFSET + PTSIZE, - - BLTOHB_DATA_START = END_RESERVED_PAGE, - // Tells processor to ignore HRMOR FORCE_PHYS_ADDR = 0x8000000000000000, }; @@ -220,6 +213,20 @@ class VmmManager */ static uint64_t pageTableOffset(); + /** @fn BlToHbPreserveDataOffset() + * @brief Gets starting address of BltoHB preserved data area + * + * @return uint64_t - starting address of VMM area + */ + static uint64_t BlToHbPreserveDataOffset(); + + /** @fn endPreservedOffset() + * @brief Gets ending address of preserved data area + * + * @return uint64_t - ending address of VMM preserved area + */ + static uint64_t endPreservedOffset(); + protected: VmmManager(); ~VmmManager() {}; @@ -282,6 +289,12 @@ class VmmManager /** See pageTableOffset */ uint64_t _pageTableOffset() const; + /** See BlToHbPreserveDataOffset */ + uint64_t _BlToHbPreserveDataOffset() const; + + /** See endPreservedOffset */ + uint64_t _endPreservedOffset() const; + public: friend class Block; friend class StackSegment; |

