From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] target/arm: Remove no-longer-reachable 32-bit KVM code
Date: Fri, 4 Sep 2020 18:01:34 +0200 [thread overview]
Message-ID: <11457fd8-725f-5836-e2ef-6c60aee344e5@redhat.com> (raw)
In-Reply-To: <20200904154156.31943-3-peter.maydell@linaro.org>
On 9/4/20 5:41 PM, Peter Maydell wrote:
> 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>
> ---
[...]
> static void arm_max_initfn(Object *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 */
> - cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
> + /* old-style VFP short-vector support */
> + cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
>
> #ifdef CONFIG_USER_ONLY
> - /* We don't set these in system emulation mode for the moment,
> - * since we don't correctly set (all of) the ID registers to
> - * advertise them.
> - */
> - set_feature(&cpu->env, ARM_FEATURE_V8);
> - {
> - uint32_t t;
> + /* We don't set these in system emulation mode for the moment,
checkpatch might warn "block comment ... separate line" :/
> + * since we don't correctly set (all of) the ID registers to
> + * advertise them.
> + */
> + set_feature(&cpu->env, ARM_FEATURE_V8);
> + {
> + uint32_t t;
>
> - t = cpu->isar.id_isar5;
> - t = FIELD_DP32(t, ID_ISAR5, AES, 2);
> - t = FIELD_DP32(t, ID_ISAR5, SHA1, 1);
> - t = FIELD_DP32(t, ID_ISAR5, SHA2, 1);
> - t = FIELD_DP32(t, ID_ISAR5, CRC32, 1);
> - t = FIELD_DP32(t, ID_ISAR5, RDM, 1);
> - t = FIELD_DP32(t, ID_ISAR5, VCMA, 1);
> - cpu->isar.id_isar5 = t;
> + t = cpu->isar.id_isar5;
> + t = FIELD_DP32(t, ID_ISAR5, AES, 2);
> + t = FIELD_DP32(t, ID_ISAR5, SHA1, 1);
> + t = FIELD_DP32(t, ID_ISAR5, SHA2, 1);
> + t = FIELD_DP32(t, ID_ISAR5, CRC32, 1);
> + t = FIELD_DP32(t, ID_ISAR5, RDM, 1);
> + t = FIELD_DP32(t, ID_ISAR5, VCMA, 1);
> + cpu->isar.id_isar5 = t;
>
> - t = cpu->isar.id_isar6;
> - t = FIELD_DP32(t, ID_ISAR6, JSCVT, 1);
> - t = FIELD_DP32(t, ID_ISAR6, DP, 1);
> - t = FIELD_DP32(t, ID_ISAR6, FHM, 1);
> - t = FIELD_DP32(t, ID_ISAR6, SB, 1);
> - t = FIELD_DP32(t, ID_ISAR6, SPECRES, 1);
> - cpu->isar.id_isar6 = t;
> + t = cpu->isar.id_isar6;
> + t = FIELD_DP32(t, ID_ISAR6, JSCVT, 1);
> + t = FIELD_DP32(t, ID_ISAR6, DP, 1);
> + t = FIELD_DP32(t, ID_ISAR6, FHM, 1);
> + t = FIELD_DP32(t, ID_ISAR6, SB, 1);
> + t = FIELD_DP32(t, ID_ISAR6, SPECRES, 1);
> + cpu->isar.id_isar6 = t;
>
> - t = cpu->isar.mvfr1;
> - t = FIELD_DP32(t, MVFR1, FPHP, 3); /* v8.2-FP16 */
> - t = FIELD_DP32(t, MVFR1, SIMDHP, 2); /* v8.2-FP16 */
> - cpu->isar.mvfr1 = t;
> + t = cpu->isar.mvfr1;
> + t = FIELD_DP32(t, MVFR1, FPHP, 3); /* v8.2-FP16 */
> + t = FIELD_DP32(t, MVFR1, SIMDHP, 2); /* v8.2-FP16 */
> + cpu->isar.mvfr1 = t;
>
> - t = cpu->isar.mvfr2;
> - t = FIELD_DP32(t, MVFR2, SIMDMISC, 3); /* SIMD MaxNum */
> - t = FIELD_DP32(t, MVFR2, FPMISC, 4); /* FP MaxNum */
> - cpu->isar.mvfr2 = t;
> + t = cpu->isar.mvfr2;
> + t = FIELD_DP32(t, MVFR2, SIMDMISC, 3); /* SIMD MaxNum */
> + t = FIELD_DP32(t, MVFR2, FPMISC, 4); /* FP MaxNum */
> + cpu->isar.mvfr2 = t;
>
> - t = cpu->isar.id_mmfr3;
> - t = FIELD_DP32(t, ID_MMFR3, PAN, 2); /* ATS1E1 */
> - cpu->isar.id_mmfr3 = t;
> + t = cpu->isar.id_mmfr3;
> + t = FIELD_DP32(t, ID_MMFR3, PAN, 2); /* ATS1E1 */
> + cpu->isar.id_mmfr3 = t;
>
> - t = cpu->isar.id_mmfr4;
> - t = FIELD_DP32(t, ID_MMFR4, HPDS, 1); /* AA32HPD */
> - t = FIELD_DP32(t, ID_MMFR4, AC2, 1); /* ACTLR2, HACTLR2 */
> - t = FIELD_DP32(t, ID_MMFR4, CNP, 1); /* TTCNP */
> - t = FIELD_DP32(t, ID_MMFR4, XNX, 1); /* TTS2UXN */
> - cpu->isar.id_mmfr4 = t;
> - }
> -#endif
> + t = cpu->isar.id_mmfr4;
> + t = FIELD_DP32(t, ID_MMFR4, HPDS, 1); /* AA32HPD */
> + t = FIELD_DP32(t, ID_MMFR4, AC2, 1); /* ACTLR2, HACTLR2 */
> + t = FIELD_DP32(t, ID_MMFR4, CNP, 1); /* TTCNP */
> + t = FIELD_DP32(t, ID_MMFR4, XNX, 1); /* TTS2UXN */
> + cpu->isar.id_mmfr4 = t;
> }
> +#endif
Scary :) This is the if {} else {} removed, OK.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> }
> #endif
>
> @@ -2269,11 +2265,7 @@ static void arm_host_initfn(Object *obj)
>
> static const TypeInfo host_arm_cpu_type_info = {
> .name = TYPE_ARM_HOST_CPU,
> -#ifdef TARGET_AARCH64
> .parent = TYPE_AARCH64_CPU,
> -#else
> - .parent = TYPE_ARM_CPU,
> -#endif
> .instance_init = arm_host_initfn,
> };
[...]
next prev parent reply other threads:[~2020-09-04 16:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 15:41 [PATCH 0/2] Remove KVM support for 32-bit Arm hosts Peter Maydell
2020-09-04 15:41 ` [PATCH 1/2] target/arm: " Peter Maydell
2020-09-04 16:01 ` Philippe Mathieu-Daudé
2020-09-04 15:41 ` [PATCH 2/2] target/arm: Remove no-longer-reachable 32-bit KVM code Peter Maydell
2020-09-04 16:01 ` Philippe Mathieu-Daudé [this message]
2020-09-04 16:06 ` Peter Maydell
2020-09-04 15:50 ` [PATCH 0/2] Remove KVM support for 32-bit Arm hosts Richard Henderson
2020-09-04 15:51 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11457fd8-725f-5836-e2ef-6c60aee344e5@redhat.com \
--to=philmd@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).