1# SPDX-License-Identifier: GPL-2.0 2config LOONGARCH 3 bool 4 default y 5 select ACPI_MCFG if ACPI 6 select ACPI_PPTT if ACPI 7 select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI 8 select ARCH_BINFMT_ELF_STATE 9 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI 10 select ARCH_HAS_CPU_FINALIZE_INIT 11 select ARCH_HAS_FORTIFY_SOURCE 12 select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE 13 select ARCH_HAS_PTE_SPECIAL if !32BIT 14 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST 15 select ARCH_INLINE_READ_LOCK if !PREEMPTION 16 select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION 17 select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION 18 select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION 19 select ARCH_INLINE_READ_UNLOCK if !PREEMPTION 20 select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION 21 select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION 22 select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION 23 select ARCH_INLINE_WRITE_LOCK if !PREEMPTION 24 select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION 25 select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION 26 select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION 27 select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION 28 select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION 29 select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION 30 select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION 31 select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION 32 select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION 33 select ARCH_INLINE_SPIN_LOCK if !PREEMPTION 34 select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION 35 select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION 36 select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION 37 select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION 38 select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION 39 select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION 40 select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION 41 select ARCH_KEEP_MEMBLOCK 42 select ARCH_SUPPORTS_ACPI 43 select ARCH_SUPPORTS_NUMA_BALANCING 44 select ARCH_SUPPORTS_UPROBES 45 select ARCH_USE_BUILTIN_BSWAP 46 select ARCH_USE_CMPXCHG_LOCKREF if 64BIT 47 select ARCH_USE_QUEUED_RWLOCKS 48 select ARCH_USE_QUEUED_SPINLOCKS 49 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT 50 select ARCH_WANT_LD_ORPHAN_WARN 51 select BUILDTIME_TABLE_SORT 52 select COMMON_CLK 53 select CPU_PM 54 select GENERIC_ATOMIC64 if !64BIT 55 select GENERIC_CLOCKEVENTS 56 select GENERIC_CMOS_UPDATE 57 select GENERIC_CPU_AUTOPROBE 58 select GENERIC_ENTRY 59 select GENERIC_FIND_FIRST_BIT 60 select GENERIC_GETTIMEOFDAY 61 select GENERIC_IOREMAP if !ARCH_IOREMAP 62 select GENERIC_IRQ_MULTI_HANDLER 63 select GENERIC_IRQ_PROBE 64 select GENERIC_IRQ_SHOW 65 select GENERIC_LIB_ASHLDI3 66 select GENERIC_LIB_ASHRDI3 67 select GENERIC_LIB_CMPDI2 68 select GENERIC_LIB_LSHRDI3 69 select GENERIC_LIB_UCMPDI2 70 select GENERIC_LIB_DEVMEM_IS_ALLOWED 71 select GENERIC_PCI_IOMAP 72 select GENERIC_SCHED_CLOCK 73 select GENERIC_SMP_IDLE_THREAD 74 select GENERIC_STRNCPY_FROM_USER 75 select GENERIC_STRNLEN_USER 76 select GENERIC_TIME_VSYSCALL 77 select GENERIC_VDSO_TIME_NS 78 select HANDLE_DOMAIN_IRQ 79 select HAVE_ARCH_AUDITSYSCALL 80 select HAVE_ARCH_JUMP_LABEL 81 select HAVE_ARCH_JUMP_LABEL_RELATIVE 82 select HAVE_ARCH_KASAN if 64BIT 83 select HAVE_ARCH_KGDB 84 select HAVE_ARCH_MMAP_RND_BITS if MMU 85 select HAVE_ARCH_SECCOMP 86 select HAVE_ARCH_SECCOMP_FILTER 87 select HAVE_ARCH_TRACEHOOK 88 select HAVE_ARCH_TRANSPARENT_HUGEPAGE 89 select HAVE_ASM_MODVERSIONS 90 select HAVE_CONTEXT_TRACKING 91 select HAVE_COPY_THREAD_TLS 92 select HAVE_C_RECORDMCOUNT 93 select HAVE_DEBUG_KMEMLEAK 94 select HAVE_DEBUG_STACKOVERFLOW 95 select HAVE_DMA_CONTIGUOUS 96 select HAVE_DYNAMIC_FTRACE 97 select HAVE_DYNAMIC_FTRACE_WITH_REGS 98 select HAVE_EBPF_JIT if 64BIT 99 select HAVE_EFFICIENT_UNALIGNED_ACCESS if !ARCH_STRICT_ALIGN 100 select HAVE_EXIT_THREAD 101 select HAVE_FAST_GUP 102 select HAVE_FTRACE_MCOUNT_RECORD 103 select HAVE_FUNCTION_GRAPH_TRACER 104 select HAVE_FUNCTION_TRACER 105 select HAVE_FUTEX_CMPXCHG if FUTEX 106 select HAVE_GENERIC_VDSO 107 select HAVE_IOREMAP_PROT 108 select HAVE_IRQ_EXIT_ON_IRQ_STACK 109 select HAVE_IRQ_TIME_ACCOUNTING 110 select HAVE_KPROBES 111 select HAVE_KPROBES_ON_FTRACE 112 select HAVE_KRETPROBES 113 select HAVE_LIVEPATCH 114 select HAVE_MEMBLOCK 115 select HAVE_MEMBLOCK_NODE_MAP 116 select HAVE_MOD_ARCH_SPECIFIC 117 select HAVE_NMI 118 select HAVE_PERF_EVENTS 119 select HAVE_PERF_REGS 120 select HAVE_PERF_USER_STACK_DUMP 121 select HAVE_REGS_AND_STACK_ACCESS_API 122 select HAVE_RSEQ 123 select HAVE_STACKPROTECTOR 124 select HAVE_STACK_VALIDATION 125 select HAVE_SYSCALL_TRACEPOINTS 126 select HAVE_TIF_NOHZ 127 select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP 128 select IRQ_FORCED_THREADING 129 select MODULES_USE_ELF_RELA if MODULES 130 select OF 131 select OF_EARLY_FLATTREE 132 select PCI_DOMAINS_GENERIC if PCI 133 select PCI_ECAM if ACPI 134 select PCI_MSI_ARCH_FALLBACKS 135 select PERF_USE_VMALLOC 136 select RTC_LIB 137 select SYSCTL_ARCH_UNALIGN_ALLOW 138 select SYSCTL_ARCH_UNALIGN_NO_WARN 139 select SYSCTL_EXCEPTION_TRACE 140 select USER_STACKTRACE_SUPPORT 141 142menu "Machine selection" 143 144choice 145 prompt "System type" 146 default MACH_LOONGSON64 147 148config MACH_LOONGSON64 149 bool "Loongson 64-bit family of machines" 150 select ARCH_SPARSEMEM_ENABLE 151 select ARCH_MIGHT_HAVE_PC_PARPORT 152 select ARCH_MIGHT_HAVE_PC_SERIO 153 select HAVE_PCI 154 select PCI 155 select IRQ_LOONGARCH_CPU 156 select NR_CPUS_DEFAULT_64 157 select SPARSE_IRQ 158 select SYS_HAS_CPU_LOONGSON64 159 select SYS_SUPPORTS_SMP 160 select SYS_SUPPORTS_ZBOOT 161 select SYS_SUPPORTS_HOTPLUG_CPU 162 select SYS_SUPPORTS_NUMA 163 select SYS_SUPPORTS_64BIT_KERNEL 164 select SYS_SUPPORTS_HIGHMEM 165 select SYS_SUPPORTS_RELOCATABLE 166 select ZONE_DMA32 167 select USE_OF 168 select BUILTIN_DTB 169 help 170 This enables the support of Loongson 64-bit family of machines. These 171 machines are based on new Loongson-3 processors (Old Loongson is MIPS 172 compatible, while new Loongson is based on LoongArch ISA). 173 174endchoice 175 176endmenu 177 178config GENERIC_HWEIGHT 179 bool 180 default y 181 182config GENERIC_CALIBRATE_DELAY 183 bool 184 default y 185 186config SCHED_OMIT_FRAME_POINTER 187 bool 188 default y 189 190config AS_HAS_EXPLICIT_RELOCS 191 def_bool $(as-instr,x:pcalau12i \$t0$(comma)%pc_hi20(x)) 192 193config ARCH_SUPPORTS_UPROBES 194 bool 195 196config SYS_SUPPORTS_HOTPLUG_CPU 197 bool 198 199config GENERIC_CSUM 200 def_bool y 201 202config SYS_SUPPORTS_RELOCATABLE 203 bool 204 help 205 Selected if the platform supports relocating the kernel. 206 207config SYS_SUPPORTS_HUGETLBFS 208 def_bool y 209 210config L1_CACHE_SHIFT 211 int 212 default "6" 213 214menu "CPU selection" 215 216choice 217 prompt "CPU type" 218 default CPU_LOONGSON64 219 220config CPU_LOONGSON64 221 bool "Loongson 64-bit CPU" 222 depends on SYS_HAS_CPU_LOONGSON64 223 select CPU_SUPPORTS_64BIT_KERNEL 224 select CPU_SUPPORTS_HIGHMEM 225 select CPU_SUPPORTS_LSX 226 select CPU_SUPPORTS_LASX 227 select GPIOLIB 228 select SWIOTLB 229 select HAVE_KVM 230 select ARCH_SUPPORTS_ATOMIC_RMW 231 help 232 The Loongson 64-bit processor implements the LoongArch64 (the 64-bit 233 version of LoongArch) instruction set. 234 235endchoice 236 237config SYS_SUPPORTS_ZBOOT 238 bool 239 select HAVE_KERNEL_GZIP 240 select HAVE_KERNEL_BZIP2 241 select HAVE_KERNEL_LZ4 242 select HAVE_KERNEL_LZMA 243 select HAVE_KERNEL_LZO 244 select HAVE_KERNEL_XZ 245 select HAVE_KERNEL_ZSTD 246 247config SYS_HAS_CPU_LOONGSON64 248 bool 249 250endmenu 251 252config SYS_SUPPORTS_32BIT_KERNEL 253 bool 254config SYS_SUPPORTS_64BIT_KERNEL 255 bool 256config CPU_SUPPORTS_32BIT_KERNEL 257 bool 258config CPU_SUPPORTS_64BIT_KERNEL 259 bool 260config HARDWARE_WATCHPOINTS 261 bool 262 default y 263 264menu "Kernel type and options" 265 266choice 267 prompt "Kernel code model" 268 help 269 You should only select this option if you have a workload that 270 actually benefits from 64-bit processing or if your machine has 271 large memory. You will only be presented a single option in this 272 menu if your system does not support both 32-bit and 64-bit kernels. 273 274config 32BIT 275 bool "32-bit kernel" 276 depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL 277 help 278 Select this option if you want to build a 32-bit kernel. 279 280config 64BIT 281 bool "64-bit kernel" 282 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL 283 help 284 Select this option if you want to build a 64-bit kernel. 285 286endchoice 287 288config FIX_EARLYCON_MEM 289 def_bool y 290 291config PAGE_SIZE_4KB 292 bool 293 294config PAGE_SIZE_16KB 295 bool 296 297config PAGE_SIZE_64KB 298 bool 299 300config PGTABLE_2LEVEL 301 bool 302 303config PGTABLE_3LEVEL 304 bool 305 306config PGTABLE_4LEVEL 307 bool 308 309config PGTABLE_LEVELS 310 int 311 default 2 if PGTABLE_2LEVEL 312 default 3 if PGTABLE_3LEVEL 313 default 4 if PGTABLE_4LEVEL 314 315choice 316 prompt "Page Table Layout" 317 default 16KB_2LEVEL if 32BIT 318 default 16KB_3LEVEL if 64BIT 319 help 320 Allows choosing the page table layout, which is a combination 321 of page size and page table levels. The size of virtual memory 322 address space are determined by the page table layout. 323 324config 4KB_3LEVEL 325 bool "4KB with 3 levels" 326 select PAGE_SIZE_4KB 327 select PGTABLE_3LEVEL 328 help 329 This option selects 4KB page size with 3 level page tables, which 330 support a maximum of 39 bits of application virtual memory. 331 332config 4KB_4LEVEL 333 bool "4KB with 4 levels" 334 select PAGE_SIZE_4KB 335 select PGTABLE_4LEVEL 336 help 337 This option selects 4KB page size with 4 level page tables, which 338 support a maximum of 48 bits of application virtual memory. 339 340config 16KB_2LEVEL 341 bool "16KB with 2 levels" 342 select PAGE_SIZE_16KB 343 select PGTABLE_2LEVEL 344 help 345 This option selects 16KB page size with 2 level page tables, which 346 support a maximum of 36 bits of application virtual memory. 347 348config 16KB_3LEVEL 349 bool "16KB with 3 levels" 350 select PAGE_SIZE_16KB 351 select PGTABLE_3LEVEL 352 help 353 This option selects 16KB page size with 3 level page tables, which 354 support a maximum of 47 bits of application virtual memory. 355 356config 64KB_2LEVEL 357 bool "64KB with 2 levels" 358 select PAGE_SIZE_64KB 359 select PGTABLE_2LEVEL 360 help 361 This option selects 64KB page size with 2 level page tables, which 362 support a maximum of 42 bits of application virtual memory. 363 364config 64KB_3LEVEL 365 bool "64KB with 3 levels" 366 select PAGE_SIZE_64KB 367 select PGTABLE_3LEVEL 368 help 369 This option selects 64KB page size with 3 level page tables, which 370 support a maximum of 55 bits of application virtual memory. 371 372endchoice 373 374config FORCE_MAX_ZONEORDER 375 int "Maximum zone order" 376 range 14 64 if PAGE_SIZE_64KB 377 default "14" if PAGE_SIZE_64KB 378 range 12 64 if PAGE_SIZE_16KB 379 default "12" if PAGE_SIZE_16KB 380 range 11 64 381 default "11" 382 help 383 The kernel memory allocator divides physically contiguous memory 384 blocks into "zones", where each zone is a power of two number of 385 pages. This option selects the largest power of two that the kernel 386 keeps in the memory allocator. If you need to allocate very large 387 blocks of physically contiguous memory, then you may need to 388 increase this value. 389 390 This config option is actually maximum order plus one. For example, 391 a value of 11 means that the largest free memory block is 2^10 pages. 392 393 The page size is not necessarily 4KB. Keep this in mind 394 when choosing a value for this option. 395 396config CPU_HAS_PREFETCH 397 bool 398 default y 399 400config CPU_HAS_FPU 401 bool 402 default y 403 404config CPU_HAS_LSX 405 bool "Support for the Loongson SIMD Extension" 406 depends on CPU_SUPPORTS_LSX 407 depends on 64BIT 408 help 409 Loongson SIMD Extension (LSX) introduces 128 bit wide vector registers 410 and a set of SIMD instructions to operate on them. When this option 411 is enabled the kernel will support allocating & switching LSX 412 vector register contexts. If you know that your kernel will only be 413 running on CPUs which do not support LSX or that your userland will 414 not be making use of it then you may wish to say N here to reduce 415 the size & complexity of your kernel. 416 417 If unsure, say Y. 418 419config CPU_HAS_LASX 420 bool "Support for the Loongson Advanced SIMD Extension" 421 depends on CPU_SUPPORTS_LASX 422 depends on 64BIT && CPU_HAS_LSX 423 help 424 Loongson Advanced SIMD Extension is 256 bit wide SIMD extension. 425 426 If unsure, say Y. 427 428config CPU_HAS_LBT 429 bool "Support for the Loongson Binary Tranlatition" 430 431# 432# - Highmem only makes sense for the 32-bit kernel. 433# - We use SYS_SUPPORTS_HIGHMEM to offer highmem only for systems where we 434# know they might have memory configurations that could make use of highmem 435# support. 436# 437config HIGHMEM 438 bool "High Memory Support" 439 depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM 440 441config CPU_SUPPORTS_HIGHMEM 442 bool 443 444config SYS_SUPPORTS_HIGHMEM 445 bool 446 447config CPU_SUPPORTS_LSX 448 bool 449 450config CPU_SUPPORTS_LASX 451 bool 452 453config ARCH_SELECT_MEMORY_MODEL 454 def_bool y 455 456config ARCH_FLATMEM_ENABLE 457 def_bool y 458 depends on !NUMA 459 460config ARCH_SPARSEMEM_ENABLE 461 def_bool y 462 select SPARSEMEM_VMEMMAP_ENABLE 463 help 464 Say Y to support efficient handling of sparse physical memory, 465 for architectures which are either NUMA (Non-Uniform Memory Access) 466 or have huge holes in the physical address space for other reasons. 467 See <file:Documentation/vm/numa.rst> for more. 468 469config NUMA 470 bool "NUMA Support" 471 depends on SYS_SUPPORTS_NUMA 472 select ACPI_NUMA if ACPI 473 help 474 Say Y to compile the kernel with NUMA (Non-Uniform Memory Access) 475 support. This option improves performance on systems with more 476 than one NUMA node; on single node systems it is generally better 477 to leave it disabled. 478 479config SYS_SUPPORTS_NUMA 480 bool 481 482config RELOCATABLE 483 bool "Relocatable kernel" 484 depends on SYS_SUPPORTS_RELOCATABLE 485 help 486 This builds a kernel image that retains relocation information 487 so it can be loaded someplace besides the default 1MB. 488 The relocations make the kernel binary about 15% larger, 489 but are discarded at runtime 490 491config RELOCATION_TABLE_SIZE 492 hex "Relocation table size" 493 depends on RELOCATABLE 494 range 0x0 0x01000000 495 default "0x00200000" 496 help 497 A table of relocation data will be appended to the kernel binary 498 and parsed at boot to fix up the relocated kernel. 499 500 This option allows the amount of space reserved for the table to be 501 adjusted, although the default of 1Mb should be ok in most cases. 502 503 The build will fail and a valid size suggested if this is too small. 504 505 If unsure, leave at the default value. 506 507config RANDOMIZE_BASE 508 bool "Randomize the address of the kernel image" 509 depends on RELOCATABLE 510 help 511 Randomizes the physical and virtual address at which the 512 kernel image is loaded, as a security feature that 513 deters exploit attempts relying on knowledge of the location 514 of kernel internals. 515 516 Entropy is generated using any coprocessor 0 registers available. 517 518 The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET. 519 520 If unsure, say N. 521 522config RANDOMIZE_BASE_MAX_OFFSET 523 hex "Maximum kASLR offset" if EXPERT 524 depends on RANDOMIZE_BASE 525 range 0x0 0x40000000 if 64BIT 526 range 0x0 0x08000000 527 default "0x01000000" 528 help 529 When kASLR is active, this provides the maximum offset that will 530 be applied to the kernel image. It should be set according to the 531 amount of physical RAM available in the target system. 532 533 This is limited by the size of the lower address memory, 256MB. 534 535config NODES_SHIFT 536 int 537 default "6" 538 depends on NEED_MULTIPLE_NODES 539 540config USE_PERCPU_NUMA_NODE_ID 541 def_bool y 542 depends on NUMA 543 544config HAVE_SETUP_PER_CPU_AREA 545 def_bool y 546 depends on NUMA 547 548config NEED_PER_CPU_EMBED_FIRST_CHUNK 549 def_bool y 550 depends on NUMA 551 552config NEED_PER_CPU_PAGE_FIRST_CHUNK 553 def_bool y 554 depends on NUMA 555 556config CMDLINE 557 string "Built-in kernel command line" 558 help 559 For most platforms, the arguments for the kernel's command line 560 are provided at run-time, during boot. However, there are cases 561 where either no arguments are being provided or the provided 562 arguments are insufficient or even invalid. 563 564 When that occurs, it is possible to define a built-in command 565 line here and choose how the kernel should use it later on. 566 567choice 568 prompt "Kernel command line type" 569 default CMDLINE_BOOTLOADER 570 help 571 Choose how the kernel will handle the provided built-in command 572 line. 573 574config CMDLINE_BOOTLOADER 575 bool "Use bootloader kernel arguments if available" 576 help 577 Prefer the command-line passed by the boot loader if available. 578 Use the built-in command line as fallback in case we get nothing 579 during boot. This is the default behaviour. 580 581config CMDLINE_EXTEND 582 bool "Use built-in to extend bootloader kernel arguments" 583 help 584 The command-line arguments provided during boot will be 585 appended to the built-in command line. This is useful in 586 cases where the provided arguments are insufficient and 587 you don't want to or cannot modify them. 588 589config CMDLINE_FORCE 590 bool "Always use the built-in kernel command string" 591 help 592 Always use the built-in command line, even if we get one during 593 boot. This is useful in case you need to override the provided 594 command line on systems where you don't have or want control 595 over it. 596 597endchoice 598 599config DMI 600 bool "Enable DMI scanning" 601 select DMI_SCAN_MACHINE_NON_EFI_FALLBACK 602 default y 603 help 604 This enables SMBIOS/DMI feature for systems, and scanning of 605 DMI to identify machine quirks. 606 607config EFI 608 bool "EFI runtime service support" 609 select UCS2_STRING 610 select EFI_RUNTIME_WRAPPERS 611 help 612 This enables the kernel to use EFI runtime services that are 613 available (such as the EFI variable services). 614 615config EFI_STUB 616 bool "EFI stub support" 617 default y 618 depends on EFI 619 select EFI_GENERIC_STUB 620 help 621 This kernel feature allows a vmlinuz.efi to be loaded directly 622 by EFI firmware without the use of a bootloader. 623 624config SCHED_SMT 625 bool "SMT scheduler support" 626 default y 627 help 628 Improves scheduler's performance when there are multiple 629 threads in one physical core. 630 631config SMP 632 bool "Multi-Processing support" 633 depends on SYS_SUPPORTS_SMP 634 help 635 This enables support for systems with more than one CPU. If you have 636 a system with only one CPU, say N. If you have a system with more 637 than one CPU, say Y. 638 639 If you say N here, the kernel will run on uni- and multiprocessor 640 machines, but will use only one CPU of a multiprocessor machine. If 641 you say Y here, the kernel will run on many, but not all, 642 uniprocessor machines. On a uniprocessor machine, the kernel 643 will run faster if you say N here. 644 645 See also the SMP-HOWTO available at <http://www.tldp.org/docs.html#howto>. 646 647 If you don't know what to do here, say N. 648 649config HOTPLUG_CPU 650 bool "Support for hot-pluggable CPUs" 651 select GENERIC_IRQ_MIGRATION 652 depends on SMP && SYS_SUPPORTS_HOTPLUG_CPU 653 help 654 Say Y here to allow turning CPUs off and on. CPUs can be 655 controlled through /sys/devices/system/cpu. 656 (Note: power management support will enable this option 657 automatically on SMP systems. ) 658 Say N if you want to disable CPU hotplug. 659 660config SYS_SUPPORTS_SMP 661 bool 662 663config NR_CPUS_DEFAULT_4 664 bool 665 666config NR_CPUS_DEFAULT_8 667 bool 668 669config NR_CPUS_DEFAULT_16 670 bool 671 672config NR_CPUS_DEFAULT_32 673 bool 674 675config NR_CPUS_DEFAULT_64 676 bool 677 678config NR_CPUS 679 int "Maximum number of CPUs (2-256)" 680 range 2 256 681 depends on SMP 682 default "4" if NR_CPUS_DEFAULT_4 683 default "8" if NR_CPUS_DEFAULT_8 684 default "16" if NR_CPUS_DEFAULT_16 685 default "32" if NR_CPUS_DEFAULT_32 686 default "64" if NR_CPUS_DEFAULT_64 687 help 688 This allows you to specify the maximum number of CPUs which this 689 kernel will support. The maximum supported value is 32 for 32-bit 690 kernel and 64 for 64-bit kernels; the minimum value which makes 691 sense is 1 for Qemu (useful only for kernel debugging purposes) 692 and 2 for all others. 693 694 This is purely to save memory - each supported CPU adds 695 approximately eight kilobytes to the kernel image. For best 696 performance should round up your number of processors to the next 697 power of two. 698 699source "kernel/Kconfig.hz" 700 701config KEXEC 702 bool "Kexec system call" 703 select KEXEC_CORE 704 help 705 kexec is a system call that implements the ability to shutdown your 706 current kernel, and to start another kernel. It is like a reboot 707 but it is independent of the system firmware. And like a reboot 708 you can start any kernel with it, not just Linux. 709 710 The name comes from the similarity to the exec system call. 711 712config CRASH_DUMP 713 bool "Build kdump crash kernel" 714 select RELOCATABLE 715 help 716 Generate crash dump after being started by kexec. This should 717 be normally only set in special crash dump kernels which are 718 loaded in the main kernel with kexec-tools into a specially 719 reserved region and then later executed after a crash by 720 kdump/kexec. 721 722 For more details see Documentation/admin-guide/kdump/kdump.rst 723 724config ARCH_IOREMAP 725 bool "Enable LoongArch DMW-based ioremap()" 726 help 727 We use generic TLB-based ioremap() by default since it has page 728 protection support. However, you can enable LoongArch DMW-based 729 ioremap() for better performance. 730 731config ARCH_WRITECOMBINE 732 bool "Enable WriteCombine (WUC) for ioremap()" 733 help 734 LoongArch maintains cache coherency in hardware, but when paired 735 with LS7A chipsets the WUC attribute (Weak-ordered UnCached, which 736 is similar to WriteCombine) is out of the scope of cache coherency 737 machanism for PCIe devices (this is a PCIe protocol violation, which 738 may be fixed in newer chipsets). 739 740 This means WUC can only used for write-only memory regions now, so 741 this option is disabled by default, making WUC silently fallback to 742 SUC for ioremap(). You can enable this option if the kernel is ensured 743 to run on hardware without this bug. 744 745 You can override this setting via writecombine=on/off boot parameter. 746 747config ARCH_STRICT_ALIGN 748 bool "Enable -mstrict-align to prevent unaligned accesses" if EXPERT 749 default y 750 help 751 Not all LoongArch cores support h/w unaligned access, we can use 752 -mstrict-align build parameter to prevent unaligned accesses. 753 754 CPUs with h/w unaligned access support: 755 Loongson-2K2000/2K3000/3A5000/3C5000/3D5000. 756 757 CPUs without h/w unaligned access support: 758 Loongson-2K500/2K1000. 759 760 This option is enabled by default to make the kernel be able to run 761 on all LoongArch systems. But you can disable it manually if you want 762 to run kernel only on systems with h/w unaligned access support in 763 order to optimise for performance. 764 765config USE_OF 766 bool 767 select OF 768 select OF_EARLY_FLATTREE 769 select IRQ_DOMAIN 770 771config BUILTIN_DTB 772 bool 773 774source "kernel/livepatch/Kconfig" 775 776endmenu 777 778config ARCH_ENABLE_MEMORY_HOTPLUG 779 def_bool y 780 depends on LOONGARCH 781 782config ARCH_ENABLE_MEMORY_HOTREMOVE 783 def_bool y 784 depends on MEMORY_HOTPLUG 785 786config ARCH_ENABLE_THP_MIGRATION 787 def_bool y 788 depends on TRANSPARENT_HUGEPAGE 789 790config ARCH_MEMORY_PROBE 791 def_bool y 792 depends on MEMORY_HOTPLUG 793 794config GENERIC_BUG 795 def_bool y 796 depends on BUG 797 798config GENERIC_BUG_RELATIVE_POINTERS 799 def_bool y 800 depends on GENERIC_BUG 801 802config LOCKDEP_SUPPORT 803 bool 804 default y 805 806config STACKTRACE_SUPPORT 807 bool 808 default y 809 810config TRACE_IRQFLAGS_SUPPORT 811 bool 812 default y 813 814config MMU 815 bool 816 default y 817 818config ARCH_MMAP_RND_BITS_MIN 819 default 12 if 64BIT 820 default 8 821 822config ARCH_MMAP_RND_BITS_MAX 823 default 18 if 64BIT 824 default 15 825 826config ZONE_DMA 827 bool 828 829config ZONE_DMA32 830 bool 831 832config KASAN_SHADOW_OFFSET 833 hex 834 default 0x0 835 depends on KASAN 836 837menu "Power management options" 838 839config ARCH_SUSPEND_POSSIBLE 840 def_bool y 841 depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP 842 843config ARCH_HIBERNATION_POSSIBLE 844 def_bool y 845 depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP 846 847source "kernel/power/Kconfig" 848source "drivers/acpi/Kconfig" 849source "drivers/cpufreq/Kconfig" 850 851endmenu 852 853source "drivers/firmware/Kconfig" 854source "arch/loongarch/kvm/Kconfig" 855 856config PARAVIRT 857 bool "Enable paravirtualization code" 858 help 859 This changes the kernel so it can modify itself when it is run 860 under a hypervisor, potentially improving performance significantly 861 over full virtualization. 862 863config PARAVIRT_SPINLOCKS 864 bool "Paravirtualization layer for spinlocks" 865 depends on PARAVIRT && SMP 866 help 867 Paravirtualized spinlocks allow a pvops backend to replace the 868 spinlock implementation with something virtualization-friendly 869 (for example, block the virtual CPU rather than spinning). 870 871 It has a minimal impact on native kernels and gives a nice performance 872 benefit on paravirtualized KVM kernels. 873 874 If you are unsure how to answer this question, answer Y. 875 876config QUEUED_LOCK_STAT 877 bool "Paravirt queued spinlock statistics" 878 depends on PARAVIRT_SPINLOCKS && DEBUG_FS 879 help 880 Enable the collection of statistical data on the slowpath 881 behavior of paravirtualized queued spinlocks and report 882 them on debugfs. 883 884config PARAVIRT_TIME_ACCOUNTING 885 bool "Paravirtual steal time accounting" 886 select PARAVIRT 887 default n 888 help 889 Select this option to enable fine granularity task steal time 890 accounting. Time spent executing other tasks in parallel with 891 the current vCPU is discounted from the vCPU power. To account for 892 that, there can be a small performance impact. 893 894 If in doubt, say N here. 895