From patchwork Mon Jan 24 09:22:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12721808 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 AF206C433FE for ; Mon, 24 Jan 2022 09:22:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47C986B0095; Mon, 24 Jan 2022 04:22:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 42B316B0096; Mon, 24 Jan 2022 04:22:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CD186B0098; Mon, 24 Jan 2022 04:22:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) by kanga.kvack.org (Postfix) with ESMTP id 1EBD86B0095 for ; Mon, 24 Jan 2022 04:22:41 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4997F918C9 for ; Mon, 24 Jan 2022 09:22:40 +0000 (UTC) X-FDA: 79064640480.04.39E92B7 Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120057.outbound.protection.outlook.com [40.107.12.57]) by imf14.hostedemail.com (Postfix) with ESMTP id A0010100025 for ; Mon, 24 Jan 2022 09:22:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RZvPCiowM6RklnpLKurfUmRyj/3v/oVq7u15JqkzyNQAYBJvc/ujagae9SmNnHVx18ZsEtu62yztIb/CcreuX+i5a0drjGHtPVsvmAEjPdi8ooT53oVnWuffhu8bH99Wxu/p5+Klu+7SLIUK6yH+eDA6Rgm5eHMlCfv5YNBjbomEa9TlcyecTPiXhe9+u/IgQqtq+55NvsqirWjmtm2+2mCGN2p06cX9M/Nsgvo6GTW2iYZ/6RsqbHzrxv6LN46qAaL6zJs6WgzN/TVWclURYUq45Sv20NjDQ4XT4mZwoEobogJEubxMD1hDTIoqaL+As6aF1oQirSt0XFuQur1Yjg== 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=z8ARt3PLVJ2vGaO0xkEt2cByxv0ww6gnOJLBp5FiZNw=; b=B8rxeU2rxmlmqIQBePLr0nE+VqG0OG3YDUqAXY8ACehY06w/s+KHokMPmwehucKKLAgPXcjifrZihtU7pfMSKWOj6hN2FGASA5Uxn7WBrb2VZxRZAopwFEX85dZnECK8q+aXe+uNBnktcxy95t+CJZddmWYHWUvJYjntnVzH515rw6Eut8+7PUxxWzA/hl5Y8jJajiF7AA4x4EbZRJL1jUBI93hMt9YPxkZ1caUTPhBZ5mjHe6b+9acwJut7ThkME17V9RPOPft/IICzIeNVLJrVRrOfVR3maWEMGcCB7JKdBeREdoy02Hh7G5m1qrBDhnhwQcuir9hFbJn+rcSa0g== 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 PR1P264MB1742.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1b5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 09:22:38 +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:38 +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" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Subject: [PATCH 7/7] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Thread-Topic: [PATCH 7/7] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Thread-Index: AQHYEQPtzPfcZbAkPk+3M/R7ScopBg== Date: Mon, 24 Jan 2022 09:22:38 +0000 Message-ID: References: In-Reply-To: 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: 951a93e4-71c8-410a-c590-08d9df1b1071 x-ms-traffictypediagnostic: PR1P264MB1742:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1XG+OFX+DNek76q0RmoVN2k5+bFN69HGG8d8edjH52fr+z18S5PgYrUM9aM60HXLYEmmOfopPWqQ672nTKyAI/nDnm1UZt50vPrObfCgOpU7aMI5M11CHsucnBSrqFnhIKMS00oB8dirag129/ij+tyhQ5OU6KS7mSzuCuaqG6rIzxPCPe6H/xmN9q6C24HyOwohzh3qmqw9yIEhuR2e1hNDgSa0jK+1LFvriFofOOuaCkimFCsEfz21FyG3vNEvn3mkJZ5PPxE1HGokSC8dwYN0Q7pty60/zB+S4fXokWap1XCSN2rtU+gvc2kgRy+MkKOIrIRDFtV9GD7nbMlUE/dFx75PLCgV7spaijGkAALTAKdSm1hRBsVckHl4QtUCM+wCHqHR9uJNb+rQ8a4XLxvJsUtRtf6wQ6AvK0zsiK0wx5OuZVqTDW7BAWswJe+UgZokGePImHfvHwdpcs0PRRoVvHANwLKx1jtTk8oh1In3ovZ25EnMkvGhSf4lS7fZF+5uCA3pTFRv7mvZkp6y3Olf6gY4nZm0afEk2prw9BdekiJ2b52P8zBkYC7INeqny+9f8xLGD9pA+iiZfMOscpq/MMj1J6zgWqk8P7/xxVtzbej1o1BpZ7KdO9TxvJ1i4/+b1udq0qSCFNZ7Cg5jd2d83t+CJVryZ/mz6e8Bo8/lxC7lBWSPbqk6P695f1QmtAQZqKvfEHSsWzHQJDmj6GU+vag5uuRyH5rrbkW6sGM= 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)(66556008)(7416002)(66476007)(91956017)(316002)(6486002)(54906003)(110136005)(6512007)(508600001)(64756008)(2616005)(86362001)(8676002)(186003)(26005)(5660300002)(66446008)(83380400001)(2906002)(76116006)(38100700002)(122000001)(44832011)(71200400001)(38070700005)(6506007)(66946007)(4326008)(36756003)(8936002)(32563001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?szicDs3f8vXOo1JDPRq5MSH?= =?iso-8859-1?q?uh2A2foLMymUFO25+7PHtEc+tp1QpzMgtAelUCuVslqItxXN0v6DwxZeMzVT?= =?iso-8859-1?q?VJ1FLOvf4tqD3k6FX1/+TH3g8QrgbPPxeECRG0+9v/gWmSTwa+jPhaBGAI6l?= =?iso-8859-1?q?96UsDOOaXrFN6NHl6amRC4qPKy7lrPVi9H9gVHjN5bDSzM4xr62fTMC4dMSO?= =?iso-8859-1?q?VvUObKrlpz1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n/leixdz28gA2gl4z5pbvhFXm/ZAeS?= =?iso-8859-1?q?o8XFmRcLILrhActohC8uAr1SW9QYzReX9lvlSpgYBMo2E9OADkz5oy9DDkoU?= =?iso-8859-1?q?GmXM0VqQou+KDtEU6iV9hYGX1+dOKOTi1QZq6BIYsXZFFJo4DI6/L62IBV5A?= =?iso-8859-1?q?djWRmgNcNZSwYWS+b6Zutyk51z5h2zNuUd+uCS2xJyKBlpM+CDd4THCZLorH?= =?iso-8859-1?q?Cz+/q+lyO21PBCxnFkQLXkYjpa8STBd37PssBS2dfyvrSx/pqgiwV106zITu?= =?iso-8859-1?q?92LsCv7TDCA3MUHorMkGwKLhbWVRGO8ISRzL/CEF/l8j3SyTQUU6rlSy4JYO?= =?iso-8859-1?q?EZmV/Q6E16m81ZVK5KxPCljuvJi1FHBxc8dF8QcAvln/p0C1WgcNHBghMoHn?= =?iso-8859-1?q?3JyOaSY/f1XylQBYKwThFDizSNgFvNaFm/NyVE5lVKqu1VJVq64QG/52qLz+?= =?iso-8859-1?q?vUjPKzfsGQSU/AH0/JnYEfCXwNJsYPLRsxxy8RBL/ywB921QdRsYxbbe3DFW?= =?iso-8859-1?q?C0/4dbfTBzfTe3WuSixxhysW/kpYLBqMS10dj+H1tMPV9OFdcKS8d/Hpg+Rt?= =?iso-8859-1?q?ZrsGmIKrxTtSte4yxCDNzCMcAKKMqJWnO9BIIebZyxd00m0V7qYVI1hl7E/1?= =?iso-8859-1?q?Uo6o=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: 951a93e4-71c8-410a-c590-08d9df1b1071 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2022 09:22:38.2013 (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: BC6hWK1UsZeHvMIgQaAMnlrQ9NxGrCRqxd7qYldE3euGCt9xO2uBtTJEjm+ikdtXblt6yFmMVoHGpKB+JEVRjcrKnlU1+dj9W6gD1TH8Uh8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR1P264MB1742 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: A0010100025 X-Stat-Signature: d6hnr7rramq8bypjdicgpz953afzhoba Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf14.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.12.57 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-Rspam-User: nil X-HE-Tag: 1643016159-221344 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: book3s/32 and 8xx have a separate area for allocating modules, defined by MODULES_VADDR / MODULES_END. On book3s/32, it is not possible to protect against execution on a page basis. A full 256M segment is either Exec or NoExec. The module area is in an Exec segment while vmalloc area is in a NoExec segment. In order to protect module data against execution, select ARCH_WANTS_MODULES_DATA_IN_VMALLOC. For the 8xx (and possibly other 32 bits platform in the future), there is no such constraint on Exec/NoExec protection, however there is a critical distance between kernel functions and callers that needs to remain below 32Mbytes in order to avoid costly trampolines. By allocating data outside of module area, we increase the chance for module text to remain within acceptable distance from kernel core text. So select ARCH_WANTS_MODULES_DATA_IN_VMALLOC for 8xx as well. Signed-off-by: Christophe Leroy Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Reported-by: kernel test robot --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 0631c9241af3..0360d6438359 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -161,6 +161,7 @@ config PPC select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IRQS_OFF_ACTIVATE_MM select ARCH_WANT_LD_ORPHAN_WARN + select ARCH_WANTS_MODULES_DATA_IN_VMALLOC if PPC_BOOK3S_32 || PPC_8xx select ARCH_WEAK_RELEASE_ACQUIRE select BINFMT_ELF select BUILDTIME_TABLE_SORT