lkml.org 
[lkml]   [2021]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH -rcu/kcsan 06/23] kcsan, kbuild: Add option for barrier instrumentation only
    From
    Source files that disable KCSAN via KCSAN_SANITIZE := n, remove all
    instrumentation, including explicit barrier instrumentation. With
    instrumentation for memory barriers, in few places it is required to
    enable just the explicit instrumentation for memory barriers to avoid
    false positives.

    Providing the Makefile variable KCSAN_INSTRUMENT_BARRIERS_obj.o or
    KCSAN_INSTRUMENT_BARRIERS (for all files) set to 'y' only enables the
    explicit barrier instrumentation.

    Signed-off-by: Marco Elver <elver@google.com>
    ---
    scripts/Makefile.lib | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
    index 54582673fc1a..2118f63b2bc5 100644
    --- a/scripts/Makefile.lib
    +++ b/scripts/Makefile.lib
    @@ -182,6 +182,11 @@ ifeq ($(CONFIG_KCSAN),y)
    _c_flags += $(if $(patsubst n%,, \
    $(KCSAN_SANITIZE_$(basetarget).o)$(KCSAN_SANITIZE)y), \
    $(CFLAGS_KCSAN))
    +# Some uninstrumented files provide implied barriers required to avoid false
    +# positives: set KCSAN_INSTRUMENT_BARRIERS for barrier instrumentation only.
    +_c_flags += $(if $(patsubst n%,, \
    + $(KCSAN_INSTRUMENT_BARRIERS_$(basetarget).o)$(KCSAN_INSTRUMENT_BARRIERS)n), \
    + -D__KCSAN_INSTRUMENT_BARRIERS__)
    endif

    # $(srctree)/$(src) for including checkin headers from generated source files
    --
    2.33.0.800.g4c38ced690-goog
    \
     
     \ /
      Last update: 2021-10-05 13:00    [W:2.730 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site