qemu-e2k/target/arm
Peter Maydell 8f4821d77e target/arm: Limit ID register assertions to TCG
In arm_cpu_realizefn() we make several assertions about the values of
guest ID registers:
 * if the CPU provides AArch32 v7VE or better it must advertise the
   ARM_DIV feature
 * if the CPU provides AArch32 A-profile v6 or better it must
   advertise the Jazelle feature

These are essentially consistency checks that our ID register
specifications in cpu.c didn't accidentally miss out a feature,
because increasingly the TCG emulation gates features on the values
in ID registers rather than using old-style checks of ARM_FEATURE_FOO
bits.

Unfortunately, these asserts can cause problems if we're running KVM,
because in that case we don't control the values of the ID registers
-- we read them from the host kernel.  In particular, if the host
kernel is older than 4.15 then it doesn't expose the ID registers via
the KVM_GET_ONE_REG ioctl, and we set up dummy values for some
registers and leave the rest at zero.  (See the comment in
target/arm/kvm64.c kvm_arm_get_host_cpu_features().) This set of
dummy values is not sufficient to pass our assertions, and so on
those kernels running an AArch32 guest on AArch64 will assert.

We could provide a more sophisticated set of dummy ID registers in
this case, but that still leaves the possibility of a host CPU which
reports bogus ID register values that would cause us to assert.  It's
more robust to only do these ID register checks if we're using TCG,
as that is the only case where this is truly a QEMU code bug.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20190718125928.20147-1-peter.maydell@linaro.org
Fixes: https://bugs.launchpad.net/qemu/+bug/1830864
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-22 14:07:39 +01:00
..
Makefile.objs target/arm/helper: Move M profile routines to m_helper.c 2019-07-04 17:14:43 +01:00
arch_dump.c target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers 2018-01-25 11:45:29 +00:00
arm-powerctl.c target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset() 2019-02-28 11:03:04 +00:00
arm-powerctl.h target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset() 2019-02-28 11:03:04 +00:00
arm-semi.c semihosting: split console_out into string and char versions 2019-06-12 17:53:22 +01:00
arm_ldst.h target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu-qom.h arm: replace instance_post_init() 2019-01-07 16:18:42 +04:00
cpu.c target/arm: Limit ID register assertions to TCG 2019-07-22 14:07:39 +01:00
cpu.h target/arm: Restrict semi-hosting to TCG 2019-07-04 17:14:43 +01:00
cpu64.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
crypto_helper.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
debug_helper.c target/arm: Move debug routines to debug_helper.c 2019-07-04 17:14:43 +01:00
gdbstub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
gdbstub64.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
helper-a64.c tcg: Introduce set/clear_helper_retaddr 2019-07-14 12:19:00 +02:00
helper-a64.h target/arm: Split helper_msr_i_pstate into 3 2019-03-05 15:55:08 +00:00
helper-sve.h target/arm: Rewrite vector gather first-fault loads 2018-10-08 14:55:03 +01:00
helper.c target/arm: Add missing break statement for Hypervisor Trap Exception 2019-07-22 14:07:38 +01:00
helper.h target/arm: Use tcg_gen_abs_i64 and tcg_gen_gvec_abs 2019-05-13 22:52:08 +00:00
idau.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
internals.h target/arm: Declare some M-profile functions publicly 2019-07-01 17:29:01 +01:00
iwmmxt_helper.c target/arm: Untabify iwmmxt_helper.c 2018-08-24 13:17:48 +01:00
kvm-consts.h arm: add trailing ; after MISMATCH_CHECK 2017-02-01 03:37:18 +02:00
kvm-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
kvm.c arm: Remove unnecessary includes of hw/arm/arm.h 2019-05-23 14:47:43 +01:00
kvm32.c KVM: Introduce kvm_arch_destroy_vcpu() 2019-06-21 02:29:39 +02:00
kvm64.c KVM: Introduce kvm_arch_destroy_vcpu() 2019-06-21 02:29:39 +02:00
kvm_arm.h kvm: add kvm_arm_get_max_vm_ipa_size 2019-03-05 15:55:09 +00:00
m_helper.c target/arm: NS BusFault on vector table fetch escalates to NS HardFault 2019-07-15 14:17:04 +01:00
machine.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
monitor.c qapi: Rename target.json to misc-target.json 2019-07-02 13:37:00 +02:00
neon_helper.c target/arm: Use tcg_gen_abs_i64 and tcg_gen_gvec_abs 2019-05-13 22:52:08 +00:00
op_addsub.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
op_helper.c target/arm: Move debug routines to debug_helper.c 2019-07-04 17:14:43 +01:00
pauth_helper.c target/arm: Fix output of PAuth Auth 2019-06-13 15:14:03 +01:00
psci.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
sve.decode target/arm: SVE brk[ab] merging does not have s bit 2019-01-07 15:23:45 +00:00
sve_helper.c tcg: Introduce set/clear_helper_retaddr 2019-07-14 12:19:00 +02:00
tlb_helper.c target/arm: Move TLB related routines to tlb_helper.c 2019-07-01 17:29:01 +01:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
translate-a64.c target/arm: Move CPU state dumping routines to cpu.c 2019-07-01 17:29:00 +01:00
translate-a64.h target/arm: Move vfp_expand_imm() to translate.[ch] 2019-06-17 15:14:19 +01:00
translate-sve.c tcg: Specify optional vector requirements with a list 2019-05-13 14:44:03 -07:00
translate-vfp.inc.c target/arm: Correct VMOV_imm_dp handling of short vectors 2019-07-04 17:25:30 +01:00
translate.c target/arm: Execute Thumb instructions when their condbits are 0xf 2019-07-04 17:25:30 +01:00
translate.h target/arm: Move CPU state dumping routines to cpu.c 2019-07-01 17:29:00 +01:00
vec_helper.c target/arm: Add helpers for FMLAL 2019-02-28 11:03:05 +00:00
vfp-uncond.decode target/arm: Convert VCVTA/VCVTN/VCVTP/VCVTM to decodetree 2019-06-13 15:14:04 +01:00
vfp.decode target/arm: Use vfp_expand_imm() for AArch32 VFP VMOV_imm 2019-06-17 15:14:19 +01:00
vfp_helper.c target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR 2019-07-08 14:11:31 +01:00