set_mtrr_state(9)
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 inset_mtrr_stateso it doesnβt get subject to races for usage ofdeftype_lo. This is accomplished by takingcache_disable_lock. ππ
π₯ RETURN π₯
0if no changes made π- else a mask indicating what was changed π
π SEE ALSO π
Kernel file ./arch/x86/kernel/cpu/mtrr/generic.c:
guest_force_mtrr_state(9)mtrr_type_lookup(9)set_fixed_range(9)generic_get_free_region(9)set_fixed_ranges(9)generic_set_mtrr(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms