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 8F80FC4332F for ; Thu, 17 Nov 2022 07:10:04 +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:MIME-Version:Message-ID:Date:Subject:CC :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=RiQ6peJS3kLU5qdUx1o8nvTl0AhcLXM3VDeycJmiEQw=; b=nl3p3hsqBjAfkW fhc0cRUycDdFlLAxJ0HYmcHKJlEhrANzvCIvyfI02q82KeAIOuc4icc1BuTA1EBfQ7wQ57EflcLO5 gDR3uLph4A560/o1NzJ6imr36oYXCzp/ATwBQO0MBWUyQANOWEO3HrHmeyqOaoNK2ViC8CqpFRHEt EdEskhZ4pp1j+yf83hgIJWUm2mkZYu9WROJjtdw9jEeXo6EXrHqn5zWCntFw1cTdbOvjRWNK64Bv3 QraqJbUxe90UnsypCDAQuOrlgIG4XYg78yVt9dQA1dUn2nz1UePpHZWPPaJ1u9c+A5cuH8U0XL8k7 cxjJTmPzqNWybHwhiOHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovZ12-00B6gy-Px; Thu, 17 Nov 2022 07:08:52 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovZ0z-00B6db-PC for linux-arm-kernel@lists.infradead.org; Thu, 17 Nov 2022 07:08:51 +0000 Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NCWGM1754zHvyV; Thu, 17 Nov 2022 15:08:11 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 15:08:26 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 15:08:25 +0800 From: Liu Shixin To: Catalin Marinas , Will Deacon , Denys Vlasenko , Kefeng Wang , Anshuman Khandual , David Hildenbrand , Rafael Aquini , Pasha Tatashin CC: , , Liu Shixin Subject: [PATCH v2 0/2] arm64: fix two bug about page table check Date: Thu, 17 Nov 2022 15:56:00 +0800 Message-ID: <20221117075602.2904324-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221116_230850_004099_39F852BC X-CRM114-Status: UNSURE ( 7.73 ) X-CRM114-Notice: Please train this message. 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 Denys Vlasenko has reported two bug about page table check on arm64. On arm64, pmd_present() contains non-leaf pmd and invalid pmd too. When collapse hugepage, the pmd is non-leaf and should skip the check. Use pmd_leaf() instead of pmd_present(). When split hugepage, the pmd will be marked as invalid and then populate. So we should decrease file_map_count when invalid pmd and then increase when populate the pmd. Add pmd_valid() check. v1->v2: Update comment and optimize the code by moving p?d_valid() at first place suggested by Mark. Liu Shixin (2): arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud arm64/mm: fix incorrect file_map_count for invalid pmd/pud arch/arm64/include/asm/pgtable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel