Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp234519ybx; Mon, 4 Nov 2019 19:23:16 -0800 (PST) X-Google-Smtp-Source: APXvYqy55PB99smG6n0E4QfB7oMqzNRFswZZTXqBaeeinenI4OYmo750zY3uTDmnTBwEidwiMBTP X-Received: by 2002:a17:906:bfc6:: with SMTP id us6mr27400543ejb.51.1572924196159; Mon, 04 Nov 2019 19:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572924196; cv=none; d=google.com; s=arc-20160816; b=E3PEtuc4Zcn5QUMwTu4dCsoUt2J8KL55qgZG8dr4FkElAWTZhOYYYFthqLE79No3og 8SMzDxRIYlUNQeDXsu8m0+ExVLLYyKBE/7tZ5cXB9CYBA8vUJkKON+XPnVsKZGfMn27g JREU00+1fOjHZuo6yFZI4aANplRQ/qrRhWmNRWbgfbQlljBDC4QccPRFI97iRNcW3Onz xFfVCivazs9a6cTxzEwdvYgG5VTEgbK39ukkigLAdaQAbW6pTQbLWa/jgddqwn/ukg0i m+/wZv81ZIs/fZ2UM/isdSqEaXt0Oqxc02G+UYfQmsEJclmQnP8SiB7b4GzmrF/1AdK3 0lFQ== 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=bAiMHQsOuI6hnngn6+5CXNDYY+Zdldt5dUW/4rLN07w=; b=1BZuMyTgm4Mq9GeWBIckFzNEfCsG1PPEZlb+Nfco3ZPP5CI/D+/iKL/Xa0NvlGpoWb iYhtJs400OmUL3tv5eAc5I6OOC3EJrPU3d/Pm5VJzAx3uBlvp0niz9ImQ9eNA6SjEabH QHwDFPJB+ydig7E6Q9xMN2AqMvqWXT5tsSbQoGFqChtnGakfa609wG9HSC06gnR50nUT yekzsVmSVszisFP4nIBTb1uP56ugt7Tp3aKlLiF33nnGrT+nnuuiaXsPICaIFChEV0yG 96VZsuXwFxD4tCQWqjwEx1k25SGm60FTtkbc+qAM1ukFYJSf8wmO3h/sAY4a7UR1h5Ef GZgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="tO/w9J5+"; 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 e12si2010704ejx.169.2019.11.04.19.22.52; Mon, 04 Nov 2019 19:23:16 -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="tO/w9J5+"; 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 S1729996AbfKEDVn (ORCPT + 99 others); Mon, 4 Nov 2019 22:21:43 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51704 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728910AbfKEDVn (ORCPT ); Mon, 4 Nov 2019 22:21:43 -0500 Received: by mail-wm1-f65.google.com with SMTP id q70so19070579wme.1 for ; Mon, 04 Nov 2019 19:21:41 -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=bAiMHQsOuI6hnngn6+5CXNDYY+Zdldt5dUW/4rLN07w=; b=tO/w9J5+r4DEJmrnMm3ifg3uO8ptXHzrnI6zja/xK4eHep7B+AAjX+LZAEQ1b7e9Rj PlvGJ+8LHgZc7RzsKDGJsu7aCHWeNzVKMuyDvMLR4Csz8sXaeMsujCSW8wb3rJuflg/F 9pSp9tz1VeQQorsBT31aOi7DdqviWdTUGL/WMGFhaAsxl34SgqSBOHO2HKSkkiK3YM69 VWi6JT4IWGyCxOObusEIvQcwzTDC3hjaBy9TFBNkcd6cDpYp/TgMvIlUzgpYaYciLXng yilVpU4ig1m41sqRHfGExoZJIjzSk3RZYQoD8E1+kY732qewJ8ntGf2ZX/lefqpCGiDi E8lA== 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=bAiMHQsOuI6hnngn6+5CXNDYY+Zdldt5dUW/4rLN07w=; b=D2wy2/llfPOvbBmdb2K4uV7uGyQefmXFs9wqVchK5aeIWTQZcaiZ+OVlerqHEnU+m3 r4exU6UPB7NHDdwRl8yfpVM2vXx3+I+d9RCxrQOdpLRjStg1Z4TUJrHeF1PPGmlVU8T4 jXp2GpbPKklZwtQ06mCb7mlg/dcXPBmtcHviYMD7XaV9jeRrXpc04WZNp5vV3A97cppo CPTFZoo2U9sTZlQZcHnri11oR0XXvOqC5eRB7ZpJo8IL6I+x7K5xOdhs6gVDJ6C57CUA wLZAamp3a5VOCO626EEwJnKy0n4YwJz0S/9lVdb7vkQZfFgxux6Xqqi5/t36T8p8H+zy PfDw== X-Gm-Message-State: APjAAAXXoef/hyWqDzMdY6ZtQWrckNNHPDBlTGJqzgVmd5tQHP9LacRV EuqsVDgSqpctFW9ySN9VpEfpF3kJFu6KQ3oxnOBpkWTw X-Received: by 2002:a1c:4c10:: with SMTP id z16mr1833021wmf.24.1572924100474; Mon, 04 Nov 2019 19:21:40 -0800 (PST) MIME-Version: 1.0 References: <1572920412-15661-1-git-send-email-zong.li@sifive.com> In-Reply-To: <1572920412-15661-1-git-send-email-zong.li@sifive.com> From: Anup Patel Date: Tue, 5 Nov 2019 08:51:29 +0530 Message-ID: Subject: Re: [PATCH v2] riscv: Use PMD_SIZE to repalce PTE_PARENT_SIZE To: Zong Li Cc: "linux-kernel@vger.kernel.org List" , linux-riscv , Paul Walmsley , Palmer Dabbelt , Anup Patel 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 Tue, Nov 5, 2019 at 7:50 AM Zong Li wrote: > > The PMD_SIZE is equal to PGDIR_SIZE when __PAGETABLE_PMD_FOLDED is > defined. > > Signed-off-by: Zong Li > --- > arch/riscv/mm/init.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 573463d..642b330 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -273,7 +273,6 @@ static void __init create_pmd_mapping(pmd_t *pmdp, > #define get_pgd_next_virt(__pa) get_pmd_virt(__pa) > #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \ > create_pmd_mapping(__nextp, __va, __pa, __sz, __prot) > -#define PTE_PARENT_SIZE PMD_SIZE > #define fixmap_pgd_next fixmap_pmd > #else > #define pgd_next_t pte_t > @@ -281,7 +280,6 @@ static void __init create_pmd_mapping(pmd_t *pmdp, > #define get_pgd_next_virt(__pa) get_pte_virt(__pa) > #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \ > create_pte_mapping(__nextp, __va, __pa, __sz, __prot) > -#define PTE_PARENT_SIZE PGDIR_SIZE > #define fixmap_pgd_next fixmap_pte > #endif > > @@ -316,10 +314,10 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size) > { > uintptr_t map_size = PAGE_SIZE; > > - /* Upgrade to PMD/PGDIR mappings whenever possible */ > - if (!(base & (PTE_PARENT_SIZE - 1)) && > - !(size & (PTE_PARENT_SIZE - 1))) > - map_size = PTE_PARENT_SIZE; > + /* Upgrade to PMD_SIZE mappings whenever possible */ > + if (!(base & (PMD_SIZE - 1)) && > + !(size & (PMD_SIZE - 1))) > + map_size = PMD_SIZE; > > return map_size; > } > -- > 2.7.4 > LGTM. Reviewed-by: Anup Patel Regards, Anup