Merge branch 'deprecated/android-4.9-q' of https://android.googlesource.com/kernel/common into HEAD
Conflicts: arch/arm/Makefile arch/arm/include/asm/unistd.h arch/arm/kernel/calls.S arch/arm64/include/asm/assembler.h arch/arm64/include/asm/cputype.h arch/arm64/kernel/bpi.S arch/arm64/kernel/cpu_errata.c arch/arm64/kernel/setup.c arch/arm64/kernel/vdso.c arch/arm64/mm/proc.S arch/mips/include/uapi/asm/Kbuild arch/powerpc/include/uapi/asm/Kbuild drivers/char/Kconfig drivers/char/random.c drivers/clk/qcom/clk-rcg2.c drivers/gpu/drm/drm_edid.c drivers/irqchip/irq-gic.c drivers/md/dm-table.c drivers/media/dvb-core/dmxdev.c drivers/mmc/core/core.c drivers/mmc/core/host.c drivers/mmc/core/mmc.c drivers/mmc/host/sdhci.c drivers/net/usb/lan78xx.c drivers/scsi/ufs/ufs_quirks.h drivers/scsi/ufs/ufshcd.c drivers/staging/android/ion/ion-ioctl.c drivers/staging/android/ion/ion.c drivers/staging/android/ion/ion_priv.h drivers/staging/android/ion/ion_system_heap.c drivers/tty/tty_io.c drivers/usb/core/hub.c drivers/usb/core/usb.h drivers/usb/dwc3/core.c drivers/usb/dwc3/gadget.c drivers/usb/gadget/composite.c drivers/usb/gadget/configfs.c drivers/usb/gadget/function/f_accessory.c drivers/usb/gadget/function/rndis.c drivers/usb/gadget/function/rndis.h fs/eventpoll.c fs/ext4/namei.c fs/fat/fatent.c fs/gfs2/acl.c include/linux/random.h include/uapi/drm/Kbuild include/uapi/linux/Kbuild include/uapi/linux/cifs/Kbuild include/uapi/linux/genwqe/Kbuild kernel/cpu.c kernel/exit.c kernel/sched/cpufreq_schedutil.c lib/Makefile lib/string.c mm/memory.c mm/page-writeback.c mm/page_alloc.c net/ipv4/udp.c net/ipv6/datagram.c net/ipv6/ip6_output.c net/netfilter/nf_conntrack_irc.c net/netfilter/xt_quota2.c net/netlink/genetlink.c security/selinux/avc.c security/selinux/include/objsec.h sound/core/compress_offload.c Change-Id: I41982a5a8e22a21b72ec5dfa61a3680be66213f4
This commit is contained in:
@@ -59,17 +59,18 @@ class
|
||||
|
||||
dma_mode
|
||||
|
||||
Transfer modes supported by the device when in DMA mode.
|
||||
DMA transfer mode used by the device.
|
||||
Mostly used by PATA device.
|
||||
|
||||
pio_mode
|
||||
|
||||
Transfer modes supported by the device when in PIO mode.
|
||||
PIO transfer mode used by the device.
|
||||
Mostly used by PATA device.
|
||||
|
||||
xfer_mode
|
||||
|
||||
Current transfer mode.
|
||||
Mostly used by PATA device.
|
||||
|
||||
id
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ Description:
|
||||
Raw capacitance measurement from channel Y. Units after
|
||||
application of scale and offset are nanofarads.
|
||||
|
||||
What: /sys/.../iio:deviceX/in_capacitanceY-in_capacitanceZ_raw
|
||||
What: /sys/.../iio:deviceX/in_capacitanceY-capacitanceZ_raw
|
||||
KernelVersion: 3.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
@@ -1491,7 +1491,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_concentrationX_voc_raw
|
||||
KernelVersion: 4.3
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Raw (unscaled no offset etc.) percentage reading of a substance.
|
||||
Raw (unscaled no offset etc.) reading of a substance. Units
|
||||
after application of scale and offset are percents.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_resistance_raw
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_resistanceX_raw
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/conversion_mode
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_conversion_mode
|
||||
KernelVersion: 4.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
|
||||
@@ -361,6 +361,7 @@ What: /sys/devices/system/cpu/vulnerabilities
|
||||
/sys/devices/system/cpu/vulnerabilities/srbds
|
||||
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort
|
||||
/sys/devices/system/cpu/vulnerabilities/itlb_multihit
|
||||
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
|
||||
Date: January 2018
|
||||
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
|
||||
Description: Information about CPU vulnerabilities
|
||||
|
||||
@@ -324,7 +324,7 @@ Many legacy IDE drivers use ata_bmdma_status() as the bmdma_status() hook.
|
||||
|
||||
<sect2><title>High-level taskfile hooks</title>
|
||||
<programlisting>
|
||||
void (*qc_prep) (struct ata_queued_cmd *qc);
|
||||
enum ata_completion_errors (*qc_prep) (struct ata_queued_cmd *qc);
|
||||
int (*qc_issue) (struct ata_queued_cmd *qc);
|
||||
</programlisting>
|
||||
|
||||
|
||||
@@ -53,8 +53,11 @@ stable kernels.
|
||||
| ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
|
||||
| ARM | Cortex-A57 | #852523 | N/A |
|
||||
| ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 |
|
||||
| ARM | Cortex-A57 | #1742098 | ARM64_ERRATUM_1742098 |
|
||||
| ARM | Cortex-A72 | #853709 | N/A |
|
||||
| ARM | Cortex-A72 | #1655431 | ARM64_ERRATUM_1742098 |
|
||||
| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 |
|
||||
| ARM | Cortex-A76 | #1188873 | ARM64_ERRATUM_1188873 |
|
||||
| ARM | MMU-500 | #841119,#826419 | N/A |
|
||||
| | | | |
|
||||
| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
|
||||
|
||||
@@ -96,7 +96,7 @@ finally:
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
language = 'en'
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
|
||||
@@ -16,6 +16,9 @@ Required properties:
|
||||
Documentation/devicetree/bindings/graph.txt. This port should be connected
|
||||
to the input port of an attached HDMI or LVDS encoder chip.
|
||||
|
||||
Optional properties:
|
||||
- pinctrl-names: Contain "default" and "sleep".
|
||||
|
||||
Example:
|
||||
|
||||
dpi0: dpi@1401d000 {
|
||||
@@ -26,6 +29,9 @@ dpi0: dpi@1401d000 {
|
||||
<&mmsys CLK_MM_DPI_ENGINE>,
|
||||
<&apmixedsys CLK_APMIXED_TVDPLL>;
|
||||
clock-names = "pixel", "engine", "pll";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dpi_pin_func>;
|
||||
pinctrl-1 = <&dpi_pin_idle>;
|
||||
|
||||
port {
|
||||
dpi0_out: endpoint {
|
||||
|
||||
@@ -34,8 +34,8 @@ Example:
|
||||
Use specific request line passing from dma
|
||||
For example, MMC request line is 5
|
||||
|
||||
sdhci: sdhci@98e00000 {
|
||||
compatible = "moxa,moxart-sdhci";
|
||||
mmc: mmc@98e00000 {
|
||||
compatible = "moxa,moxart-mmc";
|
||||
reg = <0x98e00000 0x5C>;
|
||||
interrupts = <5 0>;
|
||||
clocks = <&clk_apb>;
|
||||
|
||||
@@ -9,8 +9,9 @@ Required properties:
|
||||
- The second cell is reserved and is currently unused.
|
||||
- gpio-controller : Marks the device node as a GPIO controller.
|
||||
- interrupt-controller: Mark the device node as an interrupt controller
|
||||
- #interrupt-cells : Should be 1. The interrupt type is fixed in the hardware.
|
||||
- #interrupt-cells : Should be 2. The interrupt type is fixed in the hardware.
|
||||
- The first cell is the GPIO offset number within the GPIO controller.
|
||||
- The second cell is the interrupt trigger type and level flags.
|
||||
- interrupts: Specify the interrupt.
|
||||
- altr,interrupt-type: Specifies the interrupt trigger type the GPIO
|
||||
hardware is synthesized. This field is required if the Altera GPIO controller
|
||||
@@ -38,6 +39,6 @@ gpio_altr: gpio@0xff200000 {
|
||||
altr,interrupt-type = <IRQ_TYPE_EDGE_RISING>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
#interrupt-cells = <1>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-controller;
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ on various other factors also like;
|
||||
so the device should have enough free bytes available its OOB/Spare
|
||||
area to accommodate ECC for entire page. In general following expression
|
||||
helps in determining if given device can accommodate ECC syndrome:
|
||||
"2 + (PAGESIZE / 512) * ECC_BYTES" >= OOBSIZE"
|
||||
"2 + (PAGESIZE / 512) * ECC_BYTES" <= OOBSIZE"
|
||||
where
|
||||
OOBSIZE number of bytes in OOB/spare area
|
||||
PAGESIZE number of bytes in main-area of device page
|
||||
|
||||
@@ -27,7 +27,7 @@ Example (for ARM-based BeagleBone with NPC100 NFC controller on I2C2):
|
||||
clock-frequency = <100000>;
|
||||
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <29 GPIO_ACTIVE_HIGH>;
|
||||
interrupts = <29 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
enable-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
|
||||
firmware-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
@@ -27,7 +27,7 @@ Example (for ARM-based BeagleBone with PN544 on I2C2):
|
||||
clock-frequency = <400000>;
|
||||
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <17 GPIO_ACTIVE_HIGH>;
|
||||
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
enable-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
|
||||
firmware-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
@@ -13,6 +13,14 @@ common regulator binding documented in:
|
||||
|
||||
|
||||
Required properties of the main device node (the parent!):
|
||||
- s5m8767,pmic-buck-ds-gpios: GPIO specifiers for three host gpio's used
|
||||
for selecting GPIO DVS lines. It is one-to-one mapped to dvs gpio lines.
|
||||
|
||||
[1] If either of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
|
||||
property is specified, then all the eight voltage values for the
|
||||
's5m8767,pmic-buck[2/3/4]-dvs-voltage' should be specified.
|
||||
|
||||
Optional properties of the main device node (the parent!):
|
||||
- s5m8767,pmic-buck2-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
|
||||
units for buck2 when changing voltage using gpio dvs. Refer to [1] below
|
||||
for additional information.
|
||||
@@ -25,26 +33,13 @@ Required properties of the main device node (the parent!):
|
||||
units for buck4 when changing voltage using gpio dvs. Refer to [1] below
|
||||
for additional information.
|
||||
|
||||
- s5m8767,pmic-buck-ds-gpios: GPIO specifiers for three host gpio's used
|
||||
for selecting GPIO DVS lines. It is one-to-one mapped to dvs gpio lines.
|
||||
|
||||
[1] If none of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
|
||||
property is specified, the 's5m8767,pmic-buck[2/3/4]-dvs-voltage'
|
||||
property should specify atleast one voltage level (which would be a
|
||||
safe operating voltage).
|
||||
|
||||
If either of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
|
||||
property is specified, then all the eight voltage values for the
|
||||
's5m8767,pmic-buck[2/3/4]-dvs-voltage' should be specified.
|
||||
|
||||
Optional properties of the main device node (the parent!):
|
||||
- s5m8767,pmic-buck2-uses-gpio-dvs: 'buck2' can be controlled by gpio dvs.
|
||||
- s5m8767,pmic-buck3-uses-gpio-dvs: 'buck3' can be controlled by gpio dvs.
|
||||
- s5m8767,pmic-buck4-uses-gpio-dvs: 'buck4' can be controlled by gpio dvs.
|
||||
|
||||
Additional properties required if either of the optional properties are used:
|
||||
|
||||
- s5m8767,pmic-buck234-default-dvs-idx: Default voltage setting selected from
|
||||
- s5m8767,pmic-buck-default-dvs-idx: Default voltage setting selected from
|
||||
the possible 8 options selectable by the dvs gpios. The value of this
|
||||
property should be between 0 and 7. If not specified or if out of range, the
|
||||
default value of this property is set to 0.
|
||||
|
||||
@@ -14,9 +14,15 @@ Required properties:
|
||||
- #gpio-cells : Must be 2. The first cell is the pin number and the
|
||||
second cell is used to specify optional parameters (currently unused).
|
||||
|
||||
- AVDD2-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, CPVDD-supply,
|
||||
SPKVDD1-supply, SPKVDD2-supply : power supplies for the device, as covered
|
||||
in Documentation/devicetree/bindings/regulator/regulator.txt
|
||||
- power supplies for the device, as covered in
|
||||
Documentation/devicetree/bindings/regulator/regulator.txt, depending
|
||||
on compatible:
|
||||
- for wlf,wm1811 and wlf,wm8958:
|
||||
AVDD1-supply, AVDD2-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply,
|
||||
DCVDD-supply, CPVDD-supply, SPKVDD1-supply, SPKVDD2-supply
|
||||
- for wlf,wm8994:
|
||||
AVDD1-supply, AVDD2-supply, DBVDD-supply, DCVDD-supply, CPVDD-supply,
|
||||
SPKVDD1-supply, SPKVDD2-supply
|
||||
|
||||
Optional properties:
|
||||
|
||||
@@ -68,11 +74,11 @@ codec: wm8994@1a {
|
||||
|
||||
lineout1-se;
|
||||
|
||||
AVDD1-supply = <®ulator>;
|
||||
AVDD2-supply = <®ulator>;
|
||||
CPVDD-supply = <®ulator>;
|
||||
DBVDD1-supply = <®ulator>;
|
||||
DBVDD2-supply = <®ulator>;
|
||||
DBVDD3-supply = <®ulator>;
|
||||
DBVDD-supply = <®ulator>;
|
||||
DCVDD-supply = <®ulator>;
|
||||
SPKVDD1-supply = <®ulator>;
|
||||
SPKVDD2-supply = <®ulator>;
|
||||
};
|
||||
|
||||
@@ -93,13 +93,15 @@ The Amiga protection flags RWEDRWEDHSPARWED are handled as follows:
|
||||
|
||||
- R maps to r for user, group and others. On directories, R implies x.
|
||||
|
||||
- If both W and D are allowed, w will be set.
|
||||
- W maps to w.
|
||||
|
||||
- E maps to x.
|
||||
|
||||
- H and P are always retained and ignored under Linux.
|
||||
- D is ignored.
|
||||
|
||||
- A is always reset when a file is written to.
|
||||
- H, S and P are always retained and ignored under Linux.
|
||||
|
||||
- A is cleared when a file is written to.
|
||||
|
||||
User id and group id will be used unless set[gu]id are given as mount
|
||||
options. Since most of the Amiga file systems are single user systems
|
||||
@@ -111,11 +113,13 @@ Linux -> Amiga:
|
||||
|
||||
The Linux rwxrwxrwx file mode is handled as follows:
|
||||
|
||||
- r permission will set R for user, group and others.
|
||||
- r permission will allow R for user, group and others.
|
||||
|
||||
- w permission will set W and D for user, group and others.
|
||||
- w permission will allow W for user, group and others.
|
||||
|
||||
- x permission of the user will set E for plain files.
|
||||
- x permission of the user will allow E for plain files.
|
||||
|
||||
- D will be allowed for user, group and others.
|
||||
|
||||
- All other flags (suid, sgid, ...) are ignored and will
|
||||
not be retained.
|
||||
|
||||
@@ -169,3 +169,13 @@ havoc if they lock crucial files. The way around it is to change the file
|
||||
permissions (remove the setgid bit) before trying to read or write to it.
|
||||
Of course, that might be a bit tricky if the system is hung :-(
|
||||
|
||||
7. The "mand" mount option
|
||||
--------------------------
|
||||
Mandatory locking is disabled on all filesystems by default, and must be
|
||||
administratively enabled by mounting with "-o mand". That mount option
|
||||
is only allowed if the mounting task has the CAP_SYS_ADMIN capability.
|
||||
|
||||
Since kernel v4.5, it is possible to disable mandatory locking
|
||||
altogether by setting CONFIG_MANDATORY_FILE_LOCKING to "n". A kernel
|
||||
with this disabled will reject attempts to mount filesystems with the
|
||||
"mand" mount option with the error status EPERM.
|
||||
|
||||
@@ -211,12 +211,10 @@ Other notes:
|
||||
is 4096.
|
||||
|
||||
- show() methods should return the number of bytes printed into the
|
||||
buffer. This is the return value of scnprintf().
|
||||
buffer.
|
||||
|
||||
- show() must not use snprintf() when formatting the value to be
|
||||
returned to user space. If you can guarantee that an overflow
|
||||
will never happen you can use sprintf() otherwise you must use
|
||||
scnprintf().
|
||||
- show() should only use sysfs_emit() or sysfs_emit_at() when formatting
|
||||
the value to be returned to user space.
|
||||
|
||||
- store() should return the number of bytes used from the buffer. If the
|
||||
entire buffer has been used, just return the count argument.
|
||||
|
||||
@@ -9,8 +9,10 @@ are configurable at compile, boot or run time.
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
spectre
|
||||
l1tf
|
||||
mds
|
||||
tsx_async_abort
|
||||
multihit
|
||||
special-register-buffer-data-sampling
|
||||
processor_mmio_stale_data
|
||||
|
||||
260
Documentation/hw-vuln/processor_mmio_stale_data.rst
Normal file
260
Documentation/hw-vuln/processor_mmio_stale_data.rst
Normal file
@@ -0,0 +1,260 @@
|
||||
=========================================
|
||||
Processor MMIO Stale Data Vulnerabilities
|
||||
=========================================
|
||||
|
||||
Processor MMIO Stale Data Vulnerabilities are a class of memory-mapped I/O
|
||||
(MMIO) vulnerabilities that can expose data. The sequences of operations for
|
||||
exposing data range from simple to very complex. Because most of the
|
||||
vulnerabilities require the attacker to have access to MMIO, many environments
|
||||
are not affected. System environments using virtualization where MMIO access is
|
||||
provided to untrusted guests may need mitigation. These vulnerabilities are
|
||||
not transient execution attacks. However, these vulnerabilities may propagate
|
||||
stale data into core fill buffers where the data can subsequently be inferred
|
||||
by an unmitigated transient execution attack. Mitigation for these
|
||||
vulnerabilities includes a combination of microcode update and software
|
||||
changes, depending on the platform and usage model. Some of these mitigations
|
||||
are similar to those used to mitigate Microarchitectural Data Sampling (MDS) or
|
||||
those used to mitigate Special Register Buffer Data Sampling (SRBDS).
|
||||
|
||||
Data Propagators
|
||||
================
|
||||
Propagators are operations that result in stale data being copied or moved from
|
||||
one microarchitectural buffer or register to another. Processor MMIO Stale Data
|
||||
Vulnerabilities are operations that may result in stale data being directly
|
||||
read into an architectural, software-visible state or sampled from a buffer or
|
||||
register.
|
||||
|
||||
Fill Buffer Stale Data Propagator (FBSDP)
|
||||
-----------------------------------------
|
||||
Stale data may propagate from fill buffers (FB) into the non-coherent portion
|
||||
of the uncore on some non-coherent writes. Fill buffer propagation by itself
|
||||
does not make stale data architecturally visible. Stale data must be propagated
|
||||
to a location where it is subject to reading or sampling.
|
||||
|
||||
Sideband Stale Data Propagator (SSDP)
|
||||
-------------------------------------
|
||||
The sideband stale data propagator (SSDP) is limited to the client (including
|
||||
Intel Xeon server E3) uncore implementation. The sideband response buffer is
|
||||
shared by all client cores. For non-coherent reads that go to sideband
|
||||
destinations, the uncore logic returns 64 bytes of data to the core, including
|
||||
both requested data and unrequested stale data, from a transaction buffer and
|
||||
the sideband response buffer. As a result, stale data from the sideband
|
||||
response and transaction buffers may now reside in a core fill buffer.
|
||||
|
||||
Primary Stale Data Propagator (PSDP)
|
||||
------------------------------------
|
||||
The primary stale data propagator (PSDP) is limited to the client (including
|
||||
Intel Xeon server E3) uncore implementation. Similar to the sideband response
|
||||
buffer, the primary response buffer is shared by all client cores. For some
|
||||
processors, MMIO primary reads will return 64 bytes of data to the core fill
|
||||
buffer including both requested data and unrequested stale data. This is
|
||||
similar to the sideband stale data propagator.
|
||||
|
||||
Vulnerabilities
|
||||
===============
|
||||
Device Register Partial Write (DRPW) (CVE-2022-21166)
|
||||
-----------------------------------------------------
|
||||
Some endpoint MMIO registers incorrectly handle writes that are smaller than
|
||||
the register size. Instead of aborting the write or only copying the correct
|
||||
subset of bytes (for example, 2 bytes for a 2-byte write), more bytes than
|
||||
specified by the write transaction may be written to the register. On
|
||||
processors affected by FBSDP, this may expose stale data from the fill buffers
|
||||
of the core that created the write transaction.
|
||||
|
||||
Shared Buffers Data Sampling (SBDS) (CVE-2022-21125)
|
||||
----------------------------------------------------
|
||||
After propagators may have moved data around the uncore and copied stale data
|
||||
into client core fill buffers, processors affected by MFBDS can leak data from
|
||||
the fill buffer. It is limited to the client (including Intel Xeon server E3)
|
||||
uncore implementation.
|
||||
|
||||
Shared Buffers Data Read (SBDR) (CVE-2022-21123)
|
||||
------------------------------------------------
|
||||
It is similar to Shared Buffer Data Sampling (SBDS) except that the data is
|
||||
directly read into the architectural software-visible state. It is limited to
|
||||
the client (including Intel Xeon server E3) uncore implementation.
|
||||
|
||||
Affected Processors
|
||||
===================
|
||||
Not all the CPUs are affected by all the variants. For instance, most
|
||||
processors for the server market (excluding Intel Xeon E3 processors) are
|
||||
impacted by only Device Register Partial Write (DRPW).
|
||||
|
||||
Below is the list of affected Intel processors [#f1]_:
|
||||
|
||||
=================== ============ =========
|
||||
Common name Family_Model Steppings
|
||||
=================== ============ =========
|
||||
HASWELL_X 06_3FH 2,4
|
||||
SKYLAKE_L 06_4EH 3
|
||||
BROADWELL_X 06_4FH All
|
||||
SKYLAKE_X 06_55H 3,4,6,7,11
|
||||
BROADWELL_D 06_56H 3,4,5
|
||||
SKYLAKE 06_5EH 3
|
||||
ICELAKE_X 06_6AH 4,5,6
|
||||
ICELAKE_D 06_6CH 1
|
||||
ICELAKE_L 06_7EH 5
|
||||
ATOM_TREMONT_D 06_86H All
|
||||
LAKEFIELD 06_8AH 1
|
||||
KABYLAKE_L 06_8EH 9 to 12
|
||||
ATOM_TREMONT 06_96H 1
|
||||
ATOM_TREMONT_L 06_9CH 0
|
||||
KABYLAKE 06_9EH 9 to 13
|
||||
COMETLAKE 06_A5H 2,3,5
|
||||
COMETLAKE_L 06_A6H 0,1
|
||||
ROCKETLAKE 06_A7H 1
|
||||
=================== ============ =========
|
||||
|
||||
If a CPU is in the affected processor list, but not affected by a variant, it
|
||||
is indicated by new bits in MSR IA32_ARCH_CAPABILITIES. As described in a later
|
||||
section, mitigation largely remains the same for all the variants, i.e. to
|
||||
clear the CPU fill buffers via VERW instruction.
|
||||
|
||||
New bits in MSRs
|
||||
================
|
||||
Newer processors and microcode update on existing affected processors added new
|
||||
bits to IA32_ARCH_CAPABILITIES MSR. These bits can be used to enumerate
|
||||
specific variants of Processor MMIO Stale Data vulnerabilities and mitigation
|
||||
capability.
|
||||
|
||||
MSR IA32_ARCH_CAPABILITIES
|
||||
--------------------------
|
||||
Bit 13 - SBDR_SSDP_NO - When set, processor is not affected by either the
|
||||
Shared Buffers Data Read (SBDR) vulnerability or the sideband stale
|
||||
data propagator (SSDP).
|
||||
Bit 14 - FBSDP_NO - When set, processor is not affected by the Fill Buffer
|
||||
Stale Data Propagator (FBSDP).
|
||||
Bit 15 - PSDP_NO - When set, processor is not affected by Primary Stale Data
|
||||
Propagator (PSDP).
|
||||
Bit 17 - FB_CLEAR - When set, VERW instruction will overwrite CPU fill buffer
|
||||
values as part of MD_CLEAR operations. Processors that do not
|
||||
enumerate MDS_NO (meaning they are affected by MDS) but that do
|
||||
enumerate support for both L1D_FLUSH and MD_CLEAR implicitly enumerate
|
||||
FB_CLEAR as part of their MD_CLEAR support.
|
||||
Bit 18 - FB_CLEAR_CTRL - Processor supports read and write to MSR
|
||||
IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]. On such processors, the FB_CLEAR_DIS
|
||||
bit can be set to cause the VERW instruction to not perform the
|
||||
FB_CLEAR action. Not all processors that support FB_CLEAR will support
|
||||
FB_CLEAR_CTRL.
|
||||
|
||||
MSR IA32_MCU_OPT_CTRL
|
||||
---------------------
|
||||
Bit 3 - FB_CLEAR_DIS - When set, VERW instruction does not perform the FB_CLEAR
|
||||
action. This may be useful to reduce the performance impact of FB_CLEAR in
|
||||
cases where system software deems it warranted (for example, when performance
|
||||
is more critical, or the untrusted software has no MMIO access). Note that
|
||||
FB_CLEAR_DIS has no impact on enumeration (for example, it does not change
|
||||
FB_CLEAR or MD_CLEAR enumeration) and it may not be supported on all processors
|
||||
that enumerate FB_CLEAR.
|
||||
|
||||
Mitigation
|
||||
==========
|
||||
Like MDS, all variants of Processor MMIO Stale Data vulnerabilities have the
|
||||
same mitigation strategy to force the CPU to clear the affected buffers before
|
||||
an attacker can extract the secrets.
|
||||
|
||||
This is achieved by using the otherwise unused and obsolete VERW instruction in
|
||||
combination with a microcode update. The microcode clears the affected CPU
|
||||
buffers when the VERW instruction is executed.
|
||||
|
||||
Kernel reuses the MDS function to invoke the buffer clearing:
|
||||
|
||||
mds_clear_cpu_buffers()
|
||||
|
||||
On MDS affected CPUs, the kernel already invokes CPU buffer clear on
|
||||
kernel/userspace, hypervisor/guest and C-state (idle) transitions. No
|
||||
additional mitigation is needed on such CPUs.
|
||||
|
||||
For CPUs not affected by MDS or TAA, mitigation is needed only for the attacker
|
||||
with MMIO capability. Therefore, VERW is not required for kernel/userspace. For
|
||||
virtualization case, VERW is only needed at VMENTER for a guest with MMIO
|
||||
capability.
|
||||
|
||||
Mitigation points
|
||||
-----------------
|
||||
Return to user space
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
Same mitigation as MDS when affected by MDS/TAA, otherwise no mitigation
|
||||
needed.
|
||||
|
||||
C-State transition
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Control register writes by CPU during C-state transition can propagate data
|
||||
from fill buffer to uncore buffers. Execute VERW before C-state transition to
|
||||
clear CPU fill buffers.
|
||||
|
||||
Guest entry point
|
||||
^^^^^^^^^^^^^^^^^
|
||||
Same mitigation as MDS when processor is also affected by MDS/TAA, otherwise
|
||||
execute VERW at VMENTER only for MMIO capable guests. On CPUs not affected by
|
||||
MDS/TAA, guest without MMIO access cannot extract secrets using Processor MMIO
|
||||
Stale Data vulnerabilities, so there is no need to execute VERW for such guests.
|
||||
|
||||
Mitigation control on the kernel command line
|
||||
---------------------------------------------
|
||||
The kernel command line allows to control the Processor MMIO Stale Data
|
||||
mitigations at boot time with the option "mmio_stale_data=". The valid
|
||||
arguments for this option are:
|
||||
|
||||
========== =================================================================
|
||||
full If the CPU is vulnerable, enable mitigation; CPU buffer clearing
|
||||
on exit to userspace and when entering a VM. Idle transitions are
|
||||
protected as well. It does not automatically disable SMT.
|
||||
full,nosmt Same as full, with SMT disabled on vulnerable CPUs. This is the
|
||||
complete mitigation.
|
||||
off Disables mitigation completely.
|
||||
========== =================================================================
|
||||
|
||||
If the CPU is affected and mmio_stale_data=off is not supplied on the kernel
|
||||
command line, then the kernel selects the appropriate mitigation.
|
||||
|
||||
Mitigation status information
|
||||
-----------------------------
|
||||
The Linux kernel provides a sysfs interface to enumerate the current
|
||||
vulnerability status of the system: whether the system is vulnerable, and
|
||||
which mitigations are active. The relevant sysfs file is:
|
||||
|
||||
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
|
||||
|
||||
The possible values in this file are:
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - 'Not affected'
|
||||
- The processor is not vulnerable
|
||||
* - 'Vulnerable'
|
||||
- The processor is vulnerable, but no mitigation enabled
|
||||
* - 'Vulnerable: Clear CPU buffers attempted, no microcode'
|
||||
- The processor is vulnerable, but microcode is not updated. The
|
||||
mitigation is enabled on a best effort basis.
|
||||
* - 'Mitigation: Clear CPU buffers'
|
||||
- The processor is vulnerable and the CPU buffer clearing mitigation is
|
||||
enabled.
|
||||
* - 'Unknown: No mitigations'
|
||||
- The processor vulnerability status is unknown because it is
|
||||
out of Servicing period. Mitigation is not attempted.
|
||||
|
||||
Definitions:
|
||||
------------
|
||||
|
||||
Servicing period: The process of providing functional and security updates to
|
||||
Intel processors or platforms, utilizing the Intel Platform Update (IPU)
|
||||
process or other similar mechanisms.
|
||||
|
||||
End of Servicing Updates (ESU): ESU is the date at which Intel will no
|
||||
longer provide Servicing, such as through IPU or other similar update
|
||||
processes. ESU dates will typically be aligned to end of quarter.
|
||||
|
||||
If the processor is vulnerable then the following information is appended to
|
||||
the above information:
|
||||
|
||||
======================== ===========================================
|
||||
'SMT vulnerable' SMT is enabled
|
||||
'SMT disabled' SMT is disabled
|
||||
'SMT Host state unknown' Kernel runs in a VM, Host SMT state unknown
|
||||
======================== ===========================================
|
||||
|
||||
References
|
||||
----------
|
||||
.. [#f1] Affected Processors
|
||||
https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
|
||||
785
Documentation/hw-vuln/spectre.rst
Normal file
785
Documentation/hw-vuln/spectre.rst
Normal file
@@ -0,0 +1,785 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Spectre Side Channels
|
||||
=====================
|
||||
|
||||
Spectre is a class of side channel attacks that exploit branch prediction
|
||||
and speculative execution on modern CPUs to read memory, possibly
|
||||
bypassing access controls. Speculative execution side channel exploits
|
||||
do not modify memory but attempt to infer privileged data in the memory.
|
||||
|
||||
This document covers Spectre variant 1 and Spectre variant 2.
|
||||
|
||||
Affected processors
|
||||
-------------------
|
||||
|
||||
Speculative execution side channel methods affect a wide range of modern
|
||||
high performance processors, since most modern high speed processors
|
||||
use branch prediction and speculative execution.
|
||||
|
||||
The following CPUs are vulnerable:
|
||||
|
||||
- Intel Core, Atom, Pentium, and Xeon processors
|
||||
|
||||
- AMD Phenom, EPYC, and Zen processors
|
||||
|
||||
- IBM POWER and zSeries processors
|
||||
|
||||
- Higher end ARM processors
|
||||
|
||||
- Apple CPUs
|
||||
|
||||
- Higher end MIPS CPUs
|
||||
|
||||
- Likely most other high performance CPUs. Contact your CPU vendor for details.
|
||||
|
||||
Whether a processor is affected or not can be read out from the Spectre
|
||||
vulnerability files in sysfs. See :ref:`spectre_sys_info`.
|
||||
|
||||
Related CVEs
|
||||
------------
|
||||
|
||||
The following CVE entries describe Spectre variants:
|
||||
|
||||
============= ======================= ==========================
|
||||
CVE-2017-5753 Bounds check bypass Spectre variant 1
|
||||
CVE-2017-5715 Branch target injection Spectre variant 2
|
||||
CVE-2019-1125 Spectre v1 swapgs Spectre variant 1 (swapgs)
|
||||
============= ======================= ==========================
|
||||
|
||||
Problem
|
||||
-------
|
||||
|
||||
CPUs use speculative operations to improve performance. That may leave
|
||||
traces of memory accesses or computations in the processor's caches,
|
||||
buffers, and branch predictors. Malicious software may be able to
|
||||
influence the speculative execution paths, and then use the side effects
|
||||
of the speculative execution in the CPUs' caches and buffers to infer
|
||||
privileged data touched during the speculative execution.
|
||||
|
||||
Spectre variant 1 attacks take advantage of speculative execution of
|
||||
conditional branches, while Spectre variant 2 attacks use speculative
|
||||
execution of indirect branches to leak privileged memory.
|
||||
See :ref:`[1] <spec_ref1>` :ref:`[5] <spec_ref5>` :ref:`[6] <spec_ref6>`
|
||||
:ref:`[7] <spec_ref7>` :ref:`[10] <spec_ref10>` :ref:`[11] <spec_ref11>`.
|
||||
|
||||
Spectre variant 1 (Bounds Check Bypass)
|
||||
---------------------------------------
|
||||
|
||||
The bounds check bypass attack :ref:`[2] <spec_ref2>` takes advantage
|
||||
of speculative execution that bypasses conditional branch instructions
|
||||
used for memory access bounds check (e.g. checking if the index of an
|
||||
array results in memory access within a valid range). This results in
|
||||
memory accesses to invalid memory (with out-of-bound index) that are
|
||||
done speculatively before validation checks resolve. Such speculative
|
||||
memory accesses can leave side effects, creating side channels which
|
||||
leak information to the attacker.
|
||||
|
||||
There are some extensions of Spectre variant 1 attacks for reading data
|
||||
over the network, see :ref:`[12] <spec_ref12>`. However such attacks
|
||||
are difficult, low bandwidth, fragile, and are considered low risk.
|
||||
|
||||
Note that, despite "Bounds Check Bypass" name, Spectre variant 1 is not
|
||||
only about user-controlled array bounds checks. It can affect any
|
||||
conditional checks. The kernel entry code interrupt, exception, and NMI
|
||||
handlers all have conditional swapgs checks. Those may be problematic
|
||||
in the context of Spectre v1, as kernel code can speculatively run with
|
||||
a user GS.
|
||||
|
||||
Spectre variant 2 (Branch Target Injection)
|
||||
-------------------------------------------
|
||||
|
||||
The branch target injection attack takes advantage of speculative
|
||||
execution of indirect branches :ref:`[3] <spec_ref3>`. The indirect
|
||||
branch predictors inside the processor used to guess the target of
|
||||
indirect branches can be influenced by an attacker, causing gadget code
|
||||
to be speculatively executed, thus exposing sensitive data touched by
|
||||
the victim. The side effects left in the CPU's caches during speculative
|
||||
execution can be measured to infer data values.
|
||||
|
||||
.. _poison_btb:
|
||||
|
||||
In Spectre variant 2 attacks, the attacker can steer speculative indirect
|
||||
branches in the victim to gadget code by poisoning the branch target
|
||||
buffer of a CPU used for predicting indirect branch addresses. Such
|
||||
poisoning could be done by indirect branching into existing code,
|
||||
with the address offset of the indirect branch under the attacker's
|
||||
control. Since the branch prediction on impacted hardware does not
|
||||
fully disambiguate branch address and uses the offset for prediction,
|
||||
this could cause privileged code's indirect branch to jump to a gadget
|
||||
code with the same offset.
|
||||
|
||||
The most useful gadgets take an attacker-controlled input parameter (such
|
||||
as a register value) so that the memory read can be controlled. Gadgets
|
||||
without input parameters might be possible, but the attacker would have
|
||||
very little control over what memory can be read, reducing the risk of
|
||||
the attack revealing useful data.
|
||||
|
||||
One other variant 2 attack vector is for the attacker to poison the
|
||||
return stack buffer (RSB) :ref:`[13] <spec_ref13>` to cause speculative
|
||||
subroutine return instruction execution to go to a gadget. An attacker's
|
||||
imbalanced subroutine call instructions might "poison" entries in the
|
||||
return stack buffer which are later consumed by a victim's subroutine
|
||||
return instructions. This attack can be mitigated by flushing the return
|
||||
stack buffer on context switch, or virtual machine (VM) exit.
|
||||
|
||||
On systems with simultaneous multi-threading (SMT), attacks are possible
|
||||
from the sibling thread, as level 1 cache and branch target buffer
|
||||
(BTB) may be shared between hardware threads in a CPU core. A malicious
|
||||
program running on the sibling thread may influence its peer's BTB to
|
||||
steer its indirect branch speculations to gadget code, and measure the
|
||||
speculative execution's side effects left in level 1 cache to infer the
|
||||
victim's data.
|
||||
|
||||
Yet another variant 2 attack vector is for the attacker to poison the
|
||||
Branch History Buffer (BHB) to speculatively steer an indirect branch
|
||||
to a specific Branch Target Buffer (BTB) entry, even if the entry isn't
|
||||
associated with the source address of the indirect branch. Specifically,
|
||||
the BHB might be shared across privilege levels even in the presence of
|
||||
Enhanced IBRS.
|
||||
|
||||
Currently the only known real-world BHB attack vector is via
|
||||
unprivileged eBPF. Therefore, it's highly recommended to not enable
|
||||
unprivileged eBPF, especially when eIBRS is used (without retpolines).
|
||||
For a full mitigation against BHB attacks, it's recommended to use
|
||||
retpolines (or eIBRS combined with retpolines).
|
||||
|
||||
Attack scenarios
|
||||
----------------
|
||||
|
||||
The following list of attack scenarios have been anticipated, but may
|
||||
not cover all possible attack vectors.
|
||||
|
||||
1. A user process attacking the kernel
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Spectre variant 1
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
The attacker passes a parameter to the kernel via a register or
|
||||
via a known address in memory during a syscall. Such parameter may
|
||||
be used later by the kernel as an index to an array or to derive
|
||||
a pointer for a Spectre variant 1 attack. The index or pointer
|
||||
is invalid, but bound checks are bypassed in the code branch taken
|
||||
for speculative execution. This could cause privileged memory to be
|
||||
accessed and leaked.
|
||||
|
||||
For kernel code that has been identified where data pointers could
|
||||
potentially be influenced for Spectre attacks, new "nospec" accessor
|
||||
macros are used to prevent speculative loading of data.
|
||||
|
||||
Spectre variant 1 (swapgs)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
An attacker can train the branch predictor to speculatively skip the
|
||||
swapgs path for an interrupt or exception. If they initialize
|
||||
the GS register to a user-space value, if the swapgs is speculatively
|
||||
skipped, subsequent GS-related percpu accesses in the speculation
|
||||
window will be done with the attacker-controlled GS value. This
|
||||
could cause privileged memory to be accessed and leaked.
|
||||
|
||||
For example:
|
||||
|
||||
::
|
||||
|
||||
if (coming from user space)
|
||||
swapgs
|
||||
mov %gs:<percpu_offset>, %reg
|
||||
mov (%reg), %reg1
|
||||
|
||||
When coming from user space, the CPU can speculatively skip the
|
||||
swapgs, and then do a speculative percpu load using the user GS
|
||||
value. So the user can speculatively force a read of any kernel
|
||||
value. If a gadget exists which uses the percpu value as an address
|
||||
in another load/store, then the contents of the kernel value may
|
||||
become visible via an L1 side channel attack.
|
||||
|
||||
A similar attack exists when coming from kernel space. The CPU can
|
||||
speculatively do the swapgs, causing the user GS to get used for the
|
||||
rest of the speculative window.
|
||||
|
||||
Spectre variant 2
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
A spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch
|
||||
target buffer (BTB) before issuing syscall to launch an attack.
|
||||
After entering the kernel, the kernel could use the poisoned branch
|
||||
target buffer on indirect jump and jump to gadget code in speculative
|
||||
execution.
|
||||
|
||||
If an attacker tries to control the memory addresses leaked during
|
||||
speculative execution, he would also need to pass a parameter to the
|
||||
gadget, either through a register or a known address in memory. After
|
||||
the gadget has executed, he can measure the side effect.
|
||||
|
||||
The kernel can protect itself against consuming poisoned branch
|
||||
target buffer entries by using return trampolines (also known as
|
||||
"retpoline") :ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` for all
|
||||
indirect branches. Return trampolines trap speculative execution paths
|
||||
to prevent jumping to gadget code during speculative execution.
|
||||
x86 CPUs with Enhanced Indirect Branch Restricted Speculation
|
||||
(Enhanced IBRS) available in hardware should use the feature to
|
||||
mitigate Spectre variant 2 instead of retpoline. Enhanced IBRS is
|
||||
more efficient than retpoline.
|
||||
|
||||
There may be gadget code in firmware which could be exploited with
|
||||
Spectre variant 2 attack by a rogue user process. To mitigate such
|
||||
attacks on x86, Indirect Branch Restricted Speculation (IBRS) feature
|
||||
is turned on before the kernel invokes any firmware code.
|
||||
|
||||
2. A user process attacking another user process
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A malicious user process can try to attack another user process,
|
||||
either via a context switch on the same hardware thread, or from the
|
||||
sibling hyperthread sharing a physical processor core on simultaneous
|
||||
multi-threading (SMT) system.
|
||||
|
||||
Spectre variant 1 attacks generally require passing parameters
|
||||
between the processes, which needs a data passing relationship, such
|
||||
as remote procedure calls (RPC). Those parameters are used in gadget
|
||||
code to derive invalid data pointers accessing privileged memory in
|
||||
the attacked process.
|
||||
|
||||
Spectre variant 2 attacks can be launched from a rogue process by
|
||||
:ref:`poisoning <poison_btb>` the branch target buffer. This can
|
||||
influence the indirect branch targets for a victim process that either
|
||||
runs later on the same hardware thread, or running concurrently on
|
||||
a sibling hardware thread sharing the same physical core.
|
||||
|
||||
A user process can protect itself against Spectre variant 2 attacks
|
||||
by using the prctl() syscall to disable indirect branch speculation
|
||||
for itself. An administrator can also cordon off an unsafe process
|
||||
from polluting the branch target buffer by disabling the process's
|
||||
indirect branch speculation. This comes with a performance cost
|
||||
from not using indirect branch speculation and clearing the branch
|
||||
target buffer. When SMT is enabled on x86, for a process that has
|
||||
indirect branch speculation disabled, Single Threaded Indirect Branch
|
||||
Predictors (STIBP) :ref:`[4] <spec_ref4>` are turned on to prevent the
|
||||
sibling thread from controlling branch target buffer. In addition,
|
||||
the Indirect Branch Prediction Barrier (IBPB) is issued to clear the
|
||||
branch target buffer when context switching to and from such process.
|
||||
|
||||
On x86, the return stack buffer is stuffed on context switch.
|
||||
This prevents the branch target buffer from being used for branch
|
||||
prediction when the return stack buffer underflows while switching to
|
||||
a deeper call stack. Any poisoned entries in the return stack buffer
|
||||
left by the previous process will also be cleared.
|
||||
|
||||
User programs should use address space randomization to make attacks
|
||||
more difficult (Set /proc/sys/kernel/randomize_va_space = 1 or 2).
|
||||
|
||||
3. A virtualized guest attacking the host
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The attack mechanism is similar to how user processes attack the
|
||||
kernel. The kernel is entered via hyper-calls or other virtualization
|
||||
exit paths.
|
||||
|
||||
For Spectre variant 1 attacks, rogue guests can pass parameters
|
||||
(e.g. in registers) via hyper-calls to derive invalid pointers to
|
||||
speculate into privileged memory after entering the kernel. For places
|
||||
where such kernel code has been identified, nospec accessor macros
|
||||
are used to stop speculative memory access.
|
||||
|
||||
For Spectre variant 2 attacks, rogue guests can :ref:`poison
|
||||
<poison_btb>` the branch target buffer or return stack buffer, causing
|
||||
the kernel to jump to gadget code in the speculative execution paths.
|
||||
|
||||
To mitigate variant 2, the host kernel can use return trampolines
|
||||
for indirect branches to bypass the poisoned branch target buffer,
|
||||
and flushing the return stack buffer on VM exit. This prevents rogue
|
||||
guests from affecting indirect branching in the host kernel.
|
||||
|
||||
To protect host processes from rogue guests, host processes can have
|
||||
indirect branch speculation disabled via prctl(). The branch target
|
||||
buffer is cleared before context switching to such processes.
|
||||
|
||||
4. A virtualized guest attacking other guest
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A rogue guest may attack another guest to get data accessible by the
|
||||
other guest.
|
||||
|
||||
Spectre variant 1 attacks are possible if parameters can be passed
|
||||
between guests. This may be done via mechanisms such as shared memory
|
||||
or message passing. Such parameters could be used to derive data
|
||||
pointers to privileged data in guest. The privileged data could be
|
||||
accessed by gadget code in the victim's speculation paths.
|
||||
|
||||
Spectre variant 2 attacks can be launched from a rogue guest by
|
||||
:ref:`poisoning <poison_btb>` the branch target buffer or the return
|
||||
stack buffer. Such poisoned entries could be used to influence
|
||||
speculation execution paths in the victim guest.
|
||||
|
||||
Linux kernel mitigates attacks to other guests running in the same
|
||||
CPU hardware thread by flushing the return stack buffer on VM exit,
|
||||
and clearing the branch target buffer before switching to a new guest.
|
||||
|
||||
If SMT is used, Spectre variant 2 attacks from an untrusted guest
|
||||
in the sibling hyperthread can be mitigated by the administrator,
|
||||
by turning off the unsafe guest's indirect branch speculation via
|
||||
prctl(). A guest can also protect itself by turning on microcode
|
||||
based mitigations (such as IBPB or STIBP on x86) within the guest.
|
||||
|
||||
.. _spectre_sys_info:
|
||||
|
||||
Spectre system information
|
||||
--------------------------
|
||||
|
||||
The Linux kernel provides a sysfs interface to enumerate the current
|
||||
mitigation status of the system for Spectre: whether the system is
|
||||
vulnerable, and which mitigations are active.
|
||||
|
||||
The sysfs file showing Spectre variant 1 mitigation status is:
|
||||
|
||||
/sys/devices/system/cpu/vulnerabilities/spectre_v1
|
||||
|
||||
The possible values in this file are:
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - 'Not affected'
|
||||
- The processor is not vulnerable.
|
||||
* - 'Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers'
|
||||
- The swapgs protections are disabled; otherwise it has
|
||||
protection in the kernel on a case by case base with explicit
|
||||
pointer sanitation and usercopy LFENCE barriers.
|
||||
* - 'Mitigation: usercopy/swapgs barriers and __user pointer sanitization'
|
||||
- Protection in the kernel on a case by case base with explicit
|
||||
pointer sanitation, usercopy LFENCE barriers, and swapgs LFENCE
|
||||
barriers.
|
||||
|
||||
However, the protections are put in place on a case by case basis,
|
||||
and there is no guarantee that all possible attack vectors for Spectre
|
||||
variant 1 are covered.
|
||||
|
||||
The spectre_v2 kernel file reports if the kernel has been compiled with
|
||||
retpoline mitigation or if the CPU has hardware mitigation, and if the
|
||||
CPU has support for additional process-specific mitigation.
|
||||
|
||||
This file also reports CPU features enabled by microcode to mitigate
|
||||
attack between user processes:
|
||||
|
||||
1. Indirect Branch Prediction Barrier (IBPB) to add additional
|
||||
isolation between processes of different users.
|
||||
2. Single Thread Indirect Branch Predictors (STIBP) to add additional
|
||||
isolation between CPU threads running on the same core.
|
||||
|
||||
These CPU features may impact performance when used and can be enabled
|
||||
per process on a case-by-case base.
|
||||
|
||||
The sysfs file showing Spectre variant 2 mitigation status is:
|
||||
|
||||
/sys/devices/system/cpu/vulnerabilities/spectre_v2
|
||||
|
||||
The possible values in this file are:
|
||||
|
||||
- Kernel status:
|
||||
|
||||
======================================== =================================
|
||||
'Not affected' The processor is not vulnerable
|
||||
'Mitigation: None' Vulnerable, no mitigation
|
||||
'Mitigation: Retpolines' Use Retpoline thunks
|
||||
'Mitigation: LFENCE' Use LFENCE instructions
|
||||
'Mitigation: Enhanced IBRS' Hardware-focused mitigation
|
||||
'Mitigation: Enhanced IBRS + Retpolines' Hardware-focused + Retpolines
|
||||
'Mitigation: Enhanced IBRS + LFENCE' Hardware-focused + LFENCE
|
||||
======================================== =================================
|
||||
|
||||
- Firmware status: Show if Indirect Branch Restricted Speculation (IBRS) is
|
||||
used to protect against Spectre variant 2 attacks when calling firmware (x86 only).
|
||||
|
||||
========== =============================================================
|
||||
'IBRS_FW' Protection against user program attacks when calling firmware
|
||||
========== =============================================================
|
||||
|
||||
- Indirect branch prediction barrier (IBPB) status for protection between
|
||||
processes of different users. This feature can be controlled through
|
||||
prctl() per process, or through kernel command line options. This is
|
||||
an x86 only feature. For more details see below.
|
||||
|
||||
=================== ========================================================
|
||||
'IBPB: disabled' IBPB unused
|
||||
'IBPB: always-on' Use IBPB on all tasks
|
||||
'IBPB: conditional' Use IBPB on SECCOMP or indirect branch restricted tasks
|
||||
=================== ========================================================
|
||||
|
||||
- Single threaded indirect branch prediction (STIBP) status for protection
|
||||
between different hyper threads. This feature can be controlled through
|
||||
prctl per process, or through kernel command line options. This is x86
|
||||
only feature. For more details see below.
|
||||
|
||||
==================== ========================================================
|
||||
'STIBP: disabled' STIBP unused
|
||||
'STIBP: forced' Use STIBP on all tasks
|
||||
'STIBP: conditional' Use STIBP on SECCOMP or indirect branch restricted tasks
|
||||
==================== ========================================================
|
||||
|
||||
- Return stack buffer (RSB) protection status:
|
||||
|
||||
============= ===========================================
|
||||
'RSB filling' Protection of RSB on context switch enabled
|
||||
============= ===========================================
|
||||
|
||||
Full mitigation might require a microcode update from the CPU
|
||||
vendor. When the necessary microcode is not available, the kernel will
|
||||
report vulnerability.
|
||||
|
||||
Turning on mitigation for Spectre variant 1 and Spectre variant 2
|
||||
-----------------------------------------------------------------
|
||||
|
||||
1. Kernel mitigation
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Spectre variant 1
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
For the Spectre variant 1, vulnerable kernel code (as determined
|
||||
by code audit or scanning tools) is annotated on a case by case
|
||||
basis to use nospec accessor macros for bounds clipping :ref:`[2]
|
||||
<spec_ref2>` to avoid any usable disclosure gadgets. However, it may
|
||||
not cover all attack vectors for Spectre variant 1.
|
||||
|
||||
Copy-from-user code has an LFENCE barrier to prevent the access_ok()
|
||||
check from being mis-speculated. The barrier is done by the
|
||||
barrier_nospec() macro.
|
||||
|
||||
For the swapgs variant of Spectre variant 1, LFENCE barriers are
|
||||
added to interrupt, exception and NMI entry where needed. These
|
||||
barriers are done by the FENCE_SWAPGS_KERNEL_ENTRY and
|
||||
FENCE_SWAPGS_USER_ENTRY macros.
|
||||
|
||||
Spectre variant 2
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
For Spectre variant 2 mitigation, the compiler turns indirect calls or
|
||||
jumps in the kernel into equivalent return trampolines (retpolines)
|
||||
:ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` to go to the target
|
||||
addresses. Speculative execution paths under retpolines are trapped
|
||||
in an infinite loop to prevent any speculative execution jumping to
|
||||
a gadget.
|
||||
|
||||
To turn on retpoline mitigation on a vulnerable CPU, the kernel
|
||||
needs to be compiled with a gcc compiler that supports the
|
||||
-mindirect-branch=thunk-extern -mindirect-branch-register options.
|
||||
If the kernel is compiled with a Clang compiler, the compiler needs
|
||||
to support -mretpoline-external-thunk option. The kernel config
|
||||
CONFIG_RETPOLINE needs to be turned on, and the CPU needs to run with
|
||||
the latest updated microcode.
|
||||
|
||||
On Intel Skylake-era systems the mitigation covers most, but not all,
|
||||
cases. See :ref:`[3] <spec_ref3>` for more details.
|
||||
|
||||
On CPUs with hardware mitigation for Spectre variant 2 (e.g. Enhanced
|
||||
IBRS on x86), retpoline is automatically disabled at run time.
|
||||
|
||||
The retpoline mitigation is turned on by default on vulnerable
|
||||
CPUs. It can be forced on or off by the administrator
|
||||
via the kernel command line and sysfs control files. See
|
||||
:ref:`spectre_mitigation_control_command_line`.
|
||||
|
||||
On x86, indirect branch restricted speculation is turned on by default
|
||||
before invoking any firmware code to prevent Spectre variant 2 exploits
|
||||
using the firmware.
|
||||
|
||||
Using kernel address space randomization (CONFIG_RANDOMIZE_BASE=y
|
||||
and CONFIG_SLAB_FREELIST_RANDOM=y in the kernel configuration) makes
|
||||
attacks on the kernel generally more difficult.
|
||||
|
||||
2. User program mitigation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
User programs can mitigate Spectre variant 1 using LFENCE or "bounds
|
||||
clipping". For more details see :ref:`[2] <spec_ref2>`.
|
||||
|
||||
For Spectre variant 2 mitigation, individual user programs
|
||||
can be compiled with return trampolines for indirect branches.
|
||||
This protects them from consuming poisoned entries in the branch
|
||||
target buffer left by malicious software. Alternatively, the
|
||||
programs can disable their indirect branch speculation via prctl()
|
||||
(See Documentation/spec_ctrl.txt).
|
||||
On x86, this will turn on STIBP to guard against attacks from the
|
||||
sibling thread when the user program is running, and use IBPB to
|
||||
flush the branch target buffer when switching to/from the program.
|
||||
|
||||
Restricting indirect branch speculation on a user program will
|
||||
also prevent the program from launching a variant 2 attack
|
||||
on x86. All sand-boxed SECCOMP programs have indirect branch
|
||||
speculation restricted by default. Administrators can change
|
||||
that behavior via the kernel command line and sysfs control files.
|
||||
See :ref:`spectre_mitigation_control_command_line`.
|
||||
|
||||
Programs that disable their indirect branch speculation will have
|
||||
more overhead and run slower.
|
||||
|
||||
User programs should use address space randomization
|
||||
(/proc/sys/kernel/randomize_va_space = 1 or 2) to make attacks more
|
||||
difficult.
|
||||
|
||||
3. VM mitigation
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Within the kernel, Spectre variant 1 attacks from rogue guests are
|
||||
mitigated on a case by case basis in VM exit paths. Vulnerable code
|
||||
uses nospec accessor macros for "bounds clipping", to avoid any
|
||||
usable disclosure gadgets. However, this may not cover all variant
|
||||
1 attack vectors.
|
||||
|
||||
For Spectre variant 2 attacks from rogue guests to the kernel, the
|
||||
Linux kernel uses retpoline or Enhanced IBRS to prevent consumption of
|
||||
poisoned entries in branch target buffer left by rogue guests. It also
|
||||
flushes the return stack buffer on every VM exit to prevent a return
|
||||
stack buffer underflow so poisoned branch target buffer could be used,
|
||||
or attacker guests leaving poisoned entries in the return stack buffer.
|
||||
|
||||
To mitigate guest-to-guest attacks in the same CPU hardware thread,
|
||||
the branch target buffer is sanitized by flushing before switching
|
||||
to a new guest on a CPU.
|
||||
|
||||
The above mitigations are turned on by default on vulnerable CPUs.
|
||||
|
||||
To mitigate guest-to-guest attacks from sibling thread when SMT is
|
||||
in use, an untrusted guest running in the sibling thread can have
|
||||
its indirect branch speculation disabled by administrator via prctl().
|
||||
|
||||
The kernel also allows guests to use any microcode based mitigation
|
||||
they choose to use (such as IBPB or STIBP on x86) to protect themselves.
|
||||
|
||||
.. _spectre_mitigation_control_command_line:
|
||||
|
||||
Mitigation control on the kernel command line
|
||||
---------------------------------------------
|
||||
|
||||
Spectre variant 2 mitigation can be disabled or force enabled at the
|
||||
kernel command line.
|
||||
|
||||
nospectre_v1
|
||||
|
||||
[X86,PPC] Disable mitigations for Spectre Variant 1
|
||||
(bounds check bypass). With this option data leaks are
|
||||
possible in the system.
|
||||
|
||||
nospectre_v2
|
||||
|
||||
[X86] Disable all mitigations for the Spectre variant 2
|
||||
(indirect branch prediction) vulnerability. System may
|
||||
allow data leaks with this option, which is equivalent
|
||||
to spectre_v2=off.
|
||||
|
||||
|
||||
spectre_v2=
|
||||
|
||||
[X86] Control mitigation of Spectre variant 2
|
||||
(indirect branch speculation) vulnerability.
|
||||
The default operation protects the kernel from
|
||||
user space attacks.
|
||||
|
||||
on
|
||||
unconditionally enable, implies
|
||||
spectre_v2_user=on
|
||||
off
|
||||
unconditionally disable, implies
|
||||
spectre_v2_user=off
|
||||
auto
|
||||
kernel detects whether your CPU model is
|
||||
vulnerable
|
||||
|
||||
Selecting 'on' will, and 'auto' may, choose a
|
||||
mitigation method at run time according to the
|
||||
CPU, the available microcode, the setting of the
|
||||
CONFIG_RETPOLINE configuration option, and the
|
||||
compiler with which the kernel was built.
|
||||
|
||||
Selecting 'on' will also enable the mitigation
|
||||
against user space to user space task attacks.
|
||||
|
||||
Selecting 'off' will disable both the kernel and
|
||||
the user space protections.
|
||||
|
||||
Specific mitigations can also be selected manually:
|
||||
|
||||
retpoline auto pick between generic,lfence
|
||||
retpoline,generic Retpolines
|
||||
retpoline,lfence LFENCE; indirect branch
|
||||
retpoline,amd alias for retpoline,lfence
|
||||
eibrs enhanced IBRS
|
||||
eibrs,retpoline enhanced IBRS + Retpolines
|
||||
eibrs,lfence enhanced IBRS + LFENCE
|
||||
|
||||
Not specifying this option is equivalent to
|
||||
spectre_v2=auto.
|
||||
|
||||
For user space mitigation:
|
||||
|
||||
spectre_v2_user=
|
||||
|
||||
[X86] Control mitigation of Spectre variant 2
|
||||
(indirect branch speculation) vulnerability between
|
||||
user space tasks
|
||||
|
||||
on
|
||||
Unconditionally enable mitigations. Is
|
||||
enforced by spectre_v2=on
|
||||
|
||||
off
|
||||
Unconditionally disable mitigations. Is
|
||||
enforced by spectre_v2=off
|
||||
|
||||
prctl
|
||||
Indirect branch speculation is enabled,
|
||||
but mitigation can be enabled via prctl
|
||||
per thread. The mitigation control state
|
||||
is inherited on fork.
|
||||
|
||||
prctl,ibpb
|
||||
Like "prctl" above, but only STIBP is
|
||||
controlled per thread. IBPB is issued
|
||||
always when switching between different user
|
||||
space processes.
|
||||
|
||||
seccomp
|
||||
Same as "prctl" above, but all seccomp
|
||||
threads will enable the mitigation unless
|
||||
they explicitly opt out.
|
||||
|
||||
seccomp,ibpb
|
||||
Like "seccomp" above, but only STIBP is
|
||||
controlled per thread. IBPB is issued
|
||||
always when switching between different
|
||||
user space processes.
|
||||
|
||||
auto
|
||||
Kernel selects the mitigation depending on
|
||||
the available CPU features and vulnerability.
|
||||
|
||||
Default mitigation:
|
||||
If CONFIG_SECCOMP=y then "seccomp", otherwise "prctl"
|
||||
|
||||
Not specifying this option is equivalent to
|
||||
spectre_v2_user=auto.
|
||||
|
||||
In general the kernel by default selects
|
||||
reasonable mitigations for the current CPU. To
|
||||
disable Spectre variant 2 mitigations, boot with
|
||||
spectre_v2=off. Spectre variant 1 mitigations
|
||||
cannot be disabled.
|
||||
|
||||
Mitigation selection guide
|
||||
--------------------------
|
||||
|
||||
1. Trusted userspace
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If all userspace applications are from trusted sources and do not
|
||||
execute externally supplied untrusted code, then the mitigations can
|
||||
be disabled.
|
||||
|
||||
2. Protect sensitive programs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For security-sensitive programs that have secrets (e.g. crypto
|
||||
keys), protection against Spectre variant 2 can be put in place by
|
||||
disabling indirect branch speculation when the program is running
|
||||
(See Documentation/spec_ctrl.txt).
|
||||
|
||||
3. Sandbox untrusted programs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Untrusted programs that could be a source of attacks can be cordoned
|
||||
off by disabling their indirect branch speculation when they are run
|
||||
(See Documentation/spec_ctrl.txt).
|
||||
This prevents untrusted programs from polluting the branch target
|
||||
buffer. All programs running in SECCOMP sandboxes have indirect
|
||||
branch speculation restricted by default. This behavior can be
|
||||
changed via the kernel command line and sysfs control files. See
|
||||
:ref:`spectre_mitigation_control_command_line`.
|
||||
|
||||
3. High security mode
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
All Spectre variant 2 mitigations can be forced on
|
||||
at boot time for all programs (See the "on" option in
|
||||
:ref:`spectre_mitigation_control_command_line`). This will add
|
||||
overhead as indirect branch speculations for all programs will be
|
||||
restricted.
|
||||
|
||||
On x86, branch target buffer will be flushed with IBPB when switching
|
||||
to a new program. STIBP is left on all the time to protect programs
|
||||
against variant 2 attacks originating from programs running on
|
||||
sibling threads.
|
||||
|
||||
Alternatively, STIBP can be used only when running programs
|
||||
whose indirect branch speculation is explicitly disabled,
|
||||
while IBPB is still used all the time when switching to a new
|
||||
program to clear the branch target buffer (See "ibpb" option in
|
||||
:ref:`spectre_mitigation_control_command_line`). This "ibpb" option
|
||||
has less performance cost than the "on" option, which leaves STIBP
|
||||
on all the time.
|
||||
|
||||
References on Spectre
|
||||
---------------------
|
||||
|
||||
Intel white papers:
|
||||
|
||||
.. _spec_ref1:
|
||||
|
||||
[1] `Intel analysis of speculative execution side channels <https://newsroom.intel.com/wp-content/uploads/sites/11/2018/01/Intel-Analysis-of-Speculative-Execution-Side-Channels.pdf>`_.
|
||||
|
||||
.. _spec_ref2:
|
||||
|
||||
[2] `Bounds check bypass <https://software.intel.com/security-software-guidance/software-guidance/bounds-check-bypass>`_.
|
||||
|
||||
.. _spec_ref3:
|
||||
|
||||
[3] `Deep dive: Retpoline: A branch target injection mitigation <https://software.intel.com/security-software-guidance/insights/deep-dive-retpoline-branch-target-injection-mitigation>`_.
|
||||
|
||||
.. _spec_ref4:
|
||||
|
||||
[4] `Deep Dive: Single Thread Indirect Branch Predictors <https://software.intel.com/security-software-guidance/insights/deep-dive-single-thread-indirect-branch-predictors>`_.
|
||||
|
||||
AMD white papers:
|
||||
|
||||
.. _spec_ref5:
|
||||
|
||||
[5] `AMD64 technology indirect branch control extension <https://developer.amd.com/wp-content/resources/Architecture_Guidelines_Update_Indirect_Branch_Control.pdf>`_.
|
||||
|
||||
.. _spec_ref6:
|
||||
|
||||
[6] `Software techniques for managing speculation on AMD processors <https://developer.amd.com/wp-content/resources/Managing-Speculation-on-AMD-Processors.pdf>`_.
|
||||
|
||||
ARM white papers:
|
||||
|
||||
.. _spec_ref7:
|
||||
|
||||
[7] `Cache speculation side-channels <https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/download-the-whitepaper>`_.
|
||||
|
||||
.. _spec_ref8:
|
||||
|
||||
[8] `Cache speculation issues update <https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/latest-updates/cache-speculation-issues-update>`_.
|
||||
|
||||
Google white paper:
|
||||
|
||||
.. _spec_ref9:
|
||||
|
||||
[9] `Retpoline: a software construct for preventing branch-target-injection <https://support.google.com/faqs/answer/7625886>`_.
|
||||
|
||||
MIPS white paper:
|
||||
|
||||
.. _spec_ref10:
|
||||
|
||||
[10] `MIPS: response on speculative execution and side channel vulnerabilities <https://www.mips.com/blog/mips-response-on-speculative-execution-and-side-channel-vulnerabilities/>`_.
|
||||
|
||||
Academic papers:
|
||||
|
||||
.. _spec_ref11:
|
||||
|
||||
[11] `Spectre Attacks: Exploiting Speculative Execution <https://spectreattack.com/spectre.pdf>`_.
|
||||
|
||||
.. _spec_ref12:
|
||||
|
||||
[12] `NetSpectre: Read Arbitrary Memory over Network <https://arxiv.org/abs/1807.10535>`_.
|
||||
|
||||
.. _spec_ref13:
|
||||
|
||||
[13] `Spectre Returns! Speculation Attacks using the Return Stack Buffer <https://www.usenix.org/system/files/conference/woot18/woot18-paper-koruyeh.pdf>`_.
|
||||
@@ -756,15 +756,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
loops can be debugged more effectively on production
|
||||
systems.
|
||||
|
||||
clocksource.arm_arch_timer.fsl-a008585=
|
||||
[ARM64]
|
||||
Format: <bool>
|
||||
Enable/disable the workaround of Freescale/NXP
|
||||
erratum A-008585. This can be useful for KVM
|
||||
guests, if the guest device tree doesn't show the
|
||||
erratum. If unspecified, the workaround is
|
||||
enabled based on the device tree.
|
||||
|
||||
clearcpuid=BITNUM [X86]
|
||||
Disable CPUID feature X for the kernel. See
|
||||
arch/x86/include/asm/cpufeatures.h for the valid bit
|
||||
@@ -2549,6 +2540,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
mds=off [X86]
|
||||
tsx_async_abort=off [X86]
|
||||
kvm.nx_huge_pages=off [X86]
|
||||
no_entry_flush [PPC]
|
||||
no_uaccess_flush [PPC]
|
||||
mmio_stale_data=off [X86]
|
||||
|
||||
Exceptions:
|
||||
This does not have any effect on
|
||||
@@ -2570,6 +2564,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
Equivalent to: l1tf=flush,nosmt [X86]
|
||||
mds=full,nosmt [X86]
|
||||
tsx_async_abort=full,nosmt [X86]
|
||||
mmio_stale_data=full,nosmt [X86]
|
||||
|
||||
mminit_loglevel=
|
||||
[KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
|
||||
@@ -2579,6 +2574,40 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
log everything. Information is printed at KERN_DEBUG
|
||||
so loglevel=8 may also need to be specified.
|
||||
|
||||
mmio_stale_data=
|
||||
[X86,INTEL] Control mitigation for the Processor
|
||||
MMIO Stale Data vulnerabilities.
|
||||
|
||||
Processor MMIO Stale Data is a class of
|
||||
vulnerabilities that may expose data after an MMIO
|
||||
operation. Exposed data could originate or end in
|
||||
the same CPU buffers as affected by MDS and TAA.
|
||||
Therefore, similar to MDS and TAA, the mitigation
|
||||
is to clear the affected CPU buffers.
|
||||
|
||||
This parameter controls the mitigation. The
|
||||
options are:
|
||||
|
||||
full - Enable mitigation on vulnerable CPUs
|
||||
|
||||
full,nosmt - Enable mitigation and disable SMT on
|
||||
vulnerable CPUs.
|
||||
|
||||
off - Unconditionally disable mitigation
|
||||
|
||||
On MDS or TAA affected machines,
|
||||
mmio_stale_data=off can be prevented by an active
|
||||
MDS or TAA mitigation as these vulnerabilities are
|
||||
mitigated with the same mechanism so in order to
|
||||
disable this mitigation, you need to specify
|
||||
mds=off and tsx_async_abort=off too.
|
||||
|
||||
Not specifying this option is equivalent to
|
||||
mmio_stale_data=full.
|
||||
|
||||
For details see:
|
||||
Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
|
||||
|
||||
module.sig_enforce
|
||||
[KNL] When CONFIG_MODULE_SIG is set, this means that
|
||||
modules without (valid) signatures will fail to load.
|
||||
@@ -2855,6 +2884,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
|
||||
noefi Disable EFI runtime services support.
|
||||
|
||||
no_entry_flush [PPC] Don't flush the L1-D cache when entering the kernel.
|
||||
|
||||
noexec [IA-64]
|
||||
|
||||
noexec [X86]
|
||||
@@ -2904,6 +2935,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
nospec_store_bypass_disable
|
||||
[HW] Disable all mitigations for the Speculative Store Bypass vulnerability
|
||||
|
||||
no_uaccess_flush
|
||||
[PPC] Don't flush the L1-D cache after accessing user data.
|
||||
|
||||
noxsave [BUGS=X86] Disables x86 extended register state save
|
||||
and restore using xsave. The kernel will fallback to
|
||||
enabling legacy floating-point and sse state.
|
||||
@@ -3569,6 +3603,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
|
||||
See Documentation/blockdev/ramdisk.txt.
|
||||
|
||||
random.trust_cpu={on,off}
|
||||
[KNL] Enable or disable trusting the use of the
|
||||
CPU's random number generator (if available) to
|
||||
fully seed the kernel's CRNG. Default is controlled
|
||||
by CONFIG_RANDOM_TRUST_CPU.
|
||||
|
||||
random.trust_bootloader={on,off}
|
||||
[KNL] Enable or disable trusting the use of a
|
||||
seed passed by the bootloader (if available) to
|
||||
fully seed the kernel's CRNG. Default is controlled
|
||||
by CONFIG_RANDOM_TRUST_BOOTLOADER.
|
||||
|
||||
rcu_nocbs= [KNL]
|
||||
The argument is a cpu list, as described above.
|
||||
|
||||
@@ -4201,8 +4247,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
Specific mitigations can also be selected manually:
|
||||
|
||||
retpoline - replace indirect branches
|
||||
retpoline,generic - google's original retpoline
|
||||
retpoline,amd - AMD-specific minimal thunk
|
||||
retpoline,generic - Retpolines
|
||||
retpoline,lfence - LFENCE; indirect branch
|
||||
retpoline,amd - alias for retpoline,lfence
|
||||
eibrs - enhanced IBRS
|
||||
eibrs,retpoline - enhanced IBRS + Retpolines
|
||||
eibrs,lfence - enhanced IBRS + LFENCE
|
||||
|
||||
Not specifying this option is equivalent to
|
||||
spectre_v2=auto.
|
||||
@@ -5054,6 +5104,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
Disables the PV optimizations forcing the HVM guest to
|
||||
run as generic HVM guest with no PV drivers.
|
||||
|
||||
xen.event_eoi_delay= [XEN]
|
||||
How long to delay EOI handling in case of event
|
||||
storms (jiffies). Default is 10.
|
||||
|
||||
xen.event_loop_timeout= [XEN]
|
||||
After which time (jiffies) the event handling loop
|
||||
should start to delay EOI handling. Default is 2.
|
||||
|
||||
xirc2ps_cs= [NET,PCMCIA]
|
||||
Format:
|
||||
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
|
||||
|
||||
@@ -48,8 +48,11 @@ depends on the delivery system and on the device:
|
||||
|
||||
- This call requires read/write access to the device.
|
||||
|
||||
- At return, the values are updated to reflect the actual parameters
|
||||
used.
|
||||
.. note::
|
||||
|
||||
At return, the values aren't updated to reflect the actual
|
||||
parameters used. If the actual parameters are needed, an explicit
|
||||
call to ``FE_GET_PROPERTY`` is needed.
|
||||
|
||||
- ``FE_GET_PROPERTY:``
|
||||
|
||||
|
||||
@@ -191,11 +191,12 @@ ad_actor_sys_prio
|
||||
ad_actor_system
|
||||
|
||||
In an AD system, this specifies the mac-address for the actor in
|
||||
protocol packet exchanges (LACPDUs). The value cannot be NULL or
|
||||
multicast. It is preferred to have the local-admin bit set for this
|
||||
mac but driver does not enforce it. If the value is not given then
|
||||
system defaults to using the masters' mac address as actors' system
|
||||
address.
|
||||
protocol packet exchanges (LACPDUs). The value cannot be a multicast
|
||||
address. If the all-zeroes MAC is specified, bonding will internally
|
||||
use the MAC of the bond itself. It is preferred to have the
|
||||
local-admin bit set for this mac but driver does not enforce it. If
|
||||
the value is not given then system defaults to using the masters'
|
||||
mac address as actors' system address.
|
||||
|
||||
This parameter has effect only in 802.3ad mode and is available through
|
||||
SysFs interface.
|
||||
|
||||
@@ -801,7 +801,7 @@ cipso_cache_enable - BOOLEAN
|
||||
cipso_cache_bucket_size - INTEGER
|
||||
The CIPSO label cache consists of a fixed size hash table with each
|
||||
hash bucket containing a number of cache entries. This variable limits
|
||||
the number of entries in each hash bucket; the larger the value the
|
||||
the number of entries in each hash bucket; the larger the value is, the
|
||||
more CIPSO label mappings that can be cached. When the number of
|
||||
entries in a given hash bucket reaches this limit adding new entries
|
||||
causes the oldest entry in the bucket to be removed to make room.
|
||||
@@ -874,7 +874,7 @@ ip_nonlocal_bind - BOOLEAN
|
||||
which can be quite useful - but may break some applications.
|
||||
Default: 0
|
||||
|
||||
ip_dynaddr - BOOLEAN
|
||||
ip_dynaddr - INTEGER
|
||||
If set non-zero, enables support for dynamic addresses.
|
||||
If set to a non-zero value larger than 1, a kernel log
|
||||
message will be printed when dynamic address rewriting
|
||||
@@ -1626,7 +1626,7 @@ use_tempaddr - INTEGER
|
||||
|
||||
temp_valid_lft - INTEGER
|
||||
valid lifetime (in seconds) for temporary addresses.
|
||||
Default: 604800 (7 days)
|
||||
Default: 172800 (2 days)
|
||||
|
||||
temp_prefered_lft - INTEGER
|
||||
Preferred lifetime (in seconds) for temporary addresses.
|
||||
@@ -1752,6 +1752,16 @@ stable_secret - IPv6 address
|
||||
|
||||
By default the stable secret is unset.
|
||||
|
||||
addr_gen_mode - INTEGER
|
||||
Defines how link-local and autoconf addresses are generated.
|
||||
|
||||
0: generate address based on EUI64 (default)
|
||||
1: do no generate a link-local address, use EUI64 for addresses generated
|
||||
from autoconf
|
||||
2: generate stable privacy addresses, using the secret from
|
||||
stable_secret (RFC7217)
|
||||
3: generate stable privacy addresses, using a random secret if unset
|
||||
|
||||
drop_unicast_in_l2_multicast - BOOLEAN
|
||||
Drop any unicast IPv6 packets that are received in link-layer
|
||||
multicast (or broadcast) frames.
|
||||
|
||||
@@ -190,6 +190,39 @@ Example:
|
||||
for (node = rb_first(&mytree); node; node = rb_next(node))
|
||||
printk("key=%s\n", rb_entry(node, struct mytype, node)->keystring);
|
||||
|
||||
Cached rbtrees
|
||||
--------------
|
||||
|
||||
Computing the leftmost (smallest) node is quite a common task for binary
|
||||
search trees, such as for traversals or users relying on a the particular
|
||||
order for their own logic. To this end, users can use 'struct rb_root_cached'
|
||||
to optimize O(logN) rb_first() calls to a simple pointer fetch avoiding
|
||||
potentially expensive tree iterations. This is done at negligible runtime
|
||||
overhead for maintanence; albeit larger memory footprint.
|
||||
|
||||
Similar to the rb_root structure, cached rbtrees are initialized to be
|
||||
empty via:
|
||||
|
||||
struct rb_root_cached mytree = RB_ROOT_CACHED;
|
||||
|
||||
Cached rbtree is simply a regular rb_root with an extra pointer to cache the
|
||||
leftmost node. This allows rb_root_cached to exist wherever rb_root does,
|
||||
which permits augmented trees to be supported as well as only a few extra
|
||||
interfaces:
|
||||
|
||||
struct rb_node *rb_first_cached(struct rb_root_cached *tree);
|
||||
void rb_insert_color_cached(struct rb_node *, struct rb_root_cached *, bool);
|
||||
void rb_erase_cached(struct rb_node *node, struct rb_root_cached *);
|
||||
|
||||
Both insert and erase calls have their respective counterpart of augmented
|
||||
trees:
|
||||
|
||||
void rb_insert_augmented_cached(struct rb_node *node, struct rb_root_cached *,
|
||||
bool, struct rb_augment_callbacks *);
|
||||
void rb_erase_augmented_cached(struct rb_node *, struct rb_root_cached *,
|
||||
struct rb_augment_callbacks *);
|
||||
|
||||
|
||||
Support for Augmented rbtrees
|
||||
-----------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use Text::Tabs;
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ show up in /proc/sys/kernel:
|
||||
- sysctl_writes_strict
|
||||
- tainted
|
||||
- threads-max
|
||||
- unprivileged_bpf_disabled
|
||||
- unknown_nmi_panic
|
||||
- watchdog
|
||||
- watchdog_thresh
|
||||
@@ -803,9 +804,40 @@ The kernel command line parameter printk.devkmsg= overrides this and is
|
||||
a one-time setting until next reboot: once set, it cannot be changed by
|
||||
this sysctl interface anymore.
|
||||
|
||||
==============================================================
|
||||
pty
|
||||
===
|
||||
|
||||
randomize_va_space:
|
||||
See Documentation/filesystems/devpts.rst.
|
||||
|
||||
|
||||
random
|
||||
======
|
||||
|
||||
This is a directory, with the following entries:
|
||||
|
||||
* ``boot_id``: a UUID generated the first time this is retrieved, and
|
||||
unvarying after that;
|
||||
|
||||
* ``uuid``: a UUID generated every time this is retrieved (this can
|
||||
thus be used to generate UUIDs at will);
|
||||
|
||||
* ``entropy_avail``: the pool's entropy count, in bits;
|
||||
|
||||
* ``poolsize``: the entropy pool size, in bits;
|
||||
|
||||
* ``urandom_min_reseed_secs``: obsolete (used to determine the minimum
|
||||
number of seconds between urandom pool reseeding). This file is
|
||||
writable for compatibility purposes, but writing to it has no effect
|
||||
on any RNG behavior;
|
||||
|
||||
* ``write_wakeup_threshold``: when the entropy count drops below this
|
||||
(as a number of bits), processes waiting to write to ``/dev/random``
|
||||
are woken up. This file is writable for compatibility purposes, but
|
||||
writing to it has no effect on any RNG behavior.
|
||||
|
||||
|
||||
randomize_va_space
|
||||
==================
|
||||
|
||||
This option can be used to select the type of process address
|
||||
space randomization that is used in the system, for architectures
|
||||
@@ -1022,6 +1054,26 @@ available RAM pages threads-max is reduced accordingly.
|
||||
|
||||
==============================================================
|
||||
|
||||
unprivileged_bpf_disabled:
|
||||
|
||||
Writing 1 to this entry will disable unprivileged calls to bpf();
|
||||
once disabled, calling bpf() without CAP_SYS_ADMIN will return
|
||||
-EPERM. Once set to 1, this can't be cleared from the running kernel
|
||||
anymore.
|
||||
|
||||
Writing 2 to this entry will also disable unprivileged calls to bpf(),
|
||||
however, an admin can still change this setting later on, if needed, by
|
||||
writing 0 or 1 to this entry.
|
||||
|
||||
If BPF_UNPRIV_DEFAULT_OFF is enabled in the kernel config, then this
|
||||
entry will default to 2 instead of 0.
|
||||
|
||||
0 - Unprivileged calls to bpf() are enabled
|
||||
1 - Unprivileged calls to bpf() are disabled without recovery
|
||||
2 - Unprivileged calls to bpf() are disabled
|
||||
|
||||
==============================================================
|
||||
|
||||
unknown_nmi_panic:
|
||||
|
||||
The value in this file affects behavior of handling NMI. When the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
|
||||
#
|
||||
# Copyright (c) 2010 Rising Tide Systems
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
# add symbolic names to read_msr / write_msr in trace
|
||||
# decode_msr msr-index.h < trace
|
||||
import sys
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
# This is a POC (proof of concept or piece of crap, take your pick) for reading the
|
||||
# text representation of trace output related to page allocation. It makes an attempt
|
||||
# to extract some high-level information on what is going on. The accuracy of the parser
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
# This is a POC for reading the text representation of trace output related to
|
||||
# page reclaim. It makes an attempt to extract some high-level information on
|
||||
# what is going on. The accuracy of the parser may vary
|
||||
|
||||
@@ -3534,9 +3534,11 @@ EOI was received.
|
||||
#define KVM_EXIT_HYPERV_SYNIC 1
|
||||
#define KVM_EXIT_HYPERV_HCALL 2
|
||||
__u32 type;
|
||||
__u32 pad1;
|
||||
union {
|
||||
struct {
|
||||
__u32 msr;
|
||||
__u32 pad2;
|
||||
__u64 control;
|
||||
__u64 evt_page;
|
||||
__u64 msg_page;
|
||||
|
||||
@@ -152,8 +152,8 @@ Shadow pages contain the following information:
|
||||
shadow pages) so role.quadrant takes values in the range 0..3. Each
|
||||
quadrant maps 1GB virtual address space.
|
||||
role.access:
|
||||
Inherited guest access permissions in the form uwx. Note execute
|
||||
permission is positive, not negative.
|
||||
Inherited guest access permissions from the parent ptes in the form uwx.
|
||||
Note execute permission is positive, not negative.
|
||||
role.invalid:
|
||||
The page is invalid and should not be used. It is a root page that is
|
||||
currently pinned (by a cpu hardware register pointing to it); once it is
|
||||
|
||||
@@ -10079,6 +10079,7 @@ F: drivers/block/brd.c
|
||||
|
||||
RANDOM NUMBER DRIVER
|
||||
M: "Theodore Ts'o" <tytso@mit.edu>
|
||||
M: Jason A. Donenfeld <Jason@zx2c4.com>
|
||||
S: Maintained
|
||||
F: drivers/char/random.c
|
||||
|
||||
|
||||
43
Makefile
43
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 227
|
||||
SUBLEVEL = 337
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
@@ -324,12 +324,8 @@ KBUILD_MODULES :=
|
||||
KBUILD_BUILTIN := 1
|
||||
|
||||
# If we have only "make modules", don't compile built-in objects.
|
||||
# When we're building modules with modversions, we need to consider
|
||||
# the built-in objects during the descend as well, in order to
|
||||
# make sure the checksums are up to date before we record them.
|
||||
|
||||
ifeq ($(MAKECMDGOALS),modules)
|
||||
KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
|
||||
KBUILD_BUILTIN :=
|
||||
endif
|
||||
|
||||
# If we have "make <whatever> modules", compile modules
|
||||
@@ -377,7 +373,7 @@ endif
|
||||
AWK = awk
|
||||
GENKSYMS = scripts/genksyms/genksyms
|
||||
INSTALLKERNEL := installkernel
|
||||
DEPMOD = /sbin/depmod
|
||||
DEPMOD = depmod
|
||||
PERL = perl
|
||||
PYTHON = python
|
||||
CHECK = sparse
|
||||
@@ -865,6 +861,13 @@ ifdef CONFIG_FUNCTION_TRACER
|
||||
ifndef CC_FLAGS_FTRACE
|
||||
CC_FLAGS_FTRACE := -pg
|
||||
endif
|
||||
ifdef CONFIG_FTRACE_MCOUNT_RECORD
|
||||
# gcc 5 supports generating the mcount tables directly
|
||||
ifeq ($(call cc-option-yn,-mrecord-mcount),y)
|
||||
CC_FLAGS_FTRACE += -mrecord-mcount
|
||||
export CC_USING_RECORD_MCOUNT := 1
|
||||
endif
|
||||
endif
|
||||
export CC_FLAGS_FTRACE
|
||||
ifdef CONFIG_HAVE_FENTRY
|
||||
CC_USING_FENTRY := $(call cc-option, -mfentry -DCC_USING_FENTRY)
|
||||
@@ -944,12 +947,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
|
||||
# change __FILE__ to the relative path from the srctree
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||
|
||||
# ensure -fcf-protection is disabled when using retpoline as it is
|
||||
# incompatible with -mindirect-branch=thunk-extern
|
||||
ifdef CONFIG_RETPOLINE
|
||||
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
|
||||
endif
|
||||
|
||||
# use the deterministic mode of AR if available
|
||||
KBUILD_ARFLAGS := $(call ar-option,D)
|
||||
|
||||
@@ -1263,17 +1260,22 @@ endif
|
||||
# needs to be updated, so this check is forced on all builds
|
||||
|
||||
uts_len := 64
|
||||
ifneq (,$(BUILD_NUMBER))
|
||||
UTS_RELEASE=$(KERNELRELEASE)-ab$(BUILD_NUMBER)
|
||||
else
|
||||
UTS_RELEASE=$(KERNELRELEASE)
|
||||
endif
|
||||
define filechk_utsrelease.h
|
||||
if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
|
||||
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
|
||||
if [ `echo -n "$(UTS_RELEASE)" | wc -c ` -gt $(uts_len) ]; then \
|
||||
echo '"$(UTS_RELEASE)" exceeds $(uts_len) characters' >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
|
||||
(echo \#define UTS_RELEASE \"$(UTS_RELEASE)\";)
|
||||
endef
|
||||
|
||||
define filechk_version.h
|
||||
(echo \#define LINUX_VERSION_CODE $(shell \
|
||||
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
|
||||
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
|
||||
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
|
||||
endef
|
||||
|
||||
@@ -1367,6 +1369,13 @@ ifdef CONFIG_MODULES
|
||||
|
||||
all: modules
|
||||
|
||||
# When we're building modules with modversions, we need to consider
|
||||
# the built-in objects during the descend as well, in order to
|
||||
# make sure the checksums are up to date before we record them.
|
||||
ifdef CONFIG_MODVERSIONS
|
||||
KBUILD_BUILTIN := 1
|
||||
endif
|
||||
|
||||
# Build modules
|
||||
#
|
||||
# A module can be listed more than once in obj-m resulting in
|
||||
|
||||
@@ -60,7 +60,7 @@ extern inline void set_hae(unsigned long new_hae)
|
||||
* Change virtual addresses to physical addresses and vv.
|
||||
*/
|
||||
#ifdef USE_48_BIT_KSEG
|
||||
static inline unsigned long virt_to_phys(void *address)
|
||||
static inline unsigned long virt_to_phys(volatile void *address)
|
||||
{
|
||||
return (unsigned long)address - IDENT_ADDR;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ static inline void * phys_to_virt(unsigned long address)
|
||||
return (void *) (address + IDENT_ADDR);
|
||||
}
|
||||
#else
|
||||
static inline unsigned long virt_to_phys(void *address)
|
||||
static inline unsigned long virt_to_phys(volatile void *address)
|
||||
{
|
||||
unsigned long phys = (unsigned long)address;
|
||||
|
||||
@@ -111,7 +111,7 @@ static inline dma_addr_t __deprecated isa_page_to_bus(struct page *page)
|
||||
extern unsigned long __direct_map_base;
|
||||
extern unsigned long __direct_map_size;
|
||||
|
||||
static inline unsigned long __deprecated virt_to_bus(void *address)
|
||||
static inline unsigned long __deprecated virt_to_bus(volatile void *address)
|
||||
{
|
||||
unsigned long phys = virt_to_phys(address);
|
||||
unsigned long bus = phys + __direct_map_base;
|
||||
@@ -491,10 +491,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ioread16be(p) be16_to_cpu(ioread16(p))
|
||||
#define ioread32be(p) be32_to_cpu(ioread32(p))
|
||||
#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p))
|
||||
#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p))
|
||||
#define ioread16be(p) swab16(ioread16(p))
|
||||
#define ioread32be(p) swab32(ioread32(p))
|
||||
#define iowrite16be(v,p) iowrite16(swab16(v), (p))
|
||||
#define iowrite32be(v,p) iowrite32(swab32(v), (p))
|
||||
|
||||
#define inb_p inb
|
||||
#define inw_p inw
|
||||
|
||||
@@ -27,5 +27,6 @@ static inline cycles_t get_cycles (void)
|
||||
__asm__ __volatile__ ("rpcc %0" : "=r"(ret));
|
||||
return ret;
|
||||
}
|
||||
#define get_cycles get_cycles
|
||||
|
||||
#endif
|
||||
|
||||
@@ -341,45 +341,17 @@ __asm__ __volatile__("1: stb %r2,%1\n" \
|
||||
* Complex access routines
|
||||
*/
|
||||
|
||||
/* This little bit of silliness is to get the GP loaded for a function
|
||||
that ordinarily wouldn't. Otherwise we could have it done by the macro
|
||||
directly, which can be optimized the linker. */
|
||||
#ifdef MODULE
|
||||
#define __module_address(sym) "r"(sym),
|
||||
#define __module_call(ra, arg, sym) "jsr $" #ra ",(%" #arg ")," #sym
|
||||
#else
|
||||
#define __module_address(sym)
|
||||
#define __module_call(ra, arg, sym) "bsr $" #ra "," #sym " !samegp"
|
||||
#endif
|
||||
|
||||
extern void __copy_user(void);
|
||||
|
||||
extern inline long
|
||||
__copy_tofrom_user_nocheck(void *to, const void *from, long len)
|
||||
{
|
||||
register void * __cu_to __asm__("$6") = to;
|
||||
register const void * __cu_from __asm__("$7") = from;
|
||||
register long __cu_len __asm__("$0") = len;
|
||||
|
||||
__asm__ __volatile__(
|
||||
__module_call(28, 3, __copy_user)
|
||||
: "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to)
|
||||
: __module_address(__copy_user)
|
||||
"0" (__cu_len), "1" (__cu_from), "2" (__cu_to)
|
||||
: "$1", "$2", "$3", "$4", "$5", "$28", "memory");
|
||||
|
||||
return __cu_len;
|
||||
}
|
||||
extern long __copy_user(void *to, const void *from, long len);
|
||||
|
||||
#define __copy_to_user(to, from, n) \
|
||||
({ \
|
||||
__chk_user_ptr(to); \
|
||||
__copy_tofrom_user_nocheck((__force void *)(to), (from), (n)); \
|
||||
__copy_user((__force void *)(to), (from), (n)); \
|
||||
})
|
||||
#define __copy_from_user(to, from, n) \
|
||||
({ \
|
||||
__chk_user_ptr(from); \
|
||||
__copy_tofrom_user_nocheck((to), (__force void *)(from), (n)); \
|
||||
__copy_user((to), (__force void *)(from), (n)); \
|
||||
})
|
||||
|
||||
#define __copy_to_user_inatomic __copy_to_user
|
||||
@@ -389,7 +361,7 @@ extern inline long
|
||||
copy_to_user(void __user *to, const void *from, long n)
|
||||
{
|
||||
if (likely(__access_ok((unsigned long)to, n, get_fs())))
|
||||
n = __copy_tofrom_user_nocheck((__force void *)to, from, n);
|
||||
n = __copy_user((__force void *)to, from, n);
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -404,21 +376,7 @@ copy_from_user(void *to, const void __user *from, long n)
|
||||
return res;
|
||||
}
|
||||
|
||||
extern void __do_clear_user(void);
|
||||
|
||||
extern inline long
|
||||
__clear_user(void __user *to, long len)
|
||||
{
|
||||
register void __user * __cl_to __asm__("$6") = to;
|
||||
register long __cl_len __asm__("$0") = len;
|
||||
__asm__ __volatile__(
|
||||
__module_call(28, 2, __do_clear_user)
|
||||
: "=r"(__cl_len), "=r"(__cl_to)
|
||||
: __module_address(__do_clear_user)
|
||||
"0"(__cl_len), "1"(__cl_to)
|
||||
: "$1", "$2", "$3", "$4", "$5", "$28", "memory");
|
||||
return __cl_len;
|
||||
}
|
||||
extern long __clear_user(void __user *to, long len);
|
||||
|
||||
extern inline long
|
||||
clear_user(void __user *to, long len)
|
||||
@@ -428,9 +386,6 @@ clear_user(void __user *to, long len)
|
||||
return len;
|
||||
}
|
||||
|
||||
#undef __module_address
|
||||
#undef __module_call
|
||||
|
||||
#define user_addr_max() \
|
||||
(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
|
||||
|
||||
|
||||
@@ -468,8 +468,10 @@ entSys:
|
||||
#ifdef CONFIG_AUDITSYSCALL
|
||||
lda $6, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
|
||||
and $3, $6, $3
|
||||
#endif
|
||||
bne $3, strace
|
||||
#else
|
||||
blbs $3, strace /* check for SYSCALL_TRACE in disguise */
|
||||
#endif
|
||||
beq $4, 1f
|
||||
ldq $27, 0($5)
|
||||
1: jsr $26, ($27), alpha_ni_syscall
|
||||
|
||||
@@ -584,7 +584,7 @@ void
|
||||
smp_send_stop(void)
|
||||
{
|
||||
cpumask_t to_whom;
|
||||
cpumask_copy(&to_whom, cpu_possible_mask);
|
||||
cpumask_copy(&to_whom, cpu_online_mask);
|
||||
cpumask_clear_cpu(smp_processor_id(), &to_whom);
|
||||
#ifdef DEBUG_IPI_MSG
|
||||
if (hard_smp_processor_id() != boot_cpu_id)
|
||||
|
||||
@@ -58,7 +58,7 @@ srmcons_do_receive_chars(struct tty_port *port)
|
||||
} while((result.bits.status & 1) && (++loops < 10));
|
||||
|
||||
if (count)
|
||||
tty_schedule_flip(port);
|
||||
tty_flip_buffer_push(port);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,8 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
|
||||
checksum.o \
|
||||
csum_partial_copy.o \
|
||||
$(ev67-y)strlen.o \
|
||||
$(ev67-y)strcat.o \
|
||||
strcpy.o \
|
||||
$(ev67-y)strncat.o \
|
||||
strncpy.o \
|
||||
$(ev6-y)stxcpy.o \
|
||||
$(ev6-y)stxncpy.o \
|
||||
stycpy.o \
|
||||
styncpy.o \
|
||||
$(ev67-y)strchr.o \
|
||||
$(ev67-y)strrchr.o \
|
||||
$(ev6-y)memchr.o \
|
||||
@@ -46,11 +42,20 @@ AFLAGS___remqu.o = -DREM
|
||||
AFLAGS___divlu.o = -DDIV -DINTSIZE
|
||||
AFLAGS___remlu.o = -DREM -DINTSIZE
|
||||
|
||||
$(obj)/__divqu.o: $(obj)/$(ev6-y)divide.S
|
||||
$(cmd_as_o_S)
|
||||
$(obj)/__remqu.o: $(obj)/$(ev6-y)divide.S
|
||||
$(cmd_as_o_S)
|
||||
$(obj)/__divlu.o: $(obj)/$(ev6-y)divide.S
|
||||
$(cmd_as_o_S)
|
||||
$(obj)/__remlu.o: $(obj)/$(ev6-y)divide.S
|
||||
$(cmd_as_o_S)
|
||||
$(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \
|
||||
$(src)/$(ev6-y)divide.S FORCE
|
||||
$(call if_changed_rule,as_o_S)
|
||||
|
||||
# There are direct branches between {str*cpy,str*cat} and stx*cpy.
|
||||
# Ensure the branches are within range by merging these objects.
|
||||
|
||||
LDFLAGS_stycpy.o := -r
|
||||
LDFLAGS_styncpy.o := -r
|
||||
|
||||
$(obj)/stycpy.o: $(obj)/strcpy.o $(obj)/$(ev67-y)strcat.o \
|
||||
$(obj)/$(ev6-y)stxcpy.o FORCE
|
||||
$(call if_changed,ld)
|
||||
|
||||
$(obj)/styncpy.o: $(obj)/strncpy.o $(obj)/$(ev67-y)strncat.o \
|
||||
$(obj)/$(ev6-y)stxncpy.o FORCE
|
||||
$(call if_changed,ld)
|
||||
|
||||
@@ -8,21 +8,6 @@
|
||||
* right "bytes left to zero" value (and that it is updated only _after_
|
||||
* a successful copy). There is also some rather minor exception setup
|
||||
* stuff.
|
||||
*
|
||||
* NOTE! This is not directly C-callable, because the calling semantics
|
||||
* are different:
|
||||
*
|
||||
* Inputs:
|
||||
* length in $0
|
||||
* destination address in $6
|
||||
* exception pointer in $7
|
||||
* return address in $28 (exceptions expect it there)
|
||||
*
|
||||
* Outputs:
|
||||
* bytes left to copy in $0
|
||||
*
|
||||
* Clobbers:
|
||||
* $1,$2,$3,$4,$5,$6
|
||||
*/
|
||||
#include <asm/export.h>
|
||||
|
||||
@@ -38,62 +23,63 @@
|
||||
.set noreorder
|
||||
.align 4
|
||||
|
||||
.globl __do_clear_user
|
||||
.ent __do_clear_user
|
||||
.frame $30, 0, $28
|
||||
.globl __clear_user
|
||||
.ent __clear_user
|
||||
.frame $30, 0, $26
|
||||
.prologue 0
|
||||
|
||||
$loop:
|
||||
and $1, 3, $4 # e0 :
|
||||
beq $4, 1f # .. e1 :
|
||||
|
||||
0: EX( stq_u $31, 0($6) ) # e0 : zero one word
|
||||
0: EX( stq_u $31, 0($16) ) # e0 : zero one word
|
||||
subq $0, 8, $0 # .. e1 :
|
||||
subq $4, 1, $4 # e0 :
|
||||
addq $6, 8, $6 # .. e1 :
|
||||
addq $16, 8, $16 # .. e1 :
|
||||
bne $4, 0b # e1 :
|
||||
unop # :
|
||||
|
||||
1: bic $1, 3, $1 # e0 :
|
||||
beq $1, $tail # .. e1 :
|
||||
|
||||
2: EX( stq_u $31, 0($6) ) # e0 : zero four words
|
||||
2: EX( stq_u $31, 0($16) ) # e0 : zero four words
|
||||
subq $0, 8, $0 # .. e1 :
|
||||
EX( stq_u $31, 8($6) ) # e0 :
|
||||
EX( stq_u $31, 8($16) ) # e0 :
|
||||
subq $0, 8, $0 # .. e1 :
|
||||
EX( stq_u $31, 16($6) ) # e0 :
|
||||
EX( stq_u $31, 16($16) ) # e0 :
|
||||
subq $0, 8, $0 # .. e1 :
|
||||
EX( stq_u $31, 24($6) ) # e0 :
|
||||
EX( stq_u $31, 24($16) ) # e0 :
|
||||
subq $0, 8, $0 # .. e1 :
|
||||
subq $1, 4, $1 # e0 :
|
||||
addq $6, 32, $6 # .. e1 :
|
||||
addq $16, 32, $16 # .. e1 :
|
||||
bne $1, 2b # e1 :
|
||||
|
||||
$tail:
|
||||
bne $2, 1f # e1 : is there a tail to do?
|
||||
ret $31, ($28), 1 # .. e1 :
|
||||
ret $31, ($26), 1 # .. e1 :
|
||||
|
||||
1: EX( ldq_u $5, 0($6) ) # e0 :
|
||||
1: EX( ldq_u $5, 0($16) ) # e0 :
|
||||
clr $0 # .. e1 :
|
||||
nop # e1 :
|
||||
mskqh $5, $0, $5 # e0 :
|
||||
EX( stq_u $5, 0($6) ) # e0 :
|
||||
ret $31, ($28), 1 # .. e1 :
|
||||
EX( stq_u $5, 0($16) ) # e0 :
|
||||
ret $31, ($26), 1 # .. e1 :
|
||||
|
||||
__do_clear_user:
|
||||
and $6, 7, $4 # e0 : find dest misalignment
|
||||
__clear_user:
|
||||
and $17, $17, $0
|
||||
and $16, 7, $4 # e0 : find dest misalignment
|
||||
beq $0, $zerolength # .. e1 :
|
||||
addq $0, $4, $1 # e0 : bias counter
|
||||
and $1, 7, $2 # e1 : number of bytes in tail
|
||||
srl $1, 3, $1 # e0 :
|
||||
beq $4, $loop # .. e1 :
|
||||
|
||||
EX( ldq_u $5, 0($6) ) # e0 : load dst word to mask back in
|
||||
EX( ldq_u $5, 0($16) ) # e0 : load dst word to mask back in
|
||||
beq $1, $oneword # .. e1 : sub-word store?
|
||||
|
||||
mskql $5, $6, $5 # e0 : take care of misaligned head
|
||||
addq $6, 8, $6 # .. e1 :
|
||||
EX( stq_u $5, -8($6) ) # e0 :
|
||||
mskql $5, $16, $5 # e0 : take care of misaligned head
|
||||
addq $16, 8, $16 # .. e1 :
|
||||
EX( stq_u $5, -8($16) ) # e0 :
|
||||
addq $0, $4, $0 # .. e1 : bytes left -= 8 - misalignment
|
||||
subq $1, 1, $1 # e0 :
|
||||
subq $0, 8, $0 # .. e1 :
|
||||
@@ -101,15 +87,15 @@ __do_clear_user:
|
||||
unop # :
|
||||
|
||||
$oneword:
|
||||
mskql $5, $6, $4 # e0 :
|
||||
mskql $5, $16, $4 # e0 :
|
||||
mskqh $5, $2, $5 # e0 :
|
||||
or $5, $4, $5 # e1 :
|
||||
EX( stq_u $5, 0($6) ) # e0 :
|
||||
EX( stq_u $5, 0($16) ) # e0 :
|
||||
clr $0 # .. e1 :
|
||||
|
||||
$zerolength:
|
||||
$exception:
|
||||
ret $31, ($28), 1 # .. e1 :
|
||||
ret $31, ($26), 1 # .. e1 :
|
||||
|
||||
.end __do_clear_user
|
||||
EXPORT_SYMBOL(__do_clear_user)
|
||||
.end __clear_user
|
||||
EXPORT_SYMBOL(__clear_user)
|
||||
|
||||
@@ -9,21 +9,6 @@
|
||||
* contains the right "bytes left to copy" value (and that it is updated
|
||||
* only _after_ a successful copy). There is also some rather minor
|
||||
* exception setup stuff..
|
||||
*
|
||||
* NOTE! This is not directly C-callable, because the calling semantics are
|
||||
* different:
|
||||
*
|
||||
* Inputs:
|
||||
* length in $0
|
||||
* destination address in $6
|
||||
* source address in $7
|
||||
* return address in $28
|
||||
*
|
||||
* Outputs:
|
||||
* bytes left to copy in $0
|
||||
*
|
||||
* Clobbers:
|
||||
* $1,$2,$3,$4,$5,$6,$7
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
@@ -49,58 +34,59 @@
|
||||
.ent __copy_user
|
||||
__copy_user:
|
||||
.prologue 0
|
||||
and $6,7,$3
|
||||
and $18,$18,$0
|
||||
and $16,7,$3
|
||||
beq $0,$35
|
||||
beq $3,$36
|
||||
subq $3,8,$3
|
||||
.align 4
|
||||
$37:
|
||||
EXI( ldq_u $1,0($7) )
|
||||
EXO( ldq_u $2,0($6) )
|
||||
extbl $1,$7,$1
|
||||
mskbl $2,$6,$2
|
||||
insbl $1,$6,$1
|
||||
EXI( ldq_u $1,0($17) )
|
||||
EXO( ldq_u $2,0($16) )
|
||||
extbl $1,$17,$1
|
||||
mskbl $2,$16,$2
|
||||
insbl $1,$16,$1
|
||||
addq $3,1,$3
|
||||
bis $1,$2,$1
|
||||
EXO( stq_u $1,0($6) )
|
||||
EXO( stq_u $1,0($16) )
|
||||
subq $0,1,$0
|
||||
addq $6,1,$6
|
||||
addq $7,1,$7
|
||||
addq $16,1,$16
|
||||
addq $17,1,$17
|
||||
beq $0,$41
|
||||
bne $3,$37
|
||||
$36:
|
||||
and $7,7,$1
|
||||
and $17,7,$1
|
||||
bic $0,7,$4
|
||||
beq $1,$43
|
||||
beq $4,$48
|
||||
EXI( ldq_u $3,0($7) )
|
||||
EXI( ldq_u $3,0($17) )
|
||||
.align 4
|
||||
$50:
|
||||
EXI( ldq_u $2,8($7) )
|
||||
EXI( ldq_u $2,8($17) )
|
||||
subq $4,8,$4
|
||||
extql $3,$7,$3
|
||||
extqh $2,$7,$1
|
||||
extql $3,$17,$3
|
||||
extqh $2,$17,$1
|
||||
bis $3,$1,$1
|
||||
EXO( stq $1,0($6) )
|
||||
addq $7,8,$7
|
||||
EXO( stq $1,0($16) )
|
||||
addq $17,8,$17
|
||||
subq $0,8,$0
|
||||
addq $6,8,$6
|
||||
addq $16,8,$16
|
||||
bis $2,$2,$3
|
||||
bne $4,$50
|
||||
$48:
|
||||
beq $0,$41
|
||||
.align 4
|
||||
$57:
|
||||
EXI( ldq_u $1,0($7) )
|
||||
EXO( ldq_u $2,0($6) )
|
||||
extbl $1,$7,$1
|
||||
mskbl $2,$6,$2
|
||||
insbl $1,$6,$1
|
||||
EXI( ldq_u $1,0($17) )
|
||||
EXO( ldq_u $2,0($16) )
|
||||
extbl $1,$17,$1
|
||||
mskbl $2,$16,$2
|
||||
insbl $1,$16,$1
|
||||
bis $1,$2,$1
|
||||
EXO( stq_u $1,0($6) )
|
||||
EXO( stq_u $1,0($16) )
|
||||
subq $0,1,$0
|
||||
addq $6,1,$6
|
||||
addq $7,1,$7
|
||||
addq $16,1,$16
|
||||
addq $17,1,$17
|
||||
bne $0,$57
|
||||
br $31,$41
|
||||
.align 4
|
||||
@@ -108,27 +94,27 @@ $43:
|
||||
beq $4,$65
|
||||
.align 4
|
||||
$66:
|
||||
EXI( ldq $1,0($7) )
|
||||
EXI( ldq $1,0($17) )
|
||||
subq $4,8,$4
|
||||
EXO( stq $1,0($6) )
|
||||
addq $7,8,$7
|
||||
EXO( stq $1,0($16) )
|
||||
addq $17,8,$17
|
||||
subq $0,8,$0
|
||||
addq $6,8,$6
|
||||
addq $16,8,$16
|
||||
bne $4,$66
|
||||
$65:
|
||||
beq $0,$41
|
||||
EXI( ldq $2,0($7) )
|
||||
EXO( ldq $1,0($6) )
|
||||
EXI( ldq $2,0($17) )
|
||||
EXO( ldq $1,0($16) )
|
||||
mskql $2,$0,$2
|
||||
mskqh $1,$0,$1
|
||||
bis $2,$1,$2
|
||||
EXO( stq $2,0($6) )
|
||||
EXO( stq $2,0($16) )
|
||||
bis $31,$31,$0
|
||||
$41:
|
||||
$35:
|
||||
$exitin:
|
||||
$exitout:
|
||||
ret $31,($28),1
|
||||
ret $31,($26),1
|
||||
|
||||
.end __copy_user
|
||||
EXPORT_SYMBOL(__copy_user)
|
||||
|
||||
@@ -9,21 +9,6 @@
|
||||
* a successful copy). There is also some rather minor exception setup
|
||||
* stuff.
|
||||
*
|
||||
* NOTE! This is not directly C-callable, because the calling semantics
|
||||
* are different:
|
||||
*
|
||||
* Inputs:
|
||||
* length in $0
|
||||
* destination address in $6
|
||||
* exception pointer in $7
|
||||
* return address in $28 (exceptions expect it there)
|
||||
*
|
||||
* Outputs:
|
||||
* bytes left to copy in $0
|
||||
*
|
||||
* Clobbers:
|
||||
* $1,$2,$3,$4,$5,$6
|
||||
*
|
||||
* Much of the information about 21264 scheduling/coding comes from:
|
||||
* Compiler Writer's Guide for the Alpha 21264
|
||||
* abbreviated as 'CWG' in other comments here
|
||||
@@ -56,14 +41,15 @@
|
||||
.set noreorder
|
||||
.align 4
|
||||
|
||||
.globl __do_clear_user
|
||||
.ent __do_clear_user
|
||||
.frame $30, 0, $28
|
||||
.globl __clear_user
|
||||
.ent __clear_user
|
||||
.frame $30, 0, $26
|
||||
.prologue 0
|
||||
|
||||
# Pipeline info : Slotting & Comments
|
||||
__do_clear_user:
|
||||
and $6, 7, $4 # .. E .. .. : find dest head misalignment
|
||||
__clear_user:
|
||||
and $17, $17, $0
|
||||
and $16, 7, $4 # .. E .. .. : find dest head misalignment
|
||||
beq $0, $zerolength # U .. .. .. : U L U L
|
||||
|
||||
addq $0, $4, $1 # .. .. .. E : bias counter
|
||||
@@ -75,14 +61,14 @@ __do_clear_user:
|
||||
|
||||
/*
|
||||
* Head is not aligned. Write (8 - $4) bytes to head of destination
|
||||
* This means $6 is known to be misaligned
|
||||
* This means $16 is known to be misaligned
|
||||
*/
|
||||
EX( ldq_u $5, 0($6) ) # .. .. .. L : load dst word to mask back in
|
||||
EX( ldq_u $5, 0($16) ) # .. .. .. L : load dst word to mask back in
|
||||
beq $1, $onebyte # .. .. U .. : sub-word store?
|
||||
mskql $5, $6, $5 # .. U .. .. : take care of misaligned head
|
||||
addq $6, 8, $6 # E .. .. .. : L U U L
|
||||
mskql $5, $16, $5 # .. U .. .. : take care of misaligned head
|
||||
addq $16, 8, $16 # E .. .. .. : L U U L
|
||||
|
||||
EX( stq_u $5, -8($6) ) # .. .. .. L :
|
||||
EX( stq_u $5, -8($16) ) # .. .. .. L :
|
||||
subq $1, 1, $1 # .. .. E .. :
|
||||
addq $0, $4, $0 # .. E .. .. : bytes left -= 8 - misalignment
|
||||
subq $0, 8, $0 # E .. .. .. : U L U L
|
||||
@@ -93,11 +79,11 @@ __do_clear_user:
|
||||
* values upon initial entry to the loop
|
||||
* $1 is number of quadwords to clear (zero is a valid value)
|
||||
* $2 is number of trailing bytes (0..7) ($2 never used...)
|
||||
* $6 is known to be aligned 0mod8
|
||||
* $16 is known to be aligned 0mod8
|
||||
*/
|
||||
$headalign:
|
||||
subq $1, 16, $4 # .. .. .. E : If < 16, we can not use the huge loop
|
||||
and $6, 0x3f, $2 # .. .. E .. : Forward work for huge loop
|
||||
and $16, 0x3f, $2 # .. .. E .. : Forward work for huge loop
|
||||
subq $2, 0x40, $3 # .. E .. .. : bias counter (huge loop)
|
||||
blt $4, $trailquad # U .. .. .. : U L U L
|
||||
|
||||
@@ -114,21 +100,21 @@ $headalign:
|
||||
beq $3, $bigalign # U .. .. .. : U L U L : Aligned 0mod64
|
||||
|
||||
$alignmod64:
|
||||
EX( stq_u $31, 0($6) ) # .. .. .. L
|
||||
EX( stq_u $31, 0($16) ) # .. .. .. L
|
||||
addq $3, 8, $3 # .. .. E ..
|
||||
subq $0, 8, $0 # .. E .. ..
|
||||
nop # E .. .. .. : U L U L
|
||||
|
||||
nop # .. .. .. E
|
||||
subq $1, 1, $1 # .. .. E ..
|
||||
addq $6, 8, $6 # .. E .. ..
|
||||
addq $16, 8, $16 # .. E .. ..
|
||||
blt $3, $alignmod64 # U .. .. .. : U L U L
|
||||
|
||||
$bigalign:
|
||||
/*
|
||||
* $0 is the number of bytes left
|
||||
* $1 is the number of quads left
|
||||
* $6 is aligned 0mod64
|
||||
* $16 is aligned 0mod64
|
||||
* we know that we'll be taking a minimum of one trip through
|
||||
* CWG Section 3.7.6: do not expect a sustained store rate of > 1/cycle
|
||||
* We are _not_ going to update $0 after every single store. That
|
||||
@@ -145,39 +131,39 @@ $bigalign:
|
||||
nop # E :
|
||||
nop # E :
|
||||
nop # E :
|
||||
bis $6,$6,$3 # E : U L U L : Initial wh64 address is dest
|
||||
bis $16,$16,$3 # E : U L U L : Initial wh64 address is dest
|
||||
/* This might actually help for the current trip... */
|
||||
|
||||
$do_wh64:
|
||||
wh64 ($3) # .. .. .. L1 : memory subsystem hint
|
||||
subq $1, 16, $4 # .. .. E .. : Forward calculation - repeat the loop?
|
||||
EX( stq_u $31, 0($6) ) # .. L .. ..
|
||||
EX( stq_u $31, 0($16) ) # .. L .. ..
|
||||
subq $0, 8, $0 # E .. .. .. : U L U L
|
||||
|
||||
addq $6, 128, $3 # E : Target address of wh64
|
||||
EX( stq_u $31, 8($6) ) # L :
|
||||
EX( stq_u $31, 16($6) ) # L :
|
||||
addq $16, 128, $3 # E : Target address of wh64
|
||||
EX( stq_u $31, 8($16) ) # L :
|
||||
EX( stq_u $31, 16($16) ) # L :
|
||||
subq $0, 16, $0 # E : U L L U
|
||||
|
||||
nop # E :
|
||||
EX( stq_u $31, 24($6) ) # L :
|
||||
EX( stq_u $31, 32($6) ) # L :
|
||||
EX( stq_u $31, 24($16) ) # L :
|
||||
EX( stq_u $31, 32($16) ) # L :
|
||||
subq $0, 168, $5 # E : U L L U : two trips through the loop left?
|
||||
/* 168 = 192 - 24, since we've already completed some stores */
|
||||
|
||||
subq $0, 16, $0 # E :
|
||||
EX( stq_u $31, 40($6) ) # L :
|
||||
EX( stq_u $31, 48($6) ) # L :
|
||||
cmovlt $5, $6, $3 # E : U L L U : Latency 2, extra mapping cycle
|
||||
EX( stq_u $31, 40($16) ) # L :
|
||||
EX( stq_u $31, 48($16) ) # L :
|
||||
cmovlt $5, $16, $3 # E : U L L U : Latency 2, extra mapping cycle
|
||||
|
||||
subq $1, 8, $1 # E :
|
||||
subq $0, 16, $0 # E :
|
||||
EX( stq_u $31, 56($6) ) # L :
|
||||
EX( stq_u $31, 56($16) ) # L :
|
||||
nop # E : U L U L
|
||||
|
||||
nop # E :
|
||||
subq $0, 8, $0 # E :
|
||||
addq $6, 64, $6 # E :
|
||||
addq $16, 64, $16 # E :
|
||||
bge $4, $do_wh64 # U : U L U L
|
||||
|
||||
$trailquad:
|
||||
@@ -190,14 +176,14 @@ $trailquad:
|
||||
beq $1, $trailbytes # U .. .. .. : U L U L : Only 0..7 bytes to go
|
||||
|
||||
$onequad:
|
||||
EX( stq_u $31, 0($6) ) # .. .. .. L
|
||||
EX( stq_u $31, 0($16) ) # .. .. .. L
|
||||
subq $1, 1, $1 # .. .. E ..
|
||||
subq $0, 8, $0 # .. E .. ..
|
||||
nop # E .. .. .. : U L U L
|
||||
|
||||
nop # .. .. .. E
|
||||
nop # .. .. E ..
|
||||
addq $6, 8, $6 # .. E .. ..
|
||||
addq $16, 8, $16 # .. E .. ..
|
||||
bgt $1, $onequad # U .. .. .. : U L U L
|
||||
|
||||
# We have an unknown number of bytes left to go.
|
||||
@@ -211,9 +197,9 @@ $trailbytes:
|
||||
# so we will use $0 as the loop counter
|
||||
# We know for a fact that $0 > 0 zero due to previous context
|
||||
$onebyte:
|
||||
EX( stb $31, 0($6) ) # .. .. .. L
|
||||
EX( stb $31, 0($16) ) # .. .. .. L
|
||||
subq $0, 1, $0 # .. .. E .. :
|
||||
addq $6, 1, $6 # .. E .. .. :
|
||||
addq $16, 1, $16 # .. E .. .. :
|
||||
bgt $0, $onebyte # U .. .. .. : U L U L
|
||||
|
||||
$zerolength:
|
||||
@@ -221,6 +207,6 @@ $exception: # Destination for exception recovery(?)
|
||||
nop # .. .. .. E :
|
||||
nop # .. .. E .. :
|
||||
nop # .. E .. .. :
|
||||
ret $31, ($28), 1 # L0 .. .. .. : L U L U
|
||||
.end __do_clear_user
|
||||
EXPORT_SYMBOL(__do_clear_user)
|
||||
ret $31, ($26), 1 # L0 .. .. .. : L U L U
|
||||
.end __clear_user
|
||||
EXPORT_SYMBOL(__clear_user)
|
||||
|
||||
@@ -12,21 +12,6 @@
|
||||
* only _after_ a successful copy). There is also some rather minor
|
||||
* exception setup stuff..
|
||||
*
|
||||
* NOTE! This is not directly C-callable, because the calling semantics are
|
||||
* different:
|
||||
*
|
||||
* Inputs:
|
||||
* length in $0
|
||||
* destination address in $6
|
||||
* source address in $7
|
||||
* return address in $28
|
||||
*
|
||||
* Outputs:
|
||||
* bytes left to copy in $0
|
||||
*
|
||||
* Clobbers:
|
||||
* $1,$2,$3,$4,$5,$6,$7
|
||||
*
|
||||
* Much of the information about 21264 scheduling/coding comes from:
|
||||
* Compiler Writer's Guide for the Alpha 21264
|
||||
* abbreviated as 'CWG' in other comments here
|
||||
@@ -60,10 +45,11 @@
|
||||
# Pipeline info: Slotting & Comments
|
||||
__copy_user:
|
||||
.prologue 0
|
||||
subq $0, 32, $1 # .. E .. .. : Is this going to be a small copy?
|
||||
andq $18, $18, $0
|
||||
subq $18, 32, $1 # .. E .. .. : Is this going to be a small copy?
|
||||
beq $0, $zerolength # U .. .. .. : U L U L
|
||||
|
||||
and $6,7,$3 # .. .. .. E : is leading dest misalignment
|
||||
and $16,7,$3 # .. .. .. E : is leading dest misalignment
|
||||
ble $1, $onebyteloop # .. .. U .. : 1st branch : small amount of data
|
||||
beq $3, $destaligned # .. U .. .. : 2nd (one cycle fetcher stall)
|
||||
subq $3, 8, $3 # E .. .. .. : L U U L : trip counter
|
||||
@@ -73,17 +59,17 @@ __copy_user:
|
||||
* We know we have at least one trip through this loop
|
||||
*/
|
||||
$aligndest:
|
||||
EXI( ldbu $1,0($7) ) # .. .. .. L : Keep loads separate from stores
|
||||
addq $6,1,$6 # .. .. E .. : Section 3.8 in the CWG
|
||||
EXI( ldbu $1,0($17) ) # .. .. .. L : Keep loads separate from stores
|
||||
addq $16,1,$16 # .. .. E .. : Section 3.8 in the CWG
|
||||
addq $3,1,$3 # .. E .. .. :
|
||||
nop # E .. .. .. : U L U L
|
||||
|
||||
/*
|
||||
* the -1 is to compensate for the inc($6) done in a previous quadpack
|
||||
* the -1 is to compensate for the inc($16) done in a previous quadpack
|
||||
* which allows us zero dependencies within either quadpack in the loop
|
||||
*/
|
||||
EXO( stb $1,-1($6) ) # .. .. .. L :
|
||||
addq $7,1,$7 # .. .. E .. : Section 3.8 in the CWG
|
||||
EXO( stb $1,-1($16) ) # .. .. .. L :
|
||||
addq $17,1,$17 # .. .. E .. : Section 3.8 in the CWG
|
||||
subq $0,1,$0 # .. E .. .. :
|
||||
bne $3, $aligndest # U .. .. .. : U L U L
|
||||
|
||||
@@ -92,29 +78,29 @@ $aligndest:
|
||||
* If we arrived via branch, we have a minimum of 32 bytes
|
||||
*/
|
||||
$destaligned:
|
||||
and $7,7,$1 # .. .. .. E : Check _current_ source alignment
|
||||
and $17,7,$1 # .. .. .. E : Check _current_ source alignment
|
||||
bic $0,7,$4 # .. .. E .. : number bytes as a quadword loop
|
||||
EXI( ldq_u $3,0($7) ) # .. L .. .. : Forward fetch for fallthrough code
|
||||
EXI( ldq_u $3,0($17) ) # .. L .. .. : Forward fetch for fallthrough code
|
||||
beq $1,$quadaligned # U .. .. .. : U L U L
|
||||
|
||||
/*
|
||||
* In the worst case, we've just executed an ldq_u here from 0($7)
|
||||
* In the worst case, we've just executed an ldq_u here from 0($17)
|
||||
* and we'll repeat it once if we take the branch
|
||||
*/
|
||||
|
||||
/* Misaligned quadword loop - not unrolled. Leave it that way. */
|
||||
$misquad:
|
||||
EXI( ldq_u $2,8($7) ) # .. .. .. L :
|
||||
EXI( ldq_u $2,8($17) ) # .. .. .. L :
|
||||
subq $4,8,$4 # .. .. E .. :
|
||||
extql $3,$7,$3 # .. U .. .. :
|
||||
extqh $2,$7,$1 # U .. .. .. : U U L L
|
||||
extql $3,$17,$3 # .. U .. .. :
|
||||
extqh $2,$17,$1 # U .. .. .. : U U L L
|
||||
|
||||
bis $3,$1,$1 # .. .. .. E :
|
||||
EXO( stq $1,0($6) ) # .. .. L .. :
|
||||
addq $7,8,$7 # .. E .. .. :
|
||||
EXO( stq $1,0($16) ) # .. .. L .. :
|
||||
addq $17,8,$17 # .. E .. .. :
|
||||
subq $0,8,$0 # E .. .. .. : U L L U
|
||||
|
||||
addq $6,8,$6 # .. .. .. E :
|
||||
addq $16,8,$16 # .. .. .. E :
|
||||
bis $2,$2,$3 # .. .. E .. :
|
||||
nop # .. E .. .. :
|
||||
bne $4,$misquad # U .. .. .. : U L U L
|
||||
@@ -125,8 +111,8 @@ $misquad:
|
||||
beq $0,$zerolength # U .. .. .. : U L U L
|
||||
|
||||
/* We know we have at least one trip through the byte loop */
|
||||
EXI ( ldbu $2,0($7) ) # .. .. .. L : No loads in the same quad
|
||||
addq $6,1,$6 # .. .. E .. : as the store (Section 3.8 in CWG)
|
||||
EXI ( ldbu $2,0($17) ) # .. .. .. L : No loads in the same quad
|
||||
addq $16,1,$16 # .. .. E .. : as the store (Section 3.8 in CWG)
|
||||
nop # .. E .. .. :
|
||||
br $31, $dirtyentry # L0 .. .. .. : L U U L
|
||||
/* Do the trailing byte loop load, then hop into the store part of the loop */
|
||||
@@ -136,8 +122,8 @@ $misquad:
|
||||
* Based upon the usage context, it's worth the effort to unroll this loop
|
||||
* $0 - number of bytes to be moved
|
||||
* $4 - number of bytes to move as quadwords
|
||||
* $6 is current destination address
|
||||
* $7 is current source address
|
||||
* $16 is current destination address
|
||||
* $17 is current source address
|
||||
*/
|
||||
$quadaligned:
|
||||
subq $4, 32, $2 # .. .. .. E : do not unroll for small stuff
|
||||
@@ -155,29 +141,29 @@ $quadaligned:
|
||||
* instruction memory hint instruction).
|
||||
*/
|
||||
$unroll4:
|
||||
EXI( ldq $1,0($7) ) # .. .. .. L
|
||||
EXI( ldq $2,8($7) ) # .. .. L ..
|
||||
EXI( ldq $1,0($17) ) # .. .. .. L
|
||||
EXI( ldq $2,8($17) ) # .. .. L ..
|
||||
subq $4,32,$4 # .. E .. ..
|
||||
nop # E .. .. .. : U U L L
|
||||
|
||||
addq $7,16,$7 # .. .. .. E
|
||||
EXO( stq $1,0($6) ) # .. .. L ..
|
||||
EXO( stq $2,8($6) ) # .. L .. ..
|
||||
addq $17,16,$17 # .. .. .. E
|
||||
EXO( stq $1,0($16) ) # .. .. L ..
|
||||
EXO( stq $2,8($16) ) # .. L .. ..
|
||||
subq $0,16,$0 # E .. .. .. : U L L U
|
||||
|
||||
addq $6,16,$6 # .. .. .. E
|
||||
EXI( ldq $1,0($7) ) # .. .. L ..
|
||||
EXI( ldq $2,8($7) ) # .. L .. ..
|
||||
addq $16,16,$16 # .. .. .. E
|
||||
EXI( ldq $1,0($17) ) # .. .. L ..
|
||||
EXI( ldq $2,8($17) ) # .. L .. ..
|
||||
subq $4, 32, $3 # E .. .. .. : U U L L : is there enough for another trip?
|
||||
|
||||
EXO( stq $1,0($6) ) # .. .. .. L
|
||||
EXO( stq $2,8($6) ) # .. .. L ..
|
||||
EXO( stq $1,0($16) ) # .. .. .. L
|
||||
EXO( stq $2,8($16) ) # .. .. L ..
|
||||
subq $0,16,$0 # .. E .. ..
|
||||
addq $7,16,$7 # E .. .. .. : U L L U
|
||||
addq $17,16,$17 # E .. .. .. : U L L U
|
||||
|
||||
nop # .. .. .. E
|
||||
nop # .. .. E ..
|
||||
addq $6,16,$6 # .. E .. ..
|
||||
addq $16,16,$16 # .. E .. ..
|
||||
bgt $3,$unroll4 # U .. .. .. : U L U L
|
||||
|
||||
nop
|
||||
@@ -186,14 +172,14 @@ $unroll4:
|
||||
beq $4, $noquads
|
||||
|
||||
$onequad:
|
||||
EXI( ldq $1,0($7) )
|
||||
EXI( ldq $1,0($17) )
|
||||
subq $4,8,$4
|
||||
addq $7,8,$7
|
||||
addq $17,8,$17
|
||||
nop
|
||||
|
||||
EXO( stq $1,0($6) )
|
||||
EXO( stq $1,0($16) )
|
||||
subq $0,8,$0
|
||||
addq $6,8,$6
|
||||
addq $16,8,$16
|
||||
bne $4,$onequad
|
||||
|
||||
$noquads:
|
||||
@@ -207,23 +193,23 @@ $noquads:
|
||||
* There's no point in doing a lot of complex alignment calculations to try to
|
||||
* to quadword stuff for a small amount of data.
|
||||
* $0 - remaining number of bytes left to copy
|
||||
* $6 - current dest addr
|
||||
* $7 - current source addr
|
||||
* $16 - current dest addr
|
||||
* $17 - current source addr
|
||||
*/
|
||||
|
||||
$onebyteloop:
|
||||
EXI ( ldbu $2,0($7) ) # .. .. .. L : No loads in the same quad
|
||||
addq $6,1,$6 # .. .. E .. : as the store (Section 3.8 in CWG)
|
||||
EXI ( ldbu $2,0($17) ) # .. .. .. L : No loads in the same quad
|
||||
addq $16,1,$16 # .. .. E .. : as the store (Section 3.8 in CWG)
|
||||
nop # .. E .. .. :
|
||||
nop # E .. .. .. : U L U L
|
||||
|
||||
$dirtyentry:
|
||||
/*
|
||||
* the -1 is to compensate for the inc($6) done in a previous quadpack
|
||||
* the -1 is to compensate for the inc($16) done in a previous quadpack
|
||||
* which allows us zero dependencies within either quadpack in the loop
|
||||
*/
|
||||
EXO ( stb $2,-1($6) ) # .. .. .. L :
|
||||
addq $7,1,$7 # .. .. E .. : quadpack as the load
|
||||
EXO ( stb $2,-1($16) ) # .. .. .. L :
|
||||
addq $17,1,$17 # .. .. E .. : quadpack as the load
|
||||
subq $0,1,$0 # .. E .. .. : change count _after_ copy
|
||||
bgt $0,$onebyteloop # U .. .. .. : U L U L
|
||||
|
||||
@@ -233,7 +219,7 @@ $exitout: # Destination for exception recovery(?)
|
||||
nop # .. .. .. E
|
||||
nop # .. .. E ..
|
||||
nop # .. E .. ..
|
||||
ret $31,($28),1 # L0 .. .. .. : L U L U
|
||||
ret $31,($26),1 # L0 .. .. .. : L U L U
|
||||
|
||||
.end __copy_user
|
||||
EXPORT_SYMBOL(__copy_user)
|
||||
|
||||
@@ -108,6 +108,7 @@ bootpImage: vmlinux
|
||||
|
||||
boot_targets += uImage uImage.bin uImage.gz
|
||||
|
||||
PHONY += $(boot_targets)
|
||||
$(boot_targets): vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#define R_ARC_32_PCREL 0x31
|
||||
|
||||
/*to set parameters in the core dumps */
|
||||
#define ELF_ARCH EM_ARCOMPACT
|
||||
#define ELF_ARCH EM_ARC_INUSE
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
|
||||
@@ -35,7 +35,7 @@ static inline void ioport_unmap(void __iomem *addr)
|
||||
{
|
||||
}
|
||||
|
||||
extern void iounmap(const void __iomem *addr);
|
||||
extern void iounmap(const volatile void __iomem *addr);
|
||||
|
||||
#define ioremap_nocache(phy, sz) ioremap(phy, sz)
|
||||
#define ioremap_wc(phy, sz) ioremap(phy, sz)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define clear_page(paddr) memset((paddr), 0, PAGE_SIZE)
|
||||
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
|
||||
#define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
|
||||
|
||||
struct vm_area_struct;
|
||||
|
||||
@@ -137,8 +137,10 @@
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_PAE40
|
||||
#define PTE_BITS_NON_RWX_IN_PD1 (0xff00000000 | PAGE_MASK | _PAGE_CACHEABLE)
|
||||
#define MAX_POSSIBLE_PHYSMEM_BITS 40
|
||||
#else
|
||||
#define PTE_BITS_NON_RWX_IN_PD1 (PAGE_MASK | _PAGE_CACHEABLE)
|
||||
#define MAX_POSSIBLE_PHYSMEM_BITS 32
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
|
||||
@@ -169,7 +169,7 @@ tracesys:
|
||||
|
||||
; Do the Sys Call as we normally would.
|
||||
; Validate the Sys Call number
|
||||
cmp r8, NR_syscalls
|
||||
cmp r8, NR_syscalls - 1
|
||||
mov.hi r0, -ENOSYS
|
||||
bhi tracesys_exit
|
||||
|
||||
@@ -191,6 +191,7 @@ tracesys_exit:
|
||||
st r0, [sp, PT_r0] ; sys call return value in pt_regs
|
||||
|
||||
;POST Sys Call Ptrace Hook
|
||||
mov r0, sp ; pt_regs needed
|
||||
bl @syscall_trace_exit
|
||||
b ret_from_exception ; NOT ret_from_system_call at is saves r0 which
|
||||
; we'd done before calling post hook above
|
||||
@@ -252,7 +253,7 @@ ENTRY(EV_Trap)
|
||||
;============ Normal syscall case
|
||||
|
||||
; syscall num shd not exceed the total system calls avail
|
||||
cmp r8, NR_syscalls
|
||||
cmp r8, NR_syscalls - 1
|
||||
mov.hi r0, -ENOSYS
|
||||
bhi .Lret_from_system_call
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
|
||||
sizeof(sf->uc.uc_mcontext.regs.scratch));
|
||||
err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
|
||||
|
||||
return err;
|
||||
return err ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
|
||||
@@ -111,7 +111,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
|
||||
&(sf->uc.uc_mcontext.regs.scratch),
|
||||
sizeof(sf->uc.uc_mcontext.regs.scratch));
|
||||
if (err)
|
||||
return err;
|
||||
return -EFAULT;
|
||||
|
||||
set_current_blocked(&set);
|
||||
regs->bta = uregs.scratch.bta;
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
|
||||
#ifdef CONFIG_ARC_DW2_UNWIND
|
||||
|
||||
static void seed_unwind_frame_info(struct task_struct *tsk,
|
||||
struct pt_regs *regs,
|
||||
static int
|
||||
seed_unwind_frame_info(struct task_struct *tsk, struct pt_regs *regs,
|
||||
struct unwind_frame_info *frame_info)
|
||||
{
|
||||
/*
|
||||
* synchronous unwinding (e.g. dump_stack)
|
||||
* - uses current values of SP and friends
|
||||
*/
|
||||
if (tsk == NULL && regs == NULL) {
|
||||
if (regs == NULL && (tsk == NULL || tsk == current)) {
|
||||
unsigned long fp, sp, blink, ret;
|
||||
frame_info->task = current;
|
||||
|
||||
@@ -66,11 +66,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk,
|
||||
frame_info->call_frame = 0;
|
||||
} else if (regs == NULL) {
|
||||
/*
|
||||
* Asynchronous unwinding of sleeping task
|
||||
* - Gets SP etc from task's pt_regs (saved bottom of kernel
|
||||
* mode stack of task)
|
||||
* Asynchronous unwinding of a likely sleeping task
|
||||
* - first ensure it is actually sleeping
|
||||
* - if so, it will be in __switch_to, kernel mode SP of task
|
||||
* is safe-kept and BLINK at a well known location in there
|
||||
*/
|
||||
|
||||
if (tsk->state == TASK_RUNNING)
|
||||
return -1;
|
||||
|
||||
frame_info->task = tsk;
|
||||
|
||||
frame_info->regs.r27 = TSK_K_FP(tsk);
|
||||
@@ -104,6 +108,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk,
|
||||
frame_info->regs.r63 = regs->ret;
|
||||
frame_info->call_frame = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -113,11 +119,12 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
|
||||
int (*consumer_fn) (unsigned int, void *), void *arg)
|
||||
{
|
||||
#ifdef CONFIG_ARC_DW2_UNWIND
|
||||
int ret = 0;
|
||||
int ret = 0, cnt = 0;
|
||||
unsigned int address;
|
||||
struct unwind_frame_info frame_info;
|
||||
|
||||
seed_unwind_frame_info(tsk, regs, &frame_info);
|
||||
if (seed_unwind_frame_info(tsk, regs, &frame_info))
|
||||
return 0;
|
||||
|
||||
while (1) {
|
||||
address = UNW_PC(&frame_info);
|
||||
@@ -133,6 +140,11 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
|
||||
break;
|
||||
|
||||
frame_info.regs.r63 = frame_info.regs.r31;
|
||||
|
||||
if (cnt++ > 128) {
|
||||
printk("unwinder looping too long, aborting !\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return address; /* return the last address it saw */
|
||||
|
||||
@@ -92,6 +92,8 @@ SECTIONS
|
||||
CPUIDLE_TEXT
|
||||
LOCK_TEXT
|
||||
KPROBES_TEXT
|
||||
IRQENTRY_TEXT
|
||||
SOFTIRQENTRY_TEXT
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
}
|
||||
|
||||
@@ -923,7 +923,7 @@ void clear_user_page(void *to, unsigned long u_vaddr, struct page *page)
|
||||
clear_page(to);
|
||||
clear_bit(PG_dc_clean, &page->flags);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(clear_user_page);
|
||||
|
||||
/**********************************************************************
|
||||
* Explicit Cache flush request from user space via syscall
|
||||
|
||||
@@ -95,7 +95,7 @@ void __iomem *ioremap_prot(phys_addr_t paddr, unsigned long size,
|
||||
EXPORT_SYMBOL(ioremap_prot);
|
||||
|
||||
|
||||
void iounmap(const void __iomem *addr)
|
||||
void iounmap(const volatile void __iomem *addr)
|
||||
{
|
||||
/* weird double cast to handle phys_addr_t > 32 bits */
|
||||
if (arc_uncached_addr_space((phys_addr_t)(u32)addr))
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#define CTOP_AUX_HW_COMPLY (CTOP_AUX_BASE + 0x024)
|
||||
#define CTOP_AUX_LPC (CTOP_AUX_BASE + 0x030)
|
||||
#define CTOP_AUX_EFLAGS (CTOP_AUX_BASE + 0x080)
|
||||
#define CTOP_AUX_IACK (CTOP_AUX_BASE + 0x088)
|
||||
#define CTOP_AUX_GPA1 (CTOP_AUX_BASE + 0x08C)
|
||||
#define CTOP_AUX_UDMC (CTOP_AUX_BASE + 0x300)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ config ARM
|
||||
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
|
||||
select HAVE_EXIT_THREAD
|
||||
select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
|
||||
select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
|
||||
select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL && !CC_IS_CLANG)
|
||||
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
|
||||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
select HAVE_GCC_PLUGINS
|
||||
@@ -633,7 +633,9 @@ config ARCH_S3C24XX
|
||||
select HAVE_S3C_RTC if RTC_CLASS
|
||||
select MULTI_IRQ_HANDLER
|
||||
select NEED_MACH_IO_H
|
||||
select S3C2410_WATCHDOG
|
||||
select SAMSUNG_ATAGS
|
||||
select WATCHDOG
|
||||
help
|
||||
Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
|
||||
and S3C2450 SoCs based systems, such as the Simtec Electronics BAST
|
||||
@@ -1587,12 +1589,10 @@ config THUMB2_KERNEL
|
||||
depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K
|
||||
default y if CPU_THUMBONLY
|
||||
select AEABI
|
||||
select ARM_ASM_UNIFIED
|
||||
select ARM_UNWIND
|
||||
help
|
||||
By enabling this option, the kernel will be compiled in
|
||||
Thumb-2 mode. A compiler/assembler that understand the unified
|
||||
ARM-Thumb syntax is needed.
|
||||
Thumb-2 mode.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
@@ -1627,9 +1627,6 @@ config THUMB2_AVOID_R_ARM_THM_JUMP11
|
||||
|
||||
Unless you are sure your tools don't have this problem, say Y.
|
||||
|
||||
config ARM_ASM_UNIFIED
|
||||
bool
|
||||
|
||||
config ARM_PATCH_IDIV
|
||||
bool "Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()"
|
||||
depends on CPU_32v7 && !XIP_KERNEL
|
||||
@@ -2073,7 +2070,6 @@ config CMDLINE
|
||||
choice
|
||||
prompt "Kernel command line type" if CMDLINE != ""
|
||||
default CMDLINE_FROM_BOOTLOADER
|
||||
depends on ATAGS
|
||||
|
||||
config CMDLINE_FROM_BOOTLOADER
|
||||
bool "Use bootloader kernel arguments if available"
|
||||
|
||||
@@ -15,30 +15,42 @@ config ARM_PTDUMP
|
||||
kernel.
|
||||
If in doubt, say "N"
|
||||
|
||||
# RMK wants arm kernels compiled with frame pointers or stack unwinding.
|
||||
# If you know what you are doing and are willing to live without stack
|
||||
# traces, you can get a slightly smaller kernel by setting this option to
|
||||
# n, but then RMK will have to kill you ;).
|
||||
config FRAME_POINTER
|
||||
bool
|
||||
depends on !THUMB2_KERNEL
|
||||
default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER
|
||||
choice
|
||||
prompt "Choose kernel unwinder"
|
||||
default UNWINDER_ARM if AEABI
|
||||
default UNWINDER_FRAME_POINTER if !AEABI
|
||||
help
|
||||
If you say N here, the resulting kernel will be slightly smaller and
|
||||
faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
|
||||
when a problem occurs with the kernel, the information that is
|
||||
reported is severely limited.
|
||||
This determines which method will be used for unwinding kernel stack
|
||||
traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
|
||||
livepatch, lockdep, and more.
|
||||
|
||||
config ARM_UNWIND
|
||||
bool "Enable stack unwinding support (EXPERIMENTAL)"
|
||||
depends on AEABI
|
||||
default y
|
||||
config UNWINDER_FRAME_POINTER
|
||||
bool "Frame pointer unwinder"
|
||||
depends on !THUMB2_KERNEL && !CC_IS_CLANG
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select FRAME_POINTER
|
||||
help
|
||||
This option enables the frame pointer unwinder for unwinding
|
||||
kernel stack traces.
|
||||
|
||||
config UNWINDER_ARM
|
||||
bool "ARM EABI stack unwinder"
|
||||
depends on AEABI && !FUNCTION_GRAPH_TRACER
|
||||
select ARM_UNWIND
|
||||
help
|
||||
This option enables stack unwinding support in the kernel
|
||||
using the information automatically generated by the
|
||||
compiler. The resulting kernel image is slightly bigger but
|
||||
the performance is not affected. Currently, this feature
|
||||
only works with EABI compilers. If unsure say Y.
|
||||
only works with EABI compilers.
|
||||
|
||||
endchoice
|
||||
|
||||
config ARM_UNWIND
|
||||
bool
|
||||
|
||||
config FRAME_POINTER
|
||||
bool
|
||||
|
||||
config OLD_MCOUNT
|
||||
bool
|
||||
|
||||
@@ -17,7 +17,7 @@ ifeq ($(CONFIG_BUILD_ARM64_DT_OVERLAY),y)
|
||||
export DTC_FLAGS := -@
|
||||
endif
|
||||
|
||||
LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
|
||||
LDFLAGS_vmlinux := --no-undefined -X --pic-veneer
|
||||
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
||||
LDFLAGS_vmlinux += --be8
|
||||
LDFLAGS_MODULE += --be8
|
||||
@@ -77,15 +77,15 @@ KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra)
|
||||
# Note that GCC does not numerically define an architecture version
|
||||
# macro, but instead defines a whole series of macros which makes
|
||||
# testing for a specific architecture or later rather impossible.
|
||||
arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m
|
||||
arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
|
||||
arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
|
||||
arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m
|
||||
arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -march=armv7-a
|
||||
arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 -march=armv6
|
||||
# Only override the compiler option if ARMv6. The ARMv6K extensions are
|
||||
# always available in ARMv7
|
||||
ifeq ($(CONFIG_CPU_32v6),y)
|
||||
arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
|
||||
arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 -march=armv6k
|
||||
endif
|
||||
arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
|
||||
arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 -march=armv5te
|
||||
arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t
|
||||
arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4
|
||||
arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3
|
||||
@@ -99,7 +99,7 @@ tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
|
||||
tune-$(CONFIG_CPU_ARM740T) =-mtune=arm7tdmi
|
||||
tune-$(CONFIG_CPU_ARM9TDMI) =-mtune=arm9tdmi
|
||||
tune-$(CONFIG_CPU_ARM940T) =-mtune=arm9tdmi
|
||||
tune-$(CONFIG_CPU_ARM946E) =$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi)
|
||||
tune-$(CONFIG_CPU_ARM946E) =-mtune=arm9e
|
||||
tune-$(CONFIG_CPU_ARM920T) =-mtune=arm9tdmi
|
||||
tune-$(CONFIG_CPU_ARM922T) =-mtune=arm9tdmi
|
||||
tune-$(CONFIG_CPU_ARM925T) =-mtune=arm9tdmi
|
||||
@@ -107,11 +107,11 @@ tune-$(CONFIG_CPU_ARM926T) =-mtune=arm9tdmi
|
||||
tune-$(CONFIG_CPU_FA526) =-mtune=arm9tdmi
|
||||
tune-$(CONFIG_CPU_SA110) =-mtune=strongarm110
|
||||
tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
|
||||
tune-$(CONFIG_CPU_XSCALE) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
|
||||
tune-$(CONFIG_CPU_XSC3) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
|
||||
tune-$(CONFIG_CPU_FEROCEON) =$(call cc-option,-mtune=marvell-f,-mtune=xscale)
|
||||
tune-$(CONFIG_CPU_V6) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
|
||||
tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
|
||||
tune-$(CONFIG_CPU_XSCALE) =-mtune=xscale
|
||||
tune-$(CONFIG_CPU_XSC3) =-mtune=xscale
|
||||
tune-$(CONFIG_CPU_FEROCEON) =-mtune=xscale
|
||||
tune-$(CONFIG_CPU_V6) =-mtune=arm1136j-s
|
||||
tune-$(CONFIG_CPU_V6K) =-mtune=arm1136j-s
|
||||
|
||||
# Evaluate tune cc-option calls now
|
||||
tune-y := $(tune-y)
|
||||
@@ -126,9 +126,11 @@ ifeq ($(CONFIG_ARM_UNWIND),y)
|
||||
CFLAGS_ABI +=-funwind-tables
|
||||
endif
|
||||
|
||||
# Accept old syntax despite ".syntax unified"
|
||||
AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
|
||||
|
||||
ifeq ($(CONFIG_THUMB2_KERNEL),y)
|
||||
AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
|
||||
AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
|
||||
CFLAGS_ISA :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
|
||||
AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb
|
||||
# Work around buggy relocation from gas if requested:
|
||||
@@ -136,7 +138,7 @@ ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
|
||||
CFLAGS_MODULE +=-fno-optimize-sibling-calls
|
||||
endif
|
||||
else
|
||||
CFLAGS_ISA :=$(call cc-option,-marm,)
|
||||
CFLAGS_ISA :=$(call cc-option,-marm,) $(AFLAGS_NOWARN)
|
||||
AFLAGS_ISA :=$(CFLAGS_ISA)
|
||||
endif
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
GCOV_PROFILE := n
|
||||
|
||||
LDFLAGS_bootp :=-p --no-undefined -X \
|
||||
LDFLAGS_bootp := --no-undefined -X \
|
||||
--defsym initrd_phys=$(INITRD_PHYS) \
|
||||
--defsym params_phys=$(PARAMS_PHYS) -T
|
||||
AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
|
||||
|
||||
@@ -86,6 +86,8 @@ $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \
|
||||
$(addprefix $(obj)/,$(libfdt_hdrs))
|
||||
|
||||
ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
|
||||
CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
|
||||
CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
|
||||
OBJS += $(libfdt_objs) atags_to_fdt.o
|
||||
endif
|
||||
|
||||
@@ -126,8 +128,6 @@ endif
|
||||
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
||||
LDFLAGS_vmlinux += --be8
|
||||
endif
|
||||
# ?
|
||||
LDFLAGS_vmlinux += -p
|
||||
# Report unresolved symbol references
|
||||
LDFLAGS_vmlinux += --no-undefined
|
||||
# Delete all temporary local symbols
|
||||
|
||||
@@ -46,7 +46,10 @@ extern char * strstr(const char * s1, const char *s2);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KERNEL_XZ
|
||||
/* Prevent KASAN override of string helpers in decompressor */
|
||||
#undef memmove
|
||||
#define memmove memmove
|
||||
#undef memcpy
|
||||
#define memcpy memcpy
|
||||
#include "../../../../lib/decompress_unxz.c"
|
||||
#endif
|
||||
|
||||
@@ -1082,9 +1082,9 @@ __armv4_mmu_cache_off:
|
||||
__armv7_mmu_cache_off:
|
||||
mrc p15, 0, r0, c1, c0
|
||||
#ifdef CONFIG_MMU
|
||||
bic r0, r0, #0x000d
|
||||
bic r0, r0, #0x0005
|
||||
#else
|
||||
bic r0, r0, #0x000c
|
||||
bic r0, r0, #0x0004
|
||||
#endif
|
||||
mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
|
||||
mov r12, lr
|
||||
|
||||
@@ -552,7 +552,7 @@ status = "okay";
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_pins>;
|
||||
ti,pindir-d0-out-d1-in = <1>;
|
||||
ti,pindir-d0-out-d1-in;
|
||||
/* WLS1271 WiFi */
|
||||
wlcore: wlcore@1 {
|
||||
compatible = "ti,wl1271";
|
||||
|
||||
@@ -411,7 +411,7 @@
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0_pins>;
|
||||
clock-frequency = <400000>;
|
||||
clock-frequency = <100000>;
|
||||
|
||||
tps65218: tps65218@24 {
|
||||
reg = <0x24>;
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x80000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -618,7 +618,7 @@
|
||||
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
/* x1 port */
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x40000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -133,7 +133,7 @@
|
||||
/* x1 port */
|
||||
pcie@3,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
|
||||
assigned-addresses = <0x82001800 0 0x44000 0 0x2000>;
|
||||
reg = <0x1800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
/* x1 port */
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x40000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -144,7 +144,7 @@
|
||||
/* x1 port */
|
||||
pcie@3,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
|
||||
assigned-addresses = <0x82001800 0 0x44000 0 0x2000>;
|
||||
reg = <0x1800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -165,7 +165,7 @@
|
||||
*/
|
||||
pcie@4,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
|
||||
assigned-addresses = <0x82002000 0 0x48000 0 0x2000>;
|
||||
reg = <0x2000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -492,7 +492,7 @@
|
||||
/* x1 port */
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x40000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -510,7 +510,7 @@
|
||||
/* x1 port */
|
||||
pcie@3,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
|
||||
assigned-addresses = <0x82001800 0 0x44000 0 0x2000>;
|
||||
reg = <0x1800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -531,7 +531,7 @@
|
||||
*/
|
||||
pcie@4,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
|
||||
assigned-addresses = <0x82002000 0 0x48000 0 0x2000>;
|
||||
reg = <0x2000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
pcie@3,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
|
||||
assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
|
||||
reg = <0x1800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
pcie@4,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
|
||||
assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
|
||||
reg = <0x2000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -184,7 +184,7 @@
|
||||
|
||||
pcie@5,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
|
||||
assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
|
||||
reg = <0x2800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
pcie@2,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -165,7 +165,7 @@
|
||||
|
||||
pcie@3,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
|
||||
assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
|
||||
reg = <0x1800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
pcie@4,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
|
||||
assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
|
||||
reg = <0x2000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
pcie@5,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
|
||||
assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
|
||||
reg = <0x2800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
pcie@6,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x84000 0 0x2000>;
|
||||
assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
|
||||
reg = <0x3000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -233,7 +233,7 @@
|
||||
|
||||
pcie@7,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x88000 0 0x2000>;
|
||||
assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
|
||||
reg = <0x3800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -250,7 +250,7 @@
|
||||
|
||||
pcie@8,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x8c000 0 0x2000>;
|
||||
assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
|
||||
reg = <0x4000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
pcie@9,0 {
|
||||
device_type = "pci";
|
||||
assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
|
||||
assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
|
||||
reg = <0x4800 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
@@ -231,6 +231,11 @@
|
||||
atmel,pins =
|
||||
<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */
|
||||
};
|
||||
pinctrl_usb_default: usb_default {
|
||||
atmel,pins =
|
||||
<AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
|
||||
AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -288,6 +293,8 @@
|
||||
&pioE 3 GPIO_ACTIVE_LOW
|
||||
&pioE 4 GPIO_ACTIVE_LOW
|
||||
>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_usb_default>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -152,6 +152,11 @@
|
||||
atmel,pins =
|
||||
<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
|
||||
};
|
||||
pinctrl_usb_default: usb_default {
|
||||
atmel,pins =
|
||||
<AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
|
||||
AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
|
||||
};
|
||||
pinctrl_key_gpio: key_gpio_0 {
|
||||
atmel,pins =
|
||||
<AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
|
||||
@@ -177,6 +182,8 @@
|
||||
&pioE 11 GPIO_ACTIVE_HIGH
|
||||
&pioE 14 GPIO_ACTIVE_HIGH
|
||||
>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_usb_default>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -39,6 +39,13 @@
|
||||
|
||||
};
|
||||
|
||||
usb1 {
|
||||
pinctrl_usb1_vbus_gpio: usb1_vbus_gpio {
|
||||
atmel,pins =
|
||||
<AT91_PIOC 5 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PC5 GPIO */
|
||||
};
|
||||
};
|
||||
|
||||
mmc0_slot1 {
|
||||
pinctrl_board_mmc0_slot1: mmc0_slot1-board {
|
||||
atmel,pins =
|
||||
@@ -72,6 +79,8 @@
|
||||
};
|
||||
|
||||
usb1: gadget@fffa4000 {
|
||||
pinctrl-0 = <&pinctrl_usb1_vbus_gpio>;
|
||||
pinctrl-names = "default";
|
||||
atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -266,23 +266,26 @@
|
||||
atmel,adc-use-res = "highres";
|
||||
|
||||
trigger0 {
|
||||
trigger-name = "timer-counter-0";
|
||||
trigger-name = "external-rising";
|
||||
trigger-value = <0x1>;
|
||||
trigger-external;
|
||||
};
|
||||
|
||||
trigger1 {
|
||||
trigger-name = "timer-counter-1";
|
||||
trigger-value = <0x3>;
|
||||
trigger-name = "external-falling";
|
||||
trigger-value = <0x2>;
|
||||
trigger-external;
|
||||
};
|
||||
|
||||
trigger2 {
|
||||
trigger-name = "timer-counter-2";
|
||||
trigger-value = <0x5>;
|
||||
trigger-name = "external-any";
|
||||
trigger-value = <0x3>;
|
||||
trigger-external;
|
||||
};
|
||||
|
||||
trigger3 {
|
||||
trigger-name = "external";
|
||||
trigger-value = <0x13>;
|
||||
trigger-external;
|
||||
trigger-name = "continuous";
|
||||
trigger-value = <0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -234,6 +234,8 @@
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
usb2: usb2@21000 {
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
nand: nand@2000 {
|
||||
nand_controller: nand-controller@2000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.0", "brcm,brcmnand";
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
&nand {
|
||||
&nand_controller {
|
||||
status = "okay";
|
||||
|
||||
nandcs@1 {
|
||||
nand@1 {
|
||||
compatible = "brcm,nandcs";
|
||||
reg = <1>;
|
||||
nand-ecc-step-size = <512>;
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
reg-names = "aon-ctrl", "aon-sram";
|
||||
};
|
||||
|
||||
nand: nand@3e2800 {
|
||||
nand_controller: nand-controller@3e2800 {
|
||||
status = "disabled";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&nand {
|
||||
&nand_controller {
|
||||
status = "okay";
|
||||
|
||||
nandcs@0 {
|
||||
nand@0 {
|
||||
compatible = "brcm,nandcs";
|
||||
reg = <0>;
|
||||
nand-ecc-strength = <4>;
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
pcie1: pcie-port@1 {
|
||||
device_type = "pci";
|
||||
status = "disabled";
|
||||
assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
|
||||
assigned-addresses = <0x82001000 0 0x80000 0 0x2000>;
|
||||
reg = <0x1000 0 0 0 0>;
|
||||
clocks = <&gate_clk 5>;
|
||||
marvell,pcie-port = <1>;
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
};
|
||||
|
||||
&ehci {
|
||||
samsung,vbus-gpio = <&gpx3 5 1>;
|
||||
samsung,vbus-gpio = <&gpx3 5 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
|
||||
port@1{
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
};
|
||||
|
||||
uart3_data: uart3-data {
|
||||
samsung,pins = "gpa1-4", "gpa1-4";
|
||||
samsung,pins = "gpa1-4", "gpa1-5";
|
||||
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
|
||||
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
|
||||
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
|
||||
|
||||
@@ -118,6 +118,9 @@
|
||||
|
||||
&hdmi {
|
||||
hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
|
||||
vdd-supply = <&ldo8_reg>;
|
||||
vdd_osc-supply = <&ldo10_reg>;
|
||||
vdd_pll-supply = <&ldo8_reg>;
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
@@ -126,7 +129,7 @@
|
||||
samsung,i2c-max-bus-freq = <20000>;
|
||||
|
||||
eeprom@50 {
|
||||
compatible = "samsung,s524ad0xd1";
|
||||
compatible = "samsung,s524ad0xd1", "atmel,24c128";
|
||||
reg = <0x50>;
|
||||
};
|
||||
|
||||
@@ -134,7 +137,7 @@
|
||||
compatible = "maxim,max77686";
|
||||
reg = <0x09>;
|
||||
interrupt-parent = <&gpx3>;
|
||||
interrupts = <2 IRQ_TYPE_NONE>;
|
||||
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&max77686_irq>;
|
||||
wakeup-source;
|
||||
@@ -285,7 +288,7 @@
|
||||
samsung,i2c-max-bus-freq = <20000>;
|
||||
|
||||
eeprom@51 {
|
||||
compatible = "samsung,s524ad0xd1";
|
||||
compatible = "samsung,s524ad0xd1", "atmel,24c128";
|
||||
reg = <0x51>;
|
||||
};
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
max77686: max77686@09 {
|
||||
compatible = "maxim,max77686";
|
||||
interrupt-parent = <&gpx3>;
|
||||
interrupts = <2 IRQ_TYPE_NONE>;
|
||||
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&max77686_irq>;
|
||||
wakeup-source;
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
compatible = "samsung,s5m8767-pmic";
|
||||
reg = <0x66>;
|
||||
interrupt-parent = <&gpx3>;
|
||||
interrupts = <2 IRQ_TYPE_NONE>;
|
||||
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&s5m8767_irq &s5m8767_dvs &s5m8767_ds>;
|
||||
wakeup-source;
|
||||
|
||||
@@ -271,6 +271,8 @@
|
||||
regulator-name = "vddq_lcd";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
/* Supplies also GPK and GPJ */
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
ldo8_reg: LDO8 {
|
||||
@@ -560,11 +562,11 @@
|
||||
};
|
||||
|
||||
&usbdrd_dwc3_0 {
|
||||
dr_mode = "host";
|
||||
dr_mode = "peripheral";
|
||||
};
|
||||
|
||||
&usbdrd_dwc3_1 {
|
||||
dr_mode = "peripheral";
|
||||
dr_mode = "host";
|
||||
};
|
||||
|
||||
&usbdrd3_0 {
|
||||
|
||||
@@ -563,6 +563,34 @@
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
usb3_1_oc: usb3-1-oc {
|
||||
samsung,pins = "gpk2-4", "gpk2-5";
|
||||
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
|
||||
samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
|
||||
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
|
||||
};
|
||||
|
||||
usb3_1_vbusctrl: usb3-1-vbusctrl {
|
||||
samsung,pins = "gpk2-6", "gpk2-7";
|
||||
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
|
||||
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
|
||||
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
|
||||
};
|
||||
|
||||
usb3_0_oc: usb3-0-oc {
|
||||
samsung,pins = "gpk3-0", "gpk3-1";
|
||||
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
|
||||
samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
|
||||
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
|
||||
};
|
||||
|
||||
usb3_0_vbusctrl: usb3-0-vbusctrl {
|
||||
samsung,pins = "gpk3-2", "gpk3-3";
|
||||
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
|
||||
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
|
||||
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_2 {
|
||||
|
||||
@@ -314,6 +314,8 @@
|
||||
&usbdrd3_0 {
|
||||
clocks = <&clock CLK_USBD300>;
|
||||
clock-names = "usbdrd30";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&usb3_0_oc>, <&usb3_0_vbusctrl>;
|
||||
};
|
||||
|
||||
&usbdrd_phy0 {
|
||||
@@ -325,6 +327,8 @@
|
||||
&usbdrd3_1 {
|
||||
clocks = <&clock CLK_USBD301>;
|
||||
clock-names = "usbdrd30";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&usb3_1_oc>, <&usb3_1_vbusctrl>;
|
||||
};
|
||||
|
||||
&usbdrd_dwc3_1 {
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
reg = <0x66>;
|
||||
|
||||
interrupt-parent = <&gpx3>;
|
||||
interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&s2mps11_irq>;
|
||||
|
||||
|
||||
@@ -134,6 +134,9 @@
|
||||
hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hdmi_hpd_irq>;
|
||||
vdd-supply = <&ldo6_reg>;
|
||||
vdd_osc-supply = <&ldo7_reg>;
|
||||
vdd_pll-supply = <&ldo6_reg>;
|
||||
};
|
||||
|
||||
&hsi2c_4 {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
label = "blue:heartbeat";
|
||||
pwms = <&pwm 2 2000000 0>;
|
||||
pwm-names = "pwm2";
|
||||
max_brightness = <255>;
|
||||
max-brightness = <255>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* Green LED is much brighter than the others
|
||||
* so limit its max brightness
|
||||
*/
|
||||
max_brightness = <127>;
|
||||
max-brightness = <127>;
|
||||
linux,default-trigger = "mmc0";
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
label = "blue:heartbeat";
|
||||
pwms = <&pwm 2 2000000 0>;
|
||||
pwm-names = "pwm2";
|
||||
max_brightness = <255>;
|
||||
max-brightness = <255>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
MX23_PAD_LCD_RESET__GPIO_1_18
|
||||
MX23_PAD_PWM3__GPIO_1_29
|
||||
MX23_PAD_PWM4__GPIO_1_30
|
||||
MX23_PAD_SSP1_DETECT__SSP1_DETECT
|
||||
>;
|
||||
fsl,drive-strength = <MXS_DRIVE_4mA>;
|
||||
fsl,voltage = <MXS_VOLTAGE_HIGH>;
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
MX50_PAD_CSPI_MISO__CSPI_MISO 0x00
|
||||
MX50_PAD_CSPI_MOSI__CSPI_MOSI 0x00
|
||||
MX50_PAD_CSPI_SS0__GPIO4_11 0xc4
|
||||
MX50_PAD_ECSPI1_MOSI__CSPI_SS1 0xf4
|
||||
MX50_PAD_ECSPI1_MOSI__GPIO4_13 0x84
|
||||
>;
|
||||
};
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
ocram: sram@00900000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x00900000 0x20000>;
|
||||
ranges = <0 0x00900000 0x20000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
clocks = <&clks IMX6QDL_CLK_OCRAM>;
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user