From patchwork Wed Nov 16 08:38:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 1717 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp11925wru; Tue, 15 Nov 2022 23:55:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zUoV7viEVMlkHRjySCBQUpfpA/oNUvv66GYc3VJoWntFVKcOCYkw4yxRX68XDNafyj+vm X-Received: by 2002:a17:902:ec8a:b0:186:9fc5:6c2c with SMTP id x10-20020a170902ec8a00b001869fc56c2cmr7721421plg.174.1668585359223; Tue, 15 Nov 2022 23:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668585359; cv=none; d=google.com; s=arc-20160816; b=FVyjhfuHfvykYoVYrOE5ftbzcbhFzhPZ9JmTbq930VnDkW/gISZGw1TPMUXCL7StaH JPTDk4xbbbY3k313AnfUcSX3AULX5YUznHks+Vmg8LeNqJa8RCyUBYdV9Q9D73830OSj 4AM1TJGccb2iaLkBeksokIIf6n/asYtPvYaITfgsgD47vOqz9Vbo69wNkWJTJT7VGOZ6 4uIJbge46bpiEorgo4KMemlaBC9C6CBtcwfL5i7fK4YoZCIyYMH3w2JFnecUNzvE4sT4 21gsgLapw4hpMqqZHBwLRiwqYPFpwK3v20I+UIWRHlUNuv6vvMvYKbc9JSuo5BP4mYQ6 NEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BWRAiSYfv+uO1EKkG7dn/jo2oGFebp95M1ItqY66FGs=; b=0kEfly6R7nbeWw0TXQwAuHfGm+xMlOEFIdADbj2PN5O+r+AcNJfiYGTeXRBQkUs32R AsJM82BO5pQpUxBE+mZLciCh4W2QyVNLP+TL/ApE/GJLqWZx5/4PljJifPHSmqpSDcgG TslBAhC1fubtibdMfQq0EEn5D+beLJWzdOWQTAVM1jdXW1mfc7XKUeUMhBw8bYVNRIqP YL6GqM6oW6snazYUyaFSN70VXV0BUPKOS9Gbx0GRhFRPf5jpoh7Rh8XTjU3HNSQB7kdt nv4WGdLkoC16posXEXZfXJNEmlLaVX54xnEfoPGTSVBgf3asKEZGGvNjMluC51hgppIJ cMwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a635c4d000000b00476dd604aa8si2193446pgm.767.2022.11.15.23.55.45; Tue, 15 Nov 2022 23:55:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232688AbiKPHvE (ORCPT + 99 others); Wed, 16 Nov 2022 02:51:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiKPHvC (ORCPT ); Wed, 16 Nov 2022 02:51:02 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83AD13D24 for ; Tue, 15 Nov 2022 23:51:01 -0800 (PST) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NBwFd4dq3zHw0H; Wed, 16 Nov 2022 15:50:29 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 16 Nov 2022 15:51:00 +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; Wed, 16 Nov 2022 15:50:59 +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 0/2] arm64: fix two bug about page table check Date: Wed, 16 Nov 2022 16:38:09 +0800 Message-ID: <20221116083811.464678-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: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749638561643612186?= X-GMAIL-MSGID: =?utf-8?q?1749638561643612186?= 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. 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(-)