Skip to content

Commit 41bbcf7

Browse files
jgoulywilldeacon
authored andcommitted
selftests: mm: move fpregs printing
arm64's fpregs are not at a constant offset from sigcontext. Since this is not an important part of the test, don't print the fpregs pointer on arm64. Signed-off-by: Joey Gouly <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Acked-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 6354a01 commit 41bbcf7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

tools/testing/selftests/mm/pkey-powerpc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#endif
1010
#define REG_IP_IDX PT_NIP
1111
#define REG_TRAPNO PT_TRAP
12+
#define MCONTEXT_FPREGS
1213
#define gregs gp_regs
1314
#define fpregs fp_regs
1415
#define si_pkey_offset 0x20

tools/testing/selftests/mm/pkey-x86.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#endif
1717

18+
#define MCONTEXT_FPREGS
19+
1820
#ifndef PKEY_DISABLE_ACCESS
1921
# define PKEY_DISABLE_ACCESS 0x1
2022
#endif

tools/testing/selftests/mm/protection_keys.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext)
314314
ucontext_t *uctxt = vucontext;
315315
int trapno;
316316
unsigned long ip;
317+
#ifdef MCONTEXT_FPREGS
317318
char *fpregs;
319+
#endif
318320
#if defined(__i386__) || defined(__x86_64__) /* arch */
319321
u32 *pkey_reg_ptr;
320322
int pkey_reg_offset;
@@ -330,7 +332,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext)
330332

331333
trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO];
332334
ip = uctxt->uc_mcontext.gregs[REG_IP_IDX];
335+
#ifdef MCONTEXT_FPREGS
333336
fpregs = (char *) uctxt->uc_mcontext.fpregs;
337+
#endif
334338

335339
dprintf2("%s() trapno: %d ip: 0x%016lx info->si_code: %s/%d\n",
336340
__func__, trapno, ip, si_code_str(si->si_code),
@@ -359,7 +363,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext)
359363
#endif /* arch */
360364

361365
dprintf1("siginfo: %p\n", si);
366+
#ifdef MCONTEXT_FPREGS
362367
dprintf1(" fpregs: %p\n", fpregs);
368+
#endif
363369

364370
if ((si->si_code == SEGV_MAPERR) ||
365371
(si->si_code == SEGV_ACCERR) ||

0 commit comments

Comments
 (0)