Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp593302ybb; Fri, 20 Mar 2020 04:49:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsAsqC45/4RtFF39KKLurjR9MuzeN5cQ2ofcYD4c+cCgymwJPkTrbg5Y4Z5bA95vQ1Sw3JR X-Received: by 2002:aca:c695:: with SMTP id w143mr6136068oif.98.1584704982184; Fri, 20 Mar 2020 04:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584704982; cv=none; d=google.com; s=arc-20160816; b=R1t/Ho7w0A7s124VT5JjVQCvSfgJVExvx3YAOFcTkU/v5uaTxIR+p9kxpSTAWXmEom en5g7LL3iYJWQXH5ITJpTr2qB9+2/LcUe7oDptJeSkDyYvkiSMYfqpHdjTJHJ+SBCkOF yxVthJWJTvFAJPL0WFdnpkx9OGt4NE2aIGZc8/oavREqurytZusJFqgWk8MMs/DSjfdZ AeupcxFP9Zj2ipXTFPtFWiFowfwsC+UjbD4lP6C/8BFyV/wyoGyn1tUrL8x15r7QfG8v zaRDeArOkOdAxyvUQFsz1J0/b2wc1F+efhqgooC1I2ErTWi/GMyW5sl4yZ8iWzNoOTHo EIrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=M2TXgqwUodKIYzZQJAh9II3qf8XBdi90z3brsAgVKrM=; b=tQXgghMWfFFDVW2TPQ5vy4wFlzpiNztwUZBZbDuerAq6gEg9q7jACSGFZH0Doz7ZP9 T0FEhtf9m3MEEwTqLmcgRqr7v/bOD4ihMrKzLn2DZqxUlYFRfO7prw4d6JCMUVaDTltl ub+2sRBg66sGBckIfE2skPbW0mvyuARbNhYF+6BsAt7otIGRkAeyznVi3KQIJpXRFYsl NVnnjLMFpBPxRaNlOYMvjacvur1HJxuJaAbeCZndxon8ExDA8cyCehZdAbo2i99QLmSB E5HpGtqeTIWuEH3TdcIbWe3i0xcGdmJIx6VCGtSIZ2eK/iM04eHAamHDGCkBPcjnCCKD d1Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=EOqCghog; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si2801509oti.268.2020.03.20.04.49.29; Fri, 20 Mar 2020 04:49:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=EOqCghog; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727070AbgCTLrm (ORCPT + 99 others); Fri, 20 Mar 2020 07:47:42 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:45051 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbgCTLrl (ORCPT ); Fri, 20 Mar 2020 07:47:41 -0400 Received: by mail-lf1-f65.google.com with SMTP id j188so416679lfj.11 for ; Fri, 20 Mar 2020 04:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=M2TXgqwUodKIYzZQJAh9II3qf8XBdi90z3brsAgVKrM=; b=EOqCghogEmGJ1fsAFS0IHYdEmNQzGmBdIKU7jeXqBFhTiR8LxaFQ+MDWLVgLshqjzJ 9OeqePbgK4sWKU7KOBt7auRlj28cHFFQtDC6XsiTMbAHMJmZbnr+Neuik7VeKx4OfGvI ZK5UMK2IikgllUw17HLgo6N/9nyEd92UfQFjdECjbsm/XroryWTYiRwKpK61AhiH1AWn IOpozrLzcemPCfHaDNd9ubTDsN746O9i9Tl3y9OmQAVvc8Lveg3cPfk++YOWEpDp/7tY y2uqzMfnBxkeHJjxFc20DS3l5iW8n+jLgmGamBDOhai/PbP20em6JUFxLeAS+8Gbotb4 vkUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=M2TXgqwUodKIYzZQJAh9II3qf8XBdi90z3brsAgVKrM=; b=a28mCBs3TTC928kEh4eodQjD5vyLb0HOteu8KI74wRF3olhECLfMPMEWEhF3mOUIDt jkYxMDTmfU4a75KHNUx2a+0Iz9ZzZCyLC68f5LzE1PAbFGjAJSOWQwwpxraKRAevR9x7 P0/K2bm9q/l7yFAnMCLB2yPXEjyWkrqdKHH0CUkn3jMSH595qq/s5cs1fjRvlSpSmrhs 24BqhjKX1aQc3qOrjzgoYZRUWyd7maJrBNVx32gJlEDEdxYyDRpCR4knd9TboHpA9L5m aGZvBMEzBTYClvnP4NogrE5f2ryn67NHbFfUuNLF1J3SOcC6YW+BWvM8RvsBFChlqXa+ 2NDw== X-Gm-Message-State: ANhLgQ3iJBKzCzz4LNR2g783h1iPdiAfK4Sod3GjdFgxKLh2I3gjweZa lsuRoGHCWXhS6ARyGONgsbined4JTrIR/g== X-Received: by 2002:ac2:5c5d:: with SMTP id s29mr787973lfp.129.1584704859333; Fri, 20 Mar 2020 04:47:39 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id b23sm3315212lff.64.2020.03.20.04.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 04:47:38 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 09E221020EE; Fri, 20 Mar 2020 14:47:42 +0300 (+03) Date: Fri, 20 Mar 2020 14:47:41 +0300 From: "Kirill A. Shutemov" To: Anshuman Khandual Cc: linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , Andrew Morton , x86@kernel.org, linux-kernel@vger.kernel.org, Dan Williams Subject: Re: [PATCH] x86/mm: Make pud_present() check _PAGE_PROTNONE and _PAGE_PSE as well Message-ID: <20200320114741.c62iolt2yzltnscf@box> References: <1584507679-11976-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2020 at 08:53:16AM +0530, Anshuman Khandual wrote: > > > On 03/18/2020 10:31 AM, Anshuman Khandual wrote: > > pud_present() should also check _PAGE_PROTNONE and _PAGE_PSE bits like in > > case pmd_present(). This makes a PUD entry test positive for pud_present() > > after getting invalidated with pud_mknotpresent(), hence standardizing the > > semantics with PMD helpers. > > > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: Borislav Petkov > > Cc: "H. Peter Anvin" > > Cc: Dave Hansen > > Cc: Andrew Morton > > Cc: x86@kernel.org > > Cc: linux-mm@kvack.org > > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Anshuman Khandual > > --- > > Even though pud_mknotpresent() is not used any where currently, there is > > a discrepancy between PMD and PUD. > > > > WARN_ON(!pud_present(pud_mknotpresent(pud_mkhuge(pud)))) -> Fail > > WARN_ON(!pmd_present(pmd_mknotpresent(pmd_mkhuge(pmd)))) -> Pass > > > > Though pud_mknotpresent() currently clears _PAGE_PROTNONE, pud_present() > > does not check it. This change fixes both inconsistencies. > > > > This has been build and boot tested on x86. > > Adding Kirill and Dan. > > +Cc: Kirill A. Shutemov > +Cc: Dan Williams Or we can just drop the pud_mknotpresent(). There's no users AFAICS and only x86 provides it. -- Kirill A. Shutemov