From patchwork Thu May 25 23:25:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 685645 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp623545wrt; Thu, 25 May 2023 16:29:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Ix81QeCfrBQUm1cuOKX7vpazdU0P4vsoymz1b6/ArZGjVL9lSUSE7IVpMqRfX8dVOaxlM X-Received: by 2002:a05:620a:408b:b0:75b:23a1:834c with SMTP id f11-20020a05620a408b00b0075b23a1834cmr422289qko.71.1685057346447; Thu, 25 May 2023 16:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685057346; cv=none; d=google.com; s=arc-20160816; b=dFU8WFxtuk8XUKEsmBBqNph9BZXLVNOLjMHkWsUjwSygbAjUmfbiZ9F3yk6QpcH8Hg ZJNSTlG7q2UXpkUpHohmdbHHA7QBzbe/N3P09bMUsFj3xV6tli21T59zKWgw1IK171eC TAtVSPsZk80l1uhljydVH2siWJ5Xxe4T1FXUhjecoem4mAgUrd8AKDFL5JUM0poCM0cz W+5eX2fLduP88gsRA6Z9c6Y8+kWkQDJd4e9pIgPmmHN695kiIivPZrAxNZ2V0EGAHIFy oUYlBsDxXGhCsXUySOelcf+5/y+XO49PXkCdwnbCVpKVqynYBG7YWKxGRfHe+SgSgwc6 Vm/Q== 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:cc:to :from:dkim-signature; bh=QJBfhL5s/JujOKO92cVuqA077g93rVli8DiADyiaM+o=; b=tZOSRsDwNm2x4Kwg//Q0l1V7DIMSKNYS4EIyOkLX+y4HZfABoux2QOCdaNYJI0aLBf hrwVpcbhIY0GY/RXZqizHSfWMyJrP+zGRdk7/UM+J94kCP6+YVgSqp8PR37sWvIJYVwc awO61VzNOUdZjqV1nfowO/FDKNmov7wIR300RfE5Y/1EGHL2kT98FW31OwSQImHccOuB OTpGDIZVvNN+SirnKZ3BVLnZ86WYSjCTC0MM9/hE2t6N7FYYXuVIkryRDs1J1obtnvvc w51kdZ0UTe28P92LgFFNhFzmpnGttC6iD/0/QGq8u4mjVDl/xYa0+bzkgAJqfxi1J6wt dCog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A5hvo23g; 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 jm5-20020ad45ec5000000b006253099010asi914197qvb.588.2023.05.25.16.29.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 May 2023 16:29:06 -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=A5hvo23g; 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 1q2KLZ-0005qb-8y; Thu, 25 May 2023 19:26: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 1q2KLR-0005mg-Jl for qemu-devel@nongnu.org; Thu, 25 May 2023 19:26:12 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2KLO-0005lq-L8 for qemu-devel@nongnu.org; Thu, 25 May 2023 19:26:08 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-64d604cc0aaso262797b3a.2 for ; Thu, 25 May 2023 16:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685057164; x=1687649164; 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=QJBfhL5s/JujOKO92cVuqA077g93rVli8DiADyiaM+o=; b=A5hvo23gwC8j+XKAUw2mNHEBSYX+NlpEgOv6/2UzF82T7wc6+/iPrcpetNllUrS4hs Na5TX/jjAobW1W5F8l5XKWRyKfUisbP4LI3GKQ5AX/tS/HaeBZQmoNRK6WYcJsnlDC6n d+Wddaiue+RdosErOmzDA/gNYkq2t0n+a/fIiZmoED0ML81NeKHcbCnjaQEDgm6wsZok ygXE/yPyTocEu7Cy/RegdyczI1S7crDdlRO6II/5/3K+ZFn+otSXcOlxhpz1dauJBroy 4/yFCIjmyclkWySVGLnobllIi51nIwn9jAYWlTJWxeM/q8sG/izfM+EEoPZhTW23DvXn rXmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685057164; x=1687649164; 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=QJBfhL5s/JujOKO92cVuqA077g93rVli8DiADyiaM+o=; b=JawPNNKQ/jyZIpKWwGJYVPi16qBHbY/WcwZLoNOI5JWR5OWeWnUuSEF+N+VC2xx7nx AfVFF/KDAtva/6fuuIR9MlObtFJJWJnaq8Wfv3l2BX5DHagfm05NPzZ8OCNJnCz/KJBK vrrdmcIBeq+bD58AVecPeBpVwc0kk5Ixvb+QDKPKOJ5k2TgtMsPQnkeKXTZTW5K2xHaj HpZJpm0ihyiYNTlKOdVQzg5dHUEiOaBOGBLxoNuVtog0XrikL6sT4UkUPpSCmqfT2QGr yd3vEeGGurVKoLWMRUm8UNPQbF1KsOp1lXPgi6tUTPBDbuZJOatdJk9t554jn4Ivlq94 egrQ== X-Gm-Message-State: AC+VfDyyA9kBDBum3CexUuSbZihf6Pl0+iapdIxFGkJknIAznlb3VTgU hIvZa0g8zTAtD0FYNspEHclZCmGEAUPnpJ9SVJg= X-Received: by 2002:a05:6a20:8f14:b0:10b:27d0:70cc with SMTP id b20-20020a056a208f1400b0010b27d070ccmr21617096pzk.20.1685057164437; Thu, 25 May 2023 16:26:04 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:7ac5:31cc:3997:3a16]) by smtp.gmail.com with ESMTPSA id s15-20020a170902ea0f00b0019e60c645b1sm1885036plg.305.2023.05.25.16.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 16:26:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v2 06/20] target/arm: Use tcg_gen_qemu_st_i128 for STZG, STZ2G Date: Thu, 25 May 2023 16:25:44 -0700 Message-Id: <20230525232558.1758967-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230525232558.1758967-1-richard.henderson@linaro.org> References: <20230525232558.1758967-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 This fixes a bug in that these two insns should have been using atomic 16-byte stores, since MTE is ARMv8.5 and LSE2 is mandatory from ARMv8.4. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 6bb68618a0..51f9d227e7 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -4070,15 +4070,18 @@ static void disas_ldst_tag(DisasContext *s, uint32_t insn) if (is_zero) { TCGv_i64 clean_addr = clean_data_tbi(s, addr); - TCGv_i64 tcg_zero = tcg_constant_i64(0); + TCGv_i64 zero64 = tcg_constant_i64(0); + TCGv_i128 zero128 = tcg_temp_new_i128(); int mem_index = get_mem_index(s); - int i, n = (1 + is_pair) << LOG2_TAG_GRANULE; + MemOp mop = finalize_memop(s, MO_128 | MO_ALIGN); - tcg_gen_qemu_st_i64(tcg_zero, clean_addr, mem_index, - MO_UQ | MO_ALIGN_16); - for (i = 8; i < n; i += 8) { - tcg_gen_addi_i64(clean_addr, clean_addr, 8); - tcg_gen_qemu_st_i64(tcg_zero, clean_addr, mem_index, MO_UQ); + tcg_gen_concat_i64_i128(zero128, zero64, zero64); + + /* This is 1 or 2 atomic 16-byte operations. */ + tcg_gen_qemu_st_i128(zero128, clean_addr, mem_index, mop); + if (is_pair) { + tcg_gen_addi_i64(clean_addr, clean_addr, 16); + tcg_gen_qemu_st_i128(zero128, clean_addr, mem_index, mop); } }