Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2724680imj; Mon, 18 Feb 2019 11:00:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IaOAibZRG+8Dihn5p8W+zoxP0asBGsk9akfVLRwO5C8rvvQZZB4MAzYRmnCrhdODXgUfyHz X-Received: by 2002:a63:a:: with SMTP id 10mr20071953pga.121.1550516408300; Mon, 18 Feb 2019 11:00:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550516408; cv=none; d=google.com; s=arc-20160816; b=v+5obI7VeeVXiOZ3EAflPF6b0CehbHqbuJzgbwojGC8xW7WaSLSF3mVVjkKj0imFNP D+EYE5tFAsjqym9rD++NHpuQ+3ANS/4IwhEloTyX9gpScjqs7cfQO/arFeIl7DWxd0QT wN3r4maN+bIxbnncidoAfBKZi1fxnGFshSoPR/NMXfDHfjye8Q4//GQnymzthZRPJt7o 1VWLStCijyF/kWhdBgrnvMJgJfFG88PlFwOkDcp14c+rMXqI4RO+5rVRx6TlAH69gXZ4 DmcMzgSqYfCV1viXaL/aTbtsbYHcYUm8zAbI/i/8UxCBe/4966ivbspJdBEBOefRK658 nDTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1flPHUUAFedhAd2fMzIDDL+MwERnyOqY+Bv7YRR5bhA=; b=mI0LX71kLinkEIVK2gRQ1iLGS3t9zhVbHouKJwZIKEA7iormuY5UQc/q22T+EH2qnZ ctHzOTRu96+wha8z4r9beq8MsoZjQ0Wby4G9EWcYLEb3ziGHx8tEI43RHs8uGaNxqoP1 w78Zl7ZFiaPlCJDEpOa4ba6LMCv5Bk0DC5PPAbLl6HMMjrnQ2EvGs4wKBFfCOT87lmNt 7VlGa5pIdXiwOYjYZK1POAvf2iJLhsLcjRGZ4G2Jlr2BLz39Z9QtIQC7W/ty41pH+zbY nPur1StQ3Nrl+bnJdQgoslmcFAd7SMlDn1T1u3JBnxx+Vq3RjPx1z6OGZi+1PFeWA9oz 5Hhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si14176738pgc.580.2019.02.18.10.59.52; Mon, 18 Feb 2019 11:00:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390243AbfBRRWj (ORCPT + 99 others); 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