Skip to content

Commit 1f75619

Browse files
committed
Merge tag 'x86_misc_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc x86 fixes from Borislav Petkov: - Fix a wrong check in the function reporting whether a CPU executes (or not) a NMI handler - Ratelimit unknown NMIs messages in order to not potentially slow down the machine - Other fixlets * tag 'x86_misc_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/nmi: Fix the inverse "in NMI handler" check Documentation/maintainer-tip: Add C++ tail comments exception Documentation/maintainer-tip: Add Closes tag x86/nmi: Rate limit unknown NMI messages Documentation/kernel-parameters: Add spec_rstack_overflow to mitigations=off
2 parents 38b334f + d54e56f commit 1f75619

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3395,6 +3395,7 @@
33953395
nospectre_v1 [X86,PPC]
33963396
nospectre_v2 [X86,PPC,S390,ARM64]
33973397
retbleed=off [X86]
3398+
spec_rstack_overflow=off [X86]
33983399
spec_store_bypass_disable=off [X86,PPC]
33993400
spectre_v2_user=off [X86]
34003401
srbds=off [X86,INTEL]

Documentation/process/maintainer-tip.rst

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,15 @@ following tag ordering scheme:
304304

305305
- Reported-by: ``Reporter <reporter@mail>``
306306

307+
- Closes: ``URL or Message-ID of the bug report this is fixing``
308+
307309
- Originally-by: ``Original author <original-author@mail>``
308310

309311
- Suggested-by: ``Suggester <suggester@mail>``
310312

311313
- Co-developed-by: ``Co-author <co-author@mail>``
312314

313-
Signed-off: ``Co-author <co-author@mail>``
315+
Signed-off-by: ``Co-author <co-author@mail>``
314316

315317
Note, that Co-developed-by and Signed-off-by of the co-author(s) must
316318
come in pairs.
@@ -478,7 +480,7 @@ Multi-line comments::
478480
* Larger multi-line comments should be split into paragraphs.
479481
*/
480482

481-
No tail comments:
483+
No tail comments (see below):
482484

483485
Please refrain from using tail comments. Tail comments disturb the
484486
reading flow in almost all contexts, but especially in code::
@@ -499,6 +501,34 @@ No tail comments:
499501
/* This magic initialization needs a comment. Maybe not? */
500502
seed = MAGIC_CONSTANT;
501503
504+
Use C++ style, tail comments when documenting structs in headers to
505+
achieve a more compact layout and better readability::
506+
507+
// eax
508+
u32 x2apic_shift : 5, // Number of bits to shift APIC ID right
509+
// for the topology ID at the next level
510+
: 27; // Reserved
511+
// ebx
512+
u32 num_processors : 16, // Number of processors at current level
513+
: 16; // Reserved
514+
515+
versus::
516+
517+
/* eax */
518+
/*
519+
* Number of bits to shift APIC ID right for the topology ID
520+
* at the next level
521+
*/
522+
u32 x2apic_shift : 5,
523+
/* Reserved */
524+
: 27;
525+
526+
/* ebx */
527+
/* Number of processors at current level */
528+
u32 num_processors : 16,
529+
/* Reserved */
530+
: 16;
531+
502532
Comment the important things:
503533

504534
Comments should be added where the operation is not obvious. Documenting

arch/x86/kernel/nmi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
304304

305305
__this_cpu_add(nmi_stats.unknown, 1);
306306

307-
pr_emerg("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n",
308-
reason, smp_processor_id());
307+
pr_emerg_ratelimited("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n",
308+
reason, smp_processor_id());
309309

310310
if (unknown_nmi_panic || panic_on_unrecovered_nmi)
311311
nmi_panic(regs, "NMI: Not continuing");
312312

313-
pr_emerg("Dazed and confused, but trying to continue\n");
313+
pr_emerg_ratelimited("Dazed and confused, but trying to continue\n");
314314
}
315315
NOKPROBE_SYMBOL(unknown_nmi_error);
316316

@@ -637,7 +637,7 @@ void nmi_backtrace_stall_check(const struct cpumask *btp)
637637
msgp = nmi_check_stall_msg[idx];
638638
if (nsp->idt_ignored_snap != READ_ONCE(nsp->idt_ignored) && (idx & 0x1))
639639
modp = ", but OK because ignore_nmis was set";
640-
if (nmi_seq & ~0x1)
640+
if (nmi_seq & 0x1)
641641
msghp = " (CPU currently in NMI handler function)";
642642
else if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
643643
msghp = " (CPU exited one NMI handler function)";

0 commit comments

Comments
 (0)