aboutsummaryrefslogtreecommitdiff
path: root/target-arm/kvm32.c
diff options
context:
space:
mode:
authorPranavkumar Sawargaonkar <pranavkumar@linaro.org>2014-06-19 18:06:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-19 18:33:02 +0100
commit228d5e048b68672593d93f1e42d777de80903e3d (patch)
treec8d21395ae303a08480cf6dd27f5a8e5f026cc44 /target-arm/kvm32.c
parent99040447cee777498c1b2125f16402b8af88355c (diff)
downloadqemu-228d5e048b68672593d93f1e42d777de80903e3d.zip
qemu-228d5e048b68672593d93f1e42d777de80903e3d.tar.gz
qemu-228d5e048b68672593d93f1e42d777de80903e3d.tar.bz2
target-arm: Common kvm_arm_vcpu_init() for KVM ARM and KVM ARM64
Introduce a common kvm_arm_vcpu_init() for doing KVM_ARM_VCPU_INIT ioctl in KVM ARM and KVM ARM64. This also helps us factor-out few common code lines from kvm_arch_init_vcpu() for KVM ARM/ARM64. Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org> Signed-off-by: Anup Patel <anup.patel@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1402901605-24551-5-git-send-email-pranavkumar@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/kvm32.c')
-rw-r--r--target-arm/kvm32.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/target-arm/kvm32.c b/target-arm/kvm32.c
index b79750c..b142e90 100644
--- a/target-arm/kvm32.c
+++ b/target-arm/kvm32.c
@@ -166,7 +166,6 @@ static int compare_u64(const void *a, const void *b)
int kvm_arch_init_vcpu(CPUState *cs)
{
- struct kvm_vcpu_init init;
int i, ret, arraylen;
uint64_t v;
struct kvm_one_reg r;
@@ -179,15 +178,18 @@ int kvm_arch_init_vcpu(CPUState *cs)
return -EINVAL;
}
- init.target = cpu->kvm_target;
- memset(init.features, 0, sizeof(init.features));
+ /* Determine init features for this CPU */
+ memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features));
if (cpu->start_powered_off) {
- init.features[0] = 1 << KVM_ARM_VCPU_POWER_OFF;
+ cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
}
- ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
+
+ /* Do KVM_ARM_VCPU_INIT ioctl */
+ ret = kvm_arm_vcpu_init(cs);
if (ret) {
return ret;
}
+
/* Query the kernel to make sure it supports 32 VFP
* registers: QEMU's "cortex-a15" CPU is always a
* VFP-D32 core. The simplest way to do this is just