Skip to content

Commit

Permalink
init: add missing sync_icache after exception vector patching
Browse files Browse the repository at this point in the history
There are two cases where sync_icache is not called immediately
after instructions are modified.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
npiggin authored and stewartsmith committed Sep 5, 2017
1 parent d2a2440 commit 7b7428f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ static bool load_kernel(void)
if (kernel_entry < 0x2000) {
cpu_set_pm_enable(false);
memcpy(NULL, old_vectors, 0x2000);
sync_icache();
}
do_stb = true;
stb_container = kh; /* probably incorrect */
Expand Down Expand Up @@ -723,6 +724,7 @@ void setup_reset_vector(void)
dst = (uint32_t *)0x100;
while(src < &reset_patch_end)
*(dst++) = *(src++);
sync_icache();
}

void copy_exception_vectors(void)
Expand Down

0 comments on commit 7b7428f

Please sign in to comment.