diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-08-16 15:01:59 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-08-17 13:27:55 +1000 |
commit | 683c50e27319d432176931bebb5aa172606783ac (patch) | |
tree | 9bb875c0a94011915cefac536c086d933c9ac1db | |
parent | 233c68b378342cbf3d26fe72f6fe1e48eb15b122 (diff) | |
download | skiboot-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)); |