Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5199861rwb; Mon, 21 Nov 2022 18:32:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Q4cb605Dl8gy/9AtEyH1cFJI/4llSCjAoFzKoPR+w7tzEB8G4VPZ/NwJmfvDGBmvPaBbs X-Received: by 2002:a17:902:7445:b0:188:ca57:8956 with SMTP id e5-20020a170902744500b00188ca578956mr9680736plt.117.1669084330743; Mon, 21 Nov 2022 18:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669084330; cv=none; d=google.com; s=arc-20160816; b=wjSwWIARawTgRE4TFpOP90jJ54LkybHHYYxzTcmeVg3TgWj8Pq58XgVMRnLCnziBF5 +uLZbFedkgKlUJt5G0AlRr64RPZ0JkepfClrn920WqXzcdPeJei+1P/hGoPWWSDV0oX7 pyngg4zgH4s9OVKO0scbvGDpw4SbRLQ6BgTb3z4Lug9mjvgJtkDtLbjdo5KMnnE3oLz6 hDC7v7VoHzWiP2MtytRxE8OJFpEe1BesYYg4hiyq3/8GPqz+OJUImeKt1/wKTG0e7cyJ iFiWRudomfmrZRy1tfzwskwBm5d42TcgohFnd7rIhD/Fg4Q2tcd1S/6k7CBWX6m2SARX DNDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=SvhFUeiEVuWbFEoZSEzN7GBNSaaUQTImTzIUrc399jM=; b=TDDexa91Wfl6NbkCTfWjAmqybpmLLqW+gRAYMaIAM32AiqlvlGXM6wK8hKYoq3aioF DJ+lLYY+Zy7afbm5syZ1GPi1R0cQXQUlkm5ZuTf20WVTqFhwl4zYzliTteENAALVonjQ KSou+yezCNzwtJqKXMgiiB215ww8wytRXkbQiCbVdg1Pp8L4Ty/U5HnO0fydBnFkfLjS B5Ht2+kKXFaGW+W6U67UPazqHFFr2ESvfXvJUX+KwiJM0hUgvtsqi1Me4QfIzRlNXM55 wmTp9/Qq27g6xdSuVaaxWeVYjqLi6BFB3gHnp/+eiGFomXo1easROd9Nt6ePSR6feLvT QdkQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a63f44b000000b0045fd05b2ce9si12190638pgk.521.2022.11.21.18.31.58; Mon, 21 Nov 2022 18:32:10 -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 S232003AbiKVBZC (ORCPT + 91 others); Mon, 21 Nov 2022 20:25:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiKVBZB (ORCPT ); Mon, 21 Nov 2022 20:25:01 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA36BC21 for ; Mon, 21 Nov 2022 17:25:00 -0800 (PST) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NGRLJ0LYgzFqRT; Tue, 22 Nov 2022 09:21:44 +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; Tue, 22 Nov 2022 09:24:58 +0800 Received: from [10.174.179.24] (10.174.179.24) 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; Tue, 22 Nov 2022 09:24:58 +0800 Subject: Re: [PATCH v2 2/2] arm64/mm: fix incorrect file_map_count for invalid pmd/pud To: Will Deacon References: <20221117075602.2904324-1-liushixin2@huawei.com> <20221117075602.2904324-3-liushixin2@huawei.com> <20221118143414.GG4046@willie-the-truck> <10cecbdf-eb06-873d-6b79-bfdb3197d2ec@huawei.com> <20221121181636.GD7645@willie-the-truck> CC: Catalin Marinas , Denys Vlasenko , Kefeng Wang , "Anshuman Khandual" , David Hildenbrand , Rafael Aquini , Pasha Tatashin , , From: Liu Shixin Message-ID: <1f4ef941-6b45-8562-1723-21048a639c18@huawei.com> Date: Tue, 22 Nov 2022 09:24:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20221121181636.GD7645@willie-the-truck> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.24] 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,NICE_REPLY_A, 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 On 2022/11/22 2:16, Will Deacon wrote: > On Mon, Nov 21, 2022 at 11:15:49AM +0800, Liu Shixin wrote: >> On 2022/11/18 22:34, Will Deacon wrote: >>> On Thu, Nov 17, 2022 at 03:56:02PM +0800, Liu Shixin wrote: >>>> static inline bool pud_user_accessible_page(pud_t pud) >>>> { >>>> - return pud_leaf(pud) && pud_user(pud); >>>> + return pud_valid(pud) && pud_leaf(pud) && pud_user(pud); >>> Not caused by this patch, but why don't we have something like a >>> pud_user_exec() check here like we do for the pte and pmd levels? >> As far as I know, there is no user use the user executable pud on arm64, so didn't define pud_user_exec(). > I can believe they don't get exposed to userspace at all, but exposing only > as non-executable doesn't sound right. So I would have thought that either > pud_user_accessible_page() would always return false or it would need to > check for the executable case too. Thanks for your advice, I will add the check for the executable case too. > > Will > . >