Skip to contentSkip to conversation

x86 fixes

GIT PULL Merged Ingo Molnar 4 participants 4 messages Oct 11, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86/urgent git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2020-10-11

# HEAD: 0c7689830e907668288a1a1da84dca66dbdb4728 Documentation/x86: Fix incorrect references to zero-page.txt

Two fixes:

- Fix a (hopefully final) IRQ state tracking bug vs. MCE handling
- Fix a documentation link

Thanks,

Ingo

------------------>
Heinrich Schuchardt (1):
Documentation/x86: Fix incorrect references to zero-page.txt

Thomas Gleixner (1):
x86/mce: Use idtentry_nmi_enter/exit()

 Documentation/x86/boot.rst     | 6 +++---
 arch/x86/kernel/cpu/mce/core.c | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)
Documentation/x86/boot.rst +3 -3
index 7fafc7ac00d7..abb9fc164657 100644
@@ -1342,8 +1342,8 @@ follow::
 
 In addition to read/modify/write the setup header of the struct
 boot_params as that of 16-bit boot protocol, the boot loader should
-also fill the additional fields of the struct boot_params as that
-described in zero-page.txt.
+also fill the additional fields of the struct boot_params as
+described in chapter :doc:`zero-page`.
 
 After setting up the struct boot_params, the boot loader can load the
 32/64-bit kernel in the same way as that of 16-bit boot protocol.
@@ -1379,7 +1379,7 @@ can be calculated as follows::
 In addition to read/modify/write the setup header of the struct
 boot_params as that of 16-bit boot protocol, the boot loader should
 also fill the additional fields of the struct boot_params as described
-in zero-page.txt.
+in chapter :doc:`zero-page`.
 
 After setting up the struct boot_params, the boot loader can load
 64-bit kernel in the same way as that of 16-bit boot protocol, but
arch/x86/kernel/cpu/mce/core.c +4 -2
index f43a78bde670..fc4f8c04bdb5 100644
@@ -1904,6 +1904,8 @@ void (*machine_check_vector)(struct pt_regs *) = unexpected_machine_check;
 
 static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
 {
+	bool irq_state;
+
 	WARN_ON_ONCE(user_mode(regs));
 
 	/*
@@ -1914,7 +1916,7 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
 	    mce_check_crashing_cpu())
 		return;
 
-	nmi_enter();
+	irq_state = idtentry_enter_nmi(regs);
 	/*
 	 * The call targets are marked noinstr, but objtool can't figure
 	 * that out because it's an indirect call. Annotate it.
@@ -1925,7 +1927,7 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
 	if (regs->flags & X86_EFLAGS_IF)
 		trace_hardirqs_on_prepare();
 	instrumentation_end();
-	nmi_exit();
+	idtentry_exit_nmi(regs, irq_state);
 }
 
 static __always_inline void exc_machine_check_user(struct pt_regs *regs)
#1 lore raw
Quoted 2 lines · Ingo Molnar

- Fix a (hopefully final) IRQ state tracking bug vs. MCE handling

Why is the nmi_enter/nmi_exit thing not a problem on non-x86 architectures?

Put another way: x86 does extra work to track IRQ state across NMI. What makes x86 special? It _feels_ to me like everybody should do that? No?

Please tell me what I've missed..

Linus

merge bot Merged
#3 lore raw
In reply to Ingo Molnar
The pull request you sent on Sun, 11 Oct 2020 10:08:59 +0200:

The pull request you sent on Sun, 11 Oct 2020 10:08:59 +0200:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2020-10-11

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/c120ec12e216225f7536cc1b924fe428ff64b5bd

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
#2 lore raw
In reply to Linus Torvalds

Linus,

Quoted 11 lines · Linus Torvalds
Quoted 2 lines · Ingo Molnar

- Fix a (hopefully final) IRQ state tracking bug vs. MCE handling

Why is the nmi_enter/nmi_exit thing not a problem on non-x86 architectures?

Put another way: x86 does extra work to track IRQ state across NMI. What makes x86 special? It _feels_ to me like everybody should do that? No?

Please tell me what I've missed..

Not a lot. The nmi related tracking plus the entry/exit inconsistencies which we identified and fixed over the past couple of releases in x86 apply pretty much to all of arch/* in one way or the other and of course in different flavours.

This is worked on by architecture people and will hopefully be solved at some point by moving all architectures to the generic entry code.

Thanks,

tglx