MAJOR=4
MINOR=62
DEVNAME=tty62
  #   #ˆl–Ü4ý( ©³( 	Å€fàB¦-ÿÊ„ÓßÃÇ '¤    ## SPDX-License-Identifier: GPL-2.0-only

config HAVE_ARCH_KCSAN
	bool

config HAVE_KCSAN_COMPILER
	def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=thread -mllvm -tsan-distinguish-volatile=1)) || \
		 (CC_IS_GCC && $(cc-option,-fsanitize=thread --param tsan-distinguish-volatile=1))
	help
	  For the list of compilers that support KCSAN, please see
	  <file:Documentation/dev-tools/kcsan.rst>.

menuconfig KCSAN
	bool "KCSAN: dynamic data race detector"
	depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER
	depends on DEBUG_KERNEL && !KASAN
	select STACKTRACE
	help
	  The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
	  data-race detector that relies on compile-time instrumentation.
	  KCSAN uses a watchpoint-based sampling approach to detect races.

	  While KCSAN's primary purpose is to detect data races, it
	  also provides assertions to check data access constraints.
	  These assertions can expose bugs that do not manifest as
	  data races.

	  See <file:Documentation/dev-tools/kcsan.rst> for more details.

if KCSAN

config CC_HAS_TSAN_COMPOUND_READ_BEFORE_WRITE
	def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=thread -mllvm -tsan-compound-read-before-write=1)) || \
		 (CC_IS_GCC && $(cc-option,-fsanitize=thread --param tsan-compound-read-before-write=1))
	help
	  The compiler instruments plain compound read-write operations
	  differently (++, --, +=, -=, |=, &=, etc.), which allows KCSAN to
	  distinguish them from other plain accesses. This is currently
	  supported by Clang 12 or later.

config KCSAN_VERBOSE
	bool "Show verbose reports with more information about system state"
	depends on PROVE_LOCKING
	help
	  If enabled, reports show more information about the system state that
	  may help better analyze and debug races. This includes held locks and
	  IRQ trace events.

	  While this option should generally be benign, we call into more
	  external functions on report generation; if a race report is
	  generated from any one of them, system stability may suffer due to
	  deadlocks or recursion.  If in doubt, say N.

config KCSAN_SELFTEST
	bool "Perform short selftests on boot"
	default y
	help
	  Run KCSAN selftests on boot. On test failure, causes the kernel to
	  panic. Recommended to be enabled, ensuring critical functionality
	  works as intended.

config KCSAN_KUNIT_TEST
	tristate "KCSAN test for integrated runtime behaviour" if !KUNIT_ALL_TESTS
	default KUNIT_ALL_TESTS
	depends on TRACEPOINTS && KUNIT
	select TORTURE_TEST
	help
	  KCSAN test focusing on behaviour of the integrated runtime. Tests
	  various race scenarios, and verifies the reports generated to
	  console. Makes use of KUnit for test organization, and the Torture
	  framework for test thread control.

	  Each test case may run at least up to KCSAN_REPORT_ONCE_IN_MS
	  milliseconds. Test run duration may be optimized by building the
	  kernel and KCSAN test with KCSAN_REPORT_ONCE_IN_MS set to a lower
	  than default value.

	  Say Y here if you want the test to be built into the kernel and run
	  during boot; say M if you want the test to build as a module; say N
	  if you are unsure.

config KCSAN_EARLY_ENABLE
	bool "Early enable during boot"
	default y
	help
	  If KCSAN should be enabled globally as soon as possible. KCSAN can
	  later be enabled/disabled via debugfs.

config KCSAN_NUM_WATCHPOINTS
	int "Number of available watchpoints"
	default 64
	help
	  Total number of available watchpoints. An address range maps into a
	  specific watchpoint slot as specified in kernel/kcsan/encoding.h.
	  Although larger number of watchpoints may not be usable due to
	  limited number of CPUs, a larger value helps to improve performance
	  due to reducing cache-line contention. The chosen default is a
	  conservative value; we should almost never observe "no_capacity"
	  events (see /sys/kernel/debug/kcsan).

config KCSAN_UDELAY_TASK
	int "Delay in microseconds (for tasks)"
	default 80
	help
	  For tasks, the microsecond delay after setting up a watchpoint.

config KCSAN_UD