Skip to content

Commit

Permalink
core/init: Don't checksum MPIPL data areas
Browse files Browse the repository at this point in the history
Right now the romem checksum runs from _start until the start of our
data area. This spans the area used for the MPIPL data structures since
they're included in the SPIRA-H data area.

Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
oohal committed Oct 13, 2019
1 parent 1785745 commit a4e0f63
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/init.c
Expand Up @@ -927,8 +927,12 @@ static void checksum_romem(void)
if (chip_quirk(QUIRK_SLOW_SIM))
return;

csum = mem_csum(_start, _romem_end);
csum = mem_csum(_start, _head_end);
romem_csum ^= csum;

csum = mem_csum(_stext, _romem_end);
romem_csum ^= csum;

csum = mem_csum(__builtin_kernel_start, __builtin_kernel_end);
romem_csum ^= csum;
}
Expand Down
1 change: 1 addition & 0 deletions include/skiboot.h
Expand Up @@ -37,6 +37,7 @@ extern struct mem_region *mem_region_next(struct mem_region *region);

/* Misc linker script symbols */
extern char _start[];
extern char _head_end[];
extern char _stext[];
extern char _etext[];
extern char __sym_map_end[];
Expand Down
9 changes: 9 additions & 0 deletions skiboot.lds.S
Expand Up @@ -69,6 +69,13 @@ SECTIONS
KEEP(*(.spirah.data))
}

_head_end = .;

/*
* The following sections are read-write at runtime. We need
* to skip over them when checksumming the skiboot images
* before a fast-reboot.
*/
. = PROC_DUMP_AREA_OFF;
.procdump : {
KEEP(*(.procdump.data))
Expand All @@ -94,6 +101,8 @@ SECTIONS
KEEP(*(.cpuctrl.data))
}

/* ...and back to RO */

. = ALIGN(0x10);
_stext = .;
.text : {
Expand Down

0 comments on commit a4e0f63

Please sign in to comment.