summaryrefslogtreecommitdiffstats
path: root/src/kernel/basesegment.C
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2016-03-28 16:47:46 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-03-28 19:20:28 -0400
commit69e38bee22624eaaddbb8f812a96ff29f4efee49 (patch)
tree6b2b90ca0c3f46b4aed29364b2ce9a839d499181 /src/kernel/basesegment.C
parente3d766322fb0715c0def3ca6dd850deccbd9fbbc (diff)
downloadtalos-hostboot-69e38bee22624eaaddbb8f812a96ff29f4efee49.tar.gz
talos-hostboot-69e38bee22624eaaddbb8f812a96ff29f4efee49.zip
Fix rounding error in memory allocation code
A rounding error exposed by a new compiler caused us to write over the SPTE entries for the extended memory block. This led to unhandled page faults due to invalid permissions on the affected pages. Change-Id: I53656103252180d37a4291176d45f2cb3f63421d Backport: yes Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22560 Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/kernel/basesegment.C')
-rw-r--r--src/kernel/basesegment.C7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/basesegment.C b/src/kernel/basesegment.C
index ea5846a46..90d61f1b2 100644
--- a/src/kernel/basesegment.C
+++ b/src/kernel/basesegment.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -267,8 +267,9 @@ int BaseSegment::_mmExtend(void)
// Now need to take the pages past the SPTE and add them to the heap.
//get the number of pages needed to hold the SPTE entries.
- uint64_t spte_pages = (ALIGN_PAGE(l_size)/PAGESIZE *
- sizeof(ShadowPTE))/PAGESIZE;
+ uint64_t spte_pages = (ALIGN_PAGE
+ (ALIGN_PAGE(l_size)/PAGESIZE*sizeof(ShadowPTE)))
+ /PAGESIZE;
printkd("Number of SPTE pages %ld\n", spte_pages);
OpenPOWER on IntegriCloud