lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Nov 2017 07:44:14 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     Andy Lutomirski <luto@...nel.org>
Cc:     Thomas Gleixner <tglx@...utronix.de>, X86 ML <x86@...nel.org>,
        Borislav Petkov <bpetkov@...e.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Brian Gerst <brgerst@...il.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH v2 00/18] Entry stack switching


* Ingo Molnar <mingo@...nel.org> wrote:

> > Anyway, I booted your config (more or less -- I munged it through
> > virtme-configkernel --update first) with 17 vCPUs and it seems fine.
> > Is the issue reliable enough to bisect?
> 
> Ok, it should be bisectable, will try to bisect it.

The latestest entry-stack code appears to be working fine though.

So one of the below fixes from yesterday appears to have done the trick.

I'll re-test today to make sure: maybe it's more sporadic than I thought, in one 
of the bootups I got the do_IRQ warning only once, in half a day of uptime.

Thanks,

	Ingo

=================>

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index f1cef194dfba..3d404f8d0443 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -51,15 +51,19 @@ ENTRY(native_usergs_sysret64)
 END(native_usergs_sysret64)
 #endif /* CONFIG_PARAVIRT */
 
-.macro TRACE_IRQS_IRETQ
+.macro TRACE_IRQS_FLAGS flags:req
 #ifdef CONFIG_TRACE_IRQFLAGS
-	bt	$9, EFLAGS(%rsp)		/* interrupts off? */
+	bt	$9, \flags		/* interrupts off? */
 	jnc	1f
 	TRACE_IRQS_ON
 1:
 #endif
 .endm
 
+.macro TRACE_IRQS_IRETQ
+	TRACE_IRQS_FLAGS EFLAGS(%rsp)
+.endm
+
 /*
  * When dynamic function tracer is enabled it will add a breakpoint
  * to all locations that it is about to modify, sync CPUs, update
@@ -1069,11 +1073,13 @@ ENTRY(native_load_gs_index)
 	FRAME_BEGIN
 	pushfq
 	DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI)
+	TRACE_IRQS_OFF
 	SWAPGS
 .Lgs_change:
 	movl	%edi, %gs
 2:	ALTERNATIVE "", "mfence", X86_BUG_SWAPGS_FENCE
 	SWAPGS
+	TRACE_IRQS_FLAGS (%rsp)
 	popfq
 	FRAME_END
 	ret
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 8562356213cd..15cf010225c9 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -47,10 +47,9 @@ extern unsigned long __FIXADDR_TOP;
 /*
  * cpu_entry_area is a percpu region in the fixmap that contains things
  * needed by the CPU and early entry/exit code.  Real types aren't used
- * for all fields here to about circular header dependencies.
+ * for all fields here to avoid circular header dependencies.
  */
-struct cpu_entry_area
-{
+struct cpu_entry_area {
 	char gdt[PAGE_SIZE];
 
 	/*
@@ -232,8 +231,7 @@ static inline unsigned int __get_cpu_entry_area_page_index(int cpu, int page)
 
 static inline struct cpu_entry_area *get_cpu_entry_area(int cpu)
 {
-	return (struct cpu_entry_area *)
-		__fix_to_virt(__get_cpu_entry_area_page_index(cpu, 0));
+	return (struct cpu_entry_area *)__fix_to_virt(__get_cpu_entry_area_page_index(cpu, 0));
 }
 
 #endif /* !__ASSEMBLY__ */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