From 470c530bcb81593ac6e62a79e67e4bd5c09c14e5 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 22 Feb 2024 10:37:38 -0500 Subject: [PATCH] Document alignment of rseq_abi for allocated size Signed-off-by: Mathieu Desnoyers Change-Id: Ie78f475a2d6f8756b166db45d96367104871c2a8 --- src/rseq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rseq.c b/src/rseq.c index e904b44..4f01aad 100644 --- a/src/rseq.c +++ b/src/rseq.c @@ -70,6 +70,12 @@ static int rseq_reg_success; /* At least one rseq registration has succeded. */ /* Original struct rseq allocation size is 32 bytes. */ #define ORIG_RSEQ_ALLOC_SIZE 32 +/* + * The alignment on RSEQ_THREAD_AREA_ALLOC_SIZE guarantees that the + * rseq_abi structure allocated size is at least + * RSEQ_THREAD_AREA_ALLOC_SIZE bytes to hold extra space for yet unknown + * kernel rseq extensions. + */ static __thread struct rseq_abi __rseq_abi __attribute__((tls_model("initial-exec"), aligned(RSEQ_THREAD_AREA_ALLOC_SIZE))) = { .cpu_id = RSEQ_ABI_CPU_ID_UNINITIALIZED, -- 2.34.1