Skip to contentSkip to conversation

x86 fixes for v3.14-rc6

GIT PULL H. Peter Anvin 3 participants 4 messages Mar 7, 2014 – Mar 8, 2014

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

Hi Linus,

A small collection of minor fixes. The FPU stuff is still pending, I fear. I haven't heard anything from Suresh so I suspect I'm going to have to dig into the init specifics myself and fix up the patchset.

The following changes since commit 0414855fdc4a40da05221fc6062cccbc0c30f169:

Linux 3.14-rc5 (2014-03-02 18:56:16 -0800)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus

for you to fetch changes up to 5fa10196bdb5f190f595ebd048490ee52dddea0f:

x86: Ignore NMIs that come in during early boot (2014-03-07 15:08:14 -0800)

----------------------------------------------------------------
Borislav Petkov (1):
x86/efi: Quirk out SGI UV

H. Peter Anvin (2):
Merge tag 'efi-urgent' into x86/urgent
x86: Ignore NMIs that come in during early boot

Jiri Olsa (1):
x86, trace: Fix CR2 corruption when tracing page faults

Peter Zijlstra (1):
x86, trace: Further robustify CR2 handling vs tracing

 arch/x86/include/asm/efi.h  |  1 +
 arch/x86/kernel/head_32.S   |  7 ++++++-
 arch/x86/kernel/head_64.S   |  6 +++++-
 arch/x86/kernel/setup.c     | 10 ++--------
 arch/x86/mm/fault.c         | 47 +++++++++++++++++++++++++++++++--------------
 arch/x86/platform/efi/efi.c | 20 +++++++++++++++++++
 6 files changed, 67 insertions(+), 24 deletions(-)
arch/x86/include/asm/efi.h +1 -0
index 3d6b9f8..acd86c8 100644
@@ -134,6 +134,7 @@ extern void efi_setup_page_tables(void);
 extern void __init old_map_region(efi_memory_desc_t *md);
 extern void __init runtime_code_page_mkexec(void);
 extern void __init efi_runtime_mkexec(void);
+extern void __init efi_apply_memmap_quirks(void);
 
 struct efi_setup_data {
 	u64 fw_vendor;
arch/x86/kernel/head_32.S +6 -1
index 81ba276..d2a2159 100644
@@ -544,6 +544,10 @@ ENDPROC(early_idt_handlers)
 	/* This is global to keep gas from relaxing the jumps */
 ENTRY(early_idt_handler)
 	cld
+
+	cmpl $X86_TRAP_NMI,(%esp)
+	je is_nmi		# Ignore NMI
+
 	cmpl $2,%ss:early_recursion_flag
 	je hlt_loop
 	incl %ss:early_recursion_flag
@@ -594,8 +598,9 @@ ex_entry:
 	pop %edx
 	pop %ecx
 	pop %eax
-	addl $8,%esp		/* drop vector number and error code */
 	decl %ss:early_recursion_flag
+is_nmi:
+	addl $8,%esp		/* drop vector number and error code */
 	iret
 ENDPROC(early_idt_handler)
 
arch/x86/kernel/head_64.S +5 -1
index e1aabdb..33f36c7 100644
@@ -343,6 +343,9 @@ early_idt_handlers:
 ENTRY(early_idt_handler)
 	cld
 
+	cmpl $X86_TRAP_NMI,(%rsp)
+	je is_nmi		# Ignore NMI
+
 	cmpl $2,early_recursion_flag(%rip)
 	jz  1f
 	incl early_recursion_flag(%rip)
@@ -405,8 +408,9 @@ ENTRY(early_idt_handler)
 	popq %rdx
 	popq %rcx
 	popq %rax
-	addq $16,%rsp		# drop vector number and error code
 	decl early_recursion_flag(%rip)
+is_nmi:
+	addq $16,%rsp		# drop vector number and error code
 	INTERRUPT_RETURN
 ENDPROC(early_idt_handler)
 
arch/x86/kernel/setup.c +2 -8
index 06853e6..ce72964 100644
@@ -1239,14 +1239,8 @@ void __init setup_arch(char **cmdline_p)
 	register_refined_jiffies(CLOCK_TICK_RATE);
 
 #ifdef CONFIG_EFI
-	/* Once setup is done above, unmap the EFI memory map on
-	 * mismatched firmware/kernel archtectures since there is no
-	 * support for runtime services.
-	 */
-	if (efi_enabled(EFI_BOOT) && !efi_is_native()) {
-		pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
-		efi_unmap_memmap();
-	}
+	if (efi_enabled(EFI_BOOT))
+		efi_apply_memmap_quirks();
 #endif
 }
 
