linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Anup Patel <anup@brainfault.org>
Cc: Palmer Dabbelt <palmer@sifive.com>,
	Anup Patel <Anup.Patel@wdc.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Christoph Hellwig <hch@infradead.org>,
	Atish Patra <Atish.Patra@wdc.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v3 4/4] RISC-V: Allow booting kernel from any 4KB aligned address
Date: Mon, 25 Mar 2019 07:59:19 -0700	[thread overview]
Message-ID: <20190325145919.GB14826@infradead.org> (raw)
In-Reply-To: <CAAhSdy2dds7pp8=XX+zbKbMoWbgjPxP6r4aMZJeHyqHV2MP4CQ@mail.gmail.com>

On Mon, Mar 25, 2019 at 06:18:45PM +0530, Anup Patel wrote:
> We trying to addresses following issues in current code:
> 1. The current setup_vm() maps all possible kernel virtual addresses (128GB
> on 64bit system and 1GB on 32bit system). The amount RAM present on
> real systems might be much less so we should not have kernel mappings for
> non-existent RAM. Of course, we don't know amount of RAM available in
> setup_vm() so we have to split page table setup in two parts and do minimal
> required mapping in setup_vm().

Why do you even care about kernel mappings for non-existant ram.

> 2. NOMMU kernel requires a swapper_pg_dir with identity mapping (VA == PA)

Bullshit.  nommu per defintion does not have page tables, and thus

> 3. For both NOMMU with tiny memory and MMU with tiny memory, the current
> setup_vm() is not allowing us to place kernel on non-2M (or non-4M) aligned
> addressed there by causing memory below kernel to be wasted.

As mentioned a few times - nommu per defintion does not have page
tables, and in my uptodate nommu port none of this code is even compiled
in.  If someone still compiles that code in some codebase that is just
a bug that needs to be fixed.

For MMU with tiny memory is is a theoretical case, but I still haven't
seen a good rationale why we'd care for that case.

> 4. For MMU based kernel, the current setup_vm() is hard-wired for fixed 2M
> mapping size. It will require more changes if we want to do 1G mappings.

And why do we care?  Even if we come up with a good reason for 1G
mappings we'd better find a way to select it at run time and not require
a gazillion of options to select how to map the kernel.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2019-03-25 14:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25  9:22 [PATCH v3 0/4] Boot RISC-V kernel from any 4KB aligned address Anup Patel
2019-03-25  9:23 ` [PATCH v3 1/4] RISC-V: Add separate defconfig for 32bit systems Anup Patel
2019-03-25  9:23 ` [PATCH v3 2/4] RISC-V: Fix memory reservation in setup_bootmem() Anup Patel
2019-03-25 11:38   ` Christoph Hellwig
2019-03-25 16:13   ` Mike Rapoport
2019-04-24 21:06   ` Palmer Dabbelt
2019-03-25  9:23 ` [PATCH v3 3/4] RISC-V: Remove redundant trampoline page table Anup Patel
2019-03-25 11:38   ` Christoph Hellwig
2019-03-25  9:23 ` [PATCH v3 4/4] RISC-V: Allow booting kernel from any 4KB aligned address Anup Patel
2019-03-25 11:39   ` Christoph Hellwig
2019-03-25 12:42     ` Anup Patel
2019-03-25 14:55       ` Christoph Hellwig
2019-03-25 12:48     ` Anup Patel
2019-03-25 14:59       ` Christoph Hellwig [this message]
2019-03-25 16:16         ` Anup Patel
2019-03-25 17:35           ` Gary Guo
2019-03-26  9:43             ` Anup Patel
2019-03-27  7:54           ` Christoph Hellwig
2019-03-28  7:55             ` Mike Rapoport
2019-03-28  9:52               ` Anup Patel
2019-03-28 10:24                 ` Anup Patel
2019-03-28 15:35 Anthony Coulter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190325145919.GB14826@infradead.org \
    --to=hch@infradead.org \
    --cc=Anup.Patel@wdc.com \
    --cc=Atish.Patra@wdc.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rppt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).