From: "tip-bot2 for Juergen Gross" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Borislav Petkov <bp@alien8.de>, Juergen Gross <jgross@suse.com>,
Borislav Petkov <bp@suse.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/cpu] x86/mtrr: Add comment for set_mtrr_state() serialization
Date: Wed, 19 Oct 2022 18:45:31 -0000 [thread overview]
Message-ID: <166620513111.401.160324987040371856.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220820092533.29420-2-jgross@suse.com>
The following commit has been merged into the x86/cpu branch of tip:
Commit-ID: 01c97c7303580682751b5aaae043b639bdcbacb3
Gitweb: https://git.kernel.org/tip/01c97c7303580682751b5aaae043b639bdcbacb3
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Tue, 04 Oct 2022 10:10:08 +02:00
Committer: Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 19 Oct 2022 20:37:23 +02:00
x86/mtrr: Add comment for set_mtrr_state() serialization
Add a comment about set_mtrr_state() needing serialization.
[ bp: Touchups. ]
Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220820092533.29420-2-jgross@suse.com
---
arch/x86/kernel/cpu/mtrr/generic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 5581082..c8f8951 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)
next prev parent reply other threads:[~2022-10-19 18:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-20 9:25 [PATCH v2 00/10] x86: make pat and mtrr independent from each other Juergen Gross
2022-08-20 9:25 ` [PATCH v2 01/10] x86/mtrr: fix MTRR fixup on APs Juergen Gross
2022-08-20 10:28 ` Greg KH
2022-08-21 12:25 ` Borislav Petkov
2022-08-21 21:41 ` Borislav Petkov
2022-08-22 5:17 ` Juergen Gross
2022-08-22 8:28 ` Borislav Petkov
2022-08-22 8:32 ` Juergen Gross
2022-10-19 18:45 ` tip-bot2 for Juergen Gross [this message]
2022-08-20 9:25 ` [PATCH v2 02/10] x86/mtrr: remove unused cyrix_set_all() function Juergen Gross
2022-08-25 10:31 ` Borislav Petkov
2022-08-25 10:38 ` Juergen Gross
2022-08-25 10:41 ` Juergen Gross
2022-08-25 11:42 ` Borislav Petkov
2022-08-25 12:13 ` Juergen Gross
2022-08-20 9:25 ` [PATCH v2 03/10] x86/mtrr: replace use_intel() with a local flag Juergen Gross
2022-08-20 9:25 ` [PATCH v2 04/10] x86: move some code out of arch/x86/kernel/cpu/mtrr Juergen Gross
2022-08-20 9:25 ` [PATCH v2 05/10] x86/mtrr: split generic_set_all() Juergen Gross
2022-08-20 9:25 ` [PATCH v2 06/10] x86/mtrr: remove set_all callback from struct mtrr_ops Juergen Gross
2022-08-20 9:25 ` [PATCH v2 07/10] x86/mtrr: simplify mtrr_bp_init() Juergen Gross
2022-08-20 9:25 ` [PATCH v2 08/10] x86/mtrr: let cache_aps_delayed_init replace mtrr_aps_delayed_init Juergen Gross
2022-08-20 9:25 ` [PATCH v2 09/10] x86/mtrr: add a stop_machine() handler calling only cache_cpu_init() Juergen Gross
2022-08-20 9:25 ` [PATCH v2 10/10] x86: decouple pat and mtrr handling Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=166620513111.401.160324987040371856.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®