All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Ghiti <alexghiti@rivosinc.com>
To: Conor Dooley <conor@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Conor Dooley <conor.dooley@microchip.com>,
	linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -fixes v2 2/3] riscv: Do not set initial_boot_params to the linear address of the dtb
Date: Wed, 29 Mar 2023 16:52:45 +0200	[thread overview]
Message-ID: <CAHVXubh9t7VuM337Br-4y7zJp1msr6+bAtr1eVLc+P50V9Bikg@mail.gmail.com> (raw)
In-Reply-To: <179c38d6-4298-4a16-b0d7-8aee49a91f58@spud>

On Wed, Mar 29, 2023 at 4:37 PM Conor Dooley <conor@kernel.org> wrote:
>
> On Wed, Mar 29, 2023 at 10:19:31AM +0200, Alexandre Ghiti wrote:
> > early_init_dt_verify() is already called in parse_dtb() and since the dtb
> > address does not change anymore (it is now in the fixmap region), no need
> > to reset initial_boot_params by calling early_init_dt_verify() again.
> >
> > Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> > ---
> >  arch/riscv/kernel/setup.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> > index 542eed85ad2c..a059b73f4ddb 100644
> > --- a/arch/riscv/kernel/setup.c
> > +++ b/arch/riscv/kernel/setup.c
> > @@ -278,10 +278,7 @@ void __init setup_arch(char **cmdline_p)
> >  #if IS_ENABLED(CONFIG_BUILTIN_DTB)
> >       unflatten_and_copy_device_tree();
> >  #else
> > -     if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa))))
> > -             unflatten_device_tree();
>
> Silly question maybe, but since it isn't explicitly mentioned, the
> XIP_FIXUP bits no longer matter?

The XIP_FIXUP is only needed when translating virtual to physical
addresses, but that does not mean I did not break it, I haven't
considered XIP at all...

> Also, in related news, I assume you don't have a QEMU setup that can do
> boot an XIP kernel?

I haven't booted a XIP kernel for a long time now, here are my notes
from that time:
https://github.com/AlexGhiti/alexghiti.github.io/blob/main/xip/XIP.md

>
> Cheers,
> Conor.
>
> > -     else
> > -             pr_err("No DTB found in kernel mappings\n");
> > +     unflatten_device_tree();
> >  #endif
> >       misc_mem_init();
> >
> > --
> > 2.37.2
> >

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Ghiti <alexghiti@rivosinc.com>
To: Conor Dooley <conor@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Conor Dooley <conor.dooley@microchip.com>,
	linux-doc@vger.kernel.org,  linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -fixes v2 2/3] riscv: Do not set initial_boot_params to the linear address of the dtb
Date: Wed, 29 Mar 2023 16:52:45 +0200	[thread overview]
Message-ID: <CAHVXubh9t7VuM337Br-4y7zJp1msr6+bAtr1eVLc+P50V9Bikg@mail.gmail.com> (raw)
In-Reply-To: <179c38d6-4298-4a16-b0d7-8aee49a91f58@spud>

On Wed, Mar 29, 2023 at 4:37 PM Conor Dooley <conor@kernel.org> wrote:
>
> On Wed, Mar 29, 2023 at 10:19:31AM +0200, Alexandre Ghiti wrote:
> > early_init_dt_verify() is already called in parse_dtb() and since the dtb
> > address does not change anymore (it is now in the fixmap region), no need
> > to reset initial_boot_params by calling early_init_dt_verify() again.
> >
> > Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> > ---
> >  arch/riscv/kernel/setup.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> > index 542eed85ad2c..a059b73f4ddb 100644
> > --- a/arch/riscv/kernel/setup.c
> > +++ b/arch/riscv/kernel/setup.c
> > @@ -278,10 +278,7 @@ void __init setup_arch(char **cmdline_p)
> >  #if IS_ENABLED(CONFIG_BUILTIN_DTB)
> >       unflatten_and_copy_device_tree();
> >  #else
> > -     if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa))))
> > -             unflatten_device_tree();
>
> Silly question maybe, but since it isn't explicitly mentioned, the
> XIP_FIXUP bits no longer matter?

The XIP_FIXUP is only needed when translating virtual to physical
addresses, but that does not mean I did not break it, I haven't
considered XIP at all...

> Also, in related news, I assume you don't have a QEMU setup that can do
> boot an XIP kernel?

I haven't booted a XIP kernel for a long time now, here are my notes
from that time:
https://github.com/AlexGhiti/alexghiti.github.io/blob/main/xip/XIP.md

>
> Cheers,
> Conor.
>
> > -     else
> > -             pr_err("No DTB found in kernel mappings\n");
> > +     unflatten_device_tree();
> >  #endif
> >       misc_mem_init();
> >
> > --
> > 2.37.2
> >

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

  reply	other threads:[~2023-03-29 14:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  8:19 [PATCH -fixes v2 0/3] Fixes for dtb mapping Alexandre Ghiti
2023-03-29  8:19 ` Alexandre Ghiti
2023-03-29  8:19 ` [PATCH -fixes v2 1/3] riscv: Move early dtb mapping into the fixmap region Alexandre Ghiti
2023-03-29  8:19   ` Alexandre Ghiti
2023-03-29  8:19 ` [PATCH -fixes v2 2/3] riscv: Do not set initial_boot_params to the linear address of the dtb Alexandre Ghiti
2023-03-29  8:19   ` Alexandre Ghiti
2023-03-29 14:37   ` Conor Dooley
2023-03-29 14:37     ` Conor Dooley
2023-03-29 14:52     ` Alexandre Ghiti [this message]
2023-03-29 14:52       ` Alexandre Ghiti
2023-03-29 16:35       ` Conor Dooley
2023-03-29 16:35         ` Conor Dooley
2023-03-29  8:19 ` [PATCH -fixes v2 3/3] riscv: No need to relocate the dtb as it lies in the fixmap region Alexandre Ghiti
2023-03-29  8:19   ` Alexandre Ghiti
2023-03-29 13:56   ` Conor Dooley
2023-03-29 13:56     ` Conor Dooley
2023-03-29 14:40     ` Alexandre Ghiti
2023-03-29 14:40       ` Alexandre Ghiti
2023-03-29 15:33       ` Conor Dooley
2023-03-29 15:33         ` Conor Dooley
2023-04-14  1:17         ` Palmer Dabbelt
2023-04-14  1:17           ` Palmer Dabbelt
2023-04-14  1:13 ` [PATCH -fixes v2 0/3] Fixes for dtb mapping Palmer Dabbelt
2023-04-14  1:13   ` Palmer Dabbelt
2023-04-14  1:20 ` patchwork-bot+linux-riscv
2023-04-14  1:20   ` patchwork-bot+linux-riscv

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=CAHVXubh9t7VuM337Br-4y7zJp1msr6+bAtr1eVLc+P50V9Bikg@mail.gmail.com \
    --to=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.