From nobody Mon Feb 9 07:57:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769686635; cv=none; d=zohomail.com; s=zohoarc; b=HKdj/NkNKI4bWA9wNGmjp7slPV/qvSWIydj6+6NjeJ3vxmmnaruUHOkmfCpy2qCAZSvTdsTi3A5qN33O9xx/TfDC/SzAG+IuKhnNebjCHHCKpMcxEwZ6E7fjqUqbQ+riQ3v9GvsLrVJAJmMRREuO236X4i+fjYnGqkhhEKj7+Lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769686635; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8WqMWGMMgAwpDdsjGebmVf+TWll8M5Sqgy4tjAwHbyk=; b=IsRLEo5oWVBTdqNjp/fogy2o8MMTBMyD8jIjQ2/itCAHV0oxS1kDEMI7UFtEemUCEuEW70iEKGEu9EvGVdOAZcXNqcmRcC9oOqW3kwRtsn8Q/IxnCvye7Tojq5548kE/elUpg9/Dny3FbOfzyLNFQbCkDcDu6cqRjktHKyBH17E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769686635768302.06003995086587; Thu, 29 Jan 2026 03:37:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlQJ7-0002Ne-9c; Thu, 29 Jan 2026 06:35:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlQIn-0002Ce-RP for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:12 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlQIf-0007kv-Hv for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:08 -0500 Received: by mail-wm1-x341.google.com with SMTP id 5b1f17b1804b1-4801d7c72a5so6667615e9.0 for ; Thu, 29 Jan 2026 03:34:59 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c42895sm196311075e9.14.2026.01.29.03.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 03:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769686498; x=1770291298; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8WqMWGMMgAwpDdsjGebmVf+TWll8M5Sqgy4tjAwHbyk=; b=yqs5LXo0uCtlngDu9IpMBsf8Rq1FbLwPv9cFJUXD4zWrZ9aNitNcxP/2L3NAo2On06 xOEy39nHO4hAhB0ug+0ES5QO5WY5CEM6QdEMoL4vBnEGWZu1+ADKSxRoQsrICu+DemVW 4kfBJDe4vLkmbl85Np46gpv1NEMmjsYN01ac97p57p2ElXxlvfBqy2U8zyoRwwFH370O jaJc7F27V1w5yP8Dmbvyu+1GdxX7Q4f7X/lRJ4kCgHxo/QTWv8sNu8bp/SCg6MrMx/bc K6vxT69OXgnYbJs+OsQSnAoA+9uTCQqxu6E7M3mqeMk4WH9foXyyVlrXgWX+iHrTfLM+ V+Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769686498; x=1770291298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8WqMWGMMgAwpDdsjGebmVf+TWll8M5Sqgy4tjAwHbyk=; b=KJCmBCNXbBbV5vK/tJb1KkPzEJlG5Z5K3qD1YT9Kh61Eoa8cYb5CGEy6HRx/+hNWuI 3iYprJCtQm7le1ZztfNx1s21WMQp+WNfNjFC8/yE6lcsaGj5nu8b9HoWmlvagf3/+wsz T19Y/LJuPUlsfES1e4h0F2NPU6o8YugYCwgXOhZRyrukEd3+iE5bvMbum8r59dhedOJV wgVktI00phEmtmZ3vKq9gGWQ5yKzo/4+Dw0yfB0CnNOig5SztMknrpmF78NuEQiuvmGD t0Jd8lL7rVwVQPO3QvWLLZYlbhUgYLS9DFfszEPM49Zdj53sCy9HvJ3gvfe0t3E2JE/m zhSQ== X-Forwarded-Encrypted: i=1; AJvYcCU3L4A//3ywhz8RZWVyIL4QFX9I9E2xYtHAmjDbVLHCjeuD6RUFMy4orAKsSrW5naoQfZBv2Rl98FT4@nongnu.org X-Gm-Message-State: AOJu0YxIfb/Y9YuJJaida9RSEXvM9T3rcu3QG/2ptk/C+r+Ne2jPTQGN RUfzv21IYdO4bIumaXSjNLZ/GgU3rn/ZlVZjl8aNbm5QyPKZUK1HBT2vkleinkW/mavjYHwlkaJ UPTNfIS4LZw== X-Gm-Gg: AZuq6aJPNFccTIjyu2WZBUWUOKuYVEnjU0zDvM5zWgNWQqCcjFmjrO8HuqwOIGjDVdp H6TV2skPBU3E65O2H6tPnsQwbc0l+ZYPWpHZQoFNQBhDn7NLNWMINLGVQlzC4YAM13pKsTamdQL YYT2HGHTgyc5Z+kcwj2HP/8Nt9hEexX2tHOeEE0pOcUXWblvovGFpB0UZIInbjS9t8jMHcD8WTX mqp0pTPPiGhj9O7a00nK0J9wL1mOSkGWlymnaXjOZQu0eNOJrSIJURzpLobjPMkXDQxYSR9dQhF 78cvKgrbS8QvlrFZ6S+rFfjvHeL56VNK3O6C3vhdm9sqPiiymsCNS0U8s1GfOHSXzl8BT6rIWok F+5jtioNQa7904IgJXb6jjhXC5O4CgRhut5Op6CclQzqI7iAWh006jlCpgj4Cs4d3Hrc36DKjiW 7yaAiTSA+ndo1zXZ5to6NrYfk6aGcYpA== X-Received: by 2002:a05:600c:1c1c:b0:477:54f9:6ac2 with SMTP id 5b1f17b1804b1-48069b9d651mr130760635e9.0.1769686498369; Thu, 29 Jan 2026 03:34:58 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Richard Henderson , Manos Pitsidianakis Subject: [PATCH v2 1/6] target/arm: Account for SME in aarch64_sve_narrow_vq() assertion Date: Thu, 29 Jan 2026 11:34:50 +0000 Message-ID: <20260129113455.1283266-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260129113455.1283266-1-peter.maydell@linaro.org> References: <20260129113455.1283266-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769686638451154100 Content-Type: text/plain; charset="utf-8" In aarch64_sve_narrow_vq() we assert that the new VQ is within the maximum supported range for the CPU. We forgot to update this to account for SME, which might have a different maximum. Update the assert to permit any VQ which is valid for either SVE or SME. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- CC stable on this one, because it might also be a problem for a CPU with both SME and SVE but where the SVE max VL is less than the SME max VL. --- target/arm/helper.c | 2 +- target/arm/internals.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index dce648b482..7ceab0b503 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10076,7 +10076,7 @@ void aarch64_sve_narrow_vq(CPUARMState *env, unsign= ed vq) uint64_t pmask; =20 assert(vq >=3D 1 && vq <=3D ARM_MAX_VQ); - assert(vq <=3D env_archcpu(env)->sve_max_vq); + assert(vq <=3D arm_max_vq(env_archcpu(env))); =20 /* Zap the high bits of the zregs. */ for (i =3D 0; i < 32; i++) { diff --git a/target/arm/internals.h b/target/arm/internals.h index f7b641342a..8ec2750847 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1808,6 +1808,15 @@ static inline uint64_t arm_mdcr_el2_eff(CPUARMState = *env) ((1 << (1 - 1)) | (1 << (2 - 1)) | \ (1 << (4 - 1)) | (1 << (8 - 1)) | (1 << (16 - 1))) =20 +/* + * Return the maximum SVE/SME VQ for this CPU. This defines + * the maximum possible size of the Zn vector registers. + */ +static inline int arm_max_vq(ARMCPU *cpu) +{ + return MAX(cpu->sve_max_vq, cpu->sme_max_vq); +} + /* * Return true if it is possible to take a fine-grained-trap to EL2. */ --=20 2.43.0 From nobody Mon Feb 9 07:57:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769686652; cv=none; d=zohomail.com; s=zohoarc; b=Jklml3GhD5eJN/w4kuhhQXi47cDINaRew29dJN38W6+TaTbaRIUVVJ5phnRdiV37/tLBLn+zPQqdacANLBVq7AlRr3q8D86PVfra9Ml6hi7/BZQ8TizKH1LdjpSJDw02MyXeMrSB62/cNVNQ4As354AgTMaHVPbEXgMM72fF03M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769686652; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UeYHngVgVLDRj+NMJd+pWVh0P03LOn7Sf9KsxEWjxW8=; b=jpJotnRvmH36qy6nJNlMfgTAgg7Ph1iSra50VHMejCAoL6HB0mvzOJVj7yvU0b7Hqb1AuUMUFOhLtNzj0Yi3+wTmoG6hIjxw4eI8EDTVlBXf3uNmEOvdQDn88WLfSJVyQgvjGXj+s9kY4bKk5uqnUrys+ymTIbvOzZ9IaA302iU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769686652302333.719186169815; Thu, 29 Jan 2026 03:37:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlQJ7-0002O6-Tn; Thu, 29 Jan 2026 06:35:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlQIl-0002CM-84 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:07 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlQIf-0007l2-I2 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:06 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-48069a48629so9137095e9.0 for ; Thu, 29 Jan 2026 03:35:00 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c42895sm196311075e9.14.2026.01.29.03.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 03:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769686499; x=1770291299; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UeYHngVgVLDRj+NMJd+pWVh0P03LOn7Sf9KsxEWjxW8=; b=lEZH0n4dVHtnb902CXixC7ik4k/nH/uSAyCtGyqKwzEoYoaqNBFoR8pCvCUXNcVS7v bCiVU9gZiUPfzYDxKxve2stB850t4U+7Jgo2uixx06DUbuGrCsRq+Gws+BbOWOtqRuEG XWAmQgSaQqxsBAxGQKFuuP8es+XTu+4tg8lW/Cx5vbz+WxtGIGMN2ai6DCmtj4bTH/r2 8Vqf7uP6Y0AWiVJtXEqtr58M7i+eHDrtL7e72WA+nUS7w0eMeSohP1aK0Y7gJ4HYCckr EWxTmIZrZDdBXnAI+oowZu7UPaep6pWE6ZKFgBwzx9asbeBaqhn833caCjB52sGjU6Gz uUxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769686499; x=1770291299; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UeYHngVgVLDRj+NMJd+pWVh0P03LOn7Sf9KsxEWjxW8=; b=qaM9vn1TS7hTU2aQMDL6hhlFmF7WwKecTyjPWy1gBIA3whfDnLSSsOCWNorAB+gS/W ElkiwchSoKdbHW276hAUWCuh5wknKy/qNyK++jiAaApmgYyJUqrnyk7WYz7J72+dOibd FYKFbncNhA6D9YRQJjqVwBs9RnaTosvp3Fee55knx9PU094PTrtMpu9lePhMhMm5iTj9 utuFjBUMERASvFfzFPBg4E/GVZ4s9wAukb6gh8/0l2MANtsWAhYcFt5zdp2p5W4S1QNE R2tDgsSucZhQGAlbp8lJO/CXn1ti3MpEmktXIssFQyG6TjZtM6gi84xLFWuBImZoGhZD Byjw== X-Forwarded-Encrypted: i=1; AJvYcCVvsvx3nA2dc1OVTP5yhtixD1qI5zKdEK8pPY8YGsGf+sqNEqvgTA+XBofdtyq35o8UJAiXzu8rqR7c@nongnu.org X-Gm-Message-State: AOJu0YyOZM2BeA9NZugyZrZWCEk5YGlEDigtw8zhey7K8/7IZTXHy2NT h9R/5AtInuWedS3avJnt4tYZ7GIHXO4hB63sECir9Pmgvwon7j20XZPYulCJHpMB8bw= X-Gm-Gg: AZuq6aKth+0y1Qx+45Y+bJSAByjvrXsdWilCN5F7pXToCXNJr3SYI7LEXt/tw3xt2ru p/yAsgIg4greyte9boUYgtOF4bLPg/5BNNgkhyAlro8rbq2qsbR5bZLaMrQI871n+5NmHf2/cEE /EyV8zS8/Ho1JCa8scJMpaTI8aa2QUkGdaSSGESocL7VjiaBGdTe154vmZ2ZwOrl1xVEwtigRTY m49XkIgPyvYXY9bKDaN5LApNkGj9+PcufbvFyPnMe0XY8qNxJn7pEqwcEgVgzQEpZA68rZRuM65 gwE8WtwfgqVCWXgS1usys1nl9SJN6fNN6pFjtR2wIBSmOD/kt8UHf504sXXukJKwkFA1IWs5Utz jZ5hJJH+7pUAzdoAkbQ+zS+xJ9nQylpHCBF8ZNTRr1APbMXleBHjYCDVHm09ISmsKxEEF8IFmwJ ro4lkNP8+wOBGnC93AEimWOtpuYA95/w== X-Received: by 2002:a05:600c:83ca:b0:480:4b59:932e with SMTP id 5b1f17b1804b1-48069c1c2e2mr109367275e9.11.1769686499283; Thu, 29 Jan 2026 03:34:59 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Richard Henderson , Manos Pitsidianakis Subject: [PATCH v2 2/6] target/arm: Report correct vector width in gdbstub when SME present Date: Thu, 29 Jan 2026 11:34:51 +0000 Message-ID: <20260129113455.1283266-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260129113455.1283266-1-peter.maydell@linaro.org> References: <20260129113455.1283266-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769686695902158500 Content-Type: text/plain; charset="utf-8" Our gdbstub implementation of the org.gnu.gdb.aarch64.sve feature doesn't account for SME correctly. We always report the Zn vector registers with a width based on the maximum SVE vector register size, even though SME's maximum size could be larger. This is particularly bad in the case of a CPU with SME but not SVE, because there the SVE vector width will be zero. If we report the Zn registers in the XML as having a zero width then gdb falls over with an internal error: (gdb) target remote :1234 Remote debugging using :1234 /build/gdb-1WjiBe/gdb-15.0.50.20240403/gdb/aarch64-tdep.c:3066: internal-e= rror: aarch64_pseudo_register_type: bad register number 160 A problem internal to GDB has been detected, further debugging may prove unreliable. Report the Zn registers with their correct size. This matches how we already handle the 'vg' pseudoregister in org.gnu.gdb.aarch64.sve: we call sve_vqm1_for_el(), which returns the vector size accounting for SME, not the pure SVE vector size. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- We should make sure we have agreement on the gdb side about the interpretation of this bit of the protocol. See this gdb mailing list email: https://sourceware.org/pipermail/gdb/2026-January/052056.html --- target/arm/gdbstub64.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index c584e5b4e6..b71666c3a1 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -158,7 +158,7 @@ int aarch64_gdb_get_sve_reg(CPUState *cs, GByteArray *b= uf, int reg) case 0 ... 31: { int vq, len =3D 0; - for (vq =3D 0; vq < cpu->sve_max_vq; vq++) { + for (vq =3D 0; vq < arm_max_vq(cpu); vq++) { len +=3D gdb_get_reg128(buf, env->vfp.zregs[reg].d[vq * 2 + 1], env->vfp.zregs[reg].d[vq * 2]); @@ -174,7 +174,7 @@ int aarch64_gdb_get_sve_reg(CPUState *cs, GByteArray *b= uf, int reg) { int preg =3D reg - 34; int vq, len =3D 0; - for (vq =3D 0; vq < cpu->sve_max_vq; vq =3D vq + 4) { + for (vq =3D 0; vq < arm_max_vq(cpu); vq =3D vq + 4) { len +=3D gdb_get_reg64(buf, env->vfp.pregs[preg].p[vq / 4]); } return len; @@ -208,7 +208,7 @@ int aarch64_gdb_set_sve_reg(CPUState *cs, uint8_t *buf,= int reg) case 0 ... 31: { int vq, len =3D 0; - for (vq =3D 0; vq < cpu->sve_max_vq; vq++) { + for (vq =3D 0; vq < arm_max_vq(cpu); vq++) { if (target_big_endian()) { env->vfp.zregs[reg].d[vq * 2 + 1] =3D ldq_p(buf); buf +=3D 8; @@ -233,7 +233,7 @@ int aarch64_gdb_set_sve_reg(CPUState *cs, uint8_t *buf,= int reg) { int preg =3D reg - 34; int vq, len =3D 0; - for (vq =3D 0; vq < cpu->sve_max_vq; vq =3D vq + 4) { + for (vq =3D 0; vq < arm_max_vq(cpu); vq =3D vq + 4) { env->vfp.pregs[preg].p[vq / 4] =3D ldq_p(buf); buf +=3D 8; len +=3D 8; @@ -540,8 +540,8 @@ static void output_vector_union_type(GDBFeatureBuilder = *builder, int reg_width, GDBFeature *arm_gen_dynamic_svereg_feature(CPUState *cs, int base_reg) { ARMCPU *cpu =3D ARM_CPU(cs); - int reg_width =3D cpu->sve_max_vq * 128; - int pred_width =3D cpu->sve_max_vq * 16; + int reg_width =3D arm_max_vq(cpu) * 128; + int pred_width =3D arm_max_vq(cpu) * 16; GDBFeatureBuilder builder; char *name; int reg =3D 0; --=20 2.43.0 From nobody Mon Feb 9 07:57:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769686567; cv=none; d=zohomail.com; s=zohoarc; b=WnGY59cXQgdPcoNeKZi7zveMh9Nhgz9P3/OYFsY2khIBPdVqbHPbyIny1q7R4FHLwqDvNPd5sm+ObfERfZxPQVDO0QAf8Jt8LmSESAP6FhYKGIO4GmorPVtDij5ba2QYx4vyQeUEy/koWb6CSeacch1NaW+YNvL5dwxoycycMrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769686567; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=onHeNG6L+Cp0GwsmRC8UYqSZ2ksrcTcnPWdFnALo+iQ=; b=jLfgLlc+YAoqsKnYrVH2KtKxVUAVzztQ6UzVWhzVRtwA7b6eoChMCg/g/apsJ5GChELEJa256b871sjY0UKbGIT76BO34IRuzQKE4B5MsDGmZ5njAsdH2/aMpj6UiF0/qSlWymOgnhKR6Zvk0WJUMRzVfODzOjA05RoeH9ghHf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176968656738871.18162613413301; Thu, 29 Jan 2026 03:36:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlQJG-0002VS-3N; Thu, 29 Jan 2026 06:35:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlQIn-0002Ci-UG for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:14 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlQIj-0007lO-LB for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:09 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-47edd6111b4so8835685e9.1 for ; Thu, 29 Jan 2026 03:35:02 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c42895sm196311075e9.14.2026.01.29.03.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 03:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769686501; x=1770291301; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=onHeNG6L+Cp0GwsmRC8UYqSZ2ksrcTcnPWdFnALo+iQ=; b=yw/Ygh6McKOFyBUy10ahKuKTVXde3utXD+DxJTepEmS8wzSe1TpHnLoNlZAXxCI5+D OG/Rr16EKKarBYjphRfz/mmf3CByvpOWxyi/U0DNic7xb14pRsF4PNIYsWGtRYftngBb A77r7V3VhdYZwQcXpBLeOWz51SHCpTr9uubaD/TFGBKKKWZMpb/kuGMyFA7h0k/A4+d8 fAugIasuVYSm642XOkk6mfuJVD6oX46kCF9YiePedulC7fTDHhs0JR/NjKuTuLUdsBBm EMdUGRtX6RgYPcquvfqBLhGkI6TLgumkLdq/fUs5xlk6MLa3m9M3cQKoj/77HYw5K90c KRdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769686501; x=1770291301; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=onHeNG6L+Cp0GwsmRC8UYqSZ2ksrcTcnPWdFnALo+iQ=; b=SUxIMYcaMufKiwLuQxurqFhtUAuvIkaO/NPhnmiJkzMha+mJZUfyjJkDMQFrkYrCUm cVFnHMSyNL9teLSgG+FAlZgB7qlprsfsV6NjeFMd+VEojYJcbTH3f2rkiRxX84sypk6N ThywLP2Op0bpqge4bERGp0EO33qnfMiRyfZfM3FjogcqPDcgi4a/fxi2WtB2shkPFv8V qHUg9bB6xVjDJVGWxUAyz+kHwnysVhdicGpTWF3U5mBpIPmZwl63Nkcd7+0TDnQFFXv6 6VNCQeJju8kV9qNOKIvjRC1UPoP2LgVhK+zv+GcXQ52mGgeueqaM8fvdvYamfhXXY+Hx wphg== X-Forwarded-Encrypted: i=1; AJvYcCWzZV3LUmkgeHYl0dOKmtC/oI4l4rwkCcmwS4EIOvEovVSrzh4Xnst7z+NyURTLJ9qFfI723/tLqdMS@nongnu.org X-Gm-Message-State: AOJu0YzJtGgwQVQp8DnGud1P/419kcWBCmnfn0Dof06VCO8iNy5kwHH4 gcpGKikstuTOP+S6/g9fS/falmvsCfexWGWv4Q9wSAQkschFtpVUE2nKDKBveLYowTE= X-Gm-Gg: AZuq6aKeit9YnkqeQVWkrcTyHGCMJWHnYDuz8d++5c8tCAI8/PaFIJ2ReR/UqHn8lmI qZI6J/XfGmCfB1bfr96QNqWNgCVUipS7avbtGi8u6E9d8zp1LBIB0NuJpoqSEZmjmWXzzz6KYMZ UGjK1KmEW/LlDeNz6rR4nJ+MyBIhyNvQdNRx7ju502GTnICNMMCSLI1jAXUs0Cg+Rcabkt19Sbu JEdAPIWUYJ3Yq2Urh4fcS4RObK2IivQk9NCg6G73WYq8Pz1mZ6vIOiMbnHHGWPSyH14jDZILPXV WH9L6JTgidFiJ22N2lRXDEHzey8IxmxOBt/vcp8ajT+AVHQKOz2hA936mr6YBAzenEnATMUD8QR EQ8Fuf7FoihA73XPhGScPTIMu91NY6DMFBjLjLOt+V96IIORLiKjCrysrFPpnIcSclgxgiD8kom wUm9AMC7CR9lfuA8V/Ewb1sCRv26twSfQUjBkvRvKZ X-Received: by 2002:a05:600c:458a:b0:46f:c55a:5a8d with SMTP id 5b1f17b1804b1-48069c0fdafmr95011665e9.4.1769686501580; Thu, 29 Jan 2026 03:35:01 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Richard Henderson , Manos Pitsidianakis Subject: [PATCH v2 3/6] target/arm: Handle SME-only CPUs in sve_vqm1_for_el_sm() Date: Thu, 29 Jan 2026 11:34:52 +0000 Message-ID: <20260129113455.1283266-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260129113455.1283266-1-peter.maydell@linaro.org> References: <20260129113455.1283266-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769686569576154100 Content-Type: text/plain; charset="utf-8" In sve_vqm1_for_el_sm(), we implicitly assume that the CPU has SVE: if called with sm =3D=3D false for non-streaming mode, we try to return a vector length from svq_vq. This hits the "assert(sm)" at the bettom of the function in an SME-only CPU where sve_vq.map is zero. Add code to handle the "SME-only CPU not in streaming mode" case: we report an effective VL of 128 bits, which is what the architecture rule R_KXKNK says should be used when SVE instructions are disabled or trapped but floating point instructions are enabled. Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- target/arm/helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 7ceab0b503..732c3a9eba 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4763,7 +4763,7 @@ int sme_exception_el(CPUARMState *env, int el) } =20 /* - * Given that SVE is enabled, return the vector length for EL. + * Given that SVE or SME is enabled, return the vector length for EL. */ uint32_t sve_vqm1_for_el_sm(CPUARMState *env, int el, bool sm) { @@ -4775,6 +4775,12 @@ uint32_t sve_vqm1_for_el_sm(CPUARMState *env, int el= , bool sm) if (sm) { cr =3D env->vfp.smcr_el; map =3D cpu->sme_vq.map; + } else if (map =3D=3D 0) { + /* + * SME-only CPU not in streaming mode: effective VL + * is 128 bits, per R_KXKNK. + */ + return 0; } =20 if (el <=3D 1 && !el_is_in_host(env, el)) { --=20 2.43.0 From nobody Mon Feb 9 07:57:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769686567; cv=none; d=zohomail.com; s=zohoarc; b=QfTnc599E+tr4jEMKbK8Fr6G1PLYw50AnMRokMYY9KvWC130D/4GR9NPWgSY2IYmQwixOr8iL5dAYW0UljVX4p7EgrHymgoClxfLtn/Wgqrc035hYAVU5b/EEdkl8WyVENxd/Fwe+dOMXZ2H5oAbIn4KjbwdZD2k0L42m4n9zKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769686567; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mEeefLwyevAwvJbV1EeJJSkxsmhi2vz8LE44h+RFunE=; b=YM7Lb3uJAb1kHESLfKgkmSfqTDEhUGp95WSF+EX3yJLwXFS8woIq103GiLDBPuTdGeQujZ1OcXpS6CJDv/H7bC7lZuVwBQ3Zg5njWNMvCISeuhWfiPCfKwz4XC78QEbMMIfvpOfn2Fn2HB2l/ndEb5Ujtg6aA+Jp62MhpyZnUPA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769686567391900.4650122609798; Thu, 29 Jan 2026 03:36:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlQJ9-0002Qv-Tt; Thu, 29 Jan 2026 06:35:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlQIn-0002Cg-T5 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:12 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlQIj-0007sq-ME for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:09 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4801eb2c0a5so8205255e9.3 for ; Thu, 29 Jan 2026 03:35:03 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c42895sm196311075e9.14.2026.01.29.03.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 03:35:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769686503; x=1770291303; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mEeefLwyevAwvJbV1EeJJSkxsmhi2vz8LE44h+RFunE=; b=twBwvllTCvqT8H6u+7bRq2mU936RWtG0FfBInH106yHsgl8PXz0uZ5ZrNo6RW+neqP YIeTii+Joevj5nxT/+DeojAIwQx4tc08vj1/BCLvQru8VdcNvAkMvKmZLsVilK1M9hHw idpGoWBVaNR+wH67kXPVmD5E/bYhKzAGuqG4U4TfSDoGowpJK+i2ceOV2RwHXSi2LZyh rUo9Fl9nOASUOE5NwZBZXWdB8U4GHTsPw84MW8HAu4CqKLu2/7OgOhTlK2V0Hh7yfCum D2zVpw+eHOU8xvix4UQPBYPVmVCxlhypZ9Wr1c+oEO6oT20CkxZkYadMUz2F1igTFcK/ ncag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769686503; x=1770291303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mEeefLwyevAwvJbV1EeJJSkxsmhi2vz8LE44h+RFunE=; b=cM9WH1zh1406Jty/PUg2NEDyFsHtODC6hAMj1iwcP7C07K84S9VwGO0jgEVjEkFW7+ Bj3+dUABHdzaXb0+PQI8wamYCP1GWddZch4+b7B8OtlslVJoSUrrnrQvk1hpdWV8tZBy FSHZC//a1hvVrwcEgkMngZA1mNTx4JE6hQ+tB80ISGI8yCQxsY5MM4a3uYv0wxuI/RzE gYZoMoYIZsH24OfFA+zhd3MGt8fe1VhfbJLWUK7YnnFLUFYYn06keyf1+sIPC+dKUdeR ZDvbTjF5nv7ZsMqGebbiC6n9b3ibmRF++YQbFIUPNoZIP3ihrD1yz6zzD9BnCVqSMKTo dZaQ== X-Forwarded-Encrypted: i=1; AJvYcCU8iFa5AkfZhf5a/ShRZfNcr9BhAXszVUSaQQ8EpcJsy0T5Nw48Vub7vo5kJRPoVY3QwFZIujg9BGbi@nongnu.org X-Gm-Message-State: AOJu0Ywwz1Du64srNFVAcAlfnma3enu315QRoglwsBJEJdS0ifWJMhA/ 26kAd3IX60YQQZ8D5SKNPgjrt0OYreYld/ZzvATv8+KKelBUrTIfj9uNj2ZzRfneFzo= X-Gm-Gg: AZuq6aLyMycLh3Xz1Y+qnsJH4e15aORK/S2z1Aicw7JqlWFmSvSKdXm5vnr2n7SaKgb UsY/6vQODjMtwewEDntf2txK5r52O6f9FKivQEBD0HZVZAY3v47XL7n3B/c3AFTfcweWrBqgkIe F9Jn83GJrFhHQRqeVW2y3kDbyzqh+7RQhJMw6aafOUSGP26gHj24Qrsx8jxRTaz+lJCekFFTsy2 VNlhv5oEzS9cwTo7vQDHl53UDNpSfRxWeMFoxkbieQwQNYxDkm4qZabfX2Xdy0juQP0wP+VZRKS 0sFaPrwqrCLaWAaGzGyfyy+iGhGoZ5N36v3MQ0uYHCnceBU1/VWGTHs3kRwZrVq9+GG0NPa/WRJ ce9BBU47bpxtgimJ++41zbhR1DG+luyd2nQP9qBmbKU3mn2sLgwuVPPkVZ9wc16QMd5wZf7cgii oI7SE+GwLubeEpLbCbxKmodiNyE0muhg== X-Received: by 2002:a05:600c:3e85:b0:477:a54a:acba with SMTP id 5b1f17b1804b1-48069c557a6mr125563085e9.17.1769686502857; Thu, 29 Jan 2026 03:35:02 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Richard Henderson , Manos Pitsidianakis Subject: [PATCH v2 4/6] target/arm: Handle SME-without-SVE on change of EL Date: Thu, 29 Jan 2026 11:34:53 +0000 Message-ID: <20260129113455.1283266-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260129113455.1283266-1-peter.maydell@linaro.org> References: <20260129113455.1283266-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769686652653158500 Content-Type: text/plain; charset="utf-8" aarch64_sve_change_el() currently assumes that SME implies SVE, and will return without doing anything if SVE is not implemented, skipping a possible requirement to change the vector register state because the SME vector length has changed. Update it to handle SME also. Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 732c3a9eba..655ce73ee1 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10127,8 +10127,8 @@ void aarch64_sve_change_el(CPUARMState *env, int ol= d_el, int old_len, new_len; bool old_a64, new_a64, sm; =20 - /* Nothing to do if no SVE. */ - if (!cpu_isar_feature(aa64_sve, cpu)) { + /* Nothing to do if no SVE or SME. */ + if (!cpu_isar_feature(aa64_sve, cpu) && !cpu_isar_feature(aa64_sme, cp= u)) { return; } =20 --=20 2.43.0 From nobody Mon Feb 9 07:57:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769686620; cv=none; d=zohomail.com; s=zohoarc; b=gM14tR6uyLxPz4I0XPLwXNEBRof4NGVP3/4kpbfVj4mObpkRN2DEN7zhazlKrUYVaK19qC7Pn92mXwJozJ6EP+91JypiniAeDyJ58ogwJPiR5Omkne/GvE8b7sBMFq1J3/SevGaIXgcHsJVYhKajhePt0jvjjpv9urpbnZ/vk+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769686620; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=InrpoKttAgPvW62kHr9xgGsggByur+EYqp0VZlf3YkM=; b=COELzTAlT6s5F1mWtVexiQM5Xhz3W4jOFkbq33TVowqDXy4PWHSo7Z0ppxbiQOVY1y2+4P8UoMLu+tKM5SexFqDVyKi98GARVPz5iDLRVa7bmUEQEWr+N7vg2ftlImw/txwi3yo5ExBeIOHYs1/Qn+5mwH0/4+SDcIXlBk0TQws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17696866205031014.7654020556699; Thu, 29 Jan 2026 03:37:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlQJ8-0002Q9-Bn; Thu, 29 Jan 2026 06:35:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlQIn-0002Ch-Ts for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:12 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlQIj-0007wi-N3 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:09 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4806b43beb6so6695765e9.3 for ; Thu, 29 Jan 2026 03:35:05 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c42895sm196311075e9.14.2026.01.29.03.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 03:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769686504; x=1770291304; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=InrpoKttAgPvW62kHr9xgGsggByur+EYqp0VZlf3YkM=; b=qSKF6xbIpHYrqpaohqXb+l7cCvk9qYbc1CISCRsLIf7VmHz5rLo3ZgvUOC3f6jZCpV tUe1+RxVM7LL4rEiMTEmGeD872WkkHNr9RJqKKNncRWZPQ0iuR/YLhUZYGGDbow3u5lJ z1JEIqwVypsSags4F/1uWvDhUzxqIZI9qCAzWs13acF6s+w7Dq5HDH4o2LRYixo+i+Aq MdOub2yF8sO5xrmUaFEHTw6NqzgdOF2B13gxPLT9tcdzkF3DdOshBPspVqja/Ebaqbso Mt9SNa0YRTcx9h4YTbMDOay9Bvnk0N9v3+WPtmFYC6bN/XYPJZ6LiWw1Q4keFnQgQW+t H+lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769686504; x=1770291304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=InrpoKttAgPvW62kHr9xgGsggByur+EYqp0VZlf3YkM=; b=l/vK7noL4GA1PpzI/5fmSNXm81Hagej7P0V4uzxBKaeDmursaPll+HM/LKUBraGIiW rZlq5jytAciyqHSVL5EyvV6Pngv9u4kYEKImAmc1+me8M79ioyqKiKhyA2j3bQ+UnkGK hmkRyIRAtb05uPsyU9mhZZbzJ6zbQ7IDk296D+pHH9PrKIFVCusObJHMgOV33HWrb7Jp B84rNhSZMDz2Hy7wQxnWmQxC7URmErB8ge7LTAQ5uWwrjQD6BpjTiaTVFy/ZRPsc9CHw sikqU76gB/46j4xy8A8eTyQvdlkrpj/GowgxXwTz6C5+XZdZpoVLY6NUW22T/m9HqA4+ YcEQ== X-Forwarded-Encrypted: i=1; AJvYcCV6EUeyFi376gdY9s4FhQqJ8y5fU+sx0T6SlYmpO3G7anUW8YnSaIVGTCZIxGljK7m+9taGOXFB92au@nongnu.org X-Gm-Message-State: AOJu0YzR0gMHgfK6EbM6TKHM+GBbgHOhLNWZSVteG5ntHe6/7fvc6Sks UcgTQazFtrdS8duBQE9T02QaMELLe5osCjMkkvlQIam3/izOf/NuTu4hWITTnXrRNwA= X-Gm-Gg: AZuq6aICvu0FY5JpN94XLs71nA0nlQ3uVRXeIjqWiV/ctNV9Xf56SzLjvEIvSLdC9I4 AqCA0zlGIceQlUwSQ7GZcvxL0eqKsoyf0YIXcwHOJkpWyf2JtLUpucocsNGWRQV0786bjF/d35G C4A6MiB1zBqOcxsHBRZ+/GU6M2GyL0MFU2pPi+bghirkCo3iok5gSJ6SJIphA26+d92nwqZsR5O OmHvAKs9MVGVf6nWbg1e5gx1OeM9GeRIQrsuhEslAd8UhQjf8rRirrZQSK6dRoTDolEcLHZMS3w J8iOXEktxxmZtUV0gpRTtfw5y/DjlHMv1sD4TQhNd1zcH6If/+8Z14+LTIztHXHg6Jm+0GYUF9e RcOW2TxBdL2WnZQsBqhSwWXifIw5vLnn9zn3CEOl5Xe9US2s0CWnkQYnRfwIQvv6HyXqNu1pQIo vbvUg1FsB6On3YznzX0R+TSaElHYL6wg== X-Received: by 2002:a05:600c:350b:b0:477:9976:9e1a with SMTP id 5b1f17b1804b1-48069c0def9mr112433535e9.6.1769686503824; Thu, 29 Jan 2026 03:35:03 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Richard Henderson , Manos Pitsidianakis Subject: [PATCH v2 5/6] target/arm: Squash FEAT_SME_FA64 if FEAT_SVE is not present Date: Thu, 29 Jan 2026 11:34:54 +0000 Message-ID: <20260129113455.1283266-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260129113455.1283266-1-peter.maydell@linaro.org> References: <20260129113455.1283266-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769686690579158500 Content-Type: text/plain; charset="utf-8" FEAT_SME_FA64 allows Streaming SVE code to access the whole SVE instruction set; it requires FEAT_SVE to be present. If we have a CPU with SME but not SVE, squash the FA64 bit in arm_cpu_sme_finalize(). This doesn't have any effect at the moment because we don't let the user create an SME-without-SVE CPU, but we are about to lift that restriction. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/cpu64.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index bf30381370..e8c56fc81c 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -363,6 +363,11 @@ void arm_cpu_sme_finalize(ARMCPU *cpu, Error **errp) =20 cpu->sme_vq.map =3D vq_map; cpu->sme_max_vq =3D 32 - clz32(vq_map); + + if (!cpu_isar_feature(aa64_sve, cpu)) { + /* FEAT_SME_FA64 requires SVE, not just SME */ + FIELD_DP64_IDREG(&cpu->isar, ID_AA64SMFR0, FA64, 0); + } } =20 static bool cpu_arm_get_sme(Object *obj, Error **errp) --=20 2.43.0 From nobody Mon Feb 9 07:57:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769686617; cv=none; d=zohomail.com; s=zohoarc; b=IHFrXTH4rldBXXjDYE2BQXyliEAkFa28gnLe7vKXSIO8TumcZDEl3J8Qt8DWgvJ6Wv51bFzrk0x+/EXEJddFi07qc7WF+sZdnrXcF1mQzYveUxFEk8IMd4+OR5Z3EY/8jBJ8XyLGgruPaEVJUHbMauZwSU3FaHGpWxYCNbKeCeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769686617; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pC4vaBaGdBGxacndhuoO+54POr05bZJYxNH0VvqZF6E=; b=BytTyE3sBXa+jSph4lFvlbhINHSBISfIliRr/h+TL0w4RtYyYQRySZ9ZJS1RCmgRtLvvhxFNBd0lDSITVOTWon+TNXOK7MC+ZuV6vRHcnMp4WxKcCwIPS+tiOheTrCSEF95JAkdPHfk2x1gTDYKHnKmhyNLlvLS6aQ7uzPsX+Fw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769686617179358.469473533056; Thu, 29 Jan 2026 03:36:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlQJH-0002WI-0U; Thu, 29 Jan 2026 06:35:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlQIp-0002Cp-47 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:14 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlQIk-0007wo-A2 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 06:35:10 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-47d59da3d81so14126415e9.0 for ; Thu, 29 Jan 2026 03:35:05 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c42895sm196311075e9.14.2026.01.29.03.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 03:35:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769686505; x=1770291305; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pC4vaBaGdBGxacndhuoO+54POr05bZJYxNH0VvqZF6E=; b=aDKnjwHNhkY0mqb7mMHCh0yKU5cOevz4VuqJ/P/5WbG4uFEbdemY5uX6sjo5kOV7xF BVLkzrhbGmUtwRCROsE11fKM907WlphTTmLXGv4ollhmAAPuTrtG1pGbze85C023WsQb MzV124bTIGzeZkcR+smApGNBnu1OcWOIxlB8TaJi7NJuVvAM3jX2YDB9ki8FB2zVo6un MlWT1Uer2/Pn2dnkFc4L/QYlAQ+qL1gV1eEY4Q7u4Gl5XE3mqzcV9sPW3EzmQtbHNpku XiGuj5ksNb5hO92egSb0MEmcid7qdeZLYui22QwRIEF1vjaWeQFmfzuuARCn5Nu8+1QA 2M0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769686505; x=1770291305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pC4vaBaGdBGxacndhuoO+54POr05bZJYxNH0VvqZF6E=; b=X99FJfBdhx2ioYZXAcRDBUtOb7yJcvLVN1CDT9X9yYQ/MTN4SByNRFMaTFvnqqynFs k/0yjArrcRmtqfW5AmTTLySvgbjmpWQkAb6Q7xqzytRsdEVFrmPdVpP4O1Zxdl12S6N8 iPxwVqesYEAIjXzROPCd/5A3ZlppwgufUclZQ7cY+k2Xpf/TYgwElHl6wEcGlolp3U5v SBsztDevkLbCjKCmXdeK1Z9NK56VjPUvs24StMLuQoz3o55pcXl6hBOjQmcbhGORLEnF oMdhYhtqJKtVzfYEzKGAzq5jUM4dc078vZGbHa+uSVN40VylM1D+5/Ulkak+BSF16wIO C5SQ== X-Forwarded-Encrypted: i=1; AJvYcCXWHBLvdbjPdQheU0RgzYqXifOhBgtYMSkL8yxnByq2/MY8PPwUB1ntqF6LQSIcIqBG0uIUiGAVyTgs@nongnu.org X-Gm-Message-State: AOJu0Yzm+v9DDwfyP178RNyb/WhOz555jeqrgMd2Y/Mqvdnf2T9x38nF IsaOPwrycNxG/3BODmcQgYEcnmRpBSx62HS8Re8Kv0KuQakst9C9SV7aWeekPtLB/10= X-Gm-Gg: AZuq6aI/y/R2Ye9jPRSzynb0p0kgtP9qNrDkyE5zzexMfkX6IBTTt/ApON4Ibb6W9e3 EYIzVpxzvz5MFqPbTG8cjLHf0iQdykaCivWS+rjTDy9JVfq9GWAnyxPMe6GcRPzP1ubGZomzFnB YpH+reOQuJdrHLwZlvHU+M3AqpSPIfnp9Ngb80fiJ/FKmMSTNOaYKb+ig/5BFRz3kTgErpE37vs 9O48pbopU/5NMLV0Hu/+IJtCGg3XuwOIDzrP8lnQapEdGUOmH3YYU4GVtIrYBqtxbt9XoRXK7Iq Dw27b5IOXgg289ofJuYoBGGDlwj8iJt7RhCTkbvdx2SuI4tGSrqPtuM4RCixzFC60tVFPUxIg5l MbEuFr5S03fRnXd6W99j5fafRwi/yjO8B+h6WywXIaaK/0tIRjJ9MP4+2YRUNhm2XkcnZSVPgTM IoxGzXq4CcGZ1jCAtF5QkDAjicm71MZw== X-Received: by 2002:a05:600c:3143:b0:47e:e2b8:66e6 with SMTP id 5b1f17b1804b1-480829b1c51mr37657985e9.14.1769686504640; Thu, 29 Jan 2026 03:35:04 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Richard Henderson , Manos Pitsidianakis Subject: [PATCH v2 6/6] target/arm: Permit configurations with SME but not SVE Date: Thu, 29 Jan 2026 11:34:55 +0000 Message-ID: <20260129113455.1283266-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260129113455.1283266-1-peter.maydell@linaro.org> References: <20260129113455.1283266-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769686620154154100 Content-Type: text/plain; charset="utf-8" In commit f7767ca30179 ("target/arm: Disable SME if SVE is disabled") we added code that forces SME to be disabled if SVE is disabled. This was something we did in the run-up to a release to avoid an assertion failure in smcr_write() if the user disabled SVE on the 'max' CPU without disabling SME also. Now that we have corrected the code so that it doesn't assert in an SME-without-SVE setup, we can let users select it. This effectively reverts f7767ca30179. Note that this now means that command lines like "-cpu max,sve=3Doff" which used to turn off SME and SVE will now give you a CPU with SME but not SVE. This is permitted by our loose "max can always give you extra stuff" rules, but may be unexpected to users. Mention this in the CPU property documentation. Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- docs/system/arm/cpu-features.rst | 10 ++++++++-- target/arm/cpu.c | 10 ---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-feature= s.rst index 37d5dfd15b..9d0c5731cc 100644 --- a/docs/system/arm/cpu-features.rst +++ b/docs/system/arm/cpu-features.rst @@ -318,12 +318,18 @@ SVE CPU Property Parsing Semantics provided an error will be generated. To avoid this error, one must enable at least one vector length prior to enabling SVE. =20 + 10) Disabling SVE does not automatically disable SME. If you want to + disable both you must use ``sve=3Doff,sme=3Doff``. In particular, + for the ``max`` CPU, ``sve=3Doff`` alone will give you a CPU with + SME only (and which therefore still has the SVE vector registers). + Most users will want to disable both at once. + SVE CPU Property Examples ------------------------- =20 - 1) Disable SVE:: + 1) Disable SVE and SME:: =20 - $ qemu-system-aarch64 -M virt -cpu max,sve=3Doff + $ qemu-system-aarch64 -M virt -cpu max,sve=3Doff,sme=3Doff =20 2) Implicitly enable all vector lengths for the ``max`` CPU type:: =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 6e1cbf3d61..1cb30076ad 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1571,16 +1571,6 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **= errp) return; } =20 - /* - * 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=3Doff then turn off SM= E 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_abo= rt); - } - arm_cpu_sme_finalize(cpu, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); --=20 2.43.0