Commit 50d22834 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'docs-5.10' of git://git.lwn.net/linux

Pull documentation updates from Jonathan Corbet:
 "As hoped, things calmed down for docs this cycle; fewer changes and
  almost no conflicts at all. This includes:

   - A reworked and expanded user-mode Linux document

   - Some simplifications and improvements for submitting-patches.rst

   - An emergency fix for (some) problems with Sphinx 3.x

   - Some welcome automarkup improvements to automatically generate
     cross-references to struct definitions and other documents

   - The usual collection of translation updates, typo fixes, etc"

* tag 'docs-5.10' of git://git.lwn.net/linux: (81 commits)
  gpiolib: Update indentation in driver.rst for code excerpts
  Documentation/admin-guide: tainted-kernels: Fix typo occured
  Documentation: better locations for sysfs-pci, sysfs-tagging
  docs: programming-languages: refresh blurb on clang support
  Documentation: kvm: fix a typo
  Documentation: Chinese translation of Documentation/arm64/amu.rst
  doc: zh_CN: index files in arm64 subdirectory
  mailmap: add entry for <mstarovoitov@marvell.com>
  doc: seq_file: clarify role of *pos in ->next()
  docs: trace: ring-buffer-design.rst: use the new SPDX tag
  Documentation: kernel-parameters: clarify "module." parameters
  Fix references to nommu-mmap.rst
  docs: rewrite admin-guide/sysctl/abi.rst
  docs: fb: Remove vesafb scrollback boot option
  docs: fb: Remove sstfb scrollback boot option
  docs: fb: Remove matroxfb scrollback boot option
  docs: fb: Remove framebuffer scrollback boot option
  docs: replace the old User Mode Linux HowTo with a new one
  Documentation/admin-guide: blockdev/ramdisk: remove use of "rdev"
  Documentation/admin-guide: README & svga: remove use of "rdev"
  ...
