Re: [GIT PULL] arm64 fix for 5.14
From: Linus Torvalds
Date: Fri Aug 27 2021 - 13:03:53 EST
On Fri, Aug 27, 2021 at 12:40 AM Christoph Hellwig <hch@xxxxxx> wrote:
> > In a PC world that would be (for example) the legacy PCI space at
> > 0xa0000-0xfffff, but I could easily imagine other platforms having
> > other situations.
> So what would be the correct check for "this is not actually page backed
> normal RAM"?
It would probably be interesting to have the arm people explain the
call chain for the warning that caused that revert, so we'd have a
very concrete example of the situation that goes wrong, but taking a
wild stab at it, the code might be something like
/* Don't allow RAM to be mapped */
and then having something like
static inline bool phys_addr_is_ram(phys_addr_t phys_addr)
unsigned long pfn = PHYS_PFN(phys_addr);
return is_zero_pfn(pfn) || !PageReserved(pfn_to_page(pfn));
might be close to right.
The ARM code actually uses that complex pfn_to_section_nr() and
memblock_is_memory() etc. That seems a bit of an overkill, since the
memblock code should have translated all that into being reserved.
But again, I don't actually know exactly what triggered the issue on
ARM, so the above is just my "this seems to be a more proper check"