[PATCH] lib: sbi_domain: Avoid overwriting coldboot hart's scratch->arg1

Bin Meng bmeng at tinylab.org
Fri Dec 30 17:40:38 PST 2022


Hi Samuel,

On Sat, Dec 31, 2022 at 12:38 AM Samuel Holland <samuel at sholland.org> 
wrote:
 >
 > Hi Bin,
 >
 > On 12/29/22 22:26, Bin Meng 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.
 >
 > It sounds to me like the bug is in fdt_get_address(), not here. We
 > should save off the FDT address in some global variable, and not
 > continue getting it from next_arg1. Then there is no problem updating
 > next_arg1 from the domain configuration.
 >

Yep, I thought about this and felt that might change a lot of places. I 
will have a try in v2.

Regards,
Bin



More information about the opensbi mailing list