Skip to content

Commit d65f27d

Browse files
brooniectmarinas
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent ffca567 commit d65f27d

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

tools/testing/selftests/arm64/fp/za-test.S

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,16 @@ function check_za
148148
b memcmp
149149
endfunction
150150

151-
// Any SME register modified here can cause corruption in the main
152-
// thread -- but *only* the locations modified here.
151+
// Modify the live SME register state, signal return will undo our changes
153152
function irritator_handler
154153
// Increment the irritation signal count (x23):
155154
ldr x0, [x2, #ucontext_regs + 8 * 23]
156155
add x0, x0, #1
157156
str x0, [x2, #ucontext_regs + 8 * 23]
158157

159-
// Corrupt some random ZA data
160-
#if 0
161-
movi v0.8b, #1
162-
movi v9.16b, #2
163-
movi v31.8b, #3
164-
#endif
158+
// This will reset ZA to all bits 0
159+
smstop
160+
smstart
165161

166162
ret
167163
endfunction

tools/testing/selftests/arm64/fp/zt-test.S

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,16 @@ function check_zt
117117
b memcmp
118118
endfunction
119119

120-
// Any SME register modified here can cause corruption in the main
121-
// thread -- but *only* the locations modified here.
120+
// Modify the live SME register state, signal return will undo our changes
122121
function irritator_handler
123122
// Increment the irritation signal count (x23):
124123
ldr x0, [x2, #ucontext_regs + 8 * 23]
125124
add x0, x0, #1
126125
str x0, [x2, #ucontext_regs + 8 * 23]
127126

128-
// Corrupt some random ZT data
129-
#if 0
130-
movi v0.8b, #1
131-
movi v9.16b, #2
132-
movi v31.8b, #3
133-
#endif
127+
// This will reset ZT to all bits 0
128+
smstop
129+
smstart
134130

135131
ret
136132
endfunction

0 commit comments

Comments
 (0)