__imr_remove_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __imr_remove_range(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for __imr_remove_range, and yes it's giving "low-level x86 Quark energy" and we're gonna get through it together 🫢


🌸 NAME 🌸

__imr_remove_range β€” delete an Isolated Memory Region. that's it, that's the whole vibe. bye IMR πŸ‘‹πŸ’€


✨ SYNOPSIS ✨

int __imr_remove_range (int reg , phys_addr_t base , size_t size );

like, that's the whole call. three args, one int coming back at you πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • reg β€” the imr index to remove. the main character of this call ngl πŸ‘‘
  • base β€” the physical base address of the region, and it has to be aligned to 1 KiB. not negotiable, she's picky πŸ’…
  • size β€” the physical size of the region in bytes, also aligned to 1 KiB. same energy, same rule ⭐

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜•: this function lets you delete an IMR by its index β€” that's the reg param β€” or by an address range, which is what base and size are for.

and the way it works is honestly iconic: if you specify an index on its own, the base and size parameters are ignored. literally ignored. not even looked at. πŸ™ˆ

check it:

imr_remove_range(0, base, size);

that one deletes the IMR at index 0 β€” base/size ignored, periodt πŸ’…

imr_remove_range(-1, base, size);

and that one deletes the IMR from base to base+size. see how the index being -1 flips it over to range mode? iykyk πŸ”₯


πŸŽ€ RETURN πŸŽ€

here's the vibe check on what comes back at you:

  • -EINVAL β€” invalid range, or an out of range id. bestie no 😭
  • -ENODEV β€” reg is valid but no IMR exists, or it's locked. locked!! she's unavailable πŸ”’
  • 0 β€” success, we ate, everything slayed βœ¨πŸ‘‘

🌈 SEE ALSO 🌈

kernel file ./arch/x86/platform/intel-quark/imr.c β€” go read her, she's long but worth it πŸ“–πŸ’œ

and the whole friend group:


ok that's the page!! remember: index-only means base and size get ghosted, -1 means range mode, and 1 KiB alignment is not a suggestion 🫢

mwah πŸ’‹ this has been your girl signing off β€” brought to you by the source path ./arch/x86/platform/intel-quark, dated October 2026. catch you in the next manpage, bestie πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from