linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Rutland <mark.rutland@arm.com>,
	linux-efi <linux-efi@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>, Zong Li <zong.li@sifive.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Anup Patel <anup.patel@wdc.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Atish Patra <atish.patra@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Atish Patra <atishp@atishpatra.org>,
	Greentime Hu <greentime.hu@sifive.com>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	Will Deacon <will@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap
Date: Tue, 21 Jul 2020 12:02:39 +0300	[thread overview]
Message-ID: <CAMj1kXH53V3Vu8Lq4yzSCn5ZSxn65KiVbt91PUPhkBRO6vuRSQ@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a3e3SBtTocpkCybKRjkBJG26G-8YdiroJbZLZYq9f0yfw@mail.gmail.com>

On Tue, 21 Jul 2020 at 11:57, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, Jul 21, 2020 at 6:18 AM Atish Patra <atishp@atishpatra.org> wrote:
> > On Sat, Jul 18, 2020 at 2:24 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > > On Sat, Jul 18, 2020 at 3:05 AM Atish Patra <atishp@atishpatra.org> wrote:
> > > > That's what the original code was doing. A fixmap entry was added to
> > > > map the original fdt
> > > > location to a virtual so that parse_dtb can be operated on a virtual
> > > > address. But we can't map
> > > > both FDT & early ioremap within a single PMD region( 2MB ). That's why
> > > > we removed the DT
> > > > mapping from the fixmap to .bss section. The other alternate option is
> > > > to increase the fixmap space to 4MB which seems more fragile.
> > >
> > > Could the original location just be part of the regular linear mapping of all
> > > RAM?
> >
> > No. Because we don't map the entire RAM until setup_vm_final().
> > We need to parse DT before setup_vm_final() to get the memblocks and
> > reserved memory regions.
>
> Ok, I see how you create a direct mapping for the kernel image, plus
> the fixmap for the dtb in setup_vm(), and how moving the dtb into the
> kernel image simplifies that.
>
> I'm still wondering why you can't do the same kind of PGD mapping
> for the dtb that you do for the vmlinux, creating linear page table
> entries exactly for the location that holds the dtb, from dtb_pa to
> dtb_pa+((struct fdt_header*)dtb_pa)->totalsize.
>

On arm64, we limit the size of the DT to 2MB, and reserve a pair of
PMD entries adjacent to the fixmap so we can map it r/o statically
using huge pages without using fixmap/early_ioremap slots. (Using a
pair of PMD entries allows the DT to appear at any alignment in
memory, given that PMD entries cover 2 MB each on 4k pages kernels)

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

  reply	other threads:[~2020-07-21  9:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 23:40 [RFT PATCH v3 0/9] Add UEFI support for RISC-V Atish Patra
2020-07-16 23:40 ` [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap Atish Patra
2020-07-17  6:32   ` Arnd Bergmann
2020-07-18  1:05     ` Atish Patra
2020-07-18  9:24       ` Arnd Bergmann
2020-07-21  4:18         ` Atish Patra
2020-07-21  8:57           ` Arnd Bergmann
2020-07-21  9:02             ` Ard Biesheuvel [this message]
2020-07-21  9:30               ` Anup Patel
2020-07-16 23:40 ` [RFT PATCH v3 2/9] RISC-V: Add early ioremap support Atish Patra
2020-07-16 23:40 ` [RFT PATCH v3 3/9] RISC-V: Implement late mapping page table allocation functions Atish Patra
2020-07-16 23:40 ` [RFT PATCH v3 4/9] include: pe.h: Add RISC-V related PE definition Atish Patra
2020-07-16 23:41 ` [RFT PATCH v3 5/9] RISC-V: Add PE/COFF header for EFI stub Atish Patra
2020-07-16 23:41 ` [RFT PATCH v3 6/9] RISC-V: Add EFI stub support Atish Patra
2020-07-16 23:41 ` [RFT PATCH v3 7/9] efi: Rename arm-init to efi-init common for all arch Atish Patra
2020-07-16 23:41 ` [RFT PATCH v3 8/9] RISC-V: Add EFI runtime services Atish Patra
2020-07-16 23:41 ` [RFT PATCH v3 9/9] RISC-V: Add page table dump support for uefi Atish Patra

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=CAMj1kXH53V3Vu8Lq4yzSCn5ZSxn65KiVbt91PUPhkBRO6vuRSQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=anup.patel@wdc.com \
    --cc=arnd@arndb.de \
    --cc=atish.patra@wdc.com \
    --cc=atishp@atishpatra.org \
    --cc=greentime.hu@sifive.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rppt@linux.ibm.com \
    --cc=will@kernel.org \
    --cc=xypron.glpk@gmx.de \
    --cc=zong.li@sifive.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).