From patchwork Thu May 10 01:44:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10391033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A0E0A60353 for ; Thu, 10 May 2018 01:44:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 929BE288DA for ; Thu, 10 May 2018 01:44:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8733A288E4; Thu, 10 May 2018 01:44:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0E30288DA for ; Thu, 10 May 2018 01:44:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CEB26B05AF; Wed, 9 May 2018 21:44:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0EA1C6B05B2; Wed, 9 May 2018 21:44:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C54C26B05B0; Wed, 9 May 2018 21:44:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id 8F0FC6B05AF for ; Wed, 9 May 2018 21:44:51 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id t5-v6so335537ply.13 for ; Wed, 09 May 2018 18:44:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=uZ3mtURJToymJdzqmknRW4VLNJ6gXdyk5Tf2p2rYSzw=; b=ILFvxvs3cQ4JFNbtsV+8bHYLtzkQ5NowFz7Cid7/wnPaDfN00PWge+VeBka5Jk+zZB rxz/z28ZKpWIqyH1q84iHW5BayL8laD7iBGt1HjHfdRclCpaE50XpduNSXA1LZjzFS/i nLR+XTu9vu9wxz+8/LzG1dwTraTy2KP18Q3cDy/4qwDh7RI6Guq+19em9BM7VwrGKB6f lSKmzuy5NQGAXj2Q+XxLkS1i42EwV3dYb0yev8DpOybizfZTBk28gsuqTqJ7jxWAIEkz RDCw30QIsPouhA8qaCQhSslYCQie+CytNgCmWFecuxOm3Bg9aNI/mbTZJTsN5GbgU/03 VghQ== X-Gm-Message-State: ALKqPwd10/I1C6hUsKui9x+dSZj4NGoqt8c4jeqLsCVI5T+HZ5l4hUuP 51faRd9YCAJwVKTAg/Z6X/CiymgtonmwHvfAW5gebd4e4+iI5XPqMa/j833RduufYDV71YjVcVa oS4JfC/Pfm7gR8oiBJ8FJmW8BsgrIzVFQeBHkSQk4UH2yHT9aCf+gBzZ36UC0YvPW8w== X-Received: by 2002:a17:902:8bc5:: with SMTP id r5-v6mr297563plo.182.1525916691256; Wed, 09 May 2018 18:44:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpQtTVcAYlesQ7Cd0Ub29fzoR29LiY8wAqiDj8+EvE09kutqdv7a3AH+4Xljsc3ka1NZhzW X-Received: by 2002:a17:902:8bc5:: with SMTP id r5-v6mr297537plo.182.1525916690697; Wed, 09 May 2018 18:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525916690; cv=none; d=google.com; s=arc-20160816; b=0Sm4W18aVMxnDY7CIwBmIBpru4pE1L4fCBt6amSm9D7xSecSVKYMt+1AWeBmPrUdLr MnvtKVsBI99oA75cX/q6pnHLIFuPkgBXPlBvlF3vYSyS2ntEWqRTTnmFGFWmVVBa3XMp Vu3CkHDzKqaIe1Np6TfBdZHc8FrG7KRcWBXzKIM9+tVz5J2OmDQcyriS9VMI4IGspv+O mYXvfM3XRJQH0kiy7gkZ1KQ2Ej+T7odjLVxm2OS2qZjcA1Avo5hiZfsc7Su6vBzDTPXi nwsvW54+6XHwAr/WPMN/244//Is4U+JCYoMbABuKv618/cu4mWxrauI/+Cy5CSK/TXLR EaOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=uZ3mtURJToymJdzqmknRW4VLNJ6gXdyk5Tf2p2rYSzw=; b=09R6Eibt1uDhVQ2y95ZXxl/EBuInLh59Trs613rTXXxMZ+aN46qqypIq4NoQ9b8RlH narGhsPLi7vadC2ILuHLG7nKGlfAJ+TCpIcTo3F3ReieJlrXWYcO49f6zeoM8JRs1N6z QL+kbT6FJGjlpv29FN/HgHJLRkfhiADPDtLusNThC410CLWgqagRjAOLEv412vy6Efv3 Bh8BbJlck4RSKlHWIFSB/tn8X+3nF2qc3Rgm/8R3KBCgb89QTVANahF1J1lRi+/wpDnz Br/CigVcEva+zOvRa8Ml1csx/BwM0hQ7FXE7pUA0ZMl2yKhj9Ygc9bP8kOgv4jkHRcdB A9PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAr0XswI; spf=pass (google.com: domain of mcgrof@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=mcgrof@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id h68-v6si14995882pgc.158.2018.05.09.18.44.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 18:44:50 -0700 (PDT) Received-SPF: pass (google.com: domain of mcgrof@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAr0XswI; spf=pass (google.com: domain of mcgrof@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=mcgrof@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DC0021788; Thu, 10 May 2018 01:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525916690; bh=bctlUuWfdrKRtw0EEgWS1V+8SqEv3HJ4totKuwwIJEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAr0XswIn3ieR7PcQzkrrnzE5Ct5S8tohjPD83klGPKcNtY3Ujrmoa9rIb8zTEmEe ru5Ne5lzuq4KLzmrNWMHeCrstx8yCPx9Krr25msPeqmaFDMsQIpLKeNcCJWNsgyWP2 Toexr8uPVJHqTChrHcTO3OCJFylFPZ5rPm7OlcB8= From: "Luis R. Rodriguez" To: arnd@arndb.de Cc: gregkh@linuxfoundation.org, willy@infradead.org, geert@linux-m68k.org, linux-m68k@lists.linux-m68k.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH v2 2/2] mm: provide a fallback for PAGE_KERNEL_EXEC for architectures Date: Wed, 9 May 2018 18:44:47 -0700 Message-Id: <20180510014447.15989-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510014447.15989-1-mcgrof@kernel.org> References: <20180510014447.15989-1-mcgrof@kernel.org> 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: X-Virus-Scanned: ClamAV using ClamSMTP Some architectures just don't have PAGE_KERNEL_EXEC. The mm/nommu.c and mm/vmalloc.c code have been using PAGE_KERNEL as a fallback for years. Move this fallback to asm-generic. Architectures which do not define PAGE_KERNEL_EXEC yet: o alpha o mips o openrisc o sparc64 Suggested-by: Matthew Wilcox Signed-off-by: Luis R. Rodriguez --- include/asm-generic/pgtable.h | 12 ++++++++++++ mm/nommu.c | 4 ---- mm/vmalloc.c | 4 ---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 890fc54f4713..39e9bd66c786 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1107,6 +1107,18 @@ static inline void init_espfix_bsp(void) { } # define PAGE_KERNEL_RO PAGE_KERNEL #endif +/* + * Current architectures known to not define PAGE_KERNEL_EXEC: + * + * o alpha + * o mips + * o openrisc + * o sparc64 + */ +#ifndef PAGE_KERNEL_EXEC +# define PAGE_KERNEL_EXEC PAGE_KERNEL +#endif + #endif /* !__ASSEMBLY__ */ #ifndef io_remap_pfn_range diff --git a/mm/nommu.c b/mm/nommu.c index 13723736d38f..08ad4dcd281d 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -364,10 +364,6 @@ void *vzalloc_node(unsigned long size, int node) } EXPORT_SYMBOL(vzalloc_node); -#ifndef PAGE_KERNEL_EXEC -# define PAGE_KERNEL_EXEC PAGE_KERNEL -#endif - /** * vmalloc_exec - allocate virtually contiguous, executable memory * @size: allocation size diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ebff729cc956..89543d13e32a 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1920,10 +1920,6 @@ void *vzalloc_node(unsigned long size, int node) } EXPORT_SYMBOL(vzalloc_node); -#ifndef PAGE_KERNEL_EXEC -# define PAGE_KERNEL_EXEC PAGE_KERNEL -#endif - /** * vmalloc_exec - allocate virtually contiguous, executable memory * @size: allocation size