mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Marco Elver <elver@google.com>
Cc: dvyukov@google.com, glider@google.com, andreyknvl@google.com,
	cai@lca.pw, kasan-dev@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h
Date: Tue, 31 Mar 2020 15:55:55 -0700	[thread overview]
Message-ID: <20200331225554.GA28283@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20200331193233.15180-1-elver@google.com>

On Tue, Mar 31, 2020 at 09:32:32PM +0200, Marco Elver wrote:
> Both affect access checks, and should therefore be in kcsan-checks.h.
> This is in preparation to use these in compiler.h.
> 
> Signed-off-by: Marco Elver <elver@google.com>

The two of these do indeed make data_race() act more like one would
expect, thank you!  I have queued them for further testing and review.

							Thanx, Paul

> ---
>  include/linux/kcsan-checks.h | 16 ++++++++++++++++
>  include/linux/kcsan.h        | 16 ----------------
>  2 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/include/linux/kcsan-checks.h b/include/linux/kcsan-checks.h
> index 101df7f46d89..ef95ddc49182 100644
> --- a/include/linux/kcsan-checks.h
> +++ b/include/linux/kcsan-checks.h
> @@ -36,6 +36,20 @@
>   */
>  void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
>  
> +/**
> + * kcsan_disable_current - disable KCSAN for the current context
> + *
> + * Supports nesting.
> + */
> +void kcsan_disable_current(void);
> +
> +/**
> + * kcsan_enable_current - re-enable KCSAN for the current context
> + *
> + * Supports nesting.
> + */
> +void kcsan_enable_current(void);
> +
>  /**
>   * kcsan_nestable_atomic_begin - begin nestable atomic region
>   *
> @@ -133,6 +147,8 @@ void kcsan_end_scoped_access(struct kcsan_scoped_access *sa);
>  static inline void __kcsan_check_access(const volatile void *ptr, size_t size,
>  					int type) { }
>  
> +static inline void kcsan_disable_current(void)		{ }
> +static inline void kcsan_enable_current(void)		{ }
>  static inline void kcsan_nestable_atomic_begin(void)	{ }
>  static inline void kcsan_nestable_atomic_end(void)	{ }
>  static inline void kcsan_flat_atomic_begin(void)	{ }
> diff --git a/include/linux/kcsan.h b/include/linux/kcsan.h
> index 17ae59e4b685..53340d8789f9 100644
> --- a/include/linux/kcsan.h
> +++ b/include/linux/kcsan.h
> @@ -50,25 +50,9 @@ struct kcsan_ctx {
>   */
>  void kcsan_init(void);
>  
> -/**
> - * kcsan_disable_current - disable KCSAN for the current context
> - *
> - * Supports nesting.
> - */
> -void kcsan_disable_current(void);
> -
> -/**
> - * kcsan_enable_current - re-enable KCSAN for the current context
> - *
> - * Supports nesting.
> - */
> -void kcsan_enable_current(void);
> -
>  #else /* CONFIG_KCSAN */
>  
>  static inline void kcsan_init(void)			{ }
> -static inline void kcsan_disable_current(void)		{ }
> -static inline void kcsan_enable_current(void)		{ }
>  
>  #endif /* CONFIG_KCSAN */
>  
> -- 
> 2.26.0.rc2.310.g2932bb562d-goog
> 

  parent reply	other threads:[~2020-03-31 22:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 19:32 Marco Elver
2020-03-31 19:32 ` [PATCH 2/2] kcsan: Change data_race() to no longer require marking racing accesses Marco Elver
2020-04-01  8:38   ` Will Deacon
2020-03-31 22:55 ` Paul E. McKenney [this message]
2020-04-01  8:40 ` [PATCH 1/2] kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h Will Deacon
2020-04-01 16:37   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200331225554.GA28283@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=andreyknvl@google.com \
    --cc=cai@lca.pw \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®