From patchwork Mon Jan 24 09:22:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12721801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21FB9C433EF for ; Mon, 24 Jan 2022 09:22:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FA9B6B0081; Mon, 24 Jan 2022 04:22:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AA996B0083; Mon, 24 Jan 2022 04:22:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 872A66B0085; Mon, 24 Jan 2022 04:22:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay040.a.hostedemail.com [64.99.140.40]) by kanga.kvack.org (Postfix) with ESMTP id 7B1066B0081 for ; Mon, 24 Jan 2022 04:22:15 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 4339160915 for ; Mon, 24 Jan 2022 09:22:15 +0000 (UTC) X-FDA: 79064639430.03.7D69DD3 Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120087.outbound.protection.outlook.com [40.107.12.87]) by imf29.hostedemail.com (Postfix) with ESMTP id A13FF120046 for ; Mon, 24 Jan 2022 09:22:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7yNKcVUuTmoK2RRuJdcn8H4CWw/ufCkkHrkC7NV5CvE9UOl/IqKEB03ZjIbF2zk763dLvJCo4j0Leuznp7ieV7X/TW9NKXRVIVX6K7buby+12PXOfnELJa3fO0us5aCN8zCaiVc8z59/FpgRQrxDo7pBwOEXWTCmYLNPoDGcHAIr5xslmL3M8gnQzUb5TOxjFZm3dJpijkxpy/sN+RLx9I2fNMczYISUe+pYAzSplQE3lPyqDRYvevmOxVlOToID0azI3egRGLNfDW3om8W3fkda4iOnDjdIgR8At3CJMrZjQtzvmk9KkoZClIE6gEnk/A2pA0AYCC5Nvu1N3/hIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PmcUDD4cRpXoGbE09sZFwnyntOCoCZNQpl9c1VJ6TKw=; b=eAEQws9pJ6rHIqujCehNK0VK5o5NXatRlqRNaeTBhYMQzwIjOOazfXOLn6f2hKuBPLpb5HkjnbiNNVfFkOWisLBPE2CrB2ICZ0nViLG6ZM+O2cjifshdmi5ANl8cfA1DLRo/2oFEEtHwwXNjYJQtLt2bEORB3z+bnBSMk6sl1FFxkg/lQ3DSJXL/JPTd7U8YnJtFmJyCn88mDjSFsMq7OWUGMLFSX/1fQ9RWVLvMRpFvCxRNIID4RZx3hUm11EK+vhUM6TADMVd2ho+sgf5xaLEWI+x1ooZR4epB4iAD5ufr6TjrF0WE3ntTZYKQXQwwKkb0J7xUsjAGKLaBjpIOsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:31::15) by PAYP264MB3485.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:124::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Mon, 24 Jan 2022 09:22:12 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::9d4f:1090:9b36:3fc5]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::9d4f:1090:9b36:3fc5%5]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 09:22:12 +0000 From: Christophe Leroy To: Luis Chamberlain , Jessica Yu CC: Christophe Leroy , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "kgdb-bugreport@lists.sourceforge.net" , "linux-mm@kvack.org" , "linux-arch@vger.kernel.org" Subject: [PATCH 0/7] Allocate module text and data separately Thread-Topic: [PATCH 0/7] Allocate module text and data separately Thread-Index: AQHYEQPeal2Ru1Vo80yWM9wORGS9cw== Date: Mon, 24 Jan 2022 09:22:11 +0000 Message-ID: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 075d9852-40f0-48a7-2663-08d9df1b00d2 x-ms-traffictypediagnostic: PAYP264MB3485:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XbwZ7S9u+Qp1rbiMS6XNIsM5pJd/d/n5mZJ6hw8doYf2h7GcNmX0QTH1LO+C2zAZzPk3XiTqyAB5YE1hF6pFaRGhOajMENEddXPitVkI4+h+PQ6I6g7Zj0TXP+o8rMLNUDuUrU2LDBD812zMUMZKURUdj3sgRStwF+vfzdxoPqSuvh7oEJ0uROqUQXZejw/2bi74uVO4fh+dW+w67wxC+6iNdpA59ZKxDeNk8FrBuoluKcT0HiCu9nPLgaegcdcMppBNiTdnrpMvFk1vt83vhpNWglEcMVXNI5epgsChGfw+Fa8/HEjP11O4z+XZedMiAN5IvnG2ooiW9VlLL7zVSUO52YmGmjmO3XOpUoyLh83aJhL6iWoKsSX/x4j728uZDI69V1B6HmNypSIpTGelhuRfkBbyAQsaHKbFPKLPo8VAhUAfTJAvl+LHT/sqDoqPKEt87vJfHZR2WRT25p3gyZPI5scQJt0132lLLCcHsFnLKpkwd0v0rrSIzLx3RjGLjY4n+pwwbeZKY3eqd449fB7tW0ApFHthCwTH1N79O8Mk06uxm8p6no8wVvEuChAz8SH4m1ZQWl0v8TLvSTCqT8L4XdrFhXeX3ulRFjD9kR1qYJioqIYalWEY8Zlo1r2D5kzZGB250Yyq0OOrOMcCvp6jZFFqUNuGlm5jLBufYGIy/fxTbb2TPf9H2nSGocWcuM8UxI2zNKE8LlkfSnjtRg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(366004)(38070700005)(86362001)(66446008)(38100700002)(64756008)(66476007)(66946007)(91956017)(76116006)(71200400001)(66556008)(44832011)(36756003)(8936002)(83380400001)(8676002)(122000001)(26005)(6512007)(2906002)(6486002)(6506007)(186003)(5660300002)(508600001)(316002)(4326008)(2616005)(110136005)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?4hXagqzlzb410+CMNcJecR4?= =?iso-8859-1?q?KmGee+Hhd3cpCRp+fwNcJNcGQHe94hTbQ0ZftlCDWMbz0MXFgVzBsfHj3iKT?= =?iso-8859-1?q?6/W+KTBjFdvsQF2Zn3FyK+1u3vPdsJMdj8jSKhgrXWMXSEHV8IUDLwElnwr7?= =?iso-8859-1?q?rjA4mbMMtBoV+UOR5B13XPaHIRds5BGRp3/w+ka1bsmBRuKbc4EzMBQrHH2i?= =?iso-8859-1?q?a1EKZ8akr3ATMKjTnuxx45sXzM9Etq8DQWW68V4UCt5NqJP25Xo7F+0FlBFd?= =?iso-8859-1?q?z02VptOdjO5/jHo3SvHU7Ltwx0H+18hwF3ilrupldUsCGFZg9qh8mSlvibb+?= =?iso-8859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oVy350Pbj+Z7ucE06VnfV8ppHiTPxUftPbymKo5ZUFcv+cd1Yif4x?= =?iso-8859-1?q?17/y0ozjuoxW6ouKb8LxuBiI6FUotwYX2MV/hiI6BYEOeK3G6oqsxXKrZ2QS?= =?iso-8859-1?q?7Lv+j2WTjmt1jm3kQADlNsSCade6Zuxp+/vFHGw/CiMkeVwk2mDmDUg4xERJ?= =?iso-8859-1?q?Zl572y69onmlkTqnHo8+NTLV2nAqP9xRfOLpVz+gzsLCMnKIiVFUnaCDCtYk?= =?iso-8859-1?q?pjzC8FJXB6gvN9ohyVk1Ba59fJkQrvxWSWCPCCuYYxoropF3UeCdanttOJ0C?= =?iso-8859-1?q?0NfF9oQZc+yGjEToGYoTzyMd+6Mmi0cpIXm2Rk12Vm1NJN027283ku+Ffcly?= =?iso-8859-1?q?7Bv+O/cdEG/DhUknYAcTDWPxH1dibdpOIGI7pwdXEG1zkGChs09KcD0sOBzv?= =?iso-8859-1?q?h3ETL3NJyuqT2UTZLWulqyndd88mRvEB/N7CR4PPsxb6yj+Ufjf+TWspzqPB?= =?iso-8859-1?q?DktMpGxeyRCNiv5HJLxMCDLmBk6/vuiT9dcYTrw5Mux7vlZawg3B8eE3U9Tl?= =?iso-8859-1?q?vlGc=3D?= MIME-Version: 1.0 X-OriginatorOrg: csgroup.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 075d9852-40f0-48a7-2663-08d9df1b00d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2022 09:22:11.9425 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9914def7-b676-4fda-8815-5d49fb3b45c8 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bXjuh3Cs4mPye1dB01wH1Kcqz+geiQvH6x0JEpplMiOEd4BpnSc+NFR1G8UJkZzn3JkHJSX3c24mduFN0uEVAPWpm4crclK9Qk+mCXUt690= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAYP264MB3485 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A13FF120046 X-Stat-Signature: y5jaxxyfodp8hmw6ftjzdpgffndkd8e7 Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf29.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.12.87 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-HE-Tag: 1643016134-902115 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This series allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per 256 Mbytes segments. The module area has exec right, vmalloc area has noexec. This can also be useful on other powerpc/32 in order to maximize the chance of code being close enough to kernel core to avoid branch trampolines. Christophe Leroy (7): modules: Refactor within_module_core() and within_module_init() modules: Add within_module_text() macro modules: Always have struct mod_tree_root modules: Prepare for handling several RB trees modules: Introduce data_layout modules: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx arch/Kconfig | 6 ++ arch/powerpc/Kconfig | 1 + include/linux/module.h | 38 ++++++- kernel/debug/kdb/kdb_main.c | 10 +- kernel/module.c | 207 ++++++++++++++++++++++++------------ 5 files changed, 186 insertions(+), 76 deletions(-)