[PATCH v2] lib: sbi_domain: Avoid overwriting coldboot hart's scratch->arg1
Bin Meng
bmeng.cn at gmail.com
Sun Feb 26 18:09:44 PST 2023
Hi Anup,
On Fri, Feb 24, 2023 at 12:50 PM Anup Patel <anup at brainfault.org> wrote:
>
> On Thu, Feb 23, 2023 at 3:24 PM Bin Meng <bmeng at tinylab.org> wrote:
> >
> > In sbi_domain_finalize(), when locating the coldboot hart's domain,
> > the coldboot hart's scratch->arg1 will be overwritten by the domain
> > configuration. scratch->arg1 holds the FDT address of the coldboot
> > hart, and in later boot process OpenSBI codes still read the FDT
> > here and there, which leads to a crash.
> >
> > To fix this, we change fdt_get_address() to return root domain's
> > next_arg1 as the FDT pointer.
> >
> > Resolves: https://github.com/riscv-software-src/opensbi/issues/281
> > Fixes: b1678af210dc ("lib: sbi: Add initial domain support")
> > Reported-by: Marouene Boubakri <marouene.boubakri at nxp.com>
> > Signed-off-by: Bin Meng <bmeng at tinylab.org>
>
> Looks good to me.
>
> Reviewed-by: Anup Patel <anup at brainfault.org>
Thanks for the review!
This v2 was superseded by v3 @
https://patchwork.ozlabs.org/project/opensbi/list/?series=343310
Regards,
Bin
More information about the opensbi
mailing list