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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9C933C433EF for ; Tue, 19 Apr 2022 14:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=JX15Lsrumu7tREE1pdS/jqtbZUK3Nk8+jxZGWHO6NVw=; b=HWQHf022JL3RDH Ah3yLTa6obqN3MDSZYXts3Oo3lTTAAdV8Zv7A8MCtD3BL/bMlPHK2Ky85/JEmL37G+kIofdZzv0A8 NIhUHBixyWIOecgonSsYQb96rREMYMWAhehv5fPp7wU2p3sC663iTSc370PfTM99/d9ivDohPsMan /wW9+heBzp5/9y0plECtrV5BY3ny6l9UTo+lx2DSP8x3ke1ETE1pTKfinipUsb3e4D1D3uNQyixJ+ ZwXIG6bQLqiarfvG76k40xg1NY0mC4D5BsbBhOJRV+B9DJGOZ2b0h/RXli35ZalG7ds9lLd+8yM4b TBTOMg+fHCYSy2nlG+aA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngpAR-004OoG-PO; Tue, 19 Apr 2022 14:49:24 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngo8z-003xbX-CC for linux-arm-kernel@lists.infradead.org; Tue, 19 Apr 2022 13:43:51 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7703A615D4; Tue, 19 Apr 2022 13:43:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B4BAC385A5; Tue, 19 Apr 2022 13:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375826; bh=l4gigy3iODJQ8aF6vkclNEbKoZHxSxxrBtC8fcT83JY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=adAsUeF8sXGrAV9UjKuVAbxBCr1Z3Hj0eUmbHyY7Wcy388GLqoiFHyd92z6CMe1w5 UaCUoB6KMdLDADxfNIzVdT7ojRM5tjkHHfn3oa8yyAZnVlV5ed3/+4IWxYnt/eSCx6 d8/lRG03Q7OcBWdG0YkOq17Kz4f9S+/E9X59RViTMTHN+XzOn12Oam8VqqnlBHy1tb 7G9RTpV7pMI/ns/mS20UE2hnALBZSd34NtL7aSuRdigbDW80TlHLRDp4yOqjpuYnFF kZO/Ak4WAur6w6Q0WZvxWhWivYZogNYna7cqKvqUQNwaa6drmZ8cEPnj/7baBZ3h7M REJ8hYRP2ehsA== Date: Tue, 19 Apr 2022 14:43:39 +0100 From: Will Deacon To: Muchun Song Cc: Steven Price , catalin.marinas@arm.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, lengxujun2007@126.com, arnd@arndb.de, smuchun@gmail.com, duanxiongchun@bytedance.com, quic_qiancai@quicinc.com, aneesh.kumar@linux.ibm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] arm64: mm: fix pmd_leaf() Message-ID: <20220419134339.GA6143@willie-the-truck> References: <20220411122653.40284-1-songmuchun@bytedance.com> <20220413101929.GA1229@willie-the-truck> <64d4288e-7776-a3fd-5ee4-70486dfd0394@arm.com> <20220414100535.GB2298@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220419_064349_601886_965CF0D1 X-CRM114-Status: GOOD ( 33.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 14, 2022 at 07:18:11PM +0800, Muchun Song wrote: > On Thu, Apr 14, 2022 at 11:05:35AM +0100, Will Deacon wrote: > > On Wed, Apr 13, 2022 at 11:39:49AM +0100, Steven Price wrote: > > > On 13/04/2022 11:19, Will Deacon wrote: > > > > The documentation/comment that Steven referred to also desperately needs > > > > clarifying as it currently states: > > > > > > > > "Only meaningful when called on a valid entry." > > > > > > > > whatever that means. > > > > > > The intention at the time is that this had the same meaning as > > > pmd_huge() (when CONFIG_HUGETLB_PAGE is defined), which would then match > > > this patch. This is referred in the comment, albeit in a rather weak way: > > > > > > > * This differs from p?d_huge() by the fact that they are always available (if > > > > * the architecture supports large pages at the appropriate level) even > > > > * if CONFIG_HUGETLB_PAGE is not defined. > > > > > > However, the real issue here is that the definition of pmd_leaf() isn't > > > clear. I know what the original uses of it needed but since then it's > > > been used in other areas, and I'm afraid my 'documentation' isn't > > > precise enough to actually be useful. > > > > > > At the time I wrote that comment I think I meant "valid" in the AArch64 > > > sense (i.e. the LSB of the entry). PROT_NONE isn't 'valid' by that > > > definition (and I hadn't considered it). But of course that definition > > > of 'valid' is pretty meaningless in the cross-architecture case. > > > > arm64 'valid' + PROT_NONE is roughly what 'present' means. So we could say > > that this only works for present entries, but then Muchun's latest patch > > wants to work with !present which is why I tried to work this through. > > > > My bad. In the previous version, Aneesh seems want to make > pmd_leaf() works for a not present page table entry, I am > trying doing this in this version. Seems like I do the right > thing in the previous version from your explanation. > > I'll use the previos version and fix pud_leaf() as well and > update the documentation. Do you think this is okay? Yes, thanks, that sounds good to me. We can define both of these as present && !table. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel