lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Mar 2021 20:51:06 +0530
From:   Anup Patel <anup@...infault.org>
To:     Changbin Du <changbin.du@...il.com>
Cc:     Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] riscv: Do not invoke early_init_dt_verify() twice

On Wed, Mar 24, 2021 at 8:33 PM Changbin Du <changbin.du@...il.com> wrote:
>
> In the setup_arch() of riscv, function early_init_dt_verify() has
> been done by parse_dtb(). So no need to call it again. Just directly
> invoke unflatten_device_tree().
>
> Signed-off-by: Changbin Du <changbin.du@...il.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 f8f15332caa2..2a3d487e1710 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -255,10 +255,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(dtb_early_pa)))
> -               unflatten_device_tree();
> -       else
> -               pr_err("No DTB found in kernel mappings\n");
> +       unflatten_device_tree();
>  #endif

The early_init_dt_verify() set he DTB base address in Linux OF.

When parse_dtb() calls early_init_dt_verify(), MMU is enabled but
we have temporary mapping for DTB (i.e. dtb_early_va).

After paging_init(), we have moved to final swapper_pg_dir so
temporary mapping for DTB does not exists anymore but DTB
is at same physical address so update DTB base address in
Linux OF by calling early_init_dt_verify() again.

Based on above, NACK to this patch.

Regards,
Anup

>         misc_mem_init();
>
> --
> 2.30.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