diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2015-03-02 18:04:05 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-04-09 21:59:24 -0500 |
commit | 343014b3095462dbec20efe456cbb945d4844b4e (patch) | |
tree | e7a4f1b0b522e63ba0c0baea82a6add01b09772c /src/include/sys | |
parent | 77f3ab96fd87a9bbecb19aba9f3b48cfb09983bd (diff) | |
download | talos-hostboot-343014b3095462dbec20efe456cbb945d4844b4e.tar.gz talos-hostboot-343014b3095462dbec20efe456cbb945d4844b4e.zip |
Prevent out-of-order data access to FSP mailbox memory area
- Added system call to map FSP mailbox memory with guard permission
- Call new mapping in DMA area init
- Propagate guard permission down to MMIO map
- Apply guard permission in page fault handler
- Updated debug tools to support extra bit in MMIO struct
Change-Id: I8335ac7d3ef57e46d4c8b6c2b2a42b8a0bf7c4b0
Backport: release-fips830
Backport: release-fips820
CQ: SW295345
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16307
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/sys')
-rw-r--r-- | src/include/sys/mm.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/include/sys/mm.h b/src/include/sys/mm.h index 8394439d9..d0db803cc 100644 --- a/src/include/sys/mm.h +++ b/src/include/sys/mm.h @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,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. */ @@ -59,6 +61,7 @@ enum PAGE_PERMISSIONS NO_ALLOCATE_FROM_ZERO = 0x00000020, NO_ACCESS = 0x00000040, BYPASS_HRMOR = 0x00000080, + GUARDED = 0x00000100, }; @@ -132,6 +135,18 @@ int mm_linear_map(void *i_paddr, uint64_t i_size); */ void* mm_block_map(void* i_paddr, uint64_t i_size); +/** @fn mm_guarded_block_map() + * @brief Allocate an arbitrary physical address into the VMM with guarded + * permissions to prevent out-of-order access to instructions and data. + * @note Use mm_block_unmap to unmap a region mapped using + * mm_guarded_block_map. + * @param[in] i_paddr - Physical address of the memory to map. + * @param[in] i_size - Size of memory to map (in bytes). + * + * @return Virtual address or NULL. + */ +void* mm_guarded_block_map(void* i_paddr, uint64_t i_size); + /** @fn mm_block_unmap() * @brief Unallocate a block previously allocated with mm_block_map. * @param[in] i_vaddr - Virtual address of the mapped block. |