mirror of
https://github.com/qemu/qemu.git
synced 2025-08-08 08:05:17 +00:00
target/arm: Remove no-longer-reachable 32-bit KVM code
Now that 32-bit KVM host support is gone, KVM can never be enabled unless CONFIG_AARCH64 is true, and some code paths are no longer reachable and can be deleted. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200904154156.31943-3-peter.maydell@linaro.org
This commit is contained in:
parent
82bf7ae84c
commit
e9b2bfaa64
@ -2098,25 +2098,23 @@ static void cortex_a15_initfn(Object *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TARGET_AARCH64
|
#ifndef TARGET_AARCH64
|
||||||
/* -cpu max: if KVM is enabled, like -cpu host (best possible with this host);
|
/*
|
||||||
* otherwise, a CPU with as many features enabled as our emulation supports.
|
* -cpu max: a CPU with as many features enabled as our emulation supports.
|
||||||
* The version of '-cpu max' for qemu-system-aarch64 is defined in cpu64.c;
|
* The version of '-cpu max' for qemu-system-aarch64 is defined in cpu64.c;
|
||||||
* this only needs to handle 32 bits.
|
* this only needs to handle 32 bits, and need not care about KVM.
|
||||||
*/
|
*/
|
||||||
static void arm_max_initfn(Object *obj)
|
static void arm_max_initfn(Object *obj)
|
||||||
{
|
{
|
||||||
ARMCPU *cpu = ARM_CPU(obj);
|
ARMCPU *cpu = ARM_CPU(obj);
|
||||||
|
|
||||||
if (kvm_enabled()) {
|
|
||||||
kvm_arm_set_cpu_features_from_host(cpu);
|
|
||||||
} else {
|
|
||||||
cortex_a15_initfn(obj);
|
cortex_a15_initfn(obj);
|
||||||
|
|
||||||
/* old-style VFP short-vector support */
|
/* old-style VFP short-vector support */
|
||||||
cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
|
cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifdef CONFIG_USER_ONLY
|
||||||
/* We don't set these in system emulation mode for the moment,
|
/*
|
||||||
|
* We don't set these in system emulation mode for the moment,
|
||||||
* since we don't correctly set (all of) the ID registers to
|
* since we don't correctly set (all of) the ID registers to
|
||||||
* advertise them.
|
* advertise them.
|
||||||
*/
|
*/
|
||||||
@ -2164,7 +2162,6 @@ static void arm_max_initfn(Object *obj)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) */
|
#endif /* !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) */
|
||||||
@ -2267,11 +2264,7 @@ static void arm_host_initfn(Object *obj)
|
|||||||
|
|
||||||
static const TypeInfo host_arm_cpu_type_info = {
|
static const TypeInfo host_arm_cpu_type_info = {
|
||||||
.name = TYPE_ARM_HOST_CPU,
|
.name = TYPE_ARM_HOST_CPU,
|
||||||
#ifdef TARGET_AARCH64
|
|
||||||
.parent = TYPE_AARCH64_CPU,
|
.parent = TYPE_AARCH64_CPU,
|
||||||
#else
|
|
||||||
.parent = TYPE_ARM_CPU,
|
|
||||||
#endif
|
|
||||||
.instance_init = arm_host_initfn,
|
.instance_init = arm_host_initfn,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -136,16 +136,11 @@ MISMATCH_CHECK(QEMU_PSCI_RET_DISABLED, PSCI_RET_DISABLED);
|
|||||||
*/
|
*/
|
||||||
#define QEMU_KVM_ARM_TARGET_NONE UINT_MAX
|
#define QEMU_KVM_ARM_TARGET_NONE UINT_MAX
|
||||||
|
|
||||||
#ifdef TARGET_AARCH64
|
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_AEM_V8, KVM_ARM_TARGET_AEM_V8);
|
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_AEM_V8, KVM_ARM_TARGET_AEM_V8);
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_FOUNDATION_V8, KVM_ARM_TARGET_FOUNDATION_V8);
|
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_FOUNDATION_V8, KVM_ARM_TARGET_FOUNDATION_V8);
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A57, KVM_ARM_TARGET_CORTEX_A57);
|
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A57, KVM_ARM_TARGET_CORTEX_A57);
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_XGENE_POTENZA, KVM_ARM_TARGET_XGENE_POTENZA);
|
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_XGENE_POTENZA, KVM_ARM_TARGET_XGENE_POTENZA);
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A53, KVM_ARM_TARGET_CORTEX_A53);
|
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A53, KVM_ARM_TARGET_CORTEX_A53);
|
||||||
#else
|
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A15, KVM_ARM_TARGET_CORTEX_A15);
|
|
||||||
MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A7, KVM_ARM_TARGET_CORTEX_A7);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CP_REG_ARM64 0x6000000000000000ULL
|
#define CP_REG_ARM64 0x6000000000000000ULL
|
||||||
#define CP_REG_ARM_COPROC_MASK 0x000000000FFF0000
|
#define CP_REG_ARM_COPROC_MASK 0x000000000FFF0000
|
||||||
@ -165,7 +160,6 @@ MISMATCH_CHECK(QEMU_KVM_ARM_TARGET_CORTEX_A7, KVM_ARM_TARGET_CORTEX_A7);
|
|||||||
/* No kernel define but it's useful to QEMU */
|
/* No kernel define but it's useful to QEMU */
|
||||||
#define CP_REG_ARM64_SYSREG_CP (CP_REG_ARM64_SYSREG >> CP_REG_ARM_COPROC_SHIFT)
|
#define CP_REG_ARM64_SYSREG_CP (CP_REG_ARM64_SYSREG >> CP_REG_ARM_COPROC_SHIFT)
|
||||||
|
|
||||||
#ifdef TARGET_AARCH64
|
|
||||||
MISMATCH_CHECK(CP_REG_ARM64, KVM_REG_ARM64);
|
MISMATCH_CHECK(CP_REG_ARM64, KVM_REG_ARM64);
|
||||||
MISMATCH_CHECK(CP_REG_ARM_COPROC_MASK, KVM_REG_ARM_COPROC_MASK);
|
MISMATCH_CHECK(CP_REG_ARM_COPROC_MASK, KVM_REG_ARM_COPROC_MASK);
|
||||||
MISMATCH_CHECK(CP_REG_ARM_COPROC_SHIFT, KVM_REG_ARM_COPROC_SHIFT);
|
MISMATCH_CHECK(CP_REG_ARM_COPROC_SHIFT, KVM_REG_ARM_COPROC_SHIFT);
|
||||||
@ -180,7 +174,6 @@ MISMATCH_CHECK(CP_REG_ARM64_SYSREG_CRM_MASK, KVM_REG_ARM64_SYSREG_CRM_MASK);
|
|||||||
MISMATCH_CHECK(CP_REG_ARM64_SYSREG_CRM_SHIFT, KVM_REG_ARM64_SYSREG_CRM_SHIFT);
|
MISMATCH_CHECK(CP_REG_ARM64_SYSREG_CRM_SHIFT, KVM_REG_ARM64_SYSREG_CRM_SHIFT);
|
||||||
MISMATCH_CHECK(CP_REG_ARM64_SYSREG_OP2_MASK, KVM_REG_ARM64_SYSREG_OP2_MASK);
|
MISMATCH_CHECK(CP_REG_ARM64_SYSREG_OP2_MASK, KVM_REG_ARM64_SYSREG_OP2_MASK);
|
||||||
MISMATCH_CHECK(CP_REG_ARM64_SYSREG_OP2_SHIFT, KVM_REG_ARM64_SYSREG_OP2_SHIFT);
|
MISMATCH_CHECK(CP_REG_ARM64_SYSREG_OP2_SHIFT, KVM_REG_ARM64_SYSREG_OP2_SHIFT);
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef MISMATCH_CHECK
|
#undef MISMATCH_CHECK
|
||||||
|
|
||||||
|
@ -918,22 +918,15 @@ int kvm_arch_process_async_events(CPUState *cs)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The #ifdef protections are until 32bit headers are imported and can
|
|
||||||
* be removed once both 32 and 64 bit reach feature parity.
|
|
||||||
*/
|
|
||||||
void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg)
|
void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg)
|
||||||
{
|
{
|
||||||
#ifdef KVM_GUESTDBG_USE_SW_BP
|
|
||||||
if (kvm_sw_breakpoints_active(cs)) {
|
if (kvm_sw_breakpoints_active(cs)) {
|
||||||
dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP;
|
dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef KVM_GUESTDBG_USE_HW
|
|
||||||
if (kvm_arm_hw_debug_active(cs)) {
|
if (kvm_arm_hw_debug_active(cs)) {
|
||||||
dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW;
|
dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW;
|
||||||
kvm_arm_copy_hw_debug_data(&dbg->arch);
|
kvm_arm_copy_hw_debug_data(&dbg->arch);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void kvm_arch_init_irq_routing(KVMState *s)
|
void kvm_arch_init_irq_routing(KVMState *s)
|
||||||
|
@ -406,13 +406,7 @@ static inline const char *gic_class_name(void)
|
|||||||
static inline const char *gicv3_class_name(void)
|
static inline const char *gicv3_class_name(void)
|
||||||
{
|
{
|
||||||
if (kvm_irqchip_in_kernel()) {
|
if (kvm_irqchip_in_kernel()) {
|
||||||
#ifdef TARGET_AARCH64
|
|
||||||
return "kvm-arm-gicv3";
|
return "kvm-arm-gicv3";
|
||||||
#else
|
|
||||||
error_report("KVM GICv3 acceleration is not supported on this "
|
|
||||||
"platform");
|
|
||||||
exit(1);
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
if (kvm_enabled()) {
|
if (kvm_enabled()) {
|
||||||
error_report("Userspace GICv3 is not supported with KVM");
|
error_report("Userspace GICv3 is not supported with KVM");
|
||||||
|
Loading…
Reference in New Issue
Block a user