Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1832955imw; Sat, 16 Jul 2022 16:21:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmOCODjjk59gohwlOGkShYay6Cd/FJmoldPCbvWaq3DO1Yd6cAzV4YV6yS/2zcQB7uBnCZ X-Received: by 2002:a17:902:f787:b0:16a:1e2b:e97 with SMTP id q7-20020a170902f78700b0016a1e2b0e97mr20081956pln.27.1658013678391; Sat, 16 Jul 2022 16:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658013678; cv=none; d=google.com; s=arc-20160816; b=DeFF7WE6GFROOFSWBR8tcXmUi50uFBlm1dTwm6UkGD1cbY0p2+f5h9NVchPz8T+mU7 BwZqGJ0VErxG6c+jOg7ScaqyUhI3a2jwE8KdONJX3sKdEdyWgHiYLOQE+oZn7/O6o7MP 1BGhdUImeYt3LE8kRQZyG5FqfS+J5ae7ey6Vjp7941szCA/Yjnbg0bWUXusX4mz1AXIq VKxZw9bS2FuZ01i3UvgDqO9RBJ+ZoSXXJf8aM7I4a+UuvNf96lXexZUJ+PrmzdP6QiPn 9VSnEX99WdiIMrW51uhyZKMzymKbL/aC/H9eLJl/gANsKllxP8MNuW+D0oDIc3qCP3Dq Sxcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=b2tVGWEEQxEmKYvEfnlf9eVD7BzXQkIgf4CQYJfSWA0=; b=jB317f8SHtaR4/UAgc7mB4qhKbdALHrxMmr7HoIFuQCLys7VYSQviIhN1RzB9DEdtw Iz+7XtgufwhRskaQV+T4hh7xj81k3CfHrX2dKrf4AG2KWxnqcnD7VliBIwYU5PZSjzY9 ntNYC9Algvwo3ESm4Aqg8ixn0RZZbEQgFydS5otwLHDvSM8uYjj3WQc4DU7AJVWPpQQd ZXAfrs8Cw4PatK+N8cFAUgkzqSX+FKbvu1AeHVtBfRaYTZIvDEzwh06k/+7nTTD2n3QX szoMid3WayDx1y3lziYrU8a1uwYxKeDHssL7hWDs8GtQOY1cPj9pHXegfLBjN80y9vrn TuZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=O7UhPxkC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 d193-20020a6368ca000000b0040da5486b4dsi10543487pgc.489.2022.07.16.16.21.03; Sat, 16 Jul 2022 16:21:18 -0700 (PDT) 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=O7UhPxkC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S233151AbiGPXSO (ORCPT + 99 others); Sat, 16 Jul 2022 19:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230489AbiGPXRv (ORCPT ); Sat, 16 Jul 2022 19:17:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 835B722512 for ; Sat, 16 Jul 2022 16:17:38 -0700 (PDT) Message-ID: <20220716230953.619868339@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658013456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=b2tVGWEEQxEmKYvEfnlf9eVD7BzXQkIgf4CQYJfSWA0=; b=O7UhPxkCkQ737zainAw9aArz/bddAcpJHPpiD5Kp9M06wleZTQfXgKqex/jnpymI24hM6Z pHp4/VaBZ1nFNw8I9aByaY+wi5ZNvE2VbtGNnNmt9/9B9n25wCQqYIxXJR1Vr7YsQsHaYD ysVTkZMsDXnOjp3rrvt5extlWht2WG7n/hzF/eEoxm+otTc6g+ERiTvTRF838F/cXMni09 jKDhMKLDD4VAioO3tT9wiMIJWmZ/aCsMSq/siLBQ/hBXXLvS0ixCsKeUTxPDZ2RGgL3Ijs c7hQIDLhpu9ORGAwo2S+Yh5Y4pn85grwGXekmfbZU2rTSiN0FQbZ9grthbhf4Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658013456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=b2tVGWEEQxEmKYvEfnlf9eVD7BzXQkIgf4CQYJfSWA0=; b=CZ1DNdoIuzBl9Kb+DEaHZJzoEGs0pd4Dzz4uhF8KABrtdFczi0jr29Z2877TXr23Ow/qON 9fbK9FEBsGbTFRBw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Linus Torvalds , Tim Chen , Josh Poimboeuf , Andrew Cooper , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , Joao Moreira , Joseph Nuzman , Steven Rostedt Subject: [patch 16/38] modules: Make struct module_layout unconditionally available References: <20220716230344.239749011@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Sun, 17 Jul 2022 01:17:35 +0200 (CEST) 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 To simplify the upcoming call thunk code it's desired to expose struct module_layout even on !MDOULES builds. This spares conditionals and #ifdeffery. Signed-off-by: Thomas Gleixner --- include/linux/module.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) --- a/include/linux/module.h +++ b/include/linux/module.h @@ -67,6 +67,28 @@ struct module_version_attribute { const char *version; }; +struct mod_tree_node { + struct module *mod; + struct latch_tree_node node; +}; + +struct module_layout { + /* The actual code + data. */ + void *base; + /* Total size. */ + unsigned int size; + /* The size of the executable code. */ + unsigned int text_size; + /* Size of RO section of the module (text+rodata) */ + unsigned int ro_size; + /* Size of RO after init section */ + unsigned int ro_after_init_size; + +#ifdef CONFIG_MODULES_TREE_LOOKUP + struct mod_tree_node mtn; +#endif +}; + extern ssize_t __modver_version_show(struct module_attribute *, struct module_kobject *, char *); @@ -316,28 +338,6 @@ enum module_state { MODULE_STATE_UNFORMED, /* Still setting it up. */ }; -struct mod_tree_node { - struct module *mod; - struct latch_tree_node node; -}; - -struct module_layout { - /* The actual code + data. */ - void *base; - /* Total size. */ - unsigned int size; - /* The size of the executable code. */ - unsigned int text_size; - /* Size of RO section of the module (text+rodata) */ - unsigned int ro_size; - /* Size of RO after init section */ - unsigned int ro_after_init_size; - -#ifdef CONFIG_MODULES_TREE_LOOKUP - struct mod_tree_node mtn; -#endif -}; - #ifdef CONFIG_MODULES_TREE_LOOKUP /* Only touch one cacheline for common rbtree-for-core-layout case. */ #define __module_layout_align ____cacheline_aligned