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:   Fri, 15 May 2020 15:00:41 -0400
From:   Joel Fernandes <joel@...lfernandes.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Alexandre Chartre <alexandre.chartre@...cle.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Petr Mladek <pmladek@...e.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Brian Gerst <brgerst@...il.com>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Will Deacon <will@...nel.org>
Subject: Re: [patch V4 part 3 11/29] rcu: Provide rcu_irq_exit_preempt()

On Thu, May 14, 2020 at 04:43:31PM +0200, Thomas Gleixner wrote:
[...] 
> > Or, if [1] is merged, then we could just combine the checks into one check.
> > 	RCU_LOCKDEP_WARN(__this_cpu_read(rcu_data.dynticks_nesting) != 1,
> > 			 "Bad RCU dynticks_nmi_nesting counter\n");
> >
> >> +	RCU_LOCKDEP_WARN(rcu_dynticks_curr_cpu_in_eqs(),
> >> +			 "RCU in extended quiescent state!");
> >
> > Makes sense.
> >
> > BTW, I wonder if a better place to do this "don't enter scheduler while RCU
> > is not watching" is rcu_note_context_switch()...
> 
> I actually want to catch even the case where we don't schedule, i.e.
> 
>   if (ret_to_kernel) {
>      if (interrupts_on_after_return((regs)) {
>         if (IS_ENABLED(CONFIG_PREEMPTION)) {
>   	   if (!preempt_count()) {
>               /* Preemption is possible ... */
>        	      rcu_irq_exit_preempt();
>                  if (need_resched())
>                     schedule_preempt_irq();
> 
> that catches any exit where preemption is possible and RCU is not
> watching after rcu_irq_exit().
> 
> It does not matter whether need-resched is set here or not. Any
> interrupt/exception could set it.

Yes, your way of doing it is better. Let us do it this way then.

Thanks!

 - Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