[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.8 23/24] target/arm: Disable SME if SVE is disabled
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.8 23/24] target/arm: Disable SME if SVE is disabled |
Date: |
Wed, 13 Dec 2023 16:00:32 +0300 |
From: Peter Maydell <peter.maydell@linaro.org>
There is no architectural requirement that SME implies SVE, but
our implementation currently assumes it. (FEAT_SME_FA64 does
imply SVE.) So if you try to run a CPU with eg "-cpu max,sve=off"
you quickly run into an assert when the guest tries to write to
SMCR_EL1:
#6 0x00007ffff4b38e96 in __GI___assert_fail
(assertion=0x5555566e69cb "sm", file=0x5555566e5b24
"../../target/arm/helper.c", line=6865, function=0x5555566e82f0
<__PRETTY_FUNCTION__.31> "sve_vqm1_for_el_sm") at ./assert/assert.c:101
#7 0x0000555555ee33aa in sve_vqm1_for_el_sm (env=0x555557d291f0, el=2,
sm=false) at ../../target/arm/helper.c:6865
#8 0x0000555555ee3407 in sve_vqm1_for_el (env=0x555557d291f0, el=2) at
../../target/arm/helper.c:6871
#9 0x0000555555ee3724 in smcr_write (env=0x555557d291f0, ri=0x555557da23b0,
value=2147483663) at ../../target/arm/helper.c:6995
#10 0x0000555555fd1dba in helper_set_cp_reg64 (env=0x555557d291f0,
rip=0x555557da23b0, value=2147483663) at ../../target/arm/tcg/op_helper.c:839
#11 0x00007fff60056781 in code_gen_buffer ()
Avoid this unsupported and slightly odd combination by
disabling SME when SVE is not present.
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2005
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20231127173318.674758-1-peter.maydell@linaro.org
(cherry picked from commit f7767ca301796334f74b9b642b395a4bd3e3dbac)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 38d066c294..6cf7a33591 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1498,6 +1498,16 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp)
return;
}
+ /*
+ * FEAT_SME is not architecturally dependent on FEAT_SVE (unless
+ * FEAT_SME_FA64 is present). However our implementation currently
+ * assumes it, so if the user asked for sve=off then turn off SME also.
+ * (KVM doesn't currently support SME at all.)
+ */
+ if (cpu_isar_feature(aa64_sme, cpu) && !cpu_isar_feature(aa64_sve,
cpu)) {
+ object_property_set_bool(OBJECT(cpu), "sme", false, &error_abort);
+ }
+
arm_cpu_sme_finalize(cpu, &local_err);
if (local_err != NULL) {
error_propagate(errp, local_err);
--
2.39.2
- [Stable-7.2.8 13/24] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field, (continued)
- [Stable-7.2.8 13/24] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 15/24] hw/mips/malta: Fix the malta machine on big endian hosts, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 14/24] vmdk: Don't corrupt desc file in vmdk_write_cid, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 18/24] hw/acpi/erst: Do not ignore Error* in realize handler, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 16/24] hw/audio/hda-codec: fix multiplication overflow, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 21/24] ui/gtk-egl: move function calls back to regular code path, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 20/24] ui/gtk-egl: Check EGLSurface before doing scanout, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 19/24] msix: unset PCIDevice::msix_vector_poll_notifier in rollback, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 24/24] system/memory: use ldn_he_p/stn_he_p, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 22/24] ui/vnc-clipboard: fix inflate_buffer, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 23/24] target/arm: Disable SME if SVE is disabled,
Michael Tokarev <=
- Re: [Stable-7.2.8 00/24] Patch Round-up for stable 7.2.8, freeze on 2023-12-23, Cole Robinson, 2023/12/13