From patchwork Fri May 31 12:03:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 800522 Delivered-To: patch@linaro.org Received: by 2002:a5d:65c4:0:b0:35b:5a80:51b4 with SMTP id e4csp696199wrw; Fri, 31 May 2024 05:10:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVpShwapWHX7kEO027peCxIzJeHTVmzvtku/LszHFfRsze1CqL7c4pZBlZvs0P30LuXbx+VHCINlKFY81Hcsy7r X-Google-Smtp-Source: AGHT+IGI4ng5Gyz6PUIXmWDuLYEfySy8xs7IP7EzHGbC6nIIMOa6hwUPy0wS5q72dq5pwgGtWhsP X-Received: by 2002:a05:6808:3091:b0:3c9:713c:1269 with SMTP id 5614622812f47-3d1e3607601mr1832794b6e.38.1717157455377; Fri, 31 May 2024 05:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717157455; cv=none; d=google.com; s=arc-20160816; b=vHgTNxFXc88twq4peq4yJUtG8zWtinUjT6j+N/Rw7ymF6SKWdfX+wQh7t21LAj1pV1 Ff/FBa3AnXIHrLejb7W6HAkOL2F4XTUVaa2OFxgLagvFYCBdj4sUlTAOFeSVhSWLziDx KgBHjUiKAfDl131ED9X2OaPiL61p4klRJ+diLY3wBDnGGFUPkkYpUsoiPAxE/kx7xVvx E5UXDelWpbY5NjibzLrCRrKezUYq7Lz6kKzzqgKH5Q7Q0qTvez3xVpJqwpMdRnYjgvnp gwADwSaj45WMmsHgl5LxV+bjsg9+0QNizalOIKztCr7NLr0zb6P601WLnZgCga7SZOd8 otgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=edFpffT2hsSlEVOjiDyp2/AHPs7CCZ9Ib66cBmt6/t0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=gEgwvUniPr5/XoI8s1+8Tgk1zwSoGZaC+9G2b7tcwsEHFCT1mrdkzud2Xx8eogBW4H qSHPDCOwFT6r8kq8REHya3z/5Ir4Af9/MjfY/KuYrsqKWC2ACu20uKKjXMACmZ8Gh5AE ctD26zxk9sakkBn62Tq13UGic9XpnEoHW/P/PD9uXW/PKdpmRC47199DD1k2LAwyOpFc GTUBPf+VwBfHoV24Nw4PDBmHmugXfT2lZBpprrFUlBLzMHyjXI7L5KrDc7HrtWFIyvRO 4Aa+BcS+5uClcUcSyVmQcqJaRyuBRZn7z8rrr8oPdU6f8tYZv2xsOSu1Uy0qEGxH1bpy 45zA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kV4K/1HQ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b43da19si19154636d6.566.2024.05.31.05.10.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2024 05:10:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kV4K/1HQ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sD0zq-0004Rj-Eg; Fri, 31 May 2024 08:04:34 -0400 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 1sD0zc-0004KZ-GB for qemu-devel@nongnu.org; Fri, 31 May 2024 08:04:21 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sD0zV-0003PX-FU for qemu-devel@nongnu.org; Fri, 31 May 2024 08:04:19 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2e73359b8fbso26596891fa.2 for ; Fri, 31 May 2024 05:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717157050; x=1717761850; 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; bh=edFpffT2hsSlEVOjiDyp2/AHPs7CCZ9Ib66cBmt6/t0=; b=kV4K/1HQQ+DSRH0O6t9RUKGyuaKuomCWpdtVjjDo5hNWY68clM7A+FqJLyuh5fGBiY Ebjax6b3d/xf3/CRNtSHqmF8QRZtfCV/Ve3WXAuuRb50CMVTJfSQNYAi5rU7bGUBU3pM TR+IXHK/jC2xiFqle/PU3plDV6l/JLOztP4/7dhd3G46ExpypjQacsrgjrfOWqLfJ6Fi vRUOkdGxSni9h/q5TQ17Tit7aiiTLpMXkHXF7w0s1TaPKrFDf2OazQKh1O6fXAkTYuKr x3uBLTlAtGgvX1o+Z1Ea1Sn7pxHfYI7bgZrcXutuHXOR/LyezBUGQKJaYv7eojUjkep+ Jjaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717157050; x=1717761850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=edFpffT2hsSlEVOjiDyp2/AHPs7CCZ9Ib66cBmt6/t0=; b=VpyXfDeWGzEBAcFIejTarsqbCaRsQ7nlXBZ+kGhsRa+FJk9oZjzpRpqY+rgXaAkSjm 8i1J3Lq1/q3Sofgbfo0tYuTF3DEoKXSEJinoX5GXDjsEJ+DviXf26/utBSgMYjYOBOFI BZ60jTV/ObxxvigEB6yUf/K0tXWHugWmoCE6gi/fv7lS56/yIhCi4s4VekcR4tB4df5A r5lbR8k8xyZ4REVubm/2PhyAmmRuKZvCo2/ENGurnjKGULakYvDw5+xfURq6f9Y/z4F1 mbwcb+SQh1sJRjiRY1YIfpeJIgc0tizSIojRyc4Y7EQvzOxYlRSyKpfRQA7H6GDRuqWQ jpiw== X-Gm-Message-State: AOJu0Yy4hgmbGWV6r9Stg+zqROfuONmZ3WIe68yyssedmMAhadmqhfdv YAyClXaDV1Ur8DeMSuCetzLJ4Ua7laiEz2CcJ0tZufXIrwCAdp47eddCyi+/07hejjgIsxrt3g2 1 X-Received: by 2002:a2e:780a:0:b0:2e1:ae29:f28a with SMTP id 38308e7fff4ca-2ea951e4b00mr14103781fa.34.1717157048702; Fri, 31 May 2024 05:04:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42129de0cf9sm37027685e9.13.2024.05.31.05.04.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:04:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/43] target/arm: Assert oprsz in range when using vfp.qc Date: Fri, 31 May 2024 13:03:26 +0100 Message-Id: <20240531120401.394550-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531120401.394550-1-peter.maydell@linaro.org> References: <20240531120401.394550-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x234.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, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Suggested-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-id: 20240528203044.612851-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/gengvec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index bfe6885a018..3e2d3c21a13 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -29,6 +29,7 @@ static void gen_gvec_fn3_qc(uint32_t rd_ofs, uint32_t rn_ofs, uint32_t rm_ofs, { TCGv_ptr qc_ptr = tcg_temp_new_ptr(); + tcg_debug_assert(opr_sz <= sizeof_field(CPUARMState, vfp.qc)); tcg_gen_addi_ptr(qc_ptr, tcg_env, offsetof(CPUARMState, vfp.qc)); tcg_gen_gvec_3_ptr(rd_ofs, rn_ofs, rm_ofs, qc_ptr, opr_sz, max_sz, 0, fn); @@ -1255,6 +1256,8 @@ void gen_gvec_uqadd_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, .opt_opc = vecop_list, .vece = MO_64 }, }; + + tcg_debug_assert(opr_sz <= sizeof_field(CPUARMState, vfp.qc)); tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); } @@ -1297,6 +1300,8 @@ void gen_gvec_sqadd_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, .write_aofs = true, .vece = MO_64 }, }; + + tcg_debug_assert(opr_sz <= sizeof_field(CPUARMState, vfp.qc)); tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); } @@ -1339,6 +1344,8 @@ void gen_gvec_uqsub_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, .write_aofs = true, .vece = MO_64 }, }; + + tcg_debug_assert(opr_sz <= sizeof_field(CPUARMState, vfp.qc)); tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); } @@ -1381,6 +1388,8 @@ void gen_gvec_sqsub_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, .write_aofs = true, .vece = MO_64 }, }; + + tcg_debug_assert(opr_sz <= sizeof_field(CPUARMState, vfp.qc)); tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); }