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: <365632030.20393.1589413599743.JavaMail.zimbra@efficios.com>
Date:   Wed, 13 May 2020 19:46:39 -0400 (EDT)
From:   Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>,
        paulmck <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>, rostedt <rostedt@...dmis.org>,
        "Joel Fernandes, Google" <joel@...lfernandes.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Brian Gerst <brgerst@...il.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Will Deacon <will@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch V4 part 1 30/36] lockdep: Always inline
 lockdep_{off,on}()

----- On May 5, 2020, at 9:16 AM, Thomas Gleixner tglx@...utronix.de wrote:
[...]
> + * Split the recrursion counter in two to readily detect 'off' vs recursion.

recrursion -> recursion

> + */
> +#define LOCKDEP_RECURSION_BITS	16
> +#define LOCKDEP_OFF		(1U << LOCKDEP_RECURSION_BITS)
> +#define LOCKDEP_RECURSION_MASK	(LOCKDEP_OFF - 1)
> +
> +/*
> + * lockdep_{off,on}() are macros to avoid tracing and kprobes; not inlines due
> + * to header dependencies.
> + */
> +
> +#define lockdep_off()					\
> +do {							\
> +	current->lockdep_recursion += LOCKDEP_OFF;	\
> +} while (0)
> +
> +#define lockdep_on()					\
> +do {							\
> +	current->lockdep_recursion -= LOCKDEP_OFF;	\
> +} while (0)

Now that those on/off are macros rather than functions, I wonder if
adding compiler barriers would be relevant ?

Thanks,

Mathieu

> 
> extern void lockdep_register_key(struct lock_class_key *key);
> extern void lockdep_unregister_key(struct lock_class_key *key);
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -393,25 +393,6 @@ void lockdep_init_task(struct task_struc
> 	task->lockdep_recursion = 0;
> }
> 
> -/*
> - * Split the recrursion counter in two to readily detect 'off' vs recursion.
> - */
> -#define LOCKDEP_RECURSION_BITS	16
> -#define LOCKDEP_OFF		(1U << LOCKDEP_RECURSION_BITS)
> -#define LOCKDEP_RECURSION_MASK	(LOCKDEP_OFF - 1)
> -
> -void lockdep_off(void)
> -{
> -	current->lockdep_recursion += LOCKDEP_OFF;
> -}
> -EXPORT_SYMBOL(lockdep_off);
> -
> -void lockdep_on(void)
> -{
> -	current->lockdep_recursion -= LOCKDEP_OFF;
> -}
> -EXPORT_SYMBOL(lockdep_on);
> -
> static inline void lockdep_recursion_finish(void)
> {
>  	if (WARN_ON_ONCE(--current->lockdep_recursion))

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