kselftest/arm64: Implement irritators for ZA and ZT

Currently we don't use the irritator signal in our floating point stress
tests so when we added ZA and ZT stress tests we didn't actually bother
implementing any actual action in the handlers, we just counted the signal
deliveries. In preparation for using the irritators let's implement them,
just trivially SMSTOP and SMSTART to reset all bits in the register to 0.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241107-arm64-fp-stress-irritator-v2-4-c4b9622e36ee@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
Mark Brown 2024-11-07 01:39:23 +00:00 committed by Catalin Marinas
parent ffca567fef
commit d65f27d240
2 changed files with 8 additions and 16 deletions

View File

@ -148,20 +148,16 @@ function check_za
b memcmp b memcmp
endfunction endfunction
// Any SME register modified here can cause corruption in the main // Modify the live SME register state, signal return will undo our changes
// thread -- but *only* the locations modified here.
function irritator_handler function irritator_handler
// Increment the irritation signal count (x23): // Increment the irritation signal count (x23):
ldr x0, [x2, #ucontext_regs + 8 * 23] ldr x0, [x2, #ucontext_regs + 8 * 23]
add x0, x0, #1 add x0, x0, #1
str x0, [x2, #ucontext_regs + 8 * 23] str x0, [x2, #ucontext_regs + 8 * 23]
// Corrupt some random ZA data // This will reset ZA to all bits 0
#if 0 smstop
movi v0.8b, #1 smstart
movi v9.16b, #2
movi v31.8b, #3
#endif
ret ret
endfunction endfunction

View File

@ -117,20 +117,16 @@ function check_zt
b memcmp b memcmp
endfunction endfunction
// Any SME register modified here can cause corruption in the main // Modify the live SME register state, signal return will undo our changes
// thread -- but *only* the locations modified here.
function irritator_handler function irritator_handler
// Increment the irritation signal count (x23): // Increment the irritation signal count (x23):
ldr x0, [x2, #ucontext_regs + 8 * 23] ldr x0, [x2, #ucontext_regs + 8 * 23]
add x0, x0, #1 add x0, x0, #1
str x0, [x2, #ucontext_regs + 8 * 23] str x0, [x2, #ucontext_regs + 8 * 23]
// Corrupt some random ZT data // This will reset ZT to all bits 0
#if 0 smstop
movi v0.8b, #1 smstart
movi v9.16b, #2
movi v31.8b, #3
#endif
ret ret
endfunction endfunction