mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 13:58:46 +00:00
Merge branch 'fixes-rc1' into fixes
This commit is contained in:
commit
85ebe5aeef
10
.gitignore
vendored
10
.gitignore
vendored
@ -48,22 +48,22 @@
|
||||
*.xz
|
||||
*.zst
|
||||
Module.symvers
|
||||
modules.builtin
|
||||
modules.order
|
||||
|
||||
#
|
||||
# Top-level generic files
|
||||
#
|
||||
/tags
|
||||
/TAGS
|
||||
/linux
|
||||
/modules-only.symvers
|
||||
/vmlinux
|
||||
/vmlinux.32
|
||||
/vmlinux.map
|
||||
/vmlinux.symvers
|
||||
/vmlinux-gdb.py
|
||||
/vmlinuz
|
||||
/System.map
|
||||
/Module.markers
|
||||
/modules.builtin
|
||||
/modules.builtin.modinfo
|
||||
/modules.nsdeps
|
||||
|
||||
@ -112,6 +112,10 @@ patches-*
|
||||
patches
|
||||
series
|
||||
|
||||
# ctags files
|
||||
tags
|
||||
TAGS
|
||||
|
||||
# cscope files
|
||||
cscope.*
|
||||
ncscope.*
|
||||
|
17
.mailmap
17
.mailmap
@ -25,8 +25,9 @@ Alexandre Belloni <alexandre.belloni@bootlin.com> <alexandre.belloni@free-electr
|
||||
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
|
||||
Alex Shi <alex.shi@linux.alibaba.com> <alex.shi@intel.com>
|
||||
Alex Shi <alex.shi@linux.alibaba.com> <alex.shi@linaro.org>
|
||||
Alex Shi <alexs@kernel.org> <alex.shi@intel.com>
|
||||
Alex Shi <alexs@kernel.org> <alex.shi@linaro.org>
|
||||
Alex Shi <alexs@kernel.org> <alex.shi@linux.alibaba.com>
|
||||
Al Viro <viro@ftp.linux.org.uk>
|
||||
Al Viro <viro@zenIV.linux.org.uk>
|
||||
Andi Kleen <ak@linux.intel.com> <ak@suse.de>
|
||||
@ -36,6 +37,7 @@ Andrew Morton <akpm@linux-foundation.org>
|
||||
Andrew Murray <amurray@thegoodpenguin.co.uk> <amurray@embedded-bits.co.uk>
|
||||
Andrew Murray <amurray@thegoodpenguin.co.uk> <andrew.murray@arm.com>
|
||||
Andrew Vasquez <andrew.vasquez@qlogic.com>
|
||||
Andrey Konovalov <andreyknvl@gmail.com> <andreyknvl@google.com>
|
||||
Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com>
|
||||
Andrey Ryabinin <ryabinin.a.a@gmail.com> <aryabinin@virtuozzo.com>
|
||||
Andy Adamson <andros@citi.umich.edu>
|
||||
@ -65,6 +67,8 @@ Changbin Du <changbin.du@intel.com> <changbin.du@gmail.com>
|
||||
Changbin Du <changbin.du@intel.com> <changbin.du@intel.com>
|
||||
Chao Yu <chao@kernel.org> <chao2.yu@samsung.com>
|
||||
Chao Yu <chao@kernel.org> <yuchao0@huawei.com>
|
||||
Chris Chiu <chris.chiu@canonical.com> <chiu@endlessm.com>
|
||||
Chris Chiu <chris.chiu@canonical.com> <chiu@endlessos.org>
|
||||
Christophe Ricard <christophe.ricard@gmail.com>
|
||||
Christoph Hellwig <hch@lst.de>
|
||||
Corey Minyard <minyard@acm.org>
|
||||
@ -165,6 +169,7 @@ Johan Hovold <johan@kernel.org> <jhovold@gmail.com>
|
||||
Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com>
|
||||
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
|
||||
John Stultz <johnstul@us.ibm.com>
|
||||
Jordan Crouse <jordan@cosmicpenguin.net> <jcrouse@codeaurora.org>
|
||||
<josh@joshtriplett.org> <josh@freedesktop.org>
|
||||
<josh@joshtriplett.org> <josh@kernel.org>
|
||||
<josh@joshtriplett.org> <josht@linux.vnet.ibm.com>
|
||||
@ -250,11 +255,19 @@ Morten Welinder <welinder@anemone.rentec.com>
|
||||
Morten Welinder <welinder@darter.rentec.com>
|
||||
Morten Welinder <welinder@troll.com>
|
||||
Mythri P K <mythripk@ti.com>
|
||||
Nadia Yvette Chambers <nyc@holomorphy.com> William Lee Irwin III <wli@holomorphy.com>
|
||||
Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com>
|
||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
Nicholas Piggin <npiggin@gmail.com> <npiggen@suse.de>
|
||||
Nicholas Piggin <npiggin@gmail.com> <npiggin@kernel.dk>
|
||||
Nicholas Piggin <npiggin@gmail.com> <npiggin@suse.de>
|
||||
Nicholas Piggin <npiggin@gmail.com> <nickpiggin@yahoo.com.au>
|
||||
Nicholas Piggin <npiggin@gmail.com> <piggin@cyberone.com.au>
|
||||
Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com>
|
||||
Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org>
|
||||
Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org>
|
||||
Nicolas Saenz Julienne <nsaenz@kernel.org> <nsaenzjulienne@suse.de>
|
||||
Nicolas Saenz Julienne <nsaenz@kernel.org> <nsaenzjulienne@suse.com>
|
||||
Oleksij Rempel <linux@rempel-privat.de> <bug-track@fisher-privat.net>
|
||||
Oleksij Rempel <linux@rempel-privat.de> <external.Oleksij.Rempel@de.bosch.com>
|
||||
Oleksij Rempel <linux@rempel-privat.de> <fixed-term.Oleksij.Rempel@de.bosch.com>
|
||||
|
18
CREDITS
18
CREDITS
@ -550,7 +550,7 @@ D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few
|
||||
D: device drivers. His encouragement also helped many engineers get
|
||||
D: started working on the Linux kernel. David passed away in early
|
||||
D: 2011, and will be greatly missed.
|
||||
W: https://lkml.org/lkml/2011/4/5/36
|
||||
W: https://lore.kernel.org/lkml/20110405034819.GA7872@kroah.com
|
||||
|
||||
N: Gary Brubaker
|
||||
E: xavyer@ix.netcom.com
|
||||
@ -1874,6 +1874,11 @@ S: Krosenska' 543
|
||||
S: 181 00 Praha 8
|
||||
S: Czech Republic
|
||||
|
||||
N: Murali Karicheri
|
||||
E: m-karicheri2@ti.com
|
||||
D: Keystone NetCP driver
|
||||
D: Keystone PCIe host controller driver
|
||||
|
||||
N: Jan "Yenya" Kasprzak
|
||||
E: kas@fi.muni.cz
|
||||
D: Author of the COSA/SRP sync serial board driver.
|
||||
@ -1933,6 +1938,9 @@ N: Kukjin Kim
|
||||
E: kgene@kernel.org
|
||||
D: Samsung S3C, S5P and Exynos ARM architectures
|
||||
|
||||
N: Milo Kim
|
||||
D: TI LP855x, LP8727 and LP8788 drivers
|
||||
|
||||
N: Sangbeom Kim
|
||||
E: sbkim73@samsung.com
|
||||
D: Samsung SoC Audio (ASoC) drivers
|
||||
@ -2536,6 +2544,14 @@ D: Linux/PARISC hacker
|
||||
D: AD1889 sound driver
|
||||
S: Ottawa, Canada
|
||||
|
||||
N: Peter Meerwald-Stadler
|
||||
E: pmeerw@pmeerw.net
|
||||
W: https://pmeerw.net
|
||||
D: IIO reviewing, drivers
|
||||
S: Schießstandstr. 3a
|
||||
S: A-5061 Elsbethen
|
||||
S: Austria
|
||||
|
||||
N: Dirk Melchers
|
||||
E: dirk@merlin.nbg.sub.org
|
||||
D: 8 bit XT hard disk driver for OMTI5520
|
||||
|
27
Documentation/ABI/stable/procfs-audit_loginuid
Normal file
27
Documentation/ABI/stable/procfs-audit_loginuid
Normal file
@ -0,0 +1,27 @@
|
||||
What: Audit Login UID
|
||||
Date: 2005-02-01
|
||||
KernelVersion: 2.6.11-rc2 1e2d1492e178 ("[PATCH] audit: handle loginuid through proc")
|
||||
Contact: linux-audit@redhat.com
|
||||
Users: audit and login applications
|
||||
Description:
|
||||
The /proc/$pid/loginuid pseudofile is written to set and
|
||||
read to get the audit login UID of process $pid as a
|
||||
decimal unsigned int (%u, u32). If it is unset,
|
||||
permissions are not needed to set it. The accessor must
|
||||
have CAP_AUDIT_CONTROL in the initial user namespace to
|
||||
write it if it has been set. It cannot be written again
|
||||
if AUDIT_FEATURE_LOGINUID_IMMUTABLE is enabled. It
|
||||
cannot be unset if AUDIT_FEATURE_ONLY_UNSET_LOGINUID is
|
||||
enabled.
|
||||
|
||||
What: Audit Login Session ID
|
||||
Date: 2008-03-13
|
||||
KernelVersion: 2.6.25-rc7 1e0bd7550ea9 ("[PATCH] export sessionid alongside the loginuid in procfs")
|
||||
Contact: linux-audit@redhat.com
|
||||
Users: audit and login applications
|
||||
Description:
|
||||
The /proc/$pid/sessionid pseudofile is read to get the
|
||||
audit login session ID of process $pid as a decimal
|
||||
unsigned int (%u, u32). It is set automatically,
|
||||
serially assigned with each new login.
|
||||
|
@ -82,6 +82,24 @@ Description: Allows the root user to read or write 64 bit data directly
|
||||
If the IOMMU is disabled, it also allows the root user to read
|
||||
or write from the host a device VA of a host mapped memory
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/data_dma
|
||||
Date: Apr 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Allows the root user to read from the device's internal
|
||||
memory (DRAM/SRAM) through a DMA engine.
|
||||
This property is a binary blob that contains the result of the
|
||||
DMA transfer.
|
||||
This custom interface is needed (instead of using the generic
|
||||
Linux user-space PCI mapping) because the amount of internal
|
||||
memory is huge (>32GB) and reading it via the PCI bar will take
|
||||
a very long time.
|
||||
This interface doesn't support concurrency in the same device.
|
||||
In GAUDI and GOYA, this action can cause undefined behavior
|
||||
in case the it is done while the device is executing user
|
||||
workloads.
|
||||
Only supported on GAUDI at this stage.
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/device
|
||||
Date: Jan 2019
|
||||
KernelVersion: 5.1
|
||||
@ -90,6 +108,24 @@ Description: Enables the root user to set the device to specific state.
|
||||
Valid values are "disable", "enable", "suspend", "resume".
|
||||
User can read this property to see the valid values
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/dma_size
|
||||
Date: Apr 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Specify the size of the DMA transaction when using DMA to read
|
||||
from the device's internal memory. The value can not be larger
|
||||
than 128MB. Writing to this value initiates the DMA transfer.
|
||||
When the write is finished, the user can read the "data_dma"
|
||||
blob
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/dump_security_violations
|
||||
Date: Jan 2021
|
||||
KernelVersion: 5.12
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Dumps all security violations to dmesg. This will also ack
|
||||
all security violations meanings those violations will not be
|
||||
dumped next time user calls this API
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/engines
|
||||
Date: Jul 2019
|
||||
KernelVersion: 5.3
|
||||
@ -154,6 +190,16 @@ Description: Displays the hop values and physical address for a given ASID
|
||||
e.g. to display info about VA 0x1000 for ASID 1 you need to do:
|
||||
echo "1 0x1000" > /sys/kernel/debug/habanalabs/hl0/mmu
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/mmu_error
|
||||
Date: Mar 2021
|
||||
KernelVersion: 5.12
|
||||
Contact: fkassabri@habana.ai
|
||||
Description: Check and display page fault or access violation mmu errors for
|
||||
all MMUs specified in mmu_cap_mask.
|
||||
e.g. to display error info for MMU hw cap bit 9, you need to do:
|
||||
echo "0x200" > /sys/kernel/debug/habanalabs/hl0/mmu_error
|
||||
cat /sys/kernel/debug/habanalabs/hl0/mmu_error
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/set_power_state
|
||||
Date: Jan 2019
|
||||
KernelVersion: 5.1
|
||||
@ -161,6 +207,13 @@ Contact: ogabbay@kernel.org
|
||||
Description: Sets the PCI power state. Valid values are "1" for D0 and "2"
|
||||
for D3Hot
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/stop_on_err
|
||||
Date: Mar 2020
|
||||
KernelVersion: 5.6
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Sets the stop-on_error option for the device engines. Value of
|
||||
"0" is for disable, otherwise enable.
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/userptr
|
||||
Date: Jan 2019
|
||||
KernelVersion: 5.1
|
||||
@ -174,19 +227,4 @@ Date: Jan 2019
|
||||
KernelVersion: 5.1
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Displays a list with information about all the active virtual
|
||||
address mappings per ASID
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/stop_on_err
|
||||
Date: Mar 2020
|
||||
KernelVersion: 5.6
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Sets the stop-on_error option for the device engines. Value of
|
||||
"0" is for disable, otherwise enable.
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/dump_security_violations
|
||||
Date: Jan 2021
|
||||
KernelVersion: 5.12
|
||||
Contact: ogabbay@kernel.org
|
||||
Description: Dumps all security violations to dmesg. This will also ack
|
||||
all security violations meanings those violations will not be
|
||||
dumped next time user calls this API
|
||||
address mappings per ASID and all user mappings of HW blocks
|
||||
|
@ -1,7 +1,7 @@
|
||||
What: /sys/kernel/debug/moxtet/input
|
||||
Date: March 2019
|
||||
KernelVersion: 5.3
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) Read input from the shift registers, in hexadecimal.
|
||||
Returns N+1 bytes, where N is the number of Moxtet connected
|
||||
modules. The first byte is from the CPU board itself.
|
||||
@ -19,7 +19,7 @@ Description: (Read) Read input from the shift registers, in hexadecimal.
|
||||
What: /sys/kernel/debug/moxtet/output
|
||||
Date: March 2019
|
||||
KernelVersion: 5.3
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (RW) Read last written value to the shift registers, in
|
||||
hexadecimal, or write values to the shift registers, also
|
||||
in hexadecimal.
|
||||
|
@ -1,7 +1,7 @@
|
||||
What: /sys/kernel/debug/turris-mox-rwtm/do_sign
|
||||
Date: Jun 2020
|
||||
KernelVersion: 5.8
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description:
|
||||
|
||||
======= ===========================================================
|
||||
|
@ -44,3 +44,21 @@ Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
|
||||
Description: Contains the device access mode: ro, rw or migration.
|
||||
|
||||
What: /sys/block/rnbd<N>/rnbd/resize
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
|
||||
Description: Write the number of sectors to change the size of the disk.
|
||||
|
||||
What: /sys/block/rnbd<N>/rnbd/remap_device
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
|
||||
Description: Remap the disconnected device if the session is not destroyed yet.
|
||||
|
||||
What: /sys/block/rnbd<N>/rnbd/nr_poll_queues
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
|
||||
Description: Contains the number of poll-mode queues
|
||||
|
14
Documentation/ABI/testing/sysfs-bus-coresight-devices-trbe
Normal file
14
Documentation/ABI/testing/sysfs-bus-coresight-devices-trbe
Normal file
@ -0,0 +1,14 @@
|
||||
What: /sys/bus/coresight/devices/trbe<cpu>/align
|
||||
Date: March 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Anshuman Khandual <anshuman.khandual@arm.com>
|
||||
Description: (Read) Shows the TRBE write pointer alignment. This value
|
||||
is fetched from the TRBIDR register.
|
||||
|
||||
What: /sys/bus/coresight/devices/trbe<cpu>/flag
|
||||
Date: March 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Anshuman Khandual <anshuman.khandual@arm.com>
|
||||
Description: (Read) Shows if TRBE updates in the memory are with access
|
||||
and dirty flag updates as well. This value is fetched from
|
||||
the TRBIDR register.
|
30
Documentation/ABI/testing/sysfs-bus-event_source-devices-dsa
Normal file
30
Documentation/ABI/testing/sysfs-bus-event_source-devices-dsa
Normal file
@ -0,0 +1,30 @@
|
||||
What: /sys/bus/event_source/devices/dsa*/format
|
||||
Date: April 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Description: Read-only. Attribute group to describe the magic bits
|
||||
that go into perf_event_attr.config or
|
||||
perf_event_attr.config1 for the IDXD DSA pmu. (See also
|
||||
ABI/testing/sysfs-bus-event_source-devices-format).
|
||||
|
||||
Each attribute in this group defines a bit range in
|
||||
perf_event_attr.config or perf_event_attr.config1.
|
||||
All supported attributes are listed below (See the
|
||||
IDXD DSA Spec for possible attribute values)::
|
||||
|
||||
event_category = "config:0-3" - event category
|
||||
event = "config:4-31" - event ID
|
||||
|
||||
filter_wq = "config1:0-31" - workqueue filter
|
||||
filter_tc = "config1:32-39" - traffic class filter
|
||||
filter_pgsz = "config1:40-43" - page size filter
|
||||
filter_sz = "config1:44-51" - transfer size filter
|
||||
filter_eng = "config1:52-59" - engine filter
|
||||
|
||||
What: /sys/bus/event_source/devices/dsa*/cpumask
|
||||
Date: April 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Description: Read-only. This file always returns the cpu to which the
|
||||
IDXD DSA pmu is bound for access to all dsa pmu
|
||||
performance monitoring events.
|
@ -33,6 +33,52 @@ Description:
|
||||
Description of the physical chip / device for device X.
|
||||
Typically a part number.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/label
|
||||
KernelVersion: 5.8
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Optional symbolic label for a device.
|
||||
This is useful for userspace to be able to better identify an
|
||||
individual device.
|
||||
|
||||
The contents of the label are free-form, but there are some
|
||||
standardized uses:
|
||||
|
||||
For proximity sensors which give the proximity (of a person) to
|
||||
a certain wlan or wwan antenna the following standardized labels
|
||||
are used:
|
||||
|
||||
* "proximity-wifi"
|
||||
* "proximity-lte"
|
||||
* "proximity-wifi-lte"
|
||||
* "proximity-wifi-left"
|
||||
* "proximity-wifi-right"
|
||||
|
||||
These are used to indicate to userspace that these proximity
|
||||
sensors may be used to tune transmit power to ensure that
|
||||
Specific Absorption Rate (SAR) limits are honored.
|
||||
The "-left" and "-right" labels are for devices with multiple
|
||||
antennas.
|
||||
|
||||
In some laptops/tablets the standardized proximity sensor labels
|
||||
instead indicate proximity to a specific part of the device:
|
||||
|
||||
* "proximity-palmrest" indicates proximity to the keyboard's palmrest
|
||||
* "proximity-palmrest-left" indicates proximity to the left part of the palmrest
|
||||
* "proximity-palmrest-right" indicates proximity to the right part of the palmrest
|
||||
* "proximity-lap" indicates the device is being used on someone's lap
|
||||
|
||||
Note "proximity-lap" is special in that its value may be
|
||||
calculated by firmware from other sensor readings, rather then
|
||||
being a raw sensor reading.
|
||||
|
||||
For accelerometers used in 2-in-1s with 360° (yoga-style) hinges,
|
||||
which have an accelerometer in both their base and their display,
|
||||
the following standardized labels are used:
|
||||
|
||||
* "accel-base"
|
||||
* "accel-display"
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/current_timestamp_clock
|
||||
KernelVersion: 4.5
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@ -325,6 +371,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_humidityrelative_offset
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_magn_offset
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_rot_offset
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_angl_offset
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceX_offset
|
||||
KernelVersion: 2.6.35
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
@ -656,6 +703,8 @@ What: /sys/.../iio:deviceX/events/in_voltageY_thresh_falling_en
|
||||
What: /sys/.../iio:deviceX/events/in_voltageY_thresh_either_en
|
||||
What: /sys/.../iio:deviceX/events/in_tempY_thresh_rising_en
|
||||
What: /sys/.../iio:deviceX/events/in_tempY_thresh_falling_en
|
||||
What: /sys/.../iio:deviceX/events/in_capacitanceY_thresh_rising_en
|
||||
What: /sys/.../iio:deviceX/events/in_capacitanceY_thresh_falling_en
|
||||
KernelVersion: 2.6.37
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
@ -733,6 +782,32 @@ Description:
|
||||
a given event type is enabled a future point (and not those for
|
||||
whatever event was previously enabled).
|
||||
|
||||
What: /sys/.../events/in_capacitanceY_adaptive_thresh_rising_en
|
||||
What: /sys/.../events/in_capacitanceY_adaptive_thresh_falling_en
|
||||
KernelVersion: 5.13
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Descrption:
|
||||
Adaptive thresholds are similar to normal fixed thresholds
|
||||
but the value is expressed as an offset from a value which
|
||||
provides a low frequency approximation of the channel itself.
|
||||
Thus these detect if a rapid change occurs in the specified
|
||||
direction which crosses tracking value + offset.
|
||||
Tracking value calculation is devices specific.
|
||||
|
||||
What: /sys/.../in_capacitanceY_adaptive_thresh_rising_timeout
|
||||
What: /sys/.../in_capacitanceY_adaptive_thresh_falling_timeout
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Descrption:
|
||||
When adaptive thresholds are used, the tracking signal
|
||||
may adjust too slowly to step changes in the raw signal.
|
||||
*_timeout (in seconds) specifies a time for which the
|
||||
difference between the slow tracking signal and the raw
|
||||
signal is allowed to remain out-of-range before a reset
|
||||
event occurs in which the tracking signal is made equal
|
||||
to the raw signal, allowing slow tracking to resume and the
|
||||
adaptive threshold event detection to function as expected.
|
||||
|
||||
What: /sys/.../events/in_accel_thresh_rising_value
|
||||
What: /sys/.../events/in_accel_thresh_falling_value
|
||||
What: /sys/.../events/in_accel_x_raw_thresh_rising_value
|
||||
@ -773,6 +848,10 @@ What: /sys/.../events/in_proximity0_thresh_falling_value
|
||||
What: /sys/.../events/in_proximity0_thresh_rising_value
|
||||
What: /sys/.../events/in_illuminance_thresh_rising_value
|
||||
What: /sys/.../events/in_illuminance_thresh_falling_value
|
||||
What: /sys/.../events/in_capacitanceY_thresh_rising_value
|
||||
What: /sys/.../events/in_capacitanceY_thresh_falling_value
|
||||
What: /sys/.../events/in_capacitanceY_thresh_adaptive_rising_value
|
||||
What: /sys/.../events/in_capacitanceY_thresh_falling_rising_value
|
||||
KernelVersion: 2.6.37
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
@ -1118,12 +1197,16 @@ Description:
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/length
|
||||
KernelVersion: 2.6.35
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/length
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Number of scans contained by the buffer.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/enable
|
||||
KernelVersion: 2.6.35
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/enable
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Actually start the buffer capture up. Will start trigger
|
||||
@ -1131,11 +1214,16 @@ Description:
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/scan_elements
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Directory containing interfaces for elements that will be
|
||||
captured for a single triggered sample set in the buffer.
|
||||
|
||||
Since kernel 5.11 the scan_elements attributes are merged into
|
||||
the bufferY directory, to be configurable per buffer.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_z_en
|
||||
@ -1164,6 +1252,34 @@ What: /sys/.../iio:deviceX/scan_elements/in_pressure_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_en
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_x_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_y_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_z_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_x_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_y_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_z_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_magnetic_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_true_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_magnetic_tilt_comp_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_true_tilt_comp_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_timestamp_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_supply_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY-voltageZ_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_i_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_q_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_i_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_q_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_incli_x_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_incli_y_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_pressureY_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_pressure_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_proximity_en
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Scan element control for triggered data capture.
|
||||
@ -1185,6 +1301,23 @@ What: /sys/.../iio:deviceX/scan_elements/in_pressure_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_type
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_incli_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_supply_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_i_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_q_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_i_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_q_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_timestamp_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_pressureY_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_pressure_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_proximity_type
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Description of the scan element data storage within the buffer
|
||||
@ -1241,6 +1374,33 @@ What: /sys/.../iio:deviceX/scan_elements/in_pressure_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_index
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_supply_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_i_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_q_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_i_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltage_q_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_x_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_y_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_z_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_x_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_y_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_z_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_magnetic_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_true_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_magnetic_tilt_comp_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_from_north_true_tilt_comp_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_incli_x_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_incli_y_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_timestamp_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_pressureY_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_pressure_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_proximity_index
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
A single positive integer specifying the position of this
|
||||
@ -1455,6 +1615,8 @@ Description:
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/watermark
|
||||
KernelVersion: 4.2
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/watermark
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
A single positive integer specifying the maximum number of scan
|
||||
@ -1473,6 +1635,8 @@ Description:
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/data_available
|
||||
KernelVersion: 4.16
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/data_available
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
A read-only value indicating the bytes of data available in the
|
||||
@ -1823,3 +1987,12 @@ Description:
|
||||
hinge, keyboard, screen. It means the three channels
|
||||
each correspond respectively to hinge angle, keyboard angle,
|
||||
and screen angle.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_illuminance_hysteresis_relative
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_intensity_hysteresis_relative
|
||||
KernelVersion: 5.12
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Specify the percent for light sensor relative to the channel
|
||||
absolute value that a data field should change before an event
|
||||
is generated. Units are a percentage of the prior reading.
|
||||
|
@ -1,133 +0,0 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count_count_mode_available
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count_noise_error_available
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_index_index_polarity_available
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_index_synchronous_mode_available
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Discrete set of available values for the respective counter
|
||||
configuration are listed in this file.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_countY_count_mode
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Count mode for channel Y. Four count modes are available:
|
||||
normal, range limit, non-recycle, and modulo-n. The preset value
|
||||
for channel Y is used by the count mode where required.
|
||||
|
||||
Normal:
|
||||
Counting is continuous in either direction.
|
||||
|
||||
Range Limit:
|
||||
An upper or lower limit is set, mimicking limit switches
|
||||
in the mechanical counterpart. The upper limit is set to
|
||||
the preset value, while the lower limit is set to 0. The
|
||||
counter freezes at count = preset when counting up, and
|
||||
at count = 0 when counting down. At either of these
|
||||
limits, the counting is resumed only when the count
|
||||
direction is reversed.
|
||||
|
||||
Non-recycle:
|
||||
Counter is disabled whenever a 24-bit count overflow or
|
||||
underflow takes place. The counter is re-enabled when a
|
||||
new count value is loaded to the counter via a preset
|
||||
operation or write to raw.
|
||||
|
||||
Modulo-N:
|
||||
A count boundary is set between 0 and the preset value.
|
||||
The counter is reset to 0 at count = preset when
|
||||
counting up, while the counter is set to the preset
|
||||
value at count = 0 when counting down; the counter does
|
||||
not freeze at the bundary points, but counts
|
||||
continuously throughout.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_countY_noise_error
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Read-only attribute that indicates whether excessive noise is
|
||||
present at the channel Y count inputs in quadrature clock mode;
|
||||
irrelevant in non-quadrature clock mode.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_countY_preset
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
If the counter device supports preset registers, the preset
|
||||
count for channel Y is provided by this attribute.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_countY_quadrature_mode
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Configure channel Y counter for non-quadrature or quadrature
|
||||
clock mode. Selecting non-quadrature clock mode will disable
|
||||
synchronous load mode. In quadrature clock mode, the channel Y
|
||||
scale attribute selects the encoder phase division (scale of 1
|
||||
selects full-cycle, scale of 0.5 selects half-cycle, scale of
|
||||
0.25 selects quarter-cycle) processed by the channel Y counter.
|
||||
|
||||
Non-quadrature:
|
||||
The filter and decoder circuit are bypassed. Encoder A
|
||||
input serves as the count input and B as the UP/DOWN
|
||||
direction control input, with B = 1 selecting UP Count
|
||||
mode and B = 0 selecting Down Count mode.
|
||||
|
||||
Quadrature:
|
||||
Encoder A and B inputs are digitally filtered and
|
||||
decoded for UP/DN clock.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_countY_set_to_preset_on_index
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Whether to set channel Y counter with channel Y preset value
|
||||
when channel Y index input is active, or continuously count.
|
||||
Valid attribute values are boolean.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_indexY_index_polarity
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Active level of channel Y index input; irrelevant in
|
||||
non-synchronous load mode.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_indexY_synchronous_mode
|
||||
KernelVersion: 4.10
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This interface is deprecated; please use the Counter subsystem.
|
||||
|
||||
Configure channel Y counter for non-synchronous or synchronous
|
||||
load mode. Synchronous load mode cannot be selected in
|
||||
non-quadrature clock mode.
|
||||
|
||||
Non-synchronous:
|
||||
A logic low level is the active level at this index
|
||||
input. The index function (as enabled via
|
||||
set_to_preset_on_index) is performed directly on the
|
||||
active level of the index input.
|
||||
|
||||
Synchronous:
|
||||
Intended for interfacing with encoder Index output in
|
||||
quadrature clock mode. The active level is configured
|
||||
via index_polarity. The index function (as enabled via
|
||||
set_to_preset_on_index) is performed synchronously with
|
||||
the quadrature clock on the active level of the index
|
||||
input.
|
@ -1,11 +1,3 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/sensor_sensitivity
|
||||
Date: January 2017
|
||||
KernelVersion: 4.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Show or set the gain boost of the amp, from 0-31 range.
|
||||
default 31
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/sensor_max_range
|
||||
Date: January 2017
|
||||
KernelVersion: 4.11
|
||||
|
@ -6,4 +6,5 @@ Description:
|
||||
Controls the heater device within the humidity sensor to get
|
||||
rid of excess condensation.
|
||||
|
||||
Valid control values are 0 = OFF, and 1 = ON.
|
||||
In some devices, this is just a switch in which case 0 = OFF,
|
||||
and 1 = ON.
|
@ -1,9 +0,0 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw_available
|
||||
KernelVersion: 4.3
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Controls the heater device within the humidity sensor to get
|
||||
rid of excess condensation.
|
||||
|
||||
Valid control values are 0 = OFF, and 1 = ON.
|
@ -1,62 +0,0 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count0_preset
|
||||
KernelVersion: 4.13
|
||||
Contact: fabrice.gasnier@st.com
|
||||
Description:
|
||||
Reading returns the current preset value. Writing sets the
|
||||
preset value. Encoder counts continuously from 0 to preset
|
||||
value, depending on direction (up/down).
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available
|
||||
KernelVersion: 4.13
|
||||
Contact: fabrice.gasnier@st.com
|
||||
Description:
|
||||
Reading returns the list possible quadrature modes.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count0_quadrature_mode
|
||||
KernelVersion: 4.13
|
||||
Contact: fabrice.gasnier@st.com
|
||||
Description:
|
||||
Configure the device counter quadrature modes:
|
||||
|
||||
- non-quadrature:
|
||||
Encoder IN1 input servers as the count input (up
|
||||
direction).
|
||||
|
||||
- quadrature:
|
||||
Encoder IN1 and IN2 inputs are mixed to get direction
|
||||
and count.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count_polarity_available
|
||||
KernelVersion: 4.13
|
||||
Contact: fabrice.gasnier@st.com
|
||||
Description:
|
||||
Reading returns the list possible active edges.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_count0_polarity
|
||||
KernelVersion: 4.13
|
||||
Contact: fabrice.gasnier@st.com
|
||||
Description:
|
||||
Configure the device encoder/counter active edge:
|
||||
|
||||
- rising-edge
|
||||
- falling-edge
|
||||
- both-edges
|
||||
|
||||
In non-quadrature mode, device counts up on active edge.
|
||||
|
||||
In quadrature mode, encoder counting scenarios are as follows:
|
||||
|
||||
+---------+----------+--------------------+--------------------+
|
||||
| Active | Level on | IN1 signal | IN2 signal |
|
||||
| edge | opposite +----------+---------+----------+---------+
|
||||
| | signal | Rising | Falling | Rising | Falling |
|
||||
+---------+----------+----------+---------+----------+---------+
|
||||
| Rising | High -> | Down | - | Up | - |
|
||||
| edge | Low -> | Up | - | Down | - |
|
||||
+---------+----------+----------+---------+----------+---------+
|
||||
| Falling | High -> | - | Up | - | Down |
|
||||
| edge | Low -> | - | Down | - | Up |
|
||||
+---------+----------+----------+---------+----------+---------+
|
||||
| Both | High -> | Down | Up | Up | Down |
|
||||
| edges | Low -> | Up | Down | Down | Up |
|
||||
+---------+----------+----------+---------+----------+---------+
|
@ -8,3 +8,17 @@ Description:
|
||||
considered close to the device. If the value read from the
|
||||
sensor is above or equal to the value in this file an object
|
||||
should typically be considered near.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/sensor_sensitivity
|
||||
Date: March 2014
|
||||
KernelVersion: 3.15
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Proximity sensors sometimes have a controllable amplifier
|
||||
on the signal from which time of flight measurements are
|
||||
taken.
|
||||
The appropriate values to take is dependent on both the
|
||||
sensor and it's operating environment:
|
||||
* as3935 (0-31 range)
|
||||
18 = indoors (default)
|
||||
14 = outdoors
|
||||
|
@ -6,15 +6,6 @@ Description:
|
||||
Get the current distance in meters of storm (1km steps)
|
||||
1000-40000 = distance in meters
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/sensor_sensitivity
|
||||
Date: March 2014
|
||||
KernelVersion: 3.15
|
||||
Contact: Matt Ranostay <matt.ranostay@konsulko.com>
|
||||
Description:
|
||||
Show or set the gain boost of the amp, from 0-31 range.
|
||||
18 = indoors (default)
|
||||
14 = outdoors
|
||||
|
||||
What /sys/bus/iio/devices/iio:deviceX/noise_level_tripped
|
||||
Date: May 2017
|
||||
KernelVersion: 4.13
|
||||
|
@ -1,17 +1,17 @@
|
||||
What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_description
|
||||
Date: March 2019
|
||||
KernelVersion: 5.3
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) Moxtet module description. Format: string
|
||||
|
||||
What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_id
|
||||
Date: March 2019
|
||||
KernelVersion: 5.3
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) Moxtet module ID. Format: %x
|
||||
|
||||
What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_name
|
||||
Date: March 2019
|
||||
KernelVersion: 5.3
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) Moxtet module name. Format: string
|
||||
|
@ -195,10 +195,13 @@ What: /sys/bus/pci/devices/.../index
|
||||
Date: July 2010
|
||||
Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
|
||||
Description:
|
||||
Reading this attribute will provide the firmware
|
||||
given instance (SMBIOS type 41 device type instance) of the
|
||||
PCI device. The attribute will be created only if the firmware
|
||||
has given an instance number to the PCI device.
|
||||
Reading this attribute will provide the firmware given instance
|
||||
number of the PCI device. Depending on the platform this can
|
||||
be for example the SMBIOS type 41 device type instance or the
|
||||
user-defined ID (UID) on s390. The attribute will be created
|
||||
only if the firmware has given an instance number to the PCI
|
||||
device and that number is guaranteed to uniquely identify the
|
||||
device in the system.
|
||||
Users:
|
||||
Userspace applications interested in knowing the
|
||||
firmware assigned device type instance of the PCI
|
||||
@ -375,3 +378,32 @@ Description:
|
||||
The value comes from the PCI kernel device state and can be one
|
||||
of: "unknown", "error", "D0", D1", "D2", "D3hot", "D3cold".
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/pci/devices/.../sriov_vf_total_msix
|
||||
Date: January 2021
|
||||
Contact: Leon Romanovsky <leonro@nvidia.com>
|
||||
Description:
|
||||
This file is associated with a SR-IOV physical function (PF).
|
||||
It contains the total number of MSI-X vectors available for
|
||||
assignment to all virtual functions (VFs) associated with PF.
|
||||
The value will be zero if the device doesn't support this
|
||||
functionality. For supported devices, the value will be
|
||||
constant and won't be changed after MSI-X vectors assignment.
|
||||
|
||||
What: /sys/bus/pci/devices/.../sriov_vf_msix_count
|
||||
Date: January 2021
|
||||
Contact: Leon Romanovsky <leonro@nvidia.com>
|
||||
Description:
|
||||
This file is associated with a SR-IOV virtual function (VF).
|
||||
It allows configuration of the number of MSI-X vectors for
|
||||
the VF. This allows devices that have a global pool of MSI-X
|
||||
vectors to optimally divide them between VFs based on VF usage.
|
||||
|
||||
The values accepted are:
|
||||
* > 0 - this number will be reported as the Table Size in the
|
||||
VF's MSI-X capability
|
||||
* < 0 - not valid
|
||||
* = 0 - will reset to the device default value
|
||||
|
||||
The file is writable if the PF is bound to a driver that
|
||||
implements ->sriov_set_msix_vec_count().
|
||||
|
@ -1,4 +1,5 @@
|
||||
What: /sys/devices/pci0000:00/*/QEMU0001:00/capability
|
||||
What: /sys/devices/pci0000:00/*/QEMU0001:00/capability for MMIO
|
||||
/sys/bus/pci/drivers/pvpanic-pci/0000:00:0*.0/capability for PCI
|
||||
Date: Jan 2021
|
||||
Contact: zhenwei pi <pizhenwei@bytedance.com>
|
||||
Description:
|
||||
@ -12,6 +13,7 @@ Description:
|
||||
https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/specs/pvpanic.txt
|
||||
|
||||
What: /sys/devices/pci0000:00/*/QEMU0001:00/events
|
||||
/sys/bus/pci/drivers/pvpanic-pci/0000:00:0*.0/events for PCI
|
||||
Date: Jan 2021
|
||||
Contact: zhenwei pi <pizhenwei@bytedance.com>
|
||||
Description:
|
||||
|
@ -1,31 +1,3 @@
|
||||
What: /sys/bus/thunderbolt/devices/<xdomain>/rx_speed
|
||||
Date: Feb 2021
|
||||
KernelVersion: 5.11
|
||||
Contact: Isaac Hazan <isaac.hazan@intel.com>
|
||||
Description: This attribute reports the XDomain RX speed per lane.
|
||||
All RX lanes run at the same speed.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/<xdomain>/rx_lanes
|
||||
Date: Feb 2021
|
||||
KernelVersion: 5.11
|
||||
Contact: Isaac Hazan <isaac.hazan@intel.com>
|
||||
Description: This attribute reports the number of RX lanes the XDomain
|
||||
is using simultaneously through its upstream port.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/<xdomain>/tx_speed
|
||||
Date: Feb 2021
|
||||
KernelVersion: 5.11
|
||||
Contact: Isaac Hazan <isaac.hazan@intel.com>
|
||||
Description: This attribute reports the XDomain TX speed per lane.
|
||||
All TX lanes run at the same speed.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/<xdomain>/tx_lanes
|
||||
Date: Feb 2021
|
||||
KernelVersion: 5.11
|
||||
Contact: Isaac Hazan <isaac.hazan@intel.com>
|
||||
Description: This attribute reports number of TX lanes the XDomain
|
||||
is using simultaneously through its upstream port.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/boot_acl
|
||||
Date: Jun 2018
|
||||
KernelVersion: 4.17
|
||||
@ -162,6 +134,13 @@ Contact: thunderbolt-software@lists.01.org
|
||||
Description: This attribute contains name of this device extracted from
|
||||
the device DROM.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../maxhopid
|
||||
Date: Jul 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Mika Westerberg <mika.westerberg@linux.intel.com>
|
||||
Description: Only set for XDomains. The maximum HopID the other host
|
||||
supports as its input HopID.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../rx_speed
|
||||
Date: Jan 2020
|
||||
KernelVersion: 5.5
|
||||
|
@ -97,10 +97,7 @@ Description:
|
||||
object. The values are represented in ms. If the value is
|
||||
less than 1 jiffy, it is considered to be 0, which means
|
||||
no polling. This value is meaningless if the governor is
|
||||
not polling; thus. If the governor is not using
|
||||
devfreq-provided central polling
|
||||
(/sys/class/devfreq/.../central_polling is 0), this value
|
||||
may be useless.
|
||||
not polling.
|
||||
|
||||
A list of governors that support the node:
|
||||
- simple_ondmenad
|
||||
|
@ -1,7 +1,7 @@
|
||||
What: /sys/class/leds/<led>/device/brightness
|
||||
Date: July 2020
|
||||
KernelVersion: 5.9
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (RW) On the front panel of the Turris Omnia router there is also
|
||||
a button which can be used to control the intensity of all the
|
||||
LEDs at once, so that if they are too bright, user can dim them.
|
||||
|
@ -51,3 +51,15 @@ Description:
|
||||
Boolean value indicating whether the PHY device is used in
|
||||
standalone mode, without a net_device associated, by PHYLINK.
|
||||
Attribute created only when this is the case.
|
||||
|
||||
What: /sys/class/mdio_bus/<bus>/<device>/phy_dev_flags
|
||||
Date: March 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: netdev@vger.kernel.org
|
||||
Description:
|
||||
32-bit hexadecimal number representing a bit mask of the
|
||||
configuration bits passed from the consumer of the PHY
|
||||
(Ethernet MAC, switch, etc.) to the PHY driver. The flags are
|
||||
only used internally by the kernel and their placement are
|
||||
not meant to be stable across kernel versions. This is intended
|
||||
for facilitating the debugging of PHY drivers.
|
||||
|
@ -58,3 +58,19 @@ Description:
|
||||
|
||||
Indicates the mux id associated to the qmimux network interface
|
||||
during its creation.
|
||||
|
||||
What: /sys/class/net/<iface>/qmi/pass_through
|
||||
Date: January 2021
|
||||
KernelVersion: 5.12
|
||||
Contact: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
|
||||
Description:
|
||||
Boolean. Default: 'N'
|
||||
|
||||
Set this to 'Y' to enable 'pass-through' mode, allowing packets
|
||||
in MAP format to be passed on to the stack.
|
||||
|
||||
Normally the rmnet driver (CONFIG_RMNET) is then used to process
|
||||
and demultiplex these packets.
|
||||
|
||||
'Pass-through' mode can be enabled when the device is in
|
||||
'raw-ip' mode only.
|
||||
|
15
Documentation/ABI/testing/sysfs-class-power-surface
Normal file
15
Documentation/ABI/testing/sysfs-class-power-surface
Normal file
@ -0,0 +1,15 @@
|
||||
What: /sys/class/power_supply/<supply_name>/alarm
|
||||
Date: April 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Maximilian Luz <luzmaximilian@gmail.com>
|
||||
Description:
|
||||
Battery trip point. When the remaining battery capacity crosses this
|
||||
value in either direction, the system will be notified and if
|
||||
necessary woken.
|
||||
|
||||
Set to zero to clear/disable.
|
||||
|
||||
Access: Read, Write
|
||||
|
||||
Valid values: In micro-Wh or micro-Ah, depending on the power unit
|
||||
of the battery
|
@ -85,6 +85,19 @@ Description: Expected format is the following::
|
||||
|
||||
By default "rw" is used.
|
||||
|
||||
nr_poll_queues
|
||||
specifies the number of poll-mode queues. If the IO has HIPRI flag,
|
||||
the block-layer will send the IO via the poll-mode queue.
|
||||
For fast network and device the polling is faster than interrupt-base
|
||||
IO handling because it saves time for context switching, switching to
|
||||
another process, handling the interrupt and switching back to the
|
||||
issuing process.
|
||||
|
||||
Set -1 if you want to set it as the number of CPUs
|
||||
By default rnbd client creates only irq-mode queues.
|
||||
|
||||
NOTICE: MUST make a unique session for a device using the poll-mode queues.
|
||||
|
||||
Exit Codes:
|
||||
|
||||
If the device is already mapped it will fail with EEXIST. If the input
|
||||
|
@ -34,6 +34,9 @@ Description: Multipath policy specifies which path should be selected on each IO
|
||||
min-inflight (1):
|
||||
select path with minimum inflights.
|
||||
|
||||
min-latency (2):
|
||||
select path with minimum latency.
|
||||
|
||||
What: /sys/class/rtrs-client/<session-name>/paths/
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
@ -95,6 +98,15 @@ KernelVersion: 5.7
|
||||
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
|
||||
Description: RO, Contains the destination address of the path
|
||||
|
||||
What: /sys/class/rtrs-client/<session-name>/paths/<src@dst>/cur_latency
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
|
||||
Description: RO, Contains the latency time calculated by the heart-beat messages.
|
||||
Whenever the client sends heart-beat message, it checks the time gap
|
||||
between sending the heart-beat message and receiving the ACK.
|
||||
This value can be changed regularly.
|
||||
|
||||
What: /sys/class/rtrs-client/<session-name>/paths/<src@dst>/stats/reset_all
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
|
@ -285,7 +285,7 @@ Description: Disable L3 cache indices
|
||||
|
||||
All AMD processors with L3 caches provide this functionality.
|
||||
For details, see BKDGs at
|
||||
http://developer.amd.com/documentation/guides/Pages/default.aspx
|
||||
https://www.amd.com/en/support/tech-docs?keyword=bios+kernel
|
||||
|
||||
|
||||
What: /sys/devices/system/cpu/cpufreq/boost
|
||||
|
@ -15,3 +15,12 @@ Description: Reports the model identification provided by the touchscreen, fo
|
||||
Access: Read
|
||||
|
||||
Valid values: Represented as string
|
||||
|
||||
What: /sys/bus/i2c/devices/xxx/type
|
||||
Date: Jan 2021
|
||||
Contact: linux-input@vger.kernel.org
|
||||
Description: Reports the type identification provided by the touchscreen, for example "PCAP82H80 Series"
|
||||
|
||||
Access: Read
|
||||
|
||||
Valid values: Represented as string
|
||||
|
49
Documentation/ABI/testing/sysfs-driver-xdata
Normal file
49
Documentation/ABI/testing/sysfs-driver-xdata
Normal file
@ -0,0 +1,49 @@
|
||||
What: /sys/class/misc/drivers/dw-xdata-pcie.<device>/write
|
||||
Date: April 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
|
||||
Description: Allows the user to enable the PCIe traffic generator which
|
||||
will create write TLPs frames - from the Root Complex to the
|
||||
Endpoint direction or to disable the PCIe traffic generator
|
||||
in all directions.
|
||||
|
||||
Write y/1/on to enable, n/0/off to disable
|
||||
|
||||
Usage e.g.
|
||||
echo 1 > /sys/class/misc/dw-xdata-pcie.<device>/write
|
||||
or
|
||||
echo 0 > /sys/class/misc/dw-xdata-pcie.<device>/write
|
||||
|
||||
The user can read the current PCIe link throughput generated
|
||||
through this generator in MB/s.
|
||||
|
||||
Usage e.g.
|
||||
cat /sys/class/misc/dw-xdata-pcie.<device>/write
|
||||
204
|
||||
|
||||
The file is read and write.
|
||||
|
||||
What: /sys/class/misc/dw-xdata-pcie.<device>/read
|
||||
Date: April 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
|
||||
Description: Allows the user to enable the PCIe traffic generator which
|
||||
will create read TLPs frames - from the Endpoint to the Root
|
||||
Complex direction or to disable the PCIe traffic generator
|
||||
in all directions.
|
||||
|
||||
Write y/1/on to enable, n/0/off to disable
|
||||
|
||||
Usage e.g.
|
||||
echo 1 > /sys/class/misc/dw-xdata-pcie.<device>/read
|
||||
or
|
||||
echo 0 > /sys/class/misc/dw-xdata-pcie.<device>/read
|
||||
|
||||
The user can read the current PCIe link throughput generated
|
||||
through this generator in MB/s.
|
||||
|
||||
Usage e.g.
|
||||
cat /sys/class/misc/dw-xdata-pcie.<device>/read
|
||||
199
|
||||
|
||||
The file is read and write.
|
@ -39,8 +39,8 @@ Description:
|
||||
|
||||
The uv_type entry contains the hub revision number.
|
||||
This value can be used to identify the UV system version::
|
||||
"0.*" = Hubless UV ('*' is subtype)
|
||||
|
||||
"0.*" = Hubless UV ('*' is subtype)
|
||||
"3.0" = UV2
|
||||
"5.0" = UV3
|
||||
"7.0" = UV4
|
||||
|
@ -1,21 +1,21 @@
|
||||
What: /sys/firmware/turris-mox-rwtm/board_version
|
||||
Date: August 2019
|
||||
KernelVersion: 5.4
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) Board version burned into eFuses of this Turris Mox board.
|
||||
Format: %i
|
||||
|
||||
What: /sys/firmware/turris-mox-rwtm/mac_address*
|
||||
Date: August 2019
|
||||
KernelVersion: 5.4
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) MAC addresses burned into eFuses of this Turris Mox board.
|
||||
Format: %pM
|
||||
|
||||
What: /sys/firmware/turris-mox-rwtm/pubkey
|
||||
Date: August 2019
|
||||
KernelVersion: 5.4
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) ECDSA public key (in pubkey hex compressed form) computed
|
||||
as pair to the ECDSA private key burned into eFuses of this
|
||||
Turris Mox Board.
|
||||
@ -24,7 +24,7 @@ Description: (Read) ECDSA public key (in pubkey hex compressed form) computed
|
||||
What: /sys/firmware/turris-mox-rwtm/ram_size
|
||||
Date: August 2019
|
||||
KernelVersion: 5.4
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) RAM size in MiB of this Turris Mox board as was detected
|
||||
during manufacturing and burned into eFuses. Can be 512 or 1024.
|
||||
Format: %i
|
||||
@ -32,6 +32,6 @@ Description: (Read) RAM size in MiB of this Turris Mox board as was detected
|
||||
What: /sys/firmware/turris-mox-rwtm/serial_number
|
||||
Date: August 2019
|
||||
KernelVersion: 5.4
|
||||
Contact: Marek Behún <marek.behun@nic.cz>
|
||||
Contact: Marek Behún <kabel@kernel.org>
|
||||
Description: (Read) Serial number burned into eFuses of this Turris Mox device.
|
||||
Format: %016X
|
||||
|
@ -276,7 +276,7 @@ Date April 2019
|
||||
Contact: "Daniel Rosenberg" <drosen@google.com>
|
||||
Description: If checkpoint=disable, it displays the number of blocks that
|
||||
are unusable.
|
||||
If checkpoint=enable it displays the enumber of blocks that
|
||||
If checkpoint=enable it displays the number of blocks that
|
||||
would be unusable if checkpoint=disable were to be set.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/encoding
|
||||
@ -409,3 +409,32 @@ Description: Give a way to change checkpoint merge daemon's io priority.
|
||||
I/O priority "3". We can select the class between "rt" and "be",
|
||||
and set the I/O priority within valid range of it. "," delimiter
|
||||
is necessary in between I/O class and priority number.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/ovp_segments
|
||||
Date: March 2021
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Shows the number of overprovision segments.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/compr_written_block
|
||||
Date: March 2021
|
||||
Contact: "Daeho Jeong" <daehojeong@google.com>
|
||||
Description: Show the block count written after compression since mount. Note
|
||||
that when the compressed blocks are deleted, this count doesn't
|
||||
decrease. If you write "0" here, you can initialize
|
||||
compr_written_block and compr_saved_block to "0".
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/compr_saved_block
|
||||
Date: March 2021
|
||||
Contact: "Daeho Jeong" <daehojeong@google.com>
|
||||
Description: Show the saved block count with compression since mount. Note
|
||||
that when the compressed blocks are deleted, this count doesn't
|
||||
decrease. If you write "0" here, you can initialize
|
||||
compr_written_block and compr_saved_block to "0".
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/compr_new_inode
|
||||
Date: March 2021
|
||||
Contact: "Daeho Jeong" <daehojeong@google.com>
|
||||
Description: Show the count of inode newly enabled for compression since mount.
|
||||
Note that when the compression is disabled for the files, this count
|
||||
doesn't decrease. If you write "0" here, you can initialize
|
||||
compr_new_inode to "0".
|
||||
|
@ -33,7 +33,7 @@ Contact: xfs@oss.sgi.com
|
||||
Description:
|
||||
The current state of the log write grant head. It
|
||||
represents the total log reservation of all currently
|
||||
oustanding transactions, including regrants due to
|
||||
outstanding transactions, including regrants due to
|
||||
rolling transactions. The grant head is exported in
|
||||
"cycle:bytes" format.
|
||||
Users: xfstests
|
||||
|
25
Documentation/ABI/testing/sysfs-kernel-mm-cma
Normal file
25
Documentation/ABI/testing/sysfs-kernel-mm-cma
Normal file
@ -0,0 +1,25 @@
|
||||
What: /sys/kernel/mm/cma/
|
||||
Date: Feb 2021
|
||||
Contact: Minchan Kim <minchan@kernel.org>
|
||||
Description:
|
||||
/sys/kernel/mm/cma/ contains a subdirectory for each CMA
|
||||
heap name (also sometimes called CMA areas).
|
||||
|
||||
Each CMA heap subdirectory (that is, each
|
||||
/sys/kernel/mm/cma/<cma-heap-name> directory) contains the
|
||||
following items:
|
||||
|
||||
alloc_pages_success
|
||||
alloc_pages_fail
|
||||
|
||||
What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_success
|
||||
Date: Feb 2021
|
||||
Contact: Minchan Kim <minchan@kernel.org>
|
||||
Description:
|
||||
the number of pages CMA API succeeded to allocate
|
||||
|
||||
What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_fail
|
||||
Date: Feb 2021
|
||||
Contact: Minchan Kim <minchan@kernel.org>
|
||||
Description:
|
||||
the number of pages CMA API failed to allocate
|
20
Documentation/ABI/testing/sysfs-platform-intel-pmc
Normal file
20
Documentation/ABI/testing/sysfs-platform-intel-pmc
Normal file
@ -0,0 +1,20 @@
|
||||
What: /sys/devices/platform/<platform>/etr3
|
||||
Date: Apr 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: "Tomas Winkler" <tomas.winkler@intel.com>
|
||||
Description:
|
||||
The file exposes "Extended Test Mode Register 3" global
|
||||
reset bits. The bits are used during an Intel platform
|
||||
manufacturing process to indicate that consequent reset
|
||||
of the platform is a "global reset". This type of reset
|
||||
is required in order for manufacturing configurations
|
||||
to take effect.
|
||||
|
||||
Display global reset setting bits for PMC.
|
||||
* bit 31 - global reset is locked
|
||||
* bit 20 - global reset is set
|
||||
Writing bit 20 value to the etr3 will induce
|
||||
a platform "global reset" upon consequent platform reset,
|
||||
in case the register is not locked.
|
||||
The "global reset bit" should be locked on a production
|
||||
system and the file is in read-only mode.
|
@ -847,7 +847,7 @@ Symposium on Distributed Computing}
|
||||
'It's entirely possible that the current user could be replaced
|
||||
by RCU and/or seqlocks, and we could get rid of brlocks entirely.'
|
||||
.
|
||||
Steve Hemminger responds by replacing them with RCU.
|
||||
Stephen Hemminger responds by replacing them with RCU.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@ restrictions without needing to sign the files individually.
|
||||
|
||||
The LSM is selectable at build-time with ``CONFIG_SECURITY_LOADPIN``, and
|
||||
can be controlled at boot-time with the kernel command line option
|
||||
"``loadpin.enabled``". By default, it is enabled, but can be disabled at
|
||||
boot ("``loadpin.enabled=0``").
|
||||
"``loadpin.enforce``". By default, it is enabled, but can be disabled at
|
||||
boot ("``loadpin.enforce=0``").
|
||||
|
||||
LoadPin starts pinning when it sees the first file loaded. If the
|
||||
block device backing the filesystem is not read-only, a sysctl is
|
||||
@ -28,4 +28,4 @@ different mechanisms such as ``CONFIG_MODULE_SIG`` and
|
||||
``CONFIG_KEXEC_VERIFY_SIG`` to verify kernel module and kernel image while
|
||||
still use LoadPin to protect the integrity of other files kernel loads. The
|
||||
full list of valid file types can be found in ``kernel_read_file_str``
|
||||
defined in ``include/linux/fs.h``.
|
||||
defined in ``include/linux/kernel_read_file.h``.
|
||||
|
@ -17,6 +17,7 @@ Control Groups version 1
|
||||
hugetlb
|
||||
memcg_test
|
||||
memory
|
||||
misc
|
||||
net_cls
|
||||
net_prio
|
||||
pids
|
||||
|
@ -360,8 +360,8 @@ U != 0, K = unlimited:
|
||||
|
||||
U != 0, K < U:
|
||||
Kernel memory is a subset of the user memory. This setup is useful in
|
||||
deployments where the total amount of memory per-cgroup is overcommited.
|
||||
Overcommiting kernel memory limits is definitely not recommended, since the
|
||||
deployments where the total amount of memory per-cgroup is overcommitted.
|
||||
Overcommitting kernel memory limits is definitely not recommended, since the
|
||||
box can still run out of non-reclaimable memory.
|
||||
In this case, the admin could set up K so that the sum of all groups is
|
||||
never greater than the total memory, and freely set U at the cost of his
|
||||
@ -851,6 +851,9 @@ At reading, current status of OOM is shown.
|
||||
(if 1, oom-killer is disabled)
|
||||
- under_oom 0 or 1
|
||||
(if 1, the memory cgroup is under OOM, tasks may be stopped.)
|
||||
- oom_kill integer counter
|
||||
The number of processes belonging to this cgroup killed by any
|
||||
kind of OOM killer.
|
||||
|
||||
11. Memory Pressure
|
||||
===================
|
||||
|
4
Documentation/admin-guide/cgroup-v1/misc.rst
Normal file
4
Documentation/admin-guide/cgroup-v1/misc.rst
Normal file
@ -0,0 +1,4 @@
|
||||
===============
|
||||
Misc controller
|
||||
===============
|
||||
Please refer "Misc" documentation in Documentation/admin-guide/cgroup-v2.rst
|
@ -65,8 +65,11 @@ v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgrou
|
||||
5-7-1. RDMA Interface Files
|
||||
5-8. HugeTLB
|
||||
5.8-1. HugeTLB Interface Files
|
||||
5-8. Misc
|
||||
5-8-1. perf_event
|
||||
5-9. Misc
|
||||
5.9-1 Miscellaneous cgroup Interface Files
|
||||
5.9-2 Migration and Ownership
|
||||
5-10. Others
|
||||
5-10-1. perf_event
|
||||
5-N. Non-normative information
|
||||
5-N-1. CPU controller root cgroup process behaviour
|
||||
5-N-2. IO controller root cgroup process behaviour
|
||||
@ -2171,6 +2174,72 @@ HugeTLB Interface Files
|
||||
Misc
|
||||
----
|
||||
|
||||
The Miscellaneous cgroup provides the resource limiting and tracking
|
||||
mechanism for the scalar resources which cannot be abstracted like the other
|
||||
cgroup resources. Controller is enabled by the CONFIG_CGROUP_MISC config
|
||||
option.
|
||||
|
||||
A resource can be added to the controller via enum misc_res_type{} in the
|
||||
include/linux/misc_cgroup.h file and the corresponding name via misc_res_name[]
|
||||
in the kernel/cgroup/misc.c file. Provider of the resource must set its
|
||||
capacity prior to using the resource by calling misc_cg_set_capacity().
|
||||
|
||||
Once a capacity is set then the resource usage can be updated using charge and
|
||||
uncharge APIs. All of the APIs to interact with misc controller are in
|
||||
include/linux/misc_cgroup.h.
|
||||
|
||||
Misc Interface Files
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Miscellaneous controller provides 3 interface files. If two misc resources (res_a and res_b) are registered then:
|
||||
|
||||
misc.capacity
|
||||
A read-only flat-keyed file shown only in the root cgroup. It shows
|
||||
miscellaneous scalar resources available on the platform along with
|
||||
their quantities::
|
||||
|
||||
$ cat misc.capacity
|
||||
res_a 50
|
||||
res_b 10
|
||||
|
||||
misc.current
|
||||
A read-only flat-keyed file shown in the non-root cgroups. It shows
|
||||
the current usage of the resources in the cgroup and its children.::
|
||||
|
||||
$ cat misc.current
|
||||
res_a 3
|
||||
res_b 0
|
||||
|
||||
misc.max
|
||||
A read-write flat-keyed file shown in the non root cgroups. Allowed
|
||||
maximum usage of the resources in the cgroup and its children.::
|
||||
|
||||
$ cat misc.max
|
||||
res_a max
|
||||
res_b 4
|
||||
|
||||
Limit can be set by::
|
||||
|
||||
# echo res_a 1 > misc.max
|
||||
|
||||
Limit can be set to max by::
|
||||
|
||||
# echo res_a max > misc.max
|
||||
|
||||
Limits can be set higher than the capacity value in the misc.capacity
|
||||
file.
|
||||
|
||||
Migration and Ownership
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A miscellaneous scalar resource is charged to the cgroup in which it is used
|
||||
first, and stays charged to that cgroup until that resource is freed. Migrating
|
||||
a process to a different cgroup does not move the charge to the destination
|
||||
cgroup where the process has moved.
|
||||
|
||||
Others
|
||||
------
|
||||
|
||||
perf_event
|
||||
~~~~~~~~~~
|
||||
|
||||
|
@ -714,6 +714,7 @@ DebugData Displays information about active CIFS sessions and
|
||||
version.
|
||||
Stats Lists summary resource usage information as well as per
|
||||
share statistics.
|
||||
open_files List all the open file handles on all active SMB sessions.
|
||||
======================= =======================================================
|
||||
|
||||
Configuration pseudo-files:
|
||||
@ -794,6 +795,8 @@ LinuxExtensionsEnabled If set to one then the client will attempt to
|
||||
support and want to map the uid and gid fields
|
||||
to values supplied at mount (rather than the
|
||||
actual values, then set this to zero. (default 1)
|
||||
dfscache List the content of the DFS cache.
|
||||
If set to 0, the client will clear the cache.
|
||||
======================= =======================================================
|
||||
|
||||
These experimental features and tracing can be enabled by changing flags in
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
1 char Memory devices
|
||||
1 = /dev/mem Physical memory access
|
||||
2 = /dev/kmem Kernel virtual memory access
|
||||
2 = /dev/kmem OBSOLETE - replaced by /proc/kcore
|
||||
3 = /dev/null Null device
|
||||
4 = /dev/port I/O port access
|
||||
5 = /dev/zero Null byte source
|
||||
@ -289,7 +289,7 @@
|
||||
152 = /dev/kpoll Kernel Poll Driver
|
||||
153 = /dev/mergemem Memory merge device
|
||||
154 = /dev/pmu Macintosh PowerBook power manager
|
||||
155 = /dev/isictl MultiTech ISICom serial control
|
||||
155 =
|
||||
156 = /dev/lcd Front panel LCD display
|
||||
157 = /dev/ac Applicom Intl Profibus card
|
||||
158 = /dev/nwbutton Netwinder external button
|
||||
@ -477,11 +477,6 @@
|
||||
18 block Sanyo CD-ROM
|
||||
0 = /dev/sjcd Sanyo CD-ROM
|
||||
|
||||
19 char Cyclades serial card
|
||||
0 = /dev/ttyC0 First Cyclades port
|
||||
...
|
||||
31 = /dev/ttyC31 32nd Cyclades port
|
||||
|
||||
19 block "Double" compressed disk
|
||||
0 = /dev/double0 First compressed disk
|
||||
...
|
||||
@ -493,11 +488,6 @@
|
||||
See the Double documentation for the meaning of the
|
||||
mirror devices.
|
||||
|
||||
20 char Cyclades serial card - alternate devices
|
||||
0 = /dev/cub0 Callout device for ttyC0
|
||||
...
|
||||
31 = /dev/cub31 Callout device for ttyC31
|
||||
|
||||
20 block Hitachi CD-ROM (under development)
|
||||
0 = /dev/hitcd Hitachi CD-ROM
|
||||
|
||||
|
@ -347,7 +347,7 @@ Examples
|
||||
<debugfs>/dynamic_debug/control
|
||||
|
||||
// enable messages in files of which the paths include string "usb"
|
||||
nullarbor:~ # echo -n '*usb* +p' > <debugfs>/dynamic_debug/control
|
||||
nullarbor:~ # echo -n 'file *usb* +p' > <debugfs>/dynamic_debug/control
|
||||
|
||||
// enable all messages
|
||||
nullarbor:~ # echo -n '+p' > <debugfs>/dynamic_debug/control
|
||||
|
@ -17,17 +17,18 @@ module.
|
||||
gpio_mockup_ranges
|
||||
|
||||
This parameter takes an argument in the form of an array of integer
|
||||
pairs. Each pair defines the base GPIO number (if any) and the number
|
||||
of lines exposed by the chip. If the base GPIO is -1, the gpiolib
|
||||
will assign it automatically.
|
||||
pairs. Each pair defines the base GPIO number (non-negative integer)
|
||||
and the first number after the last of this chip. If the base GPIO
|
||||
is -1, the gpiolib will assign it automatically. while the following
|
||||
parameter is the number of lines exposed by the chip.
|
||||
|
||||
Example: gpio_mockup_ranges=-1,8,-1,16,405,4
|
||||
Example: gpio_mockup_ranges=-1,8,-1,16,405,409
|
||||
|
||||
The line above creates three chips. The first one will expose 8 lines,
|
||||
the second 16 and the third 4. The base GPIO for the third chip is set
|
||||
to 405 while for two first chips it will be assigned automatically.
|
||||
|
||||
gpio_named_lines
|
||||
gpio_mockup_named_lines
|
||||
|
||||
This parameter doesn't take any arguments. It lets the driver know that
|
||||
GPIO lines exposed by it should be named.
|
||||
|
@ -35,7 +35,6 @@ problems and bugs in particular.
|
||||
:maxdepth: 1
|
||||
|
||||
reporting-issues
|
||||
Reporting bugs (obsolete) <reporting-bugs>
|
||||
security-bugs
|
||||
bug-hunting
|
||||
bug-bisect
|
||||
|
@ -68,6 +68,13 @@ For example one can add to the command line following parameter:
|
||||
|
||||
where the final item represents CPUs 100,101,125,126,150,151,...
|
||||
|
||||
The value "N" can be used to represent the numerically last CPU on the system,
|
||||
i.e "foo_cpus=16-N" would be equivalent to "16-31" on a 32 core system.
|
||||
|
||||
Keep in mind that "N" is dynamic, so if system changes cause the bitmap width
|
||||
to change, such as less cores in the CPU list, then N and any ranges using N
|
||||
will also change. Use the same on a small 4 core system, and "16-N" becomes
|
||||
"16-3" and now the same boot input will be flagged as invalid (start > end).
|
||||
|
||||
|
||||
This document may not be entirely up to date and comprehensive. The command
|
||||
@ -140,6 +147,7 @@ parameter is applicable::
|
||||
PPT Parallel port support is enabled.
|
||||
PS2 Appropriate PS/2 support is enabled.
|
||||
RAM RAM disk support is enabled.
|
||||
RISCV RISCV architecture is enabled.
|
||||
RDT Intel Resource Director Technology.
|
||||
S390 S390 architecture is enabled.
|
||||
SCSI Appropriate SCSI support is enabled.
|
||||
|
@ -50,7 +50,7 @@
|
||||
CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
|
||||
debug output. Bits in debug_layer correspond to a
|
||||
_COMPONENT in an ACPI source file, e.g.,
|
||||
#define _COMPONENT ACPI_PCI_COMPONENT
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
Bits in debug_level correspond to a level in
|
||||
ACPI_DEBUG_PRINT statements, e.g.,
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
|
||||
@ -60,8 +60,6 @@
|
||||
|
||||
Enable processor driver info messages:
|
||||
acpi.debug_layer=0x20000000
|
||||
Enable PCI/PCI interrupt routing info messages:
|
||||
acpi.debug_layer=0x400000
|
||||
Enable AML "Debug" output, i.e., stores to the Debug
|
||||
object while interpreting AML:
|
||||
acpi.debug_layer=0xffffffff acpi.debug_level=0x2
|
||||
@ -784,6 +782,16 @@
|
||||
cs89x0_media= [HW,NET]
|
||||
Format: { rj45 | aui | bnc }
|
||||
|
||||
csdlock_debug= [KNL] Enable debug add-ons of cross-CPU function call
|
||||
handling. When switched on, additional debug data is
|
||||
printed to the console in case a hanging CPU is
|
||||
detected, and that CPU is pinged again in order to try
|
||||
to resolve the hang situation.
|
||||
0: disable csdlock debugging (default)
|
||||
1: enable basic csdlock debugging (minor impact)
|
||||
ext: enable extended csdlock debugging (more impact,
|
||||
but more data)
|
||||
|
||||
dasd= [HW,NET]
|
||||
See header of drivers/s390/block/dasd_devmap.c.
|
||||
|
||||
@ -1461,6 +1469,12 @@
|
||||
Don't use this when you are not running on the
|
||||
android emulator
|
||||
|
||||
gpio-mockup.gpio_mockup_ranges
|
||||
[HW] Sets the ranges of gpiochip of for this device.
|
||||
Format: <start1>,<end1>,<start2>,<end2>...
|
||||
gpio-mockup.gpio_mockup_named_lines
|
||||
[HW] Let the driver know GPIO lines should be named.
|
||||
|
||||
gpt [EFI] Forces disk with valid GPT signature but
|
||||
invalid Protective MBR to be treated as GPT. If the
|
||||
primary GPT is corrupted, it enables the backup/alternate
|
||||
@ -1484,10 +1498,6 @@
|
||||
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
|
||||
Default: 1024
|
||||
|
||||
gpio-mockup.gpio_mockup_ranges
|
||||
[HW] Sets the ranges of gpiochip of for this device.
|
||||
Format: <start1>,<end1>,<start2>,<end2>...
|
||||
|
||||
hardlockup_all_cpu_backtrace=
|
||||
[KNL] Should the hard-lockup detector generate
|
||||
backtraces on all cpus.
|
||||
@ -1825,6 +1835,18 @@
|
||||
initcall functions. Useful for debugging built-in
|
||||
modules and initcalls.
|
||||
|
||||
initramfs_async= [KNL]
|
||||
Format: <bool>
|
||||
Default: 1
|
||||
This parameter controls whether the initramfs
|
||||
image is unpacked asynchronously, concurrently
|
||||
with devices being probed and
|
||||
initialized. This should normally just work,
|
||||
but as a debugging aid, one can get the
|
||||
historical behaviour of the initramfs
|
||||
unpacking being completed before device_ and
|
||||
late_ initcalls.
|
||||
|
||||
initrd= [BOOT] Specify the location of the initial ramdisk
|
||||
|
||||
initrdmem= [KNL] Specify a physical address and size from which to
|
||||
@ -1869,13 +1891,6 @@
|
||||
bypassed by not enabling DMAR with this option. In
|
||||
this case, gfx device will use physical address for
|
||||
DMA.
|
||||
forcedac [X86-64]
|
||||
With this option iommu will not optimize to look
|
||||
for io virtual address below 32-bit forcing dual
|
||||
address cycle on pci bus for cards supporting greater
|
||||
than 32-bit addressing. The default is to look
|
||||
for translation below 32-bit and if not available
|
||||
then look in the higher range.
|
||||
strict [Default Off]
|
||||
With this option on every unmap_single operation will
|
||||
result in a hardware IOTLB flush operation as opposed
|
||||
@ -1964,6 +1979,14 @@
|
||||
nobypass [PPC/POWERNV]
|
||||
Disable IOMMU bypass, using IOMMU for PCI devices.
|
||||
|
||||
iommu.forcedac= [ARM64, X86] Control IOVA allocation for PCI devices.
|
||||
Format: { "0" | "1" }
|
||||
0 - Try to allocate a 32-bit DMA address first, before
|
||||
falling back to the full range if needed.
|
||||
1 - Allocate directly from the full usable range,
|
||||
forcing Dual Address Cycle for PCI cards supporting
|
||||
greater than 32-bit addressing.
|
||||
|
||||
iommu.strict= [ARM64] Configure TLB invalidation behaviour
|
||||
Format: { "0" | "1" }
|
||||
0 - Lazy mode.
|
||||
@ -2279,8 +2302,7 @@
|
||||
state is kept private from the host.
|
||||
Not valid if the kernel is running in EL2.
|
||||
|
||||
Defaults to VHE/nVHE based on hardware support and
|
||||
the value of CONFIG_ARM64_VHE.
|
||||
Defaults to VHE/nVHE based on hardware support.
|
||||
|
||||
kvm-arm.vgic_v3_group0_trap=
|
||||
[KVM,ARM] Trap guest accesses to GICv3 group-0
|
||||
@ -2794,7 +2816,24 @@
|
||||
seconds. Use this parameter to check at some
|
||||
other rate. 0 disables periodic checking.
|
||||
|
||||
memtest= [KNL,X86,ARM,PPC] Enable memtest
|
||||
memory_hotplug.memmap_on_memory
|
||||
[KNL,X86,ARM] Boolean flag to enable this feature.
|
||||
Format: {on | off (default)}
|
||||
When enabled, runtime hotplugged memory will
|
||||
allocate its internal metadata (struct pages)
|
||||
from the hotadded memory which will allow to
|
||||
hotadd a lot of memory without requiring
|
||||
additional memory to do so.
|
||||
This feature is disabled by default because it
|
||||
has some implication on large (e.g. GB)
|
||||
allocations in some configurations (e.g. small
|
||||
memory blocks).
|
||||
The state of the flag can be read in
|
||||
/sys/module/memory_hotplug/parameters/memmap_on_memory.
|
||||
Note that even when enabled, there are a few cases where
|
||||
the feature is not effective.
|
||||
|
||||
memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest
|
||||
Format: <integer>
|
||||
default : 0 <disable>
|
||||
Specifies the number of memtest passes to be
|
||||
@ -3243,6 +3282,8 @@
|
||||
|
||||
nohugeiomap [KNL,X86,PPC,ARM64] Disable kernel huge I/O mappings.
|
||||
|
||||
nohugevmalloc [PPC] Disable kernel huge vmalloc mappings.
|
||||
|
||||
nosmt [KNL,S390] Disable symmetric multithreading (SMT).
|
||||
Equivalent to smt=1.
|
||||
|
||||
@ -3472,7 +3513,8 @@
|
||||
|
||||
nr_uarts= [SERIAL] maximum number of UARTs to be registered.
|
||||
|
||||
numa_balancing= [KNL,X86] Enable or disable automatic NUMA balancing.
|
||||
numa_balancing= [KNL,ARM64,PPC,RISCV,S390,X86] Enable or disable automatic
|
||||
NUMA balancing.
|
||||
Allowed values are enable and disable
|
||||
|
||||
numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
|
||||
@ -3592,6 +3634,96 @@
|
||||
Currently this function knows 686a and 8231 chips.
|
||||
Format: [spp|ps2|epp|ecp|ecpepp]
|
||||
|
||||
pata_legacy.all= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero to probe primary and secondary ISA
|
||||
port ranges on PCI systems where no PCI PATA device
|
||||
has been found at either range. Disabled by default.
|
||||
|
||||
pata_legacy.autospeed= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero if a chip is present that snoops speed
|
||||
changes. Disabled by default.
|
||||
|
||||
pata_legacy.ht6560a= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for HT 6560A on the primary channel,
|
||||
the secondary channel, or both channels respectively.
|
||||
Disabled by default.
|
||||
|
||||
pata_legacy.ht6560b= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for HT 6560B on the primary channel,
|
||||
the secondary channel, or both channels respectively.
|
||||
Disabled by default.
|
||||
|
||||
pata_legacy.iordy_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
IORDY enable mask. Set individual bits to allow IORDY
|
||||
for the respective channel. Bit 0 is for the first
|
||||
legacy channel handled by this driver, bit 1 is for
|
||||
the second channel, and so on. The sequence will often
|
||||
correspond to the primary legacy channel, the secondary
|
||||
legacy channel, and so on, but the handling of a PCI
|
||||
bus and the use of other driver options may interfere
|
||||
with the sequence. By default IORDY is allowed across
|
||||
all channels.
|
||||
|
||||
pata_legacy.opti82c46x= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for Opti 82c611A on the primary
|
||||
channel, the secondary channel, or both channels
|
||||
respectively. Disabled by default.
|
||||
|
||||
pata_legacy.opti82c611a= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for Opti 82c465MV on the primary
|
||||
channel, the secondary channel, or both channels
|
||||
respectively. Disabled by default.
|
||||
|
||||
pata_legacy.pio_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
PIO mode mask for autospeed devices. Set individual
|
||||
bits to allow the use of the respective PIO modes.
|
||||
Bit 0 is for mode 0, bit 1 is for mode 1, and so on.
|
||||
All modes allowed by default.
|
||||
|
||||
pata_legacy.probe_all= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero to probe tertiary and further ISA
|
||||
port ranges on PCI systems. Disabled by default.
|
||||
|
||||
pata_legacy.probe_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Probe mask for legacy ISA PATA ports. Depending on
|
||||
platform configuration and the use of other driver
|
||||
options up to 6 legacy ports are supported: 0x1f0,
|
||||
0x170, 0x1e8, 0x168, 0x1e0, 0x160, however probing
|
||||
of individual ports can be disabled by setting the
|
||||
corresponding bits in the mask to 1. Bit 0 is for
|
||||
the first port in the list above (0x1f0), and so on.
|
||||
By default all supported ports are probed.
|
||||
|
||||
pata_legacy.qdi= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero to probe QDI controllers. By default
|
||||
set to 1 if CONFIG_PATA_QDI_MODULE, 0 otherwise.
|
||||
|
||||
pata_legacy.winbond= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero to probe Winbond controllers. Use
|
||||
the standard I/O port (0x130) if 1, otherwise the
|
||||
value given is the I/O port to use (typically 0x1b0).
|
||||
By default set to 1 if CONFIG_PATA_WINBOND_VLB_MODULE,
|
||||
0 otherwise.
|
||||
|
||||
pata_platform.pio_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Supported PIO mode mask. Set individual bits to allow
|
||||
the use of the respective PIO modes. Bit 0 is for
|
||||
mode 0, bit 1 is for mode 1, and so on. Mode 0 only
|
||||
allowed by default.
|
||||
|
||||
pause_on_oops=
|
||||
Halt all CPUs after the first oops has been printed for
|
||||
the specified number of seconds. This is to be used if
|
||||
@ -4061,6 +4193,17 @@
|
||||
fully seed the kernel's CRNG. Default is controlled
|
||||
by CONFIG_RANDOM_TRUST_CPU.
|
||||
|
||||
randomize_kstack_offset=
|
||||
[KNL] Enable or disable kernel stack offset
|
||||
randomization, which provides roughly 5 bits of
|
||||
entropy, frustrating memory corruption attacks
|
||||
that depend on stack address determinism or
|
||||
cross-syscall address exposures. This is only
|
||||
available on architectures that have defined
|
||||
CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET.
|
||||
Format: <bool> (1/Y/y=enable, 0/N/n=disable)
|
||||
Default is CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT.
|
||||
|
||||
ras=option[,option,...] [KNL] RAS-specific options
|
||||
|
||||
cec_disable [X86]
|
||||
@ -4068,9 +4211,7 @@
|
||||
see CONFIG_RAS_CEC help text.
|
||||
|
||||
rcu_nocbs= [KNL]
|
||||
The argument is a cpu list, as described above,
|
||||
except that the string "all" can be used to
|
||||
specify every CPU on the system.
|
||||
The argument is a cpu list, as described above.
|
||||
|
||||
In kernels built with CONFIG_RCU_NOCB_CPU=y, set
|
||||
the specified list of CPUs to be no-callback CPUs.
|
||||
@ -4259,6 +4400,18 @@
|
||||
rcuscale.kfree_rcu_test= [KNL]
|
||||
Set to measure performance of kfree_rcu() flooding.
|
||||
|
||||
rcuscale.kfree_rcu_test_double= [KNL]
|
||||
Test the double-argument variant of kfree_rcu().
|
||||
If this parameter has the same value as
|
||||
rcuscale.kfree_rcu_test_single, both the single-
|
||||
and double-argument variants are tested.
|
||||
|
||||
rcuscale.kfree_rcu_test_single= [KNL]
|
||||
Test the single-argument variant of kfree_rcu().
|
||||
If this parameter has the same value as
|
||||
rcuscale.kfree_rcu_test_double, both the single-
|
||||
and double-argument variants are tested.
|
||||
|
||||
rcuscale.kfree_nthreads= [KNL]
|
||||
The number of threads running loops of kfree_rcu().
|
||||
|
||||
@ -4725,7 +4878,7 @@
|
||||
|
||||
sbni= [NET] Granch SBNI12 leased line adapter
|
||||
|
||||
sched_debug [KNL] Enables verbose scheduler debug messages.
|
||||
sched_verbose [KNL] Enables verbose scheduler debug messages.
|
||||
|
||||
schedstats= [KNL,X86] Enable or disable scheduled statistics.
|
||||
Allowed values are enable and disable. This feature
|
||||
@ -4877,6 +5030,10 @@
|
||||
|
||||
slram= [HW,MTD]
|
||||
|
||||
slab_merge [MM]
|
||||
Enable merging of slabs with similar size when the
|
||||
kernel is built without CONFIG_SLAB_MERGE_DEFAULT.
|
||||
|
||||
slab_nomerge [MM]
|
||||
Disable merging of slabs with similar size. May be
|
||||
necessary if there is some reason to distinguish
|
||||
@ -4924,6 +5081,9 @@
|
||||
lower than slub_max_order.
|
||||
For more information see Documentation/vm/slub.rst.
|
||||
|
||||
slub_merge [MM, SLUB]
|
||||
Same with slab_merge.
|
||||
|
||||
slub_nomerge [MM, SLUB]
|
||||
Same with slab_nomerge. This is supported for legacy.
|
||||
See slab_nomerge for more information.
|
||||
@ -5100,27 +5260,37 @@
|
||||
spia_peddr=
|
||||
|
||||
split_lock_detect=
|
||||
[X86] Enable split lock detection
|
||||
[X86] Enable split lock detection or bus lock detection
|
||||
|
||||
When enabled (and if hardware support is present), atomic
|
||||
instructions that access data across cache line
|
||||
boundaries will result in an alignment check exception.
|
||||
boundaries will result in an alignment check exception
|
||||
for split lock detection or a debug exception for
|
||||
bus lock detection.
|
||||
|
||||
off - not enabled
|
||||
|
||||
warn - the kernel will emit rate limited warnings
|
||||
warn - the kernel will emit rate-limited warnings
|
||||
about applications triggering the #AC
|
||||
exception. This mode is the default on CPUs
|
||||
that supports split lock detection.
|
||||
exception or the #DB exception. This mode is
|
||||
the default on CPUs that support split lock
|
||||
detection or bus lock detection. Default
|
||||
behavior is by #AC if both features are
|
||||
enabled in hardware.
|
||||
|
||||
fatal - the kernel will send SIGBUS to applications
|
||||
that trigger the #AC exception.
|
||||
that trigger the #AC exception or the #DB
|
||||
exception. Default behavior is by #AC if
|
||||
both features are enabled in hardware.
|
||||
|
||||
If an #AC exception is hit in the kernel or in
|
||||
firmware (i.e. not while executing in user mode)
|
||||
the kernel will oops in either "warn" or "fatal"
|
||||
mode.
|
||||
|
||||
#DB exception for bus lock is triggered only when
|
||||
CPL > 0.
|
||||
|
||||
srbds= [X86,INTEL]
|
||||
Control the Special Register Buffer Data Sampling
|
||||
(SRBDS) mitigation.
|
||||
@ -5462,6 +5632,18 @@
|
||||
See Documentation/admin-guide/mm/transhuge.rst
|
||||
for more details.
|
||||
|
||||
trusted.source= [KEYS]
|
||||
Format: <string>
|
||||
This parameter identifies the trust source as a backend
|
||||
for trusted keys implementation. Supported trust
|
||||
sources:
|
||||
- "tpm"
|
||||
- "tee"
|
||||
If not specified then it defaults to iterating through
|
||||
the trust source list starting with TPM and assigns the
|
||||
first trust source as a backend which is initialized
|
||||
successfully during iteration.
|
||||
|
||||
tsc= Disable clocksource stability checks for TSC.
|
||||
Format: <string>
|
||||
[x86] reliable: mark tsc clocksource as reliable, this
|
||||
|
@ -332,23 +332,3 @@ To reduce its OS jitter, do at least one of the following:
|
||||
kthreads from being created in the first place. However, please
|
||||
note that this will not eliminate OS jitter, but will instead
|
||||
shift it to RCU_SOFTIRQ.
|
||||
|
||||
Name:
|
||||
watchdog/%u
|
||||
|
||||
Purpose:
|
||||
Detect software lockups on each CPU.
|
||||
|
||||
To reduce its OS jitter, do at least one of the following:
|
||||
|
||||
1. Build with CONFIG_LOCKUP_DETECTOR=n, which will prevent these
|
||||
kthreads from being created in the first place.
|
||||
2. Boot with "nosoftlockup=0", which will also prevent these kthreads
|
||||
from being created. Other related watchdog and softlockup boot
|
||||
parameters may be found in Documentation/admin-guide/kernel-parameters.rst
|
||||
and Documentation/watchdog/watchdog-parameters.rst.
|
||||
3. Echo a zero to /proc/sys/kernel/watchdog to disable the
|
||||
watchdog timer.
|
||||
4. Echo a large number of /proc/sys/kernel/watchdog_thresh in
|
||||
order to reduce the frequency of OS jitter due to the watchdog
|
||||
timer down to a level that is acceptable for your workload.
|
||||
|
@ -52,6 +52,7 @@ detailed description):
|
||||
- LCD Shadow (PrivacyGuard) enable and disable
|
||||
- Lap mode sensor
|
||||
- Setting keyboard language
|
||||
- WWAN Antenna type
|
||||
|
||||
A compatibility table by model and feature is maintained on the web
|
||||
site, http://ibm-acpi.sf.net/. I appreciate any success or failure
|
||||
@ -1490,6 +1491,25 @@ fr(French), fr-ch(French(Switzerland)), hu(Hungarian), it(Italy), jp (Japan),
|
||||
nl(Dutch), nn(Norway), pl(Polish), pt(portugese), sl(Slovenian), sv(Sweden),
|
||||
tr(Turkey)
|
||||
|
||||
WWAN Antenna type
|
||||
-----------------
|
||||
|
||||
sysfs: wwan_antenna_type
|
||||
|
||||
On some newer Thinkpads we need to set SAR value based on the antenna
|
||||
type. This interface will be used by userspace to get the antenna type
|
||||
and set the corresponding SAR value, as is required for FCC certification.
|
||||
|
||||
The available commands are::
|
||||
|
||||
cat /sys/devices/platform/thinkpad_acpi/wwan_antenna_type
|
||||
|
||||
Currently 2 antenna types are supported as mentioned below:
|
||||
- type a
|
||||
- type b
|
||||
|
||||
The property is read-only. If the platform doesn't have support the sysfs
|
||||
class is not created.
|
||||
|
||||
Adaptive keyboard
|
||||
-----------------
|
||||
|
@ -357,6 +357,15 @@ creates ZONE_MOVABLE as following.
|
||||
Unfortunately, there is no information to show which memory block belongs
|
||||
to ZONE_MOVABLE. This is TBD.
|
||||
|
||||
.. note::
|
||||
Techniques that rely on long-term pinnings of memory (especially, RDMA and
|
||||
vfio) are fundamentally problematic with ZONE_MOVABLE and, therefore, memory
|
||||
hot remove. Pinned pages cannot reside on ZONE_MOVABLE, to guarantee that
|
||||
memory can still get hot removed - be aware that pinning can fail even if
|
||||
there is plenty of free memory in ZONE_MOVABLE. In addition, using
|
||||
ZONE_MOVABLE might make page pinning more expensive, because pages have to be
|
||||
migrated off that zone first.
|
||||
|
||||
.. _memory_hotplug_how_to_offline_memory:
|
||||
|
||||
How to offline memory
|
||||
|
@ -151,7 +151,7 @@ Each cache level's directory provides its attributes. For example, the
|
||||
following shows a single cache level and the attributes available for
|
||||
software to query::
|
||||
|
||||
# tree sys/devices/system/node/node0/memory_side_cache/
|
||||
# tree /sys/devices/system/node/node0/memory_side_cache/
|
||||
/sys/devices/system/node/node0/memory_side_cache/
|
||||
|-- index1
|
||||
| |-- indexing
|
||||
|
@ -402,7 +402,7 @@ compact_fail
|
||||
but failed.
|
||||
|
||||
It is possible to establish how long the stalls were using the function
|
||||
tracer to record how long was spent in __alloc_pages_nodemask and
|
||||
tracer to record how long was spent in __alloc_pages() and
|
||||
using the mm_page_alloc tracepoint to identify which allocations were
|
||||
for huge pages.
|
||||
|
||||
|
@ -63,36 +63,36 @@ the generic ioctl available.
|
||||
|
||||
The ``uffdio_api.features`` bitmask returned by the ``UFFDIO_API`` ioctl
|
||||
defines what memory types are supported by the ``userfaultfd`` and what
|
||||
events, except page fault notifications, may be generated.
|
||||
events, except page fault notifications, may be generated:
|
||||
|
||||
If the kernel supports registering ``userfaultfd`` ranges on hugetlbfs
|
||||
virtual memory areas, ``UFFD_FEATURE_MISSING_HUGETLBFS`` will be set in
|
||||
``uffdio_api.features``. Similarly, ``UFFD_FEATURE_MISSING_SHMEM`` will be
|
||||
set if the kernel supports registering ``userfaultfd`` ranges on shared
|
||||
memory (covering all shmem APIs, i.e. tmpfs, ``IPCSHM``, ``/dev/zero``,
|
||||
``MAP_SHARED``, ``memfd_create``, etc).
|
||||
- The ``UFFD_FEATURE_EVENT_*`` flags indicate that various other events
|
||||
other than page faults are supported. These events are described in more
|
||||
detail below in the `Non-cooperative userfaultfd`_ section.
|
||||
|
||||
The userland application that wants to use ``userfaultfd`` with hugetlbfs
|
||||
or shared memory need to set the corresponding flag in
|
||||
``uffdio_api.features`` to enable those features.
|
||||
- ``UFFD_FEATURE_MISSING_HUGETLBFS`` and ``UFFD_FEATURE_MISSING_SHMEM``
|
||||
indicate that the kernel supports ``UFFDIO_REGISTER_MODE_MISSING``
|
||||
registrations for hugetlbfs and shared memory (covering all shmem APIs,
|
||||
i.e. tmpfs, ``IPCSHM``, ``/dev/zero``, ``MAP_SHARED``, ``memfd_create``,
|
||||
etc) virtual memory areas, respectively.
|
||||
|
||||
If the userland desires to receive notifications for events other than
|
||||
page faults, it has to verify that ``uffdio_api.features`` has appropriate
|
||||
``UFFD_FEATURE_EVENT_*`` bits set. These events are described in more
|
||||
detail below in `Non-cooperative userfaultfd`_ section.
|
||||
- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
|
||||
``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
|
||||
areas.
|
||||
|
||||
Once the ``userfaultfd`` has been enabled the ``UFFDIO_REGISTER`` ioctl should
|
||||
be invoked (if present in the returned ``uffdio_api.ioctls`` bitmask) to
|
||||
register a memory range in the ``userfaultfd`` by setting the
|
||||
The userland application should set the feature flags it intends to use
|
||||
when invoking the ``UFFDIO_API`` ioctl, to request that those features be
|
||||
enabled if supported.
|
||||
|
||||
Once the ``userfaultfd`` API has been enabled the ``UFFDIO_REGISTER``
|
||||
ioctl should be invoked (if present in the returned ``uffdio_api.ioctls``
|
||||
bitmask) to register a memory range in the ``userfaultfd`` by setting the
|
||||
uffdio_register structure accordingly. The ``uffdio_register.mode``
|
||||
bitmask will specify to the kernel which kind of faults to track for
|
||||
the range (``UFFDIO_REGISTER_MODE_MISSING`` would track missing
|
||||
pages). The ``UFFDIO_REGISTER`` ioctl will return the
|
||||
the range. The ``UFFDIO_REGISTER`` ioctl will return the
|
||||
``uffdio_register.ioctls`` bitmask of ioctls that are suitable to resolve
|
||||
userfaults on the range registered. Not all ioctls will necessarily be
|
||||
supported for all memory types depending on the underlying virtual
|
||||
memory backend (anonymous memory vs tmpfs vs real filebacked
|
||||
mappings).
|
||||
supported for all memory types (e.g. anonymous memory vs. shmem vs.
|
||||
hugetlbfs), or all types of intercepted faults.
|
||||
|
||||
Userland can use the ``uffdio_register.ioctls`` to manage the virtual
|
||||
address space in the background (to add or potentially also remove
|
||||
@ -100,21 +100,46 @@ memory from the ``userfaultfd`` registered range). This means a userfault
|
||||
could be triggering just before userland maps in the background the
|
||||
user-faulted page.
|
||||
|
||||
The primary ioctl to resolve userfaults is ``UFFDIO_COPY``. That
|
||||
atomically copies a page into the userfault registered range and wakes
|
||||
up the blocked userfaults
|
||||
(unless ``uffdio_copy.mode & UFFDIO_COPY_MODE_DONTWAKE`` is set).
|
||||
Other ioctl works similarly to ``UFFDIO_COPY``. They're atomic as in
|
||||
guaranteeing that nothing can see an half copied page since it'll
|
||||
keep userfaulting until the copy has finished.
|
||||
Resolving Userfaults
|
||||
--------------------
|
||||
|
||||
There are three basic ways to resolve userfaults:
|
||||
|
||||
- ``UFFDIO_COPY`` atomically copies some existing page contents from
|
||||
userspace.
|
||||
|
||||
- ``UFFDIO_ZEROPAGE`` atomically zeros the new page.
|
||||
|
||||
- ``UFFDIO_CONTINUE`` maps an existing, previously-populated page.
|
||||
|
||||
These operations are atomic in the sense that they guarantee nothing can
|
||||
see a half-populated page, since readers will keep userfaulting until the
|
||||
operation has finished.
|
||||
|
||||
By default, these wake up userfaults blocked on the range in question.
|
||||
They support a ``UFFDIO_*_MODE_DONTWAKE`` ``mode`` flag, which indicates
|
||||
that waking will be done separately at some later time.
|
||||
|
||||
Which ioctl to choose depends on the kind of page fault, and what we'd
|
||||
like to do to resolve it:
|
||||
|
||||
- For ``UFFDIO_REGISTER_MODE_MISSING`` faults, the fault needs to be
|
||||
resolved by either providing a new page (``UFFDIO_COPY``), or mapping
|
||||
the zero page (``UFFDIO_ZEROPAGE``). By default, the kernel would map
|
||||
the zero page for a missing fault. With userfaultfd, userspace can
|
||||
decide what content to provide before the faulting thread continues.
|
||||
|
||||
- For ``UFFDIO_REGISTER_MODE_MINOR`` faults, there is an existing page (in
|
||||
the page cache). Userspace has the option of modifying the page's
|
||||
contents before resolving the fault. Once the contents are correct
|
||||
(modified or not), userspace asks the kernel to map the page and let the
|
||||
faulting thread continue with ``UFFDIO_CONTINUE``.
|
||||
|
||||
Notes:
|
||||
|
||||
- If you requested ``UFFDIO_REGISTER_MODE_MISSING`` when registering then
|
||||
you must provide some kind of page in your thread after reading from
|
||||
the uffd. You must provide either ``UFFDIO_COPY`` or ``UFFDIO_ZEROPAGE``.
|
||||
The normal behavior of the OS automatically providing a zero page on
|
||||
an anonymous mmaping is not in place.
|
||||
- You can tell which kind of fault occurred by examining
|
||||
``pagefault.flags`` within the ``uffd_msg``, checking for the
|
||||
``UFFD_PAGEFAULT_FLAG_*`` flags.
|
||||
|
||||
- None of the page-delivering ioctls default to the range that you
|
||||
registered with. You must fill in all fields for the appropriate
|
||||
@ -122,9 +147,9 @@ Notes:
|
||||
|
||||
- You get the address of the access that triggered the missing page
|
||||
event out of a struct uffd_msg that you read in the thread from the
|
||||
uffd. You can supply as many pages as you want with ``UFFDIO_COPY`` or
|
||||
``UFFDIO_ZEROPAGE``. Keep in mind that unless you used DONTWAKE then
|
||||
the first of any of those IOCTLs wakes up the faulting thread.
|
||||
uffd. You can supply as many pages as you want with these IOCTLs.
|
||||
Keep in mind that unless you used DONTWAKE then the first of any of
|
||||
those IOCTLs wakes up the faulting thread.
|
||||
|
||||
- Be sure to test for all errors including
|
||||
(``pollfd[0].revents & POLLERR``). This can happen, e.g. when ranges
|
||||
|
@ -53,6 +53,60 @@ Example usage of perf::
|
||||
$# perf stat -a -e hisi_sccl3_l3c0/rd_hit_cpipe/ sleep 5
|
||||
$# perf stat -a -e hisi_sccl3_l3c0/config=0x02/ sleep 5
|
||||
|
||||
For HiSilicon uncore PMU v2 whose identifier is 0x30, the topology is the same
|
||||
as PMU v1, but some new functions are added to the hardware.
|
||||
|
||||
(a) L3C PMU supports filtering by core/thread within the cluster which can be
|
||||
specified as a bitmap::
|
||||
|
||||
$# perf stat -a -e hisi_sccl3_l3c0/config=0x02,tt_core=0x3/ sleep 5
|
||||
|
||||
This will only count the operations from core/thread 0 and 1 in this cluster.
|
||||
|
||||
(b) Tracetag allow the user to chose to count only read, write or atomic
|
||||
operations via the tt_req parameeter in perf. The default value counts all
|
||||
operations. tt_req is 3bits, 3'b100 represents read operations, 3'b101
|
||||
represents write operations, 3'b110 represents atomic store operations and
|
||||
3'b111 represents atomic non-store operations, other values are reserved::
|
||||
|
||||
$# perf stat -a -e hisi_sccl3_l3c0/config=0x02,tt_req=0x4/ sleep 5
|
||||
|
||||
This will only count the read operations in this cluster.
|
||||
|
||||
(c) Datasrc allows the user to check where the data comes from. It is 5 bits.
|
||||
Some important codes are as follows:
|
||||
5'b00001: comes from L3C in this die;
|
||||
5'b01000: comes from L3C in the cross-die;
|
||||
5'b01001: comes from L3C which is in another socket;
|
||||
5'b01110: comes from the local DDR;
|
||||
5'b01111: comes from the cross-die DDR;
|
||||
5'b10000: comes from cross-socket DDR;
|
||||
etc, it is mainly helpful to find that the data source is nearest from the CPU
|
||||
cores. If datasrc_cfg is used in the multi-chips, the datasrc_skt shall be
|
||||
configured in perf command::
|
||||
|
||||
$# perf stat -a -e hisi_sccl3_l3c0/config=0xb9,datasrc_cfg=0xE/,
|
||||
hisi_sccl3_l3c0/config=0xb9,datasrc_cfg=0xF/ sleep 5
|
||||
|
||||
(d)Some HiSilicon SoCs encapsulate multiple CPU and IO dies. Each CPU die
|
||||
contains several Compute Clusters (CCLs). The I/O dies are called Super I/O
|
||||
clusters (SICL) containing multiple I/O clusters (ICLs). Each CCL/ICL in the
|
||||
SoC has a unique ID. Each ID is 11bits, include a 6-bit SCCL-ID and 5-bit
|
||||
CCL/ICL-ID. For I/O die, the ICL-ID is followed by:
|
||||
5'b00000: I/O_MGMT_ICL;
|
||||
5'b00001: Network_ICL;
|
||||
5'b00011: HAC_ICL;
|
||||
5'b10000: PCIe_ICL;
|
||||
|
||||
Users could configure IDs to count data come from specific CCL/ICL, by setting
|
||||
srcid_cmd & srcid_msk, and data desitined for specific CCL/ICL by setting
|
||||
tgtid_cmd & tgtid_msk. A set bit in srcid_msk/tgtid_msk means the PMU will not
|
||||
check the bit when matching against the srcid_cmd/tgtid_cmd.
|
||||
|
||||
If all of these options are disabled, it can works by the default value that
|
||||
doesn't distinguish the filter condition and ID information and will return
|
||||
the total counter values in the PMU counters.
|
||||
|
||||
The current driver does not support sampling. So "perf record" is unsupported.
|
||||
Also attach to a task is unsupported as the events are all uncore.
|
||||
|
||||
|
@ -3,7 +3,7 @@ Ramoops oops/panic logger
|
||||
|
||||
Sergiu Iordache <sergiu@chromium.org>
|
||||
|
||||
Updated: 17 November 2011
|
||||
Updated: 10 Feb 2021
|
||||
|
||||
Introduction
|
||||
------------
|
||||
@ -30,6 +30,8 @@ mapping to pgprot_writecombine. Setting ``mem_type=1`` attempts to use
|
||||
depends on atomic operations. At least on ARM, pgprot_noncached causes the
|
||||
memory to be mapped strongly ordered, and atomic operations on strongly ordered
|
||||
memory are implementation defined, and won't work on many ARMs such as omaps.
|
||||
Setting ``mem_type=2`` attempts to treat the memory region as normal memory,
|
||||
which enables full cache on it. This can improve the performance.
|
||||
|
||||
The memory area is divided into ``record_size`` chunks (also rounded down to
|
||||
power of two) and each kmesg dump writes a ``record_size`` chunk of
|
||||
|
@ -1,187 +0,0 @@
|
||||
.. _reportingbugs:
|
||||
|
||||
.. note::
|
||||
|
||||
This document is obsolete, and will be replaced by
|
||||
'Documentation/admin-guide/reporting-issues.rst' in the near future.
|
||||
|
||||
Reporting bugs
|
||||
++++++++++++++
|
||||
|
||||
Background
|
||||
==========
|
||||
|
||||
The upstream Linux kernel maintainers only fix bugs for specific kernel
|
||||
versions. Those versions include the current "release candidate" (or -rc)
|
||||
kernel, any "stable" kernel versions, and any "long term" kernels.
|
||||
|
||||
Please see https://www.kernel.org/ for a list of supported kernels. Any
|
||||
kernel marked with [EOL] is "end of life" and will not have any fixes
|
||||
backported to it.
|
||||
|
||||
If you've found a bug on a kernel version that isn't listed on kernel.org,
|
||||
contact your Linux distribution or embedded vendor for support.
|
||||
Alternatively, you can attempt to run one of the supported stable or -rc
|
||||
kernels, and see if you can reproduce the bug on that. It's preferable
|
||||
to reproduce the bug on the latest -rc kernel.
|
||||
|
||||
|
||||
How to report Linux kernel bugs
|
||||
===============================
|
||||
|
||||
|
||||
Identify the problematic subsystem
|
||||
----------------------------------
|
||||
|
||||
Identifying which part of the Linux kernel might be causing your issue
|
||||
increases your chances of getting your bug fixed. Simply posting to the
|
||||
generic linux-kernel mailing list (LKML) may cause your bug report to be
|
||||
lost in the noise of a mailing list that gets 1000+ emails a day.
|
||||
|
||||
Instead, try to figure out which kernel subsystem is causing the issue,
|
||||
and email that subsystem's maintainer and mailing list. If the subsystem
|
||||
maintainer doesn't answer, then expand your scope to mailing lists like
|
||||
LKML.
|
||||
|
||||
|
||||
Identify who to notify
|
||||
----------------------
|
||||
|
||||
Once you know the subsystem that is causing the issue, you should send a
|
||||
bug report. Some maintainers prefer bugs to be reported via bugzilla
|
||||
(https://bugzilla.kernel.org), while others prefer that bugs be reported
|
||||
via the subsystem mailing list.
|
||||
|
||||
To find out where to send an emailed bug report, find your subsystem or
|
||||
device driver in the MAINTAINERS file. Search in the file for relevant
|
||||
entries, and send your bug report to the person(s) listed in the "M:"
|
||||
lines, making sure to Cc the mailing list(s) in the "L:" lines. When the
|
||||
maintainer replies to you, make sure to 'Reply-all' in order to keep the
|
||||
public mailing list(s) in the email thread.
|
||||
|
||||
If you know which driver is causing issues, you can pass one of the driver
|
||||
files to the get_maintainer.pl script::
|
||||
|
||||
perl scripts/get_maintainer.pl -f <filename>
|
||||
|
||||
If it is a security bug, please copy the Security Contact listed in the
|
||||
MAINTAINERS file. They can help coordinate bugfix and disclosure. See
|
||||
:ref:`Documentation/admin-guide/security-bugs.rst <securitybugs>` for more information.
|
||||
|
||||
If you can't figure out which subsystem caused the issue, you should file
|
||||
a bug in kernel.org bugzilla and send email to
|
||||
linux-kernel@vger.kernel.org, referencing the bugzilla URL. (For more
|
||||
information on the linux-kernel mailing list see
|
||||
http://vger.kernel.org/lkml/).
|
||||
|
||||
|
||||
Tips for reporting bugs
|
||||
-----------------------
|
||||
|
||||
If you haven't reported a bug before, please read:
|
||||
|
||||
https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
|
||||
|
||||
http://www.catb.org/esr/faqs/smart-questions.html
|
||||
|
||||
It's REALLY important to report bugs that seem unrelated as separate email
|
||||
threads or separate bugzilla entries. If you report several unrelated
|
||||
bugs at once, it's difficult for maintainers to tease apart the relevant
|
||||
data.
|
||||
|
||||
|
||||
Gather information
|
||||
------------------
|
||||
|
||||
The most important information in a bug report is how to reproduce the
|
||||
bug. This includes system information, and (most importantly)
|
||||
step-by-step instructions for how a user can trigger the bug.
|
||||
|
||||
If the failure includes an "OOPS:", take a picture of the screen, capture
|
||||
a netconsole trace, or type the message from your screen into the bug
|
||||
report. Please read "Documentation/admin-guide/bug-hunting.rst" before posting your
|
||||
bug report. This explains what you should do with the "Oops" information
|
||||
to make it useful to the recipient.
|
||||
|
||||
This is a suggested format for a bug report sent via email or bugzilla.
|
||||
Having a standardized bug report form makes it easier for you not to
|
||||
overlook things, and easier for the developers to find the pieces of
|
||||
information they're really interested in. If some information is not
|
||||
relevant to your bug, feel free to exclude it.
|
||||
|
||||
First run the ver_linux script included as scripts/ver_linux, which
|
||||
reports the version of some important subsystems. Run this script with
|
||||
the command ``awk -f scripts/ver_linux``.
|
||||
|
||||
Use that information to fill in all fields of the bug report form, and
|
||||
post it to the mailing list with a subject of "PROBLEM: <one line
|
||||
summary from [1.]>" for easy identification by the developers::
|
||||
|
||||
[1.] One line summary of the problem:
|
||||
[2.] Full description of the problem/report:
|
||||
[3.] Keywords (i.e., modules, networking, kernel):
|
||||
[4.] Kernel information
|
||||
[4.1.] Kernel version (from /proc/version):
|
||||
[4.2.] Kernel .config file:
|
||||
[5.] Most recent kernel version which did not have the bug:
|
||||
[6.] Output of Oops.. message (if applicable) with symbolic information
|
||||
resolved (see Documentation/admin-guide/bug-hunting.rst)
|
||||
[7.] A small shell script or example program which triggers the
|
||||
problem (if possible)
|
||||
[8.] Environment
|
||||
[8.1.] Software (add the output of the ver_linux script here)
|
||||
[8.2.] Processor information (from /proc/cpuinfo):
|
||||
[8.3.] Module information (from /proc/modules):
|
||||
[8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
|
||||
[8.5.] PCI information ('lspci -vvv' as root)
|
||||
[8.6.] SCSI information (from /proc/scsi/scsi)
|
||||
[8.7.] Other information that might be relevant to the problem
|
||||
(please look in /proc and include all information that you
|
||||
think to be relevant):
|
||||
[X.] Other notes, patches, fixes, workarounds:
|
||||
|
||||
|
||||
Follow up
|
||||
=========
|
||||
|
||||
Expectations for bug reporters
|
||||
------------------------------
|
||||
|
||||
Linux kernel maintainers expect bug reporters to be able to follow up on
|
||||
bug reports. That may include running new tests, applying patches,
|
||||
recompiling your kernel, and/or re-triggering your bug. The most
|
||||
frustrating thing for maintainers is for someone to report a bug, and then
|
||||
never follow up on a request to try out a fix.
|
||||
|
||||
That said, it's still useful for a kernel maintainer to know a bug exists
|
||||
on a supported kernel, even if you can't follow up with retests. Follow
|
||||
up reports, such as replying to the email thread with "I tried the latest
|
||||
kernel and I can't reproduce my bug anymore" are also helpful, because
|
||||
maintainers have to assume silence means things are still broken.
|
||||
|
||||
Expectations for kernel maintainers
|
||||
-----------------------------------
|
||||
|
||||
Linux kernel maintainers are busy, overworked human beings. Some times
|
||||
they may not be able to address your bug in a day, a week, or two weeks.
|
||||
If they don't answer your email, they may be on vacation, or at a Linux
|
||||
conference. Check the conference schedule at https://LWN.net for more info:
|
||||
|
||||
https://lwn.net/Calendar/
|
||||
|
||||
In general, kernel maintainers take 1 to 5 business days to respond to
|
||||
bugs. The majority of kernel maintainers are employed to work on the
|
||||
kernel, and they may not work on the weekends. Maintainers are scattered
|
||||
around the world, and they may not work in your time zone. Unless you
|
||||
have a high priority bug, please wait at least a week after the first bug
|
||||
report before sending the maintainer a reminder email.
|
||||
|
||||
The exceptions to this rule are regressions, kernel crashes, security holes,
|
||||
or userspace breakage caused by new kernel behavior. Those bugs should be
|
||||
addressed by the maintainers ASAP. If you suspect a maintainer is not
|
||||
responding to these types of bugs in a timely manner (especially during a
|
||||
merge window), escalate the bug to LKML and Linus Torvalds.
|
||||
|
||||
Thank you!
|
||||
|
||||
[Some of this is taken from Frohwalt Egerer's original linux-kernel FAQ]
|
File diff suppressed because it is too large
Load Diff
@ -64,6 +64,7 @@ two flavors of JITs, the newer eBPF JIT currently supported on:
|
||||
- arm64
|
||||
- arm32
|
||||
- ppc64
|
||||
- ppc32
|
||||
- sparc64
|
||||
- mips64
|
||||
- s390x
|
||||
@ -73,7 +74,6 @@ two flavors of JITs, the newer eBPF JIT currently supported on:
|
||||
And the older cBPF JIT supported on the following archs:
|
||||
|
||||
- mips
|
||||
- ppc
|
||||
- sparc
|
||||
|
||||
eBPF JITs are a superset of cBPF JITs, meaning the kernel will
|
||||
@ -311,6 +311,17 @@ permit to distribute the load on several cpus.
|
||||
If set to 1 (default), timestamps are sampled as soon as possible, before
|
||||
queueing.
|
||||
|
||||
netdev_unregister_timeout_secs
|
||||
------------------------------
|
||||
|
||||
Unregister network device timeout in seconds.
|
||||
This option controls the timeout (in seconds) used to issue a warning while
|
||||
waiting for a network device refcount to drop to 0 during device
|
||||
unregistration. A lower value may be useful during bisection to detect
|
||||
a leaked reference faster. A larger value may be useful to prevent false
|
||||
warnings on slow/loaded systems.
|
||||
Default value is 10, minimum 1, maximum 3600.
|
||||
|
||||
optmem_max
|
||||
----------
|
||||
|
||||
|
@ -90,8 +90,8 @@ Command Function
|
||||
``b`` Will immediately reboot the system without syncing or unmounting
|
||||
your disks.
|
||||
|
||||
``c`` Will perform a system crash by a NULL pointer dereference.
|
||||
A crashdump will be taken if configured.
|
||||
``c`` Will perform a system crash and a crashdump will be taken
|
||||
if configured.
|
||||
|
||||
``d`` Shows all locks that are held.
|
||||
|
||||
|
@ -522,7 +522,7 @@ and the short name of the data device. They all can be found in:
|
||||
================ ===========
|
||||
xfs_iwalk-$pid Inode scans of the entire filesystem. Currently limited to
|
||||
mount time quotacheck.
|
||||
xfs-blockgc Background garbage collection of disk space that have been
|
||||
xfs-gc Background garbage collection of disk space that have been
|
||||
speculatively allocated beyond EOF or for staging copy on
|
||||
write operations.
|
||||
================ ===========
|
||||
|
26
Documentation/arch.rst
Normal file
26
Documentation/arch.rst
Normal file
@ -0,0 +1,26 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
CPU Architectures
|
||||
=================
|
||||
|
||||
These books provide programming details about architecture-specific
|
||||
implementation.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
arm/index
|
||||
arm64/index
|
||||
ia64/index
|
||||
m68k/index
|
||||
mips/index
|
||||
nios2/index
|
||||
openrisc/index
|
||||
parisc/index
|
||||
powerpc/index
|
||||
riscv/index
|
||||
s390/index
|
||||
sh/index
|
||||
sparc/index
|
||||
x86/index
|
||||
xtensa/index
|
@ -52,6 +52,7 @@ SoC-specific documents
|
||||
stm32/stm32f746-overview
|
||||
stm32/overview
|
||||
stm32/stm32h743-overview
|
||||
stm32/stm32h750-overview
|
||||
stm32/stm32f769-overview
|
||||
stm32/stm32f429-overview
|
||||
stm32/stm32mp157-overview
|
||||
|
@ -18,12 +18,12 @@ Orion family
|
||||
- 88F5181L
|
||||
- 88F5182
|
||||
|
||||
- Datasheet: http://www.embeddedarm.com/documentation/third-party/MV88F5182-datasheet.pdf
|
||||
- Programmer's User Guide: http://www.embeddedarm.com/documentation/third-party/MV88F5182-opensource-manual.pdf
|
||||
- User Manual: http://www.embeddedarm.com/documentation/third-party/MV88F5182-usermanual.pdf
|
||||
- Datasheet: https://web.archive.org/web/20210124231420/http://csclub.uwaterloo.ca/~board/ts7800/MV88F5182-datasheet.pdf
|
||||
- Programmer's User Guide: https://web.archive.org/web/20210124231536/http://csclub.uwaterloo.ca/~board/ts7800/MV88F5182-opensource-manual.pdf
|
||||
- User Manual: https://web.archive.org/web/20210124231631/http://csclub.uwaterloo.ca/~board/ts7800/MV88F5182-usermanual.pdf
|
||||
- 88F5281
|
||||
|
||||
- Datasheet: http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf
|
||||
- Datasheet: https://web.archive.org/web/20131028144728/http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf
|
||||
- 88F6183
|
||||
Core:
|
||||
Feroceon 88fr331 (88f51xx) or 88fr531-vd (88f52xx) ARMv5 compatible
|
||||
@ -38,33 +38,33 @@ Kirkwood family
|
||||
Flavors:
|
||||
- 88F6282 a.k.a Armada 300
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
|
||||
- Product Brief : https://web.archive.org/web/20111027032509/http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
|
||||
- 88F6283 a.k.a Armada 310
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
|
||||
- Product Brief : https://web.archive.org/web/20111027032509/http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
|
||||
- 88F6190
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf
|
||||
- Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- Product Brief : https://web.archive.org/web/20130730072715/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf
|
||||
- Hardware Spec : https://web.archive.org/web/20121021182835/http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- 88F6192
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf
|
||||
- Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- Product Brief : https://web.archive.org/web/20131113121446/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf
|
||||
- Hardware Spec : https://web.archive.org/web/20121021182835/http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- 88F6182
|
||||
- 88F6180
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf
|
||||
- Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- Product Brief : https://web.archive.org/web/20120616201621/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf
|
||||
- Hardware Spec : https://web.archive.org/web/20130730091654/http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- 88F6281
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf
|
||||
- Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
- Product Brief : https://web.archive.org/web/20120131133709/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf
|
||||
- Hardware Spec : https://web.archive.org/web/20120620073511/http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
|
||||
Homepage:
|
||||
http://www.marvell.com/embedded-processors/kirkwood/
|
||||
https://web.archive.org/web/20160513194943/http://www.marvell.com/embedded-processors/kirkwood/
|
||||
Core:
|
||||
Feroceon 88fr131 ARMv5 compatible
|
||||
Linux kernel mach directory:
|
||||
@ -78,14 +78,15 @@ Discovery family
|
||||
Flavors:
|
||||
- MV78100
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf
|
||||
- Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
|
||||
- Product Brief : https://web.archive.org/web/20120616194711/http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf
|
||||
- Hardware Spec : https://web.archive.org/web/20141005120451/http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20111110081125/http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
|
||||
- MV78200
|
||||
|
||||
- Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf
|
||||
- Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
|
||||
- Product Brief : https://web.archive.org/web/20140801121623/http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf
|
||||
- Hardware Spec : https://web.archive.org/web/20141005120458/http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20111110081125/http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
|
||||
|
||||
- MV76100
|
||||
|
||||
Not supported by the Linux kernel.
|
||||
@ -106,9 +107,9 @@ EBU Armada family
|
||||
- 88F6707
|
||||
- 88F6W11
|
||||
|
||||
- Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
|
||||
- Hardware Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf
|
||||
- Functional Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf
|
||||
- Product Brief: https://web.archive.org/web/20121115063038/http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
|
||||
- Hardware Spec: https://web.archive.org/web/20140617183747/http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf
|
||||
- Functional Spec: https://web.archive.org/web/20140617183701/http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf
|
||||
|
||||
Core:
|
||||
Sheeva ARMv7 compatible PJ4B
|
||||
@ -116,7 +117,7 @@ EBU Armada family
|
||||
Armada 375 Flavors:
|
||||
- 88F6720
|
||||
|
||||
- Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf
|
||||
- Product Brief: https://web.archive.org/web/20131216023516/http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf
|
||||
|
||||
Core:
|
||||
ARM Cortex-A9
|
||||
@ -126,8 +127,8 @@ EBU Armada family
|
||||
- 88F6820 Armada 385
|
||||
- 88F6828 Armada 388
|
||||
|
||||
- Product infos: http://www.marvell.com/embedded-processors/armada-38x/
|
||||
- Functional Spec: http://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-38x-functional-specifications-2015-11.pdf
|
||||
- Product infos: https://web.archive.org/web/20181006144616/http://www.marvell.com/embedded-processors/armada-38x/
|
||||
- Functional Spec: https://web.archive.org/web/20200420191927/https://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-38x-functional-specifications-2015-11.pdf
|
||||
|
||||
Core:
|
||||
ARM Cortex-A9
|
||||
@ -136,7 +137,7 @@ EBU Armada family
|
||||
- 88F6920 Armada 390
|
||||
- 88F6928 Armada 398
|
||||
|
||||
- Product infos: http://www.marvell.com/embedded-processors/armada-39x/
|
||||
- Product infos: https://web.archive.org/web/20181020222559/http://www.marvell.com/embedded-processors/armada-39x/
|
||||
|
||||
Core:
|
||||
ARM Cortex-A9
|
||||
@ -150,16 +151,16 @@ EBU Armada family
|
||||
not to be confused with the non-SMP 78xx0 SoCs
|
||||
|
||||
Product Brief:
|
||||
http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
|
||||
https://web.archive.org/web/20121021173528/http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
|
||||
|
||||
Functional Spec:
|
||||
http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf
|
||||
https://web.archive.org/web/20180829171131/http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf
|
||||
|
||||
- Hardware Specs:
|
||||
|
||||
- http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF
|
||||
- http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF
|
||||
- http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF
|
||||
- https://web.archive.org/web/20141127013651/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF
|
||||
- https://web.archive.org/web/20141222000224/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF
|
||||
- https://web.archive.org/web/20141222000230/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF
|
||||
|
||||
Core:
|
||||
Sheeva ARMv7 compatible Dual-core or Quad-core PJ4B-MP
|
||||
@ -180,13 +181,13 @@ EBU Armada family ARMv8
|
||||
ARM Cortex A53 (ARMv8)
|
||||
|
||||
Homepage:
|
||||
http://www.marvell.com/embedded-processors/armada-3700/
|
||||
https://web.archive.org/web/20181103003602/http://www.marvell.com/embedded-processors/armada-3700/
|
||||
|
||||
Product Brief:
|
||||
http://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-37xx-product-brief-2016-01.pdf
|
||||
https://web.archive.org/web/20210121194810/https://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-37xx-product-brief-2016-01.pdf
|
||||
|
||||
Hardware Spec:
|
||||
http://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-37xx-hardware-specifications-2019-09.pdf
|
||||
https://web.archive.org/web/20210202162011/http://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-37xx-hardware-specifications-2019-09.pdf
|
||||
|
||||
Device tree files:
|
||||
arch/arm64/boot/dts/marvell/armada-37*
|
||||
@ -198,11 +199,11 @@ EBU Armada family ARMv8
|
||||
Core: ARM Cortex A72
|
||||
|
||||
Homepage:
|
||||
http://www.marvell.com/embedded-processors/armada-70xx/
|
||||
https://web.archive.org/web/20181020222606/http://www.marvell.com/embedded-processors/armada-70xx/
|
||||
|
||||
Product Brief:
|
||||
- http://www.marvell.com/embedded-processors/assets/Armada7020PB-Jan2016.pdf
|
||||
- http://www.marvell.com/embedded-processors/assets/Armada7040PB-Jan2016.pdf
|
||||
- https://web.archive.org/web/20161010105541/http://www.marvell.com/embedded-processors/assets/Armada7020PB-Jan2016.pdf
|
||||
- https://web.archive.org/web/20160928154533/http://www.marvell.com/embedded-processors/assets/Armada7040PB-Jan2016.pdf
|
||||
|
||||
Device tree files:
|
||||
arch/arm64/boot/dts/marvell/armada-70*
|
||||
@ -214,11 +215,11 @@ EBU Armada family ARMv8
|
||||
ARM Cortex A72
|
||||
|
||||
Homepage:
|
||||
http://www.marvell.com/embedded-processors/armada-80xx/
|
||||
https://web.archive.org/web/20181022004830/http://www.marvell.com/embedded-processors/armada-80xx/
|
||||
|
||||
Product Brief:
|
||||
- http://www.marvell.com/embedded-processors/assets/Armada8020PB-Jan2016.pdf
|
||||
- http://www.marvell.com/embedded-processors/assets/Armada8040PB-Jan2016.pdf
|
||||
- https://web.archive.org/web/20210124233728/https://www.marvell.com/content/dam/marvell/en/public-collateral/embedded-processors/marvell-embedded-processors-armada-8020-product-brief-2017-12.pdf
|
||||
- https://web.archive.org/web/20161010105532/http://www.marvell.com/embedded-processors/assets/Armada8040PB-Jan2016.pdf
|
||||
|
||||
Device tree files:
|
||||
arch/arm64/boot/dts/marvell/armada-80*
|
||||
@ -233,10 +234,10 @@ Avanta family
|
||||
- 88F6560
|
||||
|
||||
Homepage:
|
||||
http://www.marvell.com/broadband/
|
||||
https://web.archive.org/web/20181005145041/http://www.marvell.com/broadband/
|
||||
|
||||
Product Brief:
|
||||
http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf
|
||||
https://web.archive.org/web/20180829171057/http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf
|
||||
|
||||
No public datasheet available.
|
||||
|
||||
@ -255,7 +256,7 @@ Storage family
|
||||
- 88RC1580
|
||||
|
||||
Product infos:
|
||||
http://www.marvell.com/storage/armada-sp/
|
||||
https://web.archive.org/web/20191129073953/http://www.marvell.com/storage/armada-sp/
|
||||
|
||||
Core:
|
||||
Sheeva ARMv7 comatible Quad-core PJ4C
|
||||
@ -269,16 +270,16 @@ Dove family (application processor)
|
||||
- 88AP510 a.k.a Armada 510
|
||||
|
||||
Product Brief:
|
||||
http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf
|
||||
https://web.archive.org/web/20111102020643/http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf
|
||||
|
||||
Hardware Spec:
|
||||
http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf
|
||||
https://web.archive.org/web/20160428160231/http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf
|
||||
|
||||
Functional Spec:
|
||||
http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf
|
||||
https://web.archive.org/web/20120130172443/http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf
|
||||
|
||||
Homepage:
|
||||
http://www.marvell.com/application-processors/armada-500/
|
||||
https://web.archive.org/web/20160822232651/http://www.marvell.com/application-processors/armada-500/
|
||||
|
||||
Core:
|
||||
ARMv7 compatible
|
||||
@ -295,22 +296,22 @@ PXA 2xx/3xx/93x/95x family
|
||||
- Application processor only
|
||||
- Core: ARMv5 XScale1 core
|
||||
- PXA270, PXA271, PXA272
|
||||
- Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf
|
||||
- Design guide : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf
|
||||
- Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf
|
||||
- Specification : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf
|
||||
- Specification update : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf
|
||||
- Product Brief : https://web.archive.org/web/20150927135510/http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf
|
||||
- Design guide : https://web.archive.org/web/20120111181937/http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf
|
||||
- Developers manual : https://web.archive.org/web/20150927164805/http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf
|
||||
- Specification : https://web.archive.org/web/20140211221535/http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf
|
||||
- Specification update : https://web.archive.org/web/20120111104906/http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf
|
||||
- Application processor only
|
||||
- Core: ARMv5 XScale2 core
|
||||
- PXA300, PXA310, PXA320
|
||||
- PXA 300 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf
|
||||
- PXA 310 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf
|
||||
- PXA 320 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf
|
||||
- Design guide : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf
|
||||
- Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip
|
||||
- Specifications : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf
|
||||
- Specification Update : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip
|
||||
- Reference Manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf
|
||||
- PXA 300 Product Brief : https://web.archive.org/web/20120111121203/http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf
|
||||
- PXA 310 Product Brief : https://web.archive.org/web/20120111104515/http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf
|
||||
- PXA 320 Product Brief : https://web.archive.org/web/20121021182826/http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf
|
||||
- Design guide : https://web.archive.org/web/20130727144625/http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf
|
||||
- Developers manual : https://web.archive.org/web/20130727144605/http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip
|
||||
- Specifications : https://web.archive.org/web/20130727144559/http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf
|
||||
- Specification Update : https://web.archive.org/web/20150927183411/http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip
|
||||
- Reference Manual : https://web.archive.org/web/20120111103844/http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf
|
||||
- Application processor only
|
||||
- Core: ARMv5 XScale3 core
|
||||
- PXA930, PXA935
|
||||
@ -341,26 +342,26 @@ MMP/MMP2/MMP3 family (communication processor)
|
||||
|
||||
Flavors:
|
||||
- PXA168, a.k.a Armada 168
|
||||
- Homepage : http://www.marvell.com/application-processors/armada-100/armada-168.jsp
|
||||
- Product brief : http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf
|
||||
- Hardware manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf
|
||||
- Software manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf
|
||||
- Specification update : http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf
|
||||
- Boot ROM manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf
|
||||
- App node package : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf
|
||||
- Homepage : https://web.archive.org/web/20110926014256/http://www.marvell.com/application-processors/armada-100/armada-168.jsp
|
||||
- Product brief : https://web.archive.org/web/20111102030100/http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf
|
||||
- Hardware manual : https://web.archive.org/web/20160428165359/http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf
|
||||
- Software manual : https://web.archive.org/web/20160428154454/http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf
|
||||
- Specification update : https://web.archive.org/web/20150927160338/http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf
|
||||
- Boot ROM manual : https://web.archive.org/web/20130727205559/http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf
|
||||
- App node package : https://web.archive.org/web/20141005090706/http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf
|
||||
- Application processor only
|
||||
- Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk)
|
||||
- PXA910/PXA920
|
||||
- Homepage : http://www.marvell.com/communication-processors/pxa910/
|
||||
- Product Brief : http://www.marvell.com/communication-processors/pxa910/assets/Marvell_PXA910_Platform-001_PB_final.pdf
|
||||
- Homepage : https://web.archive.org/web/20150928121236/http://www.marvell.com/communication-processors/pxa910/
|
||||
- Product Brief : https://archive.org/download/marvell-pxa910-pb/Marvell_PXA910_Platform-001_PB.pdf
|
||||
- Application processor with Communication processor
|
||||
- Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk)
|
||||
- PXA688, a.k.a. MMP2, a.k.a Armada 610
|
||||
- Product Brief : http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf
|
||||
- PXA688, a.k.a. MMP2, a.k.a Armada 610 (OLPC XO-1.75)
|
||||
- Product Brief : https://web.archive.org/web/20111102023255/http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf
|
||||
- Application processor only
|
||||
- Core: ARMv7 compatible Sheeva PJ4 88sv581x core
|
||||
- PXA2128, a.k.a. MMP3 (OLPC XO4, Linux support not upstream)
|
||||
- Product Brief : http://www.marvell.com/application-processors/armada/pxa2128/assets/Marvell-ARMADA-PXA2128-SoC-PB.pdf
|
||||
- PXA2128, a.k.a. MMP3, a.k.a Armada 620 (OLPC XO-4)
|
||||
- Product Brief : https://web.archive.org/web/20120824055155/http://www.marvell.com/application-processors/armada/pxa2128/assets/Marvell-ARMADA-PXA2128-SoC-PB.pdf
|
||||
- Application processor only
|
||||
- Core: Dual-core ARMv7 compatible Sheeva PJ4C core
|
||||
- PXA960/PXA968/PXA978 (Linux support not upstream)
|
||||
|
34
Documentation/arm/stm32/stm32h750-overview.rst
Normal file
34
Documentation/arm/stm32/stm32h750-overview.rst
Normal file
@ -0,0 +1,34 @@
|
||||
==================
|
||||
STM32H750 Overview
|
||||
==================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The STM32H750 is a Cortex-M7 MCU aimed at various applications.
|
||||
It features:
|
||||
|
||||
- Cortex-M7 core running up to @480MHz
|
||||
- 128K internal flash, 1MBytes internal RAM
|
||||
- FMC controller to connect SDRAM, NOR and NAND memories
|
||||
- Dual mode QSPI
|
||||
- SD/MMC/SDIO support
|
||||
- Ethernet controller
|
||||
- USB OTFG FS & HS controllers
|
||||
- I2C, SPI, CAN busses support
|
||||
- Several 16 & 32 bits general purpose timers
|
||||
- Serial Audio interface
|
||||
- LCD controller
|
||||
- HDMI-CEC
|
||||
- SPDIFRX
|
||||
- DFSDM
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
Datasheet and reference manual are publicly available on ST website (STM32H750_).
|
||||
|
||||
.. _STM32H750: https://www.st.com/en/microcontrollers-microprocessors/stm32h750-value-line.html
|
||||
|
||||
:Authors: Dillon Min <dillon.minfei@gmail.com>
|
||||
|
@ -64,4 +64,11 @@ linux,uefi-mmap-desc-size 32-bit Size in bytes of each entry in the UEFI
|
||||
memory map.
|
||||
|
||||
linux,uefi-mmap-desc-ver 32-bit Version of the mmap descriptor format.
|
||||
|
||||
linux,initrd-start 64-bit Physical start address of an initrd
|
||||
|
||||
linux,initrd-end 64-bit Physical end address of an initrd
|
||||
|
||||
kaslr-seed 64-bit Entropy used to randomize the kernel image
|
||||
base address location.
|
||||
========================== ====== ===========================================
|
||||
|
@ -17,12 +17,12 @@ For ACPI on arm64, tables also fall into the following categories:
|
||||
|
||||
- Recommended: BERT, EINJ, ERST, HEST, PCCT, SSDT
|
||||
|
||||
- Optional: BGRT, CPEP, CSRT, DBG2, DRTM, ECDT, FACS, FPDT, IORT,
|
||||
MCHI, MPST, MSCT, NFIT, PMTT, RASF, SBST, SLIT, SPMI, SRAT, STAO,
|
||||
TCPA, TPM2, UEFI, XENV
|
||||
- Optional: BGRT, CPEP, CSRT, DBG2, DRTM, ECDT, FACS, FPDT, IBFT,
|
||||
IORT, MCHI, MPST, MSCT, NFIT, PMTT, RASF, SBST, SLIT, SPMI, SRAT,
|
||||
STAO, TCPA, TPM2, UEFI, XENV
|
||||
|
||||
- Not supported: BOOT, DBGP, DMAR, ETDT, HPET, IBFT, IVRS, LPIT,
|
||||
MSDM, OEMx, PSDT, RSDT, SLIC, WAET, WDAT, WDRT, WPBT
|
||||
- Not supported: BOOT, DBGP, DMAR, ETDT, HPET, IVRS, LPIT, MSDM, OEMx,
|
||||
PSDT, RSDT, SLIC, WAET, WDAT, WDRT, WPBT
|
||||
|
||||
====== ========================================================================
|
||||
Table Usage for ARMv8 Linux
|
||||
|
@ -202,9 +202,10 @@ Before jumping into the kernel, the following conditions must be met:
|
||||
|
||||
- System registers
|
||||
|
||||
All writable architected system registers at the exception level where
|
||||
the kernel image will be entered must be initialised by software at a
|
||||
higher exception level to prevent execution in an UNKNOWN state.
|
||||
All writable architected system registers at or below the exception
|
||||
level where the kernel image will be entered must be initialised by
|
||||
software at a higher exception level to prevent execution in an UNKNOWN
|
||||
state.
|
||||
|
||||
- SCR_EL3.FIQ must have the same value across all CPUs the kernel is
|
||||
executing on.
|
||||
@ -270,9 +271,46 @@ Before jumping into the kernel, the following conditions must be met:
|
||||
having 0b1 set for the corresponding bit for each of the auxiliary
|
||||
counters present.
|
||||
|
||||
For CPUs with the Fine Grained Traps (FEAT_FGT) extension present:
|
||||
|
||||
- If EL3 is present and the kernel is entered at EL2:
|
||||
|
||||
- SCR_EL3.FGTEn (bit 27) must be initialised to 0b1.
|
||||
|
||||
For CPUs with Advanced SIMD and floating point support:
|
||||
|
||||
- If EL3 is present:
|
||||
|
||||
- CPTR_EL3.TFP (bit 10) must be initialised to 0b0.
|
||||
|
||||
- If EL2 is present and the kernel is entered at EL1:
|
||||
|
||||
- CPTR_EL2.TFP (bit 10) must be initialised to 0b0.
|
||||
|
||||
For CPUs with the Scalable Vector Extension (FEAT_SVE) present:
|
||||
|
||||
- if EL3 is present:
|
||||
|
||||
- CPTR_EL3.EZ (bit 8) must be initialised to 0b1.
|
||||
|
||||
- ZCR_EL3.LEN must be initialised to the same value for all CPUs the
|
||||
kernel is executed on.
|
||||
|
||||
- If the kernel is entered at EL1 and EL2 is present:
|
||||
|
||||
- CPTR_EL2.TZ (bit 8) must be initialised to 0b0.
|
||||
|
||||
- CPTR_EL2.ZEN (bits 17:16) must be initialised to 0b11.
|
||||
|
||||
- ZCR_EL2.LEN must be initialised to the same value for all CPUs the
|
||||
kernel will execute on.
|
||||
|
||||
The requirements described above for CPU mode, caches, MMUs, architected
|
||||
timers, coherency and system registers apply to all CPUs. All CPUs must
|
||||
enter the kernel in the same exception level.
|
||||
enter the kernel in the same exception level. Where the values documented
|
||||
disable traps it is permissible for these traps to be enabled so long as
|
||||
those traps are handled transparently by higher exception levels as though
|
||||
the values documented were set.
|
||||
|
||||
The boot loader is expected to enter the kernel on each CPU in the
|
||||
following manner:
|
||||
|
@ -74,7 +74,7 @@ HWCAP_ASIMD
|
||||
|
||||
HWCAP_EVTSTRM
|
||||
The generic timer is configured to generate events at a frequency of
|
||||
approximately 100KHz.
|
||||
approximately 10KHz.
|
||||
|
||||
HWCAP_AES
|
||||
Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0001.
|
||||
|
@ -107,3 +107,37 @@ filter out the Pointer Authentication system key registers from
|
||||
KVM_GET/SET_REG_* ioctls and mask those features from cpufeature ID
|
||||
register. Any attempt to use the Pointer Authentication instructions will
|
||||
result in an UNDEFINED exception being injected into the guest.
|
||||
|
||||
|
||||
Enabling and disabling keys
|
||||
---------------------------
|
||||
|
||||
The prctl PR_PAC_SET_ENABLED_KEYS allows the user program to control which
|
||||
PAC keys are enabled in a particular task. It takes two arguments, the
|
||||
first being a bitmask of PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY
|
||||
and PR_PAC_APDBKEY specifying which keys shall be affected by this prctl,
|
||||
and the second being a bitmask of the same bits specifying whether the key
|
||||
should be enabled or disabled. For example::
|
||||
|
||||
prctl(PR_PAC_SET_ENABLED_KEYS,
|
||||
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | PR_PAC_APDBKEY,
|
||||
PR_PAC_APIBKEY, 0, 0);
|
||||
|
||||
disables all keys except the IB key.
|
||||
|
||||
The main reason why this is useful is to enable a userspace ABI that uses PAC
|
||||
instructions to sign and authenticate function pointers and other pointers
|
||||
exposed outside of the function, while still allowing binaries conforming to
|
||||
the ABI to interoperate with legacy binaries that do not sign or authenticate
|
||||
pointers.
|
||||
|
||||
The idea is that a dynamic loader or early startup code would issue this
|
||||
prctl very early after establishing that a process may load legacy binaries,
|
||||
but before executing any PAC instructions.
|
||||
|
||||
For compatibility with previous kernel versions, processes start up with IA,
|
||||
IB, DA and DB enabled, and are reset to this state on exec(). Processes created
|
||||
via fork() and clone() inherit the key enabled state from the calling process.
|
||||
|
||||
It is recommended to avoid disabling the IA key, as this has higher performance
|
||||
overhead than disabling any of the other keys.
|
||||
|
@ -130,6 +130,9 @@ stable kernels.
|
||||
| Marvell | ARM-MMU-500 | #582743 | N/A |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| NVIDIA | Carmel Core | N/A | NVIDIA_CARMEL_CNP_ERRATUM |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
|
@ -40,7 +40,7 @@ space obtained in one of the following ways:
|
||||
during creation and with the same restrictions as for ``mmap()`` above
|
||||
(e.g. data, bss, stack).
|
||||
|
||||
The AArch64 Tagged Address ABI has two stages of relaxation depending
|
||||
The AArch64 Tagged Address ABI has two stages of relaxation depending on
|
||||
how the user addresses are used by the kernel:
|
||||
|
||||
1. User addresses not accessed by the kernel but used for address space
|
||||
@ -113,6 +113,12 @@ ABI relaxation:
|
||||
|
||||
- ``shmat()`` and ``shmdt()``.
|
||||
|
||||
- ``brk()`` (since kernel v5.6).
|
||||
|
||||
- ``mmap()`` (since kernel v5.6).
|
||||
|
||||
- ``mremap()``, the ``new_address`` argument (since kernel v5.6).
|
||||
|
||||
Any attempt to use non-zero tagged pointers may result in an error code
|
||||
being returned, a (fatal) signal being raised, or other modes of
|
||||
failure.
|
||||
|
@ -258,3 +258,18 @@ Q: Can BPF functionality such as new program or map types, new
|
||||
helpers, etc be added out of kernel module code?
|
||||
|
||||
A: NO.
|
||||
|
||||
Q: Directly calling kernel function is an ABI?
|
||||
----------------------------------------------
|
||||
Q: Some kernel functions (e.g. tcp_slow_start) can be called
|
||||
by BPF programs. Do these kernel functions become an ABI?
|
||||
|
||||
A: NO.
|
||||
|
||||
The kernel function protos will change and the bpf programs will be
|
||||
rejected by the verifier. Also, for example, some of the bpf-callable
|
||||
kernel functions have already been used by other kernel tcp
|
||||
cc (congestion-control) implementations. If any of these kernel
|
||||
functions has changed, both the in-tree and out-of-tree kernel tcp cc
|
||||
implementations have to be changed. The same goes for the bpf
|
||||
programs and they have to be adjusted accordingly.
|
||||
|
@ -29,7 +29,7 @@ list:
|
||||
This may also include issues related to XDP, BPF tracing, etc.
|
||||
|
||||
Given netdev has a high volume of traffic, please also add the BPF
|
||||
maintainers to Cc (from kernel MAINTAINERS_ file):
|
||||
maintainers to Cc (from kernel ``MAINTAINERS`` file):
|
||||
|
||||
* Alexei Starovoitov <ast@kernel.org>
|
||||
* Daniel Borkmann <daniel@iogearbox.net>
|
||||
@ -234,11 +234,11 @@ be subject to change.
|
||||
|
||||
Q: samples/bpf preference vs selftests?
|
||||
---------------------------------------
|
||||
Q: When should I add code to `samples/bpf/`_ and when to BPF kernel
|
||||
selftests_ ?
|
||||
Q: When should I add code to ``samples/bpf/`` and when to BPF kernel
|
||||
selftests_?
|
||||
|
||||
A: In general, we prefer additions to BPF kernel selftests_ rather than
|
||||
`samples/bpf/`_. The rationale is very simple: kernel selftests are
|
||||
``samples/bpf/``. The rationale is very simple: kernel selftests are
|
||||
regularly run by various bots to test for kernel regressions.
|
||||
|
||||
The more test cases we add to BPF selftests, the better the coverage
|
||||
@ -246,9 +246,9 @@ and the less likely it is that those could accidentally break. It is
|
||||
not that BPF kernel selftests cannot demo how a specific feature can
|
||||
be used.
|
||||
|
||||
That said, `samples/bpf/`_ may be a good place for people to get started,
|
||||
That said, ``samples/bpf/`` may be a good place for people to get started,
|
||||
so it might be advisable that simple demos of features could go into
|
||||
`samples/bpf/`_, but advanced functional and corner-case testing rather
|
||||
``samples/bpf/``, but advanced functional and corner-case testing rather
|
||||
into kernel selftests.
|
||||
|
||||
If your sample looks like a test case, then go for BPF kernel selftests
|
||||
@ -449,6 +449,19 @@ from source at
|
||||
|
||||
https://github.com/acmel/dwarves
|
||||
|
||||
pahole starts to use libbpf definitions and APIs since v1.13 after the
|
||||
commit 21507cd3e97b ("pahole: add libbpf as submodule under lib/bpf").
|
||||
It works well with the git repository because the libbpf submodule will
|
||||
use "git submodule update --init --recursive" to update.
|
||||
|
||||
Unfortunately, the default github release source code does not contain
|
||||
libbpf submodule source code and this will cause build issues, the tarball
|
||||
from https://git.kernel.org/pub/scm/devel/pahole/pahole.git/ is same with
|
||||
github, you can get the source tarball with corresponding libbpf submodule
|
||||
codes from
|
||||
|
||||
https://fedorapeople.org/~acme/dwarves
|
||||
|
||||
Some distros have pahole version 1.16 packaged already, e.g.
|
||||
Fedora, Gentoo.
|
||||
|
||||
@ -645,10 +658,9 @@ when:
|
||||
|
||||
.. Links
|
||||
.. _Documentation/process/: https://www.kernel.org/doc/html/latest/process/
|
||||
.. _MAINTAINERS: ../../MAINTAINERS
|
||||
.. _netdev-FAQ: ../networking/netdev-FAQ.rst
|
||||
.. _samples/bpf/: ../../samples/bpf/
|
||||
.. _selftests: ../../tools/testing/selftests/bpf/
|
||||
.. _selftests:
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/bpf/
|
||||
.. _Documentation/dev-tools/kselftest.rst:
|
||||
https://www.kernel.org/doc/html/latest/dev-tools/kselftest.html
|
||||
.. _Documentation/bpf/btf.rst: btf.rst
|
||||
|
@ -84,6 +84,7 @@ sequentially and type id is assigned to each recognized type starting from id
|
||||
#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
|
||||
#define BTF_KIND_VAR 14 /* Variable */
|
||||
#define BTF_KIND_DATASEC 15 /* Section */
|
||||
#define BTF_KIND_FLOAT 16 /* Floating point */
|
||||
|
||||
Note that the type section encodes debug info, not just pure types.
|
||||
``BTF_KIND_FUNC`` is not a type, and it represents a defined subprogram.
|
||||
@ -95,8 +96,8 @@ Each type contains the following common data::
|
||||
/* "info" bits arrangement
|
||||
* bits 0-15: vlen (e.g. # of struct's members)
|
||||
* bits 16-23: unused
|
||||
* bits 24-27: kind (e.g. int, ptr, array...etc)
|
||||
* bits 28-30: unused
|
||||
* bits 24-28: kind (e.g. int, ptr, array...etc)
|
||||
* bits 29-30: unused
|
||||
* bit 31: kind_flag, currently used by
|
||||
* struct, union and fwd
|
||||
*/
|
||||
@ -452,6 +453,18 @@ map definition.
|
||||
* ``offset``: the in-section offset of the variable
|
||||
* ``size``: the size of the variable in bytes
|
||||
|
||||
2.2.16 BTF_KIND_FLOAT
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``struct btf_type`` encoding requirement:
|
||||
* ``name_off``: any valid offset
|
||||
* ``info.kind_flag``: 0
|
||||
* ``info.kind``: BTF_KIND_FLOAT
|
||||
* ``info.vlen``: 0
|
||||
* ``size``: the size of the float type in bytes: 2, 4, 8, 12 or 16.
|
||||
|
||||
No additional type data follow ``btf_type``.
|
||||
|
||||
3. BTF Kernel API
|
||||
*****************
|
||||
|
||||
|
@ -12,9 +12,6 @@ BPF instruction-set.
|
||||
The Cilium project also maintains a `BPF and XDP Reference Guide`_
|
||||
that goes into great technical depth about the BPF Architecture.
|
||||
|
||||
The primary info for the bpf syscall is available in the `man-pages`_
|
||||
for `bpf(2)`_.
|
||||
|
||||
BPF Type Format (BTF)
|
||||
=====================
|
||||
|
||||
@ -35,6 +32,12 @@ Two sets of Questions and Answers (Q&A) are maintained.
|
||||
bpf_design_QA
|
||||
bpf_devel_QA
|
||||
|
||||
Syscall API
|
||||
===========
|
||||
|
||||
The primary info for the bpf syscall is available in the `man-pages`_
|
||||
for `bpf(2)`_. For more information about the userspace API, see
|
||||
Documentation/userspace-api/ebpf/index.rst.
|
||||
|
||||
Helper functions
|
||||
================
|
||||
|
@ -331,27 +331,34 @@ htmlhelp_basename = 'TheLinuxKerneldoc'
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
'papersize': 'a4paper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
'papersize': 'a4paper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
'pointsize': '11pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
'pointsize': '11pt',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
|
||||
# Don't mangle with UTF-8 chars
|
||||
'inputenc': '',
|
||||
'utf8extra': '',
|
||||
# Don't mangle with UTF-8 chars
|
||||
'inputenc': '',
|
||||
'utf8extra': '',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
# Set document margins
|
||||
'sphinxsetup': '''
|
||||
hmargin=0.5in, vmargin=1in,
|
||||
parsedliteralwraps=true,
|
||||
verbatimhintsturnover=false,
|
||||
''',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
'preamble': '''
|
||||
% Use some font with UTF-8 support with XeLaTeX
|
||||
% Use some font with UTF-8 support with XeLaTeX
|
||||
\\usepackage{fontspec}
|
||||
\\setsansfont{DejaVu Sans}
|
||||
\\setromanfont{DejaVu Serif}
|
||||
\\setmonofont{DejaVu Sans Mono}
|
||||
'''
|
||||
''',
|
||||
}
|
||||
|
||||
# At least one book (translations) may have Asian characters
|
||||
|
@ -213,9 +213,9 @@ Here are the routines, one by one:
|
||||
there will be no entries in the cache for the kernel address
|
||||
space for virtual addresses in the range 'start' to 'end-1'.
|
||||
|
||||
The first of these two routines is invoked after map_kernel_range()
|
||||
The first of these two routines is invoked after vmap_range()
|
||||
has installed the page table entries. The second is invoked
|
||||
before unmap_kernel_range() deletes the page table entries.
|
||||
before vunmap_range() deletes the page table entries.
|
||||
|
||||
There exists another whole class of cpu cache issues which currently
|
||||
require a whole different set of interfaces to handle properly.
|
||||
|
@ -563,6 +563,16 @@ Free a region of memory previously allocated using dma_alloc_pages().
|
||||
dev, size, dma_handle and dir must all be the same as those passed into
|
||||
dma_alloc_pages(). page must be the pointer returned by dma_alloc_pages().
|
||||
|
||||
::
|
||||
|
||||
int
|
||||
dma_mmap_pages(struct device *dev, struct vm_area_struct *vma,
|
||||
size_t size, struct page *page)
|
||||
|
||||
Map an allocation returned from dma_alloc_pages() into a user address space.
|
||||
dev and size must be the same as those passed into dma_alloc_pages().
|
||||
page must be the pointer returned by dma_alloc_pages().
|
||||
|
||||
::
|
||||
|
||||
void *
|
||||
@ -584,6 +594,84 @@ dev, size, dma_handle and dir must all be the same as those passed into
|
||||
dma_alloc_noncoherent(). cpu_addr must be the virtual address returned by
|
||||
dma_alloc_noncoherent().
|
||||
|
||||
::
|
||||
|
||||
struct sg_table *
|
||||
dma_alloc_noncontiguous(struct device *dev, size_t size,
|
||||
enum dma_data_direction dir, gfp_t gfp,
|
||||
unsigned long attrs);
|
||||
|
||||
This routine allocates <size> bytes of non-coherent and possibly non-contiguous
|
||||
memory. It returns a pointer to struct sg_table that describes the allocated
|
||||
and DMA mapped memory, or NULL if the allocation failed. The resulting memory
|
||||
can be used for struct page mapped into a scatterlist are suitable for.
|
||||
|
||||
The return sg_table is guaranteed to have 1 single DMA mapped segment as
|
||||
indicated by sgt->nents, but it might have multiple CPU side segments as
|
||||
indicated by sgt->orig_nents.
|
||||
|
||||
The dir parameter specified if data is read and/or written by the device,
|
||||
see dma_map_single() for details.
|
||||
|
||||
The gfp parameter allows the caller to specify the ``GFP_`` flags (see
|
||||
kmalloc()) for the allocation, but rejects flags used to specify a memory
|
||||
zone such as GFP_DMA or GFP_HIGHMEM.
|
||||
|
||||
The attrs argument must be either 0 or DMA_ATTR_ALLOC_SINGLE_PAGES.
|
||||
|
||||
Before giving the memory to the device, dma_sync_sgtable_for_device() needs
|
||||
to be called, and before reading memory written by the device,
|
||||
dma_sync_sgtable_for_cpu(), just like for streaming DMA mappings that are
|
||||
reused.
|
||||
|
||||
::
|
||||
|
||||
void
|
||||
dma_free_noncontiguous(struct device *dev, size_t size,
|
||||
struct sg_table *sgt,
|
||||
enum dma_data_direction dir)
|
||||
|
||||
Free memory previously allocated using dma_alloc_noncontiguous(). dev, size,
|
||||
and dir must all be the same as those passed into dma_alloc_noncontiguous().
|
||||
sgt must be the pointer returned by dma_alloc_noncontiguous().
|
||||
|
||||
::
|
||||
|
||||
void *
|
||||
dma_vmap_noncontiguous(struct device *dev, size_t size,
|
||||
struct sg_table *sgt)
|
||||
|
||||
Return a contiguous kernel mapping for an allocation returned from
|
||||
dma_alloc_noncontiguous(). dev and size must be the same as those passed into
|
||||
dma_alloc_noncontiguous(). sgt must be the pointer returned by
|
||||
dma_alloc_noncontiguous().
|
||||
|
||||
Once a non-contiguous allocation is mapped using this function, the
|
||||
flush_kernel_vmap_range() and invalidate_kernel_vmap_range() APIs must be used
|
||||
to manage the coherency between the kernel mapping, the device and user space
|
||||
mappings (if any).
|
||||
|
||||
::
|
||||
|
||||
void
|
||||
dma_vunmap_noncontiguous(struct device *dev, void *vaddr)
|
||||
|
||||
Unmap a kernel mapping returned by dma_vmap_noncontiguous(). dev must be the
|
||||
same the one passed into dma_alloc_noncontiguous(). vaddr must be the pointer
|
||||
returned by dma_vmap_noncontiguous().
|
||||
|
||||
|
||||
::
|
||||
|
||||
int
|
||||
dma_mmap_noncontiguous(struct device *dev, struct vm_area_struct *vma,
|
||||
size_t size, struct sg_table *sgt)
|
||||
|
||||
Map an allocation returned from dma_alloc_noncontiguous() into a user address
|
||||
space. dev and size must be the same as those passed into
|
||||
dma_alloc_noncontiguous(). sgt must be the pointer returned by
|
||||
dma_alloc_noncontiguous().
|
||||
|
||||
::
|
||||
|
||||
int
|
||||
|
@ -42,10 +42,10 @@ irq_domain usage
|
||||
================
|
||||
|
||||
An interrupt controller driver creates and registers an irq_domain by
|
||||
calling one of the irq_domain_add_*() functions (each mapping method
|
||||
has a different allocator function, more on that later). The function
|
||||
will return a pointer to the irq_domain on success. The caller must
|
||||
provide the allocator function with an irq_domain_ops structure.
|
||||
calling one of the irq_domain_add_*() or irq_domain_create_*() functions
|
||||
(each mapping method has a different allocator function, more on that later).
|
||||
The function will return a pointer to the irq_domain on success. The caller
|
||||
must provide the allocator function with an irq_domain_ops structure.
|
||||
|
||||
In most cases, the irq_domain will begin empty without any mappings
|
||||
between hwirq and IRQ numbers. Mappings are added to the irq_domain
|
||||
@ -147,6 +147,7 @@ Legacy
|
||||
irq_domain_add_simple()
|
||||
irq_domain_add_legacy()
|
||||
irq_domain_add_legacy_isa()
|
||||
irq_domain_create_simple()
|
||||
irq_domain_create_legacy()
|
||||
|
||||
The Legacy mapping is a special case for drivers that already have a
|
||||
@ -169,13 +170,13 @@ supported. For example, ISA controllers would use the legacy map for
|
||||
mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ
|
||||
numbers.
|
||||
|
||||
Most users of legacy mappings should use irq_domain_add_simple() which
|
||||
will use a legacy domain only if an IRQ range is supplied by the
|
||||
system and will otherwise use a linear domain mapping. The semantics
|
||||
of this call are such that if an IRQ range is specified then
|
||||
Most users of legacy mappings should use irq_domain_add_simple() or
|
||||
irq_domain_create_simple() which will use a legacy domain only if an IRQ range
|
||||
is supplied by the system and will otherwise use a linear domain mapping.
|
||||
The semantics of this call are such that if an IRQ range is specified then
|
||||
descriptors will be allocated on-the-fly for it, and if no range is
|
||||
specified it will fall through to irq_domain_add_linear() which means
|
||||
*no* irq descriptors will be allocated.
|
||||
specified it will fall through to irq_domain_add_linear() or
|
||||
irq_domain_create_linear() which means *no* irq descriptors will be allocated.
|
||||
|
||||
A typical use case for simple domains is where an irqchip provider
|
||||
is supporting both dynamic and static IRQ assignments.
|
||||
@ -186,6 +187,7 @@ that the driver using the simple domain call irq_create_mapping()
|
||||
before any irq_find_mapping() since the latter will actually work
|
||||
for the static IRQ assignment case.
|
||||
|
||||
irq_domain_add_simple() and irq_domain_create_simple() as well as
|
||||
irq_domain_add_legacy() and irq_domain_create_legacy() are functionally
|
||||
equivalent, except for the first argument is different - the former
|
||||
accepts an Open Firmware specific 'struct device_node', while the latter
|
||||
|
@ -92,3 +92,9 @@ More Memory Management Functions
|
||||
:export:
|
||||
|
||||
.. kernel-doc:: mm/page_alloc.c
|
||||
.. kernel-doc:: mm/mempolicy.c
|
||||
.. kernel-doc:: include/linux/mm_types.h
|
||||
:internal:
|
||||
.. kernel-doc:: include/linux/mm.h
|
||||
:internal:
|
||||
.. kernel-doc:: include/linux/mmzone.h
|
||||
|
@ -79,7 +79,19 @@ Pointers printed without a specifier extension (i.e unadorned %p) are
|
||||
hashed to prevent leaking information about the kernel memory layout. This
|
||||
has the added benefit of providing a unique identifier. On 64-bit machines
|
||||
the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it
|
||||
gathers enough entropy. If you *really* want the address see %px below.
|
||||
gathers enough entropy.
|
||||
|
||||
When possible, use specialised modifiers such as %pS or %pB (described below)
|
||||
to avoid the need of providing an unhashed address that has to be interpreted
|
||||
post-hoc. If not possible, and the aim of printing the address is to provide
|
||||
more information for debugging, use %p and boot the kernel with the
|
||||
``no_hash_pointers`` parameter during debugging, which will print all %p
|
||||
addresses unmodified. If you *really* always want the unmodified address, see
|
||||
%px below.
|
||||
|
||||
If (and only if) you are printing addresses as a content of a virtual file in
|
||||
e.g. procfs or sysfs (using e.g. seq_printf(), not printk()) read by a
|
||||
userspace process, use the %pK modifier described below instead of %p or %px.
|
||||
|
||||
Error Pointers
|
||||
--------------
|
||||
@ -139,6 +151,11 @@ For printing kernel pointers which should be hidden from unprivileged
|
||||
users. The behaviour of %pK depends on the kptr_restrict sysctl - see
|
||||
Documentation/admin-guide/sysctl/kernel.rst for more details.
|
||||
|
||||
This modifier is *only* intended when producing content of a file read by
|
||||
userspace from e.g. procfs or sysfs, not for dmesg. Please refer to the
|
||||
section about %p above for discussion about how to manage hashing pointers
|
||||
in printk().
|
||||
|
||||
Unmodified Addresses
|
||||
--------------------
|
||||
|
||||
@ -153,6 +170,13 @@ equivalent to %lx (or %lu). %px is preferred because it is more uniquely
|
||||
grep'able. If in the future we need to modify the way the kernel handles
|
||||
printing pointers we will be better equipped to find the call sites.
|
||||
|
||||
Before using %px, consider if using %p is sufficient together with enabling the
|
||||
``no_hash_pointers`` kernel parameter during debugging sessions (see the %p
|
||||
description above). One valid scenario for %px might be printing information
|
||||
immediately before a panic, which prevents any sensitive information to be
|
||||
exploited anyway, and with %px there would be no need to reproduce the panic
|
||||
with no_hash_pointers.
|
||||
|
||||
Pointer Differences
|
||||
-------------------
|
||||
|
||||
@ -540,7 +564,7 @@ Flags bitfields such as page flags, gfp_flags
|
||||
|
||||
::
|
||||
|
||||
%pGp referenced|uptodate|lru|active|private
|
||||
%pGp referenced|uptodate|lru|active|private|node=0|zone=2|lastcpupid=0x1fffff
|
||||
%pGg GFP_USER|GFP_DMA32|GFP_NOWARN
|
||||
%pGv read|exec|mayread|maywrite|mayexec|denywrite
|
||||
|
||||
@ -567,6 +591,24 @@ For printing netdev_features_t.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
V4L2 and DRM FourCC code (pixel format)
|
||||
---------------------------------------
|
||||
|
||||
::
|
||||
|
||||
%p4cc
|
||||
|
||||
Print a FourCC code used by V4L2 or DRM, including format endianness and
|
||||
its numerical value as hexadecimal.
|
||||
|
||||
Passed by reference.
|
||||
|
||||
Examples::
|
||||
|
||||
%p4cc BG12 little-endian (0x32314742)
|
||||
%p4cc Y10 little-endian (0x20303159)
|
||||
%p4cc NV12 big-endian (0xb231564e)
|
||||
|
||||
Thanks
|
||||
======
|
||||
|
||||
|
@ -201,7 +201,7 @@ search trees, such as for traversals or users relying on a the particular
|
||||
order for their own logic. To this end, users can use 'struct rb_root_cached'
|
||||
to optimize O(logN) rb_first() calls to a simple pointer fetch avoiding
|
||||
potentially expensive tree iterations. This is done at negligible runtime
|
||||
overhead for maintanence; albeit larger memory footprint.
|
||||
overhead for maintenance; albeit larger memory footprint.
|
||||
|
||||
Similar to the rb_root structure, cached rbtrees are initialized to be
|
||||
empty via::
|
||||
|
@ -43,14 +43,14 @@ exporting of kernel symbols to the kernel symbol table, variants of these are
|
||||
available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and
|
||||
EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace.
|
||||
Please note that due to macro expansion that argument needs to be a
|
||||
preprocessor symbol. E.g. to export the symbol `usb_stor_suspend` into the
|
||||
namespace `USB_STORAGE`, use::
|
||||
preprocessor symbol. E.g. to export the symbol ``usb_stor_suspend`` into the
|
||||
namespace ``USB_STORAGE``, use::
|
||||
|
||||
EXPORT_SYMBOL_NS(usb_stor_suspend, USB_STORAGE);
|
||||
|
||||
The corresponding ksymtab entry struct `kernel_symbol` will have the member
|
||||
`namespace` set accordingly. A symbol that is exported without a namespace will
|
||||
refer to `NULL`. There is no default namespace if none is defined. `modpost`
|
||||
The corresponding ksymtab entry struct ``kernel_symbol`` will have the member
|
||||
``namespace`` set accordingly. A symbol that is exported without a namespace will
|
||||
refer to ``NULL``. There is no default namespace if none is defined. ``modpost``
|
||||
and kernel/module.c make use the namespace at build time or module load time,
|
||||
respectively.
|
||||
|
||||
@ -64,7 +64,7 @@ and EXPORT_SYMBOL_GPL() macro expansions that do not specify a namespace.
|
||||
|
||||
There are multiple ways of specifying this define and it depends on the
|
||||
subsystem and the maintainer's preference, which one to use. The first option
|
||||
is to define the default namespace in the `Makefile` of the subsystem. E.g. to
|
||||
is to define the default namespace in the ``Makefile`` of the subsystem. E.g. to
|
||||
export all symbols defined in usb-common into the namespace USB_COMMON, add a
|
||||
line like this to drivers/usb/common/Makefile::
|
||||
|
||||
@ -96,7 +96,7 @@ using a statement like::
|
||||
|
||||
MODULE_IMPORT_NS(USB_STORAGE);
|
||||
|
||||
This will create a `modinfo` tag in the module for each imported namespace.
|
||||
This will create a ``modinfo`` tag in the module for each imported namespace.
|
||||
This has the side effect, that the imported namespaces of a module can be
|
||||
inspected with modinfo::
|
||||
|
||||
@ -113,7 +113,7 @@ metadata definitions like MODULE_AUTHOR() or MODULE_LICENSE(). Refer to section
|
||||
4. Loading Modules that use namespaced Symbols
|
||||
==============================================
|
||||
|
||||
At module loading time (e.g. `insmod`), the kernel will check each symbol
|
||||
At module loading time (e.g. ``insmod``), the kernel will check each symbol
|
||||
referenced from the module for its availability and whether the namespace it
|
||||
might be exported to has been imported by the module. The default behaviour of
|
||||
the kernel is to reject loading modules that don't specify sufficient imports.
|
||||
@ -138,19 +138,19 @@ missing imports. Fixing missing imports can be done with::
|
||||
A typical scenario for module authors would be::
|
||||
|
||||
- write code that depends on a symbol from a not imported namespace
|
||||
- `make`
|
||||
- ``make``
|
||||
- notice the warning of modpost telling about a missing import
|
||||
- run `make nsdeps` to add the import to the correct code location
|
||||
- run ``make nsdeps`` to add the import to the correct code location
|
||||
|
||||
For subsystem maintainers introducing a namespace, the steps are very similar.
|
||||
Again, `make nsdeps` will eventually add the missing namespace imports for
|
||||
Again, ``make nsdeps`` will eventually add the missing namespace imports for
|
||||
in-tree modules::
|
||||
|
||||
- move or add symbols to a namespace (e.g. with EXPORT_SYMBOL_NS())
|
||||
- `make` (preferably with an allmodconfig to cover all in-kernel
|
||||
- ``make`` (preferably with an allmodconfig to cover all in-kernel
|
||||
modules)
|
||||
- notice the warning of modpost telling about a missing import
|
||||
- run `make nsdeps` to add the import to the correct code location
|
||||
- run ``make nsdeps`` to add the import to the correct code location
|
||||
|
||||
You can also run nsdeps for external module builds. A typical usage is::
|
||||
|
||||
|
755
Documentation/dev-tools/checkpatch.rst
Normal file
755
Documentation/dev-tools/checkpatch.rst
Normal file
@ -0,0 +1,755 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
==========
|
||||
Checkpatch
|
||||
==========
|
||||
|
||||
Checkpatch (scripts/checkpatch.pl) is a perl script which checks for trivial
|
||||
style violations in patches and optionally corrects them. Checkpatch can
|
||||
also be run on file contexts and without the kernel tree.
|
||||
|
||||
Checkpatch is not always right. Your judgement takes precedence over checkpatch
|
||||
messages. If your code looks better with the violations, then its probably
|
||||
best left alone.
|
||||
|
||||
|
||||
Options
|
||||
=======
|
||||
|
||||
This section will describe the options checkpatch can be run with.
|
||||
|
||||
Usage::
|
||||
|
||||
./scripts/checkpatch.pl [OPTION]... [FILE]...
|
||||
|
||||
Available options:
|
||||
|
||||
- -q, --quiet
|
||||
|
||||
Enable quiet mode.
|
||||
|
||||
- -v, --verbose
|
||||
Enable verbose mode. Additional verbose test descriptions are output
|
||||
so as to provide information on why that particular message is shown.
|
||||
|
||||
- --no-tree
|
||||
|
||||
Run checkpatch without the kernel tree.
|
||||
|
||||
- --no-signoff
|
||||
|
||||
Disable the 'Signed-off-by' line check. The sign-off is a simple line at
|
||||
the end of the explanation for the patch, which certifies that you wrote it
|
||||
or otherwise have the right to pass it on as an open-source patch.
|
||||
|
||||
Example::
|
||||
|
||||
Signed-off-by: Random J Developer <random@developer.example.org>
|
||||
|
||||
Setting this flag effectively stops a message for a missing signed-off-by
|
||||
line in a patch context.
|
||||
|
||||
- --patch
|
||||
|
||||
Treat FILE as a patch. This is the default option and need not be
|
||||
explicitly specified.
|
||||
|
||||
- --emacs
|
||||
|
||||
Set output to emacs compile window format. This allows emacs users to jump
|
||||
from the error in the compile window directly to the offending line in the
|
||||
patch.
|
||||
|
||||
- --terse
|
||||
|
||||
Output only one line per report.
|
||||
|
||||
- --showfile
|
||||
|
||||
Show the diffed file position instead of the input file position.
|
||||
|
||||
- -g, --git
|
||||
|
||||
Treat FILE as a single commit or a git revision range.
|
||||
|
||||
Single commit with:
|
||||
|
||||
- <rev>
|
||||
- <rev>^
|
||||
- <rev>~n
|
||||
|
||||
Multiple commits with:
|
||||
|
||||
- <rev1>..<rev2>
|
||||
- <rev1>...<rev2>
|
||||
- <rev>-<count>
|
||||
|
||||
- -f, --file
|
||||
|
||||
Treat FILE as a regular source file. This option must be used when running
|
||||
checkpatch on source files in the kernel.
|
||||
|
||||
- --subjective, --strict
|
||||
|
||||
Enable stricter tests in checkpatch. By default the tests emitted as CHECK
|
||||
do not activate by default. Use this flag to activate the CHECK tests.
|
||||
|
||||
- --list-types
|
||||
|
||||
Every message emitted by checkpatch has an associated TYPE. Add this flag
|
||||
to display all the types in checkpatch.
|
||||
|
||||
Note that when this flag is active, checkpatch does not read the input FILE,
|
||||
and no message is emitted. Only a list of types in checkpatch is output.
|
||||
|
||||
- --types TYPE(,TYPE2...)
|
||||
|
||||
Only display messages with the given types.
|
||||
|
||||
Example::
|
||||
|
||||
./scripts/checkpatch.pl mypatch.patch --types EMAIL_SUBJECT,BRACES
|
||||
|
||||
- --ignore TYPE(,TYPE2...)
|
||||
|
||||
Checkpatch will not emit messages for the specified types.
|
||||
|
||||
Example::
|
||||
|
||||
./scripts/checkpatch.pl mypatch.patch --ignore EMAIL_SUBJECT,BRACES
|
||||
|
||||
- --show-types
|
||||
|
||||
By default checkpatch doesn't display the type associated with the messages.
|
||||
Set this flag to show the message type in the output.
|
||||
|
||||
- --max-line-length=n
|
||||
|
||||
Set the max line length (default 100). If a line exceeds the specified
|
||||
length, a LONG_LINE message is emitted.
|
||||
|
||||
|
||||
The message level is different for patch and file contexts. For patches,
|
||||
a WARNING is emitted. While a milder CHECK is emitted for files. So for
|
||||
file contexts, the --strict flag must also be enabled.
|
||||
|
||||
- --min-conf-desc-length=n
|
||||
|
||||
Set the Kconfig entry minimum description length, if shorter, warn.
|
||||
|
||||
- --tab-size=n
|
||||
|
||||
Set the number of spaces for tab (default 8).
|
||||
|
||||
- --root=PATH
|
||||
|
||||
PATH to the kernel tree root.
|
||||
|
||||
This option must be specified when invoking checkpatch from outside
|
||||
the kernel root.
|
||||
|
||||
- --no-summary
|
||||
|
||||
Suppress the per file summary.
|
||||
|
||||
- --mailback
|
||||
|
||||
Only produce a report in case of Warnings or Errors. Milder Checks are
|
||||
excluded from this.
|
||||
|
||||
- --summary-file
|
||||
|
||||
Include the filename in summary.
|
||||
|
||||
- --debug KEY=[0|1]
|
||||
|
||||
Turn on/off debugging of KEY, where KEY is one of 'values', 'possible',
|
||||
'type', and 'attr' (default is all off).
|
||||
|
||||
- --fix
|
||||
|
||||
This is an EXPERIMENTAL feature. If correctable errors exists, a file
|
||||
<inputfile>.EXPERIMENTAL-checkpatch-fixes is created which has the
|
||||
automatically fixable errors corrected.
|
||||
|
||||
- --fix-inplace
|
||||
|
||||
EXPERIMENTAL - Similar to --fix but input file is overwritten with fixes.
|
||||
|
||||
DO NOT USE this flag unless you are absolutely sure and you have a backup
|
||||
in place.
|
||||
|
||||
- --ignore-perl-version
|
||||
|
||||
Override checking of perl version. Runtime errors maybe encountered after
|
||||
enabling this flag if the perl version does not meet the minimum specified.
|
||||
|
||||
- --codespell
|
||||
|
||||
Use the codespell dictionary for checking spelling errors.
|
||||
|
||||
- --codespellfile
|
||||
|
||||
Use the specified codespell file.
|
||||
Default is '/usr/share/codespell/dictionary.txt'.
|
||||
|
||||
- --typedefsfile
|
||||
|
||||
Read additional types from this file.
|
||||
|
||||
- --color[=WHEN]
|
||||
|
||||
Use colors 'always', 'never', or only when output is a terminal ('auto').
|
||||
Default is 'auto'.
|
||||
|
||||
- --kconfig-prefix=WORD
|
||||
|
||||
Use WORD as a prefix for Kconfig symbols (default is `CONFIG_`).
|
||||
|
||||
- -h, --help, --version
|
||||
|
||||
Display the help text.
|
||||
|
||||
Message Levels
|
||||
==============
|
||||
|
||||
Messages in checkpatch are divided into three levels. The levels of messages
|
||||
in checkpatch denote the severity of the error. They are:
|
||||
|
||||
- ERROR
|
||||
|
||||
This is the most strict level. Messages of type ERROR must be taken
|
||||
seriously as they denote things that are very likely to be wrong.
|
||||
|
||||
- WARNING
|
||||
|
||||
This is the next stricter level. Messages of type WARNING requires a
|
||||
more careful review. But it is milder than an ERROR.
|
||||
|
||||
- CHECK
|
||||
|
||||
This is the mildest level. These are things which may require some thought.
|
||||
|
||||
Type Descriptions
|
||||
=================
|
||||
|
||||
This section contains a description of all the message types in checkpatch.
|
||||
|
||||
.. Types in this section are also parsed by checkpatch.
|
||||
.. The types are grouped into subsections based on use.
|
||||
|
||||
|
||||
Allocation style
|
||||
----------------
|
||||
|
||||
**ALLOC_ARRAY_ARGS**
|
||||
The first argument for kcalloc or kmalloc_array should be the
|
||||
number of elements. sizeof() as the first argument is generally
|
||||
wrong.
|
||||
See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html
|
||||
|
||||
**ALLOC_SIZEOF_STRUCT**
|
||||
The allocation style is bad. In general for family of
|
||||
allocation functions using sizeof() to get memory size,
|
||||
constructs like::
|
||||
|
||||
p = alloc(sizeof(struct foo), ...)
|
||||
|
||||
should be::
|
||||
|
||||
p = alloc(sizeof(*p), ...)
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memory
|
||||
|
||||
**ALLOC_WITH_MULTIPLY**
|
||||
Prefer kmalloc_array/kcalloc over kmalloc/kzalloc with a
|
||||
sizeof multiply.
|
||||
See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html
|
||||
|
||||
|
||||
API usage
|
||||
---------
|
||||
|
||||
**ARCH_DEFINES**
|
||||
Architecture specific defines should be avoided wherever
|
||||
possible.
|
||||
|
||||
**ARCH_INCLUDE_LINUX**
|
||||
Whenever asm/file.h is included and linux/file.h exists, a
|
||||
conversion can be made when linux/file.h includes asm/file.h.
|
||||
However this is not always the case (See signal.h).
|
||||
This message type is emitted only for includes from arch/.
|
||||
|
||||
**AVOID_BUG**
|
||||
BUG() or BUG_ON() should be avoided totally.
|
||||
Use WARN() and WARN_ON() instead, and handle the "impossible"
|
||||
error condition as gracefully as possible.
|
||||
See: https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on
|
||||
|
||||
**CONSIDER_KSTRTO**
|
||||
The simple_strtol(), simple_strtoll(), simple_strtoul(), and
|
||||
simple_strtoull() functions explicitly ignore overflows, which
|
||||
may lead to unexpected results in callers. The respective kstrtol(),
|
||||
kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the
|
||||
correct replacements.
|
||||
See: https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull
|
||||
|
||||
**LOCKDEP**
|
||||
The lockdep_no_validate class was added as a temporary measure to
|
||||
prevent warnings on conversion of device->sem to device->mutex.
|
||||
It should not be used for any other purpose.
|
||||
See: https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/
|
||||
|
||||
**MALFORMED_INCLUDE**
|
||||
The #include statement has a malformed path. This has happened
|
||||
because the author has included a double slash "//" in the pathname
|
||||
accidentally.
|
||||
|
||||
**USE_LOCKDEP**
|
||||
lockdep_assert_held() annotations should be preferred over
|
||||
assertions based on spin_is_locked()
|
||||
See: https://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotations
|
||||
|
||||
**UAPI_INCLUDE**
|
||||
No #include statements in include/uapi should use a uapi/ path.
|
||||
|
||||
|
||||
Comment style
|
||||
-------------
|
||||
|
||||
**BLOCK_COMMENT_STYLE**
|
||||
The comment style is incorrect. The preferred style for multi-
|
||||
line comments is::
|
||||
|
||||
/*
|
||||
* This is the preferred style
|
||||
* for multi line comments.
|
||||
*/
|
||||
|
||||
The networking comment style is a bit different, with the first line
|
||||
not empty like the former::
|
||||
|
||||
/* This is the preferred comment style
|
||||
* for files in net/ and drivers/net/
|
||||
*/
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting
|
||||
|
||||
**C99_COMMENTS**
|
||||
C99 style single line comments (//) should not be used.
|
||||
Prefer the block comment style instead.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting
|
||||
|
||||
|
||||
Commit message
|
||||
--------------
|
||||
|
||||
**BAD_SIGN_OFF**
|
||||
The signed-off-by line does not fall in line with the standards
|
||||
specified by the community.
|
||||
See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1
|
||||
|
||||
**BAD_STABLE_ADDRESS_STYLE**
|
||||
The email format for stable is incorrect.
|
||||
Some valid options for stable address are::
|
||||
|
||||
1. stable@vger.kernel.org
|
||||
2. stable@kernel.org
|
||||
|
||||
For adding version info, the following comment style should be used::
|
||||
|
||||
stable@vger.kernel.org # version info
|
||||
|
||||
**COMMIT_COMMENT_SYMBOL**
|
||||
Commit log lines starting with a '#' are ignored by git as
|
||||
comments. To solve this problem addition of a single space
|
||||
infront of the log line is enough.
|
||||
|
||||
**COMMIT_MESSAGE**
|
||||
The patch is missing a commit description. A brief
|
||||
description of the changes made by the patch should be added.
|
||||
See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes
|
||||
|
||||
**MISSING_SIGN_OFF**
|
||||
The patch is missing a Signed-off-by line. A signed-off-by
|
||||
line should be added according to Developer's certificate of
|
||||
Origin.
|
||||
See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
|
||||
|
||||
**NO_AUTHOR_SIGN_OFF**
|
||||
The author of the patch has not signed off the patch. It is
|
||||
required that a simple sign off line should be present at the
|
||||
end of explanation of the patch to denote that the author has
|
||||
written it or otherwise has the rights to pass it on as an open
|
||||
source patch.
|
||||
See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
|
||||
|
||||
**DIFF_IN_COMMIT_MSG**
|
||||
Avoid having diff content in commit message.
|
||||
This causes problems when one tries to apply a file containing both
|
||||
the changelog and the diff because patch(1) tries to apply the diff
|
||||
which it found in the changelog.
|
||||
See: https://lore.kernel.org/lkml/20150611134006.9df79a893e3636019ad2759e@linux-foundation.org/
|
||||
|
||||
**GERRIT_CHANGE_ID**
|
||||
To be picked up by gerrit, the footer of the commit message might
|
||||
have a Change-Id like::
|
||||
|
||||
Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b
|
||||
Signed-off-by: A. U. Thor <author@example.com>
|
||||
|
||||
The Change-Id line must be removed before submitting.
|
||||
|
||||
**GIT_COMMIT_ID**
|
||||
The proper way to reference a commit id is:
|
||||
commit <12+ chars of sha1> ("<title line>")
|
||||
|
||||
An example may be::
|
||||
|
||||
Commit e21d2170f36602ae2708 ("video: remove unnecessary
|
||||
platform_set_drvdata()") removed the unnecessary
|
||||
platform_set_drvdata(), but left the variable "dev" unused,
|
||||
delete it.
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes
|
||||
|
||||
|
||||
Comparison style
|
||||
----------------
|
||||
|
||||
**ASSIGN_IN_IF**
|
||||
Do not use assignments in if condition.
|
||||
Example::
|
||||
|
||||
if ((foo = bar(...)) < BAZ) {
|
||||
|
||||
should be written as::
|
||||
|
||||
foo = bar(...);
|
||||
if (foo < BAZ) {
|
||||
|
||||
**BOOL_COMPARISON**
|
||||
Comparisons of A to true and false are better written
|
||||
as A and !A.
|
||||
See: https://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/
|
||||
|
||||
**COMPARISON_TO_NULL**
|
||||
Comparisons to NULL in the form (foo == NULL) or (foo != NULL)
|
||||
are better written as (!foo) and (foo).
|
||||
|
||||
**CONSTANT_COMPARISON**
|
||||
Comparisons with a constant or upper case identifier on the left
|
||||
side of the test should be avoided.
|
||||
|
||||
|
||||
Macros, Attributes and Symbols
|
||||
------------------------------
|
||||
|
||||
**ARRAY_SIZE**
|
||||
The ARRAY_SIZE(foo) macro should be preferred over
|
||||
sizeof(foo)/sizeof(foo[0]) for finding number of elements in an
|
||||
array.
|
||||
|
||||
The macro is defined in include/linux/kernel.h::
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
**AVOID_EXTERNS**
|
||||
Function prototypes don't need to be declared extern in .h
|
||||
files. It's assumed by the compiler and is unnecessary.
|
||||
|
||||
**AVOID_L_PREFIX**
|
||||
Local symbol names that are prefixed with `.L` should be avoided,
|
||||
as this has special meaning for the assembler; a symbol entry will
|
||||
not be emitted into the symbol table. This can prevent `objtool`
|
||||
from generating correct unwind info.
|
||||
|
||||
Symbols with STB_LOCAL binding may still be used, and `.L` prefixed
|
||||
local symbol names are still generally usable within a function,
|
||||
but `.L` prefixed local symbol names should not be used to denote
|
||||
the beginning or end of code regions via
|
||||
`SYM_CODE_START_LOCAL`/`SYM_CODE_END`
|
||||
|
||||
**BIT_MACRO**
|
||||
Defines like: 1 << <digit> could be BIT(digit).
|
||||
The BIT() macro is defined in include/linux/bitops.h::
|
||||
|
||||
#define BIT(nr) (1UL << (nr))
|
||||
|
||||
**CONST_READ_MOSTLY**
|
||||
When a variable is tagged with the __read_mostly annotation, it is a
|
||||
signal to the compiler that accesses to the variable will be mostly
|
||||
reads and rarely(but NOT never) a write.
|
||||
|
||||
const __read_mostly does not make any sense as const data is already
|
||||
read-only. The __read_mostly annotation thus should be removed.
|
||||
|
||||
**DATE_TIME**
|
||||
It is generally desirable that building the same source code with
|
||||
the same set of tools is reproducible, i.e. the output is always
|
||||
exactly the same.
|
||||
|
||||
The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros,
|
||||
and enables warnings if they are used as they can lead to
|
||||
non-deterministic builds.
|
||||
See: https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestamps
|
||||
|
||||
**DEFINE_ARCH_HAS**
|
||||
The ARCH_HAS_xyz and ARCH_HAVE_xyz patterns are wrong.
|
||||
|
||||
For big conceptual features use Kconfig symbols instead. And for
|
||||
smaller things where we have compatibility fallback functions but
|
||||
want architectures able to override them with optimized ones, we
|
||||
should either use weak functions (appropriate for some cases), or
|
||||
the symbol that protects them should be the same symbol we use.
|
||||
See: https://lore.kernel.org/lkml/CA+55aFycQ9XJvEOsiM3txHL5bjUc8CeKWJNR_H+MiicaddB42Q@mail.gmail.com/
|
||||
|
||||
**INIT_ATTRIBUTE**
|
||||
Const init definitions should use __initconst instead of
|
||||
__initdata.
|
||||
|
||||
Similarly init definitions without const require a separate
|
||||
use of const.
|
||||
|
||||
**INLINE_LOCATION**
|
||||
The inline keyword should sit between storage class and type.
|
||||
|
||||
For example, the following segment::
|
||||
|
||||
inline static int example_function(void)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
should be::
|
||||
|
||||
static inline int example_function(void)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
**MULTISTATEMENT_MACRO_USE_DO_WHILE**
|
||||
Macros with multiple statements should be enclosed in a
|
||||
do - while block. Same should also be the case for macros
|
||||
starting with `if` to avoid logic defects::
|
||||
|
||||
#define macrofun(a, b, c) \
|
||||
do { \
|
||||
if (a == 5) \
|
||||
do_this(b, c); \
|
||||
} while (0)
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl
|
||||
|
||||
**WEAK_DECLARATION**
|
||||
Using weak declarations like __attribute__((weak)) or __weak
|
||||
can have unintended link defects. Avoid using them.
|
||||
|
||||
|
||||
Functions and Variables
|
||||
-----------------------
|
||||
|
||||
**CAMELCASE**
|
||||
Avoid CamelCase Identifiers.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#naming
|
||||
|
||||
**FUNCTION_WITHOUT_ARGS**
|
||||
Function declarations without arguments like::
|
||||
|
||||
int foo()
|
||||
|
||||
should be::
|
||||
|
||||
int foo(void)
|
||||
|
||||
**GLOBAL_INITIALISERS**
|
||||
Global variables should not be initialized explicitly to
|
||||
0 (or NULL, false, etc.). Your compiler (or rather your
|
||||
loader, which is responsible for zeroing out the relevant
|
||||
sections) automatically does it for you.
|
||||
|
||||
**INITIALISED_STATIC**
|
||||
Static variables should not be initialized explicitly to zero.
|
||||
Your compiler (or rather your loader) automatically does
|
||||
it for you.
|
||||
|
||||
**RETURN_PARENTHESES**
|
||||
return is not a function and as such doesn't need parentheses::
|
||||
|
||||
return (bar);
|
||||
|
||||
can simply be::
|
||||
|
||||
return bar;
|
||||
|
||||
|
||||
Spacing and Brackets
|
||||
--------------------
|
||||
|
||||
**ASSIGNMENT_CONTINUATIONS**
|
||||
Assignment operators should not be written at the start of a
|
||||
line but should follow the operand at the previous line.
|
||||
|
||||
**BRACES**
|
||||
The placement of braces is stylistically incorrect.
|
||||
The preferred way is to put the opening brace last on the line,
|
||||
and put the closing brace first::
|
||||
|
||||
if (x is true) {
|
||||
we do y
|
||||
}
|
||||
|
||||
This applies for all non-functional blocks.
|
||||
However, there is one special case, namely functions: they have the
|
||||
opening brace at the beginning of the next line, thus::
|
||||
|
||||
int function(int x)
|
||||
{
|
||||
body of function
|
||||
}
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces
|
||||
|
||||
**BRACKET_SPACE**
|
||||
Whitespace before opening bracket '[' is prohibited.
|
||||
There are some exceptions:
|
||||
|
||||
1. With a type on the left::
|
||||
|
||||
;int [] a;
|
||||
|
||||
2. At the beginning of a line for slice initialisers::
|
||||
|
||||
[0...10] = 5,
|
||||
|
||||
3. Inside a curly brace::
|
||||
|
||||
= { [0...10] = 5 }
|
||||
|
||||
**CODE_INDENT**
|
||||
Code indent should use tabs instead of spaces.
|
||||
Outside of comments, documentation and Kconfig,
|
||||
spaces are never used for indentation.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation
|
||||
|
||||
**CONCATENATED_STRING**
|
||||
Concatenated elements should have a space in between.
|
||||
Example::
|
||||
|
||||
printk(KERN_INFO"bar");
|
||||
|
||||
should be::
|
||||
|
||||
printk(KERN_INFO "bar");
|
||||
|
||||
**ELSE_AFTER_BRACE**
|
||||
`else {` should follow the closing block `}` on the same line.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces
|
||||
|
||||
**LINE_SPACING**
|
||||
Vertical space is wasted given the limited number of lines an
|
||||
editor window can display when multiple blank lines are used.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces
|
||||
|
||||
**OPEN_BRACE**
|
||||
The opening brace should be following the function definitions on the
|
||||
next line. For any non-functional block it should be on the same line
|
||||
as the last construct.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces
|
||||
|
||||
**POINTER_LOCATION**
|
||||
When using pointer data or a function that returns a pointer type,
|
||||
the preferred use of * is adjacent to the data name or function name
|
||||
and not adjacent to the type name.
|
||||
Examples::
|
||||
|
||||
char *linux_banner;
|
||||
unsigned long long memparse(char *ptr, char **retptr);
|
||||
char *match_strdup(substring_t *s);
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces
|
||||
|
||||
**SPACING**
|
||||
Whitespace style used in the kernel sources is described in kernel docs.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces
|
||||
|
||||
**SWITCH_CASE_INDENT_LEVEL**
|
||||
switch should be at the same indent as case.
|
||||
Example::
|
||||
|
||||
switch (suffix) {
|
||||
case 'G':
|
||||
case 'g':
|
||||
mem <<= 30;
|
||||
break;
|
||||
case 'M':
|
||||
case 'm':
|
||||
mem <<= 20;
|
||||
break;
|
||||
case 'K':
|
||||
case 'k':
|
||||
mem <<= 10;
|
||||
/* fall through */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation
|
||||
|
||||
**TRAILING_WHITESPACE**
|
||||
Trailing whitespace should always be removed.
|
||||
Some editors highlight the trailing whitespace and cause visual
|
||||
distractions when editing files.
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces
|
||||
|
||||
**WHILE_AFTER_BRACE**
|
||||
while should follow the closing bracket on the same line::
|
||||
|
||||
do {
|
||||
...
|
||||
} while(something);
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces
|
||||
|
||||
|
||||
Others
|
||||
------
|
||||
|
||||
**CONFIG_DESCRIPTION**
|
||||
Kconfig symbols should have a help text which fully describes
|
||||
it.
|
||||
|
||||
**CORRUPTED_PATCH**
|
||||
The patch seems to be corrupted or lines are wrapped.
|
||||
Please regenerate the patch file before sending it to the maintainer.
|
||||
|
||||
**DOS_LINE_ENDINGS**
|
||||
For DOS-formatted patches, there are extra ^M symbols at the end of
|
||||
the line. These should be removed.
|
||||
|
||||
**EXECUTE_PERMISSIONS**
|
||||
There is no reason for source files to be executable. The executable
|
||||
bit can be removed safely.
|
||||
|
||||
**NON_OCTAL_PERMISSIONS**
|
||||
Permission bits should use 4 digit octal permissions (like 0700 or 0444).
|
||||
Avoid using any other base like decimal.
|
||||
|
||||
**NOT_UNIFIED_DIFF**
|
||||
The patch file does not appear to be in unified-diff format. Please
|
||||
regenerate the patch file before sending it to the maintainer.
|
||||
|
||||
**PRINTF_0XDECIMAL**
|
||||
Prefixing 0x with decimal output is defective and should be corrected.
|
||||
|
||||
**TRAILING_STATEMENTS**
|
||||
Trailing statements (for example after any conditional) should be
|
||||
on the next line.
|
||||
Like::
|
||||
|
||||
if (x == y) break;
|
||||
|
||||
should be::
|
||||
|
||||
if (x == y)
|
||||
break;
|
@ -124,6 +124,8 @@ box for setups where kernels are built and run on the same machine. In
|
||||
cases where the kernel runs on a separate machine, special preparations
|
||||
must be made, depending on where the gcov tool is used:
|
||||
|
||||
.. _gcov-test:
|
||||
|
||||
a) gcov is run on the TEST machine
|
||||
|
||||
The gcov tool version on the test machine must be compatible with the
|
||||
@ -143,6 +145,8 @@ a) gcov is run on the TEST machine
|
||||
machine. If any of the path components is symbolic link, the actual
|
||||
directory needs to be used instead (due to make's CURDIR handling).
|
||||
|
||||
.. _gcov-build:
|
||||
|
||||
b) gcov is run on the BUILD machine
|
||||
|
||||
The following files need to be copied after each test case from test
|
||||
@ -211,7 +215,7 @@ Appendix A: gather_on_build.sh
|
||||
------------------------------
|
||||
|
||||
Sample script to gather coverage meta files on the build machine
|
||||
(see 6a):
|
||||
(see :ref:`Separated build and test machines a. <gcov-test>`):
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
@ -244,7 +248,7 @@ Appendix B: gather_on_test.sh
|
||||
-----------------------------
|
||||
|
||||
Sample script to gather coverage data files on the test machine
|
||||
(see 6b):
|
||||
(see :ref:`Separated build and test machines b. <gcov-build>`):
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
@ -114,7 +114,7 @@ Examples of using the Linux-provided gdb helpers
|
||||
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
|
||||
....
|
||||
|
||||
- Examine fields of the current task struct::
|
||||
- Examine fields of the current task struct(supported by x86 and arm64 only)::
|
||||
|
||||
(gdb) p $lx_current().pid
|
||||
$1 = 4998
|
||||
|
@ -7,6 +7,9 @@ be used to work on the kernel. For now, the documents have been pulled
|
||||
together without any significant effort to integrate them into a coherent
|
||||
whole; patches welcome!
|
||||
|
||||
A brief overview of testing-specific tools can be found in
|
||||
Documentation/dev-tools/testing-overview.rst
|
||||
|
||||
.. class:: toc-title
|
||||
|
||||
Table of contents
|
||||
@ -14,6 +17,8 @@ whole; patches welcome!
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
testing-overview
|
||||
checkpatch
|
||||
coccinelle
|
||||
sparse
|
||||
kcov
|
||||
|
@ -11,46 +11,56 @@ designed to find out-of-bound and use-after-free bugs. KASAN has three modes:
|
||||
2. software tag-based KASAN (similar to userspace HWASan),
|
||||
3. hardware tag-based KASAN (based on hardware memory tagging).
|
||||
|
||||
Software KASAN modes (1 and 2) use compile-time instrumentation to insert
|
||||
validity checks before every memory access, and therefore require a compiler
|
||||
Generic KASAN is mainly used for debugging due to a large memory overhead.
|
||||
Software tag-based KASAN can be used for dogfood testing as it has a lower
|
||||
memory overhead that allows using it with real workloads. Hardware tag-based
|
||||
KASAN comes with low memory and performance overheads and, therefore, can be
|
||||
used in production. Either as an in-field memory bug detector or as a security
|
||||
mitigation.
|
||||
|
||||
Software KASAN modes (#1 and #2) use compile-time instrumentation to insert
|
||||
validity checks before every memory access and, therefore, require a compiler
|
||||
version that supports that.
|
||||
|
||||
Generic KASAN is supported in both GCC and Clang. With GCC it requires version
|
||||
Generic KASAN is supported in GCC and Clang. With GCC, it requires version
|
||||
8.3.0 or later. Any supported Clang version is compatible, but detection of
|
||||
out-of-bounds accesses for global variables is only supported since Clang 11.
|
||||
|
||||
Tag-based KASAN is only supported in Clang.
|
||||
Software tag-based KASAN mode is only supported in Clang.
|
||||
|
||||
Currently generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390
|
||||
The hardware KASAN mode (#3) relies on hardware to perform the checks but
|
||||
still requires a compiler version that supports memory tagging instructions.
|
||||
This mode is supported in GCC 10+ and Clang 11+.
|
||||
|
||||
Both software KASAN modes work with SLUB and SLAB memory allocators,
|
||||
while the hardware tag-based KASAN currently only supports SLUB.
|
||||
|
||||
Currently, generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390,
|
||||
and riscv architectures, and tag-based KASAN modes are supported only for arm64.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
To enable KASAN configure kernel with::
|
||||
To enable KASAN, configure the kernel with::
|
||||
|
||||
CONFIG_KASAN = y
|
||||
CONFIG_KASAN=y
|
||||
|
||||
and choose between CONFIG_KASAN_GENERIC (to enable generic KASAN),
|
||||
CONFIG_KASAN_SW_TAGS (to enable software tag-based KASAN), and
|
||||
CONFIG_KASAN_HW_TAGS (to enable hardware tag-based KASAN).
|
||||
and choose between ``CONFIG_KASAN_GENERIC`` (to enable generic KASAN),
|
||||
``CONFIG_KASAN_SW_TAGS`` (to enable software tag-based KASAN), and
|
||||
``CONFIG_KASAN_HW_TAGS`` (to enable hardware tag-based KASAN).
|
||||
|
||||
For software modes, you also need to choose between CONFIG_KASAN_OUTLINE and
|
||||
CONFIG_KASAN_INLINE. Outline and inline are compiler instrumentation types.
|
||||
The former produces smaller binary while the latter is 1.1 - 2 times faster.
|
||||
For software modes, also choose between ``CONFIG_KASAN_OUTLINE`` and
|
||||
``CONFIG_KASAN_INLINE``. Outline and inline are compiler instrumentation types.
|
||||
The former produces a smaller binary while the latter is 1.1-2 times faster.
|
||||
|
||||
Both software KASAN modes work with both SLUB and SLAB memory allocators,
|
||||
while the hardware tag-based KASAN currently only support SLUB.
|
||||
|
||||
For better error reports that include stack traces, enable CONFIG_STACKTRACE.
|
||||
|
||||
To augment reports with last allocation and freeing stack of the physical page,
|
||||
it is recommended to enable also CONFIG_PAGE_OWNER and boot with page_owner=on.
|
||||
To include alloc and free stack traces of affected slab objects into reports,
|
||||
enable ``CONFIG_STACKTRACE``. To include alloc and free stack traces of affected
|
||||
physical pages, enable ``CONFIG_PAGE_OWNER`` and boot with ``page_owner=on``.
|
||||
|
||||
Error reports
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
A typical out-of-bounds access generic KASAN report looks like this::
|
||||
A typical KASAN report looks like this::
|
||||
|
||||
==================================================================
|
||||
BUG: KASAN: slab-out-of-bounds in kmalloc_oob_right+0xa8/0xbc [test_kasan]
|
||||
@ -123,68 +133,75 @@ A typical out-of-bounds access generic KASAN report looks like this::
|
||||
ffff8801f44ec400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
|
||||
==================================================================
|
||||
|
||||
The header of the report provides a short summary of what kind of bug happened
|
||||
and what kind of access caused it. It's followed by a stack trace of the bad
|
||||
access, a stack trace of where the accessed memory was allocated (in case bad
|
||||
access happens on a slab object), and a stack trace of where the object was
|
||||
freed (in case of a use-after-free bug report). Next comes a description of
|
||||
the accessed slab object and information about the accessed memory page.
|
||||
The report header summarizes what kind of bug happened and what kind of access
|
||||
caused it. It is followed by a stack trace of the bad access, a stack trace of
|
||||
where the accessed memory was allocated (in case a slab object was accessed),
|
||||
and a stack trace of where the object was freed (in case of a use-after-free
|
||||
bug report). Next comes a description of the accessed slab object and the
|
||||
information about the accessed memory page.
|
||||
|
||||
In the last section the report shows memory state around the accessed address.
|
||||
Internally KASAN tracks memory state separately for each memory granule, which
|
||||
In the end, the report shows the memory state around the accessed address.
|
||||
Internally, KASAN tracks memory state separately for each memory granule, which
|
||||
is either 8 or 16 aligned bytes depending on KASAN mode. Each number in the
|
||||
memory state section of the report shows the state of one of the memory
|
||||
granules that surround the accessed address.
|
||||
|
||||
For generic KASAN the size of each memory granule is 8. The state of each
|
||||
For generic KASAN, the size of each memory granule is 8. The state of each
|
||||
granule is encoded in one shadow byte. Those 8 bytes can be accessible,
|
||||
partially accessible, freed or be a part of a redzone. KASAN uses the following
|
||||
encoding for each shadow byte: 0 means that all 8 bytes of the corresponding
|
||||
partially accessible, freed, or be a part of a redzone. KASAN uses the following
|
||||
encoding for each shadow byte: 00 means that all 8 bytes of the corresponding
|
||||
memory region are accessible; number N (1 <= N <= 7) means that the first N
|
||||
bytes are accessible, and other (8 - N) bytes are not; any negative value
|
||||
indicates that the entire 8-byte word is inaccessible. KASAN uses different
|
||||
negative values to distinguish between different kinds of inaccessible memory
|
||||
like redzones or freed memory (see mm/kasan/kasan.h).
|
||||
|
||||
In the report above the arrows point to the shadow byte 03, which means that
|
||||
the accessed address is partially accessible. For tag-based KASAN modes this
|
||||
last report section shows the memory tags around the accessed address
|
||||
(see the `Implementation details`_ section).
|
||||
In the report above, the arrow points to the shadow byte ``03``, which means
|
||||
that the accessed address is partially accessible.
|
||||
|
||||
For tag-based KASAN modes, this last report section shows the memory tags around
|
||||
the accessed address (see the `Implementation details`_ section).
|
||||
|
||||
Note that KASAN bug titles (like ``slab-out-of-bounds`` or ``use-after-free``)
|
||||
are best-effort: KASAN prints the most probable bug type based on the limited
|
||||
information it has. The actual type of the bug might be different.
|
||||
|
||||
Generic KASAN also reports up to two auxiliary call stack traces. These stack
|
||||
traces point to places in code that interacted with the object but that are not
|
||||
directly present in the bad access stack trace. Currently, this includes
|
||||
call_rcu() and workqueue queuing.
|
||||
|
||||
Boot parameters
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
KASAN is affected by the generic ``panic_on_warn`` command line parameter.
|
||||
When it is enabled, KASAN panics the kernel after printing a bug report.
|
||||
|
||||
By default, KASAN prints a bug report only for the first invalid memory access.
|
||||
With ``kasan_multi_shot``, KASAN prints a report on every invalid access. This
|
||||
effectively disables ``panic_on_warn`` for KASAN reports.
|
||||
|
||||
Hardware tag-based KASAN mode (see the section about various modes below) is
|
||||
intended for use in production as a security mitigation. Therefore, it supports
|
||||
boot parameters that allow to disable KASAN competely or otherwise control
|
||||
particular KASAN features.
|
||||
boot parameters that allow disabling KASAN or controlling its features.
|
||||
|
||||
- ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``).
|
||||
|
||||
- ``kasan.mode=sync`` or ``=async`` controls whether KASAN is configured in
|
||||
synchronous or asynchronous mode of execution (default: ``sync``).
|
||||
Synchronous mode: a bad access is detected immediately when a tag
|
||||
check fault occurs.
|
||||
Asynchronous mode: a bad access detection is delayed. When a tag check
|
||||
fault occurs, the information is stored in hardware (in the TFSR_EL1
|
||||
register for arm64). The kernel periodically checks the hardware and
|
||||
only reports tag faults during these checks.
|
||||
|
||||
- ``kasan.stacktrace=off`` or ``=on`` disables or enables alloc and free stack
|
||||
traces collection (default: ``on``).
|
||||
|
||||
- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN
|
||||
report or also panic the kernel (default: ``report``). Note, that tag
|
||||
checking gets disabled after the first reported bug.
|
||||
|
||||
For developers
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Software KASAN modes use compiler instrumentation to insert validity checks.
|
||||
Such instrumentation might be incompatible with some part of the kernel, and
|
||||
therefore needs to be disabled. To disable instrumentation for specific files
|
||||
or directories, add a line similar to the following to the respective kernel
|
||||
Makefile:
|
||||
|
||||
- For a single file (e.g. main.o)::
|
||||
|
||||
KASAN_SANITIZE_main.o := n
|
||||
|
||||
- For all files in one directory::
|
||||
|
||||
KASAN_SANITIZE := n
|
||||
|
||||
report or also panic the kernel (default: ``report``). The panic happens even
|
||||
if ``kasan_multi_shot`` is enabled.
|
||||
|
||||
Implementation details
|
||||
----------------------
|
||||
@ -192,12 +209,11 @@ Implementation details
|
||||
Generic KASAN
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
From a high level perspective, KASAN's approach to memory error detection is
|
||||
similar to that of kmemcheck: use shadow memory to record whether each byte of
|
||||
memory is safe to access, and use compile-time instrumentation to insert checks
|
||||
of shadow memory on each memory access.
|
||||
Software KASAN modes use shadow memory to record whether each byte of memory is
|
||||
safe to access and use compile-time instrumentation to insert shadow memory
|
||||
checks before each memory access.
|
||||
|
||||
Generic KASAN dedicates 1/8th of kernel memory to its shadow memory (e.g. 16TB
|
||||
Generic KASAN dedicates 1/8th of kernel memory to its shadow memory (16TB
|
||||
to cover 128TB on x86_64) and uses direct mapping with a scale and offset to
|
||||
translate a memory address to its corresponding shadow address.
|
||||
|
||||
@ -206,113 +222,105 @@ address::
|
||||
|
||||
static inline void *kasan_mem_to_shadow(const void *addr)
|
||||
{
|
||||
return ((unsigned long)addr >> KASAN_SHADOW_SCALE_SHIFT)
|
||||
return (void *)((unsigned long)addr >> KASAN_SHADOW_SCALE_SHIFT)
|
||||
+ KASAN_SHADOW_OFFSET;
|
||||
}
|
||||
|
||||
where ``KASAN_SHADOW_SCALE_SHIFT = 3``.
|
||||
|
||||
Compile-time instrumentation is used to insert memory access checks. Compiler
|
||||
inserts function calls (__asan_load*(addr), __asan_store*(addr)) before each
|
||||
memory access of size 1, 2, 4, 8 or 16. These functions check whether memory
|
||||
access is valid or not by checking corresponding shadow memory.
|
||||
inserts function calls (``__asan_load*(addr)``, ``__asan_store*(addr)``) before
|
||||
each memory access of size 1, 2, 4, 8, or 16. These functions check whether
|
||||
memory accesses are valid or not by checking corresponding shadow memory.
|
||||
|
||||
GCC 5.0 has possibility to perform inline instrumentation. Instead of making
|
||||
function calls GCC directly inserts the code to check the shadow memory.
|
||||
This option significantly enlarges kernel but it gives x1.1-x2 performance
|
||||
boost over outline instrumented kernel.
|
||||
With inline instrumentation, instead of making function calls, the compiler
|
||||
directly inserts the code to check shadow memory. This option significantly
|
||||
enlarges the kernel, but it gives an x1.1-x2 performance boost over the
|
||||
outline-instrumented kernel.
|
||||
|
||||
Generic KASAN also reports the last 2 call stacks to creation of work that
|
||||
potentially has access to an object. Call stacks for the following are shown:
|
||||
call_rcu() and workqueue queuing.
|
||||
|
||||
Generic KASAN is the only mode that delays the reuse of freed object via
|
||||
Generic KASAN is the only mode that delays the reuse of freed objects via
|
||||
quarantine (see mm/kasan/quarantine.c for implementation).
|
||||
|
||||
Software tag-based KASAN
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Software tag-based KASAN requires software memory tagging support in the form
|
||||
of HWASan-like compiler instrumentation (see HWASan documentation for details).
|
||||
|
||||
Software tag-based KASAN is currently only implemented for arm64 architecture.
|
||||
Software tag-based KASAN uses a software memory tagging approach to checking
|
||||
access validity. It is currently only implemented for the arm64 architecture.
|
||||
|
||||
Software tag-based KASAN uses the Top Byte Ignore (TBI) feature of arm64 CPUs
|
||||
to store a pointer tag in the top byte of kernel pointers. Like generic KASAN
|
||||
it uses shadow memory to store memory tags associated with each 16-byte memory
|
||||
cell (therefore it dedicates 1/16th of the kernel memory for shadow memory).
|
||||
to store a pointer tag in the top byte of kernel pointers. It uses shadow memory
|
||||
to store memory tags associated with each 16-byte memory cell (therefore, it
|
||||
dedicates 1/16th of the kernel memory for shadow memory).
|
||||
|
||||
On each memory allocation software tag-based KASAN generates a random tag, tags
|
||||
the allocated memory with this tag, and embeds this tag into the returned
|
||||
On each memory allocation, software tag-based KASAN generates a random tag, tags
|
||||
the allocated memory with this tag, and embeds the same tag into the returned
|
||||
pointer.
|
||||
|
||||
Software tag-based KASAN uses compile-time instrumentation to insert checks
|
||||
before each memory access. These checks make sure that tag of the memory that
|
||||
is being accessed is equal to tag of the pointer that is used to access this
|
||||
memory. In case of a tag mismatch software tag-based KASAN prints a bug report.
|
||||
before each memory access. These checks make sure that the tag of the memory
|
||||
that is being accessed is equal to the tag of the pointer that is used to access
|
||||
this memory. In case of a tag mismatch, software tag-based KASAN prints a bug
|
||||
report.
|
||||
|
||||
Software tag-based KASAN also has two instrumentation modes (outline, that
|
||||
emits callbacks to check memory accesses; and inline, that performs the shadow
|
||||
Software tag-based KASAN also has two instrumentation modes (outline, which
|
||||
emits callbacks to check memory accesses; and inline, which performs the shadow
|
||||
memory checks inline). With outline instrumentation mode, a bug report is
|
||||
simply printed from the function that performs the access check. With inline
|
||||
instrumentation a brk instruction is emitted by the compiler, and a dedicated
|
||||
brk handler is used to print bug reports.
|
||||
printed from the function that performs the access check. With inline
|
||||
instrumentation, a ``brk`` instruction is emitted by the compiler, and a
|
||||
dedicated ``brk`` handler is used to print bug reports.
|
||||
|
||||
Software tag-based KASAN uses 0xFF as a match-all pointer tag (accesses through
|
||||
pointers with 0xFF pointer tag aren't checked). The value 0xFE is currently
|
||||
pointers with the 0xFF pointer tag are not checked). The value 0xFE is currently
|
||||
reserved to tag freed memory regions.
|
||||
|
||||
Software tag-based KASAN currently only supports tagging of
|
||||
kmem_cache_alloc/kmalloc and page_alloc memory.
|
||||
Software tag-based KASAN currently only supports tagging of slab and page_alloc
|
||||
memory.
|
||||
|
||||
Hardware tag-based KASAN
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Hardware tag-based KASAN is similar to the software mode in concept, but uses
|
||||
Hardware tag-based KASAN is similar to the software mode in concept but uses
|
||||
hardware memory tagging support instead of compiler instrumentation and
|
||||
shadow memory.
|
||||
|
||||
Hardware tag-based KASAN is currently only implemented for arm64 architecture
|
||||
and based on both arm64 Memory Tagging Extension (MTE) introduced in ARMv8.5
|
||||
Instruction Set Architecture, and Top Byte Ignore (TBI).
|
||||
Instruction Set Architecture and Top Byte Ignore (TBI).
|
||||
|
||||
Special arm64 instructions are used to assign memory tags for each allocation.
|
||||
Same tags are assigned to pointers to those allocations. On every memory
|
||||
access, hardware makes sure that tag of the memory that is being accessed is
|
||||
equal to tag of the pointer that is used to access this memory. In case of a
|
||||
tag mismatch a fault is generated and a report is printed.
|
||||
access, hardware makes sure that the tag of the memory that is being accessed is
|
||||
equal to the tag of the pointer that is used to access this memory. In case of a
|
||||
tag mismatch, a fault is generated, and a report is printed.
|
||||
|
||||
Hardware tag-based KASAN uses 0xFF as a match-all pointer tag (accesses through
|
||||
pointers with 0xFF pointer tag aren't checked). The value 0xFE is currently
|
||||
pointers with the 0xFF pointer tag are not checked). The value 0xFE is currently
|
||||
reserved to tag freed memory regions.
|
||||
|
||||
Hardware tag-based KASAN currently only supports tagging of
|
||||
kmem_cache_alloc/kmalloc and page_alloc memory.
|
||||
Hardware tag-based KASAN currently only supports tagging of slab and page_alloc
|
||||
memory.
|
||||
|
||||
If the hardware doesn't support MTE (pre ARMv8.5), hardware tag-based KASAN
|
||||
won't be enabled. In this case all boot parameters are ignored.
|
||||
If the hardware does not support MTE (pre ARMv8.5), hardware tag-based KASAN
|
||||
will not be enabled. In this case, all KASAN boot parameters are ignored.
|
||||
|
||||
Note, that enabling CONFIG_KASAN_HW_TAGS always results in in-kernel TBI being
|
||||
enabled. Even when kasan.mode=off is provided, or when the hardware doesn't
|
||||
Note that enabling CONFIG_KASAN_HW_TAGS always results in in-kernel TBI being
|
||||
enabled. Even when ``kasan.mode=off`` is provided or when the hardware does not
|
||||
support MTE (but supports TBI).
|
||||
|
||||
Hardware tag-based KASAN only reports the first found bug. After that MTE tag
|
||||
Hardware tag-based KASAN only reports the first found bug. After that, MTE tag
|
||||
checking gets disabled.
|
||||
|
||||
What memory accesses are sanitised by KASAN?
|
||||
--------------------------------------------
|
||||
Shadow memory
|
||||
-------------
|
||||
|
||||
The kernel maps memory in a number of different parts of the address
|
||||
space. This poses something of a problem for KASAN, which requires
|
||||
that all addresses accessed by instrumented code have a valid shadow
|
||||
region.
|
||||
The kernel maps memory in several different parts of the address space.
|
||||
The range of kernel virtual addresses is large: there is not enough real
|
||||
memory to support a real shadow region for every address that could be
|
||||
accessed by the kernel. Therefore, KASAN only maps real shadow for certain
|
||||
parts of the address space.
|
||||
|
||||
The range of kernel virtual addresses is large: there is not enough
|
||||
real memory to support a real shadow region for every address that
|
||||
could be accessed by the kernel.
|
||||
|
||||
By default
|
||||
~~~~~~~~~~
|
||||
Default behaviour
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
By default, architectures only map real memory over the shadow region
|
||||
for the linear mapping (and potentially other small areas). For all
|
||||
@ -321,10 +329,9 @@ page is mapped over the shadow area. This read-only shadow page
|
||||
declares all memory accesses as permitted.
|
||||
|
||||
This presents a problem for modules: they do not live in the linear
|
||||
mapping, but in a dedicated module space. By hooking in to the module
|
||||
allocator, KASAN can temporarily map real shadow memory to cover
|
||||
them. This allows detection of invalid accesses to module globals, for
|
||||
example.
|
||||
mapping but in a dedicated module space. By hooking into the module
|
||||
allocator, KASAN temporarily maps real shadow memory to cover them.
|
||||
This allows detection of invalid accesses to module globals, for example.
|
||||
|
||||
This also creates an incompatibility with ``VMAP_STACK``: if the stack
|
||||
lives in vmalloc space, it will be shadowed by the read-only page, and
|
||||
@ -335,9 +342,10 @@ CONFIG_KASAN_VMALLOC
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
With ``CONFIG_KASAN_VMALLOC``, KASAN can cover vmalloc space at the
|
||||
cost of greater memory usage. Currently this is only supported on x86.
|
||||
cost of greater memory usage. Currently, this is supported on x86,
|
||||
riscv, s390, and powerpc.
|
||||
|
||||
This works by hooking into vmalloc and vmap, and dynamically
|
||||
This works by hooking into vmalloc and vmap and dynamically
|
||||
allocating real shadow memory to back the mappings.
|
||||
|
||||
Most mappings in vmalloc space are small, requiring less than a full
|
||||
@ -356,28 +364,76 @@ memory.
|
||||
|
||||
To avoid the difficulties around swapping mappings around, KASAN expects
|
||||
that the part of the shadow region that covers the vmalloc space will
|
||||
not be covered by the early shadow page, but will be left
|
||||
unmapped. This will require changes in arch-specific code.
|
||||
not be covered by the early shadow page but will be left unmapped.
|
||||
This will require changes in arch-specific code.
|
||||
|
||||
This allows ``VMAP_STACK`` support on x86, and can simplify support of
|
||||
This allows ``VMAP_STACK`` support on x86 and can simplify support of
|
||||
architectures that do not have a fixed module region.
|
||||
|
||||
CONFIG_KASAN_KUNIT_TEST and CONFIG_KASAN_MODULE_TEST
|
||||
----------------------------------------------------
|
||||
For developers
|
||||
--------------
|
||||
|
||||
KASAN tests consist of two parts:
|
||||
Ignoring accesses
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Software KASAN modes use compiler instrumentation to insert validity checks.
|
||||
Such instrumentation might be incompatible with some parts of the kernel, and
|
||||
therefore needs to be disabled.
|
||||
|
||||
Other parts of the kernel might access metadata for allocated objects.
|
||||
Normally, KASAN detects and reports such accesses, but in some cases (e.g.,
|
||||
in memory allocators), these accesses are valid.
|
||||
|
||||
For software KASAN modes, to disable instrumentation for a specific file or
|
||||
directory, add a ``KASAN_SANITIZE`` annotation to the respective kernel
|
||||
Makefile:
|
||||
|
||||
- For a single file (e.g., main.o)::
|
||||
|
||||
KASAN_SANITIZE_main.o := n
|
||||
|
||||
- For all files in one directory::
|
||||
|
||||
KASAN_SANITIZE := n
|
||||
|
||||
For software KASAN modes, to disable instrumentation on a per-function basis,
|
||||
use the KASAN-specific ``__no_sanitize_address`` function attribute or the
|
||||
generic ``noinstr`` one.
|
||||
|
||||
Note that disabling compiler instrumentation (either on a per-file or a
|
||||
per-function basis) makes KASAN ignore the accesses that happen directly in
|
||||
that code for software KASAN modes. It does not help when the accesses happen
|
||||
indirectly (through calls to instrumented functions) or with the hardware
|
||||
tag-based mode that does not use compiler instrumentation.
|
||||
|
||||
For software KASAN modes, to disable KASAN reports in a part of the kernel code
|
||||
for the current task, annotate this part of the code with a
|
||||
``kasan_disable_current()``/``kasan_enable_current()`` section. This also
|
||||
disables the reports for indirect accesses that happen through function calls.
|
||||
|
||||
For tag-based KASAN modes (include the hardware one), to disable access
|
||||
checking, use ``kasan_reset_tag()`` or ``page_kasan_tag_reset()``. Note that
|
||||
temporarily disabling access checking via ``page_kasan_tag_reset()`` requires
|
||||
saving and restoring the per-page KASAN tag via
|
||||
``page_kasan_tag``/``page_kasan_tag_set``.
|
||||
|
||||
Tests
|
||||
~~~~~
|
||||
|
||||
There are KASAN tests that allow verifying that KASAN works and can detect
|
||||
certain types of memory corruptions. The tests consist of two parts:
|
||||
|
||||
1. Tests that are integrated with the KUnit Test Framework. Enabled with
|
||||
``CONFIG_KASAN_KUNIT_TEST``. These tests can be run and partially verified
|
||||
automatically in a few different ways, see the instructions below.
|
||||
automatically in a few different ways; see the instructions below.
|
||||
|
||||
2. Tests that are currently incompatible with KUnit. Enabled with
|
||||
``CONFIG_KASAN_MODULE_TEST`` and can only be run as a module. These tests can
|
||||
only be verified manually, by loading the kernel module and inspecting the
|
||||
only be verified manually by loading the kernel module and inspecting the
|
||||
kernel log for KASAN reports.
|
||||
|
||||
Each KUnit-compatible KASAN test prints a KASAN report if an error is detected.
|
||||
Then the test prints its number and status.
|
||||
Each KUnit-compatible KASAN test prints one of multiple KASAN reports if an
|
||||
error is detected. Then the test prints its number and status.
|
||||
|
||||
When a test passes::
|
||||
|
||||
@ -405,30 +461,24 @@ Or, if one of the tests failed::
|
||||
|
||||
not ok 1 - kasan
|
||||
|
||||
|
||||
There are a few ways to run KUnit-compatible KASAN tests.
|
||||
|
||||
1. Loadable module
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
With ``CONFIG_KUNIT`` enabled, ``CONFIG_KASAN_KUNIT_TEST`` can be built as
|
||||
a loadable module and run on any architecture that supports KASAN by loading
|
||||
the module with insmod or modprobe. The module is called ``test_kasan``.
|
||||
With ``CONFIG_KUNIT`` enabled, KASAN-KUnit tests can be built as a loadable
|
||||
module and run by loading ``test_kasan.ko`` with ``insmod`` or ``modprobe``.
|
||||
|
||||
2. Built-In
|
||||
~~~~~~~~~~~
|
||||
|
||||
With ``CONFIG_KUNIT`` built-in, ``CONFIG_KASAN_KUNIT_TEST`` can be built-in
|
||||
on any architecure that supports KASAN. These and any other KUnit tests enabled
|
||||
will run and print the results at boot as a late-init call.
|
||||
With ``CONFIG_KUNIT`` built-in, KASAN-KUnit tests can be built-in as well.
|
||||
In this case, the tests will run at boot as a late-init call.
|
||||
|
||||
3. Using kunit_tool
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
With ``CONFIG_KUNIT`` and ``CONFIG_KASAN_KUNIT_TEST`` built-in, it's also
|
||||
possible use ``kunit_tool`` to see the results of these and other KUnit tests
|
||||
in a more readable way. This will not print the KASAN reports of the tests that
|
||||
passed. Use `KUnit documentation <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
|
||||
for more up-to-date information on ``kunit_tool``.
|
||||
With ``CONFIG_KUNIT`` and ``CONFIG_KASAN_KUNIT_TEST`` built-in, it is also
|
||||
possible to use ``kunit_tool`` to see the results of KUnit tests in a more
|
||||
readable way. This will not print the KASAN reports of the tests that passed.
|
||||
See `KUnit documentation <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
|
||||
for more up-to-date information on ``kunit_tool``.
|
||||
|
||||
.. _KUnit: https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html
|
||||
|
@ -1,3 +1,6 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. Copyright (C) 2019, Google LLC.
|
||||
|
||||
The Kernel Concurrency Sanitizer (KCSAN)
|
||||
========================================
|
||||
|
||||
|
@ -239,8 +239,8 @@ using a shell script test runner. ``kselftest/module.sh`` is designed
|
||||
to facilitate this process. There is also a header file provided to
|
||||
assist writing kernel modules that are for use with kselftest:
|
||||
|
||||
- ``tools/testing/kselftest/kselftest_module.h``
|
||||
- ``tools/testing/kselftest/kselftest/module.sh``
|
||||
- ``tools/testing/selftests/kselftest_module.h``
|
||||
- ``tools/testing/selftests/kselftest/module.sh``
|
||||
|
||||
How to use
|
||||
----------
|
||||
|
@ -78,8 +78,82 @@ Similarly to the above, it can be useful to add test-specific logic.
|
||||
void test_only_hook(void) { }
|
||||
#endif
|
||||
|
||||
TODO(dlatypov@google.com): add an example of using ``current->kunit_test`` in
|
||||
such a hook when it's not only updated for ``CONFIG_KASAN=y``.
|
||||
This test-only code can be made more useful by accessing the current kunit
|
||||
test, see below.
|
||||
|
||||
Accessing the current test
|
||||
--------------------------
|
||||
|
||||
In some cases, you need to call test-only code from outside the test file, e.g.
|
||||
like in the example above or if you're providing a fake implementation of an
|
||||
ops struct.
|
||||
There is a ``kunit_test`` field in ``task_struct``, so you can access it via
|
||||
``current->kunit_test``.
|
||||
|
||||
Here's a slightly in-depth example of how one could implement "mocking":
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <linux/sched.h> /* for current */
|
||||
|
||||
struct test_data {
|
||||
int foo_result;
|
||||
int want_foo_called_with;
|
||||
};
|
||||
|
||||
static int fake_foo(int arg)
|
||||
{
|
||||
struct kunit *test = current->kunit_test;
|
||||
struct test_data *test_data = test->priv;
|
||||
|
||||
KUNIT_EXPECT_EQ(test, test_data->want_foo_called_with, arg);
|
||||
return test_data->foo_result;
|
||||
}
|
||||
|
||||
static void example_simple_test(struct kunit *test)
|
||||
{
|
||||
/* Assume priv is allocated in the suite's .init */
|
||||
struct test_data *test_data = test->priv;
|
||||
|
||||
test_data->foo_result = 42;
|
||||
test_data->want_foo_called_with = 1;
|
||||
|
||||
/* In a real test, we'd probably pass a pointer to fake_foo somewhere
|
||||
* like an ops struct, etc. instead of calling it directly. */
|
||||
KUNIT_EXPECT_EQ(test, fake_foo(1), 42);
|
||||
}
|
||||
|
||||
|
||||
Note: here we're able to get away with using ``test->priv``, but if you wanted
|
||||
something more flexible you could use a named ``kunit_resource``, see :doc:`api/test`.
|
||||
|
||||
Failing the current test
|
||||
------------------------
|
||||
|
||||
But sometimes, you might just want to fail the current test. In that case, we
|
||||
have ``kunit_fail_current_test(fmt, args...)`` which is defined in ``<kunit/test-bug.h>`` and
|
||||
doesn't require pulling in ``<kunit/test.h>``.
|
||||
|
||||
E.g. say we had an option to enable some extra debug checks on some data structure:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <kunit/test-bug.h>
|
||||
|
||||
#ifdef CONFIG_EXTRA_DEBUG_CHECKS
|
||||
static void validate_my_data(struct data *data)
|
||||
{
|
||||
if (is_valid(data))
|
||||
return;
|
||||
|
||||
kunit_fail_current_test("data %p is invalid", data);
|
||||
|
||||
/* Normal, non-KUnit, error reporting code here. */
|
||||
}
|
||||
#else
|
||||
static void my_debug_function(void) { }
|
||||
#endif
|
||||
|
||||
|
||||
Customizing error messages
|
||||
--------------------------
|
||||
|
117
Documentation/dev-tools/testing-overview.rst
Normal file
117
Documentation/dev-tools/testing-overview.rst
Normal file
@ -0,0 +1,117 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
====================
|
||||
Kernel Testing Guide
|
||||
====================
|
||||
|
||||
|
||||
There are a number of different tools for testing the Linux kernel, so knowing
|
||||
when to use each of them can be a challenge. This document provides a rough
|
||||
overview of their differences, and how they fit together.
|
||||
|
||||
|
||||
Writing and Running Tests
|
||||
=========================
|
||||
|
||||
The bulk of kernel tests are written using either the kselftest or KUnit
|
||||
frameworks. These both provide infrastructure to help make running tests and
|
||||
groups of tests easier, as well as providing helpers to aid in writing new
|
||||
tests.
|
||||
|
||||
If you're looking to verify the behaviour of the Kernel — particularly specific
|
||||
parts of the kernel — then you'll want to use KUnit or kselftest.
|
||||
|
||||
|
||||
The Difference Between KUnit and kselftest
|
||||
------------------------------------------
|
||||
|
||||
KUnit (Documentation/dev-tools/kunit/index.rst) is an entirely in-kernel system
|
||||
for "white box" testing: because test code is part of the kernel, it can access
|
||||
internal structures and functions which aren't exposed to userspace.
|
||||
|
||||
KUnit tests therefore are best written against small, self-contained parts
|
||||
of the kernel, which can be tested in isolation. This aligns well with the
|
||||
concept of 'unit' testing.
|
||||
|
||||
For example, a KUnit test might test an individual kernel function (or even a
|
||||
single codepath through a function, such as an error handling case), rather
|
||||
than a feature as a whole.
|
||||
|
||||
This also makes KUnit tests very fast to build and run, allowing them to be
|
||||
run frequently as part of the development process.
|
||||
|
||||
There is a KUnit test style guide which may give further pointers in
|
||||
Documentation/dev-tools/kunit/style.rst
|
||||
|
||||
|
||||
kselftest (Documentation/dev-tools/kselftest.rst), on the other hand, is
|
||||
largely implemented in userspace, and tests are normal userspace scripts or
|
||||
programs.
|
||||
|
||||
This makes it easier to write more complicated tests, or tests which need to
|
||||
manipulate the overall system state more (e.g., spawning processes, etc.).
|
||||
However, it's not possible to call kernel functions directly from kselftest.
|
||||
This means that only kernel functionality which is exposed to userspace somehow
|
||||
(e.g. by a syscall, device, filesystem, etc.) can be tested with kselftest. To
|
||||
work around this, some tests include a companion kernel module which exposes
|
||||
more information or functionality. If a test runs mostly or entirely within the
|
||||
kernel, however, KUnit may be the more appropriate tool.
|
||||
|
||||
kselftest is therefore suited well to tests of whole features, as these will
|
||||
expose an interface to userspace, which can be tested, but not implementation
|
||||
details. This aligns well with 'system' or 'end-to-end' testing.
|
||||
|
||||
For example, all new system calls should be accompanied by kselftest tests.
|
||||
|
||||
Code Coverage Tools
|
||||
===================
|
||||
|
||||
The Linux Kernel supports two different code coverage measurement tools. These
|
||||
can be used to verify that a test is executing particular functions or lines
|
||||
of code. This is useful for determining how much of the kernel is being tested,
|
||||
and for finding corner-cases which are not covered by the appropriate test.
|
||||
|
||||
:doc:`gcov` is GCC's coverage testing tool, which can be used with the kernel
|
||||
to get global or per-module coverage. Unlike KCOV, it does not record per-task
|
||||
coverage. Coverage data can be read from debugfs, and interpreted using the
|
||||
usual gcov tooling.
|
||||
|
||||
:doc:`kcov` is a feature which can be built in to the kernel to allow
|
||||
capturing coverage on a per-task level. It's therefore useful for fuzzing and
|
||||
other situations where information about code executed during, for example, a
|
||||
single syscall is useful.
|
||||
|
||||
|
||||
Dynamic Analysis Tools
|
||||
======================
|
||||
|
||||
The kernel also supports a number of dynamic analysis tools, which attempt to
|
||||
detect classes of issues when they occur in a running kernel. These typically
|
||||
each look for a different class of bugs, such as invalid memory accesses,
|
||||
concurrency issues such as data races, or other undefined behaviour like
|
||||
integer overflows.
|
||||
|
||||
Some of these tools are listed below:
|
||||
|
||||
* kmemleak detects possible memory leaks. See
|
||||
Documentation/dev-tools/kmemleak.rst
|
||||
* KASAN detects invalid memory accesses such as out-of-bounds and
|
||||
use-after-free errors. See Documentation/dev-tools/kasan.rst
|
||||
* UBSAN detects behaviour that is undefined by the C standard, like integer
|
||||
overflows. See Documentation/dev-tools/ubsan.rst
|
||||
* KCSAN detects data races. See Documentation/dev-tools/kcsan.rst
|
||||
* KFENCE is a low-overhead detector of memory issues, which is much faster than
|
||||
KASAN and can be used in production. See Documentation/dev-tools/kfence.rst
|
||||
* lockdep is a locking correctness validator. See
|
||||
Documentation/locking/lockdep-design.rst
|
||||
* There are several other pieces of debug instrumentation in the kernel, many
|
||||
of which can be found in lib/Kconfig.debug
|
||||
|
||||
These tools tend to test the kernel as a whole, and do not "pass" like
|
||||
kselftest or KUnit tests. They can be combined with KUnit or kselftest by
|
||||
running tests on a kernel with these tools enabled: you can then be sure
|
||||
that none of these errors are occurring during the test.
|
||||
|
||||
Some of these tools integrate with KUnit or kselftest and will
|
||||
automatically fail tests if an issue is detected.
|
||||
|
4
Documentation/devicetree/bindings/.gitignore
vendored
4
Documentation/devicetree/bindings/.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
*.example.dts
|
||||
processed-schema*.yaml
|
||||
processed-schema*.json
|
||||
/processed-schema*.yaml
|
||||
/processed-schema*.json
|
||||
|
@ -5,7 +5,7 @@ DT_MK_SCHEMA ?= dt-mk-schema
|
||||
|
||||
DT_SCHEMA_LINT = $(shell which yamllint)
|
||||
|
||||
DT_SCHEMA_MIN_VERSION = 2020.8.1
|
||||
DT_SCHEMA_MIN_VERSION = 2021.2.1
|
||||
|
||||
PHONY += check_dtschema_version
|
||||
check_dtschema_version:
|
||||
@ -48,13 +48,16 @@ define rule_chkdt
|
||||
$(call cmd,mk_schema)
|
||||
endef
|
||||
|
||||
DT_DOCS = $(shell $(find_cmd) | sed -e 's|^$(srctree)/||')
|
||||
DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_cmd)))
|
||||
|
||||
override DTC_FLAGS := \
|
||||
-Wno-avoid_unnecessary_addr_size \
|
||||
-Wno-graph_child_address \
|
||||
-Wno-interrupt_provider
|
||||
|
||||
# Disable undocumented compatible checks until warning free
|
||||
override DT_CHECKER_FLAGS ?=
|
||||
|
||||
$(obj)/processed-schema-examples.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE
|
||||
$(call if_changed_rule,chkdt)
|
||||
|
||||
|
@ -109,6 +109,7 @@ properties:
|
||||
- libretech,aml-s905d-pc
|
||||
- phicomm,n1
|
||||
- smartlabs,sml5442tw
|
||||
- videostrong,gxl-kii-pro
|
||||
- const: amlogic,s905d
|
||||
- const: amlogic,meson-gxl
|
||||
|
||||
@ -120,8 +121,10 @@ properties:
|
||||
- khadas,vim2
|
||||
- kingnovel,r-box-pro
|
||||
- libretech,aml-s912-pc
|
||||
- minix,neo-u9h
|
||||
- nexbox,a1
|
||||
- tronsmart,vega-s96
|
||||
- videostrong,gxm-kiii-pro
|
||||
- wetek,core2
|
||||
- const: amlogic,s912
|
||||
- const: amlogic,meson-gxm
|
||||
|
64
Documentation/devicetree/bindings/arm/apple.yaml
Normal file
64
Documentation/devicetree/bindings/arm/apple.yaml
Normal file
@ -0,0 +1,64 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/arm/apple.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Apple ARM Machine Device Tree Bindings
|
||||
|
||||
maintainers:
|
||||
- Hector Martin <marcan@marcan.st>
|
||||
|
||||
description: |
|
||||
ARM platforms using SoCs designed by Apple Inc., branded "Apple Silicon".
|
||||
|
||||
This currently includes devices based on the "M1" SoC, starting with the
|
||||
three Mac models released in late 2020:
|
||||
|
||||
- Mac mini (M1, 2020)
|
||||
- MacBook Pro (13-inch, M1, 2020)
|
||||
- MacBook Air (M1, 2020)
|
||||
|
||||
The compatible property should follow this format:
|
||||
|
||||
compatible = "apple,<targettype>", "apple,<socid>", "apple,arm-platform";
|
||||
|
||||
<targettype> represents the board/device and comes from the `target-type`
|
||||
property of the root node of the Apple Device Tree, lowercased. It can be
|
||||
queried on macOS using the following command:
|
||||
|
||||
$ ioreg -d2 -l | grep target-type
|
||||
|
||||
<socid> is the lowercased SoC ID. Apple uses at least *five* different
|
||||
names for their SoCs:
|
||||
|
||||
- Marketing name ("M1")
|
||||
- Internal name ("H13G")
|
||||
- Codename ("Tonga")
|
||||
- SoC ID ("T8103")
|
||||
- Package/IC part number ("APL1102")
|
||||
|
||||
Devicetrees should use the lowercased SoC ID, to avoid confusion if
|
||||
multiple SoCs share the same marketing name. This can be obtained from
|
||||
the `compatible` property of the arm-io node of the Apple Device Tree,
|
||||
which can be queried as follows on macOS:
|
||||
|
||||
$ ioreg -n arm-io | grep compatible
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
const: "/"
|
||||
compatible:
|
||||
oneOf:
|
||||
- description: Apple M1 SoC based platforms
|
||||
items:
|
||||
- enum:
|
||||
- apple,j274 # Mac mini (M1, 2020)
|
||||
- apple,j293 # MacBook Pro (13-inch, M1, 2020)
|
||||
- apple,j313 # MacBook Air (M1, 2020)
|
||||
- const: apple,t8103
|
||||
- const: apple,arm-platform
|
||||
|
||||
additionalProperties: true
|
||||
|
||||
...
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user