parents ced3a9eb 4fb220da
...@@ -152,3 +152,6 @@ x509.genkey ...@@ -152,3 +152,6 @@ x509.genkey
# Clang's compilation database file # Clang's compilation database file
/compile_commands.json /compile_commands.json
# Documentation toolchain
sphinx_*/
...@@ -197,6 +197,7 @@ Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com> ...@@ -197,6 +197,7 @@ Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com>
Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com> Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com>
Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com> Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com>
Mark Brown <broonie@sirena.org.uk> Mark Brown <broonie@sirena.org.uk>
Mark Starovoytov <mstarovo@pm.me> <mstarovoitov@marvell.com>
Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com> Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com>
Martin Kepplinger <martink@posteo.de> <martin.kepplinger@ginzinger.com> Martin Kepplinger <martink@posteo.de> <martin.kepplinger@ginzinger.com>
Martin Kepplinger <martink@posteo.de> <martin.kepplinger@puri.sm> Martin Kepplinger <martink@posteo.de> <martin.kepplinger@puri.sm>
......
What: /sys/kernel/notes
Date: July 2009
Contact: <linux-kernel@vger.kernel.org>
Description: The /sys/kernel/notes file contains the binary representation
of the running vmlinux's .notes section.
...@@ -12,6 +12,7 @@ Linux PCI Bus Subsystem ...@@ -12,6 +12,7 @@ Linux PCI Bus Subsystem
pciebus-howto pciebus-howto
pci-iov-howto pci-iov-howto
msi-howto msi-howto
sysfs-pci
acpi-info acpi-info
pci-error-recovery pci-error-recovery
pcieaer-howto pcieaer-howto
......
...@@ -322,9 +322,9 @@ Compiling the kernel ...@@ -322,9 +322,9 @@ Compiling the kernel
reboot, and enjoy! reboot, and enjoy!
If you ever need to change the default root device, video mode, If you ever need to change the default root device, video mode,
ramdisk size, etc. in the kernel image, use the ``rdev`` program (or etc. in the kernel image, use your bootloader's boot options
alternatively the LILO boot options when appropriate). No need to where appropriate. No need to recompile the kernel to change
recompile the kernel to change these parameters. these parameters.
- Reboot with the new kernel and enjoy. - Reboot with the new kernel and enjoy.
......
...@@ -5,11 +5,14 @@ A block layer cache (bcache) ...@@ -5,11 +5,14 @@ A block layer cache (bcache)
Say you've got a big slow raid 6, and an ssd or three. Wouldn't it be Say you've got a big slow raid 6, and an ssd or three. Wouldn't it be
nice if you could use them as cache... Hence bcache. nice if you could use them as cache... Hence bcache.
Wiki and git repositories are at: The bcache wiki can be found at:
https://bcache.evilpiepirate.org
- https://bcache.evilpiepirate.org This is the git repository of bcache-tools:
- http://evilpiepirate.org/git/linux-bcache.git https://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git/
- https://evilpiepirate.org/git/bcache-tools.git
The latest bcache kernel code can be found from mainline Linux kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
It's designed around the performance characteristics of SSDs - it only allocates It's designed around the performance characteristics of SSDs - it only allocates
in erase block sized buckets, and it uses a hybrid btree/log to track cached in erase block sized buckets, and it uses a hybrid btree/log to track cached
...@@ -41,17 +44,21 @@ in the cache it first disables writeback caching and waits for all dirty data ...@@ -41,17 +44,21 @@ in the cache it first disables writeback caching and waits for all dirty data
to be flushed. to be flushed.
Getting started: Getting started:
You'll need make-bcache from the bcache-tools repository. Both the cache device You'll need bcache util from the bcache-tools repository. Both the cache device
and backing device must be formatted before use:: and backing device must be formatted before use::
make-bcache -B /dev/sdb bcache make -B /dev/sdb
make-bcache -C /dev/sdc bcache make -C /dev/sdc
make-bcache has the ability to format multiple devices at the same time - if `bcache make` has the ability to format multiple devices at the same time - if
you format your backing devices and cache device at the same time, you won't you format your backing devices and cache device at the same time, you won't
have to manually attach:: have to manually attach::
make-bcache -B /dev/sda /dev/sdb -C /dev/sdc bcache make -B /dev/sda /dev/sdb -C /dev/sdc
If your bcache-tools is not updated to latest version and does not have the
unified `bcache` utility, you may use the legacy `make-bcache` utility to format
bcache device with same -B and -C parameters.
bcache-tools now ships udev rules, and bcache devices are known to the kernel bcache-tools now ships udev rules, and bcache devices are known to the kernel
immediately. Without udev, you can manually register devices like this:: immediately. Without udev, you can manually register devices like this::
...@@ -188,7 +195,7 @@ D) Recovering data without bcache: ...@@ -188,7 +195,7 @@ D) Recovering data without bcache:
If bcache is not available in the kernel, a filesystem on the backing If bcache is not available in the kernel, a filesystem on the backing
device is still available at an 8KiB offset. So either via a loopdev device is still available at an 8KiB offset. So either via a loopdev
of the backing device created with --offset 8K, or any value defined by of the backing device created with --offset 8K, or any value defined by
--data-offset when you originally formatted bcache with `make-bcache`. --data-offset when you originally formatted bcache with `bcache make`.
For example:: For example::
...@@ -210,7 +217,7 @@ E) Wiping a cache device ...@@ -210,7 +217,7 @@ E) Wiping a cache device
After you boot back with bcache enabled, you recreate the cache and attach it:: After you boot back with bcache enabled, you recreate the cache and attach it::
host:~# make-bcache -C /dev/sdh2 host:~# bcache make -C /dev/sdh2
UUID: 7be7e175-8f4c-4f99-94b2-9c904d227045 UUID: 7be7e175-8f4c-4f99-94b2-9c904d227045
Set UUID: 5bc072a8-ab17-446d-9744-e247949913c1 Set UUID: 5bc072a8-ab17-446d-9744-e247949913c1
version: 0 version: 0
...@@ -318,7 +325,7 @@ want for getting the best possible numbers when benchmarking. ...@@ -318,7 +325,7 @@ want for getting the best possible numbers when benchmarking.
The default metadata size in bcache is 8k. If your backing device is The default metadata size in bcache is 8k. If your backing device is
RAID based, then be sure to align this by a multiple of your stride RAID based, then be sure to align this by a multiple of your stride
width using `make-bcache --data-offset`. If you intend to expand your width using `bcache make --data-offset`. If you intend to expand your
disk array in the future, then multiply a series of primes by your disk array in the future, then multiply a series of primes by your
raid stripe size to get the disk multiples that you would like. raid stripe size to get the disk multiples that you would like.
......
...@@ -6,7 +6,7 @@ Using the RAM disk block device with Linux ...@@ -6,7 +6,7 @@ Using the RAM disk block device with Linux
1) Overview 1) Overview
2) Kernel Command Line Parameters 2) Kernel Command Line Parameters
3) Using "rdev -r" 3) Using "rdev"
4) An Example of Creating a Compressed RAM Disk 4) An Example of Creating a Compressed RAM Disk
...@@ -59,51 +59,27 @@ default is 4096 (4 MB). ...@@ -59,51 +59,27 @@ default is 4096 (4 MB).
rd_size rd_size
See ramdisk_size. See ramdisk_size.
3) Using "rdev -r" 3) Using "rdev"
------------------ ---------------
The usage of the word (two bytes) that "rdev -r" sets in the kernel image is "rdev" is an obsolete, deprecated, antiquated utility that could be used
as follows. The low 11 bits (0 -> 10) specify an offset (in 1 k blocks) of up to set the boot device in a Linux kernel image.
to 2 MB (2^11) of where to find the RAM disk (this used to be the size). Bit
14 indicates that a RAM disk is to be loaded, and bit 15 indicates whether a
prompt/wait sequence is to be given before trying to read the RAM disk. Since
the RAM disk dynamically grows as data is being written into it, a size field
is not required. Bits 11 to 13 are not currently used and may as well be zero.
These numbers are no magical secrets, as seen below::
./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF Instead of using rdev, just place the boot device information on the
./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000 kernel command line and pass it to the kernel from the bootloader.
./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000
Consider a typical two floppy disk setup, where you will have the You can also pass arguments to the kernel by setting FDARGS in
kernel on disk one, and have already put a RAM disk image onto disk #2. arch/x86/boot/Makefile and specify in initrd image by setting FDINITRD in
arch/x86/boot/Makefile.
Hence you want to set bits 0 to 13 as 0, meaning that your RAM disk Some of the kernel command line boot options that may apply here are::
starts at an offset of 0 kB from the beginning of the floppy.
The command line equivalent is: "ramdisk_start=0"
You want bit 14 as one, indicating that a RAM disk is to be loaded. ramdisk_start=N
The command line equivalent is: "load_ramdisk=1" ramdisk_size=M
You want bit 15 as one, indicating that you want a prompt/keypress
sequence so that you have a chance to switch floppy disks.
The command line equivalent is: "prompt_ramdisk=1"
Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word.
So to create disk one of the set, you would do::
/usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0
/usr/src/linux# rdev /dev/fd0 /dev/fd0
/usr/src/linux# rdev -r /dev/fd0 49152
If you make a boot disk that has LILO, then for the above, you would use:: If you make a boot disk that has LILO, then for the above, you would use::
append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1" append = "ramdisk_start=N ramdisk_size=M"
Since the default start = 0 and the default prompt = 1, you could use::
append = "load_ramdisk=1"
4) An Example of Creating a Compressed RAM Disk 4) An Example of Creating a Compressed RAM Disk
----------------------------------------------- -----------------------------------------------
...@@ -151,12 +127,9 @@ f) Put the RAM disk image onto the floppy, after the kernel. Use an offset ...@@ -151,12 +127,9 @@ f) Put the RAM disk image onto the floppy, after the kernel. Use an offset
dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400
g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc. g) Make sure that you have already specified the boot information in
For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would FDARGS and FDINITRD or that you use a bootloader to pass kernel
have 2^15 + 2^14 + 400 = 49552:: command line boot options to the kernel.
rdev /dev/fd0 /dev/fd0
rdev -r /dev/fd0 49552
That is it. You now have your boot/root compressed RAM disk floppy. Some That is it. You now have your boot/root compressed RAM disk floppy. Some
users may wish to combine steps (d) and (f) by using a pipe. users may wish to combine steps (d) and (f) by using a pipe.
...@@ -167,11 +140,14 @@ users may wish to combine steps (d) and (f) by using a pipe. ...@@ -167,11 +140,14 @@ users may wish to combine steps (d) and (f) by using a pipe.
Changelog: Changelog:
---------- ----------
SEPT-2020 :
Removed usage of "rdev"
10-22-04 : 10-22-04 :
Updated to reflect changes in command line options, remove Updated to reflect changes in command line options, remove
obsolete references, general cleanup. obsolete references, general cleanup.
James Nelson (james4765@gmail.com) James Nelson (james4765@gmail.com)
12-95 : 12-95 :
Original Document Original Document
.. _cpusets:
======= =======
CPUSETS CPUSETS
======= =======
......
...@@ -509,9 +509,12 @@ ELF32-format headers using the --elf32-core-headers kernel option on the ...@@ -509,9 +509,12 @@ ELF32-format headers using the --elf32-core-headers kernel option on the
dump kernel. dump kernel.
You can also use the Crash utility to analyze dump files in Kdump You can also use the Crash utility to analyze dump files in Kdump
format. Crash is available on Dave Anderson's site at the following URL: format. Crash is available at the following URL:
http://people.redhat.com/~anderson/ https://github.com/crash-utility/crash
Crash document can be found at:
https://crash-utility.github.io/
Trigger Kdump on WARN() Trigger Kdump on WARN()
======================= =======================
......
...@@ -591,7 +591,7 @@ ...@@ -591,7 +591,7 @@
some critical bits. some critical bits.
cma=nn[MG]@[start[MG][-end[MG]]] cma=nn[MG]@[start[MG][-end[MG]]]
[ARM,X86,KNL] [KNL,CMA]
Sets the size of kernel global memory area for Sets the size of kernel global memory area for
contiguous memory allocations and optionally the contiguous memory allocations and optionally the
placement constraint by the physical address range of placement constraint by the physical address range of
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
Arch Perfmon v4 (Skylake and newer). Arch Perfmon v4 (Skylake and newer).
disable_ddw [PPC/PSERIES] disable_ddw [PPC/PSERIES]
Disable Dynamic DMA Window support. Use this if Disable Dynamic DMA Window support. Use this
to workaround buggy firmware. to workaround buggy firmware.
disable_ipv6= [IPV6] disable_ipv6= [IPV6]
...@@ -1019,7 +1019,7 @@ ...@@ -1019,7 +1019,7 @@
what data is available or for reverse-engineering. what data is available or for reverse-engineering.
dyndbg[="val"] [KNL,DYNAMIC_DEBUG] dyndbg[="val"] [KNL,DYNAMIC_DEBUG]
module.dyndbg[="val"] <module>.dyndbg[="val"]
Enable debug messages at boot time. See Enable debug messages at boot time. See
Documentation/admin-guide/dynamic-debug-howto.rst Documentation/admin-guide/dynamic-debug-howto.rst
for details. for details.
...@@ -1027,7 +1027,7 @@ ...@@ -1027,7 +1027,7 @@
nopku [X86] Disable Memory Protection Keys CPU feature found nopku [X86] Disable Memory Protection Keys CPU feature found
in some Intel CPUs. in some Intel CPUs.
module.async_probe [KNL] <module>.async_probe [KNL]
Enable asynchronous probe on this module. Enable asynchronous probe on this module.
early_ioremap_debug [KNL] early_ioremap_debug [KNL]
...@@ -1956,7 +1956,7 @@ ...@@ -1956,7 +1956,7 @@
1 - Bypass the IOMMU for DMA. 1 - Bypass the IOMMU for DMA.
unset - Use value of CONFIG_IOMMU_DEFAULT_PASSTHROUGH. unset - Use value of CONFIG_IOMMU_DEFAULT_PASSTHROUGH.
io7= [HW] IO7 for Marvel based alpha systems io7= [HW] IO7 for Marvel-based Alpha systems
See comment before marvel_specify_io7 in See comment before marvel_specify_io7 in
arch/alpha/kernel/core_marvel.c. arch/alpha/kernel/core_marvel.c.
...@@ -2177,7 +2177,7 @@ ...@@ -2177,7 +2177,7 @@
kgdbwait [KGDB] Stop kernel execution and enter the kgdbwait [KGDB] Stop kernel execution and enter the
kernel debugger at the earliest opportunity. kernel debugger at the earliest opportunity.
kmac= [MIPS] korina ethernet MAC address. kmac= [MIPS] Korina ethernet MAC address.
Configure the RouterBoard 532 series on-chip Configure the RouterBoard 532 series on-chip
Ethernet adapter MAC address. Ethernet adapter MAC address.
...@@ -2258,6 +2258,14 @@ ...@@ -2258,6 +2258,14 @@
[KVM,ARM] Allow use of GICv4 for direct injection of [KVM,ARM] Allow use of GICv4 for direct injection of
LPIs. LPIs.
kvm_cma_resv_ratio=n [PPC]
Reserves given percentage from system memory area for
contiguous memory allocation for KVM hash pagetable
allocation.
By default it reserves 5% of total system memory.
Format: <integer>
Default: 5
kvm-intel.ept= [KVM,Intel] Disable extended page tables kvm-intel.ept= [KVM,Intel] Disable extended page tables
(virtualized MMU) support on capable Intel chips. (virtualized MMU) support on capable Intel chips.
Default is 1 (enabled) Default is 1 (enabled)
...@@ -2367,9 +2375,10 @@ ...@@ -2367,9 +2375,10 @@
lapic [X86-32,APIC] Enable the local APIC even if BIOS lapic [X86-32,APIC] Enable the local APIC even if BIOS
disabled it. disabled it.
lapic= [X86,APIC] "notscdeadline" Do not use TSC deadline lapic= [X86,APIC] Do not use TSC deadline
value for LAPIC timer one-shot implementation. Default value for LAPIC timer one-shot implementation. Default
back to the programmable timer unit in the LAPIC. back to the programmable timer unit in the LAPIC.
Format: notscdeadline
lapic_timer_c2_ok [X86,APIC] trust the local apic timer lapic_timer_c2_ok [X86,APIC] trust the local apic timer
in C2 power state. in C2 power state.
...@@ -2441,8 +2450,7 @@ ...@@ -2441,8 +2450,7 @@
memblock=debug [KNL] Enable memblock debug messages. memblock=debug [KNL] Enable memblock debug messages.
load_ramdisk= [RAM] List of ramdisks to load from floppy load_ramdisk= [RAM] [Deprecated]
See Documentation/admin-guide/blockdev/ramdisk.rst.
lockd.nlm_grace_period=P [NFS] Assign grace period. lockd.nlm_grace_period=P [NFS] Assign grace period.
Format: <integer> Format: <integer>
...@@ -2579,8 +2587,8 @@ ...@@ -2579,8 +2587,8 @@
(machvec) in a generic kernel. (machvec) in a generic kernel.
Example: machvec=hpzx1 Example: machvec=hpzx1
machtype= [Loongson] Share the same kernel image file between different machtype= [Loongson] Share the same kernel image file between
yeeloong laptop. different yeeloong laptops.
Example: machtype=lemote-yeeloong-2f-7inch Example: machtype=lemote-yeeloong-2f-7inch
max_addr=nn[KMG] [KNL,BOOT,ia64] All physical memory greater max_addr=nn[KMG] [KNL,BOOT,ia64] All physical memory greater
...@@ -3185,7 +3193,7 @@ ...@@ -3185,7 +3193,7 @@
register save and restore. The kernel will only save register save and restore. The kernel will only save
legacy floating-point registers on task switch. legacy floating-point registers on task switch.
nohugeiomap [KNL,X86,PPC] Disable kernel huge I/O mappings. nohugeiomap [KNL,X86,PPC,ARM64] Disable kernel huge I/O mappings.
nosmt [KNL,S390] Disable symmetric multithreading (SMT). nosmt [KNL,S390] Disable symmetric multithreading (SMT).
Equivalent to smt=1. Equivalent to smt=1.
...@@ -3921,9 +3929,7 @@ ...@@ -3921,9 +3929,7 @@
Param: <number> - step/bucket size as a power of 2 for Param: <number> - step/bucket size as a power of 2 for
statistical time based profiling. statistical time based profiling.
prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk prompt_ramdisk= [RAM] [Deprecated]
before loading.
See Documentation/admin-guide/blockdev/ramdisk.rst.
prot_virt= [S390] enable hosting protected virtual machines prot_virt= [S390] enable hosting protected virtual machines
isolated from the hypervisor (if hardware supports isolated from the hypervisor (if hardware supports
...@@ -3981,6 +3987,8 @@ ...@@ -3981,6 +3987,8 @@
ramdisk_size= [RAM] Sizes of RAM disks in kilobytes ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
See Documentation/admin-guide/blockdev/ramdisk.rst. See Documentation/admin-guide/blockdev/ramdisk.rst.
ramdisk_start= [RAM] RAM disk image start address
random.trust_cpu={on,off} random.trust_cpu={on,off}
[KNL] Enable or disable trusting the use of the [KNL] Enable or disable trusting the use of the
CPU's random number generator (if available) to CPU's random number generator (if available) to
......
...@@ -12,7 +12,8 @@ Intro ...@@ -12,7 +12,8 @@ Intro
This small document describes the "Video Mode Selection" feature which This small document describes the "Video Mode Selection" feature which
allows the use of various special video modes supported by the video BIOS. Due allows the use of various special video modes supported by the video BIOS. Due
to usage of the BIOS, the selection is limited to boot time (before the to usage of the BIOS, the selection is limited to boot time (before the
kernel decompression starts) and works only on 80X86 machines. kernel decompression starts) and works only on 80X86 machines that are
booted through BIOS firmware (as opposed to through UEFI, kexec, etc.).
.. note:: .. note::
...@@ -23,7 +24,7 @@ kernel decompression starts) and works only on 80X86 machines. ...@@ -23,7 +24,7 @@ kernel decompression starts) and works only on 80X86 machines.
The video mode to be used is selected by a kernel parameter which can be The video mode to be used is selected by a kernel parameter which can be
specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..." specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..."
option of LILO (or some other boot loader you use) or by the "vidmode" utility option of LILO (or some other boot loader you use) or by the "xrandr" utility
(present in standard Linux utility packages). You can use the following values (present in standard Linux utility packages). You can use the following values
of this parameter:: of this parameter::
...@@ -41,7 +42,7 @@ of this parameter:: ...@@ -41,7 +42,7 @@ of this parameter::
better to use absolute mode numbers instead. better to use absolute mode numbers instead.
0x.... - Hexadecimal video mode ID (also displayed on the menu, see below 0x.... - Hexadecimal video mode ID (also displayed on the menu, see below
for exact meaning of the ID). Warning: rdev and LILO don't support for exact meaning of the ID). Warning: LILO doesn't support
hexadecimal numbers -- you have to convert it to decimal manually. hexadecimal numbers -- you have to convert it to decimal manually.
Menu Menu
......
.. SPDX-License-Identifier: GPL-2.0+
================================ ================================
Documentation for /proc/sys/abi/ Documentation for /proc/sys/abi/
================================ ================================
kernel version 2.6.0.test2 .. See scripts/check-sysctl-docs to keep this up to date:
.. scripts/check-sysctl-docs -vtable="abi" \
.. Documentation/admin-guide/sysctl/abi.rst \
.. $(git grep -l register_sysctl_)
Copyright (c) 2003, Fabian Frederick <ffrederick@users.sourceforge.net> Copyright (c) 2020, Stephen Kitt
For general info: index.rst. For general info, see :doc:`index`.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
This path is binary emulation relevant aka personality types aka abi. The files in ``/proc/sys/abi`` can be used to see and modify
When a process is executed, it's linked to an exec_domain whose ABI-related settings.
personality is defined using values available from /proc/sys/abi.
You can find further details about abi in include/linux/personality.h.
Here are the files featuring in 2.6 kernel:
- defhandler_coff
- defhandler_elf
- defhandler_lcall7
- defhandler_libcso
- fake_utsname
- trace
defhandler_coff
---------------
defined value:
PER_SCOSVR3::
0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE
defhandler_elf
--------------
defined value:
PER_LINUX::
0
defhandler_lcall7
-----------------
defined value :
PER_SVR4::
0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
defhandler_libsco
-----------------
defined value:
PER_SVR4::
0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, Currently, these files might (depending on your configuration)
show up in ``/proc/sys/kernel``:
fake_utsname .. contents:: :local:
------------
Unused vsyscall32 (x86)
================
trace Determines whether the kernels maps a vDSO page into 32-bit processes;
----- can be set to 1 to enable, or 0 to disable. Defaults to enabled if
``CONFIG_COMPAT_VDSO`` is set, disabled otherwide.
Unused This controls the same setting as the ``vdso32`` kernel boot
parameter.
...@@ -130,7 +130,7 @@ More detailed explanation for tainting ...@@ -130,7 +130,7 @@ More detailed explanation for tainting
5) ``B`` If a page-release function has found a bad page reference or some 5) ``B`` If a page-release function has found a bad page reference or some
unexpected page flags. This indicates a hardware problem or a kernel bug; unexpected page flags. This indicates a hardware problem or a kernel bug;
there should be other information in the log indicating why this tainting there should be other information in the log indicating why this tainting
occured. occurred.
6) ``U`` if a user or user application specifically requested that the 6) ``U`` if a user or user application specifically requested that the
Tainted flag be set, ``' '`` otherwise. Tainted flag be set, ``' '`` otherwise.
......
...@@ -108,7 +108,7 @@ SunXi family ...@@ -108,7 +108,7 @@ SunXi family
* Datasheet * Datasheet
http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf https://linux-sunxi.org/images/4/4b/Allwinner_H3_Datasheet_V1.2.pdf
- Allwinner R40 (sun8i) - Allwinner R40 (sun8i)
......
.. _amu_index:
======================================================= =======================================================
Activity Monitors Unit (AMU) extension in AArch64 Linux Activity Monitors Unit (AMU) extension in AArch64 Linux
======================================================= =======================================================
......
.. _arm64_index:
================== ==================
ARM64 Architecture ARM64 Architecture
================== ==================
......
...@@ -36,10 +36,23 @@ needs_sphinx = '1.3' ...@@ -36,10 +36,23 @@ needs_sphinx = '1.3'
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain', extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
'kfigure', 'sphinx.ext.ifconfig', 'automarkup', 'kfigure', 'sphinx.ext.ifconfig', 'automarkup',
'maintainers_include', 'sphinx.ext.autosectionlabel' ] 'maintainers_include', 'sphinx.ext.autosectionlabel' ]
#
# cdomain is badly broken in Sphinx 3+. Leaving it out generates *most*
# of the docs correctly, but not all. Scream bloody murder but allow
# the process to proceed; hopefully somebody will fix this properly soon.
#
if major >= 3:
sys.stderr.write('''WARNING: The kernel documentation build process
does not work correctly with Sphinx v3.0 and above. Expect errors
in the generated output.
''')
else:
extensions.append('cdomain')
# Ensure that autosectionlabel will produce unique names # Ensure that autosectionlabel will produce unique names
autosectionlabel_prefix_document = True autosectionlabel_prefix_document = True
autosectionlabel_maxdepth = 2 autosectionlabel_maxdepth = 2
......
...@@ -30,7 +30,7 @@ which didn't support these methods. ...@@ -30,7 +30,7 @@ which didn't support these methods.
Command Line Switches Command Line Switches
===================== =====================
``maxcpus=n`` ``maxcpus=n``
Restrict boot time CPUs to *n*. Say if you have fourV CPUs, using Restrict boot time CPUs to *n*. Say if you have four CPUs, using
``maxcpus=2`` will only boot two. You can choose to bring the ``maxcpus=2`` will only boot two. You can choose to bring the
other CPUs later online. other CPUs later online.
......
...@@ -387,22 +387,23 @@ Domain`_ references. ...@@ -387,22 +387,23 @@ Domain`_ references.
Cross-referencing from reStructuredText Cross-referencing from reStructuredText
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To cross-reference the functions and types defined in the kernel-doc comments No additional syntax is needed to cross-reference the functions and types
from reStructuredText documents, please use the `Sphinx C Domain`_ defined in the kernel-doc comments from reStructuredText documents.
references. For example:: Just end function names with ``()`` and write ``struct``, ``union``, ``enum``
or ``typedef`` before types.
See function :c:func:`foo` and struct/union/enum/typedef :c:type:`bar`. For example::
While the type reference works with just the type name, without the See foo().
struct/union/enum/typedef part in front, you may want to use:: See struct foo.
See union bar.
See :c:type:`struct foo <foo>`. See enum baz.
See :c:type:`union bar <bar>`. See typedef meh.
See :c:type:`enum baz <baz>`.
See :c:type:`typedef meh <meh>`. However, if you want custom text in the cross-reference link, that can be done
through the following syntax::
This will produce prettier links, and is in line with how kernel-doc does the
cross-references. See :c:func:`my custom link text for function foo <foo>`.
See :c:type:`my custom link text for struct bar <bar>`.
For further details, please refer to the `Sphinx C Domain`_ documentation. For further details, please refer to the `Sphinx C Domain`_ documentation.
......
...@@ -337,6 +337,23 @@ Rendered as: ...@@ -337,6 +337,23 @@ Rendered as:
- column 3 - column 3
Cross-referencing
-----------------
Cross-referencing from one documentation page to another can be done by passing
the path to the file starting from the Documentation folder.
For example, to cross-reference to this page (the .rst extension is optional)::
See Documentation/doc-guide/sphinx.rst.
If you want to use a relative path, you need to use Sphinx's ``doc`` directive.
For example, referencing this page from the same directory would be done as::
See :doc:`sphinx`.
For information on cross-referencing to kernel-doc functions or types, see
Documentation/doc-guide/kernel-doc.rst.
.. _sphinx_kfigure: .. _sphinx_kfigure:
Figures & Images Figures & Images
......
...@@ -85,7 +85,7 @@ consider though: ...@@ -85,7 +85,7 @@ consider though:
- Memory mapping the contents of the DMA buffer is also supported. See the - Memory mapping the contents of the DMA buffer is also supported. See the
discussion below on `CPU Access to DMA Buffer Objects`_ for the full details. discussion below on `CPU Access to DMA Buffer Objects`_ for the full details.
- The DMA buffer FD is also pollable, see `Fence Poll Support`_ below for - The DMA buffer FD is also pollable, see `Implicit Fence Poll Support`_ below for
details. details.
Basic Operation and Device DMA Access Basic Operation and Device DMA Access
......
...@@ -342,12 +342,12 @@ Cascaded GPIO irqchips usually fall in one of three categories: ...@@ -342,12 +342,12 @@ Cascaded GPIO irqchips usually fall in one of three categories:
forced to a thread. The "fake?" raw lock can be used to work around this forced to a thread. The "fake?" raw lock can be used to work around this
problem:: problem::
raw_spinlock_t wa_lock; raw_spinlock_t wa_lock;
static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank) static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
unsigned long wa_lock_flags; unsigned long wa_lock_flags;
raw_spin_lock_irqsave(&bank->wa_lock, wa_lock_flags); raw_spin_lock_irqsave(&bank->wa_lock, wa_lock_flags);
generic_handle_irq(irq_find_mapping(bank->chip.irq.domain, bit)); generic_handle_irq(irq_find_mapping(bank->chip.irq.domain, bit));
raw_spin_unlock_irqrestore(&bank->wa_lock, wa_lock_flags); raw_spin_unlock_irqrestore(&bank->wa_lock, wa_lock_flags);
- GENERIC CHAINED GPIO IRQCHIPS: these are the same as "CHAINED GPIO irqchips", - GENERIC CHAINED GPIO IRQCHIPS: these are the same as "CHAINED GPIO irqchips",
but chained IRQ handlers are not used. Instead GPIO IRQs dispatching is but chained IRQ handlers are not used. Instead GPIO IRQs dispatching is
......
...@@ -10,3 +10,4 @@ Non-Volatile Memory Device (NVDIMM) ...@@ -10,3 +10,4 @@ Non-Volatile Memory Device (NVDIMM)
nvdimm nvdimm
btt btt
security security
firmware-activate
...@@ -518,10 +518,10 @@ typically called during a dailink .shutdown() callback, which clears ...@@ -518,10 +518,10 @@ typically called during a dailink .shutdown() callback, which clears
the stream pointer for all DAIS connected to a stream and releases the the stream pointer for all DAIS connected to a stream and releases the
memory allocated for the stream. memory allocated for the stream.
Not Supported Not Supported
============= =============
1. A single port with multiple channels supported cannot be used between two 1. A single port with multiple channels supported cannot be used between two
streams or across stream. For example a port with 4 channels cannot be used streams or across stream. For example a port with 4 channels cannot be used
to handle 2 independent stereo streams even though it's possible in theory to handle 2 independent stereo streams even though it's possible in theory
in SoundWire. in SoundWire.
...@@ -87,15 +87,8 @@ C. Boot options ...@@ -87,15 +87,8 @@ C. Boot options
Note, not all drivers can handle font with widths not divisible by 8, Note, not all drivers can handle font with widths not divisible by 8,
such as vga16fb. such as vga16fb.
2. fbcon=scrollback:<value>[k]
The scrollback buffer is memory that is used to preserve display 2. fbcon=map:<0123>
contents that has already scrolled past your view. This is accessed
by using the Shift-PageUp key combination. The value 'value' is any
integer. It defaults to 32KB. The 'k' suffix is optional, and will
multiply the 'value' by 1024.
3. fbcon=map:<0123>
This is an interesting option. It tells which driver gets mapped to This is an interesting option. It tells which driver gets mapped to
which console. The value '0123' is a sequence that gets repeated until which console. The value '0123' is a sequence that gets repeated until
...@@ -116,7 +109,7 @@ C. Boot options ...@@ -116,7 +109,7 @@ C. Boot options
Later on, when you want to map the console the to the framebuffer Later on, when you want to map the console the to the framebuffer
device, you can use the con2fbmap utility. device, you can use the con2fbmap utility.
4. fbcon=vc:<n1>-<n2> 3. fbcon=vc:<n1>-<n2>
This option tells fbcon to take over only a range of consoles as This option tells fbcon to take over only a range of consoles as
specified by the values 'n1' and 'n2'. The rest of the consoles specified by the values 'n1' and 'n2'. The rest of the consoles
...@@ -127,7 +120,7 @@ C. Boot options ...@@ -127,7 +120,7 @@ C. Boot options
is typically located on the same video card. Thus, the consoles that is typically located on the same video card. Thus, the consoles that
are controlled by the VGA console will be garbled. are controlled by the VGA console will be garbled.
5. fbcon=rotate:<n> 4. fbcon=rotate:<n>
This option changes the orientation angle of the console display. The This option changes the orientation angle of the console display. The
value 'n' accepts the following: value 'n' accepts the following:
...@@ -152,21 +145,21 @@ C. Boot options ...@@ -152,21 +145,21 @@ C. Boot options
Actually, the underlying fb driver is totally ignorant of console Actually, the underlying fb driver is totally ignorant of console
rotation. rotation.
6. fbcon=margin:<color> 5. fbcon=margin:<color>
This option specifies the color of the margins. The margins are the This option specifies the color of the margins. The margins are the
leftover area at the right and the bottom of the screen that are not leftover area at the right and the bottom of the screen that are not
used by text. By default, this area will be black. The 'color' value used by text. By default, this area will be black. The 'color' value
is an integer number that depends on the framebuffer driver being used. is an integer number that depends on the framebuffer driver being used.
7. fbcon=nodefer 6. fbcon=nodefer
If the kernel is compiled with deferred fbcon takeover support, normally If the kernel is compiled with deferred fbcon takeover support, normally
the framebuffer contents, left in place by the firmware/bootloader, will the framebuffer contents, left in place by the firmware/bootloader, will
be preserved until there actually is some text is output to the console. be preserved until there actually is some text is output to the console.
This option causes fbcon to bind immediately to the fbdev device. This option causes fbcon to bind immediately to the fbdev device.
8. fbcon=logo-pos:<location> 7. fbcon=logo-pos:<location>
The only possible 'location' is 'center' (without quotes), and when The only possible 'location' is 'center' (without quotes), and when
given, the bootup logo is moved from the default top-left corner given, the bootup logo is moved from the default top-left corner
...@@ -174,7 +167,7 @@ C. Boot options ...@@ -174,7 +167,7 @@ C. Boot options
displayed due to multiple CPUs, the collected line of logos is moved displayed due to multiple CPUs, the collected line of logos is moved
as a whole. as a whole.
9. fbcon=logo-count:<n> 8. fbcon=logo-count:<n>
The value 'n' overrides the number of bootup logos. 0 disables the The value 'n' overrides the number of bootup logos. 0 disables the
logo, and -1 gives the default which is the number of online CPUs. logo, and -1 gives the default which is the number of online CPUs.
......
...@@ -317,8 +317,6 @@ Currently there are following known bugs: ...@@ -317,8 +317,6 @@ Currently there are following known bugs:
- interlaced text mode is not supported; it looks like hardware limitation, - interlaced text mode is not supported; it looks like hardware limitation,
but I'm not sure. but I'm not sure.
- Gxx0 SGRAM/SDRAM is not autodetected. - Gxx0 SGRAM/SDRAM is not autodetected.
- If you are using more than one framebuffer device, you must boot kernel
with 'video=scrollback:0'.
- maybe more... - maybe more...
And following misfeatures: And following misfeatures:
......
...@@ -185,9 +185,6 @@ Bugs ...@@ -185,9 +185,6 @@ Bugs
contact me. contact me.
- The 24/32 is not likely to work anytime soon, knowing that the - The 24/32 is not likely to work anytime soon, knowing that the
hardware does ... unusual things in 24/32 bpp. hardware does ... unusual things in 24/32 bpp.
- When used with another video board, current limitations of the linux
console subsystem can cause some troubles, specifically, you should
disable software scrollback, as it can oops badly ...
Todo Todo
==== ====
......
...@@ -135,8 +135,6 @@ ypan enable display panning using the VESA protected mode ...@@ -135,8 +135,6 @@ ypan enable display panning using the VESA protected mode
* scrolling (fullscreen) is fast, because there is * scrolling (fullscreen) is fast, because there is
no need to copy around data. no need to copy around data.
* You'll get scrollback (the Shift-PgUp thing),
the video memory can be used as scrollback buffer
kontra: kontra:
......
...@@ -34,8 +34,6 @@ algorithms work. ...@@ -34,8 +34,6 @@ algorithms work.
quota quota
seq_file seq_file
sharedsubtree sharedsubtree
sysfs-pci
sysfs-tagging
automount-support automount-support
......
.. SPDX-License-Identifier: GPL-2.0 .. SPDX-License-Identifier: GPL-2.0
==================== ====================
fILESYSTEM Mount API Filesystem Mount API
==================== ====================
.. CONTENTS .. CONTENTS
...@@ -479,7 +479,7 @@ returned. ...@@ -479,7 +479,7 @@ returned.
int vfs_parse_fs_param(struct fs_context *fc, int vfs_parse_fs_param(struct fs_context *fc,
struct fs_parameter *param); struct fs_parameter *param);
Supply a single mount parameter to the filesystem context. This include Supply a single mount parameter to the filesystem context. This includes
the specification of the source/device which is specified as the "source" the specification of the source/device which is specified as the "source"
parameter (which may be specified multiple times if the filesystem parameter (which may be specified multiple times if the filesystem
supports that). supports that).
...@@ -592,8 +592,7 @@ The following helpers all wrap sget_fc(): ...@@ -592,8 +592,7 @@ The following helpers all wrap sget_fc():
one. one.
===================== Parameter Description
PARAMETER DESCRIPTION
===================== =====================
Parameters are described using structures defined in linux/fs_parser.h. Parameters are described using structures defined in linux/fs_parser.h.
......
...@@ -129,7 +129,9 @@ also a special value which can be returned by the start() function ...@@ -129,7 +129,9 @@ also a special value which can be returned by the start() function
called SEQ_START_TOKEN; it can be used if you wish to instruct your called SEQ_START_TOKEN; it can be used if you wish to instruct your
show() function (described below) to print a header at the top of the show() function (described below) to print a header at the top of the
output. SEQ_START_TOKEN should only be used if the offset is zero, output. SEQ_START_TOKEN should only be used if the offset is zero,
however. however. SEQ_START_TOKEN has no special meaning to the core seq_file
code. It is provided as a convenience for a start() funciton to
communicate with the next() and show() functions.
The next function to implement is called, amazingly, next(); its job is to The next function to implement is called, amazingly, next(); its job is to
move the iterator forward to the next position in the sequence. The move the iterator forward to the next position in the sequence. The
...@@ -145,6 +147,22 @@ complete. Here's the example version:: ...@@ -145,6 +147,22 @@ complete. Here's the example version::
return spos; return spos;
} }
The next() function should set ``*pos`` to a value that start() can use
to find the new location in the sequence. When the iterator is being
stored in the private data area, rather than being reinitialized on each
start(), it might seem sufficient to simply set ``*pos`` to any non-zero
value (zero always tells start() to restart the sequence). This is not
sufficient due to historical problems.
Historically, many next() functions have *not* updated ``*pos`` at
end-of-file. If the value is then used by start() to initialise the
iterator, this can result in corner cases where the last entry in the
sequence is reported twice in the file. In order to discourage this bug
from being resurrected, the core seq_file code now produces a warning if
a next() function does not change the value of ``*pos``. Consequently a
next() function *must* change the value of ``*pos``, and of course must
set it to a non-zero value.
The stop() function closes a session; its job, of course, is to clean The stop() function closes a session; its job, of course, is to clean
up. If dynamic memory is allocated for the iterator, stop() is the up. If dynamic memory is allocated for the iterator, stop() is the
place to free it; if a lock was taken by start(), stop() must release place to free it; if a lock was taken by start(), stop() must release
......
...@@ -172,14 +172,13 @@ calls the associated methods. ...@@ -172,14 +172,13 @@ calls the associated methods.
To illustrate:: To illustrate::
#define to_dev(obj) container_of(obj, struct device, kobj)
#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr) #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr, static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
char *buf) char *buf)
{ {
struct device_attribute *dev_attr = to_dev_attr(attr); struct device_attribute *dev_attr = to_dev_attr(attr);
struct device *dev = to_dev(kobj); struct device *dev = kobj_to_dev(kobj);
ssize_t ret = -EIO; ssize_t ret = -EIO;
if (dev_attr->show) if (dev_attr->show)
......
.. SPDX-License-Identifier: GPL-2.0 .. SPDX-License-Identifier: GPL-2.0
:orphan:
.. UBIFS Authentication .. UBIFS Authentication
.. sigma star gmbh .. sigma star gmbh
.. 2018 .. 2018
============================
UBIFS Authentication Support
============================
Introduction Introduction
============ ============
......
...@@ -26,3 +26,4 @@ ACPI Support ...@@ -26,3 +26,4 @@ ACPI Support
lpit lpit
video_extension video_extension
extcon-intel-int3496 extcon-intel-int3496
intel-pmc-mux
...@@ -158,6 +158,7 @@ Hardware Monitoring Kernel Drivers ...@@ -158,6 +158,7 @@ Hardware Monitoring Kernel Drivers
smsc47b397 smsc47b397
smsc47m192 smsc47m192
smsc47m1 smsc47m1
sparx5-temp
tc654 tc654
tc74 tc74
thmc50 thmc50
......
...@@ -15,4 +15,3 @@ IA-64 Architecture ...@@ -15,4 +15,3 @@ IA-64 Architecture
irq-redir irq-redir
mca mca
serial serial
xen
********************************************************
Recipe for getting/building/running Xen/ia64 with pv_ops
********************************************************
This recipe describes how to get xen-ia64 source and build it,
and run domU with pv_ops.
Requirements
============
- python
- mercurial
it (aka "hg") is an open-source source code
management software. See the below.
http://www.selenic.com/mercurial/wiki/
- git
- bridge-utils
Getting and Building Xen and Dom0
=================================
My environment is:
- Machine : Tiger4
- Domain0 OS : RHEL5
- DomainU OS : RHEL5
1. Download source::
# hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
# cd xen-unstable.hg
# hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
2. # make world
3. # make install-tools
4. copy kernels and xen::
# cp xen/xen.gz /boot/efi/efi/redhat/
# cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
/boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
5. make initrd for Dom0/DomU::
# make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
O=$(pwd)/build-linux-2.6.18-xen_ia64
# mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
2.6.18.8-xen --builtin mptspi --builtin mptbase \
--builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
--builtin ehci-hcd
Making a disk image for guest OS
================================
1. make file::
# dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
# mke2fs -F -j /root/rhel5.img
# mount -o loop /root/rhel5.img /mnt
# cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
# mkdir /mnt/{root,proc,sys,home,tmp}
Note: You may miss some device files. If so, please create them
with mknod. Or you can use tar instead of cp.
2. modify DomU's fstab::
# vi /mnt/etc/fstab
/dev/xvda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
3. modify inittab
set runlevel to 3 to avoid X trying to start::
# vi /mnt/etc/inittab
id:3:initdefault:
Start a getty on the hvc0 console::
X0:2345:respawn:/sbin/mingetty hvc0
tty1-6 mingetty can be commented out
4. add hvc0 into /etc/securetty::
# vi /mnt/etc/securetty (add hvc0)
5. umount::
# umount /mnt
FYI, virt-manager can also make a disk image for guest OS.
It's GUI tools and easy to make it.
Boot Xen & Domain0
==================
1. replace elilo
elilo of RHEL5 can boot Xen and Dom0.
If you use old elilo (e.g RHEL4), please download from the below
http://elilo.sourceforge.net/cgi-bin/blosxom
and copy into /boot/efi/efi/redhat/::
# cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
2. modify elilo.conf (like the below)::
# vi /boot/efi/efi/redhat/elilo.conf
prompt
timeout=20
default=xen
relocatable
image=vmlinuz-2.6.18.8-xen
label=xen
vmm=xen.gz
initrd=initrd-2.6.18.8-xen.img
read-only
append=" -- rhgb root=/dev/sda2"
The append options before "--" are for xen hypervisor,
the options after "--" are for dom0.
FYI, your machine may need console options like
"com1=19200,8n1 console=vga,com1". For example,
append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
console=ttyS0 root=/dev/sda2"
Getting and Building domU with pv_ops
=====================================
1. get pv_ops tree::
# git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
2. git branch (if necessary)::
# cd linux-2.6-xen-ia64/
# git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
Note:
The current branch is xen-ia64-domu-minimal-2008may19.
But you would find the new branch. You can see with
"git branch -r" to get the branch lists.
http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
is also available.
The tree is based on
git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
3. copy .config for pv_ops of domU::
# cp arch/ia64/configs/xen_domu_wip_defconfig .config
4. make kernel with pv_ops::
# make oldconfig
# make
5. install the kernel and initrd::
# cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
# make modules_install
# mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
--builtin mptbase --builtin mptscsih --builtin uhci-hcd \
--builtin ohci-hcd --builtin ehci-hcd
Boot DomainU with pv_ops
========================
1. make config of DomU::
# vi /etc/xen/rhel5
kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
vcpus = 1
memory = 512
name = "rhel5"
disk = [ 'file:/root/rhel5.img,xvda1,w' ]
root = "/dev/xvda1 ro"
extra= "rhgb console=hvc0"
2. After boot xen and dom0, start xend::
# /etc/init.d/xend start
( In the debugging case, `# XEND_DEBUG=1 xend trace_start` )
3. start domU::
# xm create -c rhel5
Reference
=========
- Wiki of Xen/IA64 upstream merge
http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008
...@@ -53,7 +53,7 @@ kernel module following the interface in include/linux/iio/sw_trigger.h:: ...@@ -53,7 +53,7 @@ kernel module following the interface in include/linux/iio/sw_trigger.h::
*/ */
} }
static int iio_trig_hrtimer_remove(struct iio_sw_trigger *swt) static int iio_trig_sample_remove(struct iio_sw_trigger *swt)
{ {
/* /*
* This undoes the actions in iio_trig_sample_probe * This undoes the actions in iio_trig_sample_probe
......
.. _kbuild_llvm:
============================== ==============================
Building Linux with Clang/LLVM Building Linux with Clang/LLVM
============================== ==============================
...@@ -73,6 +75,8 @@ Getting Help ...@@ -73,6 +75,8 @@ Getting Help
- `Wiki <https://github.com/ClangBuiltLinux/linux/wiki>`_ - `Wiki <https://github.com/ClangBuiltLinux/linux/wiki>`_
- `Beginner Bugs <https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_ - `Beginner Bugs <https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_
.. _getting_llvm:
Getting LLVM Getting LLVM
------------- -------------
......
...@@ -13,4 +13,5 @@ additions to this manual. ...@@ -13,4 +13,5 @@ additions to this manual.
rebasing-and-merging rebasing-and-merging
pull-requests pull-requests
maintainer-entry-profile maintainer-entry-profile
modifying-patches
.. _modifyingpatches:
Modifying Patches
=================
If you are a subsystem or branch maintainer, sometimes you need to slightly
modify patches you receive in order to merge them, because the code is not
exactly the same in your tree and the submitters'. If you stick strictly to
rule (c) of the developers certificate of origin, you should ask the submitter
to rediff, but this is a totally counter-productive waste of time and energy.
Rule (b) allows you to adjust the code, but then it is very impolite to change
one submitters code and make him endorse your bugs. To solve this problem, it
is recommended that you add a line between the last Signed-off-by header and
yours, indicating the nature of your changes. While there is nothing mandatory
about this, it seems like prepending the description with your mail and/or
name, all enclosed in square brackets, is noticeable enough to make it obvious
that you are responsible for last-minute changes. Example::
Signed-off-by: Random J Developer <random@developer.example.org>
[lucky@maintainer.example.org: struct foo moved from foo.c to foo.h]
Signed-off-by: Lucky K Maintainer <lucky@maintainer.example.org>
This practice is particularly helpful if you maintain a stable branch and
want at the same time to credit the author, track changes, merge the fix,
and protect the submitter from complaints. Note that under no circumstances
can you change the author's identity (the From header), as it is the one
which appears in the changelog.
Special note to back-porters: It seems to be a common and useful practice
to insert an indication of the origin of a patch at the top of the commit
message (just after the subject line) to facilitate tracking. For instance,
here's what we see in a 3.x-stable release::
Date: Tue Oct 7 07:26:38 2014 -0400
libata: Un-break ATA blacklist
commit 1c40279960bcd7d52dbdf1d466b20d24b99176c8 upstream.
And here's what might appear in an older kernel once a patch is backported::
Date: Tue May 13 22:12:27 2008 +0200
wireless, airo: waitbusy() won't delay
[backport of 2.6 commit b7acbdfbd1f277c1eb23f344f899cfa4cd0bf36a]
Whatever the format, this information provides a valuable help to people
tracking your trees, and to people trying to troubleshoot bugs in your
tree.
...@@ -546,8 +546,8 @@ There are certain things that the Linux kernel memory barriers do not guarantee: ...@@ -546,8 +546,8 @@ There are certain things that the Linux kernel memory barriers do not guarantee:
[*] For information on bus mastering DMA and coherency please read: [*] For information on bus mastering DMA and coherency please read:
Documentation/driver-api/pci/pci.rst Documentation/driver-api/pci/pci.rst
Documentation/DMA-API-HOWTO.txt Documentation/core-api/dma-api-howto.rst
Documentation/DMA-API.txt Documentation/core-api/dma-api.rst
DATA DEPENDENCY BARRIERS (HISTORICAL) DATA DEPENDENCY BARRIERS (HISTORICAL)
...@@ -1932,8 +1932,8 @@ There are some more advanced barrier functions: ...@@ -1932,8 +1932,8 @@ There are some more advanced barrier functions:
here. here.
See the subsection "Kernel I/O barrier effects" for more information on See the subsection "Kernel I/O barrier effects" for more information on
relaxed I/O accessors and the Documentation/DMA-API.txt file for more relaxed I/O accessors and the Documentation/core-api/dma-api.rst file for
information on consistent memory. more information on consistent memory.
(*) pmem_wmb(); (*) pmem_wmb();
......
...@@ -95,6 +95,7 @@ Contents: ...@@ -95,6 +95,7 @@ Contents:
seg6-sysctl seg6-sysctl
strparser strparser
switchdev switchdev
sysfs-tagging
tc-actions-env-rules tc-actions-env-rules
tcp-thin tcp-thin
team team
......
...@@ -405,7 +405,7 @@ be found at: ...@@ -405,7 +405,7 @@ be found at:
http://vger.kernel.org/vger-lists.html http://vger.kernel.org/vger-lists.html
There are lists hosted elsewhere, though; a number of them are at There are lists hosted elsewhere, though; a number of them are at
lists.redhat.com. redhat.com/mailman/listinfo.
The core mailing list for kernel development is, of course, linux-kernel. The core mailing list for kernel development is, of course, linux-kernel.
This list is an intimidating place to be; volume can reach 500 messages per This list is an intimidating place to be; volume can reach 500 messages per
......
...@@ -30,6 +30,7 @@ you probably needn't concern yourself with pcmciautils. ...@@ -30,6 +30,7 @@ you probably needn't concern yourself with pcmciautils.
Program Minimal version Command to check the version Program Minimal version Command to check the version
====================== =============== ======================================== ====================== =============== ========================================
GNU C 4.9 gcc --version GNU C 4.9 gcc --version
Clang/LLVM (optional) 10.0.1 clang --version
GNU make 3.81 make --version GNU make 3.81 make --version
binutils 2.23 ld -v binutils 2.23 ld -v
flex 2.5.35 flex --version flex 2.5.35 flex --version
...@@ -68,6 +69,15 @@ GCC ...@@ -68,6 +69,15 @@ GCC
The gcc version requirements may vary depending on the type of CPU in your The gcc version requirements may vary depending on the type of CPU in your
computer. computer.
Clang/LLVM (optional)
---------------------
The latest formal release of clang and LLVM utils (according to
`releases.llvm.org <https://releases.llvm.org>`_) are supported for building
kernels. Older releases aren't guaranteed to work, and we may drop workarounds
from the kernel that were used to support older versions. Please see additional
docs on :ref:`Building Linux with Clang/LLVM <kbuild_llvm>`.
Make Make
---- ----
...@@ -331,6 +341,11 @@ gcc ...@@ -331,6 +341,11 @@ gcc
- <ftp://ftp.gnu.org/gnu/gcc/> - <ftp://ftp.gnu.org/gnu/gcc/>
Clang/LLVM
----------
- :ref:`Getting LLVM <getting_llvm>`.
Make Make
---- ----
......
...@@ -51,24 +51,6 @@ to make sure their systems do not continue running in the face of ...@@ -51,24 +51,6 @@ to make sure their systems do not continue running in the face of
"unreachable" conditions. (For example, see commits like `this one "unreachable" conditions. (For example, see commits like `this one
<https://git.kernel.org/linus/d4689846881d160a4d12a514e991a740bcb5d65a>`_.) <https://git.kernel.org/linus/d4689846881d160a4d12a514e991a740bcb5d65a>`_.)
uninitialized_var()
-------------------
For any compiler warnings about uninitialized variables, just add
an initializer. Using the uninitialized_var() macro (or similar
warning-silencing tricks) is dangerous as it papers over `real bugs
<https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/>`_
(or can in the future), and suppresses unrelated compiler warnings
(e.g. "unused variable"). If the compiler thinks it is uninitialized,
either simply initialize the variable or make compiler changes. Keep in
mind that in most cases, if an initialization is obviously redundant,
the compiler's dead-store elimination pass will make sure there are no
needless variable writes.
As Linus has said, this macro
`must <https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/>`_
`be <https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/>`_
`removed <https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/>`_.
open-coded arithmetic in allocator arguments open-coded arithmetic in allocator arguments
-------------------------------------------- --------------------------------------------
Dynamic size calculations (especially multiplication) should not be Dynamic size calculations (especially multiplication) should not be
...@@ -322,7 +304,8 @@ to allocate for a structure containing an array of this kind as a member:: ...@@ -322,7 +304,8 @@ to allocate for a structure containing an array of this kind as a member::
In the example above, we had to remember to calculate ``count - 1`` when using In the example above, we had to remember to calculate ``count - 1`` when using
the struct_size() helper, otherwise we would have --unintentionally-- allocated the struct_size() helper, otherwise we would have --unintentionally-- allocated
memory for one too many ``items`` objects. The cleanest and least error-prone way memory for one too many ``items`` objects. The cleanest and least error-prone way
to implement this is through the use of a `flexible array member`:: to implement this is through the use of a `flexible array member`, together with
struct_size() and flex_array_size() helpers::
struct something { struct something {
size_t count; size_t count;
...@@ -334,5 +317,4 @@ to implement this is through the use of a `flexible array member`:: ...@@ -334,5 +317,4 @@ to implement this is through the use of a `flexible array member`::
instance = kmalloc(struct_size(instance, items, count), GFP_KERNEL); instance = kmalloc(struct_size(instance, items, count), GFP_KERNEL);
instance->count = count; instance->count = count;
size = sizeof(instance->items[0]) * instance->count; memcpy(instance->items, source, flex_array_size(instance, items, instance->count));
memcpy(instance->items, source, size);
...@@ -25,6 +25,11 @@ attachments, but then the attachments should have content-type ...@@ -25,6 +25,11 @@ attachments, but then the attachments should have content-type
it makes quoting portions of the patch more difficult in the patch it makes quoting portions of the patch more difficult in the patch
review process. review process.
It's also strongly recommended that you use plain text in your email body,
for patches and other emails alike. https://useplaintext.email may be useful
for information on how to configure your preferred email client, as well as
listing recommended email clients should you not already have a preference.
Email clients that are used for Linux kernel patches should send the Email clients that are used for Linux kernel patches should send the
patch text untouched. For example, they should not modify or delete tabs patch text untouched. For example, they should not modify or delete tabs
or spaces, even at the beginning or end of lines. or spaces, even at the beginning or end of lines.
......
...@@ -6,14 +6,15 @@ Programming Language ...@@ -6,14 +6,15 @@ Programming Language
The kernel is written in the C programming language [c-language]_. The kernel is written in the C programming language [c-language]_.
More precisely, the kernel is typically compiled with ``gcc`` [gcc]_ More precisely, the kernel is typically compiled with ``gcc`` [gcc]_
under ``-std=gnu89`` [gcc-c-dialect-options]_: the GNU dialect of ISO C90 under ``-std=gnu89`` [gcc-c-dialect-options]_: the GNU dialect of ISO C90
(including some C99 features). (including some C99 features). ``clang`` [clang]_ is also supported, see
docs on :ref:`Building Linux with Clang/LLVM <kbuild_llvm>`.
This dialect contains many extensions to the language [gnu-extensions]_, This dialect contains many extensions to the language [gnu-extensions]_,
and many of them are used within the kernel as a matter of course. and many of them are used within the kernel as a matter of course.
There is some support for compiling the kernel with ``clang`` [clang]_ There is some support for compiling the kernel with ``icc`` [icc]_ for several
and ``icc`` [icc]_ for several of the architectures, although at the time of the architectures, although at the time of writing it is not completed,
of writing it is not completed, requiring third-party patches. requiring third-party patches.
Attributes Attributes
---------- ----------
......
...@@ -24,6 +24,10 @@ and elsewhere regarding submitting Linux kernel patches. ...@@ -24,6 +24,10 @@ and elsewhere regarding submitting Linux kernel patches.
c) Builds successfully when using ``O=builddir`` c) Builds successfully when using ``O=builddir``
d) Any Documentation/ changes build successfully without new warnings/errors.
Use ``make htmldocs`` or ``make pdfdocs`` to check the build and
fix any issues.
3) Builds on multiple CPU architectures by using local cross-compile tools 3) Builds on multiple CPU architectures by using local cross-compile tools
or some other build farm. or some other build farm.
......
...@@ -60,10 +60,11 @@ What Criteria Determine Acceptance ...@@ -60,10 +60,11 @@ What Criteria Determine Acceptance
Licensing: Licensing:
The code must be released to us under the The code must be released to us under the
GNU General Public License. We don't insist on any kind GNU General Public License. If you wish the driver to be
of exclusive GPL licensing, and if you wish the driver useful to other communities such as BSD you may release
to be useful to other communities such as BSD you may well under multiple licenses. If you choose to release under
wish to release under multiple licenses. licenses other than the GPL, you should include your
rationale for your license choices in your cover letter.
See accepted licenses at include/linux/module.h See accepted licenses at include/linux/module.h
Copyright: Copyright:
......
...@@ -365,7 +365,7 @@ giving it a high uclamp.min value. ...@@ -365,7 +365,7 @@ giving it a high uclamp.min value.
.. note:: .. note::
Wakeup CPU selection in CFS can be eclipsed by Energy Aware Scheduling Wakeup CPU selection in CFS can be eclipsed by Energy Aware Scheduling
(EAS), which is described in Documentation/scheduling/sched-energy.rst. (EAS), which is described in Documentation/scheduler/sched-energy.rst.
5.1.3 Load balancing 5.1.3 Load balancing
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
......
...@@ -331,7 +331,7 @@ asymmetric CPU topologies for now. This requirement is checked at run-time by ...@@ -331,7 +331,7 @@ asymmetric CPU topologies for now. This requirement is checked at run-time by
looking for the presence of the SD_ASYM_CPUCAPACITY flag when the scheduling looking for the presence of the SD_ASYM_CPUCAPACITY flag when the scheduling
domains are built. domains are built.
See Documentation/sched/sched-capacity.rst for requirements to be met for this See Documentation/scheduler/sched-capacity.rst for requirements to be met for this
flag to be set in the sched_domain hierarchy. flag to be set in the sched_domain hierarchy.
Please note that EAS is not fundamentally incompatible with SMP, but no Please note that EAS is not fundamentally incompatible with SMP, but no
......
...@@ -323,7 +323,6 @@ credentials (the value is simply returned in each case):: ...@@ -323,7 +323,6 @@ credentials (the value is simply returned in each case)::
uid_t current_fsuid(void) Current's file access UID uid_t current_fsuid(void) Current's file access UID
gid_t current_fsgid(void) Current's file access GID gid_t current_fsgid(void) Current's file access GID
kernel_cap_t current_cap(void) Current's effective capabilities kernel_cap_t current_cap(void) Current's effective capabilities
void *current_security(void) Current's LSM security pointer
struct user_struct *current_user(void) Current's user account struct user_struct *current_user(void) Current's user account
There are also convenience wrappers for retrieving specific associated pairs of There are also convenience wrappers for retrieving specific associated pairs of
......
...@@ -39,10 +39,9 @@ With the IBM TSS 2 stack:: ...@@ -39,10 +39,9 @@ With the IBM TSS 2 stack::
Or with the Intel TSS 2 stack:: Or with the Intel TSS 2 stack::
#> tpm2_createprimary --hierarchy o -G rsa2048 -o key.ctxt #> tpm2_createprimary --hierarchy o -G rsa2048 -c key.ctxt
[...] [...]
handle: 0x800000FF #> tpm2_evictcontrol -c key.ctxt 0x81000001
#> tpm2_evictcontrol -c key.ctxt -p 0x81000001
persistentHandle: 0x81000001 persistentHandle: 0x81000001
Usage:: Usage::
......
...@@ -13,6 +13,7 @@ if sphinx.version_info[0] < 2 or \ ...@@ -13,6 +13,7 @@ if sphinx.version_info[0] < 2 or \
else: else:
from sphinx.errors import NoUri from sphinx.errors import NoUri
import re import re
from itertools import chain
# #
# Regex nastiness. Of course. # Regex nastiness. Of course.
...@@ -21,7 +22,13 @@ import re ...@@ -21,7 +22,13 @@ import re
# :c:func: block (i.e. ":c:func:`mmap()`s" flakes out), so the last # :c:func: block (i.e. ":c:func:`mmap()`s" flakes out), so the last
# bit tries to restrict matches to things that won't create trouble. # bit tries to restrict matches to things that won't create trouble.
# #
RE_function = re.compile(r'([\w_][\w\d_]+\(\))') RE_function = re.compile(r'(([\w_][\w\d_]+)\(\))')
RE_type = re.compile(r'(struct|union|enum|typedef)\s+([\w_][\w\d_]+)')
#
# Detects a reference to a documentation page of the form Documentation/... with
# an optional extension
#
RE_doc = re.compile(r'Documentation(/[\w\-_/]+)(\.\w+)*')
# #
# Many places in the docs refer to common system calls. It is # Many places in the docs refer to common system calls. It is
...@@ -34,56 +41,110 @@ Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap', ...@@ -34,56 +41,110 @@ Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap',
'select', 'poll', 'fork', 'execve', 'clone', 'ioctl', 'select', 'poll', 'fork', 'execve', 'clone', 'ioctl',
'socket' ] 'socket' ]
# def markup_refs(docname, app, node):
# Find all occurrences of function() and try to replace them with
# appropriate cross references.
#
def markup_funcs(docname, app, node):
cdom = app.env.domains['c']
t = node.astext() t = node.astext()
done = 0 done = 0
repl = [ ] repl = [ ]
for m in RE_function.finditer(t): #
# Associate each regex with the function that will markup its matches
#
markup_func = {RE_type: markup_c_ref,
RE_function: markup_c_ref,
RE_doc: markup_doc_ref}
match_iterators = [regex.finditer(t) for regex in markup_func]
#
# Sort all references by the starting position in text
#
sorted_matches = sorted(chain(*match_iterators), key=lambda m: m.start())
for m in sorted_matches:
# #
# Include any text prior to function() as a normal text node. # Include any text prior to match as a normal text node.
# #
if m.start() > done: if m.start() > done:
repl.append(nodes.Text(t[done:m.start()])) repl.append(nodes.Text(t[done:m.start()]))
# #
# Go through the dance of getting an xref out of the C domain # Call the function associated with the regex that matched this text and
# # append its return to the text
target = m.group(1)[:-2]
target_text = nodes.Text(target + '()')
xref = None
if target not in Skipfuncs:
lit_text = nodes.literal(classes=['xref', 'c', 'c-func'])
lit_text += target_text
pxref = addnodes.pending_xref('', refdomain = 'c',
reftype = 'function',
reftarget = target, modname = None,
classname = None)
#
# XXX The Latex builder will throw NoUri exceptions here,
# work around that by ignoring them.
#
try:
xref = cdom.resolve_xref(app.env, docname, app.builder,
'function', target, pxref, lit_text)
except NoUri:
xref = None
#
# Toss the xref into the list if we got it; otherwise just put
# the function text.
# #
if xref: repl.append(markup_func[m.re](docname, app, m))
repl.append(xref)
else:
repl.append(target_text)
done = m.end() done = m.end()
if done < len(t): if done < len(t):
repl.append(nodes.Text(t[done:])) repl.append(nodes.Text(t[done:]))
return repl return repl
#
# Try to replace a C reference (function() or struct/union/enum/typedef
# type_name) with an appropriate cross reference.
#
def markup_c_ref(docname, app, match):
class_str = {RE_function: 'c-func', RE_type: 'c-type'}
reftype_str = {RE_function: 'function', RE_type: 'type'}
cdom = app.env.domains['c']
#
# Go through the dance of getting an xref out of the C domain
#
target = match.group(2)
target_text = nodes.Text(match.group(0))
xref = None
if not (match.re == RE_function and target in Skipfuncs):
lit_text = nodes.literal(classes=['xref', 'c', class_str[match.re]])
lit_text += target_text
pxref = addnodes.pending_xref('', refdomain = 'c',
reftype = reftype_str[match.re],
reftarget = target, modname = None,
classname = None)
#
# XXX The Latex builder will throw NoUri exceptions here,
# work around that by ignoring them.
#
try:
xref = cdom.resolve_xref(app.env, docname, app.builder,
reftype_str[match.re], target, pxref,
lit_text)
except NoUri:
xref = None
#
# Return the xref if we got it; otherwise just return the plain text.
#
if xref:
return xref
else:
return target_text
#
# Try to replace a documentation reference of the form Documentation/... with a
# cross reference to that page
#
def markup_doc_ref(docname, app, match):
stddom = app.env.domains['std']
#
# Go through the dance of getting an xref out of the std domain
#
target = match.group(1)
xref = None
pxref = addnodes.pending_xref('', refdomain = 'std', reftype = 'doc',
reftarget = target, modname = None,
classname = None, refexplicit = False)
#
# XXX The Latex builder will throw NoUri exceptions here,
# work around that by ignoring them.
#
try:
xref = stddom.resolve_xref(app.env, docname, app.builder, 'doc',
target, pxref, None)
except NoUri:
xref = None
#
# Return the xref if we got it; otherwise just return the plain text.
#
if xref:
return xref
else:
return nodes.Text(match.group(0))
def auto_markup(app, doctree, name): def auto_markup(app, doctree, name):
# #
# This loop could eventually be improved on. Someday maybe we # This loop could eventually be improved on. Someday maybe we
...@@ -97,7 +158,7 @@ def auto_markup(app, doctree, name): ...@@ -97,7 +158,7 @@ def auto_markup(app, doctree, name):
for para in doctree.traverse(nodes.paragraph): for para in doctree.traverse(nodes.paragraph):
for node in para.traverse(nodes.Text): for node in para.traverse(nodes.Text):
if not isinstance(node.parent, nodes.literal): if not isinstance(node.parent, nodes.literal):
node.parent.replace(node, markup_funcs(name, app, node)) node.parent.replace(node, markup_refs(name, app, node))
def setup(app): def setup(app):
app.connect('doctree-resolved', auto_markup) app.connect('doctree-resolved', auto_markup)
......
...@@ -40,7 +40,7 @@ Synopsis of kprobe_events ...@@ -40,7 +40,7 @@ Synopsis of kprobe_events
MEMADDR : Address where the probe is inserted. MEMADDR : Address where the probe is inserted.
MAXACTIVE : Maximum number of instances of the specified function that MAXACTIVE : Maximum number of instances of the specified function that
can be probed simultaneously, or 0 for the default value can be probed simultaneously, or 0 for the default value
as defined in Documentation/staging/kprobes.rst section 1.3.1. as defined in Documentation/trace/kprobes.rst section 1.3.1.
FETCHARGS : Arguments. Each probe can have up to 128 args. FETCHARGS : Arguments. Each probe can have up to 128 args.
%REG : Fetch register REG %REG : Fetch register REG
......
.. This file is dual-licensed: you can use it either under the terms .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.2-no-invariants-only
.. of the GPL 2.0 or the GFDL 1.2 license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file is free software; you can redistribute it and/or
.. modify it under the terms of the GNU General Public License as
.. published by the Free Software Foundation version 2 of
.. the License.
..
.. This file is distributed in the hope that it will be useful,
.. but WITHOUT ANY WARRANTY; without even the implied warranty of
.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.. GNU General Public License for more details.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.2 version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.2 WITH no-invariant-sections
=========================== ===========================
Lockless Ring Buffer Design Lockless Ring Buffer Design
......
...@@ -284,9 +284,10 @@ Andrew Morton의 글이 있다. ...@@ -284,9 +284,10 @@ Andrew Morton의 글이 있다.
여러 메이저 넘버를 갖는 다양한 안정된 커널 트리들 여러 메이저 넘버를 갖는 다양한 안정된 커널 트리들
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 자리 숫자로 이루어진 버젼의 커널들은 -stable 커널들이다. 그것들은 해당 메이저 세개의 버젼 넘버로 이루어진 버젼의 커널들은 -stable 커널들이다. 그것들은 해당
메인라인 릴리즈에서 발견된 큰 회귀들이나 보안 문제들 중 비교적 작고 중요한 메이저 메인라인 릴리즈에서 발견된 큰 회귀들이나 보안 문제들 중 비교적 작고
수정들을 포함하며, 앞의 두 버전 넘버는 같은 기반 버전을 의미한다. 중요한 수정들을 포함한다. 주요 stable 시리즈 릴리즈는 세번째 버젼 넘버를
증가시키며 앞의 두 버젼 넘버는 그대로 유지한다.
이것은 가장 최근의 안정적인 커널을 원하는 사용자에게 추천되는 브랜치이며, 이것은 가장 최근의 안정적인 커널을 원하는 사용자에게 추천되는 브랜치이며,
개발/실험적 버젼을 테스트하는 것을 돕고자 하는 사용자들과는 별로 관련이 없다. 개발/실험적 버젼을 테스트하는 것을 돕고자 하는 사용자들과는 별로 관련이 없다.
...@@ -316,7 +317,7 @@ Andrew Morton의 글이 있다. ...@@ -316,7 +317,7 @@ Andrew Morton의 글이 있다.
제안된 패치는 서브시스템 트리에 커밋되기 전에 메일링 리스트를 통해 제안된 패치는 서브시스템 트리에 커밋되기 전에 메일링 리스트를 통해
리뷰된다(아래의 관련 섹션을 참고하기 바란다). 일부 커널 서브시스템의 경우, 이 리뷰된다(아래의 관련 섹션을 참고하기 바란다). 일부 커널 서브시스템의 경우, 이
리뷰 프로세스는 patchwork라는 도구를 통해 추적된다. patchwork은 등록된 패치와 리뷰 프로세스는 patchwork라는 도구를 통해 추적된다. patchwork은 등록된 패치와
패치에 대한 코멘트, 패치의 버을 볼 수 있는 웹 인터페이스를 제공하고, 패치에 대한 코멘트, 패치의 버을 볼 수 있는 웹 인터페이스를 제공하고,
메인테이너는 패치를 리뷰 중, 리뷰 통과, 또는 반려됨으로 표시할 수 있다. 메인테이너는 패치를 리뷰 중, 리뷰 통과, 또는 반려됨으로 표시할 수 있다.
대부분의 이러한 patchwork 사이트는 https://patchwork.kernel.org/ 에 나열되어 대부분의 이러한 patchwork 사이트는 https://patchwork.kernel.org/ 에 나열되어
있다. 있다.
......
...@@ -91,7 +91,6 @@ Documentation/memory-barriers.txt ...@@ -91,7 +91,6 @@ Documentation/memory-barriers.txt
- 컴파일러 배리어. - 컴파일러 배리어.
- CPU 메모리 배리어. - CPU 메모리 배리어.
- MMIO 쓰기 배리어.
(*) 암묵적 커널 메모리 배리어. (*) 암묵적 커널 메모리 배리어.
...@@ -103,7 +102,6 @@ Documentation/memory-barriers.txt ...@@ -103,7 +102,6 @@ Documentation/memory-barriers.txt
(*) CPU 간 ACQUIRING 배리어의 효과. (*) CPU 간 ACQUIRING 배리어의 효과.
- Acquire vs 메모리 액세스. - Acquire vs 메모리 액세스.
- Acquire vs I/O 액세스.
(*) 메모리 배리어가 필요한 곳 (*) 메모리 배리어가 필요한 곳
...@@ -515,14 +513,13 @@ CPU 에게 기대할 수 있는 최소한의 보장사항 몇가지가 있습니 ...@@ -515,14 +513,13 @@ CPU 에게 기대할 수 있는 최소한의 보장사항 몇가지가 있습니
완료되기 전에 행해진 것처럼 보일 수 있습니다. 완료되기 전에 행해진 것처럼 보일 수 있습니다.
ACQUIRE 와 RELEASE 오퍼레이션의 사용은 일반적으로 다른 메모리 배리어의 ACQUIRE 와 RELEASE 오퍼레이션의 사용은 일반적으로 다른 메모리 배리어의
필요성을 없앱니다 (하지만 "MMIO 쓰기 배리어" 서브섹션에서 설명되는 예외를 필요성을 없앱니다. 또한, RELEASE+ACQUIRE 조합은 범용 메모리 배리어처럼
알아두세요). 또한, RELEASE+ACQUIRE 조합은 범용 메모리 배리어처럼 동작할 동작할 것을 보장하지 -않습니다-. 하지만, 어떤 변수에 대한 RELEASE
것을 보장하지 -않습니다-. 하지만, 어떤 변수에 대한 RELEASE 오퍼레이션을 오퍼레이션을 앞서는 메모리 액세스들의 수행 결과는 이 RELEASE 오퍼레이션을
앞서는 메모리 액세스들의 수행 결과는 이 RELEASE 오퍼레이션을 뒤이어 같은 뒤이어 같은 변수에 대해 수행된 ACQUIRE 오퍼레이션을 뒤따르는 메모리
변수에 대해 수행된 ACQUIRE 오퍼레이션을 뒤따르는 메모리 액세스에는 보여질 액세스에는 보여질 것이 보장됩니다. 다르게 말하자면, 주어진 변수의
것이 보장됩니다. 다르게 말하자면, 주어진 변수의 크리티컬 섹션에서는, 해당 크리티컬 섹션에서는, 해당 변수에 대한 앞의 크리티컬 섹션에서의 모든
변수에 대한 앞의 크리티컬 섹션에서의 모든 액세스들이 완료되었을 것을 액세스들이 완료되었을 것을 보장합니다.
보장합니다.
즉, ACQUIRE 는 최소한의 "취득" 동작처럼, 그리고 RELEASE 는 최소한의 "공개" 즉, ACQUIRE 는 최소한의 "취득" 동작처럼, 그리고 RELEASE 는 최소한의 "공개"
처럼 동작한다는 의미입니다. 처럼 동작한다는 의미입니다.
...@@ -1501,8 +1498,6 @@ u 로의 스토어를 cpu1() 의 v 로부터의 로드 뒤에 일어난 것으 ...@@ -1501,8 +1498,6 @@ u 로의 스토어를 cpu1() 의 v 로부터의 로드 뒤에 일어난 것으
(*) CPU 메모리 배리어. (*) CPU 메모리 배리어.
(*) MMIO 쓰기 배리어.
컴파일러 배리어 컴파일러 배리어
--------------- ---------------
...@@ -1909,6 +1904,19 @@ Mandatory 배리어들은 SMP 시스템에서도 UP 시스템에서도 SMP 효 ...@@ -1909,6 +1904,19 @@ Mandatory 배리어들은 SMP 시스템에서도 UP 시스템에서도 SMP 효
"커널 I/O 배리어의 효과" 섹션을, consistent memory 에 대한 자세한 내용을 "커널 I/O 배리어의 효과" 섹션을, consistent memory 에 대한 자세한 내용을
위해선 Documentation/core-api/dma-api.rst 문서를 참고하세요. 위해선 Documentation/core-api/dma-api.rst 문서를 참고하세요.
(*) pmem_wmb();
이것은 persistent memory 를 위한 것으로, persistent 저장소에 가해진 변경
사항이 플랫폼 연속성 도메인에 도달했을 것을 보장하기 위한 것입니다.
예를 들어, 임시적이지 않은 pmem 영역으로의 쓰기 후, 우리는 쓰기가 플랫폼
연속성 도메인에 도달했을 것을 보장하기 위해 pmem_wmb() 를 사용합니다.
이는 쓰기가 뒤따르는 instruction 들이 유발하는 어떠한 데이터 액세스나
데이터 전송의 시작 전에 persistent 저장소를 업데이트 했을 것을 보장합니다.
이는 wmb() 에 의해 이뤄지는 순서 규칙을 포함합니다.
Persistent memory 에서의 로드를 위해선 현재의 읽기 메모리 배리어로도 읽기
순서를 보장하는데 충분합니다.
========================= =========================
암묵적 커널 메모리 배리어 암묵적 커널 메모리 배리어
......
.. include:: ../disclaimer-zh_CN.rst
:Original: :ref:`Documentation/arm64/amu.rst <amu_index>`
Translator: Bailu Lin <bailu.lin@vivo.com>
=================================
AArch64 Linux 中扩展的活动监控单元
=================================
作者: Ionela Voinescu <ionela.voinescu@arm.com>
日期: 2019-09-10
本文档简要描述了 AArch64 Linux 支持的活动监控单元的规范。
架构总述
--------
活动监控是 ARMv8.4 CPU 架构引入的一个可选扩展特性。
活动监控单元(在每个 CPU 中实现)为系统管理提供了性能计数器。既可以通
过系统寄存器的方式访问计数器,同时也支持外部内存映射的方式访问计数器。
AMUv1 架构实现了一个由4个固定的64位事件计数器组成的计数器组。
- CPU 周期计数器:同 CPU 的频率增长
- 常量计数器:同固定的系统时钟频率增长
- 淘汰指令计数器: 同每次架构指令执行增长
- 内存停顿周期计数器:计算由在时钟域内的最后一级缓存中未命中而引起
的指令调度停顿周期数
当处于 WFI 或者 WFE 状态时,计数器不会增长。
AMU 架构提供了一个高达16位的事件计数器空间,未来新的 AMU 版本中可能
用它来实现新增的事件计数器。
另外,AMUv1 实现了一个多达16个64位辅助事件计数器的计数器组。
冷复位时所有的计数器会清零。
基本支持
--------
内核可以安全地运行在支持 AMU 和不支持 AMU 的 CPU 组合中。
因此,当配置 CONFIG_ARM64_AMU_EXTN 后我们无条件使能后续
(secondary or hotplugged) CPU 检测和使用这个特性。
当在 CPU 上检测到该特性时,我们会标记为特性可用但是不能保证计数器的功能,
仅表明有扩展属性。
固件(代码运行在高异常级别,例如 arm-tf )需支持以下功能:
- 提供低异常级别(EL2 和 EL1)访问 AMU 寄存器的能力。
- 使能计数器。如果未使能,它的值应为 0。
- 在从电源关闭状态启动 CPU 前或后保存或者恢复计数器。
当使用使能了该特性的内核启动但固件损坏时,访问计数器寄存器可能会遭遇
panic 或者死锁。即使未发现这些症状,计数器寄存器返回的数据结果并不一
定能反映真实情况。通常,计数器会返回 0,表明他们未被使能。
如果固件没有提供适当的支持最好关闭 CONFIG_ARM64_AMU_EXTN。
值得注意的是,出于安全原因,不要绕过 AMUSERRENR_EL0 设置而捕获从
EL0(用户空间) 访问 EL1(内核空间)。 因此,固件应该确保访问 AMU寄存器
不会困在 EL2或EL3。
AMUv1 的固定计数器可以通过如下系统寄存器访问:
- SYS_AMEVCNTR0_CORE_EL0
- SYS_AMEVCNTR0_CONST_EL0
- SYS_AMEVCNTR0_INST_RET_EL0
- SYS_AMEVCNTR0_MEM_STALL_EL0
特定辅助计数器可以通过 SYS_AMEVCNTR1_EL0(n) 访问,其中n介于0到15。
详细信息定义在目录:arch/arm64/include/asm/sysreg.h。
用户空间访问
------------
由于以下原因,当前禁止从用户空间访问 AMU 的寄存器:
- 安全因数:可能会暴露处于安全模式执行的代码信息。
- 意愿:AMU 是用于系统管理的。
同样,该功能对用户空间不可见。
虚拟化
------
由于以下原因,当前禁止从 KVM 客户端的用户空间(EL0)和内核空间(EL1)
访问 AMU 的寄存器:
- 安全因数:可能会暴露给其他客户端或主机端执行的代码信息。
任何试图访问 AMU 寄存器的行为都会触发一个注册在客户端的未定义异常。
.. include:: ../disclaimer-zh_CN.rst
:Original: :ref:`Documentation/arm64/index.rst <arm64_index>`
:Translator: Bailu Lin <bailu.lin@vivo.com>
.. _cn_arm64_index:
==========
ARM64 架构
==========
.. toctree::
:maxdepth: 2
amu
...@@ -154,14 +154,13 @@ sysfs 会为这个类型调用适当的方法。当一个文件被读写时, ...@@ -154,14 +154,13 @@ sysfs 会为这个类型调用适当的方法。当一个文件被读写时,
示例: 示例:
#define to_dev(obj) container_of(obj, struct device, kobj)
#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr) #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr, static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
char *buf) char *buf)
{ {
struct device_attribute *dev_attr = to_dev_attr(attr); struct device_attribute *dev_attr = to_dev_attr(attr);
struct device *dev = to_dev(kobj); struct device *dev = kobj_to_dev(kobj);
ssize_t ret = -EIO; ssize_t ret = -EIO;
if (dev_attr->show) if (dev_attr->show)
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
admin-guide/index admin-guide/index
process/index process/index
filesystems/index filesystems/index
arm64/index
目录和表格 目录和表格
---------- ----------
......
...@@ -8,7 +8,7 @@ Linux Virtualization Support ...@@ -8,7 +8,7 @@ Linux Virtualization Support
:maxdepth: 2 :maxdepth: 2
kvm/index kvm/index
uml/user_mode_linux uml/user_mode_linux_howto_v2
paravirt_ops paravirt_ops
guest-halt-polling guest-halt-polling
......
...@@ -53,11 +53,11 @@ key management interface to perform common hypervisor activities such as ...@@ -53,11 +53,11 @@ key management interface to perform common hypervisor activities such as
encrypting bootstrap code, snapshot, migrating and debugging the guest. For more encrypting bootstrap code, snapshot, migrating and debugging the guest. For more
information, see the SEV Key Management spec [api-spec]_ information, see the SEV Key Management spec [api-spec]_
The main ioctl to access SEV is KVM_MEM_ENCRYPT_OP. If the argument The main ioctl to access SEV is KVM_MEMORY_ENCRYPT_OP. If the argument
to KVM_MEM_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled to KVM_MEMORY_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled
and ``ENOTTY` if it is disabled (on some older versions of Linux, and ``ENOTTY` if it is disabled (on some older versions of Linux,
the ioctl runs normally even with a NULL argument, and therefore will the ioctl runs normally even with a NULL argument, and therefore will
likely return ``EFAULT``). If non-NULL, the argument to KVM_MEM_ENCRYPT_OP likely return ``EFAULT``). If non-NULL, the argument to KVM_MEMORY_ENCRYPT_OP
must be a struct kvm_sev_cmd:: must be a struct kvm_sev_cmd::
struct kvm_sev_cmd { struct kvm_sev_cmd {
......
...@@ -4211,7 +4211,7 @@ H_GET_CPU_CHARACTERISTICS hypercall. ...@@ -4211,7 +4211,7 @@ H_GET_CPU_CHARACTERISTICS hypercall.
:Capability: basic :Capability: basic
:Architectures: x86 :Architectures: x86
:Type: system :Type: vm
:Parameters: an opaque platform specific structure (in/out) :Parameters: an opaque platform specific structure (in/out)
:Returns: 0 on success; -1 on error :Returns: 0 on success; -1 on error
...@@ -4343,7 +4343,7 @@ Errors: ...@@ -4343,7 +4343,7 @@ Errors:
#define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001 #define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001
#define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002 #define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002
#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
struct kvm_vmx_nested_state_hdr { struct kvm_vmx_nested_state_hdr {
__u64 vmxon_pa; __u64 vmxon_pa;
......
...@@ -78,7 +78,7 @@ KVM_FEATURE_PV_SEND_IPI 11 guest checks this feature bit ...@@ -78,7 +78,7 @@ KVM_FEATURE_PV_SEND_IPI 11 guest checks this feature bit
before enabling paravirtualized before enabling paravirtualized
sebd IPIs sebd IPIs
KVM_FEATURE_PV_POLL_CONTROL 12 host-side polling on HLT can KVM_FEATURE_POLL_CONTROL 12 host-side polling on HLT can
be disabled by writing be disabled by writing
to msr 0x4b564d05. to msr 0x4b564d05.
......
This diff is collapsed.
This diff is collapsed.
.. hmm: .. _hmm:
===================================== =====================================
Heterogeneous Memory Management (HMM) Heterogeneous Memory Management (HMM)
...@@ -271,10 +271,139 @@ map those pages from the CPU side. ...@@ -271,10 +271,139 @@ map those pages from the CPU side.
Migration to and from device memory Migration to and from device memory
=================================== ===================================
Because the CPU cannot access device memory, migration must use the device DMA Because the CPU cannot access device memory directly, the device driver must
engine to perform copy from and to device memory. For this we need to use use hardware DMA or device specific load/store instructions to migrate data.
migrate_vma_setup(), migrate_vma_pages(), and migrate_vma_finalize() helpers. The migrate_vma_setup(), migrate_vma_pages(), and migrate_vma_finalize()
functions are designed to make drivers easier to write and to centralize common
code across drivers.
Before migrating pages to device private memory, special device private
``struct page`` need to be created. These will be used as special "swap"
page table entries so that a CPU process will fault if it tries to access
a page that has been migrated to device private memory.
These can be allocated and freed with::
struct resource *res;
struct dev_pagemap pagemap;
res = request_free_mem_region(&iomem_resource, /* number of bytes */,
"name of driver resource");
pagemap.type = MEMORY_DEVICE_PRIVATE;
pagemap.range.start = res->start;
pagemap.range.end = res->end;
pagemap.nr_range = 1;
pagemap.ops = &device_devmem_ops;
memremap_pages(&pagemap, numa_node_id());
memunmap_pages(&pagemap);
release_mem_region(pagemap.range.start, range_len(&pagemap.range));
There are also devm_request_free_mem_region(), devm_memremap_pages(),
devm_memunmap_pages(), and devm_release_mem_region() when the resources can
be tied to a ``struct device``.
The overall migration steps are similar to migrating NUMA pages within system
memory (see :ref:`Page migration <page_migration>`) but the steps are split
between device driver specific code and shared common code:
1. ``mmap_read_lock()``
The device driver has to pass a ``struct vm_area_struct`` to
migrate_vma_setup() so the mmap_read_lock() or mmap_write_lock() needs to
be held for the duration of the migration.
2. ``migrate_vma_setup(struct migrate_vma *args)``
The device driver initializes the ``struct migrate_vma`` fields and passes
the pointer to migrate_vma_setup(). The ``args->flags`` field is used to
filter which source pages should be migrated. For example, setting
``MIGRATE_VMA_SELECT_SYSTEM`` will only migrate system memory and
``MIGRATE_VMA_SELECT_DEVICE_PRIVATE`` will only migrate pages residing in
device private memory. If the latter flag is set, the ``args->pgmap_owner``
field is used to identify device private pages owned by the driver. This
avoids trying to migrate device private pages residing in other devices.
Currently only anonymous private VMA ranges can be migrated to or from
system memory and device private memory.
One of the first steps migrate_vma_setup() does is to invalidate other
device's MMUs with the ``mmu_notifier_invalidate_range_start(()`` and
``mmu_notifier_invalidate_range_end()`` calls around the page table
walks to fill in the ``args->src`` array with PFNs to be migrated.
The ``invalidate_range_start()`` callback is passed a
``struct mmu_notifier_range`` with the ``event`` field set to
``MMU_NOTIFY_MIGRATE`` and the ``migrate_pgmap_owner`` field set to
the ``args->pgmap_owner`` field passed to migrate_vma_setup(). This is
allows the device driver to skip the invalidation callback and only
invalidate device private MMU mappings that are actually migrating.
This is explained more in the next section.
While walking the page tables, a ``pte_none()`` or ``is_zero_pfn()``
entry results in a valid "zero" PFN stored in the ``args->src`` array.
This lets the driver allocate device private memory and clear it instead
of copying a page of zeros. Valid PTE entries to system memory or
device private struct pages will be locked with ``lock_page()``, isolated
from the LRU (if system memory since device private pages are not on
the LRU), unmapped from the process, and a special migration PTE is
inserted in place of the original PTE.
migrate_vma_setup() also clears the ``args->dst`` array.
3. The device driver allocates destination pages and copies source pages to
destination pages.
The driver checks each ``src`` entry to see if the ``MIGRATE_PFN_MIGRATE``
bit is set and skips entries that are not migrating. The device driver
can also choose to skip migrating a page by not filling in the ``dst``
array for that page.
The driver then allocates either a device private struct page or a
system memory page, locks the page with ``lock_page()``, and fills in the
``dst`` array entry with::
dst[i] = migrate_pfn(page_to_pfn(dpage)) | MIGRATE_PFN_LOCKED;
Now that the driver knows that this page is being migrated, it can
invalidate device private MMU mappings and copy device private memory
to system memory or another device private page. The core Linux kernel
handles CPU page table invalidations so the device driver only has to
invalidate its own MMU mappings.
The driver can use ``migrate_pfn_to_page(src[i])`` to get the
``struct page`` of the source and either copy the source page to the
destination or clear the destination device private memory if the pointer
is ``NULL`` meaning the source page was not populated in system memory.
4. ``migrate_vma_pages()``
This step is where the migration is actually "committed".
If the source page was a ``pte_none()`` or ``is_zero_pfn()`` page, this
is where the newly allocated page is inserted into the CPU's page table.
This can fail if a CPU thread faults on the same page. However, the page
table is locked and only one of the new pages will be inserted.
The device driver will see that the ``MIGRATE_PFN_MIGRATE`` bit is cleared
if it loses the race.
If the source page was locked, isolated, etc. the source ``struct page``
information is now copied to destination ``struct page`` finalizing the
migration on the CPU side.
5. Device driver updates device MMU page tables for pages still migrating,
rolling back pages not migrating.
If the ``src`` entry still has ``MIGRATE_PFN_MIGRATE`` bit set, the device
driver can update the device MMU and set the write enable bit if the
``MIGRATE_PFN_WRITE`` bit is set.
6. ``migrate_vma_finalize()``
This step replaces the special migration page table entry with the new
page's page table entry and releases the reference to the source and
destination ``struct page``.
7. ``mmap_read_unlock()``
The lock can now be released.
Memory cgroup (memcg) and rss accounting Memory cgroup (memcg) and rss accounting
======================================== ========================================
......
...@@ -29,6 +29,7 @@ descriptions of data structures and algorithms. ...@@ -29,6 +29,7 @@ descriptions of data structures and algorithms.
:maxdepth: 1 :maxdepth: 1
active_mm active_mm
arch_pgtable_helpers
balance balance
cleancache cleancache
free_page_reporting free_page_reporting
......
This diff is collapsed.
...@@ -103,8 +103,10 @@ watch that specific key). ...@@ -103,8 +103,10 @@ watch that specific key).
To manage a watch list, the following functions are provided: To manage a watch list, the following functions are provided:
* ``void init_watch_list(struct watch_list *wlist, * ::
void (*release_watch)(struct watch *wlist));``
void init_watch_list(struct watch_list *wlist,
void (*release_watch)(struct watch *wlist));
Initialise a watch list. If ``release_watch`` is not NULL, then this Initialise a watch list. If ``release_watch`` is not NULL, then this
indicates a function that should be called when the watch_list object is indicates a function that should be called when the watch_list object is
...@@ -179,9 +181,11 @@ The following functions are provided to manage watches: ...@@ -179,9 +181,11 @@ The following functions are provided to manage watches:
driver-settable fields in the watch struct must have been set before this driver-settable fields in the watch struct must have been set before this
is called. is called.
* ``int remove_watch_from_object(struct watch_list *wlist, * ::
struct watch_queue *wqueue,
u64 id, false);`` int remove_watch_from_object(struct watch_list *wlist,
struct watch_queue *wqueue,
u64 id, false);
Remove a watch from a watch list, where the watch must match the specified Remove a watch from a watch list, where the watch must match the specified
watch queue (``wqueue``) and object identifier (``id``). A notification watch queue (``wqueue``) and object identifier (``id``). A notification
......
...@@ -14259,7 +14259,7 @@ QLOGIC QLA3XXX NETWORK DRIVER ...@@ -14259,7 +14259,7 @@ QLOGIC QLA3XXX NETWORK DRIVER
M: GR-Linux-NIC-Dev@marvell.com M: GR-Linux-NIC-Dev@marvell.com
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Supported S: Supported
F: Documentation/networking/device_drivers/ethernet/qlogic/LICENSE.qla3xxx F: Documentation/networking/device_drivers/qlogic/LICENSE.qla3xxx
F: drivers/net/ethernet/qlogic/qla3xxx.* F: drivers/net/ethernet/qlogic/qla3xxx.*
QLOGIC QLA4XXX iSCSI DRIVER QLOGIC QLA4XXX iSCSI DRIVER
...@@ -17759,6 +17759,7 @@ S: Supported ...@@ -17759,6 +17759,7 @@ S: Supported
W: http://www.linux-mtd.infradead.org/doc/ubifs.html W: http://www.linux-mtd.infradead.org/doc/ubifs.html
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git next T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git next
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git fixes T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git fixes
F: Documentation/filesystems/ubifs-authentication.rst
F: Documentation/filesystems/ubifs.rst F: Documentation/filesystems/ubifs.rst
F: fs/ubifs/ F: fs/ubifs/
......
...@@ -641,7 +641,7 @@ static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev) ...@@ -641,7 +641,7 @@ static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
* *
* This utility must be called between IIO device allocation * This utility must be called between IIO device allocation
* (via devm_iio_device_alloc()) & IIO device registration * (via devm_iio_device_alloc()) & IIO device registration
* (via {devm_}iio_device_register()). * (via iio_device_register() and devm_iio_device_register())).
* By default, the device allocation will also assign a parent device to * By default, the device allocation will also assign a parent device to
* the IIO device object. In cases where devm_iio_device_alloc() is used, * the IIO device object. In cases where devm_iio_device_alloc() is used,
* sometimes the parent device must be different than the device used to * sometimes the parent device must be different than the device used to
......
...@@ -1986,7 +1986,7 @@ config MMAP_ALLOW_UNINITIALIZED ...@@ -1986,7 +1986,7 @@ config MMAP_ALLOW_UNINITIALIZED
userspace. Since that isn't generally a problem on no-MMU systems, userspace. Since that isn't generally a problem on no-MMU systems,
it is normally safe to say Y here. it is normally safe to say Y here.
See Documentation/mm/nommu-mmap.rst for more information. See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
config SYSTEM_DATA_VERIFICATION config SYSTEM_DATA_VERIFICATION
def_bool n def_bool n
......
...@@ -383,7 +383,7 @@ config NOMMU_INITIAL_TRIM_EXCESS ...@@ -383,7 +383,7 @@ config NOMMU_INITIAL_TRIM_EXCESS
This option specifies the initial value of this option. The default This option specifies the initial value of this option. The default
of 1 says that all excess pages should be trimmed. of 1 says that all excess pages should be trimmed.
See Documentation/mm/nommu-mmap.rst for more information. See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
config TRANSPARENT_HUGEPAGE config TRANSPARENT_HUGEPAGE
bool "Transparent Hugepage Support" bool "Transparent Hugepage Support"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Replacement code for mm functions to support CPU's that don't * Replacement code for mm functions to support CPU's that don't
* have any form of memory management unit (thus no virtual memory). * have any form of memory management unit (thus no virtual memory).
* *
* See Documentation/mm/nommu-mmap.rst * See Documentation/admin-guide/mm/nommu-mmap.rst
* *
* Copyright (c) 2004-2008 David Howells <dhowells@redhat.com> * Copyright (c) 2004-2008 David Howells <dhowells@redhat.com>
* Copyright (c) 2000-2003 David McCullough <davidm@snapgear.com> * Copyright (c) 2000-2003 David McCullough <davidm@snapgear.com>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* stack trace and selected registers when _do_fork() is called. * stack trace and selected registers when _do_fork() is called.
* *
* For more information on theory of operation of kprobes, see * For more information on theory of operation of kprobes, see
* Documentation/staging/kprobes.rst * Documentation/trace/kprobes.rst
* *
* You will see the trace data in /var/log/messages and on the console * You will see the trace data in /var/log/messages and on the console
* whenever _do_fork() is invoked to create a new process. * whenever _do_fork() is invoked to create a new process.
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* If no func_name is specified, _do_fork is instrumented * If no func_name is specified, _do_fork is instrumented
* *
* For more information on theory of operation of kretprobes, see * For more information on theory of operation of kretprobes, see
* Documentation/staging/kprobes.rst * Documentation/trace/kprobes.rst
* *
* Build and insert the kernel module as done in the kprobe example. * Build and insert the kernel module as done in the kprobe example.
* You will see the trace data in /var/log/messages and on the console * You will see the trace data in /var/log/messages and on the console
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/// ///
/// From Documentation/filesystems/sysfs.txt: /// From Documentation/filesystems/sysfs.rst:
/// show() must not use snprintf() when formatting the value to be /// show() must not use snprintf() when formatting the value to be
/// returned to user space. If you can guarantee that an overflow /// returned to user space. If you can guarantee that an overflow
/// will never happen you can use sprintf() otherwise you must use /// will never happen you can use sprintf() otherwise you must use
......
...@@ -1083,7 +1083,7 @@ sub dump_struct($$) { ...@@ -1083,7 +1083,7 @@ sub dump_struct($$) {
my $x = shift; my $x = shift;
my $file = shift; my $file = shift;
if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) { if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) {
my $decl_type = $1; my $decl_type = $1;
$declaration_name = $2; $declaration_name = $2;
my $members = $3; my $members = $3;
...@@ -1099,6 +1099,7 @@ sub dump_struct($$) { ...@@ -1099,6 +1099,7 @@ sub dump_struct($$) {
$members =~ s/\s*__packed\s*/ /gos; $members =~ s/\s*__packed\s*/ /gos;
$members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
$members =~ s/\s*____cacheline_aligned_in_smp/ /gos; $members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
$members =~ s/\s*____cacheline_aligned/ /gos;
# replace DECLARE_BITMAP # replace DECLARE_BITMAP
$members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos; $members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos;
...@@ -1594,6 +1595,8 @@ sub dump_function($$) { ...@@ -1594,6 +1595,8 @@ sub dump_function($$) {
my $file = shift; my $file = shift;
my $noret = 0; my $noret = 0;
print_lineno($.);
$prototype =~ s/^static +//; $prototype =~ s/^static +//;
$prototype =~ s/^extern +//; $prototype =~ s/^extern +//;
$prototype =~ s/^asmlinkage +//; $prototype =~ s/^asmlinkage +//;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment