|
25 | 25 | do { \
|
26 | 26 | unsigned long hwcaps = getauxval(AT_HWCAP); \
|
27 | 27 | /* data key instructions are not in NOP space. This prevents a SIGILL */ \
|
28 |
| - ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); \ |
| 28 | + if (!(hwcaps & HWCAP_PACA)) \ |
| 29 | + SKIP(return, "PAUTH not enabled"); \ |
29 | 30 | } while (0)
|
30 | 31 | #define ASSERT_GENERIC_PAUTH_ENABLED() \
|
31 | 32 | do { \
|
32 | 33 | unsigned long hwcaps = getauxval(AT_HWCAP); \
|
33 | 34 | /* generic key instructions are not in NOP space. This prevents a SIGILL */ \
|
34 |
| - ASSERT_NE(0, hwcaps & HWCAP_PACG) TH_LOG("Generic PAUTH not enabled"); \ |
| 35 | + if (!(hwcaps & HWCAP_PACG)) \ |
| 36 | + SKIP(return, "Generic PAUTH not enabled"); \ |
35 | 37 | } while (0)
|
36 | 38 |
|
37 | 39 | void sign_specific(struct signatures *sign, size_t val)
|
@@ -256,7 +258,7 @@ TEST(single_thread_different_keys)
|
256 | 258 | unsigned long hwcaps = getauxval(AT_HWCAP);
|
257 | 259 |
|
258 | 260 | /* generic and data key instructions are not in NOP space. This prevents a SIGILL */
|
259 |
| - ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); |
| 261 | + ASSERT_PAUTH_ENABLED(); |
260 | 262 | if (!(hwcaps & HWCAP_PACG)) {
|
261 | 263 | TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
|
262 | 264 | nkeys = NKEYS - 1;
|
@@ -299,7 +301,7 @@ TEST(exec_changed_keys)
|
299 | 301 | unsigned long hwcaps = getauxval(AT_HWCAP);
|
300 | 302 |
|
301 | 303 | /* generic and data key instructions are not in NOP space. This prevents a SIGILL */
|
302 |
| - ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); |
| 304 | + ASSERT_PAUTH_ENABLED(); |
303 | 305 | if (!(hwcaps & HWCAP_PACG)) {
|
304 | 306 | TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks");
|
305 | 307 | nkeys = NKEYS - 1;
|
|
0 commit comments