Received: by 2002:a05:693c:2909:b0:17e:9665:bf4c with SMTP id rk9csp395600dyc; Thu, 3 Jul 2025 01:58:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVt0kneTg4HIVF6J5C/9rd83zfZG5PYpho/jl9Gna9OXxs5BgMyCSOEsmsJRzsl/5JfErvcecDF34mEPg==@linaro.org X-Google-Smtp-Source: AGHT+IGQTBsGPiAfyxhG659xzK+KNCJZIanCRI4/rn+H2kaMHPKXX+pJl2Ql4irnDAj+/0FKBDbM X-Received: by 2002:a05:622a:6a95:b0:4a9:8b58:6300 with SMTP id d75a77b69052e-4a98b5863a5mr12791421cf.16.1751533087769; Thu, 03 Jul 2025 01:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1751533087; cv=none; d=google.com; s=arc-20240605; b=S4XIkErr7WeXAgkDak9PwQWvZVJcfxGN9H/iOEBQCKfDZ7OUInsNX2x1sTJkkfIEzp 8fR/iKlhfftewd8d3oYstH4z2XRr0ILeP8+0foMto3JLlAWxRXtqrYOt27Mhjoc3GoES JcIA47IWRiIfbhLYMZt7L0tbPW4mOsK9bhfxT0IEbFJV/F6QGyx7BbqqJd3lPqgbgkrc rGzShwOrEbPJM/WSekTpeLTgDoE7JnkwXlEDSId9Bvl54uxBKd/RABQyLwIh4BYjYPYY //QvGY/jU7ev/9HPDQPpXPosv9XEpzxM2ZkidTlRDpnC9dCecEFncRyjjfiAnsjZLXwb d3zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=iyFUAaglgtudCcm/+GaLUiopNJBnEFOWo2eTOT6yB94=; fh=a3Jp/u9nNL12HtZcCfIITo0KzR1AaxbCeDuhQS55J3c=; b=f1DqkpUVyQY7XxCC3UtbmIjpnjkA0SSxeX7OIEWUkbh51bKDscRUsLCnBzQCYVhFZH 5DNAV6eo7cLmGA91RFKY9TfpjFJ6jckVWUFw9uAWe/P96l/IjzPH+tr/pkxaJDsjC7Fe cnGiGcSlhrvwmF7/ePwpB8IBpDRq1IGTKgWq6XzMx3dkCoeN7CGYoBf7Qg+P0QhYdVvu xRRQPcOW4jF1GpyDjdYEtgeMI7S/QJsB7n23LawLCeREImGIoJrAbo+iybLSlOmFK3j6 xAllv2Vrz2eN3WQPrxX8dTjEMuh3qo9EzFxZRarHcrHFWRE8M9dEirz0tqBFzmG2oGc7 r+gw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=e8VDtZbu; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4a7fc236d87si153480211cf.423.2025.07.03.01.58.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Jul 2025 01:58:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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=@gmail.com header.s=20230601 header.b=e8VDtZbu; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXFkr-0003Ye-7n; Thu, 03 Jul 2025 04:57:17 -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 1uXFkg-00038M-U9; Thu, 03 Jul 2025 04:57:08 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXFkf-0008GH-1Z; Thu, 03 Jul 2025 04:57:06 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-74af4af04fdso580193b3a.1; Thu, 03 Jul 2025 01:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751533022; x=1752137822; 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=iyFUAaglgtudCcm/+GaLUiopNJBnEFOWo2eTOT6yB94=; b=e8VDtZbuK3J8i1UDixoDdWwNAS1UKJjzZqLhTOwCFesXRtK9ueDgthkUTh+sg+GhUg brcvh+2tu6073O3wBbT1RoICNwWY/hTuiuWVX/lYAoxbEfR7wcZW1/VP6adWTmZcEbVh AGgi4aGTb0goYYgHF0kp8eC0UwzxzHjRiQrcFeJdUAYybv8dmTHoyZA+giYb1sEJRRL1 MCxSm+IGp09RHiiT77226ybf68FHLpb9zieNouehoHTJGM175/UU53FXhmwLK2HFnEGr rSV5qkZkcCTHqT6Y0NlBxoKxn+1tnJNRK+HswoDvkwTNdTM13Yzb143Ytu4S54+Ig9UH 9xAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751533022; x=1752137822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iyFUAaglgtudCcm/+GaLUiopNJBnEFOWo2eTOT6yB94=; b=Ke8K0DUdPSou9HheaqQJkXFbqBzRK0YylV/EkZUSTxuzJL7Wy50UlGkoLmspoTmr41 6mavKnU7dTATzQYlCrZnV77htOJCsD95j8MSErWkXZTt9znaJMx4Ii511F9sntnJKP47 fJwki1M/d48OqKb4af0K9/bGBcSzLjD9EI+iTmK60iN9j6rRKT8HJNgbxCRqViGUphZr pO/T/BsxDXpbf/pupB0QnMue9mrj3OcSIvhGe1jJKYo+QH5BSAe1Vvm5MZuBsrGyHkdj BPT8fEjvg5VKeCF1chO1aqj7EIz1V1Pb+JOHso6qcaVHr4XN8yTA0jWwnLKsVt6wtqos HQ0Q== X-Forwarded-Encrypted: i=1; AJvYcCVH7uZQkuOEkolY4k5nmHbjnjHR5K6ZfmvqMq3pcKjI+TnlJu6ORNayupMIvAJ1l33LB35Ljn3ifQ==@nongnu.org X-Gm-Message-State: AOJu0YxKdr03ic29qKkfNxj7uHO8BNqoGTGk9d6TBs/96v3CBv3D53l6 a/A6NK20FaTN3vQqRyfQ2n+fZpYDuu0/njqZCQtwqQYnMxL67aXWY+5ZK89jaJNK6GU= X-Gm-Gg: ASbGncstC5Oifm57euXZgmSHywtsSQHOaf0XE7vBHVaqnI48gmjiuhrrvoe7dcqVuVS OB5RviOl0eGaQSwOob3EWQAFLPIKUbyO6YHjZehY4vgE2Sd6GkGmgNaZUP9XbXlTHf4CrwNbsWz FDj7tELk6IuVhhIKya1PaIWj58w+ljmtTSLBbopIC3x1ByeK4msCAYUaEnf+uHDIzCbxwTAkudT 3orwhJ15DEpLWzR+XuegQBP+5awllG/JrZYwrChObsY/z4Puj+VSWJMxEHrECHz3wuLZMfYt5UG 4tTHdlHhiVDN0t05LU3vAYftOxilShOKEFKoG9P2EmjJIBjlBgGVtLfN28nIR2EK2NUDUxow7/I 8ZxzLze3Y7SG6fx5OoZd1PC9uU0twen2ZRrFfkbv+ftY= X-Received: by 2002:a05:6a21:999e:b0:1f3:3547:f21b with SMTP id adf61e73a8af0-22487aa74b0mr2219578637.5.1751533022148; Thu, 03 Jul 2025 01:57:02 -0700 (PDT) Received: from localhost (pa49-178-74-199.pa.nsw.optusnet.com.au. [49.178.74.199]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-74af55c6c67sm16731730b3a.110.2025.07.03.01.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jul 2025 01:57:01 -0700 (PDT) From: William Kosasih To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Richard Henderson , William Kosasih Subject: [PATCH v4 10/11] target/arm: Fix VST4 helper store alignment checks Date: Thu, 3 Jul 2025 18:26:03 +0930 Message-ID: <20250703085604.154449-11-kosasihwilliam4@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250703085604.154449-1-kosasihwilliam4@gmail.com> References: <20250703085604.154449-1-kosasihwilliam4@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=kosasihwilliam4@gmail.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 6zYFpPk04eeA This patch adds alignment checks in the store operations in the VST4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index 7473dfad2d..5273411389 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -577,6 +577,8 @@ DO_VLD2W(vld21w, 8, 12, 16, 20) uint16_t mask = mve_eci_mask(env); \ static const uint8_t off[4] = { O1, O2, O3, O4 }; \ uint32_t addr, data; \ + int mmu_idx = arm_to_core_mmu_idx(arm_mmu_idx(env)); \ + MemOpIdx oi = make_memop_idx(MO_TEUL | MO_ALIGN, mmu_idx); \ for (beat = 0; beat < 4; beat++, mask >>= 4) { \ if ((mask & 1) == 0) { \ /* ECI says skip this beat */ \ @@ -588,7 +590,7 @@ DO_VLD2W(vld21w, 8, 12, 16, 20) uint8_t *qd = (uint8_t *)aa32_vfp_qreg(env, qnidx + e); \ data = (data << 8) | qd[H1(off[beat])]; \ } \ - cpu_stl_le_data_ra(env, addr, data, GETPC()); \ + cpu_stl_mmu(env, addr, data, oi, GETPC()); \ } \ } @@ -602,6 +604,8 @@ DO_VLD2W(vld21w, 8, 12, 16, 20) uint32_t addr, data; \ int y; /* y counts 0 2 0 2 */ \ uint16_t *qd; \ + int mmu_idx = arm_to_core_mmu_idx(arm_mmu_idx(env)); \ + MemOpIdx oi = make_memop_idx(MO_TEUL | MO_ALIGN, mmu_idx); \ for (beat = 0, y = 0; beat < 4; beat++, mask >>= 4, y ^= 2) { \ if ((mask & 1) == 0) { \ /* ECI says skip this beat */ \ @@ -612,7 +616,7 @@ DO_VLD2W(vld21w, 8, 12, 16, 20) data = qd[H2(off[beat])]; \ qd = (uint16_t *)aa32_vfp_qreg(env, qnidx + y + 1); \ data |= qd[H2(off[beat])] << 16; \ - cpu_stl_le_data_ra(env, addr, data, GETPC()); \ + cpu_stl_mmu(env, addr, data, oi, GETPC()); \ } \ } @@ -626,6 +630,8 @@ DO_VLD2W(vld21w, 8, 12, 16, 20) uint32_t addr, data; \ uint32_t *qd; \ int y; \ + int mmu_idx = arm_to_core_mmu_idx(arm_mmu_idx(env)); \ + MemOpIdx oi = make_memop_idx(MO_TEUL | MO_ALIGN, mmu_idx); \ for (beat = 0; beat < 4; beat++, mask >>= 4) { \ if ((mask & 1) == 0) { \ /* ECI says skip this beat */ \ @@ -635,7 +641,7 @@ DO_VLD2W(vld21w, 8, 12, 16, 20) y = (beat + (O1 & 2)) & 3; \ qd = (uint32_t *)aa32_vfp_qreg(env, qnidx + y); \ data = qd[H4(off[beat] >> 2)]; \ - cpu_stl_le_data_ra(env, addr, data, GETPC()); \ + cpu_stl_mmu(env, addr, data, oi, GETPC()); \ } \ } -- 2.48.1