From b9e758f0b5bc64b5800432c0a436dd1afc98ba33 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 2 Aug 2019 14:25:26 +0200 Subject: target/arm/cpu64: Ensure kvm really supports aarch64=off If -cpu ,aarch64=off is used then KVM must also be used, and it and the host must support running the vcpu in 32-bit mode. Also, if -cpu ,aarch64=on is used, then it doesn't matter if kvm is enabled or not. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger Signed-off-by: Peter Maydell --- target/arm/kvm64.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'target/arm/kvm64.c') diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 22d19c9aec..3d91846beb 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -24,7 +24,9 @@ #include "exec/gdbstub.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" +#include "sysemu/kvm_int.h" #include "kvm_arm.h" +#include "hw/boards.h" #include "internals.h" static bool have_guest_debug; @@ -593,6 +595,13 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) return true; } +bool kvm_arm_aarch32_supported(CPUState *cpu) +{ + KVMState *s = KVM_STATE(current_machine->accelerator); + + return kvm_check_extension(s, KVM_CAP_ARM_EL1_32BIT); +} + #define ARM_CPU_ID_MPIDR 3, 0, 0, 0, 5 int kvm_arch_init_vcpu(CPUState *cs) -- cgit v1.2.3