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=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 8F1B6C3A59F for ; Mon, 26 Aug 2019 13:17:30 +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 CD47F206E0 for ; Mon, 26 Aug 2019 13:17:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="S0Qm85v5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD47F206E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46HCGb28WfzDqgZ for ; Mon, 26 Aug 2019 23:17:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=willy@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="S0Qm85v5"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46HCBR6FZnzDqQ9 for ; Mon, 26 Aug 2019 23:13:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=urDTYQxxHpDLHKYV3DkLPJyBgIdOzd8vbZl6Cfapxyc=; b=S0Qm85v5u+mC94Z+1NTp3zLxy RVikWlbB8+mD7D3i6pKW1vaRh6+mpvdmY0hZwt7QeNMOfDK4v1mKu4uLruFJY+80WEeNiclw0bMni VgFWVa4FMxmnuDh4DG/NHs34XNaySiBjcLQotEzPIlKfk98LzJOfOfATotjcOvgRsK0BvJg1vvrY6 PC3VQkaRupcuqt52WqBPC5JvmCjmjjLmU1rbYgod7HJ/IZrUNwVg/kxESAnrEZvrP/71g/C/cTVL3 KSmHw9glYY9tQdIrKjhRnF9olVe6RlSSQh43S7mnoLe1VnIU+Q8j9tFnodpiFcOU1xeFxRbNIYZHd 4Bsb3y2yA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i2Eo0-0002Mw-Mf; Mon, 26 Aug 2019 13:13:08 +0000 Date: Mon, 26 Aug 2019 06:13:08 -0700 From: Matthew Wilcox To: Anshuman Khandual Subject: Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers Message-ID: <20190826131308.GA15933@bombadil.infradead.org> References: <1565335998-22553-1-git-send-email-anshuman.khandual@arm.com> <20190809101632.GM5482@bombadil.infradead.org> <20190809135202.GN5482@bombadil.infradead.org> <7a88f6bb-e8c7-3ac7-2f92-1de752a01f33@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a88f6bb-e8c7-3ac7-2f92-1de752a01f33@arm.com> User-Agent: Mutt/1.11.4 (2019-03-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 , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , James Hogan , Tetsuo Handa , Heiko Carstens , Michal Hocko , linux-mm@kvack.org, Dave Hansen , Paul Mackerras , sparclinux@vger.kernel.org, Thomas Gleixner , linux-s390@vger.kernel.org, x86@kernel.org, Russell King - ARM Linux , Steven Price , Jason Gunthorpe , linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, Kees Cook , Masahiro Yamada , Mark Brown , Dan Williams , Vlastimil Babka , Sri Krishna chowdary , Ard Biesheuvel , Greg Kroah-Hartman , linux-mips@vger.kernel.org, Ralf Baechle , linux-kernel@vger.kernel.org, Paul Burton , Mike Rapoport , Vineet Gupta , Martin Schwidefsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Aug 26, 2019 at 08:07:13AM +0530, Anshuman Khandual wrote: > On 08/09/2019 07:22 PM, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: > >> On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > >>> On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: > >>>> Should alloc_gigantic_page() be made available as an interface for general > >>>> use in the kernel. The test module here uses very similar implementation from > >>>> HugeTLB to allocate a PUD aligned memory block. Similar for mm_alloc() which > >>>> needs to be exported through a header. > >>> > >>> Why are you allocating memory at all instead of just using some > >>> known-to-exist PFNs like I suggested? > >> > >> We needed PFN to be PUD aligned for pfn_pud() and PMD aligned for mk_pmd(). > >> Now walking the kernel page table for a known symbol like kernel_init() > > > > I didn't say to walk the kernel page table. I said to call virt_to_pfn() > > for a known symbol like kernel_init(). > > > >> as you had suggested earlier we might encounter page table page entries at PMD > >> and PUD which might not be PMD or PUD aligned respectively. It seemed to me > >> that alignment requirement is applicable only for mk_pmd() and pfn_pud() > >> which create large mappings at those levels but that requirement does not > >> exist for page table pages pointing to next level. Is not that correct ? Or > >> I am missing something here ? > > > > Just clear the bottom bits off the PFN until you get a PMD or PUD aligned > > PFN. It's really not hard. > > As Mark pointed out earlier that might end up being just a synthetic PFN > which might not even exist on a given system. And why would that matter?