]> Git Repo - linux.git/commitdiff
Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck...
authorIngo Molnar <[email protected]>
Tue, 19 Nov 2019 18:54:39 +0000 (19:54 +0100)
committerIngo Molnar <[email protected]>
Tue, 19 Nov 2019 18:56:28 +0000 (19:56 +0100)
Pull the KCSAN subsystem from Paul E. McKenney:

   "This pull request contains base kernel concurrency sanitizer
    (KCSAN) enablement for x86, courtesy of Marco Elver.  KCSAN is a
    sampling watchpoint-based data-race detector, and is documented in
    Documentation/dev-tools/kcsan.rst.  KCSAN was announced in September,
    and much feedback has since been incorporated:

      http://lkml.kernel.org/r/CANpmjNPJ_bHjfLZCAPV23AXFfiPiyXXqqu72n6TgWzb2Gnu1eA@mail.gmail.com

    The data races located thus far have resulted in a number of fixes:

      https://github.com/google/ktsan/wiki/KCSAN#upstream-fixes-of-data-races-found-by-kcsan

    Additional information may be found here:

      https://lore.kernel.org/lkml/20191114180303[email protected]/
   "

Signed-off-by: Ingo Molnar <[email protected]>
1  2 
MAINTAINERS
Makefile
arch/x86/Kconfig
arch/x86/kernel/cpu/Makefile

diff --combined MAINTAINERS
index e4f170d8bc2994726298c7c71200d800ba8d86e0,1879aace2657572b0cae47c78aa6de06a96e841b..d0a544d84837d392830c12031eead366b3655caf
@@@ -3261,6 -3261,7 +3261,6 @@@ S:      Maintaine
  F:    drivers/cpufreq/bmips-cpufreq.c
  
  BROADCOM BMIPS MIPS ARCHITECTURE
 -M:    Kevin Cernekee <[email protected]>
  M:    Florian Fainelli <[email protected]>
  L:    [email protected]
  L:    [email protected]
@@@ -8298,14 -8299,11 +8298,14 @@@ F:   drivers/hid/intel-ish-hid
  
  INTEL IOMMU (VT-d)
  M:    David Woodhouse <[email protected]>
 +M:    Lu Baolu <[email protected]>
  L:    [email protected]
 -T:    git git://git.infradead.org/iommu-2.6.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
  S:    Supported
 -F:    drivers/iommu/intel-iommu.c
 +F:    drivers/iommu/dmar.c
 +F:    drivers/iommu/intel*.[ch]
  F:    include/linux/intel-iommu.h
 +F:    include/linux/intel-svm.h
  
  INTEL IOP-ADMA DMA DRIVER
  R:    Dan Williams <[email protected]>
@@@ -8850,6 -8848,17 +8850,17 @@@ F:    Documentation/kbuild/kconfig
  F:    scripts/kconfig/
  F:    scripts/Kconfig.include
  
+ KCSAN
+ M:    Marco Elver <[email protected]>
+ R:    Dmitry Vyukov <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    Documentation/dev-tools/kcsan.rst
+ F:    include/linux/kcsan*.h
+ F:    kernel/kcsan/
+ F:    lib/Kconfig.kcsan
+ F:    scripts/Makefile.kcsan
  KDUMP
  M:    Dave Young <[email protected]>
  M:    Baoquan He <[email protected]>
