@@ -182,7 +182,10 @@ int kvm_arch_init_vcpu(CPUState *cs)
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;
+ init.features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
+ }
+ if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
+ init.features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
}
ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
if (ret) {
@@ -90,7 +90,10 @@ int kvm_arch_init_vcpu(CPUState *cs)
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;
+ init.features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
+ }
+ if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
+ init.features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
}
ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);