[PATCH 2/3] kexec: Figure out our native architecture before load

Eric W. Biederman ebiederm at xmission.com
Thu Mar 11 03:21:33 EST 2010


This moves the computing of our native archtecture earlier so
that load can use it, as arch/i386/crashdump-x86.c has been
trying to.

Signed-off-by: Eric W. Biederman <ebiederm at aristanetworks.com>
---
 kexec/kexec.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 43d0189..16a0ec9 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -695,17 +695,19 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
 			}
 		}
 	}
+	/* Figure out our native architecture before load */
+	native_arch = physical_arch();
+	if (native_arch < 0) {
+		return -1;
+	}
+	info.kexec_flags |= native_arch;
+
 	if (file_type[i].load(argc, argv, kernel_buf,
 			      kernel_size, &info) < 0) {
 		fprintf(stderr, "Cannot load %s\n", kernel);
 		return -1;
 	}
 	/* If we are not in native mode setup an appropriate trampoline */
-	native_arch = physical_arch();
-	if (native_arch < 0) {
-		return -1;
-	}
-	info.kexec_flags |= native_arch;
 	if (arch_compat_trampoline(&info) < 0) {
 		return -1;
 	}
-- 
1.6.6.1




More information about the kexec mailing list