From patchwork Thu Jan 27 11:28:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12726612 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 101A1C433FE for ; Thu, 27 Jan 2022 11:28:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 912F46B007D; Thu, 27 Jan 2022 06:28:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 89B826B007E; Thu, 27 Jan 2022 06:28:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 714576B0080; Thu, 27 Jan 2022 06:28:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id 5CEAE6B007D for ; Thu, 27 Jan 2022 06:28:15 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E089E8249980 for ; Thu, 27 Jan 2022 11:28:14 +0000 (UTC) X-FDA: 79075843308.19.D457E13 Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90055.outbound.protection.outlook.com [40.107.9.55]) by imf16.hostedemail.com (Postfix) with ESMTP id 4FF17180009 for ; Thu, 27 Jan 2022 11:28:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HONsLZcHH0WoHGXT0+zCH1t2xJvj//2SpjrRmBzgbXv0j5g+IlaHoLHK65TMa7UCYmQsvdbZlc/N0k6akNXmRtC9+qgeafT5NAnpJIvdauJT8ahqxOQn+YLkKrV95qpyMNZ5lhCkqLbDjy5RyEs49C3VCWEAea1W4QxiszVRPB+vqPrlnJjMt1+kKXE9Pfku8H3AyEZSlkF5kzBwK1lyt3ORlPmuKIdNu7jjJE4nzBnQXkaU2zjbBQc8BNxuRBXt///i3HEyFm9g54YYdWhU4oVdTsKjDkY+vxS8aAc/JJoHzJvGphtUaOKNQeS48B7QrcmVuIBPVe5jCtI14dhM2A== 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=hDmVjj830CtXExXD123euZ+os2WqKPyfIrNuhETOUf0=; b=PhDFfC15sYA5sS1yfPxZ/4tBEafzLuMimPYpmp9mZF1X6jfbYczFnF312UTOUVA96JFQ9f3sVmKsk2K10v5zIws/kpYuE6oHLpkW9IY15d70WdAgp0wle/AQMGQXZQ9/twx8ZboS7aOenkjsfxCtl/G6Krycio1qI/bOEBJNw3nKgdxC9zum3F1PNQ8fKVHuOLgyYW2aRPGt6OSR1lSvLUddGmAnk9QJNnnw3KzkVuqT2mmwmG8YcR8PmA9JFZ61ejad/BnelRX9PQrsA1CK0G6tHV4OYMkWR3+ABZxDxvOJ+JnLBvtkqt6dCIXH5lQeD/gfjtKabAsQ2twUNt8GDw== 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 MRZP264MB3227.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:30::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Thu, 27 Jan 2022 11:28:12 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::c9a2:1db0:5469:54e1]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::c9a2:1db0:5469:54e1%6]) with mapi id 15.20.4930.017; Thu, 27 Jan 2022 11:28: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" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Subject: [PATCH v2 5/5] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Thread-Topic: [PATCH v2 5/5] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Thread-Index: AQHYE3D37kysOO3Vq0mRXtsXlcd4bQ== Date: Thu, 27 Jan 2022 11:28:12 +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: 4585b1ea-b2ce-4c99-123b-08d9e1881a38 x-ms-traffictypediagnostic: MRZP264MB3227: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: 35pcxN+/jFlfzwNgWNHWKW/Q2UU2LHTZ4TO0dk9fUscOlugP7i/hLWo1VXGJU305Qub4W3b2+u8Lv5V4lPxJXV+GwCc9Vw88jgvye4V3QHZm88itjM1w39VAtWXgQQxWTdvBqGog4QTzAyow9REztVaIHcG9OjzqqM7J6u4FwpBkvwbX7oNQOUPgw50c5YA8qsBZxNVojE8yzBGbbBjJRCI69X/idFqnUTJbpK0x9oNIokKhHcLwzceZ9sc1zN1VfTkN3GIbMNBzK4z0MbJeMIopCva7cMqqhnnsJ7QtdJ3LULxZ65qrwEyUoobpZaSf9mBxKtjl4KPKxbIGphx42kUhUk1M29r3b3Sj+4XgxuOQd4O6M9FhPEw1AtUeY4EIZAyMomBB6yr73QpHXhgsYOuYIFhbLad/DLKPleizlAtnIRPAU6RS37qXBg8cndrJ2gu7kbFtpguZRaRgh5Bnw0ghe1yoWnach3bZNLum5YBW4iwBmholLoh+VRnUoFnCOBs7GAGy3nc+fDMUxjiCuKJ535lC8GEDRKTu18FYZ81vjYY/iGBUBZXK5QlQkjxQH9HxDnHUU7OEbKlERnA88hSY7ElBCcgsfwThgrziC9PXHB4SVvaBAPX4dEzoBnW1ZGSyGHYJ1UIVtJb1I9evumbOIfFrgWpfZjCVPbtud+eg3wGiCNFtnuFKfFjFWXvV3TuChWsdiaUCwSxggs5znmfMIDlUTyJ1+0sTjS6AhZk= 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:(13230001)(4636009)(366004)(86362001)(316002)(66946007)(6506007)(6512007)(76116006)(508600001)(66476007)(5660300002)(66446008)(66556008)(91956017)(44832011)(4326008)(64756008)(7416002)(8936002)(8676002)(2616005)(36756003)(6486002)(71200400001)(38070700005)(2906002)(83380400001)(122000001)(26005)(186003)(38100700002)(110136005)(54906003)(32563001)(20210929001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?r4ylYb/DVh5IEiPzk8bl+g2?= =?iso-8859-1?q?hJaYN2XN0pZJ6EcqpJnU3Q8sfiMUqHfMBjnA+diI2mQnZyydLqHXz7xCK+Es?= =?iso-8859-1?q?p3niwmZ32CPE60GpuV8fy1UXEWNTJFqZxP+CcvyUQpVSvDLJ45r+q7rQSq5k?= =?iso-8859-1?q?b+eRwX38jNkSsuAzeBJmtKUcmvcvJc9xfUv4vohmmUl6dQi95Zev4B3QDWXC?= =?iso-8859-1?q?lraT94pAZn3eQudBRxp0hdNML+vCcbS0v9oOvKrrcyLmr7wszwHi8QJAMql7?= =?iso-8859-1?q?XznR+1tBr7H2e4iyRfBxflFNykDxmcy4GUZPelqfWeQ2UOSLXtPzmxXnMRl1?= =?iso-8859-1?q?FrJa0i+t4AZs/X63LDIhCQabk8NLN0ZP7tUuDfmCvVWkgHbn5+A6JU8qB1DW?= =?iso-8859-1?q?w894aoRYLfvQfJ6gnNC47cH05d6RHYHdT4jO+L/DrHxO6hFHC8CoHGEuTrnr?= =?iso-8859-1?q?uHPFArKtP6VecwUMIuh+ybhNoz+1EVLF9dLev8pzIU10OVfWjPSzU11mexKS?= =?iso-8859-1?q?CPfb0h/V+h62pE7vWUk9Shao1uvUrg5tiRRRyMuO/b10oAJPOlWylCK9OoTf?= =?iso-8859-1?q?qPRw/SKxe6YhUqcrR3ZhiLl2B9QKss6bzO8z1cHzD/PKaDfP/vHfEYjLUN0h?= =?iso-8859-1?q?a+NlAuGv+auW63BJUz5Vj03hdmHBz3tM2WZ9yshI4o/yHSZs38DeQzRgKIaC?= =?iso-8859-1?q?2LsuSpqBD84pqcITvB0ZuLXNUe3SSBLj9Vkb36U2SqB0V8NG+zRO2pxKPMme?= =?iso-8859-1?q?4OebUtTJBJA+uxQTdZLDL6hnItTypQvaSgXXD6hXIZdaLCxGclS1CXKNsG2K?= =?iso-8859-1?q?vOUIBJ7FZ+g8UqckqNKNJty1qlVsgN5i16TGU6ThwjxKBJB9V+Dq0iQapvwq?= =?iso-8859-1?q?CiYJDGFl4X7O4I3XPUWSvii/CYH02HAMkBHzx89BKeuVM/TreUMytuRd4Lsw?= =?iso-8859-1?q?ReMzOYj7ivY3UhebrSgsSOzTgdV8hOLuh0sGn6klu2ZlaAH52hAcOMlWQZK5?= =?iso-8859-1?q?vSWbv31xPsS3WpS8aJvNPtjcvj7byiAaMM8NovvsNwn91KbAmyLB0HjGl+w4?= =?iso-8859-1?q?SWwCJHQvOu7hrtAqKKODRBVnqUr+X6R2RliKU+6Bd3U71OX2JAeDRvKSniYq?= =?iso-8859-1?q?kLOqVc8DbVBa5ryEW4kiprrbAE9uKAQRxN+gYIqdWYHovCvL3O/1pTd11s/u?= =?iso-8859-1?q?ilaDBcS9mmHAPO5ro2fiCzvO7YJyQwuNQvsopIvtD8Wnvp0v+Rk0bCkWCImR?= =?iso-8859-1?q?rDw3cFZNCAVjGxv1cWORov4jkFRfNkp4niBN2kT8Vc/qVm+pgNZwh5ucSV8W?= =?iso-8859-1?q?NqNCmt0e3mIwi6EdzifTqn/8jx5J85frAsw/9AQNgv28+4dwuWgiaD3KhrIS?= =?iso-8859-1?q?o1i/e7iBxQGPJtYlz2p7XNMWzlPbK/jh/PapiQQBgLkJsJ3bpgMxTJGiF/o9?= =?iso-8859-1?q?h54ytrQ1s8XotPGpL1MKmkqtBub9ihD+Jlx2OEC315XN24/pL6mu8boDlQ4N?= =?iso-8859-1?q?MXu50sbYxPkIgGtgI2yK3gfYYfGRt1HI5t91HibudK1TCYO74g+UFvY5vQFr?= =?iso-8859-1?q?oMRHjf9s4i5C6deVqtQ0sLK1ihj9oM1J87wYUMoq7ABu8gl9fZDFjbl5XpZo?= =?iso-8859-1?q?a1TduM8YbiDY0W4LDFr/P+AD9PYibqzd1oiRGxjoTFEtvW8JVRLOjBjkGAVt?= =?iso-8859-1?q?dDKfz8DVyfjREas8Nsh/S5ENUa9pQDc1Y3qvc5jW6v6DbrFQvRMyeRhCLrN3?= =?iso-8859-1?q?mVOk=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: 4585b1ea-b2ce-4c99-123b-08d9e1881a38 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jan 2022 11:28:12.0695 (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: QE2iG1lyjB9puRxP2Hd1tDfbjnaBnOmweFdBgashU8HvUP92dDUohHGQ3rGumku00QDcnqdar4JxoeOtPudlJ76L4s2y5bSEfUoD+mNBhhU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRZP264MB3227 X-Rspam-User: nil X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4FF17180009 X-Stat-Signature: 5fizfegwhi4w1izifcugpwi7mzmef5gb Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf16.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.9.55 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-HE-Tag: 1643282894-574334 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000316, 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 --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index b779603978e1..242eed8cedf8 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -152,6 +152,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