mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
kselftest/arm64: Don't open code SVE_PT_SIZE() in fp-ptrace
In fp-trace when allocating a buffer to write SVE register data we open
code the addition of the header size to the VL depeendent register data
size, which lead to an underallocation bug when we cut'n'pasted the code
for FPSIMD format writes. Use the SVE_PT_SIZE() macro that the kernel
UAPI provides for this.
Fixes: b84d2b2795
("kselftest/arm64: Test FPSIMD format data writes via NT_ARM_SVE in fp-ptrace")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250812-arm64-fp-trace-macro-v1-1-317cfff986a5@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
parent
ceca927c86
commit
d82aa5d350
@ -1187,7 +1187,7 @@ static void sve_write_sve(pid_t child, struct test_config *config)
|
|||||||
if (!vl)
|
if (!vl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
iov.iov_len = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE);
|
iov.iov_len = SVE_PT_SIZE(vq, SVE_PT_REGS_SVE);
|
||||||
iov.iov_base = malloc(iov.iov_len);
|
iov.iov_base = malloc(iov.iov_len);
|
||||||
if (!iov.iov_base) {
|
if (!iov.iov_base) {
|
||||||
ksft_print_msg("Failed allocating %lu byte SVE write buffer\n",
|
ksft_print_msg("Failed allocating %lu byte SVE write buffer\n",
|
||||||
@ -1234,8 +1234,7 @@ static void sve_write_fpsimd(pid_t child, struct test_config *config)
|
|||||||
if (!vl)
|
if (!vl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
iov.iov_len = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq,
|
iov.iov_len = SVE_PT_SIZE(vq, SVE_PT_REGS_FPSIMD);
|
||||||
SVE_PT_REGS_FPSIMD);
|
|
||||||
iov.iov_base = malloc(iov.iov_len);
|
iov.iov_base = malloc(iov.iov_len);
|
||||||
if (!iov.iov_base) {
|
if (!iov.iov_base) {
|
||||||
ksft_print_msg("Failed allocating %lu byte SVE write buffer\n",
|
ksft_print_msg("Failed allocating %lu byte SVE write buffer\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user