From nobody Fri Aug 21 21:27:07 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=1787318793; cv=none; d=zohomail.com; s=zohoarc; b=aAHI5BHC2cfLi/pNOrQXwYbzxG/+LJo7Sw8WDqLX9hyOtbw61Bf8UALnpz4C3DygtWkCsMdCRmAXaASoNincwCG2iHEtTkuexHGh1/VtCXMNT0jKUNqH4udaLI1skT1Vp20PaPWwFauq0XXwyUpn1QSp3qWkFzoCCwZntiX6UxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787318793; h=Content-Transfer-Encoding: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:Cc; bh=p6lp+O4D/eE65qwxUb9w0dpA/8vp/oVveOpJwUREnbw=; b=KAdk/o4lYY53vboufrMDKOLHWHVfoXK+ohqMDlobqn6xq9cNTXmV2shhP6iUBMCPPePuXmURG+OVDje48o7qx/1HvxVVP03vupm8vDEXRri9xlbTbaNAqjZLxj7SXKEfBFFL0Cwzj0nhox5cU2uAmvcG9WUIVP0vrov6tJD4ZLw= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1787318793412660.1588737497949; Fri, 21 Aug 2026 06:26:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wxPFx-00023V-NJ; Fri, 21 Aug 2026 09:26:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wxPFw-00022p-Du for qemu-devel@nongnu.org; Fri, 21 Aug 2026 09:26:00 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wxPFu-0006Ow-Rn for qemu-devel@nongnu.org; Fri, 21 Aug 2026 09:26:00 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-495590dde14so8831635e9.0 for ; Fri, 21 Aug 2026 06:25:58 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1450e54sm18770327f8f.11.2026.08.21.06.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 06:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1787318757; x=1787923557; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=p6lp+O4D/eE65qwxUb9w0dpA/8vp/oVveOpJwUREnbw=; b=eMabaMLj0xnnWMd6467caD9SyPUTYJ+9X1eXy9V0p735CnMS6308ITasLNt2iFqMYD dZHTDvJsEYrV/khY+Ac90OMbALcgAJjTxgeR8QKjtWNYANkMLGwW8b/NcMHR+ndo+z1N D+eZROF+CHs5uete21cYjyyUaV70tUfjfdz6gMMEoE4deSEfbpa4VaPOD0WL+OcOq9Gb CZKBh43XWbMvJ9LUBjyykf8PavSqUx07ATBNDL0846zU+2HzsxpTQps0m0bhFjBqEQMf R7pjxtU6l9DjyfyYSGTclOCk6wIhunkhA1yKtneVIoQez6jl88Xrpc6QpNv/NbcSkig3 XCkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787318757; x=1787923557; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=p6lp+O4D/eE65qwxUb9w0dpA/8vp/oVveOpJwUREnbw=; b=hK05rTs+NP+CCt0nZvjCL0RaCXCPqf5KXjhcCh7d5ynnVMrhJ11kLaUJo2DWu68obm B4KQsMSuByIyg/8VfLAyI1CGehhebOSk1rNEUrjMLMVpBoWQrTwo2at1DMa4QfwTDlmj h2rHHra/od/phdfaQLrWFd8Jvdu2Pj5K3llF2bEUL5zygmIaCWAd5VaxaXJXpNmCl+wo Kvzs7umxELvGYbw7Lzyv0OR6L8fFIK9U/6MIdzScRc5pk0BzLDuGHRuD2T1p3OEUkA2r +bA1A6bkeHib5Q0yzl4H4pe3bowGtya6WGYerCsZI+RNy8KUepo09Ht0NHKEGQqmPCpL lgnQ== X-Forwarded-Encrypted: i=1; AHgh+RrTTWs6W/4oDk+o50uOaRJjrLGNulVV2VlpAid+3riBdfLHuov/ah2w3Ck3tfGioNabSygO53wLjpYY@nongnu.org X-Gm-Message-State: AOJu0Ywyh2GFbSY7Qi+US3Jg16nrwCG3+hwot9QBDl05H3H6iT9fDnao zebof+r6GMRRBbH8SIs83c3FgRaFqMAc/eb0Yk0QE8sRlr7dBZTUhPxjbmSbLAwBWog= X-Gm-Gg: AR+sD10E8fwDFEu1cVRZ+t9GPtp5UkjsBAhXahBJwuCbLFZ13av3Y1L2n9dzsQXud0T /deoNQ6f5k5H3SuJ8WdzCcAW+k2OKX57J40Ajb8NtAYriNmGbTCWfydZWxEEc1vpoyyASm6Yh8K S7e1RoinTKIFFrDazkxWLvna2FYmIyQ6ZGDgvi6pWLoJ5BQK26vQbE/Ae6US1VAVXoIIx0srJ/V ZTSLbLtIUZ6/unys06+Uo9xo4TjgYfPa0xkhGPQJBvZCVDLyNvanpH25KAXb2DwZ2XImwAfryXN /XsAgzx5NxScCHGjbvi2PqUoHeElRurZXca08EUNn7Y8HbMUsy2rRaer4/fR9GxeSd7d5Gh4Gjt 2VVlN78yWrKy/EGnWFyy9I0B4YS2aQSOYFk+ak5c1/3UeJ6UJBCOWQ+CztdO5mmAhbGmM/k5aGr LoYCSRjUSmJ8vXV7F6w+bHEDsSHDuhVxo9/dxwj4NPZU9ydbFV7NE8EJUm+2CBrE8pEl/DvtGGP FRIUIWdcZePgIJFvL2zCV8ybqGtrgUJ34lr3gNWhK3mblAtUNwYGDJr34oYdzjQpSPexA== X-Received: by 2002:a05:600c:c168:b0:499:7024:9d4a with SMTP id 5b1f17b1804b1-499b8327af5mr109630155e9.8.1787318757213; Fri, 21 Aug 2026 06:25:57 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/3] target/arm: Make CBZ/CBNZ UNDEF before v6T2 Date: Fri, 21 Aug 2026 14:25:48 +0100 Message-ID: <20260821132550.168896-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260821132550.168896-1-peter.maydell@linaro.org> References: <20260821132550.168896-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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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: 1787318795761158500 Content-Type: text/plain; charset="utf-8" The Thumb CBZ/CBNZ encodings are only introduced in v6T2 (for A-profile) and v7M (for M-profile). We missed out the feature-check in trans_CBZ(), so don't UNDEF on v5T or v6M. Add the missing check: conveniently, the ARM_FEATURE_THUMB2 feature is true for exactly the cases where CBZ is implemented. Cc: qemu-stable@nongnu.org Fixes: 9ee6e8bb853bde ("ARMv7 support.") Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/translate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 055f3c5b403..df98dc2e34d 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -5783,7 +5783,14 @@ static bool trans_TBH(DisasContext *s, arg_tbranch *= a) =20 static bool trans_CBZ(DisasContext *s, arg_CBZ *a) { - TCGv_i32 tmp =3D load_reg(s, a->rn); + TCGv_i32 tmp; + + /* CBZ was introduced in v6T2 and v7M */ + if (!arm_dc_feature(s, ARM_FEATURE_THUMB2)) { + return false; + } + + tmp =3D load_reg(s, a->rn); =20 arm_gen_condlabel(s); tcg_gen_brcondi_i32(a->nz ? TCG_COND_EQ : TCG_COND_NE, --=20 2.43.0 From nobody Fri Aug 21 21:27:07 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=1787318811; cv=none; d=zohomail.com; s=zohoarc; b=LLdoT1E4vM1q/OTptZ+xDkIXyy9+vOnHz//FxvT6WOelagQZXL7lRpFVnNpSDORstBTNP6NyYtyAW89J/uYx3EiKnYggIOiMzR5SGDhvEJQN5B2Q6vkvF5xdQD39eWlemUBGlRd7Sy7NtYmJRqsCnDDbgZ7emi9AFcsYF4mfpzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787318811; h=Content-Transfer-Encoding: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:Cc; bh=I0h9mD58WMwK8xuh3O68ZsPFvMRWW43LjfznY7PTEQE=; b=lfcEEmY/I2tK4Mn68WNr2h+rP2DOZSHQCyc+OpfLVHnVeW4E7OsOdgXRSGLjxwYBG5FVDvmM6JRKBvS205XwxsVwvrD2PcgHgrm/Uq/wankDcltCjqaoK+3S6NCy7wmMjfBEIoL9NdaP9lGLl4EEY3jnjNaWS7H7akM6Ac4zULg= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17873188111041007.562218128295; Fri, 21 Aug 2026 06:26:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wxPG1-00024k-40; Fri, 21 Aug 2026 09:26:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wxPFz-00024G-Fx for qemu-devel@nongnu.org; Fri, 21 Aug 2026 09:26:03 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wxPFx-0006Pb-Rq for qemu-devel@nongnu.org; Fri, 21 Aug 2026 09:26:03 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-47f703a9d05so603791f8f.0 for ; Fri, 21 Aug 2026 06:26:01 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1450e54sm18770327f8f.11.2026.08.21.06.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 06:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1787318760; x=1787923560; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=I0h9mD58WMwK8xuh3O68ZsPFvMRWW43LjfznY7PTEQE=; b=LsMquxZCJAEbFBdfWqF2NQKmKhC3vZkn0ZctQxgvKajzKSU958uKr6iDvIcCM0cUjN TCPmaZuLUp0WwEdmdeuwZR9MTkNXT60h+E9iwqXPBwuAGneSrTqB3fGKheZg2mfq0kYM xdI+uJ0ZwuemNQjkNGUBVeHjol7T2EUvCH3RW8qxC9hfW+6DPvY3e/EmhmwHT8Oc555d jj9Q8W9t6tv2erG7AW/Lxg31sWPWvY7EcOdK3GIYa/ZMI9trncMpWjqiad1VhTlq7Oay K/9XT7E3a02W5iD0IHk4RPQVSPaQj0sxTqDMgFzWEtCZX/J6YamHnK+E6g68kz/BZcDS e1rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787318760; x=1787923560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=I0h9mD58WMwK8xuh3O68ZsPFvMRWW43LjfznY7PTEQE=; b=Vlrl8jZJTcUQ0bKpfoEtGH88ZUOcjIqagq472aYqVZnI+VfhVqPmGjyzwmCs2NmEOY Ra95XtrAqv/kOgMJzdF6oc2bERbJmdEhZ0xDTycC/t2ZIGMRV3FeWKZWWy0t3eHozOaG 5t0YbeYRoEM5l/Foen1BkCx9W+yGlzxjZZI6AJJRd/AHGvNMGcBITw7gVrq0utLe4C9I Z1TA+D50ZpMS6jJM1Ua6XxZ2q9f2G0140hc2TBl46IsT3F7hSs3oYdujp5PS7E5qbLee 34IURZYDPtgMG5N8to+t7a7HJyBBu66GumeWq7f3gKT2f4WrQ44IwvOP0LUyO/Gh/wzA lsjg== X-Forwarded-Encrypted: i=1; AHgh+Rp5B2MBQwMnupSfZSm/a01aiJGvombsy/bU0Z06GK1lRtOf6HAZ8KzpyUbwqXPO+NgRWlXCNJwGXxZH@nongnu.org X-Gm-Message-State: AFuF++kpJIYLuxXD0nvmf9QmE6fjuSe4jXs3yotGwK3McSgckd/y8tIg XsXSY7nvfT6V/9N/d27ni76MZ8Rw3dQDmlGNoe8ZPoVjC0BnKAFRVxC2knBGgEKaQ9gBP4qBEB4 xvN2eELE= X-Gm-Gg: AR+sD11Dth5ay/Fi/mnQh5beHEZAO6XFfFF1AhLdU4JRJ1eQpZ8geq1yRiSBQdKAGHJ E/KxCshSIiq7DagHGueEKRml3fdqjkOHrMnHoxS6y0mIc7ATk4xeOler3Hryzdo/qlR7B1ff0XS A4xcTiOEuLx9PTMS07rAkAHWG95GpHS4zWmWl/fexNrOYRJ53OXSfJsiVVyMcveIWAeLeVdsX4d 74MhVYqYSG16N1zyjzjOixRcqgDdS59Uv5TZRvETpxANeJcdw5li5tGWWIm9MU0DHJQgl1daIN1 wXpi/+e9h9TH9OhThq11eXJGmCEcSk3roxdi78qIC63MUfHCFNUhPfKNBvc5M7EYNlNLAYQJ4EN bpN3LQydCZ3bbdKyliqkKS6c+mEI9vdRkZtvJtQ2Lg0vhk1u1PGZtyNQxPblnbQU7d05kQ8W37w Ansj2zJV5oK79MWEdJD4cJKFf8FdFv9pdM18vuIY+5pB5xSA2qbKclcTkqV4cgVw3wHMAXRwI46 96EC1kPyWi0ev44+WkBuzpOwkyRwhaxNq0gRgeWY1pFO9e+YHHN0aerk95l4sRV02GeRg== X-Received: by 2002:a05:6000:4811:b0:47f:8fc8:a8b1 with SMTP id ffacd0b85a97d-482c0b9b22dmr10710256f8f.14.1787318760304; Fri, 21 Aug 2026 06:26:00 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/3] target/arm: Make IT insn undef when not present Date: Fri, 21 Aug 2026 14:25:49 +0100 Message-ID: <20260821132550.168896-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260821132550.168896-1-peter.maydell@linaro.org> References: <20260821132550.168896-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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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: 1787318813011158500 Content-Type: text/plain; charset="utf-8" The IT insn is introduced for A-profile starting in v6T2; for M-profile it is present when the Main Extension is implemented (which includes v7M and excludes v6M). We were missing the feature-check, so fail to UNDEF on earlier cores. Add the missing check. Cc: qemu-stable@nongnu.org Fixes: 9ee6e8bb853bde ("ARMv7 support.") Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/translate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index df98dc2e34d..103e2fe7c73 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -6038,6 +6038,16 @@ static bool trans_IT(DisasContext *s, arg_IT *a) { int cond_mask =3D a->cond_mask; =20 + /* + * IT insn introduced in v6T2 for A-profile; it is only present + * on M-profile if the Main Extension is implemented. + */ + if (!arm_dc_feature(s, ARM_FEATURE_THUMB2) || + (arm_dc_feature(s, ARM_FEATURE_M) && + !arm_dc_feature(s, ARM_FEATURE_M_MAIN))) { + return false; + } + /* * No actual code generated for this insn, just setup state. * --=20 2.43.0 From nobody Fri Aug 21 21:27:07 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=1787318793; cv=none; d=zohomail.com; s=zohoarc; b=FwmTfQmzi1tQcbWCJABSe7AgEavUWUoYh8Dr0L9A83VqKcj8hH6WbxgvrJ5ZNaaptV4oK+t1+gFJ1TMG1DoMP5lHekiz+3M2pj+Lo9z3oDdTK+yeEzzjOogGECGohQY4bCVGRLvGjnTZejiqckm2fSchrwGqf5/RPXdhh2azLYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787318793; h=Content-Transfer-Encoding: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:Cc; bh=2alkrNBhAO1wnw1fFIL9osRmaaFocWT88WNJqpH93Ps=; b=S9rsQXWbz4daIfEWJwHK39UePsFIBXuw0Tw/hYbPD39cgLnu21g1/l2xq98aOZJjqQC7qCBozFklg2Onr86JDiVSWaBLuhrAF/awk4a7YjoUvZFjj6oMDWPW3qqL4ENgQzuvYcH0XXrQDycL0S0mCb4lHs4GwxO0940j9mFjF3I= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1787318793364948.7301111020458; Fri, 21 Aug 2026 06:26:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wxPG2-00025i-EI; Fri, 21 Aug 2026 09:26:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wxPG1-00024h-1e for qemu-devel@nongnu.org; Fri, 21 Aug 2026 09:26:05 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wxPFz-0006Q3-0E for qemu-devel@nongnu.org; Fri, 21 Aug 2026 09:26:04 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-47f3b39f2a1so817684f8f.2 for ; Fri, 21 Aug 2026 06:26:02 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1450e54sm18770327f8f.11.2026.08.21.06.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 06:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1787318761; x=1787923561; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=2alkrNBhAO1wnw1fFIL9osRmaaFocWT88WNJqpH93Ps=; b=dI5mT2WJaWc0pvL1aQ19pOtZD8PGBqill/UXeK9aCohosTec78z+HlozxMNxAFZy5J 8OgxuDchZ/ZImPkBUXydwy5Uuy0eJmqGuj+C5KaPFvW2t4D3i/WZ1SyzMd09IU+kd6FZ SIkLWgCMiHaj4inRcnj8xkTtk14TXjJhTg8hp8JFgFbK7eDawWsU3K+TA96akMJXxGu+ 3Sy2B/+jkX4rChz5wz1YsLBfTPzivoCfOPAho0r3MECpSWBKjzwmrCa/MCb3S5lMIfPa qniryt92XMxErqd2eutvSGjymhhGPCcqE75S/K5MvZ+RUpgalchN8D8OpSio7ULZtCaj zGWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787318761; x=1787923561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=2alkrNBhAO1wnw1fFIL9osRmaaFocWT88WNJqpH93Ps=; b=nXJszNLNKd22vzLn56qt/7CZDcFE2RNKflUK9QP7v2NHnOP+IRbP9ot6mG2QQQFn2g 3/G629zoHzh7bGgqpEvSg+7TxD30H2igJYGGzt4hwog/6ERDZ7pGQAlxXusPB9IP1FB1 cDkLZEKBmlZXGdMdbLprOPn+U6MPewv6vxg22ctmueJpCOMUC4FBg38v+LSk9r0UE723 WeWXzksf2FPiqckdb/7ez21+M111X0rRCArxohBwCEx7F0Kthld3gbIp1rmdPiZMjePh vRx9WrIxwVEYrMY3p42TKRV9SzfEAVIOSa2ryosdKjCeQunju5foFWuj8P7DT5AQ7mw3 3H7w== X-Forwarded-Encrypted: i=1; AHgh+RrwV8tdM0SCcGU7fxw1ot5fPEMs4uGL5d1yStpNs4eTrwp2po6E+BOvgonwQe8nDFQyC+Uz4YgWOmng@nongnu.org X-Gm-Message-State: AFuF++lREGLeAIrEpw5CkYTqlfZQUgFLxhBa1c3pSmM0pwGf4RaGv+kV swM27+VlJfaC6SyYaN8hkL+zIfB+Nc026fbHhE94qj3BD4pM9qmIlzU9z3qaT7DIe1Bm17ePbyn NwAZcyaI= X-Gm-Gg: AR+sD13EenPkZlzsg4BdudkdI9JLsYTH9+/IJZb3kdgkDLCV//Zyfa22NmKnqPF0sC8 ZYyaRMOOIvahWPeVVH/kijm8b54CUf5p+K0WyYMFMchyqG1lyetGWSEOginH2v+PCwTw+ZEzD2S CS/ndjl2Qhx3RqnfpcRCRgR6fbhRQMQMX+B5IrMvQVNUFFhDPpwvaBm/my4IKt6bDzlQUNB3VH5 DeuUQPIGWvL0zq6KKFo43lJkeL52y83ipJorRT73HKxEwk9eQLzAxrjA1xJXh5H36/CDMqaGd8Z KotPLl24+ArtGbFKxQhZpb8Y0lad7pOH2/kDJtnO371EqD0xUM7KMJyQ1vzPpCPzY9/rvGXa2BB ilBsVmWQLl/nN1aDU/hApmLnqYrZBOmTfJb6SYj/NeV7ZGE6mnvMLG8o1Vn3gCgXbvydxorbX7Y P3/z3R0nEVG74s6gJwuKZI12wSnXkhm2T602dy2D/YS5nMHHPbCA2LqjdngRsTs2d1qqt9Kb9Cn YtwBIDmuF2kfY98kpjJkrlfT7o3zZAXh/+N4TVO8QFQkQZ9lP30PYmTzc1uQGfo3hpxMrN8XzGw G1oT X-Received: by 2002:a5d:64cd:0:b0:47f:51bc:efe2 with SMTP id ffacd0b85a97d-482c0b95d85mr10259274f8f.11.1787318761395; Fri, 21 Aug 2026 06:26:01 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/3] target/arm: Make Thumb T1 hint space UNDEF before v6T2 Date: Fri, 21 Aug 2026 14:25:50 +0100 Message-ID: <20260821132550.168896-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260821132550.168896-1-peter.maydell@linaro.org> References: <20260821132550.168896-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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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: 1787318795340158500 Content-Type: text/plain; charset="utf-8" The "hint space" is a region of the encoding space which is defined to NOP if not specified as an architected instruction, so that future instructions can be added there which fall back to NOPs on older CPUs. In the A32 encoding, this hint space was carved out of the MSR (imm) insn by using the fact that a field_mask (bits [19:15]) of 0b0000 meant that an MSR (imm) would set no parts of the CPSR from the immediate, so it was always NOP on existing CPUs. For the T1 encoding, the hint space is in a range that used to UNDEF in Armv5, and so the hint insns and the NOP region must all UNDEF before v6T2. Rather than putting this check in the trans functions for each hint insn and for the NOP space (which is a lot of places, and awkward since those trans functions are often shared with the A64 and A32 encodings), put in a decode line that covers the whole space which we check before any of the hints and which will explicitly UNDEF if necessary. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4208 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/t16.decode | 3 +++ target/arm/tcg/translate.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/target/arm/tcg/t16.decode b/target/arm/tcg/t16.decode index 9a8f89538ac..43cd36e949c 100644 --- a/target/arm/tcg/t16.decode +++ b/target/arm/tcg/t16.decode @@ -224,6 +224,9 @@ REVSH 1011 1010 11 ... ... @rdm =20 { { + # Before v6T2 this was not NOP space and must UNDEF + MAYBE_UNDEF_T1_HINT 1011 1111 ---- 0000 + YIELD 1011 1111 0001 0000 WFE 1011 1111 0010 0000 WFI 1011 1111 0011 0000 diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 103e2fe7c73..e889c6c6136 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -3339,6 +3339,24 @@ static bool trans_NOP(DisasContext *s, arg_NOP *a) return true; } =20 +static bool trans_MAYBE_UNDEF_T1_HINT(DisasContext *s, + arg_MAYBE_UNDEF_T1_HINT *a) +{ + /* + * The Thumb T1 encoding hint space was only defined starting + * in v6T2 for A-profile. For M-profile it always exists, even + * in v6M. + */ + if (arm_dc_feature(s, ARM_FEATURE_M) || + arm_dc_feature(s, ARM_FEATURE_THUMB2)) { + /* Allow decode to fall through to the hint insns and NOP space */ + return false; + } + /* On the earlier cores, we must UNDEF */ + unallocated_encoding(s); + return true; +} + static bool trans_MSR_imm(DisasContext *s, arg_MSR_imm *a) { uint32_t val =3D ror32(a->imm, a->rot * 2); --=20 2.43.0