From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DACAC43381 for ; Thu, 28 Mar 2019 18:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 559A020823 for ; Thu, 28 Mar 2019 18:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726107AbfC1SYm (ORCPT ); Thu, 28 Mar 2019 14:24:42 -0400 Received: from ale.deltatee.com ([207.54.116.67]:39754 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfC1SYm (ORCPT ); Thu, 28 Mar 2019 14:24:42 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1h9Zha-0006cz-4x; Thu, 28 Mar 2019 12:24:35 -0600 To: Anup Patel Cc: Albert Ou , Palmer Dabbelt , "linux-kernel@vger.kernel.org List" , Stephen Bates , Atish Patra , Anup Patel , Paul Walmsley , linux-riscv@lists.infradead.org, Mike Rapoport , Christoph Hellwig , Zong Li References: <20190327213643.23789-1-logang@deltatee.com> <20190327213643.23789-5-logang@deltatee.com> From: Logan Gunthorpe Message-ID: Date: Thu, 28 Mar 2019 12:24:31 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: zongbox@gmail.com, hch@lst.de, rppt@linux.ibm.com, linux-riscv@lists.infradead.org, paul.walmsley@sifive.com, anup.patel@wdc.com, atish.patra@wdc.com, sbates@raithlin.com, linux-kernel@vger.kernel.org, palmer@sifive.com, aou@eecs.berkeley.edu, anup@brainfault.org X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH 4/7] RISC-V: Update page tables to cover the whole linear mapping X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-03-28 4:03 a.m., Anup Patel wrote: > I understand that this patch is inline with your virtual memory layout cleanup > but the way we map virtual memory in swapper_pg_dir is bound to change. > > We should not be mapping complete virtual memory in swapper_pd_dir() > rather we should only map based on amount of RAM available. > > Refer, https://www.lkml.org/lkml/2019/3/24/3 > > The setup_vm() should only map vmlinux_start to vmlinux_end plus the > FDT. Complete virtual memory mapping should be done after we have > done early parsing of FDT when we know available memory banks in > setup_vm_final() (called from paging_init()) That makes sense, but I think a lot of it sounds a out of the scope of what I'm doing in this patch set. I could attempt to update my patchset so instead of expanding the linear region on boot, we add the page tables in arch_add_memory. That would make more sense when considering the direction you want to head with setup_vm. Logan