mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
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>
This commit is contained in:
parent
99040447ce
commit
228d5e048b
5 changed files with 44 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue