Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kselftest/arm64: Correct buffer size for SME ZA storage

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>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221218092942.1940-2-yuzenghui@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Zenghui Yu and committed by
Catalin Marinas
daac8353 00598857

+2 -2
+2 -2
tools/testing/selftests/arm64/abi/syscall-abi.c
··· 300 300 return errors; 301 301 } 302 302 303 - uint8_t za_in[SVE_NUM_PREGS * __SVE_ZREG_SIZE(SVE_VQ_MAX)]; 304 - uint8_t za_out[SVE_NUM_PREGS * __SVE_ZREG_SIZE(SVE_VQ_MAX)]; 303 + uint8_t za_in[ZA_SIG_REGS_SIZE(SVE_VQ_MAX)]; 304 + uint8_t za_out[ZA_SIG_REGS_SIZE(SVE_VQ_MAX)]; 305 305 306 306 static void setup_za(struct syscall_cfg *cfg, int sve_vl, int sme_vl, 307 307 uint64_t svcr)