[PATCH v1 1/2] riscv, mm: Add Sv57 support based on Sv48 implementation

Heiko Stübner heiko at sntech.de
Mon Nov 29 04:18:40 PST 2021


Am Montag, 29. November 2021, 12:20:20 CET schrieb Alexandre ghiti:
> Hi Qinglin,
> 
> On 11/24/21 12:20, panqinglin2020 at iscas.ac.cn wrote:
> > From: Qinglin Pan <panqinglin2020 at iscas.ac.cn>
> >
> > This patch adds Sv57 implementation on the top of Alex's Sv48 patchset.
> > The mmu configuration will be determined on runtime, according to both
> > mmu HW support and mmu-type field in the dtb. The kernel will try to
> > set satp mode one by one from the configuration item to Sv39 in 64bit.
> >
> > Signed-off-by: Qinglin Pan <panqinglin2020 at iscas.ac.cn>

> > @@ -658,18 +755,31 @@ static __init void set_satp_mode(uintptr_t dtb_pa)
> >   				continue;
> >   
> >   			if (!strcmp(mmu_type, "riscv,sv39")) {
> > +				disable_pgtable_l5();
> >   				disable_pgtable_l4();
> >   				return;
> >   			}
> >   
> > +			if (!strcmp(mmu_type, "riscv,sv48")) {
> > +				check_l4 = true;
> > +			}
> > +
> 
> 
> If sv48 is set in the device tree, why would you test if it is supported 
> below? I would take it as is, just like for sv39, I'm not sure we want 
> to override this silently and make a wrong device tree work.

or alternatively the code could emit a big WARN that a mismatch was
corrected. Getting to a point where a developer can actually see their
mistake on a console might be helpful to people :-)





More information about the linux-riscv mailing list