Skip to contentSkip to conversation

x86/intel: Move mcu_opt_ctrl_* into __ro_after_init

PATCH In review Andrew Cooper 2 participants 2 messages Apr 30, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/intel: Move mcu_opt_ctrl_* into __ro_after_init

They're only modified by set_in_mcu_opt_ctrl() which is an __init function.

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

In principle:

Fixes 39a40f3835ef ("x86/spec-ctrl: Clean up MSR_MCU_OPT_CTRL handling")

seeing as __ro_after_init existed at the time, but it was tied up in a security series and __ro_after_init was very new at the time.

---
 xen/arch/x86/cpu/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/cpu/intel.c +2 -2
index 63f65ea5b048..12c3ff65e02f 100644
@@ -21,8 +21,8 @@
  * MSR_MCU_OPT_CTRL is a collection of unrelated functionality, with separate
  * enablement requirements, but which want to be consistent across the system.
  */
-static uint32_t __read_mostly mcu_opt_ctrl_mask;
-static uint32_t __read_mostly mcu_opt_ctrl_val;
+static uint32_t __ro_after_init mcu_opt_ctrl_mask;
+static uint32_t __ro_after_init mcu_opt_ctrl_val;
 
 void update_mcu_opt_ctrl(void)
 {

base-commit: a1ce987411f61dbf5fe64bba0cd3d36d7cc0311f

Signature · 1 line
2.39.5