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]
Message-ID: <20200507202339.0abc360f@oasis.local.home>
Date:   Thu, 7 May 2020 20:23:39 -0400
From:   Steven Rostedt <rostedt@...dmis.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>,
        Joel Fernandes <joel@...lfernandes.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>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch V4 part 1 24/36] lockdep: Prepare for noinstr sections

On Tue, 05 May 2020 15:16:26 +0200
Thomas Gleixner <tglx@...utronix.de> wrote:
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -3639,9 +3639,6 @@ static void __trace_hardirqs_on_caller(u
>  {
>  	struct task_struct *curr = current;
>  
> -	/* we'll do an OFF -> ON transition: */
> -	curr->hardirqs_enabled = 1;
> -
>  	/*
>  	 * We are going to turn hardirqs on, so set the
>  	 * usage bit for all held locks:
> @@ -3653,16 +3650,13 @@ static void __trace_hardirqs_on_caller(u
>  	 * bit for all held locks. (disabled hardirqs prevented
>  	 * this bit from being set before)
>  	 */
> -	if (curr->softirqs_enabled)
> +	if (curr->softirqs_enabled) {
>  		if (!mark_held_locks(curr, LOCK_ENABLED_SOFTIRQ))
>  			return;

The above can be turned into:

	if (curr->softirqs_enabled)
		mark_held_locks(curr, LOCK_ENABLED_SOFTIRQ);

No need for the condition or the return.


> -
> -	curr->hardirq_enable_ip = ip;
> -	curr->hardirq_enable_event = ++curr->irq_events;
> -	debug_atomic_inc(hardirqs_on_events);
> +	}
>  }
>  
> -void lockdep_hardirqs_on(unsigned long ip)
> +void lockdep_hardirqs_on_prepare(unsigned long ip)
>  {
>  	if (unlikely(!debug_locks || current->lockdep_recursion))
>  		return;
> @@ -3698,20 +3692,62 @@ void lockdep_hardirqs_on(unsigned long i
>  	if (DEBUG_LOCKS_WARN_ON(current->hardirq_context))
>  		return;
>  
> +	current->hardirq_chain_key = current->curr_chain_key;
> +
>  	current->lockdep_recursion++;
>  	__trace_hardirqs_on_caller(ip);
>  	lockdep_recursion_finish();
>  }
> -NOKPROBE_SYMBOL(lockdep_hardirqs_on);
> +EXPORT_SYMBOL_GPL(lockdep_hardirqs_on_prepare);
> +
> +void noinstr lockdep_hardirqs_on(unsigned long ip)
> +{

Would be nice to have some kerneldoc explaining the difference between
lockdep_hardirqs_on_prepare() and lockdep_hardirqs_on().

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