mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-10-26 10:57:38 +08:00
Pull MM updates from Andrew Morton:
- "selftests/mm: improve khugepaged coverage" (Kiryl Shutsemau):
Give khugepaged a proper workout. Extend the tests to all supported
mTHP orders, check exactly which windows collapsed, and make scan
completion deterministic. Race collapse against faults, pinning, fork
and remap; verify that the contents survive.
Add coverage for whole-page-table zaps and memory pressure too.
- "selftests/mm: separate GUP microbenchmarking from functional testing"
(Sarthak Sharma):
Untangle GUP benchmarking from correctness testing. Move the
benchmark into tools/mm, add a standalone harness-based GUP selftest,
and move shared helpers into tools/lib/mm. Give each tool one job
instead of mixing timing measurements with correctness checks.
Cover the mapping, pinning and batch-size combinations explicitly.
- "mm: Switch device DAX to section-based vmemmap optimization" (Muchun
Song):
Apply section-based vmemmap optimization to device DAX. Rework the
backing metadata layout to save memory while preserving the handling
of device memory hotplug and its different alignment and lifetime
requirements.
- "mm: Introduce section-based vmemmap optimization for HugeTLB"
(Muchun Song):
Cut the memory consumed by HugeTLB's struct page array with
section-based vmemmap optimization. Arrange the metadata so large
huge pages need fewer backing pages, while keeping initialization,
teardown and the various hugepage configurations straight.
- "mm/huge_memory: clean up and decouple the anon and file split
helpers" (Kairui Song):
Separate anonymous and file-backed folio splitting, which have rather
different locking and bookkeeping requirements. Move the work into
separate helpers, drop dead checks and tidy swap-cache handling. Fix
error paths, including one that could leave a folio frozen.
Keep the swap cache cases separate from file-cache splitting.
- "mm: Unconditional per-VMA locks and cleanups" (Dave Hansen):
Make per-VMA locking unconditional and clean up the old conditional
code around it. This removes configuration-dependent plumbing and
lets callers depend on one locking model rather than carrying both
cases along.
- "memcg: remove the v1 soft limit" (Shakeel Butt):
Remove the old cgroup v1 memory soft-limit machinery. This has long
since been superseded by the newer memory-control interfaces; hauling
around a separate reclaim scheme for it no longer buys us much.
- "read proc/pid/smaps_rollup under per-vma lock" (Suren Baghdasaryan):
Read /proc/PID/smaps_rollup using per-VMA locks where possible,
rather than holding mmap_lock across the entire walk. Retain the
contention fallback and add tearing tests. This considerably reduces
latency when another thread is busy changing its mappings.
- "mm/damon: introduce data access-as-a-data attribute" (SJ Park):
Teach DAMON to expose memory access observations as data attributes,
making them available to the probe and filtering machinery. Extend
the interfaces, documentation and tests so the new information can be
used rather than merely collected.
- "Remove PG_private by using page/folio->private checks instead" (Zi
Yan):
Get rid of PG_private and use the folio's private pointer to say
whether private data is attached. Convert the filesystem users,
including erofs, f2fs and md, and clean up the old accessors and
flags. There are a few special cases, notably swapcache and hugetlb,
which need explicit care.
- "mm: make userland page table freeing RCU-safe" (Lorenzo Stoakes):
Make freeing userspace page tables safe against RCU readers. Sort out
the page-table lifetime and locking rules so walkers cannot stumble
over freed tables while mappings are being torn down.
- "make unused huge shrinker memcg aware" (Qi Zheng):
Make shmem's unused-huge-folio shrinker aware of memory cgroups, so
reclaim can find those folios under the right memcg. Wire up the
per-memcg tracking and its lifetime rules, and give the shrinklist
its own lockdep class to avoid spurious dependency reports.
- "mm: Drop pxd_ERROR()" (Anshuman Khandual):
Remove the old pxd_ERROR() page-table checks and their
architecture-specific baggage. Simplify the common page-table
interfaces and callers now that these checks no longer serve a
useful purpose.
- "memcg: group struct fields by access pattern" (Shakeel Butt):
Rearrange memcg's hot and cold fields according to how they're
actually accessed. Keep frequently updated counters and their
neighboring state from fighting over cachelines and reduce needless
cacheline traffic.
- "mm/damon/core: fix the size charged for a filter-trimmed region"
(Donggeun Yoo):
Fix DAMOS quota accounting when a filter trims a monitoring region.
Charge only the part left after filtering, not the original region,
and add KUnit coverage. Previously the excluded memory could eat into
the quota and make schemes run more slowly than requested.
- "mm/damon: add kunit and selftests for probes and probe weights" (SJ
Park):
Add more tests for DAMON probes and their weights, including
validation and the results reported to userspace. This is mostly
about catching regressions in the newer probe infrastructure before
they become harder to diagnose.
- "mm: memcontrol: constify the read side of the read side of the memcg
API" (Tal Zussman):
Mark the read-only parts of the memcg interface const, from folio and
lruvec accessors to counters and swap helpers. Most of this is
mechanical, but it makes the contracts clearer and lets the compiler
catch accidental writes.
- "mm/damon/vaddr: support {prep,apply}_probes" (SJ Park):
Support the new prepare/apply probe operations in DAMON's
virtual-address backend. This brings vaddr monitoring into line with
the probe infrastructure and makes the added probe types useful there
too.
- "mm/mglru: clean up folio counters and flag usage" (Kairui Song):
Simplify MGLRU's folio counters and flag handling. Remove redundant
accounting paths and make the state transitions easier to follow
without changing the intended reclaim policy.
- "arch, mm/execmem: resolve confusion about set_direct_map_valid_noflush()"
(Mike Rapoport (Microsoft)):
Clarify and straighten out the set_direct_map_valid_noflush()
interface across architectures and execmem. Make the requested
mapping changes and the callers' expectations agree, rather than
relying on subtly different architecture behavior.
- "mm: zswap: free cold writeback folios promptly" (Alexandre Ghiti):
Free zswap writeback folios as soon as their disk write completes.
They are cold temporary buffers, so putting them on the LRU only
makes reclaim rediscover them later. Extend swap-cache dropbehind and
let zswap keep these folios off the LRU altogether.
- "mm: gup: cleanup gup_fast call chain" (Aristeu Rozanski):
Clean up the GUP-fast call chain and simplify how the fast-path
helpers pass their arguments and results around. Keep the page-pin
behavior the same while making the call sequence easier to maintain.
- "mm: optimize zone-device memmap initialization" (Li Zhe):
Speed up initialization of zone-device struct pages. Avoid redundant
work when setting up large device-memory ranges, where touching every
descriptor can get expensive.
- "mm/zswap: shrink zswap_entry via a pool id" (Jianyue Wu):
Reduce the size of zswap_entry by storing a compact pool identifier
instead of a full pointer. Keep the pool lookup and lifetime handling
correct while saving per-entry metadata.
- "mm/damon: support access monitoring of hugetlb-backed memory"
(Krishna Iyer):
Let DAMON monitor hugetlb-backed memory too. Extend the relevant
access checks and add coverage so those mappings no longer fall
through a hole in the monitoring machinery.
- "mm/execmem: fixes and cleanups for the ROX cache" (Mike Rapoport):
Tidy execmem's read-only-executable cache and fix its handling of the
awkward allocation and release cases. The aim is to make the cache's
ownership and permission transitions more predictable.
- "zsmallc: remove old object read API" (Sergey Senozhatsky):
Drop zsmalloc's old object-read API and move its remaining users to
the supported access mechanism. This removes a duplicate interface
which we no longer need.
- "mm/mempolicy: stop copying state in the interleave paths" (Gregory
Price):
Stop copying mempolicy state in the interleave paths when a reference
to the existing policy will do. This avoids extra work and makes the
ownership rules less obscure.
- "mm/mglru: speed up inc_min_seq() and fix cold/hot inversions" (Barry
Song):
Make MGLRU's generation advancement cheaper and fix cases where cold
and hot folios end up in the wrong order. Adjust the counter and list
handling so reclaim doesn't keep passing over the better eviction
candidates.
- "mm: Fix MF_DELAYED handling on memory failure" (Lisa Wang):
Treat MF_DELAYED as a partially completed memory-failure operation,
not an outright failure. Propagate that result correctly through
shmem and the generic handler, fix the extra-reference accounting,
and add tests for the resulting SIGBUS behavior.
- "tools/mm/page_owner_sort: fix --sort, add module filter, improve
usage" (Ye Liu):
Fix page_owner_sort's --sort handling, add module-based filtering and
make the usage output more helpful. This makes the tool less
frustrating when tracking down who is holding on to pages.
- "mm/damon: move damos filter range arguments validation to core" (SJ
Park):
Move DAMOS filter range validation into the core, where all callers
can share it. Also close the sysfs read-twice races which could pass
inconsistent ranges, and add tests for invalid input.
- "mm/damon: misc cleanups" (Zenghui Yu):
Clean up a collection of small DAMON rough edges in the core,
interfaces and tests. No large behavior change here, just simpler
code and fewer opportunities for confusion.
- "mm/damon: cleanup code, add test cases, and update guidances in
docs" (SJ Park):
Clean up DAMON's core and interfaces, add missing test cases and
bring the documentation into line with the code. These changes should
make the newer facilities easier to understand and maintain.
- "mm/damon: introduce hugepage_size probe filter" (SJ Park):
Add a DAMON probe filter for hugepage size. Let users select a range
of folio sizes through sysfs, validate the range and document the new
interface, so monitoring can concentrate on memory backed by the
desired hugepage sizes.
- "selftests/mm: pagemap_ioctl test fixes and cleanups" (Zenghui Yu):
Fix some pagemap ioctl test assumptions and clean up their setup and
reporting. Make failures point to the operation that went wrong
rather than to test harness bookkeeping.
- "mm: avoid large folio splits when swap is unavailable" (Johannes
Weiner):
Avoid splitting large folios merely to attempt swap when no swap
space is available. There is little point paying for an expensive
split when reclaim cannot actually swap the resulting pages out.
- "mm: workingset: fix the shadow node budget under MGLRU" (Hui Zhu):
Fix the workingset shadow-node budget with MGLRU enabled. Keep the
shadow entries within the intended limits so refault tracking does
not quietly consume more metadata than it should.
- "selftests/mm: TAP output and global-state fixes" (Song Hu):
Fix selftests which produce misleading TAP output or fail to restore
global settings after a run. A test ought to leave the system as it
found it, particularly when a whole suite follows behind.
- "mm: remove page_swap_entry()" (Tal Zussman):
Remove page_swap_entry() and convert its remaining users to the folio
and swap-entry helpers. Lose an old page-level interface and make the
swap paths a little more consistent.
- "mm: refactor zonelist constructors and iterators" (Gregory Price):
Refactor the zonelist construction and walk helpers to reduce
duplicated logic. Keep the allocation ordering rules intact while
making it clearer how zones are selected.
- "mm: kmemleak: batch the struct page scan" (Breno Leitao):
Scan adjacent struct pages in batches instead of taking kmemleak_lock
once for every single page. This preserves scan coverage and the
lock-hold bound, while cutting overhead substantially on debug
kernels.
- "mm/damon: misc improvements in tests and documents" (Zenghui Yu):
Fix some DAMON selftests which leave kdamond running or fail under
Python safe-path mode, and improve the KUnit coverage and
documentation. Nothing especially glamorous, but these are worth
doing.
- "mm/damon: introduce probe_hits_wsum DAMOS core filter" (SJ Park):
Add a DAMOS core filter using weighted probe-hit counts. This gives
schemes another way to select regions based on what the monitoring
probes observed.
- "mm/mglru: fix ineffective memory protection for non-kswapd reclaim"
(Ridong Chen):
Fix MGLRU's memory protection handling for reclaim outside kswapd.
The protection settings weren't having the intended effect in these
paths, leaving protected memory more exposed than requested.
- "mm/damon: improve readability, clarity and test coverage" (SJ Park):
Simplify a handful of DAMON core helpers, clarify their behavior and
expand test coverage. There are no intended userspace-visible changes
in this batch.
- "mm: replace PF_KCOMPACTD/PF_KSWAPD with kthread_func()" (Kefeng
Wang):
Stop identifying reclaim and compaction workers through the PF_KSWAPD
and PF_KCOMPACTD task flags. Use their kthread functions instead and
remove the redundant flag plumbing.
- "mm/hugetlb: fix surplus accounting and availability checks during
demotion" (Longlong Xia):
Fix HugeTLB surplus accounting and availability checks when demoting
huge pages. Keep the counters and reservation decisions consistent as
one huge page turns into several smaller ones.
- "mm/damon: add kunit tests for probe_hits handling and probe params
validation" (Jason Angelov):
Add KUnit tests for DAMON probe-hit handling and invalid probe
parameters. These cover edge cases that were too easy to miss in
ordinary monitoring tests.
- "mm/damon: fix misc bugs in kunit, quota goals and sysfs refresh_ms"
(SJ Park):
Fix a few DAMON bugs in KUnit tests, quota-goal handling and the
sysfs refresh interval. Small fixes, but the incorrect results and
control behavior were real.
- "mm: zswap: optimize zswap invalidate and store" (Kefeng Wang):
Simplify zswap's invalidate and store paths to avoid avoidable
lookups and work. Keep the entry lifetime rules intact while making
those frequent operations cheaper.
- "mm: replace custom ratelimiting logic" (Pedro Falcato):
Replace hand-rolled MM rate limiting with the common kernel helpers.
There is no need to maintain another local version of the same
mechanism.
- "mm/vmalloc: minor cleanups" (Ye Liu):
Tidy some vmalloc initialization and reporting code, and pull
duplicated vmap-area insertion work into a helper. No functional
changes are intended.
- "mm/mglru: clean up isolate_folios for readability and clarity"
(Ridong Chen):
Clean up MGLRU's isolate_folios() so the decisions are easier to read
and verify. Keep reclaim behavior unchanged while removing
unnecessary twists in the control flow.
- "Catch automatic storage in IDA and Maple Tree definitions" (Yury
Norov):
Catch IDA and maple-tree definitions placed in automatic storage
where the lifetime rules are wrong or easy to get wrong. Add checks
so such mistakes are harder to slip through unnoticed.
- "mm, swap: some random fixes and cleanups" (Kemeng Shi):
Fix and simplify a few unrelated swap paths, removing redundant work
and tidying up error handling. A small collection of things which
were better fixed than left lying around.
- "mm/page_io: folio conversion cleanups" (Tal Zussman):
Finish some page-to-folio conversions in swap I/O, removing obsolete
wrappers and using folio operations consistently. The I/O behavior is
intended to remain the same.
- "mm/swap: skip empty clusters in the swapoff scan" (Youngjun Park):
Skip empty swap clusters during swapoff instead of walking slots
which have nothing to release. This avoids pointless work on sparsely
used swap devices.
- "mm: trace: decode architecture-specific VMA flags" (Meijing Zhao):
Teach the VMA trace output to decode architecture-specific flags,
rather than leaving them as unexplained bits. That should make
tracing a good deal more useful when debugging unusual mappings.
- "mm, swap: don't spin on a bad swap entry" (Breno Leitao):
Stop repeatedly retrying a swap entry which is already known to be
bad. Make the error path terminate cleanly instead of wasting CPU
chasing an entry that cannot be used.
- "mm/page_isolation: fix UBSAN shift-out-of-bounds in
isolate_single_pageblock" (Qi Xi):
Fix an out-of-range shift in isolate_single_pageblock() and tighten
its associated boundary handling. UBSAN found the issue; the result
should be more robust pageblock isolation.
- "mm: khugepaged: fix tracepoint UAF" (Vernon Yang):
Fix a use-after-free in khugepaged tracepoint handling. Make sure the
information recorded by tracing stays valid for as long as the trace
event needs it.
- "mm/damon: fix DAMOS bugs in core, paddr and vaddr" (SJ Park):
Fix several DAMOS problems across the core and physical- and
virtual-address backends. The changes close error cases and bring the
implementations back into agreement.
- "mm/hugetlb_cgroup: move the per-node usage along with the folio"
(Hongfu Li):
Move HugeTLB per-node usage accounting when folios migrate between
nodes or are reparented to another cgroup. Otherwise numa_stat can
retain stale charges and even underflow when the folio is freed.
- "docs/core-api: memory-allocation: add k[mz]alloc_obj() and clarify
kmalloc" (Mike Rapoport):
Document the typed k[mz]alloc_obj() allocation helpers and clear up
some kmalloc guidance. Make it easier for callers to choose the right
interface.
- "selftests/mm: Validate selections and scope memfd_secret setup"
(Tianyi Chen):
Check selftest selections before running and confine memfd_secret
setup to the cases that actually need it. Avoid confusing failures
caused by the test harness itself.
- "mm/damon: move zero damos quota target_value handling to the core
layer" (SJ Park):
Handle a zero DAMOS quota goal target in the core rather than making
each user of the interface invent its own rule. Keep quota decisions
consistent across callers.
- "mm/damon: Introduce a huge page collapsing mechanism using auto
tuning" (Asier Gutierrez):
Add an auto-tuned DAMON mechanism for collapsing huge pages. Use
monitoring feedback to decide when collapse is worthwhile rather than
forcing one fixed policy onto every workload.
- "kmemleak: fix stale documentation and raise the verbose default"
(Breno Leitao):
Bring the kmemleak documentation up to date and require a third
confirming scan before verbose kernels print a suspected leak. The
extra scan helps suppress transient false positives in noisy debug
builds.
- "mm/memory: improve insert_pages() error handling" (Avi Weiss):
Tighten insert_pages() error handling so partial failures are
reported and cleaned up consistently. The caller should not have to
guess how far the operation got.
- "mm/damon: allow NULL or unstarted damon_ctx parameter for
damon_call()" (SJ Park):
Make damon_call() handle NULL and not-yet-started contexts safely.
Simplify the rules for callers and avoid an indefinite wait on an
invalid state.
- "mm/damon: introduce pgidle_set probe filter type" (SJ Park):
Add a pgidle_set DAMON probe filter, giving monitoring users another
way to select pages by their idle-tracking state. Wire it through the
filter interfaces and tests.
- "mm/damon/core: remove unused helper functions" (Cheng-Han Wu):
Remove DAMON core helpers which no longer have callers. Keep the API
surface smaller rather than retaining dead code just in case.
- "mm: stop calling pmd_folio() on special PMDs" (Gregory Price):
Avoid calling pmd_folio() on special PMD mappings that have no struct
page. The old assumption could fault in procfs walkers; use the
normal-folio checks and handle those mappings properly.
- "mm: remove three unused helpers from mm.h" (Tal Zussman):
Remove three unused helpers from mm.h. Fewer obsolete interfaces for
the next person to stumble over.
- "mm/damon: improvements in efficiency, error handling, documents"
(Liew Rui Yan):
Skip needless DAMOS quota work once the quota is full, propagate a
missing sysfs error and tidy a couple of comments. The ignored error
could make a monitoring-start request appear successful when it
wasn't.
- "docs/mm/damon/design: add explanation of nr_snapshots" (Liew Rui
Yan):
Explain DAMON's nr_snapshots accounting in the design documentation
and straighten out the associated terminology. Make it clearer what
users should expect from that counter.
- "selftests/cgroup: fixes for test_zswap on single core VM" (Wilson
Felipe Pereira):
Fix two test_zswap failures on single-CPU VMs. Wait for the exiting
child's cgroup to become unpopulated before reconfiguring it, and
avoid another test assumption which breaks under constrained
scheduling.
- "docs/ksm: fix advisor documentation and comment" (Jinjiang Tu):
Correct the KSM advisor documentation and a misleading code comment.
Keep the description aligned with how the advisor actually works.
- "Fix bugs in HugeTLB allocation when mem_cgroup_charge_hugetlb()
fails" (Ackerley Tng):
Fix HugeTLB allocation cleanup when the memcg charge fails. Make sure
failure exits undo what was allocated rather than leaving stale
accounting or resources behind.
- "mm, memcg: fix memory.peak reset clobbering other fds' watermark"
(Ridong Chen):
Fix memory.peak reset handling so resetting one file descriptor
doesn't overwrite the watermark kept for another. Keep those per-open
measurements independent as intended.
- "mm: reject zone device folios in more folio walkers" (Gregory
Price):
Reject zone-device folios in page walkers that cannot safely handle
them. Extend the existing checks rather than assuming every folio has
ordinary system-memory backing.
- "percpu: remove code with no effect" (Sang-Heon Jeon):
Remove a few pieces of percpu code which no longer do anything. There
is no reason to keep maintaining dead paths.
* tag 'mm-stable-2026-10-19-21-33' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (539 commits)
mm: shmem: assign a lock class to the unused huge shrinklist
mm: vmscan: put rotation-missed folios at the LRU tail
mm: kmemleak: scan the struct page array in MAX_SCAN_SIZE batches
mm: kmemleak: move the struct page scan into a helper
mm/damon: document that a zero sample_interval is accepted
mm/damon: fix typos in comments
mm/damon/sysfs: propagate damon_call() error in turn_damon_on
mm/damon/core: skip quota score setup when the quota is full
mm/damon/tests/core-kunit: test the size charged for a filter-trimmed region
mm/damon/core: charge only the part of a region the filter left
mm: disallow raw PFN mappings of huge/shared zeropage
selftests/mm: zap whole PTE tables in the khugepaged race harness
selftests/mm: add memory-pressure threads to the khugepaged race harness
selftests/mm: race the collapse of windows with holes
selftests/mm: add khugepaged race harness
selftests/mm: check that one khugepaged pass collapses one window
selftests/mm: run every supported collapse order by default
selftests/mm: cover a shared-source collapse write race
selftests/mm: parameterize the mixed-source collapse case by source order
selftests/mm: add order-parameterized khugepaged collapse cases
...
1836 lines
54 KiB
Plaintext
1836 lines
54 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0
|
||
#
|
||
# General architecture dependent options
|
||
#
|
||
|
||
#
|
||
# Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can
|
||
# override the default values in this file.
|
||
#
|
||
source "arch/$(SRCARCH)/Kconfig"
|
||
|
||
config ARCH_CONFIGURES_CPU_MITIGATIONS
|
||
bool
|
||
|
||
if !ARCH_CONFIGURES_CPU_MITIGATIONS
|
||
config CPU_MITIGATIONS
|
||
def_bool y
|
||
endif
|
||
|
||
#
|
||
# Selected by architectures that need custom DMA operations for e.g. legacy
|
||
# IOMMUs not handled by dma-iommu. Drivers must never select this symbol.
|
||
#
|
||
config ARCH_HAS_DMA_OPS
|
||
depends on HAS_DMA
|
||
select DMA_OPS_HELPERS
|
||
bool
|
||
|
||
menu "General architecture-dependent options"
|
||
|
||
config ARCH_HAS_SUBPAGE_FAULTS
|
||
bool
|
||
help
|
||
Select if the architecture can check permissions at sub-page
|
||
granularity (e.g. arm64 MTE). The probe_user_*() functions
|
||
must be implemented.
|
||
|
||
config HOTPLUG_SMT
|
||
bool
|
||
|
||
config SMT_NUM_THREADS_DYNAMIC
|
||
bool
|
||
|
||
config ARCH_SUPPORTS_SCHED_SMT
|
||
bool
|
||
|
||
config ARCH_SUPPORTS_SCHED_CLUSTER
|
||
bool
|
||
|
||
config ARCH_SUPPORTS_SCHED_MC
|
||
bool
|
||
|
||
config SCHED_SMT
|
||
bool "SMT (Hyperthreading) scheduler support"
|
||
depends on ARCH_SUPPORTS_SCHED_SMT
|
||
default y
|
||
help
|
||
Improves the CPU scheduler's decision making when dealing with
|
||
MultiThreading at a cost of slightly increased overhead in some
|
||
places. If unsure say N here.
|
||
|
||
config SCHED_CLUSTER
|
||
bool "Cluster scheduler support"
|
||
depends on ARCH_SUPPORTS_SCHED_CLUSTER
|
||
default y
|
||
help
|
||
Cluster scheduler support improves the CPU scheduler's decision
|
||
making when dealing with machines that have clusters of CPUs.
|
||
Cluster usually means a couple of CPUs which are placed closely
|
||
by sharing mid-level caches, last-level cache tags or internal
|
||
busses.
|
||
|
||
config SCHED_MC
|
||
bool "Multi-Core Cache (MC) scheduler support"
|
||
depends on ARCH_SUPPORTS_SCHED_MC
|
||
default y
|
||
help
|
||
Multi-core scheduler support improves the CPU scheduler's decision
|
||
making when dealing with multi-core CPU chips at a cost of slightly
|
||
increased overhead in some places. If unsure say N here.
|
||
|
||
# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
|
||
config HOTPLUG_CORE_SYNC
|
||
bool
|
||
|
||
# Basic CPU dead synchronization selected by architecture
|
||
config HOTPLUG_CORE_SYNC_DEAD
|
||
bool
|
||
select HOTPLUG_CORE_SYNC
|
||
|
||
# Full CPU synchronization with alive state selected by architecture
|
||
config HOTPLUG_CORE_SYNC_FULL
|
||
bool
|
||
select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
|
||
select HOTPLUG_CORE_SYNC
|
||
|
||
config HOTPLUG_SPLIT_STARTUP
|
||
bool
|
||
select HOTPLUG_CORE_SYNC_FULL
|
||
|
||
config HOTPLUG_PARALLEL
|
||
bool
|
||
select HOTPLUG_SPLIT_STARTUP
|
||
|
||
config GENERIC_IRQ_ENTRY
|
||
bool
|
||
|
||
config GENERIC_SYSCALL
|
||
bool
|
||
depends on GENERIC_IRQ_ENTRY
|
||
|
||
config GENERIC_ENTRY
|
||
bool
|
||
select GENERIC_IRQ_ENTRY
|
||
select GENERIC_SYSCALL
|
||
|
||
config ARCH_SUPPORTS_SYSCALL_USER_DISPATCH
|
||
bool
|
||
|
||
config SYSCALL_USER_DISPATCH
|
||
bool "Syscall User Dispatch"
|
||
depends on ARCH_SUPPORTS_SYSCALL_USER_DISPATCH
|
||
depends on GENERIC_ENTRY
|
||
default y
|
||
help
|
||
Syscall User Dispatch lets a thread have its own system calls
|
||
intercepted and redirected to a userspace signal handler based
|
||
on a prctl() configured instruction pointer range.
|
||
If unsure, say Y.
|
||
|
||
config KPROBES
|
||
bool "Kprobes"
|
||
depends on HAVE_KPROBES
|
||
select KALLSYMS
|
||
select EXECMEM
|
||
select NEED_TASKS_RCU
|
||
help
|
||
Kprobes allows you to trap at almost any kernel address and
|
||
execute a callback function. register_kprobe() establishes
|
||
a probepoint and specifies the callback. Kprobes is useful
|
||
for kernel debugging, non-intrusive instrumentation and testing.
|
||
If in doubt, say "N".
|
||
|
||
config JUMP_LABEL
|
||
bool "Optimize very unlikely/likely branches"
|
||
depends on HAVE_ARCH_JUMP_LABEL
|
||
select OBJTOOL if HAVE_JUMP_LABEL_HACK
|
||
help
|
||
This option enables a transparent branch optimization that
|
||
makes certain almost-always-true or almost-always-false branch
|
||
conditions even cheaper to execute within the kernel.
|
||
|
||
Certain performance-sensitive kernel code, such as trace points,
|
||
scheduler functionality, networking code and KVM have such
|
||
branches and include support for this optimization technique.
|
||
|
||
If it is detected that the compiler has support for "asm goto",
|
||
the kernel will compile such branches with just a nop
|
||
instruction. When the condition flag is toggled to true, the
|
||
nop will be converted to a jump instruction to execute the
|
||
conditional block of instructions.
|
||
|
||
This technique lowers overhead and stress on the branch prediction
|
||
of the processor and generally makes the kernel faster. The update
|
||
of the condition is slower, but those are always very rare.
|
||
|
||
( On 32-bit x86, the necessary options added to the compiler
|
||
flags may increase the size of the kernel slightly. )
|
||
|
||
config STATIC_KEYS_SELFTEST
|
||
bool "Static key selftest"
|
||
depends on JUMP_LABEL
|
||
help
|
||
Boot time self-test of the branch patching code.
|
||
|
||
config STATIC_CALL_SELFTEST
|
||
bool "Static call selftest"
|
||
depends on HAVE_STATIC_CALL
|
||
help
|
||
Boot time self-test of the call patching code.
|
||
|
||
config OPTPROBES
|
||
def_bool y
|
||
depends on KPROBES && HAVE_OPTPROBES
|
||
select NEED_TASKS_RCU
|
||
|
||
config KPROBES_ON_FTRACE
|
||
def_bool y
|
||
depends on KPROBES && HAVE_KPROBES_ON_FTRACE
|
||
depends on DYNAMIC_FTRACE_WITH_REGS
|
||
help
|
||
If function tracer is enabled and the arch supports full
|
||
passing of pt_regs to function tracing, then kprobes can
|
||
optimize on top of function tracing.
|
||
|
||
config UPROBES
|
||
def_bool n
|
||
depends on ARCH_SUPPORTS_UPROBES
|
||
select TASKS_TRACE_RCU
|
||
help
|
||
Uprobes is the user-space counterpart to kprobes: they
|
||
enable instrumentation applications (such as 'perf probe')
|
||
to establish unintrusive probes in user-space binaries and
|
||
libraries, by executing handler functions when the probes
|
||
are hit by user-space applications.
|
||
|
||
( These probes come in the form of single-byte breakpoints,
|
||
managed by the kernel and kept transparent to the probed
|
||
application. )
|
||
|
||
config HAVE_64BIT_ALIGNED_ACCESS
|
||
def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||
help
|
||
Some architectures require 64 bit accesses to be 64 bit
|
||
aligned, which also requires structs containing 64 bit values
|
||
to be 64 bit aligned too. This includes some 32 bit
|
||
architectures which can do 64 bit accesses, as well as 64 bit
|
||
architectures without unaligned access.
|
||
|
||
This symbol should be selected by an architecture if 64 bit
|
||
accesses are required to be 64 bit aligned in this way even
|
||
though it is not a 64 bit architecture.
|
||
|
||
See Documentation/core-api/unaligned-memory-access.rst for
|
||
more information on the topic of unaligned memory accesses.
|
||
|
||
config HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||
bool
|
||
help
|
||
Some architectures are unable to perform unaligned accesses
|
||
without the use of get_unaligned/put_unaligned. Others are
|
||
unable to perform such accesses efficiently (e.g. trap on
|
||
unaligned access and require fixing it up in the exception
|
||
handler.)
|
||
|
||
This symbol should be selected by an architecture if it can
|
||
perform unaligned accesses efficiently to allow different
|
||
code paths to be selected for these cases. Some network
|
||
drivers, for example, could opt to not fix up alignment
|
||
problems with received packets if doing so would not help
|
||
much.
|
||
|
||
See Documentation/core-api/unaligned-memory-access.rst for more
|
||
information on the topic of unaligned memory accesses.
|
||
|
||
config ARCH_USE_BUILTIN_BSWAP
|
||
bool
|
||
help
|
||
GCC and Clang have builtin functions for handling byte-swapping.
|
||
Using these allows the compiler to see what's happening and
|
||
offers more opportunity for optimisation. In particular, the
|
||
compiler will be able to combine the byteswap with a nearby load
|
||
or store and use load-and-swap or store-and-swap instructions if
|
||
the architecture has them. It should almost *never* result in code
|
||
which is worse than the hand-coded assembler in <asm/swab.h>.
|
||
But just in case it does, the use of the builtins is optional.
|
||
|
||
Any architecture with load-and-swap or store-and-swap
|
||
instructions should set this. And it shouldn't hurt to set it
|
||
on architectures that don't have such instructions.
|
||
|
||
config KRETPROBES
|
||
def_bool y
|
||
depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
|
||
|
||
config KRETPROBE_ON_RETHOOK
|
||
def_bool y
|
||
depends on HAVE_RETHOOK
|
||
depends on KRETPROBES
|
||
select RETHOOK
|
||
|
||
config USER_RETURN_NOTIFIER
|
||
bool
|
||
depends on HAVE_USER_RETURN_NOTIFIER
|
||
help
|
||
Provide a kernel-internal notification when a cpu is about to
|
||
switch to user mode.
|
||
|
||
config HAVE_IOREMAP_PROT
|
||
bool
|
||
|
||
config HAVE_KPROBES
|
||
bool
|
||
|
||
config HAVE_KRETPROBES
|
||
bool
|
||
|
||
config HAVE_OPTPROBES
|
||
bool
|
||
|
||
config HAVE_KPROBES_ON_FTRACE
|
||
bool
|
||
|
||
config ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
|
||
bool
|
||
help
|
||
Since kretprobes modifies return address on the stack, the
|
||
stacktrace may see the kretprobe trampoline address instead
|
||
of correct one. If the architecture stacktrace code and
|
||
unwinder can adjust such entries, select this configuration.
|
||
|
||
config HAVE_FUNCTION_ERROR_INJECTION
|
||
bool
|
||
|
||
config HAVE_NMI
|
||
bool
|
||
|
||
config HAVE_FUNCTION_DESCRIPTORS
|
||
bool
|
||
|
||
config TRACE_IRQFLAGS_SUPPORT
|
||
bool
|
||
|
||
config TRACE_IRQFLAGS_NMI_SUPPORT
|
||
bool
|
||
|
||
#
|
||
# An arch should select this if it provides all these things:
|
||
#
|
||
# task_pt_regs() in asm/processor.h or asm/ptrace.h
|
||
# arch_has_single_step() if there is hardware single-step support
|
||
# arch_has_block_step() if there is hardware block-step support
|
||
# asm/syscall.h supplying asm-generic/syscall.h interface
|
||
# linux/regset.h user_regset interfaces
|
||
# CORE_DUMP_USE_REGSET #define'd in linux/elf.h
|
||
# TIF_SYSCALL_TRACE calls ptrace_report_syscall_{entry,exit}
|
||
# TIF_NOTIFY_RESUME calls resume_user_mode_work()
|
||
#
|
||
config HAVE_ARCH_TRACEHOOK
|
||
bool
|
||
|
||
config HAVE_DMA_CONTIGUOUS
|
||
bool
|
||
|
||
config GENERIC_SMP_IDLE_THREAD
|
||
bool
|
||
|
||
config GENERIC_IDLE_POLL_SETUP
|
||
bool
|
||
|
||
config ARCH_HAS_FORTIFY_SOURCE
|
||
bool
|
||
help
|
||
An architecture should select this when it can successfully
|
||
build and run with CONFIG_FORTIFY_SOURCE.
|
||
|
||
#
|
||
# Select if the arch provides a historic keepinit alias for the retain_initrd
|
||
# command line option
|
||
#
|
||
config ARCH_HAS_KEEPINITRD
|
||
bool
|
||
|
||
# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
|
||
config ARCH_HAS_SET_MEMORY
|
||
bool
|
||
|
||
# Select if arch has all set_direct_map_invalid/default() functions
|
||
config ARCH_HAS_SET_DIRECT_MAP
|
||
bool
|
||
|
||
#
|
||
# Select if the architecture provides the arch_dma_set_uncached symbol to
|
||
# either provide an uncached segment alias for a DMA allocation, or
|
||
# to remap the page tables in place.
|
||
#
|
||
config ARCH_HAS_DMA_SET_UNCACHED
|
||
bool
|
||
|
||
#
|
||
# Select if the architectures provides the arch_dma_clear_uncached symbol
|
||
# to undo an in-place page table remap for uncached access.
|
||
#
|
||
config ARCH_HAS_DMA_CLEAR_UNCACHED
|
||
bool
|
||
|
||
config ARCH_HAS_CPU_FINALIZE_INIT
|
||
bool
|
||
|
||
config ARCH_HAS_DELAY_TIMER
|
||
bool
|
||
|
||
# The architecture has a per-task state that includes the mm's PASID
|
||
config ARCH_HAS_CPU_PASID
|
||
bool
|
||
select IOMMU_MM_DATA
|
||
|
||
config HAVE_ARCH_THREAD_STRUCT_WHITELIST
|
||
bool
|
||
help
|
||
An architecture should select this to provide hardened usercopy
|
||
knowledge about what region of the thread_struct should be
|
||
whitelisted for copying to userspace. Normally this is only the
|
||
FPU registers. Specifically, arch_thread_struct_whitelist()
|
||
should be implemented. Without this, the entire thread_struct
|
||
field in task_struct will be left whitelisted.
|
||
|
||
# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
|
||
config ARCH_WANTS_DYNAMIC_TASK_STRUCT
|
||
bool
|
||
|
||
config ARCH_WANTS_NO_INSTR
|
||
bool
|
||
help
|
||
An architecture should select this if the noinstr macro is being used on
|
||
functions to denote that the toolchain should avoid instrumenting such
|
||
functions and is required for correctness.
|
||
|
||
config ARCH_32BIT_OFF_T
|
||
bool
|
||
depends on !64BIT
|
||
help
|
||
All new 32-bit architectures should have 64-bit off_t type on
|
||
userspace side which corresponds to the loff_t kernel type. This
|
||
is the requirement for modern ABIs. Some existing architectures
|
||
still support 32-bit off_t. This option is enabled for all such
|
||
architectures explicitly.
|
||
|
||
# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
|
||
config ARCH_32BIT_USTAT_F_TINODE
|
||
bool
|
||
|
||
# Selected by architectures with Total Store Order (TSO)
|
||
config ARCH_MEMORY_ORDER_TSO
|
||
bool
|
||
|
||
config HAVE_ASM_MODVERSIONS
|
||
bool
|
||
help
|
||
This symbol should be selected by an architecture if it provides
|
||
<asm/asm-prototypes.h> to support the module versioning for symbols
|
||
exported from assembly code.
|
||
|
||
config HAVE_REGS_AND_STACK_ACCESS_API
|
||
bool
|
||
help
|
||
This symbol should be selected by an architecture if it supports
|
||
the API needed to access registers and stack entries from pt_regs,
|
||
declared in asm/ptrace.h
|
||
For example the kprobes-based event tracer needs this API.
|
||
|
||
config HAVE_RSEQ
|
||
bool
|
||
depends on HAVE_REGS_AND_STACK_ACCESS_API
|
||
help
|
||
This symbol should be selected by an architecture if it
|
||
supports an implementation of restartable sequences.
|
||
|
||
config HAVE_RUST
|
||
bool
|
||
help
|
||
This symbol should be selected by an architecture if it
|
||
supports Rust.
|
||
|
||
config HAVE_FUNCTION_ARG_ACCESS_API
|
||
bool
|
||
help
|
||
This symbol should be selected by an architecture if it supports
|
||
the API needed to access function arguments from pt_regs,
|
||
declared in asm/ptrace.h
|
||
|
||
config HAVE_HW_BREAKPOINT
|
||
bool
|
||
depends on PERF_EVENTS
|
||
|
||
config HAVE_MIXED_BREAKPOINTS_REGS
|
||
bool
|
||
depends on HAVE_HW_BREAKPOINT
|
||
help
|
||
Depending on the arch implementation of hardware breakpoints,
|
||
some of them have separate registers for data and instruction
|
||
breakpoints addresses, others have mixed registers to store
|
||
them but define the access type in a control register.
|
||
Select this option if your arch implements breakpoints under the
|
||
latter fashion.
|
||
|
||
config HAVE_USER_RETURN_NOTIFIER
|
||
bool
|
||
|
||
config HAVE_PERF_EVENTS_NMI
|
||
bool
|
||
help
|
||
System hardware can generate an NMI using the perf event
|
||
subsystem. Also has support for calculating CPU cycle events
|
||
to determine how many clock cycles in a given period.
|
||
|
||
config HAVE_HARDLOCKUP_DETECTOR_PERF
|
||
bool
|
||
depends on HAVE_PERF_EVENTS_NMI
|
||
help
|
||
The arch chooses to use the generic perf-NMI-based hardlockup
|
||
detector. Must define HAVE_PERF_EVENTS_NMI.
|
||
|
||
config HAVE_HARDLOCKUP_DETECTOR_ARCH
|
||
bool
|
||
help
|
||
The arch provides its own hardlockup detector implementation instead
|
||
of the generic ones.
|
||
|
||
It uses the same command line parameters, and sysctl interface,
|
||
as the generic hardlockup detectors.
|
||
|
||
config UNWIND_USER
|
||
bool
|
||
|
||
config HAVE_UNWIND_USER_FP
|
||
bool
|
||
select UNWIND_USER
|
||
|
||
config HAVE_PERF_REGS
|
||
bool
|
||
help
|
||
Support selective register dumps for perf events. This includes
|
||
bit-mapping of each registers and a unique architecture id.
|
||
|
||
config HAVE_PERF_USER_STACK_DUMP
|
||
bool
|
||
help
|
||
Support user stack dumps for perf event samples. This needs
|
||
access to the user stack pointer which is not unified across
|
||
architectures.
|
||
|
||
config HAVE_ARCH_JUMP_LABEL
|
||
bool
|
||
|
||
config HAVE_ARCH_JUMP_LABEL_RELATIVE
|
||
bool
|
||
|
||
config MMU_GATHER_PAGE_SIZE
|
||
bool
|
||
|
||
config MMU_GATHER_NO_RANGE
|
||
bool
|
||
select MMU_GATHER_MERGE_VMAS
|
||
|
||
config MMU_GATHER_NO_FLUSH_CACHE
|
||
bool
|
||
|
||
config MMU_GATHER_MERGE_VMAS
|
||
bool
|
||
|
||
config MMU_GATHER_NO_GATHER
|
||
bool
|
||
|
||
config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
|
||
bool
|
||
help
|
||
Temporary select until all architectures can be converted to have
|
||
irqs disabled over activate_mm. Architectures that do IPI based TLB
|
||
shootdowns should enable this.
|
||
|
||
# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
|
||
# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
|
||
# to/from kernel threads when the same mm is running on a lot of CPUs (a large
|
||
# multi-threaded application), by reducing contention on the mm refcount.
|
||
#
|
||
# This can be disabled if the architecture ensures no CPUs are using an mm as a
|
||
# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
|
||
# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
|
||
# final exit(2) TLB flush, for example.
|
||
#
|
||
# To implement this, an arch *must*:
|
||
# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
|
||
# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
|
||
# converted already).
|
||
config MMU_LAZY_TLB_REFCOUNT
|
||
def_bool y
|
||
depends on !MMU_LAZY_TLB_SHOOTDOWN
|
||
|
||
# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
|
||
# mm as a lazy tlb beyond its last reference count, by shooting down these
|
||
# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
|
||
# be using the mm as a lazy tlb, so that they may switch themselves to using
|
||
# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
|
||
# may be using mm as a lazy tlb mm.
|
||
#
|
||
# To implement this, an arch *must*:
|
||
# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
|
||
# at least all possible CPUs in which the mm is lazy.
|
||
# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
|
||
config MMU_LAZY_TLB_SHOOTDOWN
|
||
bool
|
||
|
||
config ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||
bool
|
||
|
||
config ARCH_HAVE_EXTRA_ELF_NOTES
|
||
bool
|
||
help
|
||
An architecture should select this in order to enable adding an
|
||
arch-specific ELF note section to core files. It must provide two
|
||
functions: elf_coredump_extra_notes_size() and
|
||
elf_coredump_extra_notes_write() which are invoked by the ELF core
|
||
dumper.
|
||
|
||
config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
|
||
bool
|
||
|
||
config HAVE_ALIGNED_STRUCT_PAGE
|
||
bool
|
||
help
|
||
This makes sure that struct pages are double word aligned and that
|
||
e.g. the SLUB allocator can perform double word atomic operations
|
||
on a struct page for better performance. However selecting this
|
||
might increase the size of a struct page by a word.
|
||
|
||
config HAVE_CMPXCHG_LOCAL
|
||
bool
|
||
|
||
config HAVE_CMPXCHG_DOUBLE
|
||
bool
|
||
|
||
config ARCH_WEAK_RELEASE_ACQUIRE
|
||
bool
|
||
|
||
config ARCH_WANT_IPC_PARSE_VERSION
|
||
bool
|
||
|
||
config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
|
||
bool
|
||
|
||
config ARCH_WANT_OLD_COMPAT_IPC
|
||
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
|
||
bool
|
||
|
||
config HAVE_ARCH_SECCOMP
|
||
bool
|
||
help
|
||
An arch should select this symbol to support seccomp mode 1 (the fixed
|
||
syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
|
||
and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
|
||
- __NR_seccomp_read_32
|
||
- __NR_seccomp_write_32
|
||
- __NR_seccomp_exit_32
|
||
- __NR_seccomp_sigreturn_32
|
||
|
||
config HAVE_ARCH_SECCOMP_FILTER
|
||
bool
|
||
select HAVE_ARCH_SECCOMP
|
||
help
|
||
An arch should select this symbol if it provides all of these things:
|
||
- all the requirements for HAVE_ARCH_SECCOMP
|
||
- syscall_get_arch()
|
||
- syscall_get_arguments()
|
||
- syscall_rollback()
|
||
- syscall_set_return_value()
|
||
- SIGSYS siginfo_t support
|
||
- secure_computing is called from a ptrace_event()-safe context
|
||
- secure_computing return value is checked and if false it
|
||
results in the system call being skipped immediately.
|
||
- seccomp syscall wired up
|
||
- if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
|
||
SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
|
||
COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
|
||
|
||
config SECCOMP
|
||
prompt "Enable seccomp to safely execute untrusted bytecode"
|
||
def_bool y
|
||
depends on HAVE_ARCH_SECCOMP
|
||
help
|
||
This kernel feature is useful for number crunching applications
|
||
that may need to handle untrusted bytecode during their
|
||
execution. By using pipes or other transports made available
|
||
to the process as file descriptors supporting the read/write
|
||
syscalls, it's possible to isolate those applications in their
|
||
own address space using seccomp. Once seccomp is enabled via
|
||
prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
|
||
disabled and the task is only allowed to execute a few safe
|
||
syscalls defined by each seccomp mode.
|
||
|
||
If unsure, say Y.
|
||
|
||
config SECCOMP_FILTER
|
||
def_bool y
|
||
depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
|
||
help
|
||
Enable tasks to build secure computing environments defined
|
||
in terms of Berkeley Packet Filter programs which implement
|
||
task-defined system call filtering polices.
|
||
|
||
See Documentation/userspace-api/seccomp_filter.rst for details.
|
||
|
||
config SECCOMP_CACHE_DEBUG
|
||
bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
|
||
depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
|
||
depends on PROC_FS
|
||
help
|
||
This enables the /proc/pid/seccomp_cache interface to monitor
|
||
seccomp cache data. The file format is subject to change. Reading
|
||
the file requires CAP_SYS_ADMIN.
|
||
|
||
This option is for debugging only. Enabling presents the risk that
|
||
an adversary may be able to infer the seccomp filter logic.
|
||
|
||
If unsure, say N.
|
||
|
||
config HAVE_ARCH_KSTACK_ERASE
|
||
bool
|
||
help
|
||
An architecture should select this if it has the code which
|
||
fills the used part of the kernel stack with the KSTACK_ERASE_POISON
|
||
value before returning from system calls.
|
||
|
||
config HAVE_STACKPROTECTOR
|
||
bool
|
||
help
|
||
An arch should select this symbol if:
|
||
- it has implemented a stack canary (e.g. __stack_chk_guard)
|
||
|
||
config STACKPROTECTOR
|
||
bool "Stack Protector buffer overflow detection"
|
||
depends on HAVE_STACKPROTECTOR
|
||
depends on $(cc-option,-fstack-protector)
|
||
default y
|
||
help
|
||
This option turns on the "stack-protector" GCC feature. This
|
||
feature puts, at the beginning of functions, a canary value on
|
||
the stack just before the return address, and validates
|
||
the value just before actually returning. Stack based buffer
|
||
overflows (that need to overwrite this return address) now also
|
||
overwrite the canary, which gets detected and the attack is then
|
||
neutralized via a kernel panic.
|
||
|
||
Functions will have the stack-protector canary logic added if they
|
||
have an 8-byte or larger character array on the stack.
|
||
|
||
This feature requires gcc version 4.2 or above, or a distribution
|
||
gcc with the feature backported ("-fstack-protector").
|
||
|
||
On an x86 "defconfig" build, this feature adds canary checks to
|
||
about 3% of all kernel functions, which increases kernel code size
|
||
by about 0.3%.
|
||
|
||
config STACKPROTECTOR_STRONG
|
||
bool "Strong Stack Protector"
|
||
depends on STACKPROTECTOR
|
||
depends on $(cc-option,-fstack-protector-strong)
|
||
default y
|
||
help
|
||
Functions will have the stack-protector canary logic added in any
|
||
of the following conditions:
|
||
|
||
- local variable's address used as part of the right hand side of an
|
||
assignment or function argument
|
||
- local variable is an array (or union containing an array),
|
||
regardless of array type or length
|
||
- uses register local variables
|
||
|
||
This feature requires gcc version 4.9 or above, or a distribution
|
||
gcc with the feature backported ("-fstack-protector-strong").
|
||
|
||
On an x86 "defconfig" build, this feature adds canary checks to
|
||
about 20% of all kernel functions, which increases the kernel code
|
||
size by about 2%.
|
||
|
||
config ARCH_SUPPORTS_SHADOW_CALL_STACK
|
||
bool
|
||
help
|
||
An architecture should select this if it supports the compiler's
|
||
Shadow Call Stack and implements runtime support for shadow stack
|
||
switching.
|
||
|
||
config SHADOW_CALL_STACK
|
||
bool "Shadow Call Stack"
|
||
depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
|
||
depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
|
||
depends on MMU
|
||
help
|
||
This option enables the compiler's Shadow Call Stack, which
|
||
uses a shadow stack to protect function return addresses from
|
||
being overwritten by an attacker. More information can be found
|
||
in the compiler's documentation:
|
||
|
||
- Clang: https://clang.llvm.org/docs/ShadowCallStack.html
|
||
- GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
|
||
|
||
Note that security guarantees in the kernel differ from the
|
||
ones documented for user space. The kernel must store addresses
|
||
of shadow stacks in memory, which means an attacker capable of
|
||
reading and writing arbitrary memory may be able to locate them
|
||
and hijack control flow by modifying the stacks.
|
||
|
||
config DYNAMIC_SCS
|
||
bool
|
||
help
|
||
Set by the arch code if it relies on code patching to insert the
|
||
shadow call stack push and pop instructions rather than on the
|
||
compiler.
|
||
|
||
config LTO
|
||
bool
|
||
help
|
||
Selected if the kernel will be built using the compiler's LTO feature.
|
||
|
||
config LTO_CLANG
|
||
bool
|
||
select LTO
|
||
help
|
||
Selected if the kernel will be built using Clang's LTO feature.
|
||
|
||
config ARCH_SUPPORTS_LTO_CLANG
|
||
bool
|
||
help
|
||
An architecture should select this option if it supports:
|
||
- compiling with Clang,
|
||
- compiling inline assembly with Clang's integrated assembler,
|
||
- and linking with LLD.
|
||
|
||
config ARCH_SUPPORTS_LTO_CLANG_THIN
|
||
bool
|
||
help
|
||
An architecture should select this option if it can support Clang's
|
||
ThinLTO mode.
|
||
|
||
config HAS_LTO_CLANG
|
||
def_bool y
|
||
depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
|
||
depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
|
||
depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
|
||
depends on ARCH_SUPPORTS_LTO_CLANG
|
||
depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
|
||
depends on !GCOV_KERNEL
|
||
help
|
||
The compiler and Kconfig options support building with Clang's
|
||
LTO.
|
||
|
||
choice
|
||
prompt "Link Time Optimization (LTO)"
|
||
default LTO_NONE
|
||
help
|
||
This option enables Link Time Optimization (LTO), which allows the
|
||
compiler to optimize binaries globally.
|
||
|
||
If unsure, select LTO_NONE. Note that LTO is very resource-intensive
|
||
so it's disabled by default.
|
||
|
||
config LTO_NONE
|
||
bool "None"
|
||
help
|
||
Build the kernel normally, without Link Time Optimization (LTO).
|
||
|
||
config LTO_CLANG_FULL
|
||
bool "Clang Full LTO (EXPERIMENTAL)"
|
||
depends on HAS_LTO_CLANG
|
||
depends on !COMPILE_TEST
|
||
select LTO_CLANG
|
||
help
|
||
This option enables Clang's full Link Time Optimization (LTO), which
|
||
allows the compiler to optimize the kernel globally. If you enable
|
||
this option, the compiler generates LLVM bitcode instead of ELF
|
||
object files, and the actual compilation from bitcode happens at
|
||
the LTO link step, which may take several minutes depending on the
|
||
kernel configuration. More information can be found from LLVM's
|
||
documentation:
|
||
|
||
https://llvm.org/docs/LinkTimeOptimization.html
|
||
|
||
During link time, this option can use a large amount of RAM, and
|
||
may take much longer than the ThinLTO option.
|
||
|
||
config LTO_CLANG_THIN
|
||
bool "Clang ThinLTO (EXPERIMENTAL)"
|
||
depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
|
||
select LTO_CLANG
|
||
help
|
||
This option enables Clang's ThinLTO, which allows for parallel
|
||
optimization and faster incremental compiles compared to the
|
||
CONFIG_LTO_CLANG_FULL option. More information can be found
|
||
from Clang's documentation:
|
||
|
||
https://clang.llvm.org/docs/ThinLTO.html
|
||
|
||
If unsure, say Y.
|
||
|
||
config LTO_CLANG_THIN_DIST
|
||
bool "Clang ThinLTO in distributed mode (EXPERIMENTAL)"
|
||
depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
|
||
select LTO_CLANG
|
||
help
|
||
This option enables Clang's ThinLTO in distributed build mode.
|
||
In this mode, the linker performs the thin-link, generating
|
||
ThinLTO index files. Subsequently, the build system explicitly
|
||
invokes ThinLTO backend compilation using these index files
|
||
and pre-linked IR objects. The resulting native object files
|
||
are with the .thinlto-native.o suffix.
|
||
|
||
This build mode offers improved visibility into the ThinLTO
|
||
process through explicit subcommand exposure. It also makes
|
||
final native object files directly available, benefiting
|
||
tools like objtool and kpatch. Additionally, it provides
|
||
crucial granular control over back-end options, enabling
|
||
module-specific compiler options, and simplifies debugging.
|
||
endchoice
|
||
|
||
config AUTOFDO_CLANG
|
||
bool "Enable Clang's AutoFDO build (EXPERIMENTAL)"
|
||
depends on CC_IS_CLANG
|
||
help
|
||
This option enables Clang’s AutoFDO build. When
|
||
an AutoFDO profile is specified in variable
|
||
CLANG_AUTOFDO_PROFILE during the build process,
|
||
Clang uses the profile to optimize the kernel.
|
||
|
||
If no profile is specified, AutoFDO options are
|
||
still passed to Clang to facilitate the collection
|
||
of perf data for creating an AutoFDO profile in
|
||
subsequent builds.
|
||
|
||
If unsure, say N.
|
||
|
||
config PROPELLER_CLANG
|
||
bool "Enable Clang's Propeller build"
|
||
depends on CC_IS_CLANG && CLANG_VERSION >= 190000
|
||
depends on $(cc-option,-fbasic-block-sections=list=/dev/null)
|
||
help
|
||
This option enables Clang’s Propeller build. When the Propeller
|
||
profiles is specified in variable CLANG_PROPELLER_PROFILE_PREFIX
|
||
during the build process, Clang uses the profiles to optimize
|
||
the kernel.
|
||
|
||
If no profile is specified, Propeller options are still passed
|
||
to Clang to facilitate the collection of perf data for creating
|
||
the Propeller profiles in subsequent builds.
|
||
|
||
If unsure, say N.
|
||
|
||
config ARCH_SUPPORTS_CFI
|
||
bool
|
||
help
|
||
An architecture should select this option if it can support Kernel
|
||
Control-Flow Integrity (CFI) checking (-fsanitize=kcfi).
|
||
|
||
config ARCH_USES_CFI_TRAPS
|
||
bool
|
||
help
|
||
An architecture should select this option if it requires the
|
||
.kcfi_traps section for KCFI trap handling.
|
||
|
||
config ARCH_USES_CFI_GENERIC_LLVM_PASS
|
||
bool
|
||
help
|
||
An architecture should select this option if it uses the generic
|
||
KCFIPass in LLVM to expand kCFI bundles instead of architecture-specific
|
||
lowering.
|
||
|
||
config CFI
|
||
bool "Use Kernel Control Flow Integrity (kCFI)"
|
||
default CFI_CLANG
|
||
depends on ARCH_SUPPORTS_CFI
|
||
depends on $(cc-option,-fsanitize=kcfi)
|
||
help
|
||
This option enables forward-edge Control Flow Integrity (CFI)
|
||
checking, where the compiler injects a runtime check to each
|
||
indirect function call to ensure the target is a valid function with
|
||
the correct static type. This restricts possible call targets and
|
||
makes it more difficult for an attacker to exploit bugs that allow
|
||
the modification of stored function pointers. More information can be
|
||
found from Clang's documentation:
|
||
|
||
https://clang.llvm.org/docs/ControlFlowIntegrity.html
|
||
|
||
config CFI_CLANG
|
||
bool
|
||
transitional
|
||
help
|
||
Transitional config for CFI_CLANG to CFI migration.
|
||
|
||
config CFI_ICALL_NORMALIZE_INTEGERS
|
||
bool "Normalize CFI tags for integers"
|
||
depends on CFI
|
||
depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
|
||
help
|
||
This option normalizes the CFI tags for integer types so that all
|
||
integer types of the same size and signedness receive the same CFI
|
||
tag.
|
||
|
||
The option is separate from CONFIG_RUST because it affects the ABI.
|
||
When working with build systems that care about the ABI, it is
|
||
convenient to be able to turn on this flag first, before Rust is
|
||
turned on.
|
||
|
||
This option is necessary for using CFI with Rust. If unsure, say N.
|
||
|
||
config HAVE_CFI_ICALL_NORMALIZE_INTEGERS
|
||
def_bool y
|
||
depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
|
||
# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
|
||
depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
|
||
|
||
config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
|
||
def_bool y
|
||
depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
|
||
depends on ARM64 || X86_64
|
||
# With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
|
||
depends on RUSTC_LLVM_VERSION >= 190103 || \
|
||
(!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
|
||
|
||
config CFI_PERMISSIVE
|
||
bool "Use CFI in permissive mode"
|
||
depends on CFI
|
||
help
|
||
When selected, Control Flow Integrity (CFI) violations result in a
|
||
warning instead of a kernel panic. This option should only be used
|
||
for finding indirect call type mismatches during development.
|
||
|
||
If unsure, say N.
|
||
|
||
config HAVE_ARCH_WITHIN_STACK_FRAMES
|
||
bool
|
||
help
|
||
An architecture should select this if it can walk the kernel stack
|
||
frames to determine if an object is part of either the arguments
|
||
or local variables (i.e. that it excludes saved return addresses,
|
||
and similar) by implementing an inline arch_within_stack_frames(),
|
||
which is used by CONFIG_HARDENED_USERCOPY.
|
||
|
||
config HAVE_CONTEXT_TRACKING_USER
|
||
bool
|
||
help
|
||
Provide kernel/user boundaries probes necessary for subsystems
|
||
that need it, such as userspace RCU extended quiescent state.
|
||
Syscalls need to be wrapped inside user_exit()-user_enter(), either
|
||
optimized behind static key or through the slow path using TIF_NOHZ
|
||
flag. Exceptions handlers must be wrapped as well. Irqs are already
|
||
protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
|
||
handling on irq exit still need to be protected.
|
||
|
||
config HAVE_CONTEXT_TRACKING_USER_OFFSTACK
|
||
bool
|
||
help
|
||
Architecture neither relies on exception_enter()/exception_exit()
|
||
nor on schedule_user(). Also preempt_schedule_notrace() and
|
||
preempt_schedule_irq() can't be called in a preemptible section
|
||
while context tracking is CT_STATE_USER. This feature reflects a sane
|
||
entry implementation where the following requirements are met on
|
||
critical entry code, ie: before user_exit() or after user_enter():
|
||
|
||
- Critical entry code isn't preemptible (or better yet:
|
||
not interruptible).
|
||
- No use of RCU read side critical sections, unless ct_nmi_enter()
|
||
got called.
|
||
- No use of instrumentation, unless instrumentation_begin() got
|
||
called.
|
||
|
||
config HAVE_TIF_NOHZ
|
||
bool
|
||
help
|
||
Arch relies on TIF_NOHZ and syscall slow path to implement context
|
||
tracking calls to user_enter()/user_exit().
|
||
|
||
config HAVE_VIRT_CPU_ACCOUNTING
|
||
bool
|
||
|
||
config HAVE_VIRT_CPU_ACCOUNTING_IDLE
|
||
bool
|
||
help
|
||
Architecture has its own way to account idle CPU time and therefore
|
||
doesn't implement vtime_account_idle().
|
||
|
||
config ARCH_HAS_SCALED_CPUTIME
|
||
bool
|
||
|
||
config HAVE_VIRT_CPU_ACCOUNTING_GEN
|
||
bool
|
||
default y if 64BIT
|
||
help
|
||
With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
|
||
Before enabling this option, arch code must be audited
|
||
to ensure there are no races in concurrent read/write of
|
||
cputime_t. For example, reading/writing 64-bit cputime_t on
|
||
some 32-bit arches may require multiple accesses, so proper
|
||
locking is needed to protect against concurrent accesses.
|
||
|
||
config HAVE_IRQ_TIME_ACCOUNTING
|
||
bool
|
||
help
|
||
Archs need to ensure they use a high enough resolution clock to
|
||
support irq time accounting and then call enable_sched_clock_irqtime().
|
||
|
||
config HAVE_PV_STEAL_CLOCK_GEN
|
||
bool
|
||
|
||
config HAVE_MOVE_PUD
|
||
bool
|
||
help
|
||
Architectures that select this are able to move page tables at the
|
||
PUD level. If there are only 3 page table levels, the move effectively
|
||
happens at the PGD level.
|
||
|
||
config HAVE_MOVE_PMD
|
||
bool
|
||
help
|
||
Archs that select this are able to move page tables at the PMD level.
|
||
|
||
config HAVE_ARCH_TRANSPARENT_HUGEPAGE
|
||
bool
|
||
|
||
config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
|
||
bool
|
||
|
||
config HAVE_ARCH_HUGE_VMAP
|
||
bool
|
||
|
||
#
|
||
# Archs that select this would be capable of PMD-sized vmaps (i.e.,
|
||
# arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
|
||
# must be used to enable allocations to use hugepages.
|
||
#
|
||
config HAVE_ARCH_HUGE_VMALLOC
|
||
depends on HAVE_ARCH_HUGE_VMAP
|
||
bool
|
||
|
||
config ARCH_WANT_HUGE_PMD_SHARE
|
||
bool
|
||
|
||
# Archs that want to use pmd_mkwrite on kernel memory need it defined even
|
||
# if there are no userspace memory management features that use it
|
||
config ARCH_WANT_KERNEL_PMD_MKWRITE
|
||
bool
|
||
|
||
config ARCH_WANT_PMD_MKWRITE
|
||
def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
|
||
|
||
config HAVE_ARCH_SOFT_DIRTY
|
||
bool
|
||
|
||
config HAVE_MOD_ARCH_SPECIFIC
|
||
bool
|
||
help
|
||
The arch uses struct mod_arch_specific to store data. Many arches
|
||
just need a simple module loader without arch specific data - those
|
||
should not enable this.
|
||
|
||
config MODULES_USE_ELF_RELA
|
||
bool
|
||
help
|
||
Modules only use ELF RELA relocations. Modules with ELF REL
|
||
relocations will give an error.
|
||
|
||
config MODULES_USE_ELF_REL
|
||
bool
|
||
help
|
||
Modules only use ELF REL relocations. Modules with ELF RELA
|
||
relocations will give an error.
|
||
|
||
config ARCH_WANTS_MODULES_DATA_IN_VMALLOC
|
||
bool
|
||
help
|
||
For architectures like powerpc/32 which have constraints on module
|
||
allocation and need to allocate module data outside of module area.
|
||
|
||
config ARCH_WANTS_MODULES_TEXT_SECTIONS
|
||
bool
|
||
help
|
||
For architectures like 32-bit parisc which require that functions in
|
||
modules have to keep code in own text sections (-ffunction-sections)
|
||
and to avoid merging all text into one big text section,
|
||
|
||
config ARCH_WANTS_EXECMEM_LATE
|
||
bool
|
||
help
|
||
For architectures that do not allocate executable memory early on
|
||
boot, but rather require its initialization late when there is
|
||
enough entropy for module space randomization, for instance
|
||
arm64.
|
||
|
||
config ARCH_HAS_EXECMEM_ROX
|
||
bool
|
||
depends on MMU && !HIGHMEM
|
||
help
|
||
For architectures that support allocations of executable memory
|
||
with read-only execute permissions. Architecture must implement
|
||
execmem_fill_trapping_insns() callback to enable this.
|
||
|
||
config HAVE_IRQ_EXIT_ON_IRQ_STACK
|
||
bool
|
||
help
|
||
Architecture doesn't only execute the irq handler on the irq stack
|
||
but also irq_exit(). This way we can process softirqs on this irq
|
||
stack instead of switching to a new one when we call __do_softirq()
|
||
in the end of an hardirq.
|
||
This spares a stack switch and improves cache usage on softirq
|
||
processing.
|
||
|
||
config HAVE_SOFTIRQ_ON_OWN_STACK
|
||
bool
|
||
help
|
||
Architecture provides a function to run __do_softirq() on a
|
||
separate stack.
|
||
|
||
config SOFTIRQ_ON_OWN_STACK
|
||
def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
|
||
|
||
config ALTERNATE_USER_ADDRESS_SPACE
|
||
bool
|
||
help
|
||
Architectures set this when the CPU uses separate address
|
||
spaces for kernel and user space pointers. In this case, the
|
||
access_ok() check on a __user pointer is skipped.
|
||
|
||
config PGTABLE_LEVELS
|
||
int
|
||
default 2
|
||
|
||
config ARCH_HAS_ELF_RANDOMIZE
|
||
bool
|
||
help
|
||
An architecture supports choosing randomized locations for
|
||
stack, mmap, brk, and ET_DYN. Defined functions:
|
||
- arch_mmap_rnd()
|
||
- arch_randomize_brk()
|
||
|
||
config HAVE_ARCH_MMAP_RND_BITS
|
||
bool
|
||
help
|
||
An arch should select this symbol if it supports setting a variable
|
||
number of bits for use in establishing the base address for mmap
|
||
allocations, has MMU enabled and provides values for both:
|
||
- ARCH_MMAP_RND_BITS_MIN
|
||
- ARCH_MMAP_RND_BITS_MAX
|
||
|
||
config HAVE_EXIT_THREAD
|
||
bool
|
||
help
|
||
An architecture implements exit_thread.
|
||
|
||
config ARCH_MMAP_RND_BITS_MIN
|
||
int
|
||
|
||
config ARCH_MMAP_RND_BITS_MAX
|
||
int
|
||
|
||
config ARCH_MMAP_RND_BITS_DEFAULT
|
||
int
|
||
|
||
config ARCH_MMAP_RND_BITS
|
||
int "Number of bits to use for ASLR of mmap base address" if EXPERT
|
||
range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
|
||
default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
|
||
default ARCH_MMAP_RND_BITS_MIN
|
||
depends on HAVE_ARCH_MMAP_RND_BITS
|
||
help
|
||
This value can be used to select the number of bits to use to
|
||
determine the random offset to the base address of vma regions
|
||
resulting from mmap allocations. This value will be bounded
|
||
by the architecture's minimum and maximum supported values.
|
||
|
||
This value can be changed after boot using the
|
||
/proc/sys/vm/mmap_rnd_bits tunable
|
||
|
||
config HAVE_ARCH_MMAP_RND_COMPAT_BITS
|
||
bool
|
||
help
|
||
An arch should select this symbol if it supports running applications
|
||
in compatibility mode, supports setting a variable number of bits for
|
||
use in establishing the base address for mmap allocations, has MMU
|
||
enabled and provides values for both:
|
||
- ARCH_MMAP_RND_COMPAT_BITS_MIN
|
||
- ARCH_MMAP_RND_COMPAT_BITS_MAX
|
||
|
||
config ARCH_MMAP_RND_COMPAT_BITS_MIN
|
||
int
|
||
|
||
config ARCH_MMAP_RND_COMPAT_BITS_MAX
|
||
int
|
||
|
||
config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
|
||
int
|
||
|
||
config ARCH_MMAP_RND_COMPAT_BITS
|
||
int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
|
||
range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
|
||
default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
|
||
default ARCH_MMAP_RND_COMPAT_BITS_MIN
|
||
depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
|
||
help
|
||
This value can be used to select the number of bits to use to
|
||
determine the random offset to the base address of vma regions
|
||
resulting from mmap allocations for compatible applications This
|
||
value will be bounded by the architecture's minimum and maximum
|
||
supported values.
|
||
|
||
This value can be changed after boot using the
|
||
/proc/sys/vm/mmap_rnd_compat_bits tunable
|
||
|
||
config HAVE_ARCH_COMPAT_MMAP_BASES
|
||
bool
|
||
help
|
||
This allows 64bit applications to invoke 32-bit mmap() syscall
|
||
and vice-versa 32-bit applications to call 64-bit mmap().
|
||
Required for applications doing different bitness syscalls.
|
||
|
||
config HAVE_PAGE_SIZE_4KB
|
||
bool
|
||
|
||
config HAVE_PAGE_SIZE_8KB
|
||
bool
|
||
|
||
config HAVE_PAGE_SIZE_16KB
|
||
bool
|
||
|
||
config HAVE_PAGE_SIZE_32KB
|
||
bool
|
||
|
||
config HAVE_PAGE_SIZE_64KB
|
||
bool
|
||
|
||
config HAVE_PAGE_SIZE_256KB
|
||
bool
|
||
|
||
choice
|
||
prompt "MMU page size"
|
||
|
||
config PAGE_SIZE_4KB
|
||
bool "4KiB pages"
|
||
depends on HAVE_PAGE_SIZE_4KB
|
||
help
|
||
This option select the standard 4KiB Linux page size and the only
|
||
available option on many architectures. Using 4KiB page size will
|
||
minimize memory consumption and is therefore recommended for low
|
||
memory systems.
|
||
Some software that is written for x86 systems makes incorrect
|
||
assumptions about the page size and only runs on 4KiB pages.
|
||
|
||
config PAGE_SIZE_8KB
|
||
bool "8KiB pages"
|
||
depends on HAVE_PAGE_SIZE_8KB
|
||
help
|
||
This option is the only supported page size on a few older
|
||
processors, and can be slightly faster than 4KiB pages.
|
||
|
||
config PAGE_SIZE_16KB
|
||
bool "16KiB pages"
|
||
depends on HAVE_PAGE_SIZE_16KB
|
||
help
|
||
This option is usually a good compromise between memory
|
||
consumption and performance for typical desktop and server
|
||
workloads, often saving a level of page table lookups compared
|
||
to 4KB pages as well as reducing TLB pressure and overhead of
|
||
per-page operations in the kernel at the expense of a larger
|
||
page cache.
|
||
|
||
config PAGE_SIZE_32KB
|
||
bool "32KiB pages"
|
||
depends on HAVE_PAGE_SIZE_32KB
|
||
help
|
||
Using 32KiB page size will result in slightly higher performance
|
||
kernel at the price of higher memory consumption compared to
|
||
16KiB pages. This option is available only on cnMIPS cores.
|
||
Note that you will need a suitable Linux distribution to
|
||
support this.
|
||
|
||
config PAGE_SIZE_64KB
|
||
bool "64KiB pages"
|
||
depends on HAVE_PAGE_SIZE_64KB
|
||
help
|
||
Using 64KiB page size will result in slightly higher performance
|
||
kernel at the price of much higher memory consumption compared to
|
||
4KiB or 16KiB pages.
|
||
This is not suitable for general-purpose workloads but the
|
||
better performance may be worth the cost for certain types of
|
||
supercomputing or database applications that work mostly with
|
||
large in-memory data rather than small files.
|
||
|
||
config PAGE_SIZE_256KB
|
||
bool "256KiB pages"
|
||
depends on HAVE_PAGE_SIZE_256KB
|
||
help
|
||
256KiB pages have little practical value due to their extreme
|
||
memory usage. The kernel will only be able to run applications
|
||
that have been compiled with '-zmax-page-size' set to 256KiB
|
||
(the default is 64KiB or 4KiB on most architectures).
|
||
|
||
endchoice
|
||
|
||
config PAGE_SIZE_LESS_THAN_64KB
|
||
def_bool y
|
||
depends on !PAGE_SIZE_64KB
|
||
depends on PAGE_SIZE_LESS_THAN_256KB
|
||
|
||
config PAGE_SIZE_LESS_THAN_256KB
|
||
def_bool y
|
||
depends on !PAGE_SIZE_256KB
|
||
|
||
config PAGE_SHIFT
|
||
int
|
||
default 12 if PAGE_SIZE_4KB
|
||
default 13 if PAGE_SIZE_8KB
|
||
default 14 if PAGE_SIZE_16KB
|
||
default 15 if PAGE_SIZE_32KB
|
||
default 16 if PAGE_SIZE_64KB
|
||
default 18 if PAGE_SIZE_256KB
|
||
|
||
# This allows to use a set of generic functions to determine mmap base
|
||
# address by giving priority to top-down scheme only if the process
|
||
# is not in legacy mode (compat task, unlimited stack size or
|
||
# sysctl_legacy_va_layout).
|
||
# Architecture that selects this option can provide its own version of:
|
||
# - STACK_RND_MASK
|
||
config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
|
||
bool
|
||
depends on MMU
|
||
select ARCH_HAS_ELF_RANDOMIZE
|
||
|
||
config HAVE_OBJTOOL
|
||
bool
|
||
|
||
config HAVE_JUMP_LABEL_HACK
|
||
bool
|
||
|
||
config HAVE_NOINSTR_HACK
|
||
bool
|
||
|
||
config HAVE_NOINSTR_VALIDATION
|
||
bool
|
||
|
||
config HAVE_UACCESS_VALIDATION
|
||
bool
|
||
select OBJTOOL
|
||
|
||
config HAVE_STACK_VALIDATION
|
||
bool
|
||
help
|
||
Architecture supports objtool compile-time frame pointer rule
|
||
validation.
|
||
|
||
config HAVE_RELIABLE_STACKTRACE
|
||
bool
|
||
help
|
||
Architecture has either save_stack_trace_tsk_reliable() or
|
||
arch_stack_walk_reliable() function which only returns a stack trace
|
||
if it can guarantee the trace is reliable.
|
||
|
||
config HAVE_ARCH_HASH
|
||
bool
|
||
default n
|
||
help
|
||
If this is set, the architecture provides an <asm/hash.h>
|
||
file which provides platform-specific implementations of some
|
||
functions in <linux/hash.h> or fs/namei.c.
|
||
|
||
config HAVE_ARCH_NVRAM_OPS
|
||
bool
|
||
|
||
config ISA_BUS_API
|
||
def_bool ISA
|
||
|
||
#
|
||
# ABI hall of shame
|
||
#
|
||
config CLONE_BACKWARDS
|
||
bool
|
||
help
|
||
Architecture has tls passed as the 4th argument of clone(2),
|
||
not the 5th one.
|
||
|
||
config CLONE_BACKWARDS2
|
||
bool
|
||
help
|
||
Architecture has the first two arguments of clone(2) swapped.
|
||
|
||
config CLONE_BACKWARDS3
|
||
bool
|
||
help
|
||
Architecture has tls passed as the 3rd argument of clone(2),
|
||
not the 5th one.
|
||
|
||
config ODD_RT_SIGACTION
|
||
bool
|
||
help
|
||
Architecture has unusual rt_sigaction(2) arguments
|
||
|
||
config OLD_SIGSUSPEND
|
||
bool
|
||
help
|
||
Architecture has old sigsuspend(2) syscall, of one-argument variety
|
||
|
||
config OLD_SIGSUSPEND3
|
||
bool
|
||
help
|
||
Even weirder antique ABI - three-argument sigsuspend(2)
|
||
|
||
config OLD_SIGACTION
|
||
bool
|
||
help
|
||
Architecture has old sigaction(2) syscall. Nope, not the same
|
||
as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
|
||
but fairly different variant of sigaction(2), thanks to OSF/1
|
||
compatibility...
|
||
|
||
config COMPAT_OLD_SIGACTION
|
||
bool
|
||
|
||
config COMPAT_32BIT_TIME
|
||
bool "Provide system calls for 32-bit time_t"
|
||
default !64BIT || COMPAT
|
||
help
|
||
This enables 32 bit time_t support in addition to 64 bit time_t support.
|
||
This is relevant on all 32-bit architectures, and 64-bit architectures
|
||
as part of compat syscall handling.
|
||
|
||
config ARCH_NO_PREEMPT
|
||
bool
|
||
|
||
config ARCH_SUPPORTS_RT
|
||
bool
|
||
|
||
config CPU_NO_EFFICIENT_FFS
|
||
def_bool n
|
||
|
||
config HAVE_ARCH_VMAP_STACK
|
||
def_bool n
|
||
help
|
||
An arch should select this symbol if it can support kernel stacks
|
||
in vmalloc space. This means:
|
||
|
||
- vmalloc space must be large enough to hold many kernel stacks.
|
||
This may rule out many 32-bit architectures.
|
||
|
||
- Stacks in vmalloc space need to work reliably. For example, if
|
||
vmap page tables are created on demand, either this mechanism
|
||
needs to work while the stack points to a virtual address with
|
||
unpopulated page tables or arch code (switch_to() and switch_mm(),
|
||
most likely) needs to ensure that the stack's page table entries
|
||
are populated before running on a possibly unpopulated stack.
|
||
|
||
- If the stack overflows into a guard page, something reasonable
|
||
should happen. The definition of "reasonable" is flexible, but
|
||
instantly rebooting without logging anything would be unfriendly.
|
||
|
||
config VMAP_STACK
|
||
default y
|
||
bool "Use a virtually-mapped stack"
|
||
depends on HAVE_ARCH_VMAP_STACK
|
||
depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
|
||
help
|
||
Enable this if you want the use virtually-mapped kernel stacks
|
||
with guard pages. This causes kernel stack overflows to be
|
||
caught immediately rather than causing difficult-to-diagnose
|
||
corruption.
|
||
|
||
To use this with software KASAN modes, the architecture must support
|
||
backing virtual mappings with real shadow memory, and KASAN_VMALLOC
|
||
must be enabled.
|
||
|
||
config HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
|
||
def_bool n
|
||
help
|
||
An arch should select this symbol if it can support kernel stack
|
||
offset randomization with a call to add_random_kstack_offset()
|
||
during syscall entry. Careful removal of -fstack-protector-strong and
|
||
-fstack-protector should also be applied to the entry code and
|
||
closely examined, as the artificial stack bump looks like an array
|
||
to the compiler, so it will attempt to add canary checks regardless
|
||
of the static branch state.
|
||
|
||
config RANDOMIZE_KSTACK_OFFSET
|
||
bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
|
||
default y
|
||
depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
|
||
help
|
||
The kernel stack offset can be randomized (after pt_regs) by
|
||
roughly 5 bits of entropy, frustrating memory corruption
|
||
attacks that depend on stack address determinism or
|
||
cross-syscall address exposures.
|
||
|
||
The feature is controlled via the "randomize_kstack_offset=on/off"
|
||
kernel boot param, and if turned off has zero overhead due to its use
|
||
of static branches (see JUMP_LABEL).
|
||
|
||
If unsure, say Y.
|
||
|
||
config RANDOMIZE_KSTACK_OFFSET_DEFAULT
|
||
bool "Default state of kernel stack offset randomization"
|
||
depends on RANDOMIZE_KSTACK_OFFSET
|
||
help
|
||
Kernel stack offset randomization is controlled by kernel boot param
|
||
"randomize_kstack_offset=on/off", and this config chooses the default
|
||
boot state.
|
||
|
||
config ARCH_OPTIONAL_KERNEL_RWX
|
||
def_bool n
|
||
|
||
config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
|
||
def_bool n
|
||
|
||
config ARCH_HAS_STRICT_KERNEL_RWX
|
||
def_bool n
|
||
|
||
config STRICT_KERNEL_RWX
|
||
bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
|
||
depends on ARCH_HAS_STRICT_KERNEL_RWX
|
||
default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
|
||
help
|
||
If this is set, kernel text and rodata memory will be made read-only,
|
||
and non-text memory will be made non-executable. This provides
|
||
protection against certain security exploits (e.g. executing the heap
|
||
or modifying text)
|
||
|
||
These features are considered standard security practice these days.
|
||
You should say Y here in almost all cases.
|
||
|
||
config ARCH_HAS_STRICT_MODULE_RWX
|
||
def_bool n
|
||
|
||
config STRICT_MODULE_RWX
|
||
bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
|
||
depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
|
||
default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
|
||
help
|
||
If this is set, module text and rodata memory will be made read-only,
|
||
and non-text memory will be made non-executable. This provides
|
||
protection against certain security exploits (e.g. writing to text)
|
||
|
||
# select if the architecture provides an asm/dma-direct.h header
|
||
config ARCH_HAS_PHYS_TO_DMA
|
||
bool
|
||
|
||
config ARCH_HAS_CPU_RESCTRL
|
||
bool
|
||
help
|
||
An architecture selects this option to indicate that the necessary
|
||
hooks are provided to support the common memory system usage
|
||
monitoring and control interfaces provided by the 'resctrl'
|
||
filesystem (see RESCTRL_FS).
|
||
|
||
config HAVE_ARCH_COMPILER_H
|
||
bool
|
||
help
|
||
An architecture can select this if it provides an
|
||
asm/compiler.h header that should be included after
|
||
linux/compiler-*.h in order to override macro definitions that those
|
||
headers generally provide.
|
||
|
||
config HAVE_ARCH_LIBGCC_H
|
||
bool
|
||
help
|
||
An architecture can select this if it provides an
|
||
asm/libgcc.h header that should be included after
|
||
linux/libgcc.h in order to override macro definitions that
|
||
header generally provides.
|
||
|
||
config HAVE_ARCH_PREL32_RELOCATIONS
|
||
bool
|
||
help
|
||
May be selected by an architecture if it supports place-relative
|
||
32-bit relocations, both in the toolchain and in the module loader,
|
||
in which case relative references can be used in special sections
|
||
for PCI fixup, initcalls etc which are only half the size on 64 bit
|
||
architectures, and don't require runtime relocation on relocatable
|
||
kernels.
|
||
|
||
config ARCH_USE_MEMREMAP_PROT
|
||
bool
|
||
|
||
config LOCK_EVENT_COUNTS
|
||
bool "Locking event counts collection"
|
||
depends on DEBUG_FS
|
||
help
|
||
Enable light-weight counting of various locking related events
|
||
in the system with minimal performance impact. This reduces
|
||
the chance of application behavior change because of timing
|
||
differences. The counts are reported via debugfs.
|
||
|
||
# Select if the architecture has support for applying RELR relocations.
|
||
config ARCH_HAS_RELR
|
||
bool
|
||
|
||
config RELR
|
||
bool "Use RELR relocation packing"
|
||
depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
|
||
default y
|
||
help
|
||
Store the kernel's dynamic relocations in the RELR relocation packing
|
||
format. Requires a compatible linker (LLD supports this feature), as
|
||
well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
|
||
are compatible).
|
||
|
||
config ARCH_HAS_MEM_ENCRYPT
|
||
bool
|
||
|
||
config ARCH_HAS_CC_PLATFORM
|
||
bool
|
||
|
||
config HAVE_SPARSE_SYSCALL_NR
|
||
bool
|
||
help
|
||
An architecture should select this if its syscall numbering is sparse
|
||
to save space. For example, MIPS architecture has a syscall array with
|
||
entries at 4000, 5000 and 6000 locations. This option turns on syscall
|
||
related optimizations for a given architecture.
|
||
|
||
config ARCH_HAS_VDSO_ARCH_DATA
|
||
bool
|
||
|
||
config ARCH_HAS_VDSO_TIME_DATA
|
||
bool
|
||
|
||
config HAVE_STATIC_CALL
|
||
bool
|
||
|
||
config HAVE_STATIC_CALL_INLINE
|
||
bool
|
||
depends on HAVE_STATIC_CALL
|
||
select OBJTOOL
|
||
|
||
config ARCH_WANT_LD_ORPHAN_WARN
|
||
bool
|
||
help
|
||
An arch should select this symbol once all linker sections are explicitly
|
||
included, size-asserted, or discarded in the linker scripts. This is
|
||
important because we never want expected sections to be placed heuristically
|
||
by the linker, since the locations of such sections can change between linker
|
||
versions.
|
||
|
||
config HAVE_ARCH_PFN_VALID
|
||
bool
|
||
|
||
config ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
||
bool
|
||
|
||
config ARCH_SUPPORTS_PAGE_TABLE_CHECK
|
||
bool
|
||
|
||
config ARCH_SPLIT_ARG64
|
||
bool
|
||
help
|
||
If a 32-bit architecture requires 64-bit arguments to be split into
|
||
pairs of 32-bit arguments, select this option.
|
||
|
||
config ARCH_HAS_ELFCORE_COMPAT
|
||
bool
|
||
|
||
config ARCH_HAS_PARANOID_L1D_FLUSH
|
||
bool
|
||
|
||
config ARCH_HAVE_TRACE_MMIO_ACCESS
|
||
bool
|
||
|
||
config DYNAMIC_SIGFRAME
|
||
bool
|
||
|
||
# Select, if arch has a named attribute group bound to NUMA device nodes.
|
||
config HAVE_ARCH_NODE_DEV_GROUP
|
||
bool
|
||
|
||
config ARCH_HAS_HW_PTE_YOUNG
|
||
bool
|
||
help
|
||
Architectures that select this option are capable of setting the
|
||
accessed bit in PTE entries when using them as part of linear address
|
||
translations. Architectures that require runtime check should select
|
||
this option and override arch_has_hw_pte_young().
|
||
|
||
config ARCH_HAS_NONLEAF_PMD_YOUNG
|
||
bool
|
||
help
|
||
Architectures that select this option are capable of setting the
|
||
accessed bit in non-leaf PMD entries when using them as part of linear
|
||
address translations. Page table walkers that clear the accessed bit
|
||
may use this capability to reduce their search space.
|
||
|
||
config ARCH_HAS_KERNEL_FPU_SUPPORT
|
||
bool
|
||
help
|
||
Architectures that select this option can run floating-point code in
|
||
the kernel, as described in Documentation/core-api/floating-point.rst.
|
||
|
||
config ARCH_VMLINUX_NEEDS_RELOCS
|
||
bool
|
||
help
|
||
Whether the architecture needs vmlinux to be built with static
|
||
relocations preserved. This is used by some architectures to
|
||
construct bespoke relocation tables for KASLR.
|
||
|
||
# Select if architecture uses the common generic TIF bits
|
||
config HAVE_GENERIC_TIF_BITS
|
||
bool
|
||
|
||
source "kernel/gcov/Kconfig"
|
||
|
||
source "scripts/gcc-plugins/Kconfig"
|
||
|
||
config FUNCTION_ALIGNMENT_4B
|
||
bool
|
||
|
||
config FUNCTION_ALIGNMENT_8B
|
||
bool
|
||
|
||
config FUNCTION_ALIGNMENT_16B
|
||
bool
|
||
|
||
config FUNCTION_ALIGNMENT_32B
|
||
bool
|
||
|
||
config FUNCTION_ALIGNMENT_64B
|
||
bool
|
||
|
||
config FUNCTION_ALIGNMENT
|
||
int
|
||
default 64 if FUNCTION_ALIGNMENT_64B
|
||
default 32 if FUNCTION_ALIGNMENT_32B
|
||
default 16 if FUNCTION_ALIGNMENT_16B
|
||
default 8 if FUNCTION_ALIGNMENT_8B
|
||
default 4 if FUNCTION_ALIGNMENT_4B
|
||
default 0
|
||
|
||
config CC_HAS_MIN_FUNCTION_ALIGNMENT
|
||
# Detect availability of the GCC option -fmin-function-alignment which
|
||
# guarantees minimal alignment for all functions, unlike
|
||
# -falign-functions which the compiler ignores for cold functions.
|
||
def_bool $(cc-option, -fmin-function-alignment=8)
|
||
|
||
config CC_HAS_SANE_FUNCTION_ALIGNMENT
|
||
# Set if the guaranteed alignment with -fmin-function-alignment is
|
||
# available or extra care is required in the kernel. Clang provides
|
||
# strict alignment always, even with -falign-functions.
|
||
def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
|
||
|
||
config ARCH_NEED_CMPXCHG_1_EMU
|
||
bool
|
||
|
||
config ARCH_WANTS_PRE_LINK_VMLINUX
|
||
bool
|
||
help
|
||
An architecture can select this if it provides arch/<arch>/tools/Makefile
|
||
with .arch.vmlinux.o target to be linked into vmlinux.
|
||
|
||
config ARCH_HAS_CPU_ATTACK_VECTORS
|
||
bool
|
||
|
||
config HAVE_ARCH_GET_SECUREBOOT
|
||
def_bool EFI
|
||
|
||
endmenu
|