Kconfig

CONFIG_LOONGARCH

Unknown
Default
  • y

Kernel type and options

Kernel type

Default
  • # Keep existing behavior

CONFIG_32BIT 32-bit kernel

Unknown

Select this option if you want to build a 32-bit kernel.

CONFIG_64BIT 64-bit kernel

On

Select this option if you want to build a 64-bit kernel.

End of Kernel type

If

32-bit kernel sub-type

CONFIG_32BIT_REDUCED 32-bit kernel for LA32R

Unknown

Select this option if you want to build a 32-bit kernel for LoongArch32 Reduced (LA32R).

CONFIG_32BIT_STANDARD 32-bit kernel for LA32S

Unknown

Select this option if you want to build a 32-bit kernel for LoongArch32 Standard (LA32S).

End of 32-bit kernel sub-type

CONFIG_GENERIC_BUG

On
Default
  • y

CONFIG_GENERIC_BUG_RELATIVE_POINTERS

On
  • Depends on
Default
  • y

CONFIG_GENERIC_CALIBRATE_DELAY

On
Default
  • y

CONFIG_GENERIC_CSUM

On
Default
  • y

CONFIG_GENERIC_HWEIGHT

Unknown
Default
  • y

CONFIG_L1_CACHE_SHIFT

Unknown
Default
  • "6"

CONFIG_LOCKDEP_SUPPORT

On
Default
  • y

CONFIG_STACKTRACE_SUPPORT

On
Default
  • y

CONFIG_MACH_LOONGSON32

Unknown
Default

CONFIG_MACH_LOONGSON64

Unknown
Default

CONFIG_PGTABLE_2LEVEL

Unknown

CONFIG_PGTABLE_3LEVEL

Unknown

CONFIG_PGTABLE_4LEVEL

Unknown

CONFIG_SCHED_OMIT_FRAME_POINTER

On
Default
  • y

CONFIG_AS_HAS_EXPLICIT_RELOCS

Unknown
Default
  • $(as-instr,x:pcalau12i \$t0$(comma)%pc_hi20(x))

CONFIG_AS_HAS_FCSR_CLASS

Unknown
Default
  • $(as-instr,movfcsr2gr \$t0$(comma)\$fcsr0)

CONFIG_AS_HAS_THIN_ADD_SUB

Unknown
Default
  • $(cc-option,-Wa$(comma)-mthin-add-sub) || AS_IS_LLVM

CONFIG_AS_HAS_LSX_EXTENSION

Unknown
Default
  • $(as-instr,vld \$vr0$(comma)\$a0$(comma)0)

CONFIG_AS_HAS_LASX_EXTENSION

Unknown
Default
  • $(as-instr,xvld \$xr0$(comma)\$a0$(comma)0)

CONFIG_AS_HAS_LBT_EXTENSION

Unknown
Default
  • $(as-instr,movscr2gr \$a0$(comma)\$scr0)

CONFIG_AS_HAS_LVZ_EXTENSION

Unknown
Default
  • $(as-instr,hvcl 0)

CONFIG_AS_HAS_SCQ_EXTENSION

Unknown
Default
  • $(as-instr,sc.q \$t0$(comma)\$t1$(comma)\$t2)

CONFIG_CC_HAS_ANNOTATE_TABLEJUMP

Unknown
Default
  • $(cc-option,-mannotate-tablejump)

CONFIG_RUSTC_HAS_ANNOTATE_TABLEJUMP

Unknown
Default
  • $(rustc-option,-Cllvm-args=--loongarch-annotate-tablejump)
Includekernel/Kconfig.hz Open file

CONFIG_HIGHMEM High Memory Support

Unknown

Page Table Layout

Allows choosing the page table layout, which is a combination of page size and page table levels. The size of virtual memory address space are determined by the page table layout.

CONFIG_4KB_2LEVEL 4KB with 2 levels

Unknown

This option selects 4KB page size with 2 level page tables, which support a maximum of 32 bits of application virtual memory.

CONFIG_4KB_3LEVEL 4KB with 3 levels

Unknown

This option selects 4KB page size with 3 level page tables, which support a maximum of 39 bits of application virtual memory.

CONFIG_4KB_4LEVEL 4KB with 4 levels

Unknown

This option selects 4KB page size with 4 level page tables, which support a maximum of 48 bits of application virtual memory.

CONFIG_16KB_2LEVEL 16KB with 2 levels

Unknown

This option selects 16KB page size with 2 level page tables, which support a maximum of 36 bits of application virtual memory.

CONFIG_16KB_3LEVEL 16KB with 3 levels

Unknown

This option selects 16KB page size with 3 level page tables, which support a maximum of 47 bits of application virtual memory.

CONFIG_64KB_2LEVEL 64KB with 2 levels

Unknown

This option selects 64KB page size with 2 level page tables, which support a maximum of 42 bits of application virtual memory.

CONFIG_64KB_3LEVEL 64KB with 3 levels

Unknown

This option selects 64KB page size with 3 level page tables, which support a maximum of 55 bits of application virtual memory.

End of Page Table Layout

CONFIG_CMDLINE Built-in kernel command line

Empty

For most platforms, the arguments for the kernel's command line are provided at run-time, during boot. However, there are cases where either no arguments are being provided or the provided arguments are insufficient or even invalid.

When that occurs, it is possible to define a built-in command line here and choose how the kernel should use it later on.

Kernel command line type

Choose how the kernel will handle the provided built-in command line.

CONFIG_CMDLINE_BOOTLOADER Use bootloader kernel arguments if available

Unknown

Prefer the command-line passed by the boot loader if available. Use the built-in command line as fallback in case we get nothing during boot. This is the default behaviour.

CONFIG_CMDLINE_EXTEND Use built-in to extend bootloader kernel arguments

Unknown

The built-in command line will be appended to the command- line arguments provided during boot. This is useful in cases where the provided arguments are insufficient and you don't want to or cannot modify them.

CONFIG_CMDLINE_FORCE Always use the built-in kernel command string

Unknown

Always use the built-in command line, even if we get one during boot. This is useful in case you need to override the provided command line on systems where you don't have or want control over it.

End of Kernel command line type

CONFIG_BUILTIN_DTB Enable built-in dtb in kernel

Unknown

Some existing systems do not provide a canonical device tree to the kernel at boot time. Let's provide a device tree table in the kernel, keyed by the dts filename, containing the relevant DTBs.

Built-in DTBs are generic enough and can be used as references.

CONFIG_BUILTIN_DTB_NAME Source file for built-in dtb

Unknown

Base name (without suffix, relative to arch/loongarch/boot/dts/) for the DTS file that will be used to produce the DTB linked into the kernel.

  • Depends on

CONFIG_DMI Enable DMI scanning

On

This enables SMBIOS/DMI feature for systems, and scanning of DMI to identify machine quirks.

Default
  • y

CONFIG_EFI EFI runtime service support

On

This enables the kernel to use EFI runtime services that are available (such as the EFI variable services).

CONFIG_EFI_STUB EFI boot stub support

On

This kernel feature allows the kernel to be loaded directly by EFI firmware without the use of a bootloader.

Default
  • y

CONFIG_SMP Multi-Processing support

On

This enables support for systems with more than one CPU. If you have a system with only one CPU, say N. If you have a system with more than one CPU, say Y.

If you say N here, the kernel will run on uni- and multiprocessor machines, but will use only one CPU of a multiprocessor machine. If you say Y here, the kernel will run on many, but not all, uniprocessor machines. On a uniprocessor machine, the kernel will run faster if you say N here.

See also the SMP-HOWTO available at <http://www.tldp.org/docs.html#howto>.

If you don't know what to do here, say N.

  • Depends on

CONFIG_HOTPLUG_CPU Support for hot-pluggable CPUs

On
Say Y here to allow turning CPUs off and on. CPUs can be
controlled through /sys/devices/system/cpu.
(Note: power management support will enable this option
  automatically on SMP systems. )
Say N if you want to disable CPU hotplug.

CONFIG_NR_CPUS Maximum number of CPUs (2-2048)

This allows you to specify the maximum number of CPUs which this kernel will support.

  • Range2 2048
  • Depends on
Default
  • "2048"

CONFIG_NUMA NUMA Support

On

Say Y to compile the kernel with NUMA (Non-Uniform Memory Access) support. This option improves performance on systems with more than one NUMA node; on single node systems it is generally better to leave it disabled.

  • Selects
  • Depends on

CONFIG_NODES_SHIFT

  • Depends on
Default
  • "6"

CONFIG_ARCH_FORCE_MAX_ORDER Maximum zone order

Unknown

The kernel memory allocator divides physically contiguous memory blocks into "zones", where each zone is a power of two number of pages. This option selects the largest power of two that the kernel keeps in the memory allocator. If you need to allocate very large blocks of physically contiguous memory, then you may need to increase this value.

The page size is not necessarily 4KB. Keep this in mind when choosing a value for this option.

CONFIG_ARCH_IOREMAP Enable LoongArch DMW-based ioremap()

Unknown

We use generic TLB-based ioremap() by default since it has page protection support. However, you can enable LoongArch DMW-based ioremap() for better performance.

CONFIG_ARCH_WRITECOMBINE Enable WriteCombine (WUC) for ioremap()

Unknown

LoongArch maintains cache coherency in hardware, but when paired with LS7A chipsets the WUC attribute (Weak-ordered UnCached, which is similar to WriteCombine) is out of the scope of cache coherency machanism for PCIe devices (this is a PCIe protocol violation, which may be fixed in newer chipsets).

This means WUC can only used for write-only memory regions now, so this option is disabled by default, making WUC silently fallback to SUC for ioremap(). You can enable this option if the kernel is ensured to run on hardware without this bug.

You can override this setting via writecombine=on/off boot parameter.

CONFIG_ARCH_STRICT_ALIGN Enable -mstrict-align to prevent unaligned accesses

Unknown

Not all LoongArch cores support h/w unaligned access, we can use -mstrict-align build parameter to prevent unaligned accesses.

CPUs with h/w unaligned access support: Loongson-2K2000/2K3000 and all of Loongson-3 series processors based on LoongArch.

CPUs without h/w unaligned access support: Loongson-2K0300/2K0500/2K1000.

If you want to make sure whether to support unaligned memory access on your hardware, please read the bit 20 (UAL) of CPUCFG1 register.

This option is enabled by default to make the kernel be able to run on all LoongArch systems. But you can disable it manually if you want to run kernel only on systems with h/w unaligned access support in order to optimise for performance.

Default
  • y

CONFIG_CPU_HAS_AMO

Unknown
Default

CONFIG_CPU_HAS_FPU

Unknown
Default
  • y

CONFIG_CPU_HAS_LSX Support for the Loongson SIMD Extension

Unknown

Loongson SIMD Extension (LSX) introduces 128 bit wide vector registers and a set of SIMD instructions to operate on them. When this option is enabled the kernel will support allocating & switching LSX vector register contexts. If you know that your kernel will only be running on CPUs which do not support LSX or that your userland will not be making use of it then you may wish to say N here to reduce the size & complexity of your kernel.

If unsure, say Y.

CONFIG_CPU_HAS_LASX Support for the Loongson Advanced SIMD Extension

Unknown

Loongson Advanced SIMD Extension (LASX) introduces 256 bit wide vector registers and a set of SIMD instructions to operate on them. When this option is enabled the kernel will support allocating & switching LASX vector register contexts. If you know that your kernel will only be running on CPUs which do not support LASX or that your userland will not be making use of it then you may wish to say N here to reduce the size & complexity of your kernel.

If unsure, say Y.

CONFIG_CPU_HAS_LBT Support for the Loongson Binary Translation Extension

Unknown

Loongson Binary Translation (LBT) introduces 4 scratch registers (SCR0 to SCR3), x86/ARM eflags (eflags) and x87 fpu stack pointer (ftop). Enabling this option allows the kernel to allocate and switch registers specific to LBT.

If you want to use this feature, such as the Loongson Architecture Translator (LAT), say Y.

CONFIG_CPU_HAS_PREFETCH

Unknown
Default
  • y

CONFIG_ARCH_SUPPORTS_KEXEC

On
Default
  • y

CONFIG_ARCH_SUPPORTS_KEXEC_FILE

On
Default

CONFIG_ARCH_SUPPORTS_CRASH_DUMP

On
Default

CONFIG_ARCH_DEFAULT_CRASH_DUMP

On
Default

CONFIG_ARCH_SELECTS_CRASH_DUMP

Unknown
Default

CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION

On

CONFIG_RELOCATABLE Relocatable kernel

On

This builds the kernel as a Position Independent Executable (PIE), which retains all relocation metadata required, so as to relocate the kernel binary at runtime to a different virtual address from its link address.

CONFIG_RANDOMIZE_BASE Randomize the address of the kernel (KASLR)

On

Randomizes the physical and virtual address at which the kernel image is loaded, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals.

The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET.

If unsure, say N.

  • Depends on

CONFIG_RANDOMIZE_BASE_MAX_OFFSET Maximum KASLR offset

Unknown

When KASLR is active, this provides the maximum offset that will be applied to the kernel image. It should be set according to the amount of physical RAM available in the target system.

This is limited by the size of the lower address memory, 256MB.

  • Visible ifEXPERT
  • Depends on
  • Range0x0 0x10000000
Default
  • "0x01000000"
Includekernel/livepatch/Kconfig Open file

CONFIG_PARAVIRT Enable paravirtualization code

On

This changes the kernel so it can modify itself when it is run under a hypervisor, potentially improving performance significantly over full virtualization. However, when run without a hypervisor the kernel is theoretically slower and slightly larger.

CONFIG_PARAVIRT_TIME_ACCOUNTING Paravirtual steal time accounting

On

Select this option to enable fine granularity task steal time accounting. Time spent executing other tasks in parallel with the current vCPU is discounted from the vCPU power. To account for that, there can be a small performance impact.

If in doubt, say N here.

  • Depends on
End of Kernel type and options

CONFIG_ARCH_SELECT_MEMORY_MODEL

Unknown
Default
  • y

CONFIG_ARCH_FLATMEM_ENABLE

Unknown
  • Depends on!
Default
  • y

CONFIG_ARCH_SPARSEMEM_ENABLE

On

Say Y to support efficient handling of sparse physical memory, for architectures which are either NUMA (Non-Uniform Memory Access) or have huge holes in the physical address space for other reasons. See <file:Documentation/mm/numa.rst> for more.

Default

CONFIG_MMU

On
Default
  • y

CONFIG_ARCH_MMAP_RND_BITS_MIN

28
Defaults
  • 10 if
  • 12 if

CONFIG_ARCH_MMAP_RND_BITS_MAX

32
Defaults
  • 15 if
  • 20 if

CONFIG_ARCH_SUPPORTS_UPROBES

On
Default
  • y

CONFIG_KASAN_SHADOW_OFFSET

Default
  • 0x0

Power management options

CONFIG_ARCH_SUSPEND_POSSIBLE

On
Default
  • y

CONFIG_ARCH_HIBERNATION_POSSIBLE

On
Default
  • y
Includekernel/power/Kconfig Open file
Includedrivers/acpi/Kconfig Open file
Includedrivers/cpufreq/Kconfig Open file
End of Power management options
Includearch/loongarch/kvm/Kconfig Open file