Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1035821rwb; Fri, 18 Nov 2022 11:42:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6FTyzD4jCKmdf5e2KyRDyQzTiRA58dzcRYn29vObdziCsMiGkRmBPt/IniaftpJSEUSklR X-Received: by 2002:a17:90a:1bc6:b0:212:cf2d:4ff0 with SMTP id r6-20020a17090a1bc600b00212cf2d4ff0mr15510495pjr.132.1668800553533; Fri, 18 Nov 2022 11:42:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668800553; cv=none; d=google.com; s=arc-20160816; b=fAa7YJWuZABD4RZ7FLf9tsux8GI/6gzG+tOYi1CeYq1JnXNPXEWlSNnnXpAdrHIbdc ly2yU7H+y+vqqdHOawdC2+G3m9ozj9s2oY3yWKcgqGu+MThQEnaLeIhDdjzIQ8Y4b14q 75blcHzOeS1G47gu3+ThdwgASeKEwOESMgNtmNhhw+C8ITu6iyA3vxN0Gs3DSnsapFPR i0Z7nAre0Ix/DWTqTmy1ybVKwoLXpQCXWfd3rxbqcqJyDOWLibNFfW+2tRhjnwIydjw6 p+eT78D6lGc5GVgBvYfMNCfIfokI7mnP2f4GFm8WinSmhpA5fCmXbCRtHqPSdUZvow02 RZkA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=p3L+OUUcLVYDnI3fhfAa5DCwp51043H4HnG67m84+ls=; b=w0kXW9Iyw+1h9hN28sYi0VW4LSbFL/2lzpIra7ESQqNeUJkcx20ECpmL8MPLZFAIG3 0OZCwy6npdxDE6b3achbTquHcMBkrc/H38YteNZTO8RLpmHxtE/RTi17GyQQkdQX27bs CB1J28DcxZc1TufxhULrl9ReiUsbhagxpuccRy7a9pFDDb7k3l4RQ6YWVwpYVaWg16N9 daTMs+AIjMdo4gff+G0XewCjvO51QzmPWYxBce9F06EHVQJEGuuDOXUvc689lJZYF1Sj y9L/i1k9NFCNljxUaewswwQPqtPHYYxbKv+pPNTOavSAukfLvLkoPZS1CBiHqLV2N24V RNgA== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t70-20020a638149000000b00476f2b0b330si4773636pgd.700.2022.11.18.11.42.21; Fri, 18 Nov 2022 11:42:33 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235558AbiKRTfL (ORCPT + 90 others); Fri, 18 Nov 2022 14:35:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235428AbiKRTfI (ORCPT ); Fri, 18 Nov 2022 14:35:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 359791A22A for ; Fri, 18 Nov 2022 11:35:08 -0800 (PST) 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 C633F62716 for ; Fri, 18 Nov 2022 19:35:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EE61C433C1; Fri, 18 Nov 2022 19:35:05 +0000 (UTC) From: Catalin Marinas To: David Hildenbrand , Pasha Tatashin , Anshuman Khandual , Liu Shixin , Rafael Aquini , Denys Vlasenko , Kefeng Wang , Will Deacon Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: (subset) [PATCH v2 0/2] arm64: fix two bug about page table check Date: Fri, 18 Nov 2022 19:35:02 +0000 Message-Id: <166879995436.2970319.8402648264263746100.b4-ty@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117075602.2904324-1-liushixin2@huawei.com> References: <20221117075602.2904324-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 On Thu, 17 Nov 2022 15:56:00 +0800, Liu Shixin wrote: > 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. > > [...] Applied to arm64 (for-next/fixes), thanks! [1/2] arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud https://git.kernel.org/arm64/c/5b47348fc0b1 I only merged the first patch in this series as Will had some questions on the second patch (it does seem weird that the pud and pmd functions are different w.r.t. the p*d_user() checks). -- Catalin