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=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_NEOMUTT 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 E25B3C43381 for ; Mon, 4 Mar 2019 13:11:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B15282075B for ; Mon, 4 Mar 2019 13:11:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="koIKbFq/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="sddgU2aR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B15282075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wVIHqaSGA5QmJVFFTj/UbrsvQ+PcSEuQJbAJ+vKh54U=; b=koIKbFq/MyurK7 zRPs12v5IvPWMp05SMuOC4HnL1HQWxLmysmh1PwU5gE/L0ylhHu1WQ/LgDW3qfzsSCCvf/lsqs7NK PUDhlcuNl5gEL+CPX9xztE0Az51MxpGK5/b89+QWSmJbpwBpQvlJiet785+b3U1lPH+7F1LcCbt0g DyFJwig0nsfgHfwHeY7kq4wUBRyFlcidwJw+BqLakPfOFXTOMrIgma9ycRNI4kZG0/Rcw1NkMBQym OBI6yS3rNsixF8KB+xqkHQjdOS2HL7qSqRn6PfEh/upZexqtSC/68M7AmouvgzmkMdijafmpAxPuJ FfsCugHp+t+OtEaKYeMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0nN2-0007N6-4w; Mon, 04 Mar 2019 13:11:04 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0nMx-0007MM-St for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2019 13:11:01 +0000 Received: by mail-pg1-x543.google.com with SMTP id m2so3087245pgl.5 for ; Mon, 04 Mar 2019 05:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=i+uJsIH9vVyOV5Tk28y23klIfxYci68lEiPowiIlx3E=; b=sddgU2aRtJ2zYqDNcOUZzUk3M/eU6C/dPxzI/yarFrk5YXqKXTlkj9+V6Ej1gWGl5S 0Y00j8efBGBPNa38B9fwNBevPWrW4bRQn/oqwpPZl2mEOu7VDUlL2/NWR7kGcp/8ayOP N0WFcpQyvsiYdHTddw0D88Z+w4eW1PNS5EVEa0YW+pdelsy46Nk5okbwiL+l56G1rLRp 29tRCiS9Q840vVihdOrq3YC8lfunYrw3EvcMZxWUyrk195VG02sK+7l5nCxai5WslBOr mtj248N5e1raENfLI4cliIs/J1DmKCHFfC8aLYUNyNcKMYIUGSOidPjGzeTm7Brf/ltu pTEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=i+uJsIH9vVyOV5Tk28y23klIfxYci68lEiPowiIlx3E=; b=Sz11sRlh3HUjoOpTo+p08xHZWVOUleTxuhbj9ALCCYL1c1z/HyA3wvUPJ+vFQgiO5l Rj6Q7y0nMxnHp5ONwvFPNAmEaXD8wSSJeMRZhroNhKHCm5V84fOu3ibztx3pPCmDgPLL 5OphgCfujhpCL2k3PlKnaueyAt76BYawX4m9ncRrX0TQ3/XE7jTgf43iuxEerzNtONuc hMhrhI1ozrUg4krqKIGqaWt5CykSCyIqit7VmNZVJVoX1/UfjujGcm239MSOIYDMO/uD uzCXeSzDkXaSxuKrNHqasv6mhH/Odud4vuwqc98vI+0yOOA44y+CjP3nmgrxZyuHmvOg 8ZZA== X-Gm-Message-State: APjAAAWvYA4VrWzPhyL1N7tkfo52X1vohoLCZhtlB9wrSGf6yvA6Xo3t up5CI/5IbSFX560u5JvsOcjCpw== X-Google-Smtp-Source: APXvYqzHr+bDim597mkyh4dboXKIfYc7NYQ38mxKFIYbp8RFyPZGLKWjB/Fag6abhRGxq7b6vqo/4Q== X-Received: by 2002:a17:902:9a48:: with SMTP id x8mr13344843plv.98.1551705058879; Mon, 04 Mar 2019 05:10:58 -0800 (PST) Received: from kshutemo-mobl1.localdomain ([134.134.139.83]) by smtp.gmail.com with ESMTPSA id 20sm8185700pgr.80.2019.03.04.05.10.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 05:10:58 -0800 (PST) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id 72ACC300429; Mon, 4 Mar 2019 16:10:54 +0300 (+03) Date: Mon, 4 Mar 2019 16:10:54 +0300 From: "Kirill A. Shutemov" To: Steven Price Subject: Re: [PATCH v3 03/34] arm: mm: Add p?d_large() definitions Message-ID: <20190304131054.goxpqsosolkg7khf@kshutemo-mobl1> References: <20190227170608.27963-1-steven.price@arm.com> <20190227170608.27963-4-steven.price@arm.com> <20190301214715.hyzy5tevvwgki4w5@kshutemo-mobl1> <974310a0-0114-9a0c-9041-4e0394c4b9aa@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <974310a0-0114-9a0c-9041-4e0394c4b9aa@arm.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_051059_981756_F04052C5 X-CRM114-Status: GOOD ( 17.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Dave Hansen , Arnd Bergmann , Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , x86@kernel.org, Will Deacon , linux-kernel@vger.kernel.org, Russell King , linux-mm@kvack.org, =?utf-8?B?SsOpcsO0bWU=?= Glisse , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, "Liang, Kan" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 04, 2019 at 11:56:13AM +0000, Steven Price wrote: > On 01/03/2019 21:47, Kirill A. Shutemov wrote: > > On Wed, Feb 27, 2019 at 05:05:37PM +0000, Steven Price 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 arm, we already provide most p?d_large() macros. Add a stub for PUD > >> as we don't have huge pages at that level. > > > > We do not have PUD for 2- and 3-level paging. Macros from generic header > > should cover it, shouldn't it? > > > > I'm not sure of the reasoning behind this, but levels are folded in a > slightly strange way. arm/include/asm/pgtable.h defines > __ARCH_USE_5LEVEL_HACK which means: > > PGD has 2048 (2-level) or 4 (3-level) entries which are always > considered 'present' (pgd_present() returns 1 defined in > asm-generic/pgtables-nop4d-hack.h). > > P4D has 1 entry which is always present (see asm-generic/5level-fixup.h) > > PUD has 1 entry (see asm-generic/pgtable-nop4d-hack.h). This is always > present for 2-level, and present only if the first level of real page > table is present with a 3-level. > > PMD/PTE are as you might expect. > > So in terms of tables which are more than one entry you have PGD, > (optionally) PMD, PTE. But the levels which actually read the table > entries are PUD, PMD, PTE. > > This means that the corresponding p?d_large() macros are needed for > PUD/PMD as that is where the actual entries are read. The asm-generic > files provide the definitions for PGD/P4D. Makes sense. Only additional thing worth nothing that ARM in 2-level paging case folds PMD manually without help from generic headres. I'm partly responsible for the mess with folding. Sorry that you need to explain this to :P -- Kirill A. Shutemov _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel