Skip to content

Commit 40eb0cb

Browse files
committed
x86/cpu: Fix typos and improve the comments in sync_core()
- Fix typos. - Move the compiler barrier comment to the top, because it's valid for the whole function, not just the legacy branch. Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200818053130.GA3161093@gmail.com Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
1 parent 8610981 commit 40eb0cb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

arch/x86/include/asm/sync_core.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@ static inline void iret_to_self(void)
4747
*
4848
* b) Text was modified on a different CPU, may subsequently be
4949
* executed on this CPU, and you want to make sure the new version
50-
* gets executed. This generally means you're calling this in a IPI.
50+
* gets executed. This generally means you're calling this in an IPI.
5151
*
5252
* If you're calling this for a different reason, you're probably doing
5353
* it wrong.
54+
*
55+
* Like all of Linux's memory ordering operations, this is a
56+
* compiler barrier as well.
5457
*/
5558
static inline void sync_core(void)
5659
{
5760
/*
5861
* The SERIALIZE instruction is the most straightforward way to
59-
* do this but it not universally available.
62+
* do this, but it is not universally available.
6063
*/
6164
if (static_cpu_has(X86_FEATURE_SERIALIZE)) {
6265
serialize();
@@ -67,10 +70,10 @@ static inline void sync_core(void)
6770
* For all other processors, there are quite a few ways to do this.
6871
* IRET-to-self is nice because it works on every CPU, at any CPL
6972
* (so it's compatible with paravirtualization), and it never exits
70-
* to a hypervisor. The only down sides are that it's a bit slow
73+
* to a hypervisor. The only downsides are that it's a bit slow
7174
* (it seems to be a bit more than 2x slower than the fastest
72-
* options) and that it unmasks NMIs. The "push %cs" is needed
73-
* because, in paravirtual environments, __KERNEL_CS may not be a
75+
* options) and that it unmasks NMIs. The "push %cs" is needed,
76+
* because in paravirtual environments __KERNEL_CS may not be a
7477
* valid CS value when we do IRET directly.
7578
*
7679
* In case NMI unmasking or performance ever becomes a problem,
@@ -81,9 +84,6 @@ static inline void sync_core(void)
8184
* CPUID is the conventional way, but it's nasty: it doesn't
8285
* exist on some 486-like CPUs, and it usually exits to a
8386
* hypervisor.
84-
*
85-
* Like all of Linux's memory ordering operations, this is a
86-
* compiler barrier as well.
8787
*/
8888
iret_to_self();
8989
}

0 commit comments

Comments
 (0)