set_mtrr_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

set_mtrr_state(9) πŸŽ€

okay bestie, welcome to set_mtrr_state(9) from the Kernel API Manual β€” this is the little function that sets the MTRR state for this CPU, and we’re gonna read it together like a group chat πŸ’…βœ¨


πŸ’– NAME πŸ’–

set_mtrr_state β€” Set the MTRR state for this CPU. πŸ¦‹

✨ SYNOPSIS ✨

unsigned long set_mtrr_state (void );

🌸 ARGUMENTS 🌸

  • void β€” no arguments, bestie. zero. none. the function is out here taking absolutely nothing and we love that for it 🫢

🚨 NOTE 🚨

okay so real talk: the CPU must already be in a safe state for MTRR changes, no cap. That includes measures that only a single CPU can be active in set_mtrr_state so it doesn’t get subject to races for usage of deftype_lo. This is accomplished by taking cache_disable_lock. πŸ’€πŸ”’

πŸ”₯ RETURN πŸ”₯

  • 0 if no changes made 😌
  • else a mask indicating what was changed πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./arch/x86/kernel/cpu/mtrr/generic.c:


kiss kiss πŸ’‹ source/version: ./arch/x86/kernel/cpu/mtrr β€’ date: October 2026 β€’ and yes, it’s still set_mtrr_state(9) β€” iconic forever, periodt πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from