[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/10] mips_malta: Catch kernels linked at wrong addr
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/10] mips_malta: Catch kernels linked at wrong address |
Date: |
Thu, 10 Jul 2014 18:04:07 +0200 |
From: James Hogan <address@hidden>
Add error reporting if the wrong type of kernel is provided for the
current mode of acceleration.
Currently a KVM kernel linked at 0x40000000 can't be used with TCG, and
a normal kernel linked at 0x80000000 can't be used with KVM.
Cc: Aurelien Jarno <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: James Hogan <address@hidden>
Reviewed-by: Aurelien Jarno <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/mips/mips_malta.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 3305a25..cfb60af 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -792,9 +792,23 @@ static int64_t load_kernel (void)
loaderparams.kernel_filename);
exit(1);
}
+
+ /* Sanity check where the kernel has been linked */
if (kvm_enabled()) {
+ if (kernel_entry & 0x80000000ll) {
+ error_report("KVM guest kernels must be linked in useg. "
+ "Did you forget to enable CONFIG_KVM_GUEST?");
+ exit(1);
+ }
+
xlate_to_kseg0 = cpu_mips_kvm_um_phys_to_kseg0;
} else {
+ if (!(kernel_entry & 0x80000000ll)) {
+ error_report("KVM guest kernels aren't supported with TCG. "
+ "Did you unintentionally enable CONFIG_KVM_GUEST?");
+ exit(1);
+ }
+
xlate_to_kseg0 = cpu_mips_phys_to_kseg0;
}
--
1.8.3.1
- [Qemu-devel] [PULL v3 00/10] KVM changes (+ misc small fixes) for 2.1, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 02/10] mips/kvm: Disable FPU on reset with KVM, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 01/10] mips/kvm: Init EBase to correct KSEG0, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 03/10] mips_malta: Remove incorrect KVM T&E references, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 04/10] mips_malta: Catch kernels linked at wrong address,
Paolo Bonzini <=
- [Qemu-devel] [PULL 06/10] Enforce stack protector usage, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 08/10] oslib-posix: Fix new compiler error with -Wclobbered, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 05/10] watchdog: fix deadlock with -watchdog-action pause, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 09/10] mc146818rtc: register the clock reset notifier on the right clock, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 07/10] target-i386: Add "kvmclock-stable-bit" feature bit name, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 10/10] qtest: fix vhost-user-test compilation with old GLib, Paolo Bonzini, 2014/07/10
- Re: [Qemu-devel] [PULL v3 00/10] KVM changes (+ misc small fixes) for 2.1, Peter Maydell, 2014/07/11