Commit 889c5d60 authored by Mathieu Desnoyers's avatar Mathieu Desnoyers Committed by Peter Zijlstra

selftests/rseq: Change type of rseq_offset to ptrdiff_t

Just before the 2.35 release of glibc, the __rseq_offset userspace ABI
was changed from int to ptrdiff_t.

Adapt to this change in the kernel selftests.
Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://sourceware.org/pipermail/libc-alpha/2022-February/136024.html
parent c8eaf6ac
...@@ -143,7 +143,7 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu) ...@@ -143,7 +143,7 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
RSEQ_ASM_DEFINE_ABORT(4, "", abort) RSEQ_ASM_DEFINE_ABORT(4, "", abort)
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
[v] "m" (*v), [v] "m" (*v),
[expect] "r" (expect), [expect] "r" (expect),
[newv] "r" (newv) [newv] "r" (newv)
...@@ -214,7 +214,7 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot, ...@@ -214,7 +214,7 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
RSEQ_ASM_DEFINE_ABORT(4, "", abort) RSEQ_ASM_DEFINE_ABORT(4, "", abort)
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
/* final store input */ /* final store input */
[v] "m" (*v), [v] "m" (*v),
[expectnot] "r" (expectnot), [expectnot] "r" (expectnot),
...@@ -270,7 +270,7 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu) ...@@ -270,7 +270,7 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
RSEQ_ASM_DEFINE_ABORT(4, "", abort) RSEQ_ASM_DEFINE_ABORT(4, "", abort)
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
/* final store input */ /* final store input */
[v] "m" (*v), [v] "m" (*v),
[count] "er" (count) [count] "er" (count)
...@@ -329,7 +329,7 @@ int rseq_offset_deref_addv(intptr_t *ptr, long off, intptr_t inc, int cpu) ...@@ -329,7 +329,7 @@ int rseq_offset_deref_addv(intptr_t *ptr, long off, intptr_t inc, int cpu)
RSEQ_ASM_DEFINE_ABORT(4, "", abort) RSEQ_ASM_DEFINE_ABORT(4, "", abort)
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
/* final store input */ /* final store input */
[ptr] "m" (*ptr), [ptr] "m" (*ptr),
[off] "er" (off), [off] "er" (off),
...@@ -387,7 +387,7 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect, ...@@ -387,7 +387,7 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
RSEQ_ASM_DEFINE_ABORT(4, "", abort) RSEQ_ASM_DEFINE_ABORT(4, "", abort)
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
/* try store input */ /* try store input */
[v2] "m" (*v2), [v2] "m" (*v2),
[newv2] "r" (newv2), [newv2] "r" (newv2),
...@@ -469,7 +469,7 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect, ...@@ -469,7 +469,7 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
RSEQ_ASM_DEFINE_ABORT(4, "", abort) RSEQ_ASM_DEFINE_ABORT(4, "", abort)
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
/* cmp2 input */ /* cmp2 input */
[v2] "m" (*v2), [v2] "m" (*v2),
[expect2] "r" (expect2), [expect2] "r" (expect2),
...@@ -581,7 +581,7 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect, ...@@ -581,7 +581,7 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
#endif #endif
: /* gcc asm goto does not allow outputs */ : /* gcc asm goto does not allow outputs */
: [cpu_id] "r" (cpu), : [cpu_id] "r" (cpu),
[rseq_offset] "r" ((long)rseq_offset), [rseq_offset] "r" (rseq_offset),
/* final store input */ /* final store input */
[v] "m" (*v), [v] "m" (*v),
[expect] "r" (expect), [expect] "r" (expect),
......
...@@ -27,16 +27,17 @@ ...@@ -27,16 +27,17 @@
#include <signal.h> #include <signal.h>
#include <limits.h> #include <limits.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stddef.h>
#include "../kselftest.h" #include "../kselftest.h"
#include "rseq.h" #include "rseq.h"
static const int *libc_rseq_offset_p; static const ptrdiff_t *libc_rseq_offset_p;
static const unsigned int *libc_rseq_size_p; static const unsigned int *libc_rseq_size_p;
static const unsigned int *libc_rseq_flags_p; static const unsigned int *libc_rseq_flags_p;
/* Offset from the thread pointer to the rseq area. */ /* Offset from the thread pointer to the rseq area. */
int rseq_offset; ptrdiff_t rseq_offset;
/* Size of the registered rseq area. 0 if the registration was /* Size of the registered rseq area. 0 if the registration was
unsuccessful. */ unsuccessful. */
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h>
#include "rseq-abi.h" #include "rseq-abi.h"
#include "compiler.h" #include "compiler.h"
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
#include "rseq-thread-pointer.h" #include "rseq-thread-pointer.h"
/* Offset from the thread pointer to the rseq area. */ /* Offset from the thread pointer to the rseq area. */
extern int rseq_offset; extern ptrdiff_t rseq_offset;
/* Size of the registered rseq area. 0 if the registration was /* Size of the registered rseq area. 0 if the registration was
unsuccessful. */ unsuccessful. */
extern unsigned int rseq_size; extern unsigned int rseq_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment