Tiezhu Yang 43e26c3b77 LoongArch: Disable instrumentation for setup_ptwalker()
According to Documentation/dev-tools/kasan.rst, software KASAN modes use
compiler instrumentation to insert validity checks. Such instrumentation
might be incompatible with some parts of the kernel, and therefore needs
to be disabled, just use the attribute __no_sanitize_address to disable
instrumentation for the low level function setup_ptwalker().

Otherwise bringing up the secondary CPUs failed when CONFIG_KASAN is set
(especially when PTW is enabled), here are the call chains:

    smpboot_entry()
      start_secondary()
        cpu_probe()
          per_cpu_trap_init()
            tlb_init()
              setup_tlb_handler()
                setup_ptwalker()

The reason is the PGD registers are configured in setup_ptwalker(), but
KASAN instrumentation may cause TLB exceptions before that.

Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
2026-08-24 14:17:22 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2026-02-04 16:41:27 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 16:03:32 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 16:03:32 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00
2025-02-13 14:11:16 +08:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
S
Description
No description provided
Readme
260 MiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%