未验证 提交 ffb1e76f 编写于 作者: M Mark Brown

Merge tag 'v5.15-rc2' into spi-5.15

Linux 5.15-rc2

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
...@@ -229,6 +229,7 @@ Matthew Wilcox <willy@infradead.org> <mawilcox@microsoft.com> ...@@ -229,6 +229,7 @@ Matthew Wilcox <willy@infradead.org> <mawilcox@microsoft.com>
Matthew Wilcox <willy@infradead.org> <willy@debian.org> Matthew Wilcox <willy@infradead.org> <willy@debian.org>
Matthew Wilcox <willy@infradead.org> <willy@linux.intel.com> Matthew Wilcox <willy@infradead.org> <willy@linux.intel.com>
Matthew Wilcox <willy@infradead.org> <willy@parisc-linux.org> Matthew Wilcox <willy@infradead.org> <willy@parisc-linux.org>
Matthias Fuchs <socketcan@esd.eu> <matthias.fuchs@esd.eu>
Matthieu CASTET <castet.matthieu@free.fr> Matthieu CASTET <castet.matthieu@free.fr>
Matt Ranostay <matt.ranostay@konsulko.com> <matt@ranostay.consulting> Matt Ranostay <matt.ranostay@konsulko.com> <matt@ranostay.consulting>
Matt Ranostay <mranostay@gmail.com> Matthew Ranostay <mranostay@embeddedalley.com> Matt Ranostay <mranostay@gmail.com> Matthew Ranostay <mranostay@embeddedalley.com>
...@@ -341,6 +342,7 @@ Sumit Semwal <sumit.semwal@ti.com> ...@@ -341,6 +342,7 @@ Sumit Semwal <sumit.semwal@ti.com>
Takashi YOSHII <takashi.yoshii.zj@renesas.com> Takashi YOSHII <takashi.yoshii.zj@renesas.com>
Tejun Heo <htejun@gmail.com> Tejun Heo <htejun@gmail.com>
Thomas Graf <tgraf@suug.ch> Thomas Graf <tgraf@suug.ch>
Thomas Körper <socketcan@esd.eu> <thomas.koerper@esd.eu>
Thomas Pedersen <twp@codeaurora.org> Thomas Pedersen <twp@codeaurora.org>
Tiezhu Yang <yangtiezhu@loongson.cn> <kernelpatch@126.com> Tiezhu Yang <yangtiezhu@loongson.cn> <kernelpatch@126.com>
Todor Tomov <todor.too@gmail.com> <todor.tomov@linaro.org> Todor Tomov <todor.too@gmail.com> <todor.tomov@linaro.org>
......
...@@ -128,6 +128,8 @@ Date: Aug 28, 2020 ...@@ -128,6 +128,8 @@ Date: Aug 28, 2020
KernelVersion: 5.10.0 KernelVersion: 5.10.0
Contact: dmaengine@vger.kernel.org Contact: dmaengine@vger.kernel.org
Description: The last executed device administrative command's status/error. Description: The last executed device administrative command's status/error.
Also last configuration error overloaded.
Writing to it will clear the status.
What: /sys/bus/dsa/devices/wq<m>.<n>/block_on_fault What: /sys/bus/dsa/devices/wq<m>.<n>/block_on_fault
Date: Oct 27, 2020 Date: Oct 27, 2020
...@@ -211,6 +213,13 @@ Contact: dmaengine@vger.kernel.org ...@@ -211,6 +213,13 @@ Contact: dmaengine@vger.kernel.org
Description: Indicate whether ATS disable is turned on for the workqueue. Description: Indicate whether ATS disable is turned on for the workqueue.
0 indicates ATS is on, and 1 indicates ATS is off for the workqueue. 0 indicates ATS is on, and 1 indicates ATS is off for the workqueue.
What: /sys/bus/dsa/devices/wq<m>.<n>/occupancy
Date May 25, 2021
KernelVersion: 5.14.0
Contact: dmaengine@vger.kernel.org
Description: Show the current number of entries in this WQ if WQ Occupancy
Support bit WQ capabilities is 1.
What: /sys/bus/dsa/devices/engine<m>.<n>/group_id What: /sys/bus/dsa/devices/engine<m>.<n>/group_id
Date: Oct 25, 2019 Date: Oct 25, 2019
KernelVersion: 5.6.0 KernelVersion: 5.6.0
......
...@@ -8,9 +8,19 @@ Description: ...@@ -8,9 +8,19 @@ Description:
c_chmask capture channel mask c_chmask capture channel mask
c_srate capture sampling rate c_srate capture sampling rate
c_ssize capture sample size (bytes) c_ssize capture sample size (bytes)
c_mute_present capture mute control enable
c_volume_present capture volume control enable
c_volume_min capture volume control min value (in 1/256 dB)
c_volume_max capture volume control max value (in 1/256 dB)
c_volume_res capture volume control resolution (in 1/256 dB)
p_chmask playback channel mask p_chmask playback channel mask
p_srate playback sampling rate p_srate playback sampling rate
p_ssize playback sample size (bytes) p_ssize playback sample size (bytes)
p_mute_present playback mute control enable
p_volume_present playback volume control enable
p_volume_min playback volume control min value (in 1/256 dB)
p_volume_max playback volume control max value (in 1/256 dB)
p_volume_res playback volume control resolution (in 1/256 dB)
req_number the number of pre-allocated request req_number the number of pre-allocated request
for both capture and playback for both capture and playback
========== =================================== ========== ===================================
...@@ -9,8 +9,18 @@ Description: ...@@ -9,8 +9,18 @@ Description:
c_srate capture sampling rate c_srate capture sampling rate
c_ssize capture sample size (bytes) c_ssize capture sample size (bytes)
c_sync capture synchronization type (async/adaptive) c_sync capture synchronization type (async/adaptive)
c_mute_present capture mute control enable
c_volume_present capture volume control enable
c_volume_min capture volume control min value (in 1/256 dB)
c_volume_max capture volume control max value (in 1/256 dB)
c_volume_res capture volume control resolution (in 1/256 dB)
fb_max maximum extra bandwidth in async mode fb_max maximum extra bandwidth in async mode
p_chmask playback channel mask p_chmask playback channel mask
p_srate playback sampling rate p_srate playback sampling rate
p_ssize playback sample size (bytes) p_ssize playback sample size (bytes)
p_mute_present playback mute control enable
p_volume_present playback volume control enable
p_volume_min playback volume control min value (in 1/256 dB)
p_volume_max playback volume control max value (in 1/256 dB)
p_volume_res playback volume control resolution (in 1/256 dB)
========= ============================ ========= ============================
...@@ -215,6 +215,17 @@ Description: Sets the skip reset on timeout option for the device. Value of ...@@ -215,6 +215,17 @@ Description: Sets the skip reset on timeout option for the device. Value of
"0" means device will be reset in case some CS has timed out, "0" means device will be reset in case some CS has timed out,
otherwise it will not be reset. otherwise it will not be reset.
What: /sys/kernel/debug/habanalabs/hl<n>/state_dump
Date: Oct 2021
KernelVersion: 5.15
Contact: ynudelman@habana.ai
Description: Gets the state dump occurring on a CS timeout or failure.
State dump is used for debug and is created each time in case of
a problem in a CS execution, before reset.
Reading from the node returns the newest state dump available.
Writing an integer X discards X state dumps, so that the
next read would return X+1-st newest state dump.
What: /sys/kernel/debug/habanalabs/hl<n>/stop_on_err What: /sys/kernel/debug/habanalabs/hl<n>/stop_on_err
Date: Mar 2020 Date: Mar 2020
KernelVersion: 5.6 KernelVersion: 5.6
...@@ -230,6 +241,14 @@ Description: Displays a list with information about the currently user ...@@ -230,6 +241,14 @@ Description: Displays a list with information about the currently user
pointers (user virtual addresses) that are pinned and mapped pointers (user virtual addresses) that are pinned and mapped
to DMA addresses to DMA addresses
What: /sys/kernel/debug/habanalabs/hl<n>/userptr_lookup
Date: Aug 2021
KernelVersion: 5.15
Contact: ogabbay@kernel.org
Description: Allows to search for specific user pointers (user virtual
addresses) that are pinned and mapped to DMA addresses, and see
their resolution to the specific dma address.
What: /sys/kernel/debug/habanalabs/hl<n>/vm What: /sys/kernel/debug/habanalabs/hl<n>/vm
Date: Jan 2019 Date: Jan 2019
KernelVersion: 5.1 KernelVersion: 5.1
......
What: /dev/wmi/dell-smbios What: /dev/wmi/dell-smbios
Date: November 2017 Date: November 2017
KernelVersion: 4.15 KernelVersion: 4.15
Contact: "Mario Limonciello" <mario.limonciello@dell.com> Contact: Dell.Client.Kernel@dell.com
Description: Description:
Perform SMBIOS calls on supported Dell machines. Perform SMBIOS calls on supported Dell machines.
through the Dell ACPI-WMI interface. through the Dell ACPI-WMI interface.
......
...@@ -27,12 +27,13 @@ Description: ...@@ -27,12 +27,13 @@ Description:
lsm: [[subj_user=] [subj_role=] [subj_type=] lsm: [[subj_user=] [subj_role=] [subj_type=]
[obj_user=] [obj_role=] [obj_type=]] [obj_user=] [obj_role=] [obj_type=]]
option: [[appraise_type=]] [template=] [permit_directio] option: [[appraise_type=]] [template=] [permit_directio]
[appraise_flag=] [keyrings=] [appraise_flag=] [appraise_algos=] [keyrings=]
base: base:
func:= [BPRM_CHECK][MMAP_CHECK][CREDS_CHECK][FILE_CHECK][MODULE_CHECK] func:= [BPRM_CHECK][MMAP_CHECK][CREDS_CHECK][FILE_CHECK][MODULE_CHECK]
[FIRMWARE_CHECK] [FIRMWARE_CHECK]
[KEXEC_KERNEL_CHECK] [KEXEC_INITRAMFS_CHECK] [KEXEC_KERNEL_CHECK] [KEXEC_INITRAMFS_CHECK]
[KEXEC_CMDLINE] [KEY_CHECK] [CRITICAL_DATA] [KEXEC_CMDLINE] [KEY_CHECK] [CRITICAL_DATA]
[SETXATTR_CHECK]
mask:= [[^]MAY_READ] [[^]MAY_WRITE] [[^]MAY_APPEND] mask:= [[^]MAY_READ] [[^]MAY_WRITE] [[^]MAY_APPEND]
[[^]MAY_EXEC] [[^]MAY_EXEC]
fsmagic:= hex value fsmagic:= hex value
...@@ -55,6 +56,10 @@ Description: ...@@ -55,6 +56,10 @@ Description:
label:= [selinux]|[kernel_info]|[data_label] label:= [selinux]|[kernel_info]|[data_label]
data_label:= a unique string used for grouping and limiting critical data. data_label:= a unique string used for grouping and limiting critical data.
For example, "selinux" to measure critical data for SELinux. For example, "selinux" to measure critical data for SELinux.
appraise_algos:= comma-separated list of hash algorithms
For example, "sha256,sha512" to only accept to appraise
files where the security.ima xattr was hashed with one
of these two algorithms.
default policy: default policy:
# PROC_SUPER_MAGIC # PROC_SUPER_MAGIC
...@@ -134,3 +139,9 @@ Description: ...@@ -134,3 +139,9 @@ Description:
keys added to .builtin_trusted_keys or .ima keyring: keys added to .builtin_trusted_keys or .ima keyring:
measure func=KEY_CHECK keyrings=.builtin_trusted_keys|.ima measure func=KEY_CHECK keyrings=.builtin_trusted_keys|.ima
Example of the special SETXATTR_CHECK appraise rule, that
restricts the hash algorithms allowed when writing to the
security.ima xattr of a file:
appraise func=SETXATTR_CHECK appraise_algos=sha256,sha384,sha512
...@@ -28,6 +28,18 @@ Description: ...@@ -28,6 +28,18 @@ Description:
For more details refer Documentation/admin-guide/iostats.rst For more details refer Documentation/admin-guide/iostats.rst
What: /sys/block/<disk>/diskseq
Date: February 2021
Contact: Matteo Croce <mcroce@microsoft.com>
Description:
The /sys/block/<disk>/diskseq files reports the disk
sequence number, which is a monotonically increasing
number assigned to every drive.
Some devices, like the loop device, refresh such number
every time the backing file is changed.
The value type is 64 bit unsigned.
What: /sys/block/<disk>/<part>/stat What: /sys/block/<disk>/<part>/stat
Date: February 2008 Date: February 2008
Contact: Jerome Marchand <jmarchan@redhat.com> Contact: Jerome Marchand <jmarchan@redhat.com>
......
...@@ -55,6 +55,43 @@ Date: Oct, 2016 ...@@ -55,6 +55,43 @@ Date: Oct, 2016
KernelVersion: v4.10 KernelVersion: v4.10
Contact: linux-ide@vger.kernel.org Contact: linux-ide@vger.kernel.org
Description: Description:
(RW) Write to the file to turn on or off the SATA ncq (native (RW) Write to the file to turn on or off the SATA NCQ (native
command queueing) support. By default this feature is turned command queueing) priority support. By default this feature is
off. turned off. If the device does not support the SATA NCQ
priority feature, writing "1" to this file results in an error
(see ncq_prio_supported).
What: /sys/block/*/device/sas_ncq_prio_enable
Date: Oct, 2016
KernelVersion: v4.10
Contact: linux-ide@vger.kernel.org
Description:
(RW) This is the equivalent of the ncq_prio_enable attribute
file for SATA devices connected to a SAS host-bus-adapter
(HBA) implementing support for the SATA NCQ priority feature.
This file does not exist if the HBA driver does not implement
support for the SATA NCQ priority feature, regardless of the
device support for this feature (see sas_ncq_prio_supported).
What: /sys/block/*/device/ncq_prio_supported
Date: Aug, 2021
KernelVersion: v5.15
Contact: linux-ide@vger.kernel.org
Description:
(RO) Indicates if the device supports the SATA NCQ (native
command queueing) priority feature.
What: /sys/block/*/device/sas_ncq_prio_supported
Date: Aug, 2021
KernelVersion: v5.15
Contact: linux-ide@vger.kernel.org
Description:
(RO) This is the equivalent of the ncq_prio_supported attribute
file for SATA devices connected to a SAS host-bus-adapter
(HBA) implementing support for the SATA NCQ priority feature.
This file does not exist if the HBA driver does not implement
support for the SATA NCQ priority feature, regardless of the
device support for this feature.
What: /sys/bus/event_source/devices/uncore_*/alias
Date: June 2021
KernelVersion: 5.15
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Description: Read-only. An attribute to describe the alias name of
the uncore PMU if an alias exists on some platforms.
The 'perf(1)' tool should treat both names the same.
They both can be used to access the uncore PMU.
Example:
$ cat /sys/devices/uncore_cha_2/alias
uncore_type_0_2
What: /sys/bus/iio/devices/iio:deviceX/out_temp_raw
Date: August 2021
KernelVersion: 5.15
Contact: Andreas Klinger <ak@it-klinger.de>
Description:
Set the temperature. This value is sent to the sensor for
temperature compensation.
Default value: 25000 (25 °C)
What: /sys/bus/iio/devices/iio:deviceX/out_humidityrelative_raw
Date: August 2021
KernelVersion: 5.15
Contact: Andreas Klinger <ak@it-klinger.de>
Description:
Set the relative humidity. This value is sent to the sensor for
humidity compensation.
Default value: 50000 (50 % relative humidity)
What: /sys/bus/iio/devices/iio:deviceX/in_resistance_calibbias
Date: August 2021
KernelVersion: 5.15
Contact: Andreas Klinger <ak@it-klinger.de>
Description:
Set the bias value for the resistance which is used for
calculation of in_concentration_input as follows:
x = (in_resistance_raw - in_resistance_calibbias) * 0.65
in_concentration_input = 500 / (1 + e^x)
Default value: 30000
...@@ -121,6 +121,23 @@ Description: ...@@ -121,6 +121,23 @@ Description:
child buses, and re-discover devices removed earlier child buses, and re-discover devices removed earlier
from this part of the device tree. from this part of the device tree.
What: /sys/bus/pci/devices/.../reset_method
Date: August 2021
Contact: Amey Narkhede <ameynarkhede03@gmail.com>
Description:
Some devices allow an individual function to be reset
without affecting other functions in the same slot.
For devices that have this support, a file named
reset_method is present in sysfs. Reading this file
gives names of the supported and enabled reset methods and
their ordering. Writing a space-separated list of names of
reset methods sets the reset methods and ordering to be
used when resetting the device. Writing an empty string
disables the ability to reset the device. Writing
"default" enables all supported reset methods in the
default ordering.
What: /sys/bus/pci/devices/.../reset What: /sys/bus/pci/devices/.../reset
Date: July 2009 Date: July 2009
Contact: Michael S. Tsirkin <mst@redhat.com> Contact: Michael S. Tsirkin <mst@redhat.com>
......
...@@ -28,3 +28,17 @@ Description: ...@@ -28,3 +28,17 @@ Description:
value comes from an ACPI _PXM method or a similar firmware value comes from an ACPI _PXM method or a similar firmware
source. Initial users for this file would be devices like source. Initial users for this file would be devices like
arm smmu which are populated by arm64 acpi_iort. arm smmu which are populated by arm64 acpi_iort.
What: /sys/bus/platform/devices/.../msi_irqs/
Date: August 2021
Contact: Barry Song <song.bao.hua@hisilicon.com>
Description:
The /sys/devices/.../msi_irqs directory contains a variable set
of files, with each file being named after a corresponding msi
irq vector allocated to that device.
What: /sys/bus/platform/devices/.../msi_irqs/<N>
Date: August 2021
Contact: Barry Song <song.bao.hua@hisilicon.com>
Description:
This attribute will show "msi" if <N> is a valid msi irq
...@@ -232,7 +232,7 @@ Description: When new NVM image is written to the non-active NVM ...@@ -232,7 +232,7 @@ Description: When new NVM image is written to the non-active NVM
What: /sys/bus/thunderbolt/devices/.../nvm_authenticate_on_disconnect What: /sys/bus/thunderbolt/devices/.../nvm_authenticate_on_disconnect
Date: Oct 2020 Date: Oct 2020
KernelVersion: v5.9 KernelVersion: v5.9
Contact: Mario Limonciello <mario.limonciello@dell.com> Contact: Mario Limonciello <mario.limonciello@outlook.com>
Description: For supported devices, automatically authenticate the new Thunderbolt Description: For supported devices, automatically authenticate the new Thunderbolt
image when the device is disconnected from the host system. image when the device is disconnected from the host system.
......
...@@ -2,8 +2,8 @@ What: /sys/class/firmware-attributes/*/attributes/*/ ...@@ -2,8 +2,8 @@ What: /sys/class/firmware-attributes/*/attributes/*/
Date: February 2021 Date: February 2021
KernelVersion: 5.11 KernelVersion: 5.11
Contact: Divya Bharathi <Divya.Bharathi@Dell.com>, Contact: Divya Bharathi <Divya.Bharathi@Dell.com>,
Mario Limonciello <mario.limonciello@dell.com>,
Prasanth KSR <prasanth.ksr@dell.com> Prasanth KSR <prasanth.ksr@dell.com>
Dell.Client.Kernel@dell.com
Description: Description:
A sysfs interface for systems management software to enable A sysfs interface for systems management software to enable
configuration capability on supported systems. This directory configuration capability on supported systems. This directory
...@@ -130,8 +130,8 @@ What: /sys/class/firmware-attributes/*/authentication/ ...@@ -130,8 +130,8 @@ What: /sys/class/firmware-attributes/*/authentication/
Date: February 2021 Date: February 2021
KernelVersion: 5.11 KernelVersion: 5.11
Contact: Divya Bharathi <Divya.Bharathi@Dell.com>, Contact: Divya Bharathi <Divya.Bharathi@Dell.com>,
Mario Limonciello <mario.limonciello@dell.com>,
Prasanth KSR <prasanth.ksr@dell.com> Prasanth KSR <prasanth.ksr@dell.com>
Dell.Client.Kernel@dell.com
Description: Description:
Devices support various authentication mechanisms which can be exposed Devices support various authentication mechanisms which can be exposed
as a separate configuration object. as a separate configuration object.
...@@ -220,8 +220,8 @@ What: /sys/class/firmware-attributes/*/attributes/pending_reboot ...@@ -220,8 +220,8 @@ What: /sys/class/firmware-attributes/*/attributes/pending_reboot
Date: February 2021 Date: February 2021
KernelVersion: 5.11 KernelVersion: 5.11
Contact: Divya Bharathi <Divya.Bharathi@Dell.com>, Contact: Divya Bharathi <Divya.Bharathi@Dell.com>,
Mario Limonciello <mario.limonciello@dell.com>,
Prasanth KSR <prasanth.ksr@dell.com> Prasanth KSR <prasanth.ksr@dell.com>
Dell.Client.Kernel@dell.com
Description: Description:
A read-only attribute reads 1 if a reboot is necessary to apply A read-only attribute reads 1 if a reboot is necessary to apply
pending BIOS attribute changes. Also, an uevent_KOBJ_CHANGE is pending BIOS attribute changes. Also, an uevent_KOBJ_CHANGE is
...@@ -249,8 +249,8 @@ What: /sys/class/firmware-attributes/*/attributes/reset_bios ...@@ -249,8 +249,8 @@ What: /sys/class/firmware-attributes/*/attributes/reset_bios
Date: February 2021 Date: February 2021
KernelVersion: 5.11 KernelVersion: 5.11
Contact: Divya Bharathi <Divya.Bharathi@Dell.com>, Contact: Divya Bharathi <Divya.Bharathi@Dell.com>,
Mario Limonciello <mario.limonciello@dell.com>,
Prasanth KSR <prasanth.ksr@dell.com> Prasanth KSR <prasanth.ksr@dell.com>
Dell.Client.Kernel@dell.com
Description: Description:
This attribute can be used to reset the BIOS Configuration. This attribute can be used to reset the BIOS Configuration.
Specifically, it tells which type of reset BIOS configuration is being Specifically, it tells which type of reset BIOS configuration is being
...@@ -272,3 +272,14 @@ Description: ...@@ -272,3 +272,14 @@ Description:
Note that any changes to this attribute requires a reboot Note that any changes to this attribute requires a reboot
for changes to take effect. for changes to take effect.
What: /sys/class/firmware-attributes/*/attributes/debug_cmd
Date: July 2021
KernelVersion: 5.14
Contact: Mark Pearson <markpearson@lenovo.com>
Description:
This write only attribute can be used to send debug commands to the BIOS.
This should only be used when recommended by the BIOS vendor. Vendors may
use it to enable extra debug attributes or BIOS features for testing purposes.
Note that any changes to this attribute requires a reboot for changes to take effect.
...@@ -494,6 +494,15 @@ Description: AArch64 CPU registers ...@@ -494,6 +494,15 @@ Description: AArch64 CPU registers
'identification' directory exposes the CPU ID registers for 'identification' directory exposes the CPU ID registers for
identifying model and revision of the CPU. identifying model and revision of the CPU.
What: /sys/devices/system/cpu/aarch32_el0
Date: May 2021
Contact: Linux ARM Kernel Mailing list <linux-arm-kernel@lists.infradead.org>
Description: Identifies the subset of CPUs in the system that can execute
AArch32 (32-bit ARM) applications. If present, the same format as
/sys/devices/system/cpu/{offline,online,possible,present} is used.
If absent, then all or none of the CPUs can execute AArch32
applications and execve() will behave accordingly.
What: /sys/devices/system/cpu/cpu#/cpu_capacity What: /sys/devices/system/cpu/cpu#/cpu_capacity
Date: December 2016 Date: December 2016
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
...@@ -640,3 +649,20 @@ Description: SPURR ticks for cpuX when it was idle. ...@@ -640,3 +649,20 @@ Description: SPURR ticks for cpuX when it was idle.
This sysfs interface exposes the number of SPURR ticks This sysfs interface exposes the number of SPURR ticks
for cpuX when it was idle. for cpuX when it was idle.
What: /sys/devices/system/cpu/cpuX/mte_tcf_preferred
Date: July 2021
Contact: Linux ARM Kernel Mailing list <linux-arm-kernel@lists.infradead.org>
Description: Preferred MTE tag checking mode
When a user program specifies more than one MTE tag checking
mode, this sysfs node is used to specify which mode should
be preferred when scheduling a task on that CPU. Possible
values:
================ ==============================================
"sync" Prefer synchronous mode
"async" Prefer asynchronous mode
================ ==============================================
See also: Documentation/arm64/memory-tagging-extension.rst
What: /sys/bus/spi/<dev>/update_firmware
Date: Jul 2021
Contact: sebastian.reichel@collabora.com
Description: Write 1 to this file to update the ACHC microcontroller
firmware via the EzPort interface. For this the kernel
will load "achc.bin" via the firmware API (so usually
from /lib/firmware). The write will block until the FW
has either been flashed successfully or an error occured.
What: /sys/bus/spi/<dev>/reset
Date: Jul 2021
Contact: sebastian.reichel@collabora.com
Description: This file represents the microcontroller's reset line.
1 means the reset line is asserted, 0 means it's not
asserted. The file is read and writable.
What: /sys/bus/platform/devices/INTC1092:00/intc_reg
Date: August 2021
KernelVersion: 5.15
Contact: Shravan S <s.shravan@intel.com>,
An Sudhakar <sudhakar.an@intel.com>
Description:
Specific Absorption Rate (SAR) regulatory mode is typically
derived based on information like mcc (Mobile Country Code) and
mnc (Mobile Network Code) that is available for the currently
attached LTE network. A userspace application is required to set
the current SAR regulatory mode on the Dynamic SAR driver using
this sysfs node. Such an application can also read back using
this sysfs node, the currently configured regulatory mode value
from the Dynamic SAR driver.
Acceptable regulatory modes are:
== ====
0 FCC
1 CE
2 ISED
== ====
- The regulatory mode value has one of the above values.
- The default regulatory mode used in the driver is 0.
What: /sys/bus/platform/devices/INTC1092:00/intc_data
Date: August 2021
KernelVersion: 5.15
Contact: Shravan S <s.shravan@intel.com>,
An Sudhakar <sudhakar.an@intel.com>
Description:
This sysfs entry is used to retrieve Dynamic SAR information
emitted/maintained by a BIOS that supports Dynamic SAR.
The retrieved information is in the order given below:
- device_mode
- bandtable_index
- antennatable_index
- sartable_index
The above information is sent as integer values separated
by a single space. This information can then be pushed to a
WWAN modem that uses this to control the transmit signal
level using the Band/Antenna/SAR table index information.
These parameters are derived/decided by aggregating
device-mode like laptop/tablet/clamshell etc. and the
proximity-sensor data available to the embedded controller on
given host. The regulatory mode configured on Dynamic SAR
driver also influences these values.
The userspace applications can poll for changes to this file
using POLLPRI event on file-descriptor (fd) obtained by opening
this sysfs entry. Application can then read this information from
the sysfs node and consume the given information.
...@@ -1298,3 +1298,239 @@ Description: This node is used to set or display whether UFS WriteBooster is ...@@ -1298,3 +1298,239 @@ Description: This node is used to set or display whether UFS WriteBooster is
(if the platform supports UFSHCD_CAP_CLK_SCALING). For a (if the platform supports UFSHCD_CAP_CLK_SCALING). For a
platform that doesn't support UFSHCD_CAP_CLK_SCALING, we can platform that doesn't support UFSHCD_CAP_CLK_SCALING, we can
disable/enable WriteBooster through this sysfs node. disable/enable WriteBooster through this sysfs node.
What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_version
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the HPB specification version.
The full information about the descriptor can be found in the UFS
HPB (Host Performance Booster) Extension specifications.
Example: version 1.2.3 = 0123h
The file is read only.
What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_control
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows an indication of the HPB control mode.
00h: Host control mode
01h: Device control mode
The file is read only.
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_region_size
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the bHPBRegionSize which can be calculated
as in the following (in bytes):
HPB Region size = 512B * 2^bHPBRegionSize
The file is read only.
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_number_lu
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the maximum number of HPB LU supported by
the device.
00h: HPB is not supported by the device.
01h ~ 20h: Maximum number of HPB LU supported by the device
The file is read only.
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_subregion_size
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the bHPBSubRegionSize, which can be
calculated as in the following (in bytes) and shall be a multiple of
logical block size:
HPB Sub-Region size = 512B x 2^bHPBSubRegionSize
bHPBSubRegionSize shall not exceed bHPBRegionSize.
The file is read only.
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_max_active_regions
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the maximum number of active HPB regions that
is supported by the device.
The file is read only.
What: /sys/class/scsi_device/*/device/unit_descriptor/hpb_lu_max_active_regions
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the maximum number of HPB regions assigned to
the HPB logical unit.
The file is read only.
What: /sys/class/scsi_device/*/device/unit_descriptor/hpb_pinned_region_start_offset
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the start offset of HPB pinned region.
The file is read only.
What: /sys/class/scsi_device/*/device/unit_descriptor/hpb_number_pinned_regions
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of HPB pinned regions assigned to
the HPB logical unit.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_stats/hit_cnt
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of reads that changed to HPB read.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_stats/miss_cnt
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of reads that cannot be changed to
HPB read.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_stats/rb_noti_cnt
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of response UPIUs that has
recommendations for activating sub-regions and/or inactivating region.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_stats/rb_active_cnt
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of active sub-regions recommended by
response UPIUs.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_stats/rb_inactive_cnt
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of inactive regions recommended by
response UPIUs.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_stats/map_req_cnt
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the number of read buffer commands for
activating sub-regions recommended by response UPIUs.
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_params/requeue_timeout_ms
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the requeue timeout threshold for write buffer
command in ms. The value can be changed by writing an integer to
this entry.
What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_data_size_hpb_single_cmd
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the maximum HPB data size for using a single HPB
command.
=== ========
00h 4KB
01h 8KB
02h 12KB
...
FFh 1024KB
=== ========
The file is read only.
What: /sys/bus/platform/drivers/ufshcd/*/flags/hpb_enable
Date: June 2021
Contact: Daejun Park <daejun7.park@samsung.com>
Description: This entry shows the status of HPB.
== ============================
0 HPB is not enabled.
1 HPB is enabled
== ============================
The file is read only.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/activation_thld
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: In host control mode, reads are the major source of activation
trials. Once this threshold hs met, the region is added to the
"to-be-activated" list. Since we reset the read counter upon
write, this include sending a rb command updating the region
ppn as well.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/normalization_factor
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: In host control mode, we think of the regions as "buckets".
Those buckets are being filled with reads, and emptied on write.
We use entries_per_srgn - the amount of blocks in a subregion as
our bucket size. This applies because HPB1.0 only handles
single-block reads. Once the bucket size is crossed, we trigger
a normalization work - not only to avoid overflow, but mainly
because we want to keep those counters normalized, as we are
using those reads as a comparative score, to make various decisions.
The normalization is dividing (shift right) the read counter by
the normalization_factor. If during consecutive normalizations
an active region has exhausted its reads - inactivate it.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_enter
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: Region deactivation is often due to the fact that eviction took
place: A region becomes active at the expense of another. This is
happening when the max-active-regions limit has been crossed.
In host mode, eviction is considered an extreme measure. We
want to verify that the entering region has enough reads, and
the exiting region has much fewer reads. eviction_thld_enter is
the min reads that a region must have in order to be considered
a candidate for evicting another region.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_exit
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: Same as above for the exiting region. A region is considered to
be a candidate for eviction only if it has fewer reads than
eviction_thld_exit.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_ms
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: In order not to hang on to "cold" regions, we inactivate
a region that has no READ access for a predefined amount of
time - read_timeout_ms. If read_timeout_ms has expired, and the
region is dirty, it is less likely that we can make any use of
HPB reading it so we inactivate it. Still, deactivation has
its overhead, and we may still benefit from HPB reading this
region if it is clean - see read_timeout_expiries.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_expiries
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: If the region read timeout has expired, but the region is clean,
just re-wind its timer for another spin. Do that as long as it
is clean and did not exhaust its read_timeout_expiries threshold.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/timeout_polling_interval_ms
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: The frequency with which the delayed worker that checks the
read_timeouts is awakened.
What: /sys/class/scsi_device/*/device/hpb_param_sysfs/inflight_map_req
Date: February 2021
Contact: Avri Altman <avri.altman@wdc.com>
Description: In host control mode the host is the originator of map requests.
To avoid flooding the device with map requests, use a simple throttling
mechanism that limits the number of inflight map requests.
...@@ -41,8 +41,7 @@ Description: This parameter controls the number of prefree segments to be ...@@ -41,8 +41,7 @@ Description: This parameter controls the number of prefree segments to be
What: /sys/fs/f2fs/<disk>/main_blkaddr What: /sys/fs/f2fs/<disk>/main_blkaddr
Date: November 2019 Date: November 2019
Contact: "Ramon Pantin" <pantin@google.com> Contact: "Ramon Pantin" <pantin@google.com>
Description: Description: Shows first block address of MAIN area.
Shows first block address of MAIN area.
What: /sys/fs/f2fs/<disk>/ipu_policy What: /sys/fs/f2fs/<disk>/ipu_policy
Date: November 2013 Date: November 2013
...@@ -493,3 +492,23 @@ Contact: "Chao Yu" <yuchao0@huawei.com> ...@@ -493,3 +492,23 @@ Contact: "Chao Yu" <yuchao0@huawei.com>
Description: When ATGC is on, it controls age threshold to bypass GCing young Description: When ATGC is on, it controls age threshold to bypass GCing young
candidates whose age is not beyond the threshold, by default it was candidates whose age is not beyond the threshold, by default it was
initialized as 604800 seconds (equals to 7 days). initialized as 604800 seconds (equals to 7 days).
What: /sys/fs/f2fs/<disk>/gc_reclaimed_segments
Date: July 2021
Contact: "Daeho Jeong" <daehojeong@google.com>
Description: Show how many segments have been reclaimed by GC during a specific
GC mode (0: GC normal, 1: GC idle CB, 2: GC idle greedy,
3: GC idle AT, 4: GC urgent high, 5: GC urgent low)
You can re-initialize this value to "0".
What: /sys/fs/f2fs/<disk>/gc_segment_mode
Date: July 2021
Contact: "Daeho Jeong" <daehojeong@google.com>
Description: You can control for which gc mode the "gc_reclaimed_segments" node shows.
Refer to the description of the modes in "gc_reclaimed_segments".
What: /sys/fs/f2fs/<disk>/seq_file_ra_mul
Date: July 2021
Contact: "Daeho Jeong" <daehojeong@google.com>
Description: You can control the multiplier value of bdi device readahead window size
between 2 (default) and 256 for POSIX_FADV_SEQUENTIAL advise option.
What: /sys/kernel/dmabuf/buffers
Date: May 2021
KernelVersion: v5.13
Contact: Hridya Valsaraju <hridya@google.com>
Description: The /sys/kernel/dmabuf/buffers directory contains a
snapshot of the internal state of every DMA-BUF.
/sys/kernel/dmabuf/buffers/<inode_number> will contain the
statistics for the DMA-BUF with the unique inode number
<inode_number>
Users: kernel memory tuning/debugging tools
What: /sys/kernel/dmabuf/buffers/<inode_number>/exporter_name
Date: May 2021
KernelVersion: v5.13
Contact: Hridya Valsaraju <hridya@google.com>
Description: This file is read-only and contains the name of the exporter of
the DMA-BUF.
What: /sys/kernel/dmabuf/buffers/<inode_number>/size
Date: May 2021
KernelVersion: v5.13
Contact: Hridya Valsaraju <hridya@google.com>
Description: This file is read-only and specifies the size of the DMA-BUF in
bytes.
...@@ -42,8 +42,12 @@ Description: /sys/kernel/iommu_groups/<grp_id>/type shows the type of default ...@@ -42,8 +42,12 @@ Description: /sys/kernel/iommu_groups/<grp_id>/type shows the type of default
======== ====================================================== ======== ======================================================
DMA All the DMA transactions from the device in this group DMA All the DMA transactions from the device in this group
are translated by the iommu. are translated by the iommu.
DMA-FQ As above, but using batched invalidation to lazily
remove translations after use. This may offer reduced
overhead at the cost of reduced memory protection.
identity All the DMA transactions from the device in this group identity All the DMA transactions from the device in this group
are not translated by the iommu. are not translated by the iommu. Maximum performance
but zero protection.
auto Change to the type the device was booted with. auto Change to the type the device was booted with.
======== ====================================================== ======== ======================================================
......
What: /sys/kernel/mm/numa/
Date: June 2021
Contact: Linux memory management mailing list <linux-mm@kvack.org>
Description: Interface for NUMA
What: /sys/kernel/mm/numa/demotion_enabled
Date: June 2021
Contact: Linux memory management mailing list <linux-mm@kvack.org>
Description: Enable/disable demoting pages during reclaim
Page migration during reclaim is intended for systems
with tiered memory configurations. These systems have
multiple types of memory with varied performance
characteristics instead of plain NUMA systems where
the same kind of memory is found at varied distances.
Allowing page migration during reclaim enables these
systems to migrate pages from fast tiers to slow tiers
when the fast tier is under pressure. This migration
is performed before swap. It may move data to a NUMA
node that does not fall into the cpuset of the
allocating process which might be construed to violate
the guarantees of cpusets. This should not be enabled
on systems which need strict cpuset location
guarantees.
What: /sys/devices/platform/<platform>/tokens/* What: /sys/devices/platform/<platform>/tokens/*
Date: November 2017 Date: November 2017
KernelVersion: 4.15 KernelVersion: 4.15
Contact: "Mario Limonciello" <mario.limonciello@dell.com> Contact: Dell.Client.Kernel@dell.com
Description: Description:
A read-only description of Dell platform tokens A read-only description of Dell platform tokens
available on the machine. available on the machine.
......
...@@ -111,3 +111,43 @@ Contact: linux-acpi@vger.kernel.org ...@@ -111,3 +111,43 @@ Contact: linux-acpi@vger.kernel.org
Description: Description:
(RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz, (RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz,
when FIVR clock is 38.4MHz. when FIVR clock is 38.4MHz.
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_freq_mhz
Date: September, 2021
KernelVersion: v5.15
Contact: linux-acpi@vger.kernel.org
Description:
(RO) Get the FIVR switching control frequency in MHz.
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_fault_status
Date: September, 2021
KernelVersion: v5.15
Contact: linux-acpi@vger.kernel.org
Description:
(RO) Read the FIVR switching frequency control fault status.
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/ssc_clock_info
Date: September, 2021
KernelVersion: v5.15
Contact: linux-acpi@vger.kernel.org
Description:
(RO) Presents SSC (spread spectrum clock) information for EMI
(Electro magnetic interference) control. This is a bit mask.
Bits Description
[7:0] Sets clock spectrum spread percentage:
0x00=0.2% , 0x3F=10%
1 LSB = 0.1% increase in spread (for
settings 0x01 thru 0x1C)
1 LSB = 0.2% increase in spread (for
settings 0x1E thru 0x3F)
[8] When set to 1, enables spread
spectrum clock
[9] 0: Triangle mode. FFC frequency
walks around the Fcenter in a linear
fashion
1: Random walk mode. FFC frequency
changes randomly within the SSC
(Spread spectrum clock) range
[10] 0: No white noise. 1: Add white noise
to spread waveform
[11] When 1, future writes are ignored.
What: /sys/devices/platform/<platform>/force_power What: /sys/devices/platform/<platform>/force_power
Date: September 2017 Date: September 2017
KernelVersion: 4.15 KernelVersion: 4.15
Contact: "Mario Limonciello" <mario.limonciello@dell.com> Contact: "Mario Limonciello" <mario.limonciello@outlook.com>
Description: Description:
Modify the platform force power state, influencing Modify the platform force power state, influencing
Thunderbolt controllers to turn on or off when no Thunderbolt controllers to turn on or off when no
......
...@@ -26,3 +26,10 @@ Contact: Hans de Goede <hdegoede@redhat.com> ...@@ -26,3 +26,10 @@ Contact: Hans de Goede <hdegoede@redhat.com>
Description: Reading this file gives the current selected profile for this Description: Reading this file gives the current selected profile for this
device. Writing this file with one of the strings from device. Writing this file with one of the strings from
platform_profile_choices changes the profile to the new value. platform_profile_choices changes the profile to the new value.
This file can be monitored for changes by polling for POLLPRI,
POLLPRI will be signalled on any changes, independent of those
changes coming from a userspace write; or coming from another
source such as e.g. a hotkey triggered profile change handled
either directly by the embedded-controller or fully handled
inside the kernel.
...@@ -295,7 +295,7 @@ Description: ...@@ -295,7 +295,7 @@ Description:
What: /sys/power/resume_offset What: /sys/power/resume_offset
Date: April 2018 Date: April 2018
Contact: Mario Limonciello <mario.limonciello@dell.com> Contact: Mario Limonciello <mario.limonciello@outlook.com>
Description: Description:
This file is used for telling the kernel an offset into a disk This file is used for telling the kernel an offset into a disk
to use when hibernating the system such as with a swap file. to use when hibernating the system such as with a swap file.
......
...@@ -33,6 +33,13 @@ Description: ...@@ -33,6 +33,13 @@ Description:
frequency adjustment value (a positive integer) in frequency adjustment value (a positive integer) in
parts per billion. parts per billion.
What: /sys/class/ptp/ptpN/max_vclocks
Date: May 2021
Contact: Yangbo Lu <yangbo.lu@nxp.com>
Description:
This file contains the maximum number of ptp vclocks.
Write integer to re-configure it.
What: /sys/class/ptp/ptpN/n_alarms What: /sys/class/ptp/ptpN/n_alarms
Date: September 2010 Date: September 2010
Contact: Richard Cochran <richardcochran@gmail.com> Contact: Richard Cochran <richardcochran@gmail.com>
...@@ -61,6 +68,19 @@ Description: ...@@ -61,6 +68,19 @@ Description:
This file contains the number of programmable pins This file contains the number of programmable pins
offered by the PTP hardware clock. offered by the PTP hardware clock.
What: /sys/class/ptp/ptpN/n_vclocks
Date: May 2021
Contact: Yangbo Lu <yangbo.lu@nxp.com>
Description:
This file contains the number of virtual PTP clocks in
use. By default, the value is 0 meaning that only the
physical clock is in use. Setting the value creates
the corresponding number of virtual clocks and causes
the physical clock to become free running. Setting the
value back to 0 deletes the virtual clocks and
switches the physical clock back to normal, adjustable
operation.
What: /sys/class/ptp/ptpN/pins What: /sys/class/ptp/ptpN/pins
Date: March 2014 Date: March 2014
Contact: Richard Cochran <richardcochran@gmail.com> Contact: Richard Cochran <richardcochran@gmail.com>
......
...@@ -43,6 +43,7 @@ entries corresponding to EPF driver will be created by the EPF core. ...@@ -43,6 +43,7 @@ entries corresponding to EPF driver will be created by the EPF core.
.. <EPF Driver1>/ .. <EPF Driver1>/
... <EPF Device 11>/ ... <EPF Device 11>/
... <EPF Device 21>/ ... <EPF Device 21>/
... <EPF Device 31>/
.. <EPF Driver2>/ .. <EPF Driver2>/
... <EPF Device 12>/ ... <EPF Device 12>/
... <EPF Device 22>/ ... <EPF Device 22>/
...@@ -68,6 +69,7 @@ created) ...@@ -68,6 +69,7 @@ created)
... subsys_vendor_id ... subsys_vendor_id
... subsys_id ... subsys_id
... interrupt_pin ... interrupt_pin
... <Symlink EPF Device 31>/
... primary/ ... primary/
... <Symlink EPC Device1>/ ... <Symlink EPC Device1>/
... secondary/ ... secondary/
...@@ -79,6 +81,13 @@ interface should be added in 'primary' directory and symlink of endpoint ...@@ -79,6 +81,13 @@ interface should be added in 'primary' directory and symlink of endpoint
controller connected to secondary interface should be added in 'secondary' controller connected to secondary interface should be added in 'secondary'
directory. directory.
The <EPF Device> directory can have a list of symbolic links
(<Symlink EPF Device 31>) to other <EPF Device>. These symbolic links should
be created by the user to represent the virtual functions that are bound to
the physical function. In the above directory structure <EPF Device 11> is a
physical function and <EPF Device 31> is a virtual function. An EPF device once
it's linked to another EPF device, cannot be linked to a EPC device.
EPC Device EPC Device
========== ==========
...@@ -98,7 +107,8 @@ entries corresponding to EPC device will be created by the EPC core. ...@@ -98,7 +107,8 @@ entries corresponding to EPC device will be created by the EPC core.
The <EPC Device> directory will have a list of symbolic links to The <EPC Device> directory will have a list of symbolic links to
<EPF Device>. These symbolic links should be created by the user to <EPF Device>. These symbolic links should be created by the user to
represent the functions present in the endpoint device. represent the functions present in the endpoint device. Only <EPF Device>
that represents a physical function can be linked to a EPC device.
The <EPC Device> directory will also have a *start* field. Once The <EPC Device> directory will also have a *start* field. Once
"1" is written to this field, the endpoint device will be ready to "1" is written to this field, the endpoint device will be ready to
......
...@@ -103,6 +103,7 @@ need pass only as many optional fields as necessary: ...@@ -103,6 +103,7 @@ need pass only as many optional fields as necessary:
- subvendor and subdevice fields default to PCI_ANY_ID (FFFFFFFF) - subvendor and subdevice fields default to PCI_ANY_ID (FFFFFFFF)
- class and classmask fields default to 0 - class and classmask fields default to 0
- driver_data defaults to 0UL. - driver_data defaults to 0UL.
- override_only field defaults to 0.
Note that driver_data must match the value used by any of the pci_device_id Note that driver_data must match the value used by any of the pci_device_id
entries defined in the driver. This makes the driver_data field mandatory entries defined in the driver. This makes the driver_data field mandatory
......
...@@ -112,6 +112,35 @@ on PowerPC. ...@@ -112,6 +112,35 @@ on PowerPC.
The ``smp_mb__after_unlock_lock()`` invocations prevent this The ``smp_mb__after_unlock_lock()`` invocations prevent this
``WARN_ON()`` from triggering. ``WARN_ON()`` from triggering.
+-----------------------------------------------------------------------+
| **Quick Quiz**: |
+-----------------------------------------------------------------------+
| But the chain of rcu_node-structure lock acquisitions guarantees |
| that new readers will see all of the updater's pre-grace-period |
| accesses and also guarantees that the updater's post-grace-period |
| accesses will see all of the old reader's accesses. So why do we |
| need all of those calls to smp_mb__after_unlock_lock()? |
+-----------------------------------------------------------------------+
| **Answer**: |
+-----------------------------------------------------------------------+
| Because we must provide ordering for RCU's polling grace-period |
| primitives, for example, get_state_synchronize_rcu() and |
| poll_state_synchronize_rcu(). Consider this code:: |
| |
| CPU 0 CPU 1 |
| ---- ---- |
| WRITE_ONCE(X, 1) WRITE_ONCE(Y, 1) |
| g = get_state_synchronize_rcu() smp_mb() |
| while (!poll_state_synchronize_rcu(g)) r1 = READ_ONCE(X) |
| continue; |
| r0 = READ_ONCE(Y) |
| |
| RCU guarantees that the outcome r0 == 0 && r1 == 0 will not |
| happen, even if CPU 1 is in an RCU extended quiescent state |
| (idle or offline) and thus won't interact directly with the RCU |
| core processing at all. |
+-----------------------------------------------------------------------+
This approach must be extended to include idle CPUs, which need This approach must be extended to include idle CPUs, which need
RCU's grace-period memory ordering guarantee to extend to any RCU's grace-period memory ordering guarantee to extend to any
RCU read-side critical sections preceding and following the current RCU read-side critical sections preceding and following the current
......
...@@ -362,9 +362,8 @@ do_something_gp() uses rcu_dereference() to fetch from ``gp``: ...@@ -362,9 +362,8 @@ do_something_gp() uses rcu_dereference() to fetch from ``gp``:
12 } 12 }
The rcu_dereference() uses volatile casts and (for DEC Alpha) memory The rcu_dereference() uses volatile casts and (for DEC Alpha) memory
barriers in the Linux kernel. Should a `high-quality implementation of barriers in the Linux kernel. Should a |high-quality implementation of
C11 ``memory_order_consume`` C11 memory_order_consume [PDF]|_
[PDF] <http://www.rdrop.com/users/paulmck/RCU/consume.2015.07.13a.pdf>`__
ever appear, then rcu_dereference() could be implemented as a ever appear, then rcu_dereference() could be implemented as a
``memory_order_consume`` load. Regardless of the exact implementation, a ``memory_order_consume`` load. Regardless of the exact implementation, a
pointer fetched by rcu_dereference() may not be used outside of the pointer fetched by rcu_dereference() may not be used outside of the
...@@ -374,6 +373,9 @@ element has been passed from RCU to some other synchronization ...@@ -374,6 +373,9 @@ element has been passed from RCU to some other synchronization
mechanism, most commonly locking or `reference mechanism, most commonly locking or `reference
counting <https://www.kernel.org/doc/Documentation/RCU/rcuref.txt>`__. counting <https://www.kernel.org/doc/Documentation/RCU/rcuref.txt>`__.
.. |high-quality implementation of C11 memory_order_consume [PDF]| replace:: high-quality implementation of C11 ``memory_order_consume`` [PDF]
.. _high-quality implementation of C11 memory_order_consume [PDF]: http://www.rdrop.com/users/paulmck/RCU/consume.2015.07.13a.pdf
In short, updaters use rcu_assign_pointer() and readers use In short, updaters use rcu_assign_pointer() and readers use
rcu_dereference(), and these two RCU API elements work together to rcu_dereference(), and these two RCU API elements work together to
ensure that readers have a consistent view of newly added data elements. ensure that readers have a consistent view of newly added data elements.
......
...@@ -37,7 +37,7 @@ over a rather long period of time, but improvements are always welcome! ...@@ -37,7 +37,7 @@ over a rather long period of time, but improvements are always welcome!
1. Does the update code have proper mutual exclusion? 1. Does the update code have proper mutual exclusion?
RCU does allow -readers- to run (almost) naked, but -writers- must RCU does allow *readers* to run (almost) naked, but *writers* must
still use some sort of mutual exclusion, such as: still use some sort of mutual exclusion, such as:
a. locking, a. locking,
...@@ -73,7 +73,7 @@ over a rather long period of time, but improvements are always welcome! ...@@ -73,7 +73,7 @@ over a rather long period of time, but improvements are always welcome!
critical section is every bit as bad as letting them leak out critical section is every bit as bad as letting them leak out
from under a lock. Unless, of course, you have arranged some from under a lock. Unless, of course, you have arranged some
other means of protection, such as a lock or a reference count other means of protection, such as a lock or a reference count
-before- letting them out of the RCU read-side critical section. *before* letting them out of the RCU read-side critical section.
3. Does the update code tolerate concurrent accesses? 3. Does the update code tolerate concurrent accesses?
...@@ -101,7 +101,7 @@ over a rather long period of time, but improvements are always welcome! ...@@ -101,7 +101,7 @@ over a rather long period of time, but improvements are always welcome!
c. Make updates appear atomic to readers. For example, c. Make updates appear atomic to readers. For example,
pointer updates to properly aligned fields will pointer updates to properly aligned fields will
appear atomic, as will individual atomic primitives. appear atomic, as will individual atomic primitives.
Sequences of operations performed under a lock will -not- Sequences of operations performed under a lock will *not*
appear to be atomic to RCU readers, nor will sequences appear to be atomic to RCU readers, nor will sequences
of multiple atomic primitives. of multiple atomic primitives.
...@@ -333,7 +333,7 @@ over a rather long period of time, but improvements are always welcome! ...@@ -333,7 +333,7 @@ over a rather long period of time, but improvements are always welcome!
for example) may be omitted. for example) may be omitted.
10. Conversely, if you are in an RCU read-side critical section, 10. Conversely, if you are in an RCU read-side critical section,
and you don't hold the appropriate update-side lock, you -must- and you don't hold the appropriate update-side lock, you *must*
use the "_rcu()" variants of the list macros. Failing to do so use the "_rcu()" variants of the list macros. Failing to do so
will break Alpha, cause aggressive compilers to generate bad code, will break Alpha, cause aggressive compilers to generate bad code,
and confuse people trying to read your code. and confuse people trying to read your code.
...@@ -359,12 +359,12 @@ over a rather long period of time, but improvements are always welcome! ...@@ -359,12 +359,12 @@ over a rather long period of time, but improvements are always welcome!
callback pending, then that RCU callback will execute on some callback pending, then that RCU callback will execute on some
surviving CPU. (If this was not the case, a self-spawning RCU surviving CPU. (If this was not the case, a self-spawning RCU
callback would prevent the victim CPU from ever going offline.) callback would prevent the victim CPU from ever going offline.)
Furthermore, CPUs designated by rcu_nocbs= might well -always- Furthermore, CPUs designated by rcu_nocbs= might well *always*
have their RCU callbacks executed on some other CPUs, in fact, have their RCU callbacks executed on some other CPUs, in fact,
for some real-time workloads, this is the whole point of using for some real-time workloads, this is the whole point of using
the rcu_nocbs= kernel boot parameter. the rcu_nocbs= kernel boot parameter.
13. Unlike other forms of RCU, it -is- permissible to block in an 13. Unlike other forms of RCU, it *is* permissible to block in an
SRCU read-side critical section (demarked by srcu_read_lock() SRCU read-side critical section (demarked by srcu_read_lock()
and srcu_read_unlock()), hence the "SRCU": "sleepable RCU". and srcu_read_unlock()), hence the "SRCU": "sleepable RCU".
Please note that if you don't need to sleep in read-side critical Please note that if you don't need to sleep in read-side critical
...@@ -411,16 +411,16 @@ over a rather long period of time, but improvements are always welcome! ...@@ -411,16 +411,16 @@ over a rather long period of time, but improvements are always welcome!
14. The whole point of call_rcu(), synchronize_rcu(), and friends 14. The whole point of call_rcu(), synchronize_rcu(), and friends
is to wait until all pre-existing readers have finished before is to wait until all pre-existing readers have finished before
carrying out some otherwise-destructive operation. It is carrying out some otherwise-destructive operation. It is
therefore critically important to -first- remove any path therefore critically important to *first* remove any path
that readers can follow that could be affected by the that readers can follow that could be affected by the
destructive operation, and -only- -then- invoke call_rcu(), destructive operation, and *only then* invoke call_rcu(),
synchronize_rcu(), or friends. synchronize_rcu(), or friends.
Because these primitives only wait for pre-existing readers, it Because these primitives only wait for pre-existing readers, it
is the caller's responsibility to guarantee that any subsequent is the caller's responsibility to guarantee that any subsequent
readers will execute safely. readers will execute safely.
15. The various RCU read-side primitives do -not- necessarily contain 15. The various RCU read-side primitives do *not* necessarily contain
memory barriers. You should therefore plan for the CPU memory barriers. You should therefore plan for the CPU
and the compiler to freely reorder code into and out of RCU and the compiler to freely reorder code into and out of RCU
read-side critical sections. It is the responsibility of the read-side critical sections. It is the responsibility of the
...@@ -459,8 +459,8 @@ over a rather long period of time, but improvements are always welcome! ...@@ -459,8 +459,8 @@ over a rather long period of time, but improvements are always welcome!
pass in a function defined within a loadable module, then it in pass in a function defined within a loadable module, then it in
necessary to wait for all pending callbacks to be invoked after necessary to wait for all pending callbacks to be invoked after
the last invocation and before unloading that module. Note that the last invocation and before unloading that module. Note that
it is absolutely -not- sufficient to wait for a grace period! it is absolutely *not* sufficient to wait for a grace period!
The current (say) synchronize_rcu() implementation is -not- The current (say) synchronize_rcu() implementation is *not*
guaranteed to wait for callbacks registered on other CPUs. guaranteed to wait for callbacks registered on other CPUs.
Or even on the current CPU if that CPU recently went offline Or even on the current CPU if that CPU recently went offline
and came back online. and came back online.
...@@ -470,7 +470,7 @@ over a rather long period of time, but improvements are always welcome! ...@@ -470,7 +470,7 @@ over a rather long period of time, but improvements are always welcome!
- call_rcu() -> rcu_barrier() - call_rcu() -> rcu_barrier()
- call_srcu() -> srcu_barrier() - call_srcu() -> srcu_barrier()
However, these barrier functions are absolutely -not- guaranteed However, these barrier functions are absolutely *not* guaranteed
to wait for a grace period. In fact, if there are no call_rcu() to wait for a grace period. In fact, if there are no call_rcu()
callbacks waiting anywhere in the system, rcu_barrier() is within callbacks waiting anywhere in the system, rcu_barrier() is within
its rights to return immediately. its rights to return immediately.
......
...@@ -43,7 +43,7 @@ Follow these rules to keep your RCU code working properly: ...@@ -43,7 +43,7 @@ Follow these rules to keep your RCU code working properly:
- Set bits and clear bits down in the must-be-zero low-order - Set bits and clear bits down in the must-be-zero low-order
bits of that pointer. This clearly means that the pointer bits of that pointer. This clearly means that the pointer
must have alignment constraints, for example, this does must have alignment constraints, for example, this does
-not- work in general for char* pointers. *not* work in general for char* pointers.
- XOR bits to translate pointers, as is done in some - XOR bits to translate pointers, as is done in some
classic buddy-allocator algorithms. classic buddy-allocator algorithms.
...@@ -174,7 +174,7 @@ Follow these rules to keep your RCU code working properly: ...@@ -174,7 +174,7 @@ Follow these rules to keep your RCU code working properly:
Please see the "CONTROL DEPENDENCIES" section of Please see the "CONTROL DEPENDENCIES" section of
Documentation/memory-barriers.txt for more details. Documentation/memory-barriers.txt for more details.
- The pointers are not equal -and- the compiler does - The pointers are not equal *and* the compiler does
not have enough information to deduce the value of the not have enough information to deduce the value of the
pointer. Note that the volatile cast in rcu_dereference() pointer. Note that the volatile cast in rcu_dereference()
will normally prevent the compiler from knowing too much. will normally prevent the compiler from knowing too much.
...@@ -360,7 +360,7 @@ in turn destroying the ordering between this load and the loads of the ...@@ -360,7 +360,7 @@ in turn destroying the ordering between this load and the loads of the
return values. This can result in "p->b" returning pre-initialization return values. This can result in "p->b" returning pre-initialization
garbage values. garbage values.
In short, rcu_dereference() is -not- optional when you are going to In short, rcu_dereference() is *not* optional when you are going to
dereference the resulting pointer. dereference the resulting pointer.
......
...@@ -32,7 +32,7 @@ warnings: ...@@ -32,7 +32,7 @@ warnings:
- Booting Linux using a console connection that is too slow to - Booting Linux using a console connection that is too slow to
keep up with the boot-time console-message rate. For example, keep up with the boot-time console-message rate. For example,
a 115Kbaud serial console can be -way- too slow to keep up a 115Kbaud serial console can be *way* too slow to keep up
with boot-time message rates, and will frequently result in with boot-time message rates, and will frequently result in
RCU CPU stall warning messages. Especially if you have added RCU CPU stall warning messages. Especially if you have added
debug printk()s. debug printk()s.
...@@ -105,7 +105,7 @@ warnings: ...@@ -105,7 +105,7 @@ warnings:
leading the realization that the CPU had failed. leading the realization that the CPU had failed.
The RCU, RCU-sched, and RCU-tasks implementations have CPU stall warning. The RCU, RCU-sched, and RCU-tasks implementations have CPU stall warning.
Note that SRCU does -not- have CPU stall warnings. Please note that Note that SRCU does *not* have CPU stall warnings. Please note that
RCU only detects CPU stalls when there is a grace period in progress. RCU only detects CPU stalls when there is a grace period in progress.
No grace period, no CPU stall warnings. No grace period, no CPU stall warnings.
...@@ -145,7 +145,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT ...@@ -145,7 +145,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT
this parameter is checked only at the beginning of a cycle. this parameter is checked only at the beginning of a cycle.
So if you are 10 seconds into a 40-second stall, setting this So if you are 10 seconds into a 40-second stall, setting this
sysfs parameter to (say) five will shorten the timeout for the sysfs parameter to (say) five will shorten the timeout for the
-next- stall, or the following warning for the current stall *next* stall, or the following warning for the current stall
(assuming the stall lasts long enough). It will not affect the (assuming the stall lasts long enough). It will not affect the
timing of the next warning for the current stall. timing of the next warning for the current stall.
...@@ -189,8 +189,8 @@ rcupdate.rcu_task_stall_timeout ...@@ -189,8 +189,8 @@ rcupdate.rcu_task_stall_timeout
Interpreting RCU's CPU Stall-Detector "Splats" Interpreting RCU's CPU Stall-Detector "Splats"
============================================== ==============================================
For non-RCU-tasks flavors of RCU, when a CPU detects that it is stalling, For non-RCU-tasks flavors of RCU, when a CPU detects that some other
it will print a message similar to the following:: CPU is stalling, it will print a message similar to the following::
INFO: rcu_sched detected stalls on CPUs/tasks: INFO: rcu_sched detected stalls on CPUs/tasks:
2-...: (3 GPs behind) idle=06c/0/0 softirq=1453/1455 fqs=0 2-...: (3 GPs behind) idle=06c/0/0 softirq=1453/1455 fqs=0
...@@ -202,8 +202,10 @@ causing stalls, and that the stall was affecting RCU-sched. This message ...@@ -202,8 +202,10 @@ causing stalls, and that the stall was affecting RCU-sched. This message
will normally be followed by stack dumps for each CPU. Please note that will normally be followed by stack dumps for each CPU. Please note that
PREEMPT_RCU builds can be stalled by tasks as well as by CPUs, and that PREEMPT_RCU builds can be stalled by tasks as well as by CPUs, and that
the tasks will be indicated by PID, for example, "P3421". It is even the tasks will be indicated by PID, for example, "P3421". It is even
possible for an rcu_state stall to be caused by both CPUs -and- tasks, possible for an rcu_state stall to be caused by both CPUs *and* tasks,
in which case the offending CPUs and tasks will all be called out in the list. in which case the offending CPUs and tasks will all be called out in the list.
In some cases, CPUs will detect themselves stalling, which will result
in a self-detected stall.
CPU 2's "(3 GPs behind)" indicates that this CPU has not interacted with CPU 2's "(3 GPs behind)" indicates that this CPU has not interacted with
the RCU core for the past three grace periods. In contrast, CPU 16's "(0 the RCU core for the past three grace periods. In contrast, CPU 16's "(0
...@@ -224,7 +226,7 @@ is the number that had executed since boot at the time that this CPU ...@@ -224,7 +226,7 @@ is the number that had executed since boot at the time that this CPU
last noted the beginning of a grace period, which might be the current last noted the beginning of a grace period, which might be the current
(stalled) grace period, or it might be some earlier grace period (for (stalled) grace period, or it might be some earlier grace period (for
example, if the CPU might have been in dyntick-idle mode for an extended example, if the CPU might have been in dyntick-idle mode for an extended
time period. The number after the "/" is the number that have executed time period). The number after the "/" is the number that have executed
since boot until the current time. If this latter number stays constant since boot until the current time. If this latter number stays constant
across repeated stall-warning messages, it is possible that RCU's softirq across repeated stall-warning messages, it is possible that RCU's softirq
handlers are no longer able to execute on this CPU. This can happen if handlers are no longer able to execute on this CPU. This can happen if
...@@ -283,7 +285,8 @@ If the relevant grace-period kthread has been unable to run prior to ...@@ -283,7 +285,8 @@ If the relevant grace-period kthread has been unable to run prior to
the stall warning, as was the case in the "All QSes seen" line above, the stall warning, as was the case in the "All QSes seen" line above,
the following additional line is printed:: the following additional line is printed::
kthread starved for 23807 jiffies! g7075 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 ->cpu=5 rcu_sched kthread starved for 23807 jiffies! g7075 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 ->cpu=5
Unless rcu_sched kthread gets sufficient CPU time, OOM is now expected behavior.
Starving the grace-period kthreads of CPU time can of course result Starving the grace-period kthreads of CPU time can of course result
in RCU CPU stall warnings even when all CPUs and tasks have passed in RCU CPU stall warnings even when all CPUs and tasks have passed
...@@ -313,15 +316,21 @@ is the current ``TIMER_SOFTIRQ`` count on cpu 4. If this value does not ...@@ -313,15 +316,21 @@ is the current ``TIMER_SOFTIRQ`` count on cpu 4. If this value does not
change on successive RCU CPU stall warnings, there is further reason to change on successive RCU CPU stall warnings, there is further reason to
suspect a timer problem. suspect a timer problem.
These messages are usually followed by stack dumps of the CPUs and tasks
involved in the stall. These stack traces can help you locate the cause
of the stall, keeping in mind that the CPU detecting the stall will have
an interrupt frame that is mainly devoted to detecting the stall.
Multiple Warnings From One Stall Multiple Warnings From One Stall
================================ ================================
If a stall lasts long enough, multiple stall-warning messages will be If a stall lasts long enough, multiple stall-warning messages will
printed for it. The second and subsequent messages are printed at be printed for it. The second and subsequent messages are printed at
longer intervals, so that the time between (say) the first and second longer intervals, so that the time between (say) the first and second
message will be about three times the interval between the beginning message will be about three times the interval between the beginning
of the stall and the first message. of the stall and the first message. It can be helpful to compare the
stack dumps for the different messages for the same stalled grace period.
Stall Warnings for Expedited Grace Periods Stall Warnings for Expedited Grace Periods
......
...@@ -259,7 +259,7 @@ Configuring the kernel ...@@ -259,7 +259,7 @@ Configuring the kernel
Compiling the kernel Compiling the kernel
-------------------- --------------------
- Make sure you have at least gcc 4.9 available. - Make sure you have at least gcc 5.1 available.
For more information, refer to :ref:`Documentation/process/changes.rst <changes>`. For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
Please note that you can still run a.out user programs with this kernel. Please note that you can still run a.out user programs with this kernel.
......
...@@ -30,22 +30,21 @@ following ASL code can be used:: ...@@ -30,22 +30,21 @@ following ASL code can be used::
{ {
Device (STAC) Device (STAC)
{ {
Name (_ADR, Zero)
Name (_HID, "BMA222E") Name (_HID, "BMA222E")
Name (RBUF, ResourceTemplate ()
{
I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.I2C6", 0x00,
ResourceConsumer, ,)
GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000,
"\\_SB.GPO2", 0x00, ResourceConsumer, , )
{ // Pin list
0
}
})
Method (_CRS, 0, Serialized) Method (_CRS, 0, Serialized)
{ {
Name (RBUF, ResourceTemplate ()
{
I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.I2C6", 0x00,
ResourceConsumer, ,)
GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000,
"\\_SB.GPO2", 0x00, ResourceConsumer, , )
{ // Pin list
0
}
})
Return (RBUF) Return (RBUF)
} }
} }
...@@ -75,7 +74,7 @@ This option allows loading of user defined SSDTs from initrd and it is useful ...@@ -75,7 +74,7 @@ This option allows loading of user defined SSDTs from initrd and it is useful
when the system does not support EFI or when there is not enough EFI storage. when the system does not support EFI or when there is not enough EFI storage.
It works in a similar way with initrd based ACPI tables override/upgrade: SSDT It works in a similar way with initrd based ACPI tables override/upgrade: SSDT
aml code must be placed in the first, uncompressed, initrd under the AML code must be placed in the first, uncompressed, initrd under the
"kernel/firmware/acpi" path. Multiple files can be used and this will translate "kernel/firmware/acpi" path. Multiple files can be used and this will translate
in loading multiple tables. Only SSDT and OEM tables are allowed. See in loading multiple tables. Only SSDT and OEM tables are allowed. See
initrd_table_override.txt for more details. initrd_table_override.txt for more details.
...@@ -103,12 +102,14 @@ This is the preferred method, when EFI is supported on the platform, because it ...@@ -103,12 +102,14 @@ This is the preferred method, when EFI is supported on the platform, because it
allows a persistent, OS independent way of storing the user defined SSDTs. There allows a persistent, OS independent way of storing the user defined SSDTs. There
is also work underway to implement EFI support for loading user defined SSDTs is also work underway to implement EFI support for loading user defined SSDTs
and using this method will make it easier to convert to the EFI loading and using this method will make it easier to convert to the EFI loading
mechanism when that will arrive. mechanism when that will arrive. To enable it, the
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS shoyld be chosen to y.
In order to load SSDTs from an EFI variable the efivar_ssdt kernel command line In order to load SSDTs from an EFI variable the ``"efivar_ssdt=..."`` kernel
parameter can be used. The argument for the option is the variable name to command line parameter can be used (the name has a limitation of 16 characters).
use. If there are multiple variables with the same name but with different The argument for the option is the variable name to use. If there are multiple
vendor GUIDs, all of them will be loaded. variables with the same name but with different vendor GUIDs, all of them will
be loaded.
In order to store the AML code in an EFI variable the efivarfs filesystem can be In order to store the AML code in an EFI variable the efivarfs filesystem can be
used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all
...@@ -127,7 +128,7 @@ variable with the content from a given file:: ...@@ -127,7 +128,7 @@ variable with the content from a given file::
#!/bin/sh -e #!/bin/sh -e
while ! [ -z "$1" ]; do while [ -n "$1" ]; do
case "$1" in case "$1" in
"-f") filename="$2"; shift;; "-f") filename="$2"; shift;;
"-g") guid="$2"; shift;; "-g") guid="$2"; shift;;
...@@ -167,14 +168,14 @@ variable with the content from a given file:: ...@@ -167,14 +168,14 @@ variable with the content from a given file::
Loading ACPI SSDTs from configfs Loading ACPI SSDTs from configfs
================================ ================================
This option allows loading of user defined SSDTs from userspace via the configfs This option allows loading of user defined SSDTs from user space via the configfs
interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be
mounted. In the following examples, we assume that configfs has been mounted in mounted. In the following examples, we assume that configfs has been mounted in
/config. /sys/kernel/config.
New tables can be loading by creating new directories in /config/acpi/table/ and New tables can be loading by creating new directories in /sys/kernel/config/acpi/table
writing the SSDT aml code in the aml attribute:: and writing the SSDT AML code in the aml attribute::
cd /config/acpi/table cd /sys/kernel/config/acpi/table
mkdir my_ssdt mkdir my_ssdt
cat ~/ssdt.aml > my_ssdt/aml cat ~/ssdt.aml > my_ssdt/aml
...@@ -72,3 +72,16 @@ that the `rm() <rm_>`_ tool can be used to delete them. Note that the ...@@ -72,3 +72,16 @@ that the `rm() <rm_>`_ tool can be used to delete them. Note that the
``binder-control`` device cannot be deleted since this would make the binderfs ``binder-control`` device cannot be deleted since this would make the binderfs
instance unusable. The ``binder-control`` device will be deleted when the instance unusable. The ``binder-control`` device will be deleted when the
binderfs instance is unmounted and all references to it have been dropped. binderfs instance is unmounted and all references to it have been dropped.
Binder features
---------------
Assuming an instance of binderfs has been mounted at ``/dev/binderfs``, the
features supported by the binder driver can be located under
``/dev/binderfs/features/``. The presence of individual files can be tested
to determine whether a particular feature is supported by the driver.
Example::
cat /dev/binderfs/features/oneway_spam_detection
1
...@@ -178,7 +178,7 @@ update the boot loader and the kernel image itself as long as the boot ...@@ -178,7 +178,7 @@ update the boot loader and the kernel image itself as long as the boot
loader passes the correct initrd file size. If by any chance, the boot loader passes the correct initrd file size. If by any chance, the boot
loader passes a longer size, the kernel fails to find the bootconfig data. loader passes a longer size, the kernel fails to find the bootconfig data.
To do this operation, Linux kernel provides "bootconfig" command under To do this operation, Linux kernel provides ``bootconfig`` command under
tools/bootconfig, which allows admin to apply or delete the config file tools/bootconfig, which allows admin to apply or delete the config file
to/from initrd image. You can build it by the following command:: to/from initrd image. You can build it by the following command::
...@@ -196,6 +196,43 @@ To remove the config from the image, you can use -d option as below:: ...@@ -196,6 +196,43 @@ To remove the config from the image, you can use -d option as below::
Then add "bootconfig" on the normal kernel command line to tell the Then add "bootconfig" on the normal kernel command line to tell the
kernel to look for the bootconfig at the end of the initrd file. kernel to look for the bootconfig at the end of the initrd file.
Kernel parameters via Boot Config
=================================
In addition to the kernel command line, the boot config can be used for
passing the kernel parameters. All the key-value pairs under ``kernel``
key will be passed to kernel cmdline directly. Moreover, the key-value
pairs under ``init`` will be passed to init process via the cmdline.
The parameters are concatinated with user-given kernel cmdline string
as the following order, so that the command line parameter can override
bootconfig parameters (this depends on how the subsystem handles parameters
but in general, earlier parameter will be overwritten by later one.)::
[bootconfig params][cmdline params] -- [bootconfig init params][cmdline init params]
Here is an example of the bootconfig file for kernel/init parameters.::
kernel {
root = 01234567-89ab-cdef-0123-456789abcd
}
init {
splash
}
This will be copied into the kernel cmdline string as the following::
root="01234567-89ab-cdef-0123-456789abcd" -- splash
If user gives some other command line like,::
ro bootconfig -- quiet
The final kernel cmdline will be the following::
root="01234567-89ab-cdef-0123-456789abcd" ro bootconfig -- splash quiet
Config File Limitation Config File Limitation
====================== ======================
......
...@@ -2056,6 +2056,17 @@ Cpuset Interface Files ...@@ -2056,6 +2056,17 @@ Cpuset Interface Files
The value of "cpuset.mems" stays constant until the next update The value of "cpuset.mems" stays constant until the next update
and won't be affected by any memory nodes hotplug events. and won't be affected by any memory nodes hotplug events.
Setting a non-empty value to "cpuset.mems" causes memory of
tasks within the cgroup to be migrated to the designated nodes if
they are currently using memory outside of the designated nodes.
There is a cost for this memory migration. The migration
may not be complete and some memory pages may be left behind.
So it is recommended that "cpuset.mems" should be set properly
before spawning new tasks into the cpuset. Even if there is
a need to change "cpuset.mems" with active tasks, it shouldn't
be done frequently.
cpuset.mems.effective cpuset.mems.effective
A read-only multiple values file which exists on all A read-only multiple values file which exists on all
cpuset-enabled cgroups. cpuset-enabled cgroups.
......
...@@ -58,9 +58,9 @@ source for the output is in brackets ("[]"). ...@@ -58,9 +58,9 @@ source for the output is in brackets ("[]").
[NR_CPUS-1] [NR_CPUS-1]
offline: CPUs that are not online because they have been offline: CPUs that are not online because they have been
HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit HOTPLUGGED off or exceed the limit of CPUs allowed by the
of CPUs allowed by the kernel configuration (kernel_max kernel configuration (kernel_max above).
above). [~cpu_online_mask + cpus >= NR_CPUS] [~cpu_online_mask + cpus >= NR_CPUS]
online: CPUs that are online and being scheduled [cpu_online_mask] online: CPUs that are online and being scheduled [cpu_online_mask]
...@@ -96,5 +96,5 @@ online.):: ...@@ -96,5 +96,5 @@ online.)::
possible: 0-127 possible: 0-127
present: 0-3 present: 0-3
See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter See Documentation/core-api/cpu_hotplug.rst for the possible_cpus=NUM
as well as more information on the various cpumasks. kernel start parameter as well as more information on the various cpumasks.
此差异已折叠。
...@@ -13,6 +13,7 @@ Device Mapper ...@@ -13,6 +13,7 @@ Device Mapper
dm-dust dm-dust
dm-ebs dm-ebs
dm-flakey dm-flakey
dm-ima
dm-init dm-init
dm-integrity dm-integrity
dm-io dm-io
......
...@@ -78,13 +78,23 @@ Status: ...@@ -78,13 +78,23 @@ Status:
2. the number of blocks 2. the number of blocks
3. the number of free blocks 3. the number of free blocks
4. the number of blocks under writeback 4. the number of blocks under writeback
5. the number of read requests
6. the number of read requests that hit the cache
7. the number of write requests
8. the number of write requests that hit uncommitted block
9. the number of write requests that hit committed block
10. the number of write requests that bypass the cache
11. the number of write requests that are allocated in the cache
12. the number of write requests that are blocked on the freelist
13. the number of flush requests
14. the number of discard requests
Messages: Messages:
flush flush
flush the cache device. The message returns successfully Flush the cache device. The message returns successfully
if the cache device was flushed without an error if the cache device was flushed without an error
flush_on_suspend flush_on_suspend
flush the cache device on next suspend. Use this message Flush the cache device on next suspend. Use this message
when you are going to remove the cache device. The proper when you are going to remove the cache device. The proper
sequence for removing the cache device is: sequence for removing the cache device is:
...@@ -98,3 +108,5 @@ Messages: ...@@ -98,3 +108,5 @@ Messages:
6. the cache device is now inactive and it can be deleted 6. the cache device is now inactive and it can be deleted
cleaner cleaner
See above "cleaner" constructor documentation. See above "cleaner" constructor documentation.
clear_stats
Clear the statistics that are reported on the status line
...@@ -2993,10 +2993,10 @@ ...@@ -2993,10 +2993,10 @@
65 = /dev/infiniband/issm1 Second InfiniBand IsSM device 65 = /dev/infiniband/issm1 Second InfiniBand IsSM device
... ...
127 = /dev/infiniband/issm63 63rd InfiniBand IsSM device 127 = /dev/infiniband/issm63 63rd InfiniBand IsSM device
128 = /dev/infiniband/uverbs0 First InfiniBand verbs device 192 = /dev/infiniband/uverbs0 First InfiniBand verbs device
129 = /dev/infiniband/uverbs1 Second InfiniBand verbs device 193 = /dev/infiniband/uverbs1 Second InfiniBand verbs device
... ...
159 = /dev/infiniband/uverbs31 31st InfiniBand verbs device 223 = /dev/infiniband/uverbs31 31st InfiniBand verbs device
232 char Biometric Devices 232 char Biometric Devices
0 = /dev/biometric/sensor0/fingerprint first fingerprint sensor on first device 0 = /dev/biometric/sensor0/fingerprint first fingerprint sensor on first device
......
...@@ -181,10 +181,12 @@ Open cross-HT issues that core scheduling does not solve ...@@ -181,10 +181,12 @@ Open cross-HT issues that core scheduling does not solve
-------------------------------------------------------- --------------------------------------------------------
1. For MDS 1. For MDS
~~~~~~~~~~ ~~~~~~~~~~
Core scheduling cannot protect against MDS attacks between an HT running in Core scheduling cannot protect against MDS attacks between the siblings
user mode and another running in kernel mode. Even though both HTs run tasks running in user mode and the others running in kernel mode. Even though all
which trust each other, kernel memory is still considered untrusted. Such siblings run tasks which trust each other, when the kernel is executing
attacks are possible for any combination of sibling CPU modes (host or guest mode). code on behalf of a task, it cannot trust the code running in the
sibling. Such attacks are possible for any combination of sibling CPU modes
(host or guest mode).
2. For L1TF 2. For L1TF
~~~~~~~~~~~ ~~~~~~~~~~~
......
...@@ -16,3 +16,4 @@ are configurable at compile, boot or run time. ...@@ -16,3 +16,4 @@ are configurable at compile, boot or run time.
multihit.rst multihit.rst
special-register-buffer-data-sampling.rst special-register-buffer-data-sampling.rst
core-scheduling.rst core-scheduling.rst
l1d_flush.rst
L1D Flushing
============
With an increasing number of vulnerabilities being reported around data
leaks from the Level 1 Data cache (L1D) the kernel provides an opt-in
mechanism to flush the L1D cache on context switch.
This mechanism can be used to address e.g. CVE-2020-0550. For applications
the mechanism keeps them safe from vulnerabilities, related to leaks
(snooping of) from the L1D cache.
Related CVEs
------------
The following CVEs can be addressed by this
mechanism
============= ======================== ==================
CVE-2020-0550 Improper Data Forwarding OS related aspects
============= ======================== ==================
Usage Guidelines
----------------
Please see document: :ref:`Documentation/userspace-api/spec_ctrl.rst
<set_spec_ctrl>` for details.
**NOTE**: The feature is disabled by default, applications need to
specifically opt into the feature to enable it.
Mitigation
----------
When PR_SET_L1D_FLUSH is enabled for a task a flush of the L1D cache is
performed when the task is scheduled out and the incoming task belongs to a
different process and therefore to a different address space.
If the underlying CPU supports L1D flushing in hardware, the hardware
mechanism is used, software fallback for the mitigation, is not supported.
Mitigation control on the kernel command line
---------------------------------------------
The kernel command line allows to control the L1D flush mitigations at boot
time with the option "l1d_flush=". The valid arguments for this option are:
============ =============================================================
on Enables the prctl interface, applications trying to use
the prctl() will fail with an error if l1d_flush is not
enabled
============ =============================================================
By default the mechanism is disabled.
Limitations
-----------
The mechanism does not mitigate L1D data leaks between tasks belonging to
different processes which are concurrently executing on sibling threads of
a physical CPU core when SMT is enabled on the system.
This can be addressed by controlled placement of processes on physical CPU
cores or by disabling SMT. See the relevant chapter in the L1TF mitigation
document: :ref:`Documentation/admin-guide/hw-vuln/l1tf.rst <smt_control>`.
**NOTE** : The opt-in of a task for L1D flushing works only when the task's
affinity is limited to cores running in non-SMT mode. If a task which
requested L1D flushing is scheduled on a SMT-enabled core the kernel sends
a SIGBUS to the task.
...@@ -287,13 +287,21 @@ ...@@ -287,13 +287,21 @@
do not want to use tracing_snapshot_alloc() as it needs do not want to use tracing_snapshot_alloc() as it needs
to be done where GFP_KERNEL allocations are allowed. to be done where GFP_KERNEL allocations are allowed.
allow_mismatched_32bit_el0 [ARM64]
Allow execve() of 32-bit applications and setting of the
PER_LINUX32 personality on systems where only a strict
subset of the CPUs support 32-bit EL0. When this
parameter is present, the set of CPUs supporting 32-bit
EL0 is indicated by /sys/devices/system/cpu/aarch32_el0
and hot-unplug operations may be restricted.
See Documentation/arm64/asymmetric-32bit.rst for more
information.
amd_iommu= [HW,X86-64] amd_iommu= [HW,X86-64]
Pass parameters to the AMD IOMMU driver in the system. Pass parameters to the AMD IOMMU driver in the system.
Possible values are: Possible values are:
fullflush - enable flushing of IO/TLB entries when fullflush - Deprecated, equivalent to iommu.strict=1
they are unmapped. Otherwise they are
flushed before they will be reused, which
is a lot of faster
off - do not initialize any AMD IOMMU found in off - do not initialize any AMD IOMMU found in
the system the system
force_isolation - Force device isolation for all force_isolation - Force device isolation for all
...@@ -380,6 +388,9 @@ ...@@ -380,6 +388,9 @@
arm64.nopauth [ARM64] Unconditionally disable Pointer Authentication arm64.nopauth [ARM64] Unconditionally disable Pointer Authentication
support support
arm64.nomte [ARM64] Unconditionally disable Memory Tagging Extension
support
ataflop= [HW,M68k] ataflop= [HW,M68k]
atarimouse= [HW,MOUSE] Atari Mouse atarimouse= [HW,MOUSE] Atari Mouse
...@@ -1747,6 +1758,11 @@ ...@@ -1747,6 +1758,11 @@
support for the idxd driver. By default it is set to support for the idxd driver. By default it is set to
true (1). true (1).
idxd.tc_override= [HW]
Format: <bool>
Allow override of default traffic class configuration
for the device. By default it is set to false (0).
ieee754= [MIPS] Select IEEE Std 754 conformance mode ieee754= [MIPS] Select IEEE Std 754 conformance mode
Format: { strict | legacy | 2008 | relaxed } Format: { strict | legacy | 2008 | relaxed }
Default: strict Default: strict
...@@ -1944,18 +1960,17 @@ ...@@ -1944,18 +1960,17 @@
this case, gfx device will use physical address for this case, gfx device will use physical address for
DMA. DMA.
strict [Default Off] strict [Default Off]
With this option on every unmap_single operation will Deprecated, equivalent to iommu.strict=1.
result in a hardware IOTLB flush operation as opposed
to batching them for performance.
sp_off [Default Off] sp_off [Default Off]
By default, super page will be supported if Intel IOMMU By default, super page will be supported if Intel IOMMU
has the capability. With this option, super page will has the capability. With this option, super page will
not be supported. not be supported.
sm_on [Default Off] sm_on
By default, scalable mode will be disabled even if the Enable the Intel IOMMU scalable mode if the hardware
hardware advertises that it has support for the scalable advertises that it has support for the scalable mode
mode translation. With this option set, scalable mode translation.
will be used on hardware which claims to support it. sm_off
Disallow use of the Intel IOMMU scalable mode.
tboot_noforce [Default Off] tboot_noforce [Default Off]
Do not force the Intel IOMMU enabled under tboot. Do not force the Intel IOMMU enabled under tboot.
By default, tboot will force Intel IOMMU on, which By default, tboot will force Intel IOMMU on, which
...@@ -2047,13 +2062,12 @@ ...@@ -2047,13 +2062,12 @@
throughput at the cost of reduced device isolation. throughput at the cost of reduced device isolation.
Will fall back to strict mode if not supported by Will fall back to strict mode if not supported by
the relevant IOMMU driver. the relevant IOMMU driver.
1 - Strict mode (default). 1 - Strict mode.
DMA unmap operations invalidate IOMMU hardware TLBs DMA unmap operations invalidate IOMMU hardware TLBs
synchronously. synchronously.
Note: on x86, the default behaviour depends on the unset - Use value of CONFIG_IOMMU_DEFAULT_DMA_{LAZY,STRICT}.
equivalent driver-specific parameters, but a strict Note: on x86, strict mode specified via one of the
mode explicitly specified by either method takes legacy driver-specific options takes precedence.
precedence.
iommu.passthrough= iommu.passthrough=
[ARM64, X86] Configure DMA to bypass the IOMMU by default. [ARM64, X86] Configure DMA to bypass the IOMMU by default.
...@@ -2421,6 +2435,23 @@ ...@@ -2421,6 +2435,23 @@
feature (tagged TLBs) on capable Intel chips. feature (tagged TLBs) on capable Intel chips.
Default is 1 (enabled) Default is 1 (enabled)
l1d_flush= [X86,INTEL]
Control mitigation for L1D based snooping vulnerability.
Certain CPUs are vulnerable to an exploit against CPU
internal buffers which can forward information to a
disclosure gadget under certain conditions.
In vulnerable processors, the speculatively
forwarded data can be used in a cache side channel
attack, to access data to which the attacker does
not have direct access.
This parameter controls the mitigation. The
options are:
on - enable the interface for the mitigation
l1tf= [X86] Control mitigation of the L1TF vulnerability on l1tf= [X86] Control mitigation of the L1TF vulnerability on
affected CPUs affected CPUs
...@@ -4167,6 +4198,15 @@ ...@@ -4167,6 +4198,15 @@
Format: <bool> (1/Y/y=enable, 0/N/n=disable) Format: <bool> (1/Y/y=enable, 0/N/n=disable)
default: disabled default: disabled
printk.console_no_auto_verbose=
Disable console loglevel raise on oops, panic
or lockdep-detected issues (only if lock debug is on).
With an exception to setups with low baudrate on
serial console, keeping this 0 is a good choice
in order to provide more debug information.
Format: <bool>
default: 0 (auto_verbose is enabled)
printk.devkmsg={on,off,ratelimit} printk.devkmsg={on,off,ratelimit}
Control writing to /dev/kmsg. Control writing to /dev/kmsg.
on - unlimited logging to /dev/kmsg from userspace on - unlimited logging to /dev/kmsg from userspace
...@@ -4777,7 +4817,7 @@ ...@@ -4777,7 +4817,7 @@
reboot= [KNL] reboot= [KNL]
Format (x86 or x86_64): Format (x86 or x86_64):
[w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \ [w[arm] | c[old] | h[ard] | s[oft] | g[pio]] | d[efault] \
[[,]s[mp]#### \ [[,]s[mp]#### \
[[,]b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \ [[,]b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \
[[,]f[orce] [[,]f[orce]
...@@ -4945,8 +4985,6 @@ ...@@ -4945,8 +4985,6 @@
sa1100ir [NET] sa1100ir [NET]
See drivers/net/irda/sa1100_ir.c. See drivers/net/irda/sa1100_ir.c.
sbni= [NET] Granch SBNI12 leased line adapter
sched_verbose [KNL] Enables verbose scheduler debug messages. sched_verbose [KNL] Enables verbose scheduler debug messages.
schedstats= [KNL,X86] Enable or disable scheduled statistics. schedstats= [KNL,X86] Enable or disable scheduled statistics.
......
...@@ -13,10 +13,8 @@ Hotkeys ...@@ -13,10 +13,8 @@ Hotkeys
The following FN keys are ignored by the kernel without this driver: The following FN keys are ignored by the kernel without this driver:
- FN-F1 (LG control panel) - Generates F15 - FN-F1 (LG control panel) - Generates F15
- FN-F5 (Touchpad toggle) - Generates F13 - FN-F5 (Touchpad toggle) - Generates F21
- FN-F6 (Airplane mode) - Generates RFKILL - FN-F6 (Airplane mode) - Generates RFKILL
- FN-F8 (Keyboard backlight) - Generates F16.
This key also changes keyboard backlight mode.
- FN-F9 (Reader mode) - Generates F14 - FN-F9 (Reader mode) - Generates F14
The rest of the FN keys work without a need for a special driver. The rest of the FN keys work without a need for a special driver.
......
.. SPDX-License-Identifier: GPL-2.0
========================
Monitoring Data Accesses
========================
:doc:`DAMON </vm/damon/index>` allows light-weight data access monitoring.
Using DAMON, users can analyze the memory access patterns of their systems and
optimize those.
.. toctree::
:maxdepth: 2
start
usage
.. SPDX-License-Identifier: GPL-2.0
===============
Getting Started
===============
This document briefly describes how you can use DAMON by demonstrating its
default user space tool. Please note that this document describes only a part
of its features for brevity. Please refer to :doc:`usage` for more details.
TL; DR
======
Follow the commands below to monitor and visualize the memory access pattern of
your workload. ::
# # build the kernel with CONFIG_DAMON_*=y, install it, and reboot
# mount -t debugfs none /sys/kernel/debug/
# git clone https://github.com/awslabs/damo
# ./damo/damo record $(pidof <your workload>)
# ./damo/damo report heat --plot_ascii
The final command draws the access heatmap of ``<your workload>``. The heatmap
shows which memory region (x-axis) is accessed when (y-axis) and how frequently
(number; the higher the more accesses have been observed). ::
111111111111111111111111111111111111111111111111111111110000
111121111111111111111111111111211111111111111111111111110000
000000000000000000000000000000000000000000000000001555552000
000000000000000000000000000000000000000000000222223555552000
000000000000000000000000000000000000000011111677775000000000
000000000000000000000000000000000000000488888000000000000000
000000000000000000000000000000000177888400000000000000000000
000000000000000000000000000046666522222100000000000000000000
000000000000000000000014444344444300000000000000000000000000
000000000000000002222245555510000000000000000000000000000000
# access_frequency: 0 1 2 3 4 5 6 7 8 9
# x-axis: space (140286319947776-140286426374096: 101.496 MiB)
# y-axis: time (605442256436361-605479951866441: 37.695430s)
# resolution: 60x10 (1.692 MiB and 3.770s for each character)
Prerequisites
=============
Kernel
------
You should first ensure your system is running on a kernel built with
``CONFIG_DAMON_*=y``.
User Space Tool
---------------
For the demonstration, we will use the default user space tool for DAMON,
called DAMON Operator (DAMO). It is available at
https://github.com/awslabs/damo. The examples below assume that ``damo`` is on
your ``$PATH``. It's not mandatory, though.
Because DAMO is using the debugfs interface (refer to :doc:`usage` for the
detail) of DAMON, you should ensure debugfs is mounted. Mount it manually as
below::
# mount -t debugfs none /sys/kernel/debug/
or append the following line to your ``/etc/fstab`` file so that your system
can automatically mount debugfs upon booting::
debugfs /sys/kernel/debug debugfs defaults 0 0
Recording Data Access Patterns
==============================
The commands below record the memory access patterns of a program and save the
monitoring results to a file. ::
$ git clone https://github.com/sjp38/masim
$ cd masim; make; ./masim ./configs/zigzag.cfg &
$ sudo damo record -o damon.data $(pidof masim)
The first two lines of the commands download an artificial memory access
generator program and run it in the background. The generator will repeatedly
access two 100 MiB sized memory regions one by one. You can substitute this
with your real workload. The last line asks ``damo`` to record the access
pattern in the ``damon.data`` file.
Visualizing Recorded Patterns
=============================
The following three commands visualize the recorded access patterns and save
the results as separate image files. ::
$ damo report heats --heatmap access_pattern_heatmap.png
$ damo report wss --range 0 101 1 --plot wss_dist.png
$ damo report wss --range 0 101 1 --sortby time --plot wss_chron_change.png
- ``access_pattern_heatmap.png`` will visualize the data access pattern in a
heatmap, showing which memory region (y-axis) got accessed when (x-axis)
and how frequently (color).
- ``wss_dist.png`` will show the distribution of the working set size.
- ``wss_chron_change.png`` will show how the working set size has
chronologically changed.
You can view the visualizations of this example workload at [1]_.
Visualizations of other realistic workloads are available at [2]_ [3]_ [4]_.
.. [1] https://damonitor.github.io/doc/html/v17/admin-guide/mm/damon/start.html#visualizing-recorded-patterns
.. [2] https://damonitor.github.io/test/result/visual/latest/rec.heatmap.1.png.html
.. [3] https://damonitor.github.io/test/result/visual/latest/rec.wss_sz.png.html
.. [4] https://damonitor.github.io/test/result/visual/latest/rec.wss_time.png.html
.. SPDX-License-Identifier: GPL-2.0
===============
Detailed Usages
===============
DAMON provides below three interfaces for different users.
- *DAMON user space tool.*
This is for privileged people such as system administrators who want a
just-working human-friendly interface. Using this, users can use the DAMON’s
major features in a human-friendly way. It may not be highly tuned for
special cases, though. It supports only virtual address spaces monitoring.
- *debugfs interface.*
This is for privileged user space programmers who want more optimized use of
DAMON. Using this, users can use DAMON’s major features by reading
from and writing to special debugfs files. Therefore, you can write and use
your personalized DAMON debugfs wrapper programs that reads/writes the
debugfs files instead of you. The DAMON user space tool is also a reference
implementation of such programs. It supports only virtual address spaces
monitoring.
- *Kernel Space Programming Interface.*
This is for kernel space programmers. Using this, users can utilize every
feature of DAMON most flexibly and efficiently by writing kernel space
DAMON application programs for you. You can even extend DAMON for various
address spaces.
Nevertheless, you could write your own user space tool using the debugfs
interface. A reference implementation is available at
https://github.com/awslabs/damo. If you are a kernel programmer, you could
refer to :doc:`/vm/damon/api` for the kernel space programming interface. For
the reason, this document describes only the debugfs interface
debugfs Interface
=================
DAMON exports three files, ``attrs``, ``target_ids``, and ``monitor_on`` under
its debugfs directory, ``<debugfs>/damon/``.
Attributes
----------
Users can get and set the ``sampling interval``, ``aggregation interval``,
``regions update interval``, and min/max number of monitoring target regions by
reading from and writing to the ``attrs`` file. To know about the monitoring
attributes in detail, please refer to the :doc:`/vm/damon/design`. For
example, below commands set those values to 5 ms, 100 ms, 1,000 ms, 10 and
1000, and then check it again::
# cd <debugfs>/damon
# echo 5000 100000 1000000 10 1000 > attrs
# cat attrs
5000 100000 1000000 10 1000
Target IDs
----------
Some types of address spaces supports multiple monitoring target. For example,
the virtual memory address spaces monitoring can have multiple processes as the
monitoring targets. Users can set the targets by writing relevant id values of
the targets to, and get the ids of the current targets by reading from the
``target_ids`` file. In case of the virtual address spaces monitoring, the
values should be pids of the monitoring target processes. For example, below
commands set processes having pids 42 and 4242 as the monitoring targets and
check it again::
# cd <debugfs>/damon
# echo 42 4242 > target_ids
# cat target_ids
42 4242
Note that setting the target ids doesn't start the monitoring.
Turning On/Off
--------------
Setting the files as described above doesn't incur effect unless you explicitly
start the monitoring. You can start, stop, and check the current status of the
monitoring by writing to and reading from the ``monitor_on`` file. Writing
``on`` to the file starts the monitoring of the targets with the attributes.
Writing ``off`` to the file stops those. DAMON also stops if every target
process is terminated. Below example commands turn on, off, and check the
status of DAMON::
# cd <debugfs>/damon
# echo on > monitor_on
# echo off > monitor_on
# cat monitor_on
off
Please note that you cannot write to the above-mentioned debugfs files while
the monitoring is turned on. If you write to the files while DAMON is running,
an error code such as ``-EBUSY`` will be returned.
Tracepoint for Monitoring Results
=================================
DAMON provides the monitoring results via a tracepoint,
``damon:damon_aggregated``. While the monitoring is turned on, you could
record the tracepoint events and show results using tracepoint supporting tools
like ``perf``. For example::
# echo on > monitor_on
# perf record -e damon:damon_aggregated &
# sleep 5
# kill 9 $(pidof perf)
# echo off > monitor_on
# perf script
...@@ -27,6 +27,7 @@ the Linux memory management. ...@@ -27,6 +27,7 @@ the Linux memory management.
concepts concepts
cma_debugfs cma_debugfs
damon/index
hugetlbpage hugetlbpage
idle_page_tracking idle_page_tracking
ksm ksm
......
...@@ -245,6 +245,13 @@ MPOL_INTERLEAVED ...@@ -245,6 +245,13 @@ MPOL_INTERLEAVED
address range or file. During system boot up, the temporary address range or file. During system boot up, the temporary
interleaved system default policy works in this mode. interleaved system default policy works in this mode.
MPOL_PREFERRED_MANY
This mode specifices that the allocation should be preferrably
satisfied from the nodemask specified in the policy. If there is
a memory pressure on all nodes in the nodemask, the allocation
can fall back to all existing numa nodes. This is effectively
MPOL_PREFERRED allowed for a mask rather than a single node.
NUMA memory policy supports the following optional mode flags: NUMA memory policy supports the following optional mode flags:
MPOL_F_STATIC_NODES MPOL_F_STATIC_NODES
...@@ -253,10 +260,10 @@ MPOL_F_STATIC_NODES ...@@ -253,10 +260,10 @@ MPOL_F_STATIC_NODES
nodes changes after the memory policy has been defined. nodes changes after the memory policy has been defined.
Without this flag, any time a mempolicy is rebound because of a Without this flag, any time a mempolicy is rebound because of a
change in the set of allowed nodes, the node (Preferred) or change in the set of allowed nodes, the preferred nodemask (Preferred
nodemask (Bind, Interleave) is remapped to the new set of Many), preferred node (Preferred) or nodemask (Bind, Interleave) is
allowed nodes. This may result in nodes being used that were remapped to the new set of allowed nodes. This may result in nodes
previously undesired. being used that were previously undesired.
With this flag, if the user-specified nodes overlap with the With this flag, if the user-specified nodes overlap with the
nodes allowed by the task's cpuset, then the memory policy is nodes allowed by the task's cpuset, then the memory policy is
......
...@@ -118,7 +118,8 @@ compaction_proactiveness ...@@ -118,7 +118,8 @@ compaction_proactiveness
This tunable takes a value in the range [0, 100] with a default value of This tunable takes a value in the range [0, 100] with a default value of
20. This tunable determines how aggressively compaction is done in the 20. This tunable determines how aggressively compaction is done in the
background. Setting it to 0 disables proactive compaction. background. Write of a non zero value to this tunable will immediately
trigger the proactive compaction. Setting it to 0 disables proactive compaction.
Note that compaction has a non-trivial system-wide impact as pages Note that compaction has a non-trivial system-wide impact as pages
belonging to different processes are moved around, which could also lead belonging to different processes are moved around, which could also lead
......
...@@ -72,7 +72,7 @@ On PowerPC ...@@ -72,7 +72,7 @@ On PowerPC
On other On other
If you know of the key combos for other architectures, please If you know of the key combos for other architectures, please
let me know so I can add them to this section. submit a patch to be included in this section.
On all On all
Write a character to /proc/sysrq-trigger. e.g.:: Write a character to /proc/sysrq-trigger. e.g.::
...@@ -205,10 +205,12 @@ frozen (probably root) filesystem via the FIFREEZE ioctl. ...@@ -205,10 +205,12 @@ frozen (probably root) filesystem via the FIFREEZE ioctl.
Sometimes SysRq seems to get 'stuck' after using it, what can I do? Sometimes SysRq seems to get 'stuck' after using it, what can I do?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That happens to me, also. I've found that tapping shift, alt, and control When this happens, try tapping shift, alt and control on both sides of the
on both sides of the keyboard, and hitting an invalid sysrq sequence again keyboard, and hitting an invalid sysrq sequence again. (i.e., something like
will fix the problem. (i.e., something like :kbd:`alt-sysrq-z`). Switching to :kbd:`alt-sysrq-z`).
another virtual console (:kbd:`ALT+Fn`) and then back again should also help.
Switching to another virtual console (:kbd:`ALT+Fn`) and then back again
should also help.
I hit SysRq, but nothing seems to happen, what's wrong? I hit SysRq, but nothing seems to happen, what's wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -58,11 +58,19 @@ Kirkwood family ...@@ -58,11 +58,19 @@ Kirkwood family
- Product Brief : https://web.archive.org/web/20120616201621/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.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 - 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 - Functional Spec: https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
- 88F6280
- Product Brief : https://web.archive.org/web/20130730091058/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6280_SoC_PB-001.pdf
- 88F6281 - 88F6281
- Product Brief : https://web.archive.org/web/20120131133709/http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.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 - 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 - Functional Spec: https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
- 88F6321
- 88F6322
- 88F6323
- Product Brief : https://web.archive.org/web/20120616201639/http://www.marvell.com/embedded-processors/kirkwood/assets/88f632x_pb.pdf
Homepage: Homepage:
https://web.archive.org/web/20160513194943/http://www.marvell.com/embedded-processors/kirkwood/ https://web.archive.org/web/20160513194943/http://www.marvell.com/embedded-processors/kirkwood/
Core: Core:
...@@ -89,6 +97,10 @@ Discovery family ...@@ -89,6 +97,10 @@ Discovery family
- MV76100 - MV76100
- Product Brief : https://web.archive.org/web/20140722064429/http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV76100-002_WEB.pdf
- Hardware Spec : https://web.archive.org/web/20140722064425/http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV76100_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
Not supported by the Linux kernel. Not supported by the Linux kernel.
Core: Core:
...@@ -124,17 +136,24 @@ EBU Armada family ...@@ -124,17 +136,24 @@ EBU Armada family
Armada 38x Flavors: Armada 38x Flavors:
- 88F6810 Armada 380 - 88F6810 Armada 380
- 88F6811 Armada 381
- 88F6821 Armada 382
- 88F6W21 Armada 383
- 88F6820 Armada 385 - 88F6820 Armada 385
- 88F6825
- 88F6828 Armada 388 - 88F6828 Armada 388
- Product infos: https://web.archive.org/web/20181006144616/http://www.marvell.com/embedded-processors/armada-38x/ - 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 - 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
- Hardware Spec: https://web.archive.org/web/20180713105318/https://www.marvell.com/docs/embedded-processors/assets/marvell-embedded-processors-armada-38x-hardware-specifications-2017-03.pdf
- Design guide: https://web.archive.org/web/20180712231737/https://www.marvell.com/docs/embedded-processors/assets/marvell-embedded-processors-armada-38x-hardware-design-guide-2017-08.pdf
Core: Core:
ARM Cortex-A9 ARM Cortex-A9
Armada 39x Flavors: Armada 39x Flavors:
- 88F6920 Armada 390 - 88F6920 Armada 390
- 88F6925 Armada 395
- 88F6928 Armada 398 - 88F6928 Armada 398
- Product infos: https://web.archive.org/web/20181020222559/http://www.marvell.com/embedded-processors/armada-39x/ - Product infos: https://web.archive.org/web/20181020222559/http://www.marvell.com/embedded-processors/armada-39x/
......
======================
Asymmetric 32-bit SoCs
======================
Author: Will Deacon <will@kernel.org>
This document describes the impact of asymmetric 32-bit SoCs on the
execution of 32-bit (``AArch32``) applications.
Date: 2021-05-17
Introduction
============
Some Armv9 SoCs suffer from a big.LITTLE misfeature where only a subset
of the CPUs are capable of executing 32-bit user applications. On such
a system, Linux by default treats the asymmetry as a "mismatch" and
disables support for both the ``PER_LINUX32`` personality and
``execve(2)`` of 32-bit ELF binaries, with the latter returning
``-ENOEXEC``. If the mismatch is detected during late onlining of a
64-bit-only CPU, then the onlining operation fails and the new CPU is
unavailable for scheduling.
Surprisingly, these SoCs have been produced with the intention of
running legacy 32-bit binaries. Unsurprisingly, that doesn't work very
well with the default behaviour of Linux.
It seems inevitable that future SoCs will drop 32-bit support
altogether, so if you're stuck in the unenviable position of needing to
run 32-bit code on one of these transitionary platforms then you would
be wise to consider alternatives such as recompilation, emulation or
retirement. If neither of those options are practical, then read on.
Enabling kernel support
=======================
Since the kernel support is not completely transparent to userspace,
allowing 32-bit tasks to run on an asymmetric 32-bit system requires an
explicit "opt-in" and can be enabled by passing the
``allow_mismatched_32bit_el0`` parameter on the kernel command-line.
For the remainder of this document we will refer to an *asymmetric
system* to mean an asymmetric 32-bit SoC running Linux with this kernel
command-line option enabled.
Userspace impact
================
32-bit tasks running on an asymmetric system behave in mostly the same
way as on a homogeneous system, with a few key differences relating to
CPU affinity.
sysfs
-----
The subset of CPUs capable of running 32-bit tasks is described in
``/sys/devices/system/cpu/aarch32_el0`` and is documented further in
``Documentation/ABI/testing/sysfs-devices-system-cpu``.
**Note:** CPUs are advertised by this file as they are detected and so
late-onlining of 32-bit-capable CPUs can result in the file contents
being modified by the kernel at runtime. Once advertised, CPUs are never
removed from the file.
``execve(2)``
-------------
On a homogeneous system, the CPU affinity of a task is preserved across
``execve(2)``. This is not always possible on an asymmetric system,
specifically when the new program being executed is 32-bit yet the
affinity mask contains 64-bit-only CPUs. In this situation, the kernel
determines the new affinity mask as follows:
1. If the 32-bit-capable subset of the affinity mask is not empty,
then the affinity is restricted to that subset and the old affinity
mask is saved. This saved mask is inherited over ``fork(2)`` and
preserved across ``execve(2)`` of 32-bit programs.
**Note:** This step does not apply to ``SCHED_DEADLINE`` tasks.
See `SCHED_DEADLINE`_.
2. Otherwise, the cpuset hierarchy of the task is walked until an
ancestor is found containing at least one 32-bit-capable CPU. The
affinity of the task is then changed to match the 32-bit-capable
subset of the cpuset determined by the walk.
3. On failure (i.e. out of memory), the affinity is changed to the set
of all 32-bit-capable CPUs of which the kernel is aware.
A subsequent ``execve(2)`` of a 64-bit program by the 32-bit task will
invalidate the affinity mask saved in (1) and attempt to restore the CPU
affinity of the task using the saved mask if it was previously valid.
This restoration may fail due to intervening changes to the deadline
policy or cpuset hierarchy, in which case the ``execve(2)`` continues
with the affinity unchanged.
Calls to ``sched_setaffinity(2)`` for a 32-bit task will consider only
the 32-bit-capable CPUs of the requested affinity mask. On success, the
affinity for the task is updated and any saved mask from a prior
``execve(2)`` is invalidated.
``SCHED_DEADLINE``
------------------
Explicit admission of a 32-bit deadline task to the default root domain
(e.g. by calling ``sched_setattr(2)``) is rejected on an asymmetric
32-bit system unless admission control is disabled by writing -1 to
``/proc/sys/kernel/sched_rt_runtime_us``.
``execve(2)`` of a 32-bit program from a 64-bit deadline task will
return ``-ENOEXEC`` if the root domain for the task contains any
64-bit-only CPUs and admission control is enabled. Concurrent offlining
of 32-bit-capable CPUs may still necessitate the procedure described in
`execve(2)`_, in which case step (1) is skipped and a warning is
emitted on the console.
**Note:** It is recommended that a set of 32-bit-capable CPUs are placed
into a separate root domain if ``SCHED_DEADLINE`` is to be used with
32-bit tasks on an asymmetric system. Failure to do so is likely to
result in missed deadlines.
Cpusets
-------
The affinity of a 32-bit task on an asymmetric system may include CPUs
that are not explicitly allowed by the cpuset to which it is attached.
This can occur as a result of the following two situations:
- A 64-bit task attached to a cpuset which allows only 64-bit CPUs
executes a 32-bit program.
- All of the 32-bit-capable CPUs allowed by a cpuset containing a
32-bit task are offlined.
In both of these cases, the new affinity is calculated according to step
(2) of the process described in `execve(2)`_ and the cpuset hierarchy is
unchanged irrespective of the cgroup version.
CPU hotplug
-----------
On an asymmetric system, the first detected 32-bit-capable CPU is
prevented from being offlined by userspace and any such attempt will
return ``-EPERM``. Note that suspend is still permitted even if the
primary CPU (i.e. CPU 0) is 64-bit-only.
KVM
---
Although KVM will not advertise 32-bit EL0 support to any vCPUs on an
asymmetric system, a broken guest at EL1 could still attempt to execute
32-bit code at EL0. In this case, an exit from a vCPU thread in 32-bit
mode will return to host userspace with an ``exit_reason`` of
``KVM_EXIT_FAIL_ENTRY`` and will remain non-runnable until successfully
re-initialised by a subsequent ``KVM_ARM_VCPU_INIT`` operation.
...@@ -207,10 +207,17 @@ Before jumping into the kernel, the following conditions must be met: ...@@ -207,10 +207,17 @@ Before jumping into the kernel, the following conditions must be met:
software at a higher exception level to prevent execution in an UNKNOWN software at a higher exception level to prevent execution in an UNKNOWN
state. state.
- SCR_EL3.FIQ must have the same value across all CPUs the kernel is For all systems:
executing on. - If EL3 is present:
- The value of SCR_EL3.FIQ must be the same as the one present at boot
time whenever the kernel is executing. - SCR_EL3.FIQ must have the same value across all CPUs the kernel is
executing on.
- The value of SCR_EL3.FIQ must be the same as the one present at boot
time whenever the kernel is executing.
- If EL3 is present and the kernel is entered at EL2:
- SCR_EL3.HCE (bit 8) must be initialised to 0b1.
For systems with a GICv3 interrupt controller to be used in v3 mode: For systems with a GICv3 interrupt controller to be used in v3 mode:
- If EL3 is present: - If EL3 is present:
...@@ -311,6 +318,28 @@ Before jumping into the kernel, the following conditions must be met: ...@@ -311,6 +318,28 @@ Before jumping into the kernel, the following conditions must be met:
- ZCR_EL2.LEN must be initialised to the same value for all CPUs the - ZCR_EL2.LEN must be initialised to the same value for all CPUs the
kernel will execute on. kernel will execute on.
For CPUs with the Scalable Matrix Extension (FEAT_SME):
- If EL3 is present:
- CPTR_EL3.ESM (bit 12) must be initialised to 0b1.
- SCR_EL3.EnTP2 (bit 41) must be initialised to 0b1.
- SMCR_EL3.LEN must be initialised to the same value for all CPUs the
kernel will execute on.
- If the kernel is entered at EL1 and EL2 is present:
- CPTR_EL2.TSM (bit 12) must be initialised to 0b0.
- CPTR_EL2.SMEN (bits 25:24) must be initialised to 0b11.
- SCTLR_EL2.EnTP2 (bit 60) must be initialised to 0b1.
- SMCR_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 The requirements described above for CPU mode, caches, MMUs, architected
timers, coherency and system registers apply to all CPUs. All CPUs must timers, coherency and system registers apply to all CPUs. All CPUs must
enter the kernel in the same exception level. Where the values documented enter the kernel in the same exception level. Where the values documented
......
...@@ -10,6 +10,7 @@ ARM64 Architecture ...@@ -10,6 +10,7 @@ ARM64 Architecture
acpi_object_usage acpi_object_usage
amu amu
arm-acpi arm-acpi
asymmetric-32bit
booting booting
cpu-feature-registers cpu-feature-registers
elf_hwcaps elf_hwcaps
......
...@@ -77,14 +77,20 @@ configurable behaviours: ...@@ -77,14 +77,20 @@ configurable behaviours:
address is unknown). address is unknown).
The user can select the above modes, per thread, using the The user can select the above modes, per thread, using the
``prctl(PR_SET_TAGGED_ADDR_CTRL, flags, 0, 0, 0)`` system call where ``prctl(PR_SET_TAGGED_ADDR_CTRL, flags, 0, 0, 0)`` system call where ``flags``
``flags`` contain one of the following values in the ``PR_MTE_TCF_MASK`` contains any number of the following values in the ``PR_MTE_TCF_MASK``
bit-field: bit-field:
- ``PR_MTE_TCF_NONE`` - *Ignore* tag check faults - ``PR_MTE_TCF_NONE``  - *Ignore* tag check faults
(ignored if combined with other options)
- ``PR_MTE_TCF_SYNC`` - *Synchronous* tag check fault mode - ``PR_MTE_TCF_SYNC`` - *Synchronous* tag check fault mode
- ``PR_MTE_TCF_ASYNC`` - *Asynchronous* tag check fault mode - ``PR_MTE_TCF_ASYNC`` - *Asynchronous* tag check fault mode
If no modes are specified, tag check faults are ignored. If a single
mode is specified, the program will run in that mode. If multiple
modes are specified, the mode is selected as described in the "Per-CPU
preferred tag checking modes" section below.
The current tag check fault mode can be read using the The current tag check fault mode can be read using the
``prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0)`` system call. ``prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0)`` system call.
...@@ -120,13 +126,39 @@ in the ``PR_MTE_TAG_MASK`` bit-field. ...@@ -120,13 +126,39 @@ in the ``PR_MTE_TAG_MASK`` bit-field.
interface provides an include mask. An include mask of ``0`` (exclusion interface provides an include mask. An include mask of ``0`` (exclusion
mask ``0xffff``) results in the CPU always generating tag ``0``. mask ``0xffff``) results in the CPU always generating tag ``0``.
Per-CPU preferred tag checking mode
-----------------------------------
On some CPUs the performance of MTE in stricter tag checking modes
is similar to that of less strict tag checking modes. This makes it
worthwhile to enable stricter checks on those CPUs when a less strict
checking mode is requested, in order to gain the error detection
benefits of the stricter checks without the performance downsides. To
support this scenario, a privileged user may configure a stricter
tag checking mode as the CPU's preferred tag checking mode.
The preferred tag checking mode for each CPU is controlled by
``/sys/devices/system/cpu/cpu<N>/mte_tcf_preferred``, to which a
privileged user may write the value ``async`` or ``sync``. The default
preferred mode for each CPU is ``async``.
To allow a program to potentially run in the CPU's preferred tag
checking mode, the user program may set multiple tag check fault mode
bits in the ``flags`` argument to the ``prctl(PR_SET_TAGGED_ADDR_CTRL,
flags, 0, 0, 0)`` system call. If the CPU's preferred tag checking
mode is in the task's set of provided tag checking modes (this will
always be the case at present because the kernel only supports two
tag checking modes, but future kernels may support more modes), that
mode will be selected. Otherwise, one of the modes in the task's mode
set will be selected in a currently unspecified manner.
Initial process state Initial process state
--------------------- ---------------------
On ``execve()``, the new process has the following configuration: On ``execve()``, the new process has the following configuration:
- ``PR_TAGGED_ADDR_ENABLE`` set to 0 (disabled) - ``PR_TAGGED_ADDR_ENABLE`` set to 0 (disabled)
- Tag checking mode set to ``PR_MTE_TCF_NONE`` - No tag checking modes are selected (tag check faults ignored)
- ``PR_MTE_TAG_MASK`` set to 0 (all tags excluded) - ``PR_MTE_TAG_MASK`` set to 0 (all tags excluded)
- ``PSTATE.TCO`` set to 0 - ``PSTATE.TCO`` set to 0
- ``PROT_MTE`` not set on any of the initial memory maps - ``PROT_MTE`` not set on any of the initial memory maps
...@@ -251,11 +283,13 @@ Example of correct usage ...@@ -251,11 +283,13 @@ Example of correct usage
return EXIT_FAILURE; return EXIT_FAILURE;
/* /*
* Enable the tagged address ABI, synchronous MTE tag check faults and * Enable the tagged address ABI, synchronous or asynchronous MTE
* allow all non-zero tags in the randomly generated set. * tag check faults (based on per-CPU preference) and allow all
* non-zero tags in the randomly generated set.
*/ */
if (prctl(PR_SET_TAGGED_ADDR_CTRL, if (prctl(PR_SET_TAGGED_ADDR_CTRL,
PR_TAGGED_ADDR_ENABLE | PR_MTE_TCF_SYNC | (0xfffe << PR_MTE_TAG_SHIFT), PR_TAGGED_ADDR_ENABLE | PR_MTE_TCF_SYNC | PR_MTE_TCF_ASYNC |
(0xfffe << PR_MTE_TAG_SHIFT),
0, 0, 0)) { 0, 0, 0)) {
perror("prctl() failed"); perror("prctl() failed");
return EXIT_FAILURE; return EXIT_FAILURE;
......
...@@ -45,14 +45,24 @@ how the user addresses are used by the kernel: ...@@ -45,14 +45,24 @@ how the user addresses are used by the kernel:
1. User addresses not accessed by the kernel but used for address space 1. User addresses not accessed by the kernel but used for address space
management (e.g. ``mprotect()``, ``madvise()``). The use of valid management (e.g. ``mprotect()``, ``madvise()``). The use of valid
tagged pointers in this context is allowed with the exception of tagged pointers in this context is allowed with these exceptions:
``brk()``, ``mmap()`` and the ``new_address`` argument to
``mremap()`` as these have the potential to alias with existing - ``brk()``, ``mmap()`` and the ``new_address`` argument to
user addresses. ``mremap()`` as these have the potential to alias with existing
user addresses.
NOTE: This behaviour changed in v5.6 and so some earlier kernels may
incorrectly accept valid tagged pointers for the ``brk()``, NOTE: This behaviour changed in v5.6 and so some earlier kernels may
``mmap()`` and ``mremap()`` system calls. incorrectly accept valid tagged pointers for the ``brk()``,
``mmap()`` and ``mremap()`` system calls.
- The ``range.start``, ``start`` and ``dst`` arguments to the
``UFFDIO_*`` ``ioctl()``s used on a file descriptor obtained from
``userfaultfd()``, as fault addresses subsequently obtained by reading
the file descriptor will be untagged, which may otherwise confuse
tag-unaware programs.
NOTE: This behaviour changed in v5.14 and so some earlier kernels may
incorrectly accept valid tagged pointers for this system call.
2. User addresses accessed by the kernel (e.g. ``write()``). This ABI 2. User addresses accessed by the kernel (e.g. ``write()``). This ABI
relaxation is disabled by default and the application thread needs to relaxation is disabled by default and the application thread needs to
......
...@@ -271,3 +271,97 @@ WRITE_ONCE. Thus: ...@@ -271,3 +271,97 @@ WRITE_ONCE. Thus:
SC *y, t; SC *y, t;
is allowed. is allowed.
CMPXCHG vs TRY_CMPXCHG
----------------------
int atomic_cmpxchg(atomic_t *ptr, int old, int new);
bool atomic_try_cmpxchg(atomic_t *ptr, int *oldp, int new);
Both provide the same functionality, but try_cmpxchg() can lead to more
compact code. The functions relate like:
bool atomic_try_cmpxchg(atomic_t *ptr, int *oldp, int new)
{
int ret, old = *oldp;
ret = atomic_cmpxchg(ptr, old, new);
if (ret != old)
*oldp = ret;
return ret == old;
}
and:
int atomic_cmpxchg(atomic_t *ptr, int old, int new)
{
(void)atomic_try_cmpxchg(ptr, &old, new);
return old;
}
Usage:
old = atomic_read(&v); old = atomic_read(&v);
for (;;) { do {
new = func(old); new = func(old);
tmp = atomic_cmpxchg(&v, old, new); } while (!atomic_try_cmpxchg(&v, &old, new));
if (tmp == old)
break;
old = tmp;
}
NB. try_cmpxchg() also generates better code on some platforms (notably x86)
where the function more closely matches the hardware instruction.
FORWARD PROGRESS
----------------
In general strong forward progress is expected of all unconditional atomic
operations -- those in the Arithmetic and Bitwise classes and xchg(). However
a fair amount of code also requires forward progress from the conditional
atomic operations.
Specifically 'simple' cmpxchg() loops are expected to not starve one another
indefinitely. However, this is not evident on LL/SC architectures, because
while an LL/SC architecure 'can/should/must' provide forward progress
guarantees between competing LL/SC sections, such a guarantee does not
transfer to cmpxchg() implemented using LL/SC. Consider:
old = atomic_read(&v);
do {
new = func(old);
} while (!atomic_try_cmpxchg(&v, &old, new));
which on LL/SC becomes something like:
old = atomic_read(&v);
do {
new = func(old);
} while (!({
volatile asm ("1: LL %[oldval], %[v]\n"
" CMP %[oldval], %[old]\n"
" BNE 2f\n"
" SC %[new], %[v]\n"
" BNE 1b\n"
"2:\n"
: [oldval] "=&r" (oldval), [v] "m" (v)
: [old] "r" (old), [new] "r" (new)
: "memory");
success = (oldval == old);
if (!success)
old = oldval;
success; }));
However, even the forward branch from the failed compare can cause the LL/SC
to fail on some architectures, let alone whatever the compiler makes of the C
loop body. As a result there is no guarantee what so ever the cacheline
containing @v will stay on the local CPU and progress is made.
Even native CAS architectures can fail to provide forward progress for their
primitive (See Sparc64 for an example).
Such implementations are strongly encouraged to add exponential backoff loops
to a failed CAS in order to ensure some progress. Affected architectures are
also strongly encouraged to inspect/audit the atomic fallbacks, refcount_t and
their locking primitives.
...@@ -54,7 +54,7 @@ layer or if we want to try to merge requests. In both cases, requests will be ...@@ -54,7 +54,7 @@ layer or if we want to try to merge requests. In both cases, requests will be
sent to the software queue. sent to the software queue.
Then, after the requests are processed by software queues, they will be placed Then, after the requests are processed by software queues, they will be placed
at the hardware queue, a second stage queue were the hardware has direct access at the hardware queue, a second stage queue where the hardware has direct access
to process those requests. However, if the hardware does not have enough to process those requests. However, if the hardware does not have enough
resources to accept more requests, blk-mq will places requests on a temporary resources to accept more requests, blk-mq will places requests on a temporary
queue, to be sent in the future, when the hardware is able. queue, to be sent in the future, when the hardware is able.
......
...@@ -15,15 +15,7 @@ that goes into great technical depth about the BPF Architecture. ...@@ -15,15 +15,7 @@ that goes into great technical depth about the BPF Architecture.
libbpf libbpf
====== ======
Libbpf is a userspace library for loading and interacting with bpf programs. Documentation/bpf/libbpf/libbpf.rst is a userspace library for loading and interacting with bpf programs.
.. toctree::
:maxdepth: 1
libbpf/libbpf
libbpf/libbpf_api
libbpf/libbpf_build
libbpf/libbpf_naming_convention
BPF Type Format (BTF) BPF Type Format (BTF)
===================== =====================
......
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
libbpf
======
For API documentation see the `versioned API documentation site <https://libbpf.readthedocs.io/en/latest/api.html>`_.
.. toctree::
:maxdepth: 1
libbpf_naming_convention
libbpf_build
This is documentation for libbpf, a userspace library for loading and
interacting with bpf programs.
All general BPF questions, including kernel functionality, libbpf APIs and
their application, should be sent to bpf@vger.kernel.org mailing list.
You can `subscribe <http://vger.kernel.org/vger-lists.html#bpf>`_ to the
mailing list search its `archive <https://lore.kernel.org/bpf/>`_.
Please search the archive before asking new questions. It very well might
be that this was already addressed or answered before.
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
libbpf
======
This is documentation for libbpf, a userspace library for loading and
interacting with bpf programs.
All general BPF questions, including kernel functionality, libbpf APIs and
their application, should be sent to bpf@vger.kernel.org mailing list.
You can `subscribe <http://vger.kernel.org/vger-lists.html#bpf>`_ to the
mailing list search its `archive <https://lore.kernel.org/bpf/>`_.
Please search the archive before asking new questions. It very well might
be that this was already addressed or answered before.
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
API
===
This documentation is autogenerated from header files in libbpf, tools/lib/bpf
.. kernel-doc:: tools/lib/bpf/libbpf.h
:internal:
.. kernel-doc:: tools/lib/bpf/bpf.h
:internal:
.. kernel-doc:: tools/lib/bpf/btf.h
:internal:
.. kernel-doc:: tools/lib/bpf/xsk.h
:internal:
.. kernel-doc:: tools/lib/bpf/bpf_tracing.h
:internal:
.. kernel-doc:: tools/lib/bpf/bpf_core_read.h
:internal:
.. kernel-doc:: tools/lib/bpf/bpf_endian.h
:internal:
\ No newline at end of file
...@@ -69,7 +69,7 @@ functions. These can be mixed and matched. Note that these functions ...@@ -69,7 +69,7 @@ functions. These can be mixed and matched. Note that these functions
are not reentrant for performance reasons. are not reentrant for performance reasons.
ABI ABI
========== ---
libbpf can be both linked statically or used as DSO. To avoid possible libbpf can be both linked statically or used as DSO. To avoid possible
conflicts with other libraries an application is linked with, all conflicts with other libraries an application is linked with, all
...@@ -108,7 +108,7 @@ This bump in ABI version is at most once per kernel development cycle. ...@@ -108,7 +108,7 @@ This bump in ABI version is at most once per kernel development cycle.
For example, if current state of ``libbpf.map`` is: For example, if current state of ``libbpf.map`` is:
.. code-block:: c .. code-block:: none
LIBBPF_0.0.1 { LIBBPF_0.0.1 {
global: global:
...@@ -121,7 +121,7 @@ For example, if current state of ``libbpf.map`` is: ...@@ -121,7 +121,7 @@ For example, if current state of ``libbpf.map`` is:
, and a new symbol ``bpf_func_c`` is being introduced, then , and a new symbol ``bpf_func_c`` is being introduced, then
``libbpf.map`` should be changed like this: ``libbpf.map`` should be changed like this:
.. code-block:: c .. code-block:: none
LIBBPF_0.0.1 { LIBBPF_0.0.1 {
global: global:
......
...@@ -16,8 +16,6 @@ import sys ...@@ -16,8 +16,6 @@ import sys
import os import os
import sphinx import sphinx
from subprocess import check_output
# Get Sphinx version # Get Sphinx version
major, minor, patch = sphinx.version_info[:3] major, minor, patch = sphinx.version_info[:3]
...@@ -343,6 +341,9 @@ latex_elements = { ...@@ -343,6 +341,9 @@ latex_elements = {
verbatimhintsturnover=false, verbatimhintsturnover=false,
''', ''',
# For CJK One-half spacing, need to be in front of hyperref
'extrapackages': r'\usepackage{setspace}',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
'preamble': ''' 'preamble': '''
% Prevent column squeezing of tabulary. % Prevent column squeezing of tabulary.
...@@ -355,29 +356,117 @@ latex_elements = { ...@@ -355,29 +356,117 @@ latex_elements = {
''', ''',
} }
# At least one book (translations) may have Asian characters # Translations have Asian (CJK) characters which are only displayed if
# with are only displayed if xeCJK is used # xeCJK is used
cjk_cmd = check_output(['fc-list', '--format="%{family[0]}\n"']).decode('utf-8', 'ignore') latex_elements['preamble'] += '''
if cjk_cmd.find("Noto Sans CJK SC") >= 0: \\IfFontExistsTF{Noto Sans CJK SC}{
latex_elements['preamble'] += '''
% This is needed for translations % This is needed for translations
\\usepackage{xeCJK} \\usepackage{xeCJK}
\\setCJKmainfont{Noto Sans CJK SC} \\IfFontExistsTF{Noto Serif CJK SC}{
\\setCJKmainfont{Noto Serif CJK SC}[AutoFakeSlant]
}{
\\setCJKmainfont{Noto Sans CJK SC}[AutoFakeSlant]
}
\\setCJKsansfont{Noto Sans CJK SC}[AutoFakeSlant]
\\setCJKmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant]
% CJK Language-specific font choices
\\IfFontExistsTF{Noto Serif CJK SC}{
\\newCJKfontfamily[SCmain]\\scmain{Noto Serif CJK SC}[AutoFakeSlant]
\\newCJKfontfamily[SCserif]\\scserif{Noto Serif CJK SC}[AutoFakeSlant]
}{
\\newCJKfontfamily[SCmain]\\scmain{Noto Sans CJK SC}[AutoFakeSlant]
\\newCJKfontfamily[SCserif]\\scserif{Noto Sans CJK SC}[AutoFakeSlant]
}
\\newCJKfontfamily[SCsans]\\scsans{Noto Sans CJK SC}[AutoFakeSlant]
\\newCJKfontfamily[SCmono]\\scmono{Noto Sans Mono CJK SC}[AutoFakeSlant]
\\IfFontExistsTF{Noto Serif CJK TC}{
\\newCJKfontfamily[TCmain]\\tcmain{Noto Serif CJK TC}[AutoFakeSlant]
\\newCJKfontfamily[TCserif]\\tcserif{Noto Serif CJK TC}[AutoFakeSlant]
}{
\\newCJKfontfamily[TCmain]\\tcmain{Noto Sans CJK TC}[AutoFakeSlant]
\\newCJKfontfamily[TCserif]\\tcserif{Noto Sans CJK TC}[AutoFakeSlant]
}
\\newCJKfontfamily[TCsans]\\tcsans{Noto Sans CJK TC}[AutoFakeSlant]
\\newCJKfontfamily[TCmono]\\tcmono{Noto Sans Mono CJK TC}[AutoFakeSlant]
\\IfFontExistsTF{Noto Serif CJK KR}{
\\newCJKfontfamily[KRmain]\\krmain{Noto Serif CJK KR}[AutoFakeSlant]
\\newCJKfontfamily[KRserif]\\krserif{Noto Serif CJK KR}[AutoFakeSlant]
}{
\\newCJKfontfamily[KRmain]\\krmain{Noto Sans CJK KR}[AutoFakeSlant]
\\newCJKfontfamily[KRserif]\\krserif{Noto Sans CJK KR}[AutoFakeSlant]
}
\\newCJKfontfamily[KRsans]\\krsans{Noto Sans CJK KR}[AutoFakeSlant]
\\newCJKfontfamily[KRmono]\\krmono{Noto Sans Mono CJK KR}[AutoFakeSlant]
\\IfFontExistsTF{Noto Serif CJK JP}{
\\newCJKfontfamily[JPmain]\\jpmain{Noto Serif CJK JP}[AutoFakeSlant]
\\newCJKfontfamily[JPserif]\\jpserif{Noto Serif CJK JP}[AutoFakeSlant]
}{
\\newCJKfontfamily[JPmain]\\jpmain{Noto Sans CJK JP}[AutoFakeSlant]
\\newCJKfontfamily[JPserif]\\jpserif{Noto Sans CJK JP}[AutoFakeSlant]
}
\\newCJKfontfamily[JPsans]\\jpsans{Noto Sans CJK JP}[AutoFakeSlant]
\\newCJKfontfamily[JPmono]\\jpmono{Noto Sans Mono CJK JP}[AutoFakeSlant]
% Dummy commands for Sphinx < 2.3 (no 'extrapackages' support)
\\providecommand{\\onehalfspacing}{}
\\providecommand{\\singlespacing}{}
% Define custom macros to on/off CJK % Define custom macros to on/off CJK
\\newcommand{\\kerneldocCJKon}{\\makexeCJKactive} \\newcommand{\\kerneldocCJKon}{\\makexeCJKactive\\onehalfspacing}
\\newcommand{\\kerneldocCJKoff}{\\makexeCJKinactive} \\newcommand{\\kerneldocCJKoff}{\\makexeCJKinactive\\singlespacing}
% To customize \sphinxtableofcontents \\newcommand{\\kerneldocBeginSC}{%
\\begingroup%
\\scmain%
}
\\newcommand{\\kerneldocEndSC}{\\endgroup}
\\newcommand{\\kerneldocBeginTC}{%
\\begingroup%
\\tcmain%
\\renewcommand{\\CJKrmdefault}{TCserif}%
\\renewcommand{\\CJKsfdefault}{TCsans}%
\\renewcommand{\\CJKttdefault}{TCmono}%
}
\\newcommand{\\kerneldocEndTC}{\\endgroup}
\\newcommand{\\kerneldocBeginKR}{%
\\begingroup%
\\xeCJKDeclareCharClass{HalfLeft}{`“,`‘}%
\\xeCJKDeclareCharClass{HalfRight}{`”,`’}%
\\krmain%
\\renewcommand{\\CJKrmdefault}{KRserif}%
\\renewcommand{\\CJKsfdefault}{KRsans}%
\\renewcommand{\\CJKttdefault}{KRmono}%
\\xeCJKsetup{CJKspace = true} % For inter-phrase space
}
\\newcommand{\\kerneldocEndKR}{\\endgroup}
\\newcommand{\\kerneldocBeginJP}{%
\\begingroup%
\\xeCJKDeclareCharClass{HalfLeft}{`“,`‘}%
\\xeCJKDeclareCharClass{HalfRight}{`”,`’}%
\\jpmain%
\\renewcommand{\\CJKrmdefault}{JPserif}%
\\renewcommand{\\CJKsfdefault}{JPsans}%
\\renewcommand{\\CJKttdefault}{JPmono}%
}
\\newcommand{\\kerneldocEndJP}{\\endgroup}
% Single spacing in literal blocks
\\fvset{baselinestretch=1}
% To customize \\sphinxtableofcontents
\\usepackage{etoolbox} \\usepackage{etoolbox}
% Inactivate CJK after tableofcontents % Inactivate CJK after tableofcontents
\\apptocmd{\\sphinxtableofcontents}{\\kerneldocCJKoff}{}{} \\apptocmd{\\sphinxtableofcontents}{\\kerneldocCJKoff}{}{}
''' }{ % No CJK font found
else:
latex_elements['preamble'] += '''
% Custom macros to on/off CJK (Dummy) % Custom macros to on/off CJK (Dummy)
\\newcommand{\\kerneldocCJKon}{} \\newcommand{\\kerneldocCJKon}{}
\\newcommand{\\kerneldocCJKoff}{} \\newcommand{\\kerneldocCJKoff}{}
''' \\newcommand{\\kerneldocBeginSC}{}
\\newcommand{\\kerneldocEndSC}{}
\\newcommand{\\kerneldocBeginTC}{}
\\newcommand{\\kerneldocEndTC}{}
\\newcommand{\\kerneldocBeginKR}{}
\\newcommand{\\kerneldocEndKR}{}
\\newcommand{\\kerneldocBeginJP}{}
\\newcommand{\\kerneldocEndJP}{}
}
'''
# Fix reference escape troubles with Sphinx 1.4.x # Fix reference escape troubles with Sphinx 1.4.x
if major == 1: if major == 1:
......
...@@ -271,10 +271,15 @@ maps this page at its virtual address. ...@@ -271,10 +271,15 @@ maps this page at its virtual address.
``void flush_dcache_page(struct page *page)`` ``void flush_dcache_page(struct page *page)``
Any time the kernel writes to a page cache page, _OR_ This routines must be called when:
the kernel is about to read from a page cache page and
user space shared/writable mappings of this page potentially a) the kernel did write to a page that is in the page cache page
exist, this routine is called. and / or in high memory
b) the kernel is about to read from a page cache page and user space
shared/writable mappings of this page potentially exist. Note
that {get,pin}_user_pages{_fast} already call flush_dcache_page
on any page found in the user address space and thus driver
code rarely needs to take this into account.
.. note:: .. note::
...@@ -284,38 +289,34 @@ maps this page at its virtual address. ...@@ -284,38 +289,34 @@ maps this page at its virtual address.
handling vfs symlinks in the page cache need not call handling vfs symlinks in the page cache need not call
this interface at all. this interface at all.
The phrase "kernel writes to a page cache page" means, The phrase "kernel writes to a page cache page" means, specifically,
specifically, that the kernel executes store instructions that the kernel executes store instructions that dirty data in that
that dirty data in that page at the page->virtual mapping page at the page->virtual mapping of that page. It is important to
of that page. It is important to flush here to handle flush here to handle D-cache aliasing, to make sure these kernel stores
D-cache aliasing, to make sure these kernel stores are are visible to user space mappings of that page.
visible to user space mappings of that page.
The corollary case is just as important, if there are users which have
The corollary case is just as important, if there are users shared+writable mappings of this file, we must make sure that kernel
which have shared+writable mappings of this file, we must make reads of these pages will see the most recent stores done by the user.
sure that kernel reads of these pages will see the most recent
stores done by the user. If D-cache aliasing is not an issue, this routine may simply be defined
as a nop on that architecture.
If D-cache aliasing is not an issue, this routine may
simply be defined as a nop on that architecture. There is a bit set aside in page->flags (PG_arch_1) as "architecture
private". The kernel guarantees that, for pagecache pages, it will
There is a bit set aside in page->flags (PG_arch_1) as clear this bit when such a page first enters the pagecache.
"architecture private". The kernel guarantees that,
for pagecache pages, it will clear this bit when such This allows these interfaces to be implemented much more efficiently.
a page first enters the pagecache. It allows one to "defer" (perhaps indefinitely) the actual flush if
there are currently no user processes mapping this page. See sparc64's
This allows these interfaces to be implemented much more flush_dcache_page and update_mmu_cache implementations for an example
efficiently. It allows one to "defer" (perhaps indefinitely) of how to go about doing this.
the actual flush if there are currently no user processes
mapping this page. See sparc64's flush_dcache_page and The idea is, first at flush_dcache_page() time, if page_file_mapping()
update_mmu_cache implementations for an example of how to go returns a mapping, and mapping_mapped on that mapping returns %false,
about doing this. just mark the architecture private page flag bit. Later, in
update_mmu_cache(), a check is made of this flag bit, and if set the
The idea is, first at flush_dcache_page() time, if flush is done and the flag bit is cleared.
page->mapping->i_mmap is an empty tree, just mark the architecture
private page flag bit. Later, in update_mmu_cache(), a check is
made of this flag bit, and if set the flush is done and the flag
bit is cleared.
.. important:: .. important::
...@@ -351,19 +352,6 @@ maps this page at its virtual address. ...@@ -351,19 +352,6 @@ maps this page at its virtual address.
architectures). For incoherent architectures, it should flush architectures). For incoherent architectures, it should flush
the cache of the page at vmaddr. the cache of the page at vmaddr.
``void flush_kernel_dcache_page(struct page *page)``
When the kernel needs to modify a user page is has obtained
with kmap, it calls this function after all modifications are
complete (but before kunmapping it) to bring the underlying
page up to date. It is assumed here that the user has no
incoherent cached copies (i.e. the original page was obtained
from a mechanism like get_user_pages()). The default
implementation is a nop and should remain so on all coherent
architectures. On incoherent architectures, this should flush
the kernel cache for page (using page_address(page)).
``void flush_icache_range(unsigned long start, unsigned long end)`` ``void flush_icache_range(unsigned long start, unsigned long end)``
When the kernel stores into addresses that it will execute When the kernel stores into addresses that it will execute
......
...@@ -55,8 +55,24 @@ exist then it will allocate a new Linux irq_desc, associate it with ...@@ -55,8 +55,24 @@ exist then it will allocate a new Linux irq_desc, associate it with
the hwirq, and call the .map() callback so the driver can perform any the hwirq, and call the .map() callback so the driver can perform any
required hardware setup. required hardware setup.
When an interrupt is received, irq_find_mapping() function should Once a mapping has been established, it can be retrieved or used via a
be used to find the Linux IRQ number from the hwirq number. variety of methods:
- irq_resolve_mapping() returns a pointer to the irq_desc structure
for a given domain and hwirq number, and NULL if there was no
mapping.
- irq_find_mapping() returns a Linux IRQ number for a given domain and
hwirq number, and 0 if there was no mapping
- irq_linear_revmap() is now identical to irq_find_mapping(), and is
deprecated
- generic_handle_domain_irq() handles an interrupt described by a
domain and a hwirq number
- handle_domain_irq() does the same thing for root interrupt
controllers and deals with the set_irq_reg()/irq_enter() sequences
that most architecture requires
Note that irq domain lookups must happen in contexts that are
compatible with a RCU read-side critical section.
The irq_create_mapping() function must be called *atleast once* The irq_create_mapping() function must be called *atleast once*
before any call to irq_find_mapping(), lest the descriptor will not before any call to irq_find_mapping(), lest the descriptor will not
...@@ -137,7 +153,9 @@ required. Calling irq_create_direct_mapping() will allocate a Linux ...@@ -137,7 +153,9 @@ required. Calling irq_create_direct_mapping() will allocate a Linux
IRQ number and call the .map() callback so that driver can program the IRQ number and call the .map() callback so that driver can program the
Linux IRQ number into the hardware. Linux IRQ number into the hardware.
Most drivers cannot use this mapping. Most drivers cannot use this mapping, and it is now gated on the
CONFIG_IRQ_DOMAIN_NOMAP option. Please refrain from introducing new
users of this API.
Legacy Legacy
------ ------
...@@ -157,6 +175,10 @@ for IRQ numbers that are passed to struct device registrations. In that ...@@ -157,6 +175,10 @@ for IRQ numbers that are passed to struct device registrations. In that
case the Linux IRQ numbers cannot be dynamically assigned and the legacy case the Linux IRQ numbers cannot be dynamically assigned and the legacy
mapping should be used. mapping should be used.
As the name implies, the *_legacy() functions are deprecated and only
exist to ease the support of ancient platforms. No new users should be
added.
The legacy map assumes a contiguous range of IRQ numbers has already The legacy map assumes a contiguous range of IRQ numbers has already
been allocated for the controller and that the IRQ number can be been allocated for the controller and that the IRQ number can be
calculated by adding a fixed offset to the hwirq number, and calculated by adding a fixed offset to the hwirq number, and
......
...@@ -315,6 +315,9 @@ Block Devices ...@@ -315,6 +315,9 @@ Block Devices
.. kernel-doc:: block/genhd.c .. kernel-doc:: block/genhd.c
:export: :export:
.. kernel-doc:: block/bdev.c
:export:
Char devices Char devices
============ ============
......
...@@ -107,9 +107,6 @@ also ``CONFIG_DYNAMIC_DEBUG`` in the case of pr_debug()) is defined. ...@@ -107,9 +107,6 @@ also ``CONFIG_DYNAMIC_DEBUG`` in the case of pr_debug()) is defined.
Function reference Function reference
================== ==================
.. kernel-doc:: kernel/printk/printk.c
:functions: printk
.. kernel-doc:: include/linux/printk.h .. kernel-doc:: include/linux/printk.h
:functions: pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info :functions: printk pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info
pr_fmt pr_debug pr_devel pr_cont pr_fmt pr_debug pr_devel pr_cont
...@@ -130,6 +130,7 @@ printed after the symbol name with an extra ``b`` appended to the end of the ...@@ -130,6 +130,7 @@ printed after the symbol name with an extra ``b`` appended to the end of the
specifier. specifier.
:: ::
%pS versatile_init+0x0/0x110 [module_name] %pS versatile_init+0x0/0x110 [module_name]
%pSb versatile_init+0x0/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e] %pSb versatile_init+0x0/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]
%pSRb versatile_init+0x9/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e] %pSRb versatile_init+0x9/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]
......
...@@ -75,9 +75,6 @@ And optionally ...@@ -75,9 +75,6 @@ And optionally
.resume - A pointer to a per-policy resume function which is called .resume - A pointer to a per-policy resume function which is called
with interrupts disabled and _before_ the governor is started again. with interrupts disabled and _before_ the governor is started again.
.ready - A pointer to a per-policy ready function which is called after
the policy is fully initialized.
.attr - A pointer to a NULL-terminated list of "struct freq_attr" which .attr - A pointer to a NULL-terminated list of "struct freq_attr" which
allow to export values to sysfs. allow to export values to sysfs.
......
...@@ -181,9 +181,16 @@ By default, KASAN prints a bug report only for the first invalid memory access. ...@@ -181,9 +181,16 @@ 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 With ``kasan_multi_shot``, KASAN prints a report on every invalid access. This
effectively disables ``panic_on_warn`` for KASAN reports. effectively disables ``panic_on_warn`` for KASAN reports.
Alternatively, independent of ``panic_on_warn`` the ``kasan.fault=`` boot
parameter can be used to control panic and reporting behaviour:
- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN
report or also panic the kernel (default: ``report``). The panic happens even
if ``kasan_multi_shot`` is enabled.
Hardware tag-based KASAN mode (see the section about various modes below) is 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 intended for use in production as a security mitigation. Therefore, it supports
boot parameters that allow disabling KASAN or controlling its features. additional boot parameters that allow disabling KASAN or controlling features:
- ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``). - ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``).
...@@ -199,10 +206,6 @@ boot parameters that allow disabling KASAN or controlling its features. ...@@ -199,10 +206,6 @@ boot parameters that allow disabling KASAN or controlling its features.
- ``kasan.stacktrace=off`` or ``=on`` disables or enables alloc and free stack - ``kasan.stacktrace=off`` or ``=on`` disables or enables alloc and free stack
traces collection (default: ``on``). traces collection (default: ``on``).
- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN
report or also panic the kernel (default: ``report``). The panic happens even
if ``kasan_multi_shot`` is enabled.
Implementation details Implementation details
---------------------- ----------------------
......
...@@ -127,6 +127,18 @@ Kconfig options: ...@@ -127,6 +127,18 @@ Kconfig options:
causes KCSAN to not report data races due to conflicts where the only plain causes KCSAN to not report data races due to conflicts where the only plain
accesses are aligned writes up to word size. accesses are aligned writes up to word size.
* ``CONFIG_KCSAN_PERMISSIVE``: Enable additional permissive rules to ignore
certain classes of common data races. Unlike the above, the rules are more
complex involving value-change patterns, access type, and address. This
option depends on ``CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=y``. For details
please see the ``kernel/kcsan/permissive.h``. Testers and maintainers that
only focus on reports from specific subsystems and not the whole kernel are
recommended to disable this option.
To use the strictest possible rules, select ``CONFIG_KCSAN_STRICT=y``, which
configures KCSAN to follow the Linux-kernel memory consistency model (LKMM) as
closely as possible.
DebugFS interface DebugFS interface
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
......
...@@ -65,25 +65,27 @@ Error reports ...@@ -65,25 +65,27 @@ Error reports
A typical out-of-bounds access looks like this:: A typical out-of-bounds access looks like this::
================================================================== ==================================================================
BUG: KFENCE: out-of-bounds read in test_out_of_bounds_read+0xa3/0x22b BUG: KFENCE: out-of-bounds read in test_out_of_bounds_read+0xa6/0x234
Out-of-bounds read at 0xffffffffb672efff (1B left of kfence-#17): Out-of-bounds read at 0xffff8c3f2e291fff (1B left of kfence-#72):
test_out_of_bounds_read+0xa3/0x22b test_out_of_bounds_read+0xa6/0x234
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
kfence-#17 [0xffffffffb672f000-0xffffffffb672f01f, size=32, cache=kmalloc-32] allocated by task 507: kfence-#72: 0xffff8c3f2e292000-0xffff8c3f2e29201f, size=32, cache=kmalloc-32
test_alloc+0xf3/0x25b
test_out_of_bounds_read+0x98/0x22b allocated by task 484 on cpu 0 at 32.919330s:
kunit_try_run_case+0x51/0x85 test_alloc+0xfe/0x738
test_out_of_bounds_read+0x9b/0x234
kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
CPU: 4 PID: 107 Comm: kunit_try_catch Not tainted 5.8.0-rc6+ #7 CPU: 0 PID: 484 Comm: kunit_try_catch Not tainted 5.13.0-rc3+ #7
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
================================================================== ==================================================================
The header of the report provides a short summary of the function involved in The header of the report provides a short summary of the function involved in
...@@ -96,30 +98,32 @@ Use-after-free accesses are reported as:: ...@@ -96,30 +98,32 @@ Use-after-free accesses are reported as::
================================================================== ==================================================================
BUG: KFENCE: use-after-free read in test_use_after_free_read+0xb3/0x143 BUG: KFENCE: use-after-free read in test_use_after_free_read+0xb3/0x143
Use-after-free read at 0xffffffffb673dfe0 (in kfence-#24): Use-after-free read at 0xffff8c3f2e2a0000 (in kfence-#79):
test_use_after_free_read+0xb3/0x143 test_use_after_free_read+0xb3/0x143
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
kfence-#24 [0xffffffffb673dfe0-0xffffffffb673dfff, size=32, cache=kmalloc-32] allocated by task 507: kfence-#79: 0xffff8c3f2e2a0000-0xffff8c3f2e2a001f, size=32, cache=kmalloc-32
test_alloc+0xf3/0x25b
allocated by task 488 on cpu 2 at 33.871326s:
test_alloc+0xfe/0x738
test_use_after_free_read+0x76/0x143 test_use_after_free_read+0x76/0x143
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
freed by task 507: freed by task 488 on cpu 2 at 33.871358s:
test_use_after_free_read+0xa8/0x143 test_use_after_free_read+0xa8/0x143
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
CPU: 4 PID: 109 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7 CPU: 2 PID: 488 Comm: kunit_try_catch Tainted: G B 5.13.0-rc3+ #7
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
================================================================== ==================================================================
KFENCE also reports on invalid frees, such as double-frees:: KFENCE also reports on invalid frees, such as double-frees::
...@@ -127,30 +131,32 @@ KFENCE also reports on invalid frees, such as double-frees:: ...@@ -127,30 +131,32 @@ KFENCE also reports on invalid frees, such as double-frees::
================================================================== ==================================================================
BUG: KFENCE: invalid free in test_double_free+0xdc/0x171 BUG: KFENCE: invalid free in test_double_free+0xdc/0x171
Invalid free of 0xffffffffb6741000: Invalid free of 0xffff8c3f2e2a4000 (in kfence-#81):
test_double_free+0xdc/0x171 test_double_free+0xdc/0x171
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
kfence-#26 [0xffffffffb6741000-0xffffffffb674101f, size=32, cache=kmalloc-32] allocated by task 507: kfence-#81: 0xffff8c3f2e2a4000-0xffff8c3f2e2a401f, size=32, cache=kmalloc-32
test_alloc+0xf3/0x25b
allocated by task 490 on cpu 1 at 34.175321s:
test_alloc+0xfe/0x738
test_double_free+0x76/0x171 test_double_free+0x76/0x171
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
freed by task 507: freed by task 490 on cpu 1 at 34.175348s:
test_double_free+0xa8/0x171 test_double_free+0xa8/0x171
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
CPU: 4 PID: 111 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7 CPU: 1 PID: 490 Comm: kunit_try_catch Tainted: G B 5.13.0-rc3+ #7
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
================================================================== ==================================================================
KFENCE also uses pattern-based redzones on the other side of an object's guard KFENCE also uses pattern-based redzones on the other side of an object's guard
...@@ -160,23 +166,25 @@ These are reported on frees:: ...@@ -160,23 +166,25 @@ These are reported on frees::
================================================================== ==================================================================
BUG: KFENCE: memory corruption in test_kmalloc_aligned_oob_write+0xef/0x184 BUG: KFENCE: memory corruption in test_kmalloc_aligned_oob_write+0xef/0x184
Corrupted memory at 0xffffffffb6797ff9 [ 0xac . . . . . . ] (in kfence-#69): Corrupted memory at 0xffff8c3f2e33aff9 [ 0xac . . . . . . ] (in kfence-#156):
test_kmalloc_aligned_oob_write+0xef/0x184 test_kmalloc_aligned_oob_write+0xef/0x184
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
kfence-#69 [0xffffffffb6797fb0-0xffffffffb6797ff8, size=73, cache=kmalloc-96] allocated by task 507: kfence-#156: 0xffff8c3f2e33afb0-0xffff8c3f2e33aff8, size=73, cache=kmalloc-96
test_alloc+0xf3/0x25b
allocated by task 502 on cpu 7 at 42.159302s:
test_alloc+0xfe/0x738
test_kmalloc_aligned_oob_write+0x57/0x184 test_kmalloc_aligned_oob_write+0x57/0x184
kunit_try_run_case+0x51/0x85 kunit_try_run_case+0x61/0xa0
kunit_generic_run_threadfn_adapter+0x16/0x30 kunit_generic_run_threadfn_adapter+0x16/0x30
kthread+0x137/0x160 kthread+0x176/0x1b0
ret_from_fork+0x22/0x30 ret_from_fork+0x22/0x30
CPU: 4 PID: 120 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7 CPU: 7 PID: 502 Comm: kunit_try_catch Tainted: G B 5.13.0-rc3+ #7
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
================================================================== ==================================================================
For such errors, the address where the corruption occurred as well as the For such errors, the address where the corruption occurred as well as the
......
...@@ -114,9 +114,12 @@ results in TAP format, you can pass the ``--raw_output`` argument. ...@@ -114,9 +114,12 @@ results in TAP format, you can pass the ``--raw_output`` argument.
./tools/testing/kunit/kunit.py run --raw_output ./tools/testing/kunit/kunit.py run --raw_output
.. note:: The raw output from test runs may contain other, non-KUnit kernel log
The raw output from test runs may contain other, non-KUnit kernel log lines. You can see just KUnit output with ``--raw_output=kunit``:
lines.
.. code-block:: bash
./tools/testing/kunit/kunit.py run --raw_output=kunit
If you have KUnit results in their raw TAP format, you can parse them and print If you have KUnit results in their raw TAP format, you can parse them and print
the human-readable summary with the ``parse`` command for kunit_tool. This the human-readable summary with the ``parse`` command for kunit_tool. This
......
...@@ -80,25 +80,23 @@ file ``.kunitconfig``, you can just pass in the dir, e.g. ...@@ -80,25 +80,23 @@ file ``.kunitconfig``, you can just pass in the dir, e.g.
automagically, but tests could theoretically depend on incompatible automagically, but tests could theoretically depend on incompatible
options, so handling that would be tricky. options, so handling that would be tricky.
Setting kernel commandline parameters
-------------------------------------
You can use ``--kernel_args`` to pass arbitrary kernel arguments, e.g.
.. code-block:: bash
$ ./tools/testing/kunit/kunit.py run --kernel_args=param=42 --kernel_args=param2=false
Generating code coverage reports under UML Generating code coverage reports under UML
------------------------------------------ ------------------------------------------
.. note:: .. note::
TODO(brendanhiggins@google.com): There are various issues with UML and TODO(brendanhiggins@google.com): There are various issues with UML and
versions of gcc 7 and up. You're likely to run into missing ``.gcda`` versions of gcc 7 and up. You're likely to run into missing ``.gcda``
files or compile errors. We know one `faulty GCC commit files or compile errors.
<https://github.com/gcc-mirror/gcc/commit/8c9434c2f9358b8b8bad2c1990edf10a21645f9d>`_
but not how we'd go about getting this fixed. The compile errors still
need some investigation.
.. note::
TODO(brendanhiggins@google.com): for recent versions of Linux
(5.10-5.12, maybe earlier), there's a bug with gcov counters not being
flushed in UML. This translates to very low (<1%) reported coverage. This is
related to the above issue and can be worked around by replacing the
one call to ``uml_abort()`` (it's in ``os_dump_core()``) with a plain
``exit()``.
This is different from the "normal" way of getting coverage information that is This is different from the "normal" way of getting coverage information that is
documented in Documentation/dev-tools/gcov.rst. documented in Documentation/dev-tools/gcov.rst.
......
...@@ -28,7 +28,7 @@ find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ ...@@ -28,7 +28,7 @@ find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
quiet_cmd_yamllint = LINT $(src) quiet_cmd_yamllint = LINT $(src)
cmd_yamllint = ($(find_cmd) | \ cmd_yamllint = ($(find_cmd) | \
xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint) || true xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true
quiet_cmd_chk_bindings = CHKDT $@ quiet_cmd_chk_bindings = CHKDT $@
cmd_chk_bindings = ($(find_cmd) | \ cmd_chk_bindings = ($(find_cmd) | \
......
...@@ -145,6 +145,11 @@ properties: ...@@ -145,6 +145,11 @@ properties:
- const: atmel,sama5d4 - const: atmel,sama5d4
- const: atmel,sama5 - const: atmel,sama5
- items:
- const: microchip,sama7g5ek # SAMA7G5 Evaluation Kit
- const: microchip,sama7g5
- const: microchip,sama7
- items: - items:
- enum: - enum:
- atmel,sams70j19 - atmel,sams70j19
......
...@@ -45,7 +45,8 @@ RAMC SDRAM/DDR Controller required properties: ...@@ -45,7 +45,8 @@ RAMC SDRAM/DDR Controller required properties:
"atmel,at91sam9260-sdramc", "atmel,at91sam9260-sdramc",
"atmel,at91sam9g45-ddramc", "atmel,at91sam9g45-ddramc",
"atmel,sama5d3-ddramc", "atmel,sama5d3-ddramc",
"microchip,sam9x60-ddramc" "microchip,sam9x60-ddramc",
"microchip,sama7g5-uddrc"
- reg: Should contain registers location and length - reg: Should contain registers location and length
Examples: Examples:
...@@ -55,6 +56,17 @@ Examples: ...@@ -55,6 +56,17 @@ Examples:
reg = <0xffffe800 0x200>; reg = <0xffffe800 0x200>;
}; };
RAMC PHY Controller required properties:
- compatible: Should be "microchip,sama7g5-ddr3phy", "syscon"
- reg: Should contain registers location and length
Example:
ddr3phy: ddr3phy@e3804000 {
compatible = "microchip,sama7g5-ddr3phy", "syscon";
reg = <0xe3804000 0x1000>;
};
SHDWC Shutdown Controller SHDWC Shutdown Controller
required properties: required properties:
......
...@@ -221,9 +221,13 @@ properties: ...@@ -221,9 +221,13 @@ properties:
- prt,prti6q # Protonic PRTI6Q board - prt,prti6q # Protonic PRTI6Q board
- prt,prtwd2 # Protonic WD2 board - prt,prtwd2 # Protonic WD2 board
- rex,imx6q-rex-pro # Rex Pro i.MX6 Quad Board - rex,imx6q-rex-pro # Rex Pro i.MX6 Quad Board
- skov,imx6q-skov-revc-lt2 # SKOV IMX6 CPU QuadCore lt2
- skov,imx6q-skov-revc-lt6 # SKOV IMX6 CPU QuadCore lt6
- skov,imx6q-skov-reve-mi1010ait-1cp1 # SKOV IMX6 CPU QuadCore mi1010ait-1cp1
- solidrun,cubox-i/q # SolidRun Cubox-i Dual/Quad - solidrun,cubox-i/q # SolidRun Cubox-i Dual/Quad
- solidrun,hummingboard/q - solidrun,hummingboard/q
- solidrun,hummingboard2/q - solidrun,hummingboard2/q
- solidrun,solidsense/q # SolidRun SolidSense Dual/Quad
- tbs,imx6q-tbs2910 # TBS2910 Matrix ARM mini PC - tbs,imx6q-tbs2910 # TBS2910 Matrix ARM mini PC
- technexion,imx6q-pico-dwarf # TechNexion i.MX6Q Pico-Dwarf - technexion,imx6q-pico-dwarf # TechNexion i.MX6Q Pico-Dwarf
- technexion,imx6q-pico-hobbit # TechNexion i.MX6Q Pico-Hobbit - technexion,imx6q-pico-hobbit # TechNexion i.MX6Q Pico-Hobbit
...@@ -377,9 +381,12 @@ properties: ...@@ -377,9 +381,12 @@ properties:
- prt,prtvt7 # Protonic VT7 board - prt,prtvt7 # Protonic VT7 board
- rex,imx6dl-rex-basic # Rex Basic i.MX6 Dual Lite Board - rex,imx6dl-rex-basic # Rex Basic i.MX6 Dual Lite Board
- riot,imx6s-riotboard # RIoTboard i.MX6S - riot,imx6s-riotboard # RIoTboard i.MX6S
- skov,imx6dl-skov-revc-lt2 # SKOV IMX6 CPU SoloCore lt2
- skov,imx6dl-skov-revc-lt6 # SKOV IMX6 CPU SoloCore lt6
- solidrun,cubox-i/dl # SolidRun Cubox-i Solo/DualLite - solidrun,cubox-i/dl # SolidRun Cubox-i Solo/DualLite
- solidrun,hummingboard/dl - solidrun,hummingboard/dl
- solidrun,hummingboard2/dl # SolidRun HummingBoard2 Solo/DualLite - solidrun,hummingboard2/dl # SolidRun HummingBoard2 Solo/DualLite
- solidrun,solidsense/dl # SolidRun SolidSense Solo/DualLite
- technexion,imx6dl-pico-dwarf # TechNexion i.MX6DL Pico-Dwarf - technexion,imx6dl-pico-dwarf # TechNexion i.MX6DL Pico-Dwarf
- technexion,imx6dl-pico-hobbit # TechNexion i.MX6DL Pico-Hobbit - technexion,imx6dl-pico-hobbit # TechNexion i.MX6DL Pico-Hobbit
- technexion,imx6dl-pico-nymph # TechNexion i.MX6DL Pico-Nymph - technexion,imx6dl-pico-nymph # TechNexion i.MX6DL Pico-Nymph
...@@ -418,6 +425,12 @@ properties: ...@@ -418,6 +425,12 @@ properties:
- const: dfi,fs700e-m60 - const: dfi,fs700e-m60
- const: fsl,imx6dl - const: fsl,imx6dl
- description: i.MX6DL DHCOM PicoITX Board
items:
- const: dh,imx6dl-dhcom-picoitx
- const: dh,imx6dl-dhcom-som
- const: fsl,imx6dl
- description: i.MX6DL Gateworks Ventana Boards - description: i.MX6DL Gateworks Ventana Boards
items: items:
- enum: - enum:
...@@ -469,6 +482,12 @@ properties: ...@@ -469,6 +482,12 @@ properties:
- const: toradex,colibri_imx6dl # Colibri iMX6 Module - const: toradex,colibri_imx6dl # Colibri iMX6 Module
- const: fsl,imx6dl - const: fsl,imx6dl
- description: i.MX6S DHCOM DRC02 Board
items:
- const: dh,imx6s-dhcom-drc02
- const: dh,imx6s-dhcom-som
- const: fsl,imx6dl
- description: i.MX6SL based Boards - description: i.MX6SL based Boards
items: items:
- enum: - enum:
...@@ -698,6 +717,7 @@ properties: ...@@ -698,6 +717,7 @@ properties:
- gw,imx8mm-gw72xx-0x # i.MX8MM Gateworks Development Kit - gw,imx8mm-gw72xx-0x # i.MX8MM Gateworks Development Kit
- gw,imx8mm-gw73xx-0x # i.MX8MM Gateworks Development Kit - gw,imx8mm-gw73xx-0x # i.MX8MM Gateworks Development Kit
- gw,imx8mm-gw7901 # i.MX8MM Gateworks Board - gw,imx8mm-gw7901 # i.MX8MM Gateworks Board
- gw,imx8mm-gw7902 # i.MX8MM Gateworks Board
- kontron,imx8mm-n801x-som # i.MX8MM Kontron SL (N801X) SOM - kontron,imx8mm-n801x-som # i.MX8MM Kontron SL (N801X) SOM
- variscite,var-som-mx8mm # i.MX8MM Variscite VAR-SOM-MX8MM module - variscite,var-som-mx8mm # i.MX8MM Variscite VAR-SOM-MX8MM module
- const: fsl,imx8mm - const: fsl,imx8mm
...@@ -728,6 +748,7 @@ properties: ...@@ -728,6 +748,7 @@ properties:
- beacon,imx8mn-beacon-kit # i.MX8MN Beacon Development Kit - beacon,imx8mn-beacon-kit # i.MX8MN Beacon Development Kit
- fsl,imx8mn-ddr4-evk # i.MX8MN DDR4 EVK Board - fsl,imx8mn-ddr4-evk # i.MX8MN DDR4 EVK Board
- fsl,imx8mn-evk # i.MX8MN LPDDR4 EVK Board - fsl,imx8mn-evk # i.MX8MN LPDDR4 EVK Board
- gw,imx8mn-gw7902 # i.MX8MM Gateworks Board
- const: fsl,imx8mn - const: fsl,imx8mn
- description: Variscite VAR-SOM-MX8MN based boards - description: Variscite VAR-SOM-MX8MN based boards
...@@ -752,10 +773,12 @@ properties: ...@@ -752,10 +773,12 @@ properties:
items: items:
- enum: - enum:
- boundary,imx8mq-nitrogen8m # i.MX8MQ NITROGEN Board - boundary,imx8mq-nitrogen8m # i.MX8MQ NITROGEN Board
- boundary,imx8mq-nitrogen8m-som # i.MX8MQ NITROGEN SoM
- einfochips,imx8mq-thor96 # i.MX8MQ Thor96 Board - einfochips,imx8mq-thor96 # i.MX8MQ Thor96 Board
- fsl,imx8mq-evk # i.MX8MQ EVK Board - fsl,imx8mq-evk # i.MX8MQ EVK Board
- google,imx8mq-phanbell # Google Coral Edge TPU - google,imx8mq-phanbell # Google Coral Edge TPU
- kontron,pitx-imx8m # Kontron pITX-imx8m Board - kontron,pitx-imx8m # Kontron pITX-imx8m Board
- mntre,reform2 # MNT Reform2 Laptop
- purism,librem5-devkit # Purism Librem5 devkit - purism,librem5-devkit # Purism Librem5 devkit
- solidrun,hummingboard-pulse # SolidRun Hummingboard Pulse - solidrun,hummingboard-pulse # SolidRun Hummingboard Pulse
- technexion,pico-pi-imx8m # TechNexion PICO-PI-8M evk - technexion,pico-pi-imx8m # TechNexion PICO-PI-8M evk
...@@ -973,6 +996,12 @@ properties: ...@@ -973,6 +996,12 @@ properties:
- fsl,s32v234-evb # S32V234-EVB2 Customer Evaluation Board - fsl,s32v234-evb # S32V234-EVB2 Customer Evaluation Board
- const: fsl,s32v234 - const: fsl,s32v234
- description: Traverse LS1088A based Boards
items:
- enum:
- traverse,ten64 # Ten64 Networking Appliance / Board
- const: fsl,ls1088a
additionalProperties: true additionalProperties: true
... ...
此差异已折叠。
...@@ -13,6 +13,7 @@ Required Properties: ...@@ -13,6 +13,7 @@ Required Properties:
- "mediatek,mt7623-audsys", "mediatek,mt2701-audsys", "syscon" - "mediatek,mt7623-audsys", "mediatek,mt2701-audsys", "syscon"
- "mediatek,mt8167-audiosys", "syscon" - "mediatek,mt8167-audiosys", "syscon"
- "mediatek,mt8183-audiosys", "syscon" - "mediatek,mt8183-audiosys", "syscon"
- "mediatek,mt8192-audsys", "syscon"
- "mediatek,mt8516-audsys", "syscon" - "mediatek,mt8516-audsys", "syscon"
- #clock-cells: Must be 1 - #clock-cells: Must be 1
......
Mediatek mmsys controller
============================
The Mediatek mmsys system controller provides clock control, routing control,
and miscellaneous control in mmsys partition.
Required Properties:
- compatible: Should be one of:
- "mediatek,mt2701-mmsys", "syscon"
- "mediatek,mt2712-mmsys", "syscon"
- "mediatek,mt6765-mmsys", "syscon"
- "mediatek,mt6779-mmsys", "syscon"
- "mediatek,mt6797-mmsys", "syscon"
- "mediatek,mt7623-mmsys", "mediatek,mt2701-mmsys", "syscon"
- "mediatek,mt8167-mmsys", "syscon"
- "mediatek,mt8173-mmsys", "syscon"
- "mediatek,mt8183-mmsys", "syscon"
- #clock-cells: Must be 1
For the clock control, the mmsys controller uses the common clk binding from
Documentation/devicetree/bindings/clock/clock-bindings.txt
The available clocks are defined in dt-bindings/clock/mt*-clk.h.
Example:
mmsys: syscon@14000000 {
compatible = "mediatek,mt8173-mmsys", "syscon";
reg = <0 0x14000000 0 0x1000>;
#clock-cells = <1>;
};
...@@ -31,6 +31,7 @@ description: | ...@@ -31,6 +31,7 @@ description: |
ipq6018 ipq6018
ipq8074 ipq8074
mdm9615 mdm9615
msm8226
msm8916 msm8916
msm8974 msm8974
msm8992 msm8992
...@@ -114,6 +115,11 @@ properties: ...@@ -114,6 +115,11 @@ properties:
- qcom,apq8084-sbc - qcom,apq8084-sbc
- const: qcom,apq8084 - const: qcom,apq8084
- items:
- enum:
- samsung,s3ve3g
- const: qcom,msm8226
- items: - items:
- enum: - enum:
- qcom,msm8960-cdp - qcom,msm8960-cdp
...@@ -129,6 +135,8 @@ properties: ...@@ -129,6 +135,8 @@ properties:
- const: qcom,msm8974 - const: qcom,msm8974
- items: - items:
- enum:
- alcatel,idol347
- const: qcom,msm8916-mtp/1 - const: qcom,msm8916-mtp/1
- const: qcom,msm8916-mtp - const: qcom,msm8916-mtp
- const: qcom,msm8916 - const: qcom,msm8916
...@@ -181,6 +189,8 @@ properties: ...@@ -181,6 +189,8 @@ properties:
- items: - items:
- enum: - enum:
- qcom,sc7280-idp - qcom,sc7280-idp
- qcom,sc7280-idp2
- google,piglin
- google,senor - google,senor
- const: qcom,sc7280 - const: qcom,sc7280
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册