@samitouri / QOSamiQemu / commits / 66d0446738

target/arm: Tidy cpu_max_initfn

Once we have eliminated hwaccel_enabled, only tcg and qtest remain. Separate tcg from qtest initialization. Remove an assert on aarch64_enabled that is directly protected by a preceding if. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-id: 20260812204435.295067-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Richard Henderson committed Aug 18, 2026 at 10:39 UTC 66d0446738c7be74b40746e3eebe5cfbeea56d45
1 file changed +21 -18
target/arm/cpu-max.c
+21 -18
@@ -203,29 +203,32 @@ static void cpu_max_initfn(Object *obj)
203 return;
204 }
205
206 - if (tcg_enabled() || qtest_enabled()) {
207 - aarch64_aa32_a57_init(obj, !aarch64_enabled);
208 - }
209 -
210 - if (!aarch64_enabled) {
211 - aa32_max_features(cpu);
212 -#ifdef CONFIG_USER_ONLY
213 - /*
214 - * Break with true ARMv8 and add back old-style VFP short-vector
215 - * support. Only do this for user-mode, where -cpu max is the default,
216 - * so that older v6 and v7 programs are more likely to work without
217 - * adjustment.
218 - */
219 - cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
220 -#endif
221 - } else if (tcg_enabled()) {
222 - assert(aarch64_enabled);
206 + if (tcg_enabled()) {
207 /*
208 * '-cpu max' for TCG: we currently do this as
209 * "A57 with extra things"
210 */
227 - aarch64_max_tcg_initfn(obj);
211 + aarch64_aa32_a57_init(obj, !aarch64_enabled);
212 + if (!aarch64_enabled) {
213 + aa32_max_features(cpu);
214 +#ifdef CONFIG_USER_ONLY
215 + /*
216 + * Break with true ARMv8 and add back old-style VFP short-vector
217 + * support. Only do this for user-mode, where -cpu max is the default,
218 + * so that older v6 and v7 programs are more likely to work without
219 + * adjustment.
220 + */
221 + cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
222 +#endif
223 + } else {
224 + aarch64_max_tcg_initfn(obj);
225 + }
226 + return;
227 }
228 +
229 + /* Ultimate fallback: -cpu max as cortex-a57. */
230 + assert(qtest_enabled());
231 + aarch64_aa32_a57_init(obj, !aarch64_enabled);
232 }
233
234 static const ARMCPUInfo arm_max_cpu = {