summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-10-11 11:56:19 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-10-19 22:17:12 -0400
commit20250c0b1f6de53b2bfddd1c714fb8c97e655ce2 (patch)
tree3d67d0922a68c11bc71218880844233604ebf50d
parent281503375a8c02c78b8fa188c58c6207affe3713 (diff)
downloadtalos-hostboot-20250c0b1f6de53b2bfddd1c714fb8c97e655ce2.tar.gz
talos-hostboot-20250c0b1f6de53b2bfddd1c714fb8c97e655ce2.zip
Ensure AbaPtr is not used in runtime code
The AbaPtr makes assumptions that we have pointer values that are only 32-bits long. In our runtime (HBRT) environment that assumption is not true so we need to make sure none of the code that runs there is trying to use the AbaPtr code. Change-Id: I0a26558f305fada723bf3cb3447a2bdfddb194d0 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48248 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@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>
-rw-r--r--src/include/kernel/heapmgr.H10
-rw-r--r--src/include/sys/time.h5
-rw-r--r--src/include/usr/errl/errlmanager.H1
-rw-r--r--src/include/util/lockfree/abaptr.H8
-rw-r--r--src/usr/errl/errlmanager.C1
-rw-r--r--src/usr/errl/errlprvt.C6
-rw-r--r--src/usr/htmgt/htmgt_occ.C1
-rw-r--r--src/usr/htmgt/htmgt_occcmd.C1
-rw-r--r--src/usr/ibscom/ibscom.C3
-rw-r--r--src/usr/isteps/istep06/thread_activate/thread_activate.C1
-rw-r--r--src/usr/isteps/istep16/call_host_activate_master.C2
-rw-r--r--src/usr/pnor/pnorrp.C1
-rw-r--r--src/usr/trace/daemon/daemon.C3
-rw-r--r--src/usr/util/utiltcemgr.C1
14 files changed, 36 insertions, 8 deletions
diff --git a/src/include/kernel/heapmgr.H b/src/include/kernel/heapmgr.H
index bf4fe1cc7..9f1d0a7ed 100644
--- a/src/include/kernel/heapmgr.H
+++ b/src/include/kernel/heapmgr.H
@@ -26,10 +26,13 @@
#define __KERNEL_HEAPMGR_H
#include <stdint.h>
-#include <util/lockfree/stack.H>
#include <builtins.h>
#include <kernel/types.h>
+#ifndef __HOSTBOOT_RUNTIME
+#include <util/lockfree/stack.H>
+#endif
+
extern "C"
void kernel_execute_decrementer();
@@ -81,6 +84,8 @@ class HeapManager
};
+// we only want the constants in HBRT
+#ifndef __HOSTBOOT_RUNTIME
friend class CpuManager;
friend void kernel_execute_decrementer();
@@ -231,5 +236,8 @@ class HeapManager
static uint32_t cv_smallheap_page_count; //!< # of pages being used
static uint32_t cv_largeheap_page_count; //!< # of pages being used
static uint32_t cv_largeheap_page_max; //!< Max # of pages used
+
+#endif //__HOSTBOOT_RUNTIME
+
};
#endif
diff --git a/src/include/sys/time.h b/src/include/sys/time.h
index 1a0a02ec4..85601bc63 100644
--- a/src/include/sys/time.h
+++ b/src/include/sys/time.h
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -26,7 +26,10 @@
#define __SYS_TIME_H
#include <stdint.h>
+
+#ifndef __HOSTBOOT_RUNTIME
#include <kernel/timemgr.H>
+#endif
//******************************************************************************
// Macros
diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H
index 9f2292515..174b55725 100644
--- a/src/include/usr/errl/errlmanager.H
+++ b/src/include/usr/errl/errlmanager.H
@@ -40,7 +40,6 @@
#include <errl/errlentry.H>
#include <errldisplay/errldisplay.H>
#include <sys/sync.h>
-#include <kernel/timemgr.H>
#include <hbotcompid.H>
#include <hwas/common/hwasCallout.H>
#include <mbox/mbox_queues.H>
diff --git a/src/include/util/lockfree/abaptr.H b/src/include/util/lockfree/abaptr.H
index ed13f83ca..5ea5868ff 100644
--- a/src/include/util/lockfree/abaptr.H
+++ b/src/include/util/lockfree/abaptr.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -25,6 +25,12 @@
#ifndef __UTIL_LOCKFREE_ABAPTR_H
#define __UTIL_LOCKFREE_ABAPTR_H
+// This code makes assumptions on pointer sizes that are not valid within
+// our runtime environment, therefore it cannot ever be used there.
+#ifdef __HOSTBOOT_RUNTIME
+#error "AbaPtr is not allowed in HBRT"
+#endif
+
#include <stdint.h>
#include <assert.h>
diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C
index 17cc11dd6..2f465a049 100644
--- a/src/usr/errl/errlmanager.C
+++ b/src/usr/errl/errlmanager.C
@@ -39,6 +39,7 @@
#include <errl/errlentry.H>
#include <initservice/taskargs.H>
#include <sys/task.h>
+#include <arch/ppc.H>
#include <stdlib.h>
#include <string.h>
#include <mbox/mbox_queues.H>
diff --git a/src/usr/errl/errlprvt.C b/src/usr/errl/errlprvt.C
index bf4ab0d33..7ae87b645 100644
--- a/src/usr/errl/errlprvt.C
+++ b/src/usr/errl/errlprvt.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
+/* [+] 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. */
@@ -35,7 +37,7 @@
#include <hbotcompid.H>
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
-
+#include <arch/ppc.H>
diff --git a/src/usr/htmgt/htmgt_occ.C b/src/usr/htmgt/htmgt_occ.C
index 760799e50..f7ae48a78 100644
--- a/src/usr/htmgt/htmgt_occ.C
+++ b/src/usr/htmgt/htmgt_occ.C
@@ -37,6 +37,7 @@
#include <targeting/common/targetservice.H>
#include <console/consoleif.H>
#include <sys/time.h>
+#include <arch/ppc.H>
#include <isteps/pm/occAccess.H>
#include <errl/errludlogregister.H>
#include <fapi2.H>
diff --git a/src/usr/htmgt/htmgt_occcmd.C b/src/usr/htmgt/htmgt_occcmd.C
index 15e4dbe49..05b5b1657 100644
--- a/src/usr/htmgt/htmgt_occcmd.C
+++ b/src/usr/htmgt/htmgt_occcmd.C
@@ -39,6 +39,7 @@
#include <isteps/pm/occAccess.H>
#include <sys/time.h>
+#include <arch/ppc.H>
#include <trace/interface.H>
#include <errl/errlmanager.H>
#include <stdio.h>
diff --git a/src/usr/ibscom/ibscom.C b/src/usr/ibscom/ibscom.C
index 27ad8503c..9a8091ba4 100644
--- a/src/usr/ibscom/ibscom.C
+++ b/src/usr/ibscom/ibscom.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -30,6 +30,7 @@
#include <sys/task.h>
#include <sys/sync.h>
#include <sys/misc.h>
+#include <arch/ppc.H>
#include <string.h>
#include <devicefw/driverif.H>
#include <trace/interface.H>
diff --git a/src/usr/isteps/istep06/thread_activate/thread_activate.C b/src/usr/isteps/istep06/thread_activate/thread_activate.C
index 606249534..ad481dd16 100644
--- a/src/usr/isteps/istep06/thread_activate/thread_activate.C
+++ b/src/usr/isteps/istep06/thread_activate/thread_activate.C
@@ -46,6 +46,7 @@
#include <p9_thread_control.H>
#include <arch/pirformat.H>
#include <arch/pvrformat.H>
+#include <arch/ppc.H>
// targeting support
#include <targeting/common/target.H>
diff --git a/src/usr/isteps/istep16/call_host_activate_master.C b/src/usr/isteps/istep16/call_host_activate_master.C
index 40e0d0538..d5be9070b 100644
--- a/src/usr/isteps/istep16/call_host_activate_master.C
+++ b/src/usr/isteps/istep16/call_host_activate_master.C
@@ -37,6 +37,8 @@
#include <arch/pvrformat.H>
#include <sys/task.h>
#include <sys/mmio.h>
+#include <arch/ppc.H>
+
// targeting support
#include <targeting/namedtarget.H>
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C
index 162881830..5a79879e2 100644
--- a/src/usr/pnor/pnorrp.C
+++ b/src/usr/pnor/pnorrp.C
@@ -28,6 +28,7 @@
#include <pnor/pnor_reasoncodes.H>
#include <initservice/taskargs.H>
#include <sys/msg.h>
+#include <arch/ppc.H>
#include <trace/interface.H>
#include <errl/errlmanager.H>
#include <targeting/common/targetservice.H>
diff --git a/src/usr/trace/daemon/daemon.C b/src/usr/trace/daemon/daemon.C
index 44515dc52..a7e895b0a 100644
--- a/src/usr/trace/daemon/daemon.C
+++ b/src/usr/trace/daemon/daemon.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -40,6 +40,7 @@
#include <sys/msg.h>
#include <sys/task.h>
#include <kernel/console.H>
+#include <arch/ppc.H>
#include <util/align.H>
#include <targeting/common/commontargeting.H>
diff --git a/src/usr/util/utiltcemgr.C b/src/usr/util/utiltcemgr.C
index eb2ee395b..c1a030b65 100644
--- a/src/usr/util/utiltcemgr.C
+++ b/src/usr/util/utiltcemgr.C
@@ -32,6 +32,7 @@
#include <util/align.H>
#include <sys/mmio.h>
#include <sys/mm.h>
+#include <arch/ppc.H>
#include <errno.h>
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
OpenPOWER on IntegriCloud