From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 CD4BFC0650E for ; Mon, 1 Jul 2019 09:46:14 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 87BAC20B7C for ; Mon, 1 Jul 2019 09:46:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87BAC20B7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45cjDh4pSfzDqX3 for ; Mon, 1 Jul 2019 19:46:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=arm.com (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=catalin.marinas@arm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lists.ozlabs.org (Postfix) with ESMTP id 45cjBk4ps8zDqTG for ; Mon, 1 Jul 2019 19:44:25 +1000 (AEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E1E752B; Mon, 1 Jul 2019 02:44:20 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 727AD3F718; Mon, 1 Jul 2019 02:44:19 -0700 (PDT) Date: Mon, 1 Jul 2019 10:44:17 +0100 From: Catalin Marinas To: Nicholas Piggin Subject: Re: [PATCH v2 1/3] arm64: mm: Add p?d_large() definitions Message-ID: <20190701094417.GB21774@arrakis.emea.arm.com> References: <20190701064026.970-1-npiggin@gmail.com> <20190701064026.970-2-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190701064026.970-2-npiggin@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Anshuman Khandual , Ard Biesheuvel , Will Deacon , Steven Price , "linux-mm @ kvack . org" , Andrew Morton , "linuxppc-dev @ lists . ozlabs . org" , "linux-arm-kernel @ lists . infradead . org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Jul 01, 2019 at 04:40:24PM +1000, Nicholas Piggin wrote: > walk_page_range() is going to be allowed to walk page tables other than > those of user space. For this it needs to know when it has reached a > 'leaf' entry in the page tables. This information will be provided by the > p?d_large() functions/macros. > > For arm64, we already have p?d_sect() macros which we can reuse for > p?d_large(). > > pud_sect() is defined as a dummy function when CONFIG_PGTABLE_LEVELS < 3 > or CONFIG_ARM64_64K_PAGES is defined. However when the kernel is > configured this way then architecturally it isn't allowed to have a > large page that this level, and any code using these page walking macros > is implicitly relying on the page size/number of levels being the same as > the kernel. So it is safe to reuse this for p?d_large() as it is an > architectural restriction. > > Cc: Catalin Marinas > Cc: Will Deacon > Signed-off-by: Steven Price Acked-by: Catalin Marinas