[2/2] kselftest/arm64: Correct buffer size for SME ZA storage

Message ID 20221218092942.1940-2-yuzenghui@huawei.com
State New
Headers
Series [1/2] kselftest/arm64: Remove the local NUM_VL definition |

Commit Message

Zenghui Yu Dec. 18, 2022, 9:29 a.m. UTC
  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 <yuzenghui@huawei.com>
---
 tools/testing/selftests/arm64/abi/syscall-abi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Mark Brown Dec. 19, 2022, 11:44 a.m. UTC | #1
On Sun, Dec 18, 2022 at 05:29:42PM +0800, Zenghui Yu wrote:
> 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.

Reviewed-by: Mark Brown <broonie@kernel.org>
  

Patch

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)