Re: [v5.4 stable] arm: stm32: Regression observed on "no-map" reserved memory region

From: Quentin Perret
Date: Wed Apr 21 2021 - 04:45:51 EST


On Wednesday 21 Apr 2021 at 08:31:00 (+0000), Quentin Perret wrote:
> FWIW I did test this on Qemu before posting. With 5.12-rc8 and a 1MiB
> no-map region at 0x80000000, I have the following:
>
> 40000000-7fffffff : System RAM
> 40210000-417fffff : Kernel code
> 41800000-41daffff : reserved
> 41db0000-4210ffff : Kernel data
> 48000000-48008fff : reserved
> 80000000-800fffff : reserved
> 80100000-13fffffff : System RAM
> fa000000-ffffffff : reserved
> 13b000000-13f5fffff : reserved
> 13f6de000-13f77dfff : reserved
> 13f77e000-13f77efff : reserved
> 13f77f000-13f7dafff : reserved
> 13f7dd000-13f7defff : reserved
> 13f7df000-13f7dffff : reserved
> 13f7e0000-13f7f3fff : reserved
> 13f7f4000-13f7fdfff : reserved
> 13f7fe000-13fffffff : reserved
>
> If I remove the 'no-map' qualifier from DT, I get this:
>
> 40000000-13fffffff : System RAM
> 40210000-417fffff : Kernel code
> 41800000-41daffff : reserved
> 41db0000-4210ffff : Kernel data
> 48000000-48008fff : reserved
> 80000000-800fffff : reserved
> fa000000-ffffffff : reserved
> 13b000000-13f5fffff : reserved
> 13f6de000-13f77dfff : reserved
> 13f77e000-13f77efff : reserved
> 13f77f000-13f7dafff : reserved
> 13f7dd000-13f7defff : reserved
> 13f7df000-13f7dffff : reserved
> 13f7e0000-13f7f3fff : reserved
> 13f7f4000-13f7fdfff : reserved
> 13f7fe000-13fffffff : reserved
>
> So this does seem to be working fine on my setup. I'll try again with
> 5.4 to see if I can repro.

I just ran the same experiment on v5.4.102 which is where the
regression was reported, and I'm seeing the same correct result...

> Also, 8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already
> reserved regions") looks more likely to cause the issue observed here,
> but that shouldn't be silent. I get the following error message in dmesg
> if I if place the no-map region on top of the kernel image:
>
> OF: fdt: Reserved memory: failed to reserve memory for node 'foobar@40210000': base 0x0000000040210000, size 1 MiB
>
> Is that triggering on your end?

So that really sounds like the cause of the issue here, though arguably
this should be indicative a something funny in the DT.

Thanks,
Quentin