linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available()
@ 2012-08-28 21:00 Sergey Senozhatsky
  2012-08-28 22:11 ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Senozhatsky @ 2012-08-28 21:00 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, H. Peter Anvin, x86, Steven Rostedt,
	Srikar Dronamraju, Peter Zijlstra, Paul E. McKenney,
	linux-kernel

 x86: use new exception_enter()/exception_exit() API in do_device_not_available()

 RCU can be in extended quiescent state when do_device_not_available() called.

[  676.400274] RCU used illegally from idle CPU!
[  676.400274] rcu_scheduler_active = 1, debug_locks = 0
[  676.400278] RCU used illegally from extended quiescent state!
[  676.400282] 2 locks held by sed/9468:
[  676.400285]  #0:  (&rq->lock){-.-.-.}, at: [<ffffffff814c67cf>] __schedule+0x1c0/0x992
[  676.400304]  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8106a880>] cpuacct_charge+0x27/0x1e0
[  676.400321] 
[  676.400329] Call Trace:
[  676.400340]  [<ffffffff8108933a>] lockdep_rcu_suspicious+0x109/0x112
[  676.400347]  [<ffffffff8106a8f7>] cpuacct_charge+0x9e/0x1e0
[  676.400353]  [<ffffffff8106a880>] ? cpuacct_charge+0x27/0x1e0
[  676.400359]  [<ffffffff814c67cf>] ? __schedule+0x1c0/0x992
[  676.400366]  [<ffffffff8106d525>] update_curr+0x159/0x200
[  676.400375]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
[  676.400382]  [<ffffffff8106e0da>] put_prev_task_fair+0x2a/0xac
[  676.400388]  [<ffffffff814c69a7>] __schedule+0x398/0x992
[  676.400397]  [<ffffffff810b4f0a>] ? rcu_irq_exit+0x83/0x99
[  676.400404]  [<ffffffff814c8bf0>] ? retint_restore_args+0x13/0x13
[  676.400411]  [<ffffffff810889e9>] ? lock_is_held+0x2d/0xa5
[  676.400414]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
[  676.400417]  [<ffffffff81065d0a>] __cond_resched+0x28/0x34
[  676.400420]  [<ffffffff814c701a>] _cond_resched+0x2e/0x35
[  676.400425]  [<ffffffff8111cad4>] kmem_cache_alloc+0x4c/0x1c5
[  676.400430]  [<ffffffff810021ff>] ? math_state_restore+0x1f/0xdc
[  676.400433]  [<ffffffff8100a04f>] init_fpu+0x4e/0x8f
[  676.400437]  [<ffffffff8100220e>] math_state_restore+0x2e/0xdc
[  676.400440]  [<ffffffff814c982e>] do_device_not_available+0xe/0x10
[  676.400445]  [<ffffffff814d161b>] device_not_available+0x1b/0x20


Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

---

 arch/x86/kernel/traps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ab82cbd..dff3e72 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -654,7 +654,9 @@ do_device_not_available(struct pt_regs *regs, long error_code)
 		return;
 	}
 #endif
+	exception_enter(regs);
 	math_state_restore(); /* interrupts still off */
+	exception_enter(regs);
 #ifdef CONFIG_X86_32
 	conditional_sti(regs);
 #endif


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

