kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/2] x86/apic: x2apic write eoi msr notrace
@ 2016-10-31  1:37 Wanpeng Li
  2016-10-31  1:37 ` [PATCH v7 1/2] x86/msr: Add write " Wanpeng Li
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wanpeng Li @ 2016-10-31  1:37 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: Ingo Molnar, Mike Galbraith, Peter Zijlstra, Thomas Gleixner,
	Paolo Bonzini, Borislav Petkov, Wanpeng Li

| RCU used illegally from idle CPU!
| rcu_scheduler_active = 1, debug_locks = 0
| RCU used illegally from extended quiescent state!
| no locks held by swapper/1/0.
| 
|  [<ffffffff9d492b95>] do_trace_write_msr+0x135/0x140
|  [<ffffffff9d06f860>] native_write_msr+0x20/0x30
|  [<ffffffff9d065fad>] native_apic_msr_eoi_write+0x1d/0x30
|  [<ffffffff9d05bd1d>] smp_reschedule_interrupt+0x1d/0x30
|  [<ffffffff9d8daec6>] reschedule_interrupt+0x96/0xa0

Reschedule interrupt may be called in cpu idle state. This causes lockdep
check warning above.

As Peterz pointed out:

| The thing is, many many smp_reschedule_interrupt() invocations don't
| actually execute anything much at all and are only send to tickle the
| return to user path (which does the actual preemption).
| 
| Having to do the whole irq_enter/irq_exit dance just for this unlikely
| debug case totally blows.

This patchset adds x2apic write eoi msr notrace to avoid the debug codes 
splash and reverts irq_enter/irq_exit dance to avoid to make a very frequent 
interrupt slower because of debug code.

v6 -> v7:
 * cleanup storage class should be at the beginning of the declaration

v5 -> v6:
 * split the patch 
 * don't duplicate the inline asm

v4 -> v5:
 * add notrace mark 

v3 -> v4: 
 * add notrace mark 

v2 -> v3:
 * revert irq_enter/irq_exit() since it is merged

v1 -> v2:
 * add write msr notrace to avoid debug codes splash instead of slowdown 
   a very frequent interrupt


Wanpeng Li (2):
  x86/msr: Add write msr notrace
  x86/apic: x2apic write eoi msr notrace

 arch/x86/include/asm/apic.h |  3 ++-
 arch/x86/include/asm/msr.h  | 14 +++++++++++++-
 arch/x86/kernel/apic/apic.c |  1 +
 arch/x86/kernel/kvm.c       |  4 ++--
 arch/x86/kernel/smp.c       |  2 --
 5 files changed, 18 insertions(+), 6 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-07  2:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31  1:37 [PATCH v7 0/2] x86/apic: x2apic write eoi msr notrace Wanpeng Li
2016-10-31  1:37 ` [PATCH v7 1/2] x86/msr: Add write " Wanpeng Li
2016-11-02 21:10   ` Borislav Petkov
2016-10-31  1:37 ` [PATCH v7 2/2] x86/apic: x2apic write eoi " Wanpeng Li
2016-11-02 21:10   ` Borislav Petkov
2016-11-07  2:52     ` Wanpeng Li
2016-11-02 21:10 ` [PATCH v7 0/2] " Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).