* [PULL 0/1] target-arm queue
@ 2023-12-04 14:33 Peter Maydell
2023-12-04 14:33 ` [PULL 1/1] target/arm: Disable SME if SVE is disabled Peter Maydell
2023-12-05 12:33 ` [PULL 0/1] target-arm queue Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2023-12-04 14:33 UTC (permalink / raw)
To: qemu-devel
Just one fix for rc3. Technically this isn't a regression since
8.1, but it is a small change that avoids the user being able
to select an oddball combination of CPU features that currently
QEMU will assert on.
thanks
-- PMM
The following changes since commit 29b5d70cb70574b499517ec9e9f80dea496a3cc0:
Merge tag 'pull-ppc-for-8.2-20231130' of https://gitlab.com/npiggin/qemu into staging (2023-12-01 07:29:52 -0500)
are available in the Git repository at:
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20231204-1
for you to fetch changes up to f7767ca301796334f74b9b642b395a4bd3e3dbac:
target/arm: Disable SME if SVE is disabled (2023-12-04 13:34:16 +0000)
----------------------------------------------------------------
target-arm queue:
* Turn off SME if SVE is turned off (this combination doesn't
currently work and QEMU will assert if you try it)
----------------------------------------------------------------
Peter Maydell (1):
target/arm: Disable SME if SVE is disabled
target/arm/cpu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PULL 1/1] target/arm: Disable SME if SVE is disabled
2023-12-04 14:33 [PULL 0/1] target-arm queue Peter Maydell
@ 2023-12-04 14:33 ` Peter Maydell
2023-12-05 12:33 ` [PULL 0/1] target-arm queue Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2023-12-04 14:33 UTC (permalink / raw)
To: qemu-devel
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
---
target/arm/cpu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 25e9d2ae7b8..efb22a87f9e 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1743,6 +1743,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.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PULL 0/1] target-arm queue
2023-12-04 14:33 [PULL 0/1] target-arm queue Peter Maydell
2023-12-04 14:33 ` [PULL 1/1] target/arm: Disable SME if SVE is disabled Peter Maydell
@ 2023-12-05 12:33 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2023-12-05 12:33 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-05 14:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 14:33 [PULL 0/1] target-arm queue Peter Maydell
2023-12-04 14:33 ` [PULL 1/1] target/arm: Disable SME if SVE is disabled Peter Maydell
2023-12-05 12:33 ` [PULL 0/1] target-arm queue Stefan Hajnoczi
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).