* Re: [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available()
  2012-08-28 21:00 [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available() Sergey Senozhatsky
@ 2012-08-28 22:11 ` Borislav Petkov
  2012-08-29  4:42   ` Sergey Senozhatsky
  2012-08-29  4:47   ` [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available() (v2) Sergey Senozhatsky
  0 siblings, 2 replies; 5+ messages in thread
From: Borislav Petkov @ 2012-08-28 22:11 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Steven Rostedt, Srikar Dronamraju, Peter Zijlstra,
	Paul E. McKenney, linux-kernel

On Wed, Aug 29, 2012 at 12:00:47AM +0300, Sergey Senozhatsky wrote:
>  x86: use new exception_enter()/exception_exit() API in do_device_not_available()
> 
>  RCU can be in extended quiescent state when do_device_not_available() called.
> 
> [  676.400274] RCU used illegally from idle CPU!
> [  676.400274] rcu_scheduler_active = 1, debug_locks = 0
> [  676.400278] RCU used illegally from extended quiescent state!
> [  676.400282] 2 locks held by sed/9468:
> [  676.400285]  #0:  (&rq->lock){-.-.-.}, at: [<ffffffff814c67cf>] __schedule+0x1c0/0x992
> [  676.400304]  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8106a880>] cpuacct_charge+0x27/0x1e0
> [  676.400321] 
> [  676.400329] Call Trace:
> [  676.400340]  [<ffffffff8108933a>] lockdep_rcu_suspicious+0x109/0x112
> [  676.400347]  [<ffffffff8106a8f7>] cpuacct_charge+0x9e/0x1e0
> [  676.400353]  [<ffffffff8106a880>] ? cpuacct_charge+0x27/0x1e0
> [  676.400359]  [<ffffffff814c67cf>] ? __schedule+0x1c0/0x992
> [  676.400366]  [<ffffffff8106d525>] update_curr+0x159/0x200
> [  676.400375]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
> [  676.400382]  [<ffffffff8106e0da>] put_prev_task_fair+0x2a/0xac
> [  676.400388]  [<ffffffff814c69a7>] __schedule+0x398/0x992
> [  676.400397]  [<ffffffff810b4f0a>] ? rcu_irq_exit+0x83/0x99
> [  676.400404]  [<ffffffff814c8bf0>] ? retint_restore_args+0x13/0x13
> [  676.400411]  [<ffffffff810889e9>] ? lock_is_held+0x2d/0xa5
> [  676.400414]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
> [  676.400417]  [<ffffffff81065d0a>] __cond_resched+0x28/0x34
> [  676.400420]  [<ffffffff814c701a>] _cond_resched+0x2e/0x35
> [  676.400425]  [<ffffffff8111cad4>] kmem_cache_alloc+0x4c/0x1c5
> [  676.400430]  [<ffffffff810021ff>] ? math_state_restore+0x1f/0xdc
> [  676.400433]  [<ffffffff8100a04f>] init_fpu+0x4e/0x8f
> [  676.400437]  [<ffffffff8100220e>] math_state_restore+0x2e/0xdc
> [  676.400440]  [<ffffffff814c982e>] do_device_not_available+0xe/0x10
> [  676.400445]  [<ffffffff814d161b>] device_not_available+0x1b/0x20
> 
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 
> ---
> 
>  arch/x86/kernel/traps.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index ab82cbd..dff3e72 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -654,7 +654,9 @@ do_device_not_available(struct pt_regs *regs, long error_code)
>  		return;
>  	}
>  #endif
> +	exception_enter(regs);
>  	math_state_restore(); /* interrupts still off */
> +	exception_enter(regs);

Shouldn't that be exception_exit actually?

-- 
Regards/Gruss,
    Boris.

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

* Re: [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available()
  2012-08-28 22:11 ` Borislav Petkov
@ 2012-08-29  4:42   ` Sergey Senozhatsky
  2012-08-29 15:51     ` Borislav Petkov
  2012-08-29  4:47   ` [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available() (v2) Sergey Senozhatsky
  1 sibling, 1 reply; 5+ messages in thread
From: Sergey Senozhatsky @ 2012-08-29  4:42 UTC (permalink / raw)
  To: Borislav Petkov, Sergey Senozhatsky, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, Steven Rostedt,
	Srikar Dronamraju, Peter Zijlstra, Paul E. McKenney,
	linux-kernel

On (08/29/12 00:11), Borislav Petkov wrote:
> Date: Wed, 29 Aug 2012 00:11:13 +0200
> From: Borislav Petkov <bp@alien8.de>
> To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
>  "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org, Steven Rostedt
>  <rostedt@goodmis.org>, Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
>  Peter Zijlstra <a.p.zijlstra@chello.nl>, "Paul E. McKenney"
>  <paulmck@linux.vnet.ibm.com>, linux-kernel@vger.kernel.org
> Subject: Re: [RFC PATCH] x86: use new exception_enter()/exception_exit()
>  API in do_device_not_available()
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
> On Wed, Aug 29, 2012 at 12:00:47AM +0300, Sergey Senozhatsky wrote:
> >  x86: use new exception_enter()/exception_exit() API in do_device_not_available()
> > 
> >  RCU can be in extended quiescent state when do_device_not_available() called.
> > 
> > [  676.400274] RCU used illegally from idle CPU!
> > [  676.400274] rcu_scheduler_active = 1, debug_locks = 0
> > [  676.400278] RCU used illegally from extended quiescent state!
> > [  676.400282] 2 locks held by sed/9468:
> > [  676.400285]  #0:  (&rq->lock){-.-.-.}, at: [<ffffffff814c67cf>] __schedule+0x1c0/0x992
> > [  676.400304]  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8106a880>] cpuacct_charge+0x27/0x1e0
> > [  676.400321] 
> > [  676.400329] Call Trace:
> > [  676.400340]  [<ffffffff8108933a>] lockdep_rcu_suspicious+0x109/0x112
> > [  676.400347]  [<ffffffff8106a8f7>] cpuacct_charge+0x9e/0x1e0
> > [  676.400353]  [<ffffffff8106a880>] ? cpuacct_charge+0x27/0x1e0
> > [  676.400359]  [<ffffffff814c67cf>] ? __schedule+0x1c0/0x992
> > [  676.400366]  [<ffffffff8106d525>] update_curr+0x159/0x200
> > [  676.400375]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
> > [  676.400382]  [<ffffffff8106e0da>] put_prev_task_fair+0x2a/0xac
> > [  676.400388]  [<ffffffff814c69a7>] __schedule+0x398/0x992
> > [  676.400397]  [<ffffffff810b4f0a>] ? rcu_irq_exit+0x83/0x99
> > [  676.400404]  [<ffffffff814c8bf0>] ? retint_restore_args+0x13/0x13
> > [  676.400411]  [<ffffffff810889e9>] ? lock_is_held+0x2d/0xa5
> > [  676.400414]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
> > [  676.400417]  [<ffffffff81065d0a>] __cond_resched+0x28/0x34
> > [  676.400420]  [<ffffffff814c701a>] _cond_resched+0x2e/0x35
> > [  676.400425]  [<ffffffff8111cad4>] kmem_cache_alloc+0x4c/0x1c5
> > [  676.400430]  [<ffffffff810021ff>] ? math_state_restore+0x1f/0xdc
> > [  676.400433]  [<ffffffff8100a04f>] init_fpu+0x4e/0x8f
> > [  676.400437]  [<ffffffff8100220e>] math_state_restore+0x2e/0xdc
> > [  676.400440]  [<ffffffff814c982e>] do_device_not_available+0xe/0x10
> > [  676.400445]  [<ffffffff814d161b>] device_not_available+0x1b/0x20
> > 
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > 
> > ---
> > 
> >  arch/x86/kernel/traps.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> > index ab82cbd..dff3e72 100644
> > --- a/arch/x86/kernel/traps.c
> > +++ b/arch/x86/kernel/traps.c
> > @@ -654,7 +654,9 @@ do_device_not_available(struct pt_regs *regs, long error_code)
> >  		return;
> >  	}
> >  #endif
> > +	exception_enter(regs);
> >  	math_state_restore(); /* interrupts still off */
> > +	exception_enter(regs);
> 
> Shouldn't that be exception_exit actually?
>

OH! NO WAY I did that mistake! That was some last minute in-text-editor
changes and somehow I screwed this up. Will re-send in a second.

Sorry, and thank you.
 
	-ss

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

* Re: [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available() (v2)
  2012-08-28 22:11 ` Borislav Petkov
  2012-08-29  4:42   ` Sergey Senozhatsky
@ 2012-08-29  4:47   ` Sergey Senozhatsky
  1 sibling, 0 replies; 5+ messages in thread
From: Sergey Senozhatsky @ 2012-08-29  4:47 UTC (permalink / raw)
  To: Borislav Petkov, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, Steven Rostedt, Srikar Dronamraju, Peter Zijlstra,
	Paul E. McKenney, linux-kernel

 x86: use new exception_enter()/exception_exit() API in do_device_not_available()
 
 RCU can be in extended quiescent state when do_device_not_available() called.

[  676.400274] RCU used illegally from idle CPU!
[  676.400274] rcu_scheduler_active = 1, debug_locks = 0
[  676.400278] RCU used illegally from extended quiescent state!
[  676.400282] 2 locks held by sed/9468:
[  676.400285]  #0:  (&rq->lock){-.-.-.}, at: [<ffffffff814c67cf>] __schedule+0x1c0/0x992
[  676.400304]  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8106a880>] cpuacct_charge+0x27/0x1e0
[  676.400321] 
[  676.400329] Call Trace:
[  676.400340]  [<ffffffff8108933a>] lockdep_rcu_suspicious+0x109/0x112
[  676.400347]  [<ffffffff8106a8f7>] cpuacct_charge+0x9e/0x1e0
[  676.400353]  [<ffffffff8106a880>] ? cpuacct_charge+0x27/0x1e0
[  676.400359]  [<ffffffff814c67cf>] ? __schedule+0x1c0/0x992
[  676.400366]  [<ffffffff8106d525>] update_curr+0x159/0x200
[  676.400375]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
[  676.400382]  [<ffffffff8106e0da>] put_prev_task_fair+0x2a/0xac
[  676.400388]  [<ffffffff814c69a7>] __schedule+0x398/0x992
[  676.400397]  [<ffffffff810b4f0a>] ? rcu_irq_exit+0x83/0x99
[  676.400404]  [<ffffffff814c8bf0>] ? retint_restore_args+0x13/0x13
[  676.400411]  [<ffffffff810889e9>] ? lock_is_held+0x2d/0xa5
[  676.400414]  [<ffffffff8100a04f>] ? init_fpu+0x4e/0x8f
[  676.400417]  [<ffffffff81065d0a>] __cond_resched+0x28/0x34
[  676.400420]  [<ffffffff814c701a>] _cond_resched+0x2e/0x35
[  676.400425]  [<ffffffff8111cad4>] kmem_cache_alloc+0x4c/0x1c5
[  676.400430]  [<ffffffff810021ff>] ? math_state_restore+0x1f/0xdc
[  676.400433]  [<ffffffff8100a04f>] init_fpu+0x4e/0x8f
[  676.400437]  [<ffffffff8100220e>] math_state_restore+0x2e/0xdc
[  676.400440]  [<ffffffff814c982e>] do_device_not_available+0xe/0x10
[  676.400445]  [<ffffffff814d161b>] device_not_available+0x1b/0x20


Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

---

 arch/x86/kernel/traps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ab82cbd..fa226ef 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -654,7 +654,9 @@ do_device_not_available(struct pt_regs *regs, long error_code)
 		return;
 	}
 #endif
