Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp313279ybv; Wed, 19 Feb 2020 22:13:38 -0800 (PST) X-Google-Smtp-Source: APXvYqz4IU73KhTI9TrbOze2Z5+KdU4JpvyeWr3lrk/xggtUXc3guwKpTFLS+X49yA83OlfDrPIZ X-Received: by 2002:a9d:d0b:: with SMTP id 11mr23170262oti.287.1582179217963; Wed, 19 Feb 2020 22:13:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582179217; cv=none; d=google.com; s=arc-20160816; b=Yc+wF6AkW1iV/vvBKf2PJb1BWZinnPP3UoRm5htbExjTO9kFrZAXnBNwAda4JQ/4DD tKYZcZObI7HI4onYQ/NJvziwMI+8mznVtCQ+bkniR8A4q1C15KoK9oKXFCqPuDMEqGl/ /lDWat5/kr1yO8bDBu09URIQ/IyC9Blu8vZCyk+8gyobtvMRBpgcwS4MInVKAw0EiPGI yftdscG5J3XQpsEk1iLp02Eq9Hb0Qh0UEqi/JrACuWPM06e/4UKlSL0L1eJVRdbdu+xg YcLYOqKWxzwTmwWIwBRlYmVZzEk/ghdTdVGyX7mqIRReEbuRyCeT/TpT1RItZcHnVoK2 lMoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8LXBy0Uexw62kag86kt07J2cNSFL92+mtSCX46spkX8=; b=WCpBC4Ca6doEfKACUM5cSLuuMuZRjtjSaHMx+t2uCtbsB8czhMGLX2mLWmS0fZpZb1 ra/3N5E8J+5Hszfu9cHY7c/8fV7NicLydbxUHd0g8q3ZhpkQDb575zz+nNe3pKuKqXiv b6Llh6nnF8leSBO7B2sQFHh2QUU3E+7I53Pq7KkhT+TivkPnveqO6vV7bv3RLx68DLly ecypL0ibgShyxWEL78VS8ylvrrwcF+zxyZYkzwdusnVMhFYaA/18oNeu4UZ3txGvvHxd f26jfOgfPgHULhfZrScUQW78yTf9GgNn6YCQt4ELiovA/AoKW/O251HeC+QUDzOtINb5 PRkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="MruqT/lL"; 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 k184si9938540oib.239.2020.02.19.22.13.25; Wed, 19 Feb 2020 22:13:37 -0800 (PST) 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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="MruqT/lL"; 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 S1726986AbgBTGM6 (ORCPT + 99 others); Thu, 20 Feb 2020 01:12:58 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54073 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbgBTGM5 (ORCPT ); Thu, 20 Feb 2020 01:12:57 -0500 Received: by mail-wm1-f66.google.com with SMTP id s10so684255wmh.3 for ; Wed, 19 Feb 2020 22:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8LXBy0Uexw62kag86kt07J2cNSFL92+mtSCX46spkX8=; b=MruqT/lLwSAY/zZMkWPYyZnUdokPOkKShNCtKtMf/VykASByq7CcqXkeJtyAFtaE9d mO5avU+Ye1J1rSsVQYiZYzVTh2UcMw4oSNd88QTH2ZnWcqW0y7X903SrT2LBN6Ueo7Ak O5/k8vc51viBHlk9Pst4jGvSCHEng4S2zFufuqaWQfdgxgF9RbTM9i1kKH49Pq3Jd9rD axORqzyd3aaOYT00FJIWvjhDCfrUDCcjo5qiuTg6N764cg04CVA5hMMv2EwNCak1jiYg rYWGXwLF4qexYdwemsf2asYFk6VP4ARRR5pqJKviz3lLKi4EhKWXt2ktUm+WEMyDy1sq +7Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8LXBy0Uexw62kag86kt07J2cNSFL92+mtSCX46spkX8=; b=FGvoXFgWcohuLZ3mapnwnsp4BK2MsDvVWU+RLkmcOGHycs+/EQK+HPzDJrscpjmhgc ijOPi5yj8ZnPdgTUV+NHXOXs1ofVPu78yjcxbo9vQtIMamrfT2j9CyvUiDK+87upK2pI my9J8fFS1Mjs8Wnkegnr4h5xsLwv2vCJjDVSHaTS2NZnslHo3cS1/aQOs1WZ/DhUhf5w 7ij61WemRh20lU06vofqSMitVc041TyKJLh8ksPKQctQW3l1bNyFqAF+p7Y6QgvmITnv tfkwxXVyGgVz+MTSp8O3ZrlDRHM/Wn+jDfSaPIsLfH1lJM6p0SbAUEjzHzabEV4C/CCp mgBw== X-Gm-Message-State: APjAAAXtIYBSHW1iwC4uWHbFc3sNKKbwWsx2Jx4P3jpmGwwueMY8hO8B OmFL6KP3MacjSOeC93giQyNwj0LcVLxmOyPRJ0Li4A== X-Received: by 2002:a1c:1984:: with SMTP id 126mr2342646wmz.78.1582179175373; Wed, 19 Feb 2020 22:12:55 -0800 (PST) MIME-Version: 1.0 References: <20200220061023.958-1-alex@ghiti.fr> In-Reply-To: <20200220061023.958-1-alex@ghiti.fr> From: Anup Patel Date: Thu, 20 Feb 2020 11:42:44 +0530 Message-ID: Subject: Re: [PATCH] riscv: Use p*d_leaf macros to define p*d_huge To: Alexandre Ghiti Cc: Paul Walmsley , Palmer Dabbelt , linux-riscv , "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 11:41 AM Alexandre Ghiti wrote: > > The newly introduced p*d_leaf macros allow to check if an entry of the > page table map to a physical page instead of the next level. To avoid > duplication of code, use those macros to determine if a page table entry > points to a hugepage. > > Suggested-by: Paul Walmsley > Signed-off-by: Alexandre Ghiti > --- > arch/riscv/mm/hugetlbpage.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c > index 0d4747e9d5b5..a6189ed36c5f 100644 > --- a/arch/riscv/mm/hugetlbpage.c > +++ b/arch/riscv/mm/hugetlbpage.c > @@ -4,14 +4,12 @@ > > int pud_huge(pud_t pud) > { > - return pud_present(pud) && > - (pud_val(pud) & (_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC)); > + return pud_leaf(pud); > } > > int pmd_huge(pmd_t pmd) > { > - return pmd_present(pmd) && > - (pmd_val(pmd) & (_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC)); > + return pmd_leaf(pmd); > } > > static __init int setup_hugepagesz(char *opt) > -- > 2.20.1 > Looks good to me. Reviewed-by: Anup Patel Regards, Anup