Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375363

[PATCH 4.5 029/238] x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt()

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.5 029/238] x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt()
Date 2016-04-10 23:00 +0200
Message-ID <rmuCF-2to-85@gated-at.bofh.it> (permalink)
References <rmsr7-Nr-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.5-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dave Jones <davej@codemonkey.org.uk>

commit 7834c10313fb823e538f2772be78edcdeed2e6e3 upstream.

Since 4.4, I've been able to trigger this occasionally:

===============================
[ INFO: suspicious RCU usage. ]
4.5.0-rc7-think+ #3 Not tainted
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/20160315012054.GA17765@codemonkey.org.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-------------------------------
./arch/x86/include/asm/msr-trace.h:47 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from idle CPU!
rcu_scheduler_active = 1, debug_locks = 1
RCU used illegally from extended quiescent state!
no locks held by swapper/3/0.

stack backtrace:
CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.5.0-rc7-think+ #3
 ffffffff92f821e0 1f3e5c340597d7fc ffff880468e07f10 ffffffff92560c2a
 ffff880462145280 0000000000000001 ffff880468e07f40 ffffffff921376a6
 ffffffff93665ea0 0000cc7c876d28da 0000000000000005 ffffffff9383dd60
Call Trace:
 <IRQ>  [<ffffffff92560c2a>] dump_stack+0x67/0x9d
 [<ffffffff921376a6>] lockdep_rcu_suspicious+0xe6/0x100
 [<ffffffff925ae7a7>] do_trace_write_msr+0x127/0x1a0
 [<ffffffff92061c83>] native_apic_msr_eoi_write+0x23/0x30
 [<ffffffff92054408>] smp_trace_call_function_interrupt+0x38/0x360
 [<ffffffff92d1ca60>] trace_call_function_interrupt+0x90/0xa0
 <EOI>  [<ffffffff92ac5124>] ? cpuidle_enter_state+0x1b4/0x520

Move the entering_irq() call before ack_APIC_irq(), because entering_irq()
tells the RCU susbstems to end the extended quiescent state, so that the
following trace call in ack_APIC_irq() works correctly.

Suggested-by: Andi Kleen <ak@linux.intel.com>
Fixes: 4787c368a9bc "x86/tracing: Add irq_enter/exit() in smp_trace_reschedule_interrupt()"
Signed-off-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/include/asm/apic.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -644,8 +644,8 @@ static inline void entering_irq(void)
 
 static inline void entering_ack_irq(void)
 {
-	ack_APIC_irq();
 	entering_irq();
+	ack_APIC_irq();
 }
 
 static inline void ipi_entering_ack_irq(void)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.5 000/238] 4.5.1-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 027/238] PCI: ACPI: IA64: fix IO port generic range check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 001/238] x86/microcode/intel: Make early loader look for builtin microcode too Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 010/238] KVM: VMX: avoid guest hang on invalid invvpid instruction Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 033/238] sg: fix dxferp in from_to case Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 023/238] s390/cpumf: add missing lpp magic initialization Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 024/238] s390/pci: enforce fmb page boundary rule Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 025/238] pinctrl-bcm2835: Fix cut-and-paste error in "pull" parsing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 031/238] x86/iopl: Fix iopl capability check on Xen PV Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 026/238] PCI: Disable IO/MEM decoding for devices with non-compliant BARs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
    Re: [PATCH 4.5 026/238] PCI: Disable IO/MEM decoding for devices  with non-compliant BARs Ben Hutchings <ben@decadent.org.uk> - 2016-04-12 01:50 +0200
      Re: [PATCH 4.5 026/238] PCI: Disable IO/MEM decoding for devices  with non-compliant BARs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-12 16:40 +0200
  [PATCH 4.5 022/238] s390: fix floating pointer register corruption (again) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 019/238] sched/preempt, sh: kmap_coherent relies on disabled preemption Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 029/238] x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  [PATCH 4.5 021/238] EDAC, amd64_edac: Shift wrapping issue in f1x_get_norm_dct_addr() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 23:00 +0200
  Re: [PATCH 4.5 000/238] 4.5.1-stable review Guenter Roeck <linux@roeck-us.net> - 2016-04-11 08:50 +0200
    Re: [PATCH 4.5 000/238] 4.5.1-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-12 16:40 +0200
  Re: [PATCH 4.5 000/238] 4.5.1-stable review shuahkh <shuahkh@osg.sisa.samsung.com> - 2016-04-11 19:30 +0200
    Re: [PATCH 4.5 000/238] 4.5.1-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-12 08:50 +0200

csiph-web