From patchwork Sun Dec 18 09:29:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zenghui Yu X-Patchwork-Id: 34301 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1858659wrn; Sun, 18 Dec 2022 02:01:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf48l/TT1bfNAMRRE8wgr207v484FIStde6ztalj5WnSr47ea95dhjPyq485QD1OouwXW1IE X-Received: by 2002:a17:906:2b46:b0:7c1:bb5:5704 with SMTP id b6-20020a1709062b4600b007c10bb55704mr32220922ejg.26.1671357676108; Sun, 18 Dec 2022 02:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671357676; cv=none; d=google.com; s=arc-20160816; b=MtuZF2Gko4dOqdwGd4ht4Gl+1SRtdjwN6H/mEdbLqErKTIfL7+hUkcgT6c+i6KDECU htczicXiVoY2Es2psATj+RXobPS31VJeRgTeIb6ClGP2xZriWecdQMoH2406Ak0vIujJ QFLuhYtfC2RKuJsyQZwlu+xC9lHDTdg4iSyduHBkQueSFEbvJjWVtMYeI7g5edx0Pr41 FtLpNbmc1IH7lSC77JqrMYaeCwvp8MwC21c6IR36pqscbKi8rhDsNkmU4sOgxJkC0ERJ YC6jXsGWshQgyZCZhM/vzj4j5ea+gUHyJEe6hlBrQX3iTBaHoUGW8fOHVwx1d8jmmUSV relQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DdnZzD5v9px5VNPOf6/zm+KsOUVYKv3iHzB3BMk6h5M=; b=TW8hZ35elnmYZeUQpHU0qaeFlbbUENj+CPsaPhB0ageZYrAyHTv0PyoWs1v1Zxu/iE ZyQaf3eM0lirsOvulWJGelRQ13HB9lnhEVAXZnAtfKWb51ItLotzuGveOFSaJHeRN1ZX lml7Z7orrWs27rNm63/SKJfx2WIV9VUIriLwqAFw2Q08tpBc6O39009ZkKXu/FyQad+8 9Os6g1d9SXB1M4wt4EvRiVXtYrhhP8MNEAzN4iPqOW2nHUEhT8iYjrK2Vb+Wzhuv2qdJ d68m2me9WFnG4gH0tXO95toZSz8SmX6lnIVDC17Aioa/fpr82kV1ZJvpAITqc9xrAPJW MmYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz4-20020a170906f2c400b0078d93245e23si5458974ejb.791.2022.12.18.02.00.42; Sun, 18 Dec 2022 02:01:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbiLRJ36 (ORCPT + 99 others); Sun, 18 Dec 2022 04:29:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbiLRJ3z (ORCPT ); Sun, 18 Dec 2022 04:29:55 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E35EDE87; Sun, 18 Dec 2022 01:29:54 -0800 (PST) Received: from kwepemm600007.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NZcwJ43lXzmWMl; Sun, 18 Dec 2022 17:28:48 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.174.185.179) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sun, 18 Dec 2022 17:29:51 +0800 From: Zenghui Yu To: , , CC: , , , , , Zenghui Yu Subject: [PATCH 2/2] kselftest/arm64: Correct buffer size for SME ZA storage Date: Sun, 18 Dec 2022 17:29:42 +0800 Message-ID: <20221218092942.1940-2-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 In-Reply-To: <20221218092942.1940-1-yuzenghui@huawei.com> References: <20221218092942.1940-1-yuzenghui@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.185.179] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600007.china.huawei.com (7.193.23.208) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752545546840580065?= X-GMAIL-MSGID: =?utf-8?q?1752545546840580065?= It looks like a copy-paste error to describe the ZA buffer size using (the number of P registers * the maximum size of a Z register). This doesn't have practical impact though as we're always allocating enough space even for the architectural maximum ZA storage, with SVL equals to 2048 bits. Switch to use ZA_SIG_REGS_SIZE(SVE_VQ_MAX). setup_za() will need to initialize two 64MB arraies with this change and can be optimized later (if someone complain). Signed-off-by: Zenghui Yu Reviewed-by: Mark Brown --- tools/testing/selftests/arm64/abi/syscall-abi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/abi/syscall-abi.c b/tools/testing/selftests/arm64/abi/syscall-abi.c index 24a498029c78..4adeb21f500e 100644 --- a/tools/testing/selftests/arm64/abi/syscall-abi.c +++ b/tools/testing/selftests/arm64/abi/syscall-abi.c @@ -282,8 +282,8 @@ static int check_svcr(struct syscall_cfg *cfg, int sve_vl, int sme_vl, return errors; } -uint8_t za_in[SVE_NUM_PREGS * __SVE_ZREG_SIZE(SVE_VQ_MAX)]; -uint8_t za_out[SVE_NUM_PREGS * __SVE_ZREG_SIZE(SVE_VQ_MAX)]; +uint8_t za_in[ZA_SIG_REGS_SIZE(SVE_VQ_MAX)]; +uint8_t za_out[ZA_SIG_REGS_SIZE(SVE_VQ_MAX)]; static void setup_za(struct syscall_cfg *cfg, int sve_vl, int sme_vl, uint64_t svcr)