diff mbox series

[05/16] fast-reboot: don't back up old vectors upon fast reboot

Message ID 20200427110813.1276533-6-npiggin@gmail.com
State Accepted
Headers show
Series assorted fixes and preparation (try again) | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (0f1937ef40fca0c3212a9dff1010b832a24fb063)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Nicholas Piggin April 27, 2020, 11:08 a.m. UTC
Initial boot already saved original exception vectors to old_vectors,
copying again upon fast reboot will overwrite old_vectors with some
arbitrary vectors set up by the current OS.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 core/init.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/core/init.c b/core/init.c
index 595d087fa..2bb48845d 100644
--- a/core/init.c
+++ b/core/init.c
@@ -859,11 +859,6 @@  void copy_sreset_vector_fast_reboot(void)
 
 void copy_exception_vectors(void)
 {
-	/* Backup previous vectors as this could contain a kernel
-	 * image.
-	 */
-	memcpy_null(old_vectors, NULL, EXCEPTION_VECTORS_END);
-
 	/* Copy from 0x100 to EXCEPTION_VECTORS_END, avoid below 0x100 as
 	 * this is the boot flag used by CPUs still potentially entering
 	 * skiboot.
@@ -1021,6 +1016,11 @@  void __noreturn __nomcount main_cpu_entry(const void *fdt)
 	 */
 	clear_console();
 
+	/* Backup previous vectors as this could contain a kernel
+	 * image.
+	 */
+	memcpy_null(old_vectors, NULL, EXCEPTION_VECTORS_END);
+
 	/*
 	 * Some boot firmwares enter OPAL with MSR[ME]=1, as they presumably
 	 * handle machine checks until we take over. As we overwrite the