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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS 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 EAF32C10F01 for ; Mon, 18 Feb 2019 17:22:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4680217F9 for ; Mon, 18 Feb 2019 17:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390300AbfBRRWj (ORCPT ); Mon, 18 Feb 2019 12:22:39 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34702 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbfBRRWg (ORCPT ); Mon, 18 Feb 2019 12:22:36 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 70A19A78; Mon, 18 Feb 2019 09:22:36 -0800 (PST) Received: from [10.1.196.69] (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9CA853F675; Mon, 18 Feb 2019 09:22:33 -0800 (PST) Subject: Re: [PATCH 01/13] arm64: mm: Add p?d_large() definitions To: Mark Rutland Cc: x86@kernel.org, Arnd Bergmann , Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , Dave Hansen , Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , linux-arm-kernel@lists.infradead.org References: <20190215170235.23360-1-steven.price@arm.com> <20190215170235.23360-2-steven.price@arm.com> <20190218112922.GT32477@hirez.programming.kicks-ass.net> <20190218142951.GA10145@lakrids.cambridge.arm.com> <20190218150657.GU32494@hirez.programming.kicks-ass.net> <20190218170451.GB10145@lakrids.cambridge.arm.com> From: Steven Price Message-ID: Date: Mon, 18 Feb 2019 17:22:32 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190218170451.GB10145@lakrids.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/02/2019 17:04, Mark Rutland wrote: > On Mon, Feb 18, 2019 at 03:30:38PM +0000, Steven Price wrote: >> On 18/02/2019 15:06, Peter Zijlstra wrote: >>> On Mon, Feb 18, 2019 at 02:29:52PM +0000, Mark Rutland wrote: >>>> I think that Peter means p?d_huge(x) should imply p?d_large(x), e.g. >>>> >>>> #define pmd_large(x) \ >>>> (pmd_sect(x) || pmd_huge(x) || pmd_trans_huge(x)) >>>> >>>> ... which should work regardless of CONFIG_HUGETLB_PAGE. >>> >>> Yep, that. >> >> I'm not aware of a situation where pmd_huge(x) is true but pmd_sect(x) >> isn't. Equally for pmd_huge(x) and pmd_trans_huge(x). >> >> What am I missing? > > Having dug for a bit, I think you're right in asserting that pmd_sect() > should cover those. > > I had worried that wouldn't cater for contiguous pmd entries, but those > have to be contiguous section entries, so they get picked up. > > That said, do we have any special handling for contiguous PTEs? We use > those in kernel mappings regardless of hugetlb support, and I didn't > spot a pte_large() helper. There's no special handling for contiguous PTEs because the page walk code doesn't care - each PTE is valid individually even if it is part of a contiguous group. So the walker can descend all levels in this case. pte_large() if it existed would therefore always return 0. The pte_entry() callback obviously might go looking for the contiguous bit so that it can annotate the output correctly but that's different from a 'large' page. The code in arch/arm64/mm/dump.c simply looks for the PTE_CONT bit being set to do this annotation. Steve