[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 18/28] target/arm: Move common cpu code into cpu.c
From: |
Fabiano Rosas |
Subject: |
Re: [RFC PATCH v3 18/28] target/arm: Move common cpu code into cpu.c |
Date: |
Wed, 18 Jan 2023 09:46:19 -0300 |
Richard Henderson <richard.henderson@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 <farosas@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?).
- Re: [RFC PATCH v3 12/28] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled, (continued)
- [RFC PATCH v3 13/28] target/arm: Move hflags code into the tcg directory, Fabiano Rosas, 2023/01/13
- [RFC PATCH v3 14/28] target/arm: Move regime_using_lpae_format into internal.h, Fabiano Rosas, 2023/01/13
- [RFC PATCH v3 15/28] target/arm: Don't access TCG code when debugging with KVM, Fabiano Rosas, 2023/01/13
- [RFC PATCH v3 16/28] cpu-defs.h: Expose CPUTLBEntryFull to non-TCG code, Fabiano Rosas, 2023/01/13
- [RFC PATCH v3 18/28] target/arm: Move common cpu code into cpu.c, Fabiano Rosas, 2023/01/13
[RFC PATCH v3 19/28] target/arm: move cpu_tcg to tcg/cpu32.c, Fabiano Rosas, 2023/01/13
[RFC PATCH v3 17/28] target/arm: Move cortex sysregs into cpregs.c, Fabiano Rosas, 2023/01/13
[RFC PATCH v3 21/28] tests/qtest: Skip tests that depend on TCG when CONFIG_TCG=n, Fabiano Rosas, 2023/01/13