target/arm/kvm: Init cap_has_inject_serror_esr in kvm_arch_init
There is no need to do this in kvm_arch_init_vcpu per vcpu. Inline kvm_arm_init_serror_injection rather than keep separate. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
09ddc01216
commit
51641de468
@ -98,12 +98,6 @@ static int kvm_arm_vcpu_finalize(CPUState *cs, int feature)
|
|||||||
return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_FINALIZE, &feature);
|
return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_FINALIZE, &feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
void kvm_arm_init_serror_injection(CPUState *cs)
|
|
||||||
{
|
|
||||||
cap_has_inject_serror_esr = kvm_check_extension(cs->kvm_state,
|
|
||||||
KVM_CAP_ARM_INJECT_SERROR_ESR);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool kvm_arm_create_scratch_host_vcpu(const uint32_t *cpus_to_try,
|
bool kvm_arm_create_scratch_host_vcpu(const uint32_t *cpus_to_try,
|
||||||
int *fdarray,
|
int *fdarray,
|
||||||
struct kvm_vcpu_init *init)
|
struct kvm_vcpu_init *init)
|
||||||
@ -564,6 +558,10 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
|
|||||||
|
|
||||||
cap_has_mp_state = kvm_check_extension(s, KVM_CAP_MP_STATE);
|
cap_has_mp_state = kvm_check_extension(s, KVM_CAP_MP_STATE);
|
||||||
|
|
||||||
|
/* Check whether user space can specify guest syndrome value */
|
||||||
|
cap_has_inject_serror_esr =
|
||||||
|
kvm_check_extension(s, KVM_CAP_ARM_INJECT_SERROR_ESR);
|
||||||
|
|
||||||
if (ms->smp.cpus > 256 &&
|
if (ms->smp.cpus > 256 &&
|
||||||
!kvm_check_extension(s, KVM_CAP_ARM_IRQ_LINE_LAYOUT_2)) {
|
!kvm_check_extension(s, KVM_CAP_ARM_IRQ_LINE_LAYOUT_2)) {
|
||||||
error_report("Using more than 256 vcpus requires a host kernel "
|
error_report("Using more than 256 vcpus requires a host kernel "
|
||||||
@ -1946,9 +1944,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
|
|||||||
}
|
}
|
||||||
cpu->mp_affinity = mpidr & ARM64_AFFINITY_MASK;
|
cpu->mp_affinity = mpidr & ARM64_AFFINITY_MASK;
|
||||||
|
|
||||||
/* Check whether user space can specify guest syndrome value */
|
|
||||||
kvm_arm_init_serror_injection(cs);
|
|
||||||
|
|
||||||
return kvm_arm_init_cpreg_list(cpu);
|
return kvm_arm_init_cpreg_list(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,14 +98,6 @@ void kvm_arm_cpu_post_load(ARMCPU *cpu);
|
|||||||
*/
|
*/
|
||||||
void kvm_arm_reset_vcpu(ARMCPU *cpu);
|
void kvm_arm_reset_vcpu(ARMCPU *cpu);
|
||||||
|
|
||||||
/**
|
|
||||||
* kvm_arm_init_serror_injection:
|
|
||||||
* @cs: CPUState
|
|
||||||
*
|
|
||||||
* Check whether KVM can set guest SError syndrome.
|
|
||||||
*/
|
|
||||||
void kvm_arm_init_serror_injection(CPUState *cs);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* kvm_get_vcpu_events:
|
* kvm_get_vcpu_events:
|
||||||
* @cpu: ARMCPU
|
* @cpu: ARMCPU
|
||||||
|
Loading…
Reference in New Issue
Block a user