From patchwork Wed Mar 24 09:54:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12160589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36B6FC433C1 for ; Wed, 24 Mar 2021 09:56:30 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5014619AE for ; Wed, 24 Mar 2021 09:56:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5014619AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synaptics.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=KObobciMqYQ0wVs0ovVOafUWkP9bpw9LS9FurFqi6qU=; b=KZgglaSA6NxN+6daE+BplkfSPF Qndx5h6cJpq/GGXDJ7CY8NniZAJncyKqAdiTw7TeMiJe8cTDTU2MZ3gYbtTayH5gKBdLayujYFzqj Qg7dJ4CmQaUcAfp35DIs9EAI/R63O+xw1mZ24SpfH8lAGtjSTRZQZ/j2kioPgB5bVcg9PB/BDKC6E lXJV9GoKTn6Ha9iXOz+kdQ5RtiebvKUeZhnQlsuqDVfg/Ap2oiRXDfmZO0wRRvGf8a/Rq/V3plQ8F qsyJo7/TDvq2KsKD3jG2KNe/HfkhnnI4sIhB1J5U54W8j8vLSt88MKKxADKMCF74UlW6/IuixwcZb /dNVJHKg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lP0Du-00GmSj-0y; Wed, 24 Mar 2021 09:54:46 +0000 Received: from mail-mw2nam12on2069.outbound.protection.outlook.com ([40.107.244.69] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lP0Dn-00GmRY-3g for linux-arm-kernel@lists.infradead.org; Wed, 24 Mar 2021 09:54:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LjbrXJV9JlziOzuQkkbH2REMsMTTJhSIAqYFm5QTr/7i2abNZxKQwjwpC/UKgreu8nA/owVYQ51tmprCYb7pYGsXDUL/W2YtTs7LB6KJ9BUkatNweqkkQxHjdwlZHjXxWfUATl0SC3ZM8lNh9SQw0zubuw6RhU3UDj1AXu6jpadaqZvatWKq3gzUz7y/5K0k9htliC7ZNQk58KhB4XFBemIFgAx6jbiohIEwisfKMzLvVdg/hfcX9AUGZA8D9i3ODtJghR9UiJOqKMVG/bXiN4qJgJE1iBm6iIWRjOlltYwQsHZZOD4a1hzmY9ft6rHfPb6ZscWQsPri1eq6C4io0Q== 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-SenderADCheck; bh=xxfJzUOYUQTYpZ1KeXRQ5akStSMLwcyuQbhTQVOuPQA=; b=kB3A8+fhF/jJbgcOCOkxSD1LxFI5UDsCrUhVAY5f1kM6fVFIesUkk1NE9LZbsAGL1IrEbhymftJUs6TwpqluUhHCRmUVEzn2BExaU/znwKE9jFQeNhIllR5Z6RHWzbFxbnGG/m4G6pmegtXz3Dgq47eEOur0fMC8PZcpqP4cfUxOWj9ACnHIVOnHFKWqUoaEu/RXOgqv+V1Xzv6ecuk/c0H1mVwNPD9fPOIH7suSm6IrVX0OhY2CqfTQQh+OEXB8zjltCHtQTu0mNG8rjkFw/iuWSDTwnwG7BIo+hKPMuVqk4TCNE1xQBwWvs0VVegqDbsqWzSQyPF4f/TpKMSuLfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xxfJzUOYUQTYpZ1KeXRQ5akStSMLwcyuQbhTQVOuPQA=; b=WgjFDoGs5d2X3TIuxvCIQ9K8fIoHNuqgtGrhlhAUfSFwaRmqkCOLHFM5l93OdRBDLP7tUznFLYGI1oGKiJlreAx4kMCVhT3gU4MzzGvKG/1OLZMGB5zQwsNvIy8uXBb30LjqkjkPodGEqcQTbZJ9K+MZUvF8Axzc8hJRWFOiq1Q= Authentication-Results: armlinux.org.uk; dkim=none (message not signed) header.d=none;armlinux.org.uk; dmarc=none action=none header.from=synaptics.com; Received: from BY5PR03MB5345.namprd03.prod.outlook.com (2603:10b6:a03:219::16) by BYAPR03MB3672.namprd03.prod.outlook.com (2603:10b6:a02:af::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Wed, 24 Mar 2021 09:54:31 +0000 Received: from BY5PR03MB5345.namprd03.prod.outlook.com ([fe80::8569:341f:4bc6:5b72]) by BY5PR03MB5345.namprd03.prod.outlook.com ([fe80::8569:341f:4bc6:5b72%7]) with mapi id 15.20.3955.027; Wed, 24 Mar 2021 09:54:31 +0000 Date: Wed, 24 Mar 2021 17:54:24 +0800 From: Jisheng Zhang To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm: mm: remove set_kernel_text_r[ow]() Message-ID: <20210324175424.065b90bb@xhacker.debian> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) X-Originating-IP: [192.147.44.204] X-ClientProxiedBy: SJ0PR03CA0210.namprd03.prod.outlook.com (2603:10b6:a03:2ef::35) To BY5PR03MB5345.namprd03.prod.outlook.com (2603:10b6:a03:219::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (192.147.44.204) by SJ0PR03CA0210.namprd03.prod.outlook.com (2603:10b6:a03:2ef::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Wed, 24 Mar 2021 09:54:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ead5f80a-80b5-48b2-c639-08d8eeaad274 X-MS-TrafficTypeDiagnostic: BYAPR03MB3672: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:134; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vizYaMpgGgV4y/HFg06AaC5lLjiXLjTU4IqdkEsabe1q8djC390FdwP29wDINlIG8fGaKtilPXGmswqt21LYxbPyXtfunhMot1t6mus1oVvJqgU6e+o1r8mgTMQZf3q/Bq/liomEUkypxLCu6IDyG5Gg01dbeoRY3oUhlOfaJ9AKj8opeGrsxBOCN+t2nudkzMicqC0EZuSiAqGNYCXk1wmQtirAXSjDDa2nIyfmOGJz4NgSvZU433CkH4+foT8ZyKb+JbpQKkETPzNnc/LiiLDQbSDpHLWwDYMKHvf9/3wdY2QEMRNLYr+sNeDGPXimPQbdREUoYvKSd7A90NdxnSp8gFSIY++xU+4ePn75pGlqAUMEETjxUmRgFzBOMNStG9y+evEJsElZQPU89Uj71X+SQGR1Z5HBYtkSjqQ1sLBPuJaJYeqNQnG2niwoJvq8EXXtut1N/H4x8EOClE8Se5BWztn9phJdU8LVdOB02DHbKloG6HqbKrEXTey8uI0NH43FAeFMrqvfEy3o7s0qcvwzhYEvu0HBlyrV9up78Q+ijVFoOLbc5fxPQBTxZS3SXwOT3eKw/rgQAUeYH74DwHAepmTr4ZjKCz8kqAVbLi6zv8LdpIlyNq8zNFNeZJAUNjwW3OoL4oCaAWkj38Iww4z5BhAb04mi6GHbUZYHFD0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR03MB5345.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(136003)(39860400002)(396003)(376002)(346002)(7696005)(52116002)(1076003)(5660300002)(66946007)(6916009)(2906002)(8676002)(83380400001)(86362001)(6506007)(316002)(8936002)(38100700001)(186003)(956004)(6666004)(9686003)(55016002)(478600001)(66556008)(66476007)(4326008)(26005)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fnxKpa/ydSsiiZ6B7mLUEtvUlpaHBft0tdKDD/mLXwFyfuIJH9+pB4eM0Xm51m+ZfGeqJ/7VljLfsecHNBJn8PF3lCgajm/UA+IVgY0vih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Tt631LBwHqWxvMS0uVML83zr/mr5kQANBcGdERFx0JbNY4nGzQLZEhcW/8FQOK7TsTrlnw5ADMKl5Je0yVSrZo4oZRJo+PG2TKG0GvrE74yEh078CfXnNvgwMvc3fVbwREWqlYNR/uEmxFlY1juAWb14WBSzvW4Ne X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: ead5f80a-80b5-48b2-c639-08d8eeaad274 X-MS-Exchange-CrossTenant-AuthSource: BY5PR03MB5345.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2021 09:54:31.7426 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t1MCC8eNr1eqc2sGkIWk9kekVAfg0rWTwD7DM57ayAZxOopbCxO8oBv6IrjumaiQxH3vux6SXZalmukiqJGqHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB3672 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210324_095439_682857_947555C5 X-CRM114-Status: GOOD ( 10.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org After commit 5a735583b764 ("arm/ftrace: Use __patch_text()"), the last and only user of these functions has gone, remove them. Signed-off-by: Jisheng Zhang --- arch/arm/include/asm/set_memory.h | 8 -------- arch/arm/mm/init.c | 21 --------------------- 2 files changed, 29 deletions(-) diff --git a/arch/arm/include/asm/set_memory.h b/arch/arm/include/asm/set_memory.h index a1ceff4295d3..ec17fc0fda7a 100644 --- a/arch/arm/include/asm/set_memory.h +++ b/arch/arm/include/asm/set_memory.h @@ -18,12 +18,4 @@ static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; } #endif -#ifdef CONFIG_STRICT_KERNEL_RWX -void set_kernel_text_rw(void); -void set_kernel_text_ro(void); -#else -static inline void set_kernel_text_rw(void) { } -static inline void set_kernel_text_ro(void) { } -#endif - #endif diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 828a2561b229..039c19597c7a 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -487,33 +487,12 @@ static int __mark_rodata_ro(void *unused) return 0; } -static int kernel_set_to_readonly __read_mostly; - void mark_rodata_ro(void) { - kernel_set_to_readonly = 1; stop_machine(__mark_rodata_ro, NULL, NULL); debug_checkwx(); } -void set_kernel_text_rw(void) -{ - if (!kernel_set_to_readonly) - return; - - set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false, - current->active_mm); -} - -void set_kernel_text_ro(void) -{ - if (!kernel_set_to_readonly) - return; - - set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true, - current->active_mm); -} - #else static inline void fix_kernmem_perms(void) { } #endif /* CONFIG_STRICT_KERNEL_RWX */