aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Gross <[email protected]>2022-10-04 10:10:08 +0200
committerBorislav Petkov <[email protected]>2022-10-19 20:37:23 +0200
commit01c97c7303580682751b5aaae043b639bdcbacb3 (patch)
tree4dd6d8f0eb87a549e36831dc507c2fcfaea67575
parent1d30800c0c0ae1d086ffad2bdf0ba4403370f132 (diff)
x86/mtrr: Add comment for set_mtrr_state() serialization
Add a comment about set_mtrr_state() needing serialization. [ bp: Touchups. ] Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Juergen Gross <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 558108296f3c..c8f895157e05 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -684,7 +684,10 @@ static u32 deftype_lo, deftype_hi;
/**
* set_mtrr_state - Set the MTRR state for this CPU.
*
- * NOTE: The CPU must already be in a safe state for MTRR changes.
+ * NOTE: The CPU must already be in a safe state for MTRR changes, including
+ * measures that only a single CPU can be active in set_mtrr_state() in
+ * order to not be subject to races for usage of deftype_lo. This is
+ * accomplished by taking set_atomicity_lock.
* RETURNS: 0 if no changes made, else a mask indicating what was changed.
*/
static unsigned long set_mtrr_state(void)