arch/x86/mm/fault.c +33 -14

87 lines not on this page · raw message

arch/x86/platform/efi/efi.c +20 -0
index 1a201ac..b97acec 100644
@@ -52,6 +52,7 @@
 #include <asm/tlbflush.h>
 #include <asm/x86_init.h>
 #include <asm/rtc.h>
+#include <asm/uv/uv.h>
 
 #define EFI_DEBUG
 
@@ -1210,3 +1211,22 @@ static int __init parse_efi_cmdline(char *str)
 	return 0;
 }
 early_param("efi", parse_efi_cmdline);
+
+void __init efi_apply_memmap_quirks(void)
+{
+	/*
+	 * Once setup is done earlier, unmap the EFI memory map on mismatched
+	 * firmware/kernel architectures since there is no support for runtime
+	 * services.
+	 */
+	if (!efi_is_native()) {
+		pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
+		efi_unmap_memmap();
+	}
+
+	/*
+	 * UV doesn't support the new EFI pagetable mapping yet.
+	 */
+	if (is_uv_system())
+		set_bit(EFI_OLD_MEMMAP, &x86_efi_facility);
+}
#1 lore raw

Oww, oww, oww.

DAMMIT.

Quoted 4 lines · H. Peter Anvin

A small collection of minor fixes. The FPU stuff is still pending, I fear. I haven't heard anything from Suresh so I suspect I'm going to have to dig into the init specifics myself and fix up the patchset.

I pulled this and then pushed out without test-compiling, because I'm not used to the x86 trees causing problems. Usually they've gone through a lot of build tests etc.

But dammit, it's broken:

arch/x86/kernel/head_64.o: In function `early_idt_handler':
(.init.text+0x124): undefined reference to `X86_TRAP_NMI'

because X86_TRAP_NMI is an enum, not a #define.

This can not have worked in your tree either, because that thing has never been anything *but* an enum. So I'm pissed off. This patch was clearly never tested anywhere. Why was it sent to me?

Grr. Consider yourself cursed at. Saatana.

Linus

#2 lore raw

Bloody hell. Friday afternoon malfunction (thought I checked the output and apparently missed.)

Quoted 29 lines · Linus Torvalds

Oww, oww, oww.

DAMMIT.

Quoted 4 lines · H. Peter Anvin

A small collection of minor fixes. The FPU stuff is still pending, I fear. I haven't heard anything from Suresh so I suspect I'm going to have to dig into the init specifics myself and fix up the patchset.

I pulled this and then pushed out without test-compiling, because I'm not used to the x86 trees causing problems. Usually they've gone through a lot of build tests etc.

But dammit, it's broken:

arch/x86/kernel/head_64.o: In function `early_idt_handler':
(.init.text+0x124): undefined reference to `X86_TRAP_NMI'

because X86_TRAP_NMI is an enum, not a #define.

This can not have worked in your tree either, because that thing has never been anything *but* an enum. So I'm pissed off. This patch was clearly never tested anywhere. Why was it sent to me?

Grr. Consider yourself cursed at. Saatana.

Linus

Signature · 1 line
Sent from my mobile phone.  Please pardon brevity and lack of formatting.
#3 lore raw
In reply to Linus Torvalds

And yes, of course the change from hardcoded 2 to X86_TRAP_NMI was an afterthought.

Quoted 29 lines · Linus Torvalds

Oww, oww, oww.

DAMMIT.

Quoted 4 lines · H. Peter Anvin

A small collection of minor fixes. The FPU stuff is still pending, I fear. I haven't heard anything from Suresh so I suspect I'm going to have to dig into the init specifics myself and fix up the patchset.

I pulled this and then pushed out without test-compiling, because I'm not used to the x86 trees causing problems. Usually they've gone through a lot of build tests etc.

But dammit, it's broken:

arch/x86/kernel/head_64.o: In function `early_idt_handler':
(.init.text+0x124): undefined reference to `X86_TRAP_NMI'

because X86_TRAP_NMI is an enum, not a #define.

This can not have worked in your tree either, because that thing has never been anything *but* an enum. So I'm pissed off. This patch was clearly never tested anywhere. Why was it sent to me?

Grr. Consider yourself cursed at. Saatana.

Linus

Signature · 1 line
Sent from my mobile phone.  Please pardon brevity and lack of formatting.