Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3101681rwl; Tue, 27 Dec 2022 04:30:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXvoYqxDzTxY9rs9YEtX8VQUnU4mH14noNkFiA+M7DGwhjeDhEP7i0mk4GbyWJoCHjDZiutD X-Received: by 2002:a05:6402:36a:b0:46f:7453:dd84 with SMTP id s10-20020a056402036a00b0046f7453dd84mr17418397edw.40.1672144217782; Tue, 27 Dec 2022 04:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672144217; cv=none; d=google.com; s=arc-20160816; b=BAMuEGJ/4dQ3r4ENRiqZ9wPWOyWemP51ohLzjJrcEiNvXjk8SnwsbAUt+XNgq79VEP 2ymJzzgXk70hC7sWZMxO998NS6gcimBDA10r3uKBIb/dlKTUtGIYWaohwHJQnk33Vtg0 Sk+tIWGxlYCWLS65YBun101UHCPdWHlMN4UOGzy6+XSOh0fZdVB6jApxKbEqLaMu/ev3 sxbR6G2cWwKBq6VWt00vp/+J6n769+leprOjjzJLv5sbi86UOAIYWwAuUl6WhVqk8P3E 3s/zP/MnZlM/ZPD89RntS3fwujNneh/z/GrltKLbZ4txrfBjQnsNgcTlxO1emec2C1sK Jd1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=3YHleamizsjcxSTKmwNgxXpWw4wPScZashrcfCs99co=; b=Tol7JY3WgcSBYrrTtQuCiX6XV9JuI/jnOo327o0ub73UPzTN4BMtUo4Vitkg2JtmDH BnEA2kGNRwcw5NiZbBveMjzfCA1Z/AO4oyfitX6lQEUAwYHbCXFVrJA3QwQThSd4lgzI Jj6S+6fG7/ePu0QKCDujfUuHvp2D/EYRIdOs818tWFQVH/C3VcbcdyUbUuGjRoz0TqPp eKbQM4jvJPpGyJIvj51+Kku/VwzaLcgziKKUB5iXQWmg2PeIfjnLHMkFYcVgJVGwtlfn huw5FDKmvk2v/Gc8cfr7IlSdx/vFjmBquf7iJqLV682/e0Y8UeIH1zU9JgFjy1oTRdrd tWGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SCslnUXk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8e9WYj7N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe10-20020a170907318a00b007815e9c5b80si11000530ejb.617.2022.12.27.04.30.02; Tue, 27 Dec 2022 04:30:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SCslnUXk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8e9WYj7N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232210AbiL0MQj (ORCPT + 66 others); Tue, 27 Dec 2022 07:16:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229883AbiL0MOm (ORCPT ); Tue, 27 Dec 2022 07:14:42 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 363F5272D; Tue, 27 Dec 2022 04:13:56 -0800 (PST) Date: Tue, 27 Dec 2022 12:13:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672143233; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3YHleamizsjcxSTKmwNgxXpWw4wPScZashrcfCs99co=; b=SCslnUXkYfexq0UHIhkMHYcEPmIVv1GdRuPOAuaNJBZuB2a3MOMYdAMbLG5tAY+xa6T+nA iBnuhz2L5eCdY2RNAi+70y7xMLLnzKGzJI5HBeR5YQfali73KF+zzzu8+CJx8LyyNeW52V Vpe/LU3DS0oZJ+VFCjYGjAD0JJNM9g7eR3MyN0NYFrMsj2xn8oKmsAJZH3tHWp8tG9tWD1 bqiht+mPhyUw0Fuy52C94tpTfksz0uikbkb1t8G7QUDQpkVwELZUOblgmhhVGx6CAG1Zt4 +t0UtYMJhbYUS4as98A/Unek3OR4AChWMm69hrvJgvVFMVh14rckcsYKQZmVhA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672143233; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3YHleamizsjcxSTKmwNgxXpWw4wPScZashrcfCs99co=; b=8e9WYj7NxFLkQtxfOsrtg3qWHtUMmBcedsN6xEv92xHQThboLbkt8gnHfUEi4guoSrEfMc 9EzicD1g9U3PiEAg== From: "tip-bot2 for Mathieu Desnoyers" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] rseq: Introduce feature size and alignment ELF auxiliary vector entries Cc: Mathieu Desnoyers , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221122203932.231377-3-mathieu.desnoyers@efficios.com> References: <20221122203932.231377-3-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Message-ID: <167214323264.4906.3609141535442160200.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 317c8194e6aeb8b3b573ad139fc2a0635856498e Gitweb: https://git.kernel.org/tip/317c8194e6aeb8b3b573ad139fc2a0635856498e Author: Mathieu Desnoyers AuthorDate: Tue, 22 Nov 2022 15:39:04 -05:00 Committer: Peter Zijlstra CommitterDate: Tue, 27 Dec 2022 12:52:10 +01:00 rseq: Introduce feature size and alignment ELF auxiliary vector entries Export the rseq feature size supported by the kernel as well as the required allocation alignment for the rseq per-thread area to user-space through ELF auxiliary vector entries. This is part of the extensible rseq ABI. Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20221122203932.231377-3-mathieu.desnoyers@efficios.com --- fs/binfmt_elf.c | 5 +++++ include/uapi/linux/auxvec.h | 2 ++ include/uapi/linux/rseq.h | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index de63572..0ba86f0 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -288,6 +289,10 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, if (bprm->have_execfd) { NEW_AUX_ENT(AT_EXECFD, bprm->execfd); } +#ifdef CONFIG_RSEQ + NEW_AUX_ENT(AT_RSEQ_FEATURE_SIZE, offsetof(struct rseq, end)); + NEW_AUX_ENT(AT_RSEQ_ALIGN, __alignof__(struct rseq)); +#endif #undef NEW_AUX_ENT /* AT_NULL is zero; clear the rest too */ memset(elf_info, 0, (char *)mm->saved_auxv + diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h index c7e502b..6991c4b 100644 --- a/include/uapi/linux/auxvec.h +++ b/include/uapi/linux/auxvec.h @@ -30,6 +30,8 @@ * differ from AT_PLATFORM. */ #define AT_RANDOM 25 /* address of 16 random bytes */ #define AT_HWCAP2 26 /* extension of AT_HWCAP */ +#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size */ +#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment */ #define AT_EXECFN 31 /* filename of program */ diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h index 77ee207..05d3c4c 100644 --- a/include/uapi/linux/rseq.h +++ b/include/uapi/linux/rseq.h @@ -130,6 +130,11 @@ struct rseq { * this thread. */ __u32 flags; + + /* + * Flexible array member at end of structure, after last feature field. + */ + char end[]; } __attribute__((aligned(4 * sizeof(__u64)))); #endif /* _UAPI_LINUX_RSEQ_H */