aboutsummaryrefslogtreecommitdiff
path: root/target-arm/kvm.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-11-22 17:17:16 +0000
committerPeter Maydell <peter.maydell@linaro.org>2013-12-10 13:28:49 +0000
commit3541addc888413b84fb309e3f4abf210c0c5eb57 (patch)
tree0ae1485418dab6bac1727eb121d2cecc01e74b94 /target-arm/kvm.c
parentf5fdcd6e58ec35b4463569694fc15d28c505c4d0 (diff)
target-arm: Don't hardcode KVM target CPU to be A15
Instead of assuming that a KVM target CPU must always be a Cortex-A15 and hardcoding this in kvm_arch_init_vcpu(), store the KVM_ARM_TARGET_* value in the ARMCPU class, and use that. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Message-id: 1385140638-10444-10-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'target-arm/kvm.c')
-rw-r--r--target-arm/kvm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index 80c58c5ab1..182db85fdd 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -77,7 +77,12 @@ int kvm_arch_init_vcpu(CPUState *cs)
struct kvm_reg_list *rlp;
ARMCPU *cpu = ARM_CPU(cs);
- init.target = KVM_ARM_TARGET_CORTEX_A15;
+ if (cpu->kvm_target == QEMU_KVM_ARM_TARGET_NONE) {
+ fprintf(stderr, "KVM is not supported for this guest CPU type\n");
+ return -EINVAL;
+ }
+
+ init.target = cpu->kvm_target;
memset(init.features, 0, sizeof(init.features));
if (cpu->start_powered_off) {
init.features[0] = 1 << KVM_ARM_VCPU_POWER_OFF;