From patchwork Thu May 10 18:55:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10392271 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 7229C6028E for ; Thu, 10 May 2018 18:55:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6041828D2C for ; Thu, 10 May 2018 18:55:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5339128D33; Thu, 10 May 2018 18:55:24 +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 C298628D2C for ; Thu, 10 May 2018 18:55:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC6BE6B063B; Thu, 10 May 2018 14:55:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B71C86B063C; Thu, 10 May 2018 14:55:17 -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 9EF246B063E; Thu, 10 May 2018 14:55:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 461B56B063C for ; Thu, 10 May 2018 14:55:17 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id m4-v6so1035874pgu.5 for ; Thu, 10 May 2018 11:55:17 -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=Ey4I0LBXWwGtnNiRrEmL5OiifRP1sHYRz5EdaSU7Y3c=; b=NAgsFVEg0jQApL6A/e0rrEWNgKPWMITXMGEwNcSKnMZXfFCC1OAGLve8qiTnBWTneh N62DMPu54fKbpm2Vw5Bv5mhM+7gE+LLqQmFS+56UMtzyalzrk+UZkqb7ef4OC5GU58VY QakiDrdg/4GY8Iz6IVDsvg70XcPDZIbZIQXONKx4KDNFtJ/V1HOuZal5BvmoZLIpYmZL rnV2I55AkmdIgt9vx57CMwXTluq3wt+D2xtn+hmI2KrazBZf5HNdtrPqsoyDbKc7hbsz nG1rb0AUMlQT4YEQ3y4IfEexBi8lTrqmSVxy6bc2WOYImWTNCWsUsv7wQ1q0kKFLIqhh QJlQ== X-Gm-Message-State: ALKqPwewICupW4IPq50nkKmipxVcCPdCpGdypUUTcUrVyV+m19RdZF6r r+P5U3fLTfZMvKB9A2NY0gcphiFX0Pbr7e9p4+EUkVj1/3OL7A8k+AUghOsOn1SR3aOv4uw8Rbm jnHO2GFbvz9HmnZ9CCCIe+H5hBn8iu1XxOrHMeJ5AYS19myjRg3b3kajT4wo+e30JZw== X-Received: by 2002:a17:902:7615:: with SMTP id k21-v6mr2363976pll.97.1525978516977; Thu, 10 May 2018 11:55:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqjXY1bPdEp0ymq34OJAQl7adnLpl+8xB4Pf99tSkGzxmJwtLHyfwU0s4R6Y1+PNCoqbW8W X-Received: by 2002:a17:902:7615:: with SMTP id k21-v6mr2363907pll.97.1525978515756; Thu, 10 May 2018 11:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525978515; cv=none; d=google.com; s=arc-20160816; b=HFN5xIaN1bBuCoMGAeNsJHs03mQtH1jGt423O0/4jaPJRWE1y/lGVXBOtAEyJHNaQ+ c8uk4xW3Uu6WSspK0OdCYYlMl7yoGXoN6LiO2xqWKOLph/1LWfJ0RzkTLgagBRNb7y8M jUhBwhMRtRDGhetZEAQpxfYYTgtnRXGdqvpNsPPPGNs8CT6mYceB8Nb/l7hWjzSoP/Yn TVWaL5xW4zmyiwU66H02euMb6vWT3MA84k0c8pxzv4ohDls1RSS/ovQmFoBI2Z4YRIbu vc2kn4Z9r/0pwqn4DUyDYYMyiLiPyp+IexQvcZwKzjy4qBtQ3ivJemFFE/ABa101DkOE wA5g== 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=Ey4I0LBXWwGtnNiRrEmL5OiifRP1sHYRz5EdaSU7Y3c=; b=CnbCLLHAa94Tj1NLZZYQPaGH3xJ1b9oUXGpBNgHSNKuND13qDjbAAtith4a+JggZQM YOz//gIrQk44tOsR1BSa5w5n8Assu4QQM4KG3MYzET+LR7bX6Ikx4GcpnbvuMwsw8iNz bmlpY+Qam0bzQwTl7Y3xD5F2Lpfwszw7PpBQEP0AH3y3V1Que6rhNqFwUJutaT4Log4A WolXy3Y6+FHdhhAM0s29oF5d/3QqX/hscAEGROdcbS1TMNVWfpbpFLXtwCUF/2cCCQ7m OagxyjN377cPdWkHuYl+A9q8qacI9utlEvdESbe0QszST6Et3uQ47p/hHItFOuwV62sk Vc5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lldQ0M/P; 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 u10-v6si1347377pfh.145.2018.05.10.11.55.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 11:55:15 -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=lldQ0M/P; 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 1DC9B2183F; Thu, 10 May 2018 18:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525978515; bh=ksWBaM0MwsMNhm/JxMVZqu44oRBc6Zknw6oLrb2/MBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lldQ0M/PlK3TNcFBOVtE0qg8gm8lYypIoAPspn1GOsHiBTg/7r7hxAe+CN8cq/6cm I4cQxrY3uPScp+pXL6gNVf892B72NWR+WVX2GRZMORPKWSp6gZI/t7a+3j4KZVjqbD tSp84RNH+zVXLH3j31oT0qEVguT//E5wxRKs7JeU= 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 v3 2/2] mm: provide a fallback for PAGE_KERNEL_EXEC for architectures Date: Thu, 10 May 2018 11:55:07 -0700 Message-Id: <20180510185507.2439-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510185507.2439-1-mcgrof@kernel.org> References: <20180510185507.2439-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. Suggested-by: Matthew Wilcox Signed-off-by: Luis R. Rodriguez --- include/asm-generic/pgtable.h | 4 ++++ mm/nommu.c | 4 ---- mm/vmalloc.c | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 4e310e543fc8..81371468ed5a 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1097,6 +1097,10 @@ static inline void init_espfix_bsp(void) { } # define PAGE_KERNEL_RO PAGE_KERNEL #endif +#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