selftests/rseq: Use ELF auxiliary vector for extensible rseq

Use the ELF auxiliary vector AT_RSEQ_FEATURE_SIZE to detect the RSEQ
features supported by the kernel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221122203932.231377-6-mathieu.desnoyers@efficios.com
This commit is contained in:
Mathieu Desnoyers
2022-11-22 15:39:07 -05:00
committed by Peter Zijlstra
parent cbae6bac29
commit 03f5c0272d
3 changed files with 78 additions and 12 deletions

View File

@@ -47,14 +47,24 @@
#include "rseq-thread-pointer.h"
/* Offset from the thread pointer to the rseq area. */
/* Offset from the thread pointer to the rseq area. */
extern ptrdiff_t rseq_offset;
/* Size of the registered rseq area. 0 if the registration was
unsuccessful. */
/*
* Size of the registered rseq area. 0 if the registration was
* unsuccessful.
*/
extern unsigned int rseq_size;
/* Flags used during rseq registration. */
/* Flags used during rseq registration. */
extern unsigned int rseq_flags;
/*
* rseq feature size supported by the kernel. 0 if the registration was
* unsuccessful.
*/
extern unsigned int rseq_feature_size;
static inline struct rseq_abi *rseq_get_abi(void)
{
return (struct rseq_abi *) ((uintptr_t) rseq_thread_pointer() + rseq_offset);