From patchwork Wed Jul 25 15:21:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhong jiang X-Patchwork-Id: 10544181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5165A1822 for ; Wed, 25 Jul 2018 15:34:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F4E728573 for ; Wed, 25 Jul 2018 15:34:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 330D028618; Wed, 25 Jul 2018 15:34:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE77928573 for ; Wed, 25 Jul 2018 15:34:02 +0000 (UTC) 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:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=F/GC7KMVc2Pcf8TzXjPlxDKmCayBcQlm8548E0pxHs0=; b=dYwq8gljuGGKpb wRi7QU98Nwvnoi/O/s8YvI88G2t2Rg7uIhkIEIXr0r50lIddOXt0ewaehhQLyXQeQz6hMqHdPwTew gWtXuqyykh+dY4J9QW7ZbsAQho1VmL2AiZw9IVdz+dRLT+VAO6F+hHVfsgSF3g1allH0PIju5ao+3 VCbqRzvmfOTMZ2JDTlMoFiTe+DisJBAGBu2pxyu4fwAkiRQAur7uL+5kyqdTi+3qvBxJC5eY2W5N+ ctqRw7kqfqPlWhZD08jww1eXmSZRTHBH84fIJW/ko/d/rN90cWC5DuKQt85IG/OhwI6RVfuoMwFcn I7aN3kdeyIGibv7f4BiQ==; 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 1fiLnb-0008Az-OQ; Wed, 25 Jul 2018 15:33:59 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiLnY-000877-CK for linux-arm-kernel@lists.infradead.org; Wed, 25 Jul 2018 15:33:57 +0000 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BF2753BA54B1D; Wed, 25 Jul 2018 23:33:29 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.382.0; Wed, 25 Jul 2018 23:33:28 +0800 From: zhong jiang To: , , Subject: [RFC] mm: Do not look up the next level table when large page exist. Date: Wed, 25 Jul 2018 23:21:59 +0800 Message-ID: <1532532119-59955-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180725_083356_617341_ED1051D1 X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. 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: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, ard.biesheuvel@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP show_pte can show the kernel page table and user page table. user page table is totally four level table. but kernel page table can be a large page. Therefore, it need to check the page table. Signed-off-by: zhong jiang --- arch/arm64/mm/fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 1b40676..a397a54 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -169,13 +169,13 @@ void show_pte(unsigned long addr) pudp = pud_offset(pgdp, addr); pud = READ_ONCE(*pudp); pr_cont(", pud=%016llx", pud_val(pud)); - if (pud_none(pud) || pud_bad(pud)) + if (pud_none(pud) || pud_bad(pud) || pud_sect(pud)) break; pmdp = pmd_offset(pudp, addr); pmd = READ_ONCE(*pmdp); pr_cont(", pmd=%016llx", pmd_val(pmd)); - if (pmd_none(pmd) || pmd_bad(pmd)) + if (pmd_none(pmd) || pmd_bad(pmd) || pmd_sect(pmd)) break; ptep = pte_offset_map(pmdp, addr);