STRUCT VMCORE_CB(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct vmcore_cb(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” today's main character is struct vmcore_cb, and it's literally the driver callback squad for /proc/vmcore handling πŸŽ€ like if you're a driver managing physical memory ranges and you need to talk to the vmcore handling code, this is your girl. periodt.


✨ NAME ✨

struct vmcore_cb β€” driver callbacks for /proc/vmcore handling πŸ¦‹


🌸 SYNOPSIS 🌸

struct vmcore_cb {
    bool (*pfn_is_ram)(struct vmcore_cb *cb, unsigned long pfn);
    int (*get_device_ram)(struct vmcore_cb *cb, struct list_head *list);
    struct list_head next;
 };

πŸ‘‘ Members πŸ‘‘

  • pfn_is_ram β€” this one's job is to check whether a PFN really is RAM and actually should be accessed when reading the vmcore πŸ‘€. It returns true if it is RAM, or if the callback genuinely can't tell. But if any callback returns false, then nope β€” it's not RAM and the page must not be accessed; instead, zeroes should be indicated in the vmcore. Fr fr, think about it: a ballooned page contains no data, and reading from such a page will cause high load in the hypervisor πŸ’€ so yeah, don't do that.
  • get_device_ram β€” this one queries RAM ranges that can only be detected by device drivers, like the virtio-mem driver, so they can be included in the crash dump on architectures that allocate the elfcore hdr in the dump ("2nd") kernel 🌈. And here's the tea: the indicated RAM ranges may contain holes to reduce the total number of ranges β€” those holes can be detected using the pfn_is_ram callback, just like for other RAM ✨.
  • next β€” list head to manage registered callbacks internally; it gets initialized by register_vmcore_cb 🫢.

πŸ’… Description πŸ’…

vmcore callbacks allow drivers managing physical memory ranges to coordinate with vmcore handling code β€” for example, to prevent accessing physical memory ranges that should not be accessed when reading the vmcore, even though they're included in the vmcore header as memory ranges to dump πŸ¦‹. it's giving teamwork, it's giving "don't touch that memory", iconic behavior honestly.


⭐ SEE ALSO ⭐

Kernel file ./include/linux/crash_dump.h πŸŽ€


ngl bestie, if pfn_is_ram says false, that page is off-limits β€” zeroes in the vmcore only, no exceptions πŸ™ˆ

and that's a wrap, mwah πŸ’‹ β€” this page came from ./include/linux, dated October 2026, and it's struct vmcore_cb(9) in the Kernel API Manual. slay πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from