Re: uninitialized pmem struct pages

From: David Hildenbrand
Date: Mon Jan 04 2021 - 11:32:23 EST

>> Let's assume this is indeed a reserved pfn in the altmap. What's the
>> actual address of the memmap?
> Not sure what exactly you are asking for but crash says
> crash> kmem -p 6060000
> fffff8c600181800 6060000 0 0 0 fffffc0000000

^ this looks like it was somewhat initialized. All flags zero, nid/zone
set to -1 (wild guess) and thus the crash? weird

>> I do wonder what hosts pfn_to_page(PHYS_PFN(0x6060000)) - is it actually
>> part of the actual altmap (i.e. > 0x6060000) or maybe even self-hosted?
> I am not really familiar with the pmem so I would need more assistance
> here. I've tried this (shot into the dark):
> crash> struct page.pgmap fffff8c600181800
> pgmap = 0xfffff8c600181808

That's weird. If the memmap is at fffff8c600181800, why should the pgmap
be at an offset of 8 bytes from there. The "pgmap" field is actually at
an offset of 8 bytes within the memmap ...

Assuming the memmap is not actually ZONE_DEVICE, fffff8c600181800 really
only contains garbage, including the pgmap pointer :(

> crash> struct -x dev_pagemap 0xfffff8c600181808
> struct dev_pagemap {
> altmap = {
> base_pfn = 0xfffff8c600181808,
> end_pfn = 0xfffff8c600181808,

^ because this is very weird

> reserve = 0x0,

^ and this indicates nothing was actually reserved.


David / dhildenb