@@@ -17340,6 -17349,12 +17351,6 @@@ F:  include/linux/vbox_utils.
  F:    include/uapi/linux/vbox*.h
  F:    drivers/virt/vboxguest/
  
 -VIRTUAL BOX SHARED FOLDER VFS DRIVER:
 -M:    Hans de Goede <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    drivers/staging/vboxsf/*
 -
  VIRTUAL SERIO DEVICE DRIVER
  M:    Stephen Chandler Paul <[email protected]>
  S:    Maintained
diff --combined Makefile
index 9cd289196267131a6261188a11a3614fec2c4206,6fe2889d2309222e448c96727d5219e3ac601967..566b83a51864d868c6700fe53168d8a03f579828
+++ b/Makefile
@@@ -2,7 -2,7 +2,7 @@@
  VERSION = 5
  PATCHLEVEL = 4
  SUBLEVEL = 0
 -EXTRAVERSION = -rc7
 +EXTRAVERSION = -rc8
  NAME = Kleptomaniac Octopus
  
  # *DOCUMENTATION*
@@@ -478,7 -478,7 +478,7 @@@ export KBUILD_HOSTCXXFLAGS KBUILD_HOSTL
  
  export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
  export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
- export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
+ export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN CFLAGS_KCSAN
  export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
  export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
  export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
@@@ -900,6 -900,7 +900,7 @@@ endi
  include scripts/Makefile.kasan
  include scripts/Makefile.extrawarn
  include scripts/Makefile.ubsan
+ include scripts/Makefile.kcsan
  
  # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
  KBUILD_CPPFLAGS += $(KCPPFLAGS)
@@@ -917,9 -918,6 +918,9 @@@ ifeq ($(CONFIG_RELR),y
  LDFLAGS_vmlinux       += --pack-dyn-relocs=relr
  endif
  
 +# make the checker run with the right architecture
 +CHECKFLAGS += --arch=$(ARCH)
 +
  # insure the checker run with the right endianness
  CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian)
  
diff --combined arch/x86/Kconfig
index 8ef85139553f5a4ad5187375af898266355c4177,81859be4a005e101e0e8b4a20f749a3b2aa55c87..9933ca8ffe1608e8c2969acc7532a7ca49aba24d
@@@ -226,6 -226,7 +226,7 @@@ config X8
        select VIRT_TO_BUS
        select X86_FEATURE_NAMES                if PROC_FS
        select PROC_PID_ARCH_STATUS             if PROC_FS
+       select HAVE_ARCH_KCSAN if X86_64
  
  config INSTRUCTION_DECODER
        def_bool y
@@@ -1940,51 -1941,6 +1941,51 @@@ config X86_INTEL_MEMORY_PROTECTION_KEY
  
          If unsure, say y.
  
 +choice
 +      prompt "TSX enable mode"
 +      depends on CPU_SUP_INTEL
 +      default X86_INTEL_TSX_MODE_OFF
 +      help
 +        Intel's TSX (Transactional Synchronization Extensions) feature
 +        allows to optimize locking protocols through lock elision which
 +        can lead to a noticeable performance boost.
 +
 +        On the other hand it has been shown that TSX can be exploited
 +        to form side channel attacks (e.g. TAA) and chances are there
 +        will be more of those attacks discovered in the future.
 +
 +        Therefore TSX is not enabled by default (aka tsx=off). An admin
 +        might override this decision by tsx=on the command line parameter.
 +        Even with TSX enabled, the kernel will attempt to enable the best
 +        possible TAA mitigation setting depending on the microcode available
 +        for the particular machine.
 +
 +        This option allows to set the default tsx mode between tsx=on, =off
 +        and =auto. See Documentation/admin-guide/kernel-parameters.txt for more
 +        details.
 +
 +        Say off if not sure, auto if TSX is in use but it should be used on safe
 +        platforms or on if TSX is in use and the security aspect of tsx is not
 +        relevant.
 +
 +config X86_INTEL_TSX_MODE_OFF
 +      bool "off"
 +      help
 +        TSX is disabled if possible - equals to tsx=off command line parameter.
 +
 +config X86_INTEL_TSX_MODE_ON
 +      bool "on"
 +      help
 +        TSX is always enabled on TSX capable HW - equals the tsx=on command
 +        line parameter.
 +
 +config X86_INTEL_TSX_MODE_AUTO
 +      bool "auto"
 +      help
 +        TSX is enabled on TSX capable HW that is believed to be safe against
 +        side channel attacks- equals the tsx=auto command line parameter.
 +endchoice
 +
  config EFI
        bool "EFI runtime service support"
        depends on ACPI
index 890f60083eca7f1486524ffbe0c619531c0f9ad6,1f1b0edc018731fd804fbdaf4d304e1c26dbf2ea..a704fb9ee98e95b8a77cd6ee66a183179c2cc0ee
@@@ -13,6 -13,9 +13,9 @@@ endi
  KCOV_INSTRUMENT_common.o := n
  KCOV_INSTRUMENT_perf_event.o := n
  
+ # As above, instrumenting secondary CPU boot code causes boot hangs.
+ KCSAN_SANITIZE_common.o := n
  # Make sure load_percpu_segment has no stackprotector
  nostackp := $(call cc-option, -fno-stack-protector)
  CFLAGS_common.o               := $(nostackp)
@@@ -30,7 -33,7 +33,7 @@@ obj-$(CONFIG_PROC_FS) += proc.
  obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o
  
  ifdef CONFIG_CPU_SUP_INTEL
 -obj-y                 += intel.o intel_pconfig.o
 +obj-y                 += intel.o intel_pconfig.o tsx.o
  obj-$(CONFIG_PM)      += intel_epb.o
  endif
  obj-$(CONFIG_CPU_SUP_AMD)             += amd.o
This page took 0.144419 seconds and 4 git commands to generate.