aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-08-16 15:01:59 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-17 13:27:55 +1000
commit683c50e27319d432176931bebb5aa172606783ac (patch)
tree9bb875c0a94011915cefac536c086d933c9ac1db
parent233c68b378342cbf3d26fe72f6fe1e48eb15b122 (diff)
downloadskiboot-683c50e27319d432176931bebb5aa172606783ac.zip
skiboot-683c50e27319d432176931bebb5aa172606783ac.tar.gz
skiboot-683c50e27319d432176931bebb5aa172606783ac.tar.bz2
Adjust top_of_ram when we know cpu_max_pir for the processor generation
This allows opal_addr_valid to perform the < top_of_mem check and pass for early xscom_reads that read into cpu stack. Arguably the more correct solution is to split opal_xscom_read from xscom_read and only validate for the OPAL call. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/cpu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/cpu.c b/core/cpu.c
index a94c17a..78331cc 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -510,6 +510,13 @@ void init_boot_cpu(void)
pir, pvr);
prlog(PR_DEBUG, "CPU: Initial max PIR set to 0x%x\n", cpu_max_pir);
+ /*
+ * Adjust top of RAM to include CPU stacks. While we *could* have
+ * less RAM than this... during early boot, it's enough of a check
+ * until we start parsing device tree / hdat and find out for sure
+ */
+ top_of_ram += (cpu_max_pir + 1) * STACK_SIZE;
+
/* Clear the CPU structs */
for (i = 0; i <= cpu_max_pir; i++)
memset(&cpu_stacks[i].cpu, 0, sizeof(struct cpu_thread));