Richard Henderson <richard.hender...@linaro.org> writes: > On 1/13/23 06:04, Fabiano Rosas wrote: >> The cpu_tcg.c file about to be moved into the tcg directory. Move the >> code that is needed for cpus that also work with KVM into cpu.c. >> >> Signed-off-by: Fabiano Rosas <faro...@suse.de> >> --- >> target/arm/cpu.c | 76 +++++++++++++++++++++++++++++++++++++++++++ >> target/arm/cpu_tcg.c | 77 -------------------------------------------- >> 2 files changed, 76 insertions(+), 77 deletions(-) > > Actually, not true. This is tcg-only. As is the bulk of aarch64_max_initfn > from which > this is called -- note the first 4 lines of that function: > > if (kvm_enabled() || hvf_enabled()) { > /* With KVM or HVF, '-cpu max' is identical to '-cpu host' */ > aarch64_host_initfn(obj); > return; > } > > Thus the rest of the function is only reachable for tcg.
Sigh... It seems it's not that simple: We can currently have a QEMU invocation with "-accel qtest -cpu max" and no other accelerator. Currently, it falls into this implicit else branch. So this is actually "else if (tcg_enabled() || qtest_enabled())". If I move the "TCG-only" code under CONFIG_TCG, the qtests that use -cpu max will break. So I have chosen to move the code which depends on aa32_max_features as you suggest into tcg/ but kept the cortex-a57 as a baseline for qtest. This has the effect of causing "-cpu max" for the tests to be a slightly different CPU depending on whether TCG is built in (which perhaps is ok because if the tests depended on cpu features they should specify an accel?).