+	exception_enter(regs);
 	math_state_restore(); /* interrupts still off */
+	exception_exit(regs);
 #ifdef CONFIG_X86_32
 	conditional_sti(regs);
 #endif


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

* Re: [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available()
  2012-08-29  4:42   ` Sergey Senozhatsky
@ 2012-08-29 15:51     ` Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2012-08-29 15:51 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Steven Rostedt, Srikar Dronamraju, Peter Zijlstra,
	Paul E. McKenney, linux-kernel

On Wed, Aug 29, 2012 at 07:42:55AM +0300, Sergey Senozhatsky wrote:
> OH! NO WAY I did that mistake! That was some last minute
> in-text-editor changes and somehow I screwed this up. Will re-send in
> a second.
>
> Sorry, and thank you.

I wouldn't worry - it can happen to anyone (and I'm talking from
experience here) :-).

-- 
Regards/Gruss,
Boris.

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

end of thread, other threads:[~2012-08-29 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-28 21:00 [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available() Sergey Senozhatsky
2012-08-28 22:11 ` Borislav Petkov
2012-08-29  4:42   ` Sergey Senozhatsky
2012-08-29 15:51     ` Borislav Petkov
2012-08-29  4:47   ` [RFC PATCH] x86: use new exception_enter()/exception_exit() API in do_device_not_available() (v2) Sergey Senozhatsky

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).