mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
Merge branch 'devx-async' into k.o/for-next
Yishai Hadas says: Enable DEVX asynchronous query commands This series enables querying a DEVX object in an asynchronous mode. The userspace application won't block when calling the firmware and it will be able to get the response back once that it will be ready. To enable the above functionality: - DEVX asynchronous command completion FD object was introduced. - The applicable file operations were implemented to enable using it by the user application. - Query asynchronous method was added to the DEVX object, it will call the firmware asynchronously and manages the response on the given input FD. - Hot unplug support was added for the FD to work properly upon unbind/disassociate. - mlx5 core fence for asynchronous commands was implemented and used to prevent racing upon unbind/disassociate. This branch is based on mlx5-next & v5.0-rc2 due to dependencies, from git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux * branch 'devx-async': IB/mlx5: Implement DEVX hot unplug for async command FD IB/mlx5: Implement the file ops of DEVX async command FD IB/mlx5: Introduce async DEVX obj query API IB/mlx5: Introduce MLX5_IB_OBJECT_DEVX_ASYNC_CMD_FD Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
commit
55c293c38e
@ -279,3 +279,12 @@ Description:
|
||||
size in 512B sectors of the zones of the device, with
|
||||
the eventual exception of the last zone of the device
|
||||
which may be smaller.
|
||||
|
||||
What: /sys/block/<disk>/queue/io_timeout
|
||||
Date: November 2018
|
||||
Contact: Weiping Zhang <zhangweiping@didiglobal.com>
|
||||
Description:
|
||||
io_timeout is the request timeout in milliseconds. If a request
|
||||
does not complete in this time then the block driver timeout
|
||||
handler is invoked. That timeout handler can decide to retry
|
||||
the request, to fail it or to start a device recovery strategy.
|
||||
|
@ -122,11 +122,18 @@ Description:
|
||||
statistics (bd_count, bd_reads, bd_writes) in a format
|
||||
similar to block layer statistics file format.
|
||||
|
||||
What: /sys/block/zram<id>/writeback_limit_enable
|
||||
Date: November 2018
|
||||
Contact: Minchan Kim <minchan@kernel.org>
|
||||
Description:
|
||||
The writeback_limit_enable file is read-write and specifies
|
||||
eanbe of writeback_limit feature. "1" means eable the feature.
|
||||
No limit "0" is the initial state.
|
||||
|
||||
What: /sys/block/zram<id>/writeback_limit
|
||||
Date: November 2018
|
||||
Contact: Minchan Kim <minchan@kernel.org>
|
||||
Description:
|
||||
The writeback_limit file is read-write and specifies the maximum
|
||||
amount of writeback ZRAM can do. The limit could be changed
|
||||
in run time and "0" means disable the limit.
|
||||
No limit is the initial state.
|
||||
in run time.
|
||||
|
@ -357,6 +357,13 @@ video playing/streaming, a very low drop rate may be more important
|
||||
than maximum throughput. In these cases, consider setting the
|
||||
strict_guarantees parameter.
|
||||
|
||||
slice_idle_us
|
||||
-------------
|
||||
|
||||
Controls the same tuning parameter as slice_idle, but in microseconds.
|
||||
Either tunable can be used to set idling behavior. Afterwards, the
|
||||
other tunable will reflect the newly set value in sysfs.
|
||||
|
||||
strict_guarantees
|
||||
-----------------
|
||||
|
||||
|
@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0
|
||||
|
||||
zoned=[0/1]: Default: 0
|
||||
0: Block device is exposed as a random-access block device.
|
||||
1: Block device is exposed as a host-managed zoned block device.
|
||||
1: Block device is exposed as a host-managed zoned block device. Requires
|
||||
CONFIG_BLK_DEV_ZONED.
|
||||
|
||||
zone_size=[MB]: Default: 256
|
||||
Per zone size when exposed as a zoned block device. Must be a power of two.
|
||||
|
@ -67,6 +67,13 @@ If set to a value larger than 0, the kernel will put the process issuing
|
||||
IO to sleep for this amount of microseconds before entering classic
|
||||
polling.
|
||||
|
||||
io_timeout (RW)
|
||||
---------------
|
||||
io_timeout is the request timeout in milliseconds. If a request does not
|
||||
complete in this time then the block driver timeout handler is invoked.
|
||||
That timeout handler can decide to retry the request, to fail it or to start
|
||||
a device recovery strategy.
|
||||
|
||||
iostats (RW)
|
||||
-------------
|
||||
This file is used to control (on/off) the iostats accounting of the
|
||||
|
@ -156,22 +156,23 @@ Per-device statistics are exported as various nodes under /sys/block/zram<id>/
|
||||
A brief description of exported device attributes. For more details please
|
||||
read Documentation/ABI/testing/sysfs-block-zram.
|
||||
|
||||
Name access description
|
||||
---- ------ -----------
|
||||
disksize RW show and set the device's disk size
|
||||
initstate RO shows the initialization state of the device
|
||||
reset WO trigger device reset
|
||||
mem_used_max WO reset the `mem_used_max' counter (see later)
|
||||
mem_limit WO specifies the maximum amount of memory ZRAM can use
|
||||
to store the compressed data
|
||||
writeback_limit WO specifies the maximum amount of write IO zram can
|
||||
write out to backing device as 4KB unit
|
||||
max_comp_streams RW the number of possible concurrent compress operations
|
||||
comp_algorithm RW show and change the compression algorithm
|
||||
compact WO trigger memory compaction
|
||||
debug_stat RO this file is used for zram debugging purposes
|
||||
backing_dev RW set up backend storage for zram to write out
|
||||
idle WO mark allocated slot as idle
|
||||
Name access description
|
||||
---- ------ -----------
|
||||
disksize RW show and set the device's disk size
|
||||
initstate RO shows the initialization state of the device
|
||||
reset WO trigger device reset
|
||||
mem_used_max WO reset the `mem_used_max' counter (see later)
|
||||
mem_limit WO specifies the maximum amount of memory ZRAM can use
|
||||
to store the compressed data
|
||||
writeback_limit WO specifies the maximum amount of write IO zram can
|
||||
write out to backing device as 4KB unit
|
||||
writeback_limit_enable RW show and set writeback_limit feature
|
||||
max_comp_streams RW the number of possible concurrent compress operations
|
||||
comp_algorithm RW show and change the compression algorithm
|
||||
compact WO trigger memory compaction
|
||||
debug_stat RO this file is used for zram debugging purposes
|
||||
backing_dev RW set up backend storage for zram to write out
|
||||
idle WO mark allocated slot as idle
|
||||
|
||||
|
||||
User space is advised to use the following files to read the device statistics.
|
||||
@ -280,32 +281,51 @@ With the command, zram writeback idle pages from memory to the storage.
|
||||
If there are lots of write IO with flash device, potentially, it has
|
||||
flash wearout problem so that admin needs to design write limitation
|
||||
to guarantee storage health for entire product life.
|
||||
To overcome the concern, zram supports "writeback_limit".
|
||||
The "writeback_limit"'s default value is 0 so that it doesn't limit
|
||||
any writeback. If admin want to measure writeback count in a certain
|
||||
period, he could know it via /sys/block/zram0/bd_stat's 3rd column.
|
||||
|
||||
To overcome the concern, zram supports "writeback_limit" feature.
|
||||
The "writeback_limit_enable"'s default value is 0 so that it doesn't limit
|
||||
any writeback. IOW, if admin want to apply writeback budget, he should
|
||||
enable writeback_limit_enable via
|
||||
|
||||
$ echo 1 > /sys/block/zramX/writeback_limit_enable
|
||||
|
||||
Once writeback_limit_enable is set, zram doesn't allow any writeback
|
||||
until admin set the budget via /sys/block/zramX/writeback_limit.
|
||||
|
||||
(If admin doesn't enable writeback_limit_enable, writeback_limit's value
|
||||
assigned via /sys/block/zramX/writeback_limit is meaninless.)
|
||||
|
||||
If admin want to limit writeback as per-day 400M, he could do it
|
||||
like below.
|
||||
|
||||
MB_SHIFT=20
|
||||
4K_SHIFT=12
|
||||
echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
|
||||
/sys/block/zram0/writeback_limit.
|
||||
$ MB_SHIFT=20
|
||||
$ 4K_SHIFT=12
|
||||
$ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
|
||||
/sys/block/zram0/writeback_limit.
|
||||
$ echo 1 > /sys/block/zram0/writeback_limit_enable
|
||||
|
||||
If admin want to allow further write again, he could do it like below
|
||||
If admin want to allow further write again once the bugdet is exausted,
|
||||
he could do it like below
|
||||
|
||||
echo 0 > /sys/block/zram0/writeback_limit
|
||||
$ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
|
||||
/sys/block/zram0/writeback_limit
|
||||
|
||||
If admin want to see remaining writeback budget since he set,
|
||||
|
||||
cat /sys/block/zram0/writeback_limit
|
||||
$ cat /sys/block/zramX/writeback_limit
|
||||
|
||||
If admin want to disable writeback limit, he could do
|
||||
|
||||
$ echo 0 > /sys/block/zramX/writeback_limit_enable
|
||||
|
||||
The writeback_limit count will reset whenever you reset zram(e.g.,
|
||||
system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of
|
||||
writeback happened until you reset the zram to allocate extra writeback
|
||||
budget in next setting is user's job.
|
||||
|
||||
If admin want to measure writeback count in a certain period, he could
|
||||
know it via /sys/block/zram0/bd_stat's 3rd column.
|
||||
|
||||
= memory tracking
|
||||
|
||||
With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the
|
||||
|
@ -1,7 +1,8 @@
|
||||
Altera SOCFPGA Reset Manager
|
||||
|
||||
Required properties:
|
||||
- compatible : "altr,rst-mgr"
|
||||
- compatible : "altr,rst-mgr" for (Cyclone5/Arria5/Arria10)
|
||||
"altr,stratix10-rst-mgr","altr,rst-mgr" for Stratix10 ARM64 SoC
|
||||
- reg : Should contain 1 register ranges(address and length)
|
||||
- altr,modrst-offset : Should contain the offset of the first modrst register.
|
||||
- #reset-cells: 1
|
||||
|
@ -120,27 +120,30 @@ Example:
|
||||
};
|
||||
|
||||
|
||||
USB3 core reset
|
||||
---------------
|
||||
Peripheral core reset in glue layer
|
||||
-----------------------------------
|
||||
|
||||
USB3 core reset belongs to USB3 glue layer. Before using the core reset,
|
||||
it is necessary to control the clocks and resets to enable this layer.
|
||||
These clocks and resets should be described in each property.
|
||||
Some peripheral core reset belongs to its own glue layer. Before using
|
||||
this core reset, it is necessary to control the clocks and resets to enable
|
||||
this layer. These clocks and resets should be described in each property.
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be
|
||||
"socionext,uniphier-pro4-usb3-reset" - for Pro4 SoC
|
||||
"socionext,uniphier-pxs2-usb3-reset" - for PXs2 SoC
|
||||
"socionext,uniphier-ld20-usb3-reset" - for LD20 SoC
|
||||
"socionext,uniphier-pxs3-usb3-reset" - for PXs3 SoC
|
||||
"socionext,uniphier-pro4-usb3-reset" - for Pro4 SoC USB3
|
||||
"socionext,uniphier-pxs2-usb3-reset" - for PXs2 SoC USB3
|
||||
"socionext,uniphier-ld20-usb3-reset" - for LD20 SoC USB3
|
||||
"socionext,uniphier-pxs3-usb3-reset" - for PXs3 SoC USB3
|
||||
"socionext,uniphier-pro4-ahci-reset" - for Pro4 SoC AHCI
|
||||
"socionext,uniphier-pxs2-ahci-reset" - for PXs2 SoC AHCI
|
||||
"socionext,uniphier-pxs3-ahci-reset" - for PXs3 SoC AHCI
|
||||
- #reset-cells: Should be 1.
|
||||
- reg: Specifies offset and length of the register set for the device.
|
||||
- clocks: A list of phandles to the clock gate for USB3 glue layer.
|
||||
- clocks: A list of phandles to the clock gate for the glue layer.
|
||||
According to the clock-names, appropriate clocks are required.
|
||||
- clock-names: Should contain
|
||||
"gio", "link" - for Pro4 SoC
|
||||
"link" - for others
|
||||
- resets: A list of phandles to the reset control for USB3 glue layer.
|
||||
- resets: A list of phandles to the reset control for the glue layer.
|
||||
According to the reset-names, appropriate resets are required.
|
||||
- reset-names: Should contain
|
||||
"gio", "link" - for Pro4 SoC
|
||||
|
@ -124,11 +124,11 @@ struct bus_attribute {
|
||||
ssize_t (*store)(struct bus_type *, const char * buf, size_t count);
|
||||
};
|
||||
|
||||
Bus drivers can export attributes using the BUS_ATTR macro that works
|
||||
similarly to the DEVICE_ATTR macro for devices. For example, a definition
|
||||
like this:
|
||||
Bus drivers can export attributes using the BUS_ATTR_RW macro that works
|
||||
similarly to the DEVICE_ATTR_RW macro for devices. For example, a
|
||||
definition like this:
|
||||
|
||||
static BUS_ATTR(debug,0644,show_debug,store_debug);
|
||||
static BUS_ATTR_RW(debug);
|
||||
|
||||
is equivalent to declaring:
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | ok |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | ok |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | ok |
|
||||
| csky: | ok |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | ok |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | ok |
|
||||
| hexagon: | ok |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | ok |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | ok |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | ok |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | ok |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -34,6 +34,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | .. |
|
||||
| arm64: | ok |
|
||||
| c6x: | .. |
|
||||
| csky: | .. |
|
||||
| h8300: | .. |
|
||||
| hexagon: | .. |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | ok |
|
||||
| csky: | ok |
|
||||
| h8300: | ok |
|
||||
| hexagon: | ok |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | .. |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | ok |
|
||||
| c6x: | ok |
|
||||
| csky: | ok |
|
||||
| h8300: | ok |
|
||||
| hexagon: | ok |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | .. |
|
||||
| csky: | .. |
|
||||
| h8300: | .. |
|
||||
| hexagon: | .. |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | .. |
|
||||
| csky: | TODO |
|
||||
| h8300: | .. |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | TODO |
|
||||
| arm64: | TODO |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | .. |
|
||||
| arm64: | ok |
|
||||
| c6x: | .. |
|
||||
| csky: | .. |
|
||||
| h8300: | .. |
|
||||
| hexagon: | .. |
|
||||
| ia64: | ok |
|
||||
|
@ -11,6 +11,7 @@
|
||||
| arm: | ok |
|
||||
| arm64: | ok |
|
||||
| c6x: | TODO |
|
||||
| csky: | TODO |
|
||||
| h8300: | TODO |
|
||||
| hexagon: | TODO |
|
||||
| ia64: | TODO |
|
||||
|
@ -344,7 +344,9 @@ struct bus_attribute {
|
||||
|
||||
Declaring:
|
||||
|
||||
BUS_ATTR(_name, _mode, _show, _store)
|
||||
static BUS_ATTR_RW(name);
|
||||
static BUS_ATTR_RO(name);
|
||||
static BUS_ATTR_WO(name);
|
||||
|
||||
Creation/Removal:
|
||||
|
||||
|
@ -165,7 +165,7 @@ Do some work...
|
||||
The same can also be done from an application program.
|
||||
|
||||
Disable specific CPU's specific idle state from cpuidle sysfs (see
|
||||
Documentation/cpuidle/sysfs.txt):
|
||||
Documentation/admin-guide/pm/cpuidle.rst):
|
||||
# echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
|
||||
|
||||
|
||||
|
@ -242,6 +242,6 @@ References
|
||||
==========
|
||||
|
||||
.. [white-paper] http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/12/AMD_Memory_Encryption_Whitepaper_v7-Public.pdf
|
||||
.. [api-spec] http://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf
|
||||
.. [api-spec] http://support.amd.com/TechDocs/55766_SEV-KM_API_Specification.pdf
|
||||
.. [amd-apm] http://support.amd.com/TechDocs/24593.pdf (section 15.34)
|
||||
.. [kvm-forum] http://www.linux-kvm.org/images/7/74/02x08A-Thomas_Lendacky-AMDs_Virtualizatoin_Memory_Encryption_Technology.pdf
|
||||
|
@ -9,7 +9,7 @@ Fenghua Yu <fenghua.yu@intel.com>
|
||||
Tony Luck <tony.luck@intel.com>
|
||||
Vikas Shivappa <vikas.shivappa@intel.com>
|
||||
|
||||
This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
|
||||
This feature is enabled by the CONFIG_X86_RESCTRL and the x86 /proc/cpuinfo
|
||||
flag bits:
|
||||
RDT (Resource Director Technology) Allocation - "rdt_a"
|
||||
CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
|
||||
|
16
MAINTAINERS
16
MAINTAINERS
@ -3951,7 +3951,7 @@ L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/ti/cpmac.c
|
||||
|
||||
CPU FREQUENCY DRIVERS
|
||||
CPU FREQUENCY SCALING FRAMEWORK
|
||||
M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
|
||||
M: Viresh Kumar <viresh.kumar@linaro.org>
|
||||
L: linux-pm@vger.kernel.org
|
||||
@ -3959,6 +3959,8 @@ S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
|
||||
T: git git://git.linaro.org/people/vireshk/linux.git (For ARM Updates)
|
||||
B: https://bugzilla.kernel.org
|
||||
F: Documentation/admin-guide/pm/cpufreq.rst
|
||||
F: Documentation/admin-guide/pm/intel_pstate.rst
|
||||
F: Documentation/cpu-freq/
|
||||
F: Documentation/devicetree/bindings/cpufreq/
|
||||
F: drivers/cpufreq/
|
||||
@ -4006,13 +4008,14 @@ S: Supported
|
||||
F: drivers/cpuidle/cpuidle-exynos.c
|
||||
F: arch/arm/mach-exynos/pm.c
|
||||
|
||||
CPUIDLE DRIVERS
|
||||
CPU IDLE TIME MANAGEMENT FRAMEWORK
|
||||
M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
|
||||
M: Daniel Lezcano <daniel.lezcano@linaro.org>
|
||||
L: linux-pm@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
|
||||
B: https://bugzilla.kernel.org
|
||||
F: Documentation/admin-guide/pm/cpuidle.rst
|
||||
F: drivers/cpuidle/*
|
||||
F: include/linux/cpuidle.h
|
||||
|
||||
@ -13820,8 +13823,9 @@ F: drivers/media/mmc/siano/
|
||||
|
||||
SIFIVE DRIVERS
|
||||
M: Palmer Dabbelt <palmer@sifive.com>
|
||||
M: Paul Walmsley <paul.walmsley@sifive.com>
|
||||
L: linux-riscv@lists.infradead.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux.git
|
||||
T: git git://github.com/sifive/riscv-linux.git
|
||||
S: Supported
|
||||
K: sifive
|
||||
N: sifive
|
||||
@ -14432,6 +14436,11 @@ M: Florian Schilhabel <florian.c.schilhabel@googlemail.com>.
|
||||
S: Odd Fixes
|
||||
F: drivers/staging/rtl8712/
|
||||
|
||||
STAGING - REALTEK RTL8188EU DRIVERS
|
||||
M: Larry Finger <Larry.Finger@lwfinger.net>
|
||||
S: Odd Fixes
|
||||
F: drivers/staging/rtl8188eu/
|
||||
|
||||
STAGING - SILICON MOTION SM750 FRAME BUFFER DRIVER
|
||||
M: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
|
||||
M: Teddy Wang <teddy.wang@siliconmotion.com>
|
||||
@ -15802,7 +15811,6 @@ M: Alan Stern <stern@rowland.harvard.edu>
|
||||
L: linux-usb@vger.kernel.org
|
||||
L: usb-storage@lists.one-eyed-alien.net
|
||||
S: Maintained
|
||||
W: http://www.one-eyed-alien.net/~mdharm/linux-usb/
|
||||
F: drivers/usb/storage/
|
||||
|
||||
USB MIDI DRIVER
|
||||
|
2
Makefile
2
Makefile
@ -2,7 +2,7 @@
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 0
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc1
|
||||
EXTRAVERSION = -rc2
|
||||
NAME = Shy Crocodile
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -94,6 +94,28 @@
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
baseboard_3v3: fixedregulator-3v3 {
|
||||
/* TPS73701DCQ */
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "baseboard_3v3";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
vin-supply = <&vbat>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
baseboard_1v8: fixedregulator-1v8 {
|
||||
/* TPS73701DCQ */
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "baseboard_1v8";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
vin-supply = <&vbat>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
backlight_lcd: backlight-regulator {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "lcd_backlight_pwr";
|
||||
@ -105,7 +127,7 @@
|
||||
|
||||
sound {
|
||||
compatible = "simple-audio-card";
|
||||
simple-audio-card,name = "DA850/OMAP-L138 EVM";
|
||||
simple-audio-card,name = "DA850-OMAPL138 EVM";
|
||||
simple-audio-card,widgets =
|
||||
"Line", "Line In",
|
||||
"Line", "Line Out";
|
||||
@ -210,10 +232,9 @@
|
||||
|
||||
/* Regulators */
|
||||
IOVDD-supply = <&vdcdc2_reg>;
|
||||
/* Derived from VBAT: Baseboard 3.3V / 1.8V */
|
||||
AVDD-supply = <&vbat>;
|
||||
DRVDD-supply = <&vbat>;
|
||||
DVDD-supply = <&vbat>;
|
||||
AVDD-supply = <&baseboard_3v3>;
|
||||
DRVDD-supply = <&baseboard_3v3>;
|
||||
DVDD-supply = <&baseboard_1v8>;
|
||||
};
|
||||
tca6416: gpio@20 {
|
||||
compatible = "ti,tca6416";
|
||||
|
@ -39,9 +39,39 @@
|
||||
};
|
||||
};
|
||||
|
||||
vcc_5vd: fixedregulator-vcc_5vd {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_5vd";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
vcc_3v3d: fixedregulator-vcc_3v3d {
|
||||
/* TPS650250 - VDCDC1 */
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_3v3d";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
vin-supply = <&vcc_5vd>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
vcc_1v8d: fixedregulator-vcc_1v8d {
|
||||
/* TPS650250 - VDCDC2 */
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_1v8d";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
vin-supply = <&vcc_5vd>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
sound {
|
||||
compatible = "simple-audio-card";
|
||||
simple-audio-card,name = "DA850/OMAP-L138 LCDK";
|
||||
simple-audio-card,name = "DA850-OMAPL138 LCDK";
|
||||
simple-audio-card,widgets =
|
||||
"Line", "Line In",
|
||||
"Line", "Line Out";
|
||||
@ -221,6 +251,12 @@
|
||||
compatible = "ti,tlv320aic3106";
|
||||
reg = <0x18>;
|
||||
status = "okay";
|
||||
|
||||
/* Regulators */
|
||||
IOVDD-supply = <&vcc_3v3d>;
|
||||
AVDD-supply = <&vcc_3v3d>;
|
||||
DRVDD-supply = <&vcc_3v3d>;
|
||||
DVDD-supply = <&vcc_1v8d>;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -36,8 +36,8 @@
|
||||
compatible = "gpio-fan";
|
||||
pinctrl-0 = <&pmx_fan_high_speed &pmx_fan_low_speed>;
|
||||
pinctrl-names = "default";
|
||||
gpios = <&gpio1 14 GPIO_ACTIVE_LOW
|
||||
&gpio1 13 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&gpio1 14 GPIO_ACTIVE_HIGH
|
||||
&gpio1 13 GPIO_ACTIVE_HIGH>;
|
||||
gpio-fan,speed-map = <0 0
|
||||
3000 1
|
||||
6000 2>;
|
||||
|
@ -208,9 +208,9 @@ static struct gpiod_lookup_table mmc_gpios_table = {
|
||||
.dev_id = "da830-mmc.0",
|
||||
.table = {
|
||||
/* gpio chip 1 contains gpio range 32-63 */
|
||||
GPIO_LOOKUP("davinci_gpio.0", DA830_MMCSD_CD_PIN, "cd",
|
||||
GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_CD_PIN, "cd",
|
||||
GPIO_ACTIVE_LOW),
|
||||
GPIO_LOOKUP("davinci_gpio.0", DA830_MMCSD_WP_PIN, "wp",
|
||||
GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_WP_PIN, "wp",
|
||||
GPIO_ACTIVE_LOW),
|
||||
},
|
||||
};
|
||||
|
@ -805,9 +805,9 @@ static struct gpiod_lookup_table mmc_gpios_table = {
|
||||
.dev_id = "da830-mmc.0",
|
||||
.table = {
|
||||
/* gpio chip 2 contains gpio range 64-95 */
|
||||
GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd",
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_CD_PIN, "cd",
|
||||
GPIO_ACTIVE_LOW),
|
||||
GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp",
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_WP_PIN, "wp",
|
||||
GPIO_ACTIVE_HIGH),
|
||||
},
|
||||
};
|
||||
|
@ -117,9 +117,9 @@ static struct platform_device davinci_nand_device = {
|
||||
static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
|
||||
.dev_id = "i2c_davinci.1",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SDA_PIN, "sda",
|
||||
GPIO_LOOKUP("davinci_gpio", DM355_I2C_SDA_PIN, "sda",
|
||||
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
|
||||
GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SCL_PIN, "scl",
|
||||
GPIO_LOOKUP("davinci_gpio", DM355_I2C_SCL_PIN, "scl",
|
||||
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
|
||||
},
|
||||
};
|
||||
|
@ -660,9 +660,9 @@ static struct i2c_board_info __initdata i2c_info[] = {
|
||||
static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
|
||||
.dev_id = "i2c_davinci.1",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SDA_PIN, "sda",
|
||||
GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SDA_PIN, "sda",
|
||||
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
|
||||
GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SCL_PIN, "scl",
|
||||
GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SCL_PIN, "scl",
|
||||
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
|
||||
},
|
||||
};
|
||||
|
@ -134,9 +134,9 @@ static const short hawk_mmcsd0_pins[] = {
|
||||
static struct gpiod_lookup_table mmc_gpios_table = {
|
||||
.dev_id = "da830-mmc.0",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio.0", DA850_HAWK_MMCSD_CD_PIN, "cd",
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_HAWK_MMCSD_CD_PIN, "cd",
|
||||
GPIO_ACTIVE_LOW),
|
||||
GPIO_LOOKUP("davinci_gpio.0", DA850_HAWK_MMCSD_WP_PIN, "wp",
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_HAWK_MMCSD_WP_PIN, "wp",
|
||||
GPIO_ACTIVE_LOW),
|
||||
},
|
||||
};
|
||||
|
@ -390,10 +390,14 @@ static int __ref impd1_probe(struct lm_device *dev)
|
||||
char *mmciname;
|
||||
|
||||
lookup = devm_kzalloc(&dev->dev,
|
||||
sizeof(*lookup) + 3 * sizeof(struct gpiod_lookup),
|
||||
struct_size(lookup, table, 3),
|
||||
GFP_KERNEL);
|
||||
chipname = devm_kstrdup(&dev->dev, devname, GFP_KERNEL);
|
||||
mmciname = kasprintf(GFP_KERNEL, "lm%x:00700", dev->id);
|
||||
mmciname = devm_kasprintf(&dev->dev, GFP_KERNEL,
|
||||
"lm%x:00700", dev->id);
|
||||
if (!lookup || !chipname || !mmciname)
|
||||
return -ENOMEM;
|
||||
|
||||
lookup->dev_id = mmciname;
|
||||
/*
|
||||
* Offsets on GPIO block 1:
|
||||
|
@ -32,6 +32,8 @@ void __iomem *rst_manager_base_addr;
|
||||
void __iomem *sdr_ctl_base_addr;
|
||||
unsigned long socfpga_cpu1start_addr;
|
||||
|
||||
extern void __init socfpga_reset_init(void);
|
||||
|
||||
static void __init socfpga_sysmgr_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
@ -64,6 +66,7 @@ static void __init socfpga_init_irq(void)
|
||||
|
||||
if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
|
||||
socfpga_init_ocram_ecc();
|
||||
socfpga_reset_init();
|
||||
}
|
||||
|
||||
static void __init socfpga_arria10_init_irq(void)
|
||||
@ -74,6 +77,7 @@ static void __init socfpga_arria10_init_irq(void)
|
||||
socfpga_init_arria10_l2_ecc();
|
||||
if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
|
||||
socfpga_init_arria10_ocram_ecc();
|
||||
socfpga_reset_init();
|
||||
}
|
||||
|
||||
static void socfpga_cyclone5_restart(enum reboot_mode mode, const char *cmd)
|
||||
|
@ -183,7 +183,7 @@
|
||||
pinctrl-0 = <&cp0_pcie_pins>;
|
||||
num-lanes = <4>;
|
||||
num-viewport = <8>;
|
||||
reset-gpio = <&cp0_gpio1 20 GPIO_ACTIVE_LOW>;
|
||||
reset-gpios = <&cp0_gpio2 20 GPIO_ACTIVE_LOW>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,23 @@
|
||||
method = "smc";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
/*
|
||||
* This area matches the mapping done with a
|
||||
* mainline U-Boot, and should be updated by the
|
||||
* bootloader.
|
||||
*/
|
||||
|
||||
psci-area@4000000 {
|
||||
reg = <0x0 0x4000000 0x0 0x200000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
|
||||
ap806 {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
|
@ -506,11 +506,15 @@ CONFIG_SND_SOC_ROCKCHIP=m
|
||||
CONFIG_SND_SOC_ROCKCHIP_SPDIF=m
|
||||
CONFIG_SND_SOC_ROCKCHIP_RT5645=m
|
||||
CONFIG_SND_SOC_RK3399_GRU_SOUND=m
|
||||
CONFIG_SND_MESON_AXG_SOUND_CARD=m
|
||||
CONFIG_SND_SOC_SAMSUNG=y
|
||||
CONFIG_SND_SOC_RCAR=m
|
||||
CONFIG_SND_SOC_AK4613=m
|
||||
CONFIG_SND_SIMPLE_CARD=m
|
||||
CONFIG_SND_AUDIO_GRAPH_CARD=m
|
||||
CONFIG_SND_SOC_ES7134=m
|
||||
CONFIG_SND_SOC_ES7241=m
|
||||
CONFIG_SND_SOC_TAS571X=m
|
||||
CONFIG_I2C_HID=m
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_OTG=y
|
||||
|
@ -2,7 +2,7 @@
|
||||
#ifndef __ASM_PROTOTYPES_H
|
||||
#define __ASM_PROTOTYPES_H
|
||||
/*
|
||||
* CONFIG_MODEVERIONS requires a C declaration to generate the appropriate CRC
|
||||
* CONFIG_MODVERSIONS requires a C declaration to generate the appropriate CRC
|
||||
* for each symbol. Since commit:
|
||||
*
|
||||
* 4efca4ed05cbdfd1 ("kbuild: modversions for EXPORT_SYMBOL() for asm")
|
||||
|
@ -58,6 +58,12 @@
|
||||
*/
|
||||
#define ARCH_DMA_MINALIGN (128)
|
||||
|
||||
#ifdef CONFIG_KASAN_SW_TAGS
|
||||
#define ARCH_SLAB_MINALIGN (1ULL << KASAN_SHADOW_SCALE_SHIFT)
|
||||
#else
|
||||
#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
@ -16,6 +16,8 @@
|
||||
#ifndef __ASM_MMU_H
|
||||
#define __ASM_MMU_H
|
||||
|
||||
#include <asm/cputype.h>
|
||||
|
||||
#define MMCF_AARCH32 0x1 /* mm context flag for AArch32 executables */
|
||||
#define USER_ASID_BIT 48
|
||||
#define USER_ASID_FLAG (UL(1) << USER_ASID_BIT)
|
||||
@ -44,6 +46,45 @@ static inline bool arm64_kernel_unmapped_at_el0(void)
|
||||
cpus_have_const_cap(ARM64_UNMAP_KERNEL_AT_EL0);
|
||||
}
|
||||
|
||||
static inline bool arm64_kernel_use_ng_mappings(void)
|
||||
{
|
||||
bool tx1_bug;
|
||||
|
||||
/* What's a kpti? Use global mappings if we don't know. */
|
||||
if (!IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Note: this function is called before the CPU capabilities have
|
||||
* been configured, so our early mappings will be global. If we
|
||||
* later determine that kpti is required, then
|
||||
* kpti_install_ng_mappings() will make them non-global.
|
||||
*/
|
||||
if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE))
|
||||
return arm64_kernel_unmapped_at_el0();
|
||||
|
||||
/*
|
||||
* KASLR is enabled so we're going to be enabling kpti on non-broken
|
||||
* CPUs regardless of their susceptibility to Meltdown. Rather
|
||||
* than force everybody to go through the G -> nG dance later on,
|
||||
* just put down non-global mappings from the beginning.
|
||||
*/
|
||||
if (!IS_ENABLED(CONFIG_CAVIUM_ERRATUM_27456)) {
|
||||
tx1_bug = false;
|
||||
#ifndef MODULE
|
||||
} else if (!static_branch_likely(&arm64_const_caps_ready)) {
|
||||
extern const struct midr_range cavium_erratum_27456_cpus[];
|
||||
|
||||
tx1_bug = is_midr_in_range_list(read_cpuid_id(),
|
||||
cavium_erratum_27456_cpus);
|
||||
#endif
|
||||
} else {
|
||||
tx1_bug = __cpus_have_const_cap(ARM64_WORKAROUND_CAVIUM_27456);
|
||||
}
|
||||
|
||||
return !tx1_bug && kaslr_offset() > 0;
|
||||
}
|
||||
|
||||
typedef void (*bp_hardening_cb_t)(void);
|
||||
|
||||
struct bp_hardening_data {
|
||||
|
@ -37,8 +37,8 @@
|
||||
#define _PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
|
||||
#define _PROT_SECT_DEFAULT (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
|
||||
|
||||
#define PTE_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PTE_NG : 0)
|
||||
#define PMD_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PMD_SECT_NG : 0)
|
||||
#define PTE_MAYBE_NG (arm64_kernel_use_ng_mappings() ? PTE_NG : 0)
|
||||
#define PMD_MAYBE_NG (arm64_kernel_use_ng_mappings() ? PMD_SECT_NG : 0)
|
||||
|
||||
#define PROT_DEFAULT (_PROT_DEFAULT | PTE_MAYBE_NG)
|
||||
#define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_MAYBE_NG)
|
||||
|
@ -553,7 +553,7 @@ static const struct midr_range arm64_repeat_tlbi_cpus[] = {
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CAVIUM_ERRATUM_27456
|
||||
static const struct midr_range cavium_erratum_27456_cpus[] = {
|
||||
const struct midr_range cavium_erratum_27456_cpus[] = {
|
||||
/* Cavium ThunderX, T88 pass 1.x - 2.1 */
|
||||
MIDR_RANGE(MIDR_THUNDERX, 0, 0, 1, 1),
|
||||
/* Cavium ThunderX, T81 pass 1.0 */
|
||||
|
@ -983,7 +983,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
|
||||
|
||||
/* Useful for KASLR robustness */
|
||||
if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
|
||||
return true;
|
||||
return kaslr_offset() > 0;
|
||||
|
||||
/* Don't force KPTI for CPUs that are not vulnerable */
|
||||
if (is_midr_in_range_list(read_cpuid_id(), kpti_safe_list))
|
||||
@ -1003,7 +1003,12 @@ kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
|
||||
static bool kpti_applied = false;
|
||||
int cpu = smp_processor_id();
|
||||
|
||||
if (kpti_applied)
|
||||
/*
|
||||
* We don't need to rewrite the page-tables if either we've done
|
||||
* it already or we have KASLR enabled and therefore have not
|
||||
* created any global mappings at all.
|
||||
*/
|
||||
if (kpti_applied || kaslr_offset() > 0)
|
||||
return;
|
||||
|
||||
remap_fn = (void *)__pa_symbol(idmap_kpti_install_ng_mappings);
|
||||
|
@ -475,6 +475,7 @@ ENDPROC(__primary_switched)
|
||||
|
||||
ENTRY(kimage_vaddr)
|
||||
.quad _text - TEXT_OFFSET
|
||||
EXPORT_SYMBOL(kimage_vaddr)
|
||||
|
||||
/*
|
||||
* If we're fortunate enough to boot at EL2, ensure that the world is
|
||||
|
@ -87,7 +87,9 @@ static int setup_dtb(struct kimage *image,
|
||||
|
||||
/* add kaslr-seed */
|
||||
ret = fdt_delprop(dtb, off, FDT_PROP_KASLR_SEED);
|
||||
if (ret && (ret != -FDT_ERR_NOTFOUND))
|
||||
if (ret == -FDT_ERR_NOTFOUND)
|
||||
ret = 0;
|
||||
else if (ret)
|
||||
goto out;
|
||||
|
||||
if (rng_is_initialized()) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += kvm_para.h
|
||||
generic-y += shmparam.h
|
||||
generic-y += ucontext.h
|
||||
|
@ -15,6 +15,31 @@ extern void iounmap(void *addr);
|
||||
extern int remap_area_pages(unsigned long address, phys_addr_t phys_addr,
|
||||
size_t size, unsigned long flags);
|
||||
|
||||
/*
|
||||
* I/O memory access primitives. Reads are ordered relative to any
|
||||
* following Normal memory access. Writes are ordered relative to any prior
|
||||
* Normal memory access.
|
||||
*
|
||||
* For CACHEV1 (807, 810), store instruction could fast retire, so we need
|
||||
* another mb() to prevent st fast retire.
|
||||
*
|
||||
* For CACHEV2 (860), store instruction with PAGE_ATTR_NO_BUFFERABLE won't
|
||||
* fast retire.
|
||||
*/
|
||||
#define readb(c) ({ u8 __v = readb_relaxed(c); rmb(); __v; })
|
||||
#define readw(c) ({ u16 __v = readw_relaxed(c); rmb(); __v; })
|
||||
#define readl(c) ({ u32 __v = readl_relaxed(c); rmb(); __v; })
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_CACHEV2
|
||||
#define writeb(v,c) ({ wmb(); writeb_relaxed((v),(c)); })
|
||||
#define writew(v,c) ({ wmb(); writew_relaxed((v),(c)); })
|
||||
#define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); })
|
||||
#else
|
||||
#define writeb(v,c) ({ wmb(); writeb_relaxed((v),(c)); mb(); })
|
||||
#define writew(v,c) ({ wmb(); writew_relaxed((v),(c)); mb(); })
|
||||
#define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); mb(); })
|
||||
#endif
|
||||
|
||||
#define ioremap_nocache(phy, sz) ioremap(phy, sz)
|
||||
#define ioremap_wc ioremap_nocache
|
||||
#define ioremap_wt ioremap_nocache
|
||||
|
@ -24,41 +24,34 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
|
||||
|
||||
extern void pgd_init(unsigned long *p);
|
||||
|
||||
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
|
||||
unsigned long address)
|
||||
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
|
||||
{
|
||||
pte_t *pte;
|
||||
unsigned long *kaddr, i;
|
||||
unsigned long i;
|
||||
|
||||
pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL,
|
||||
PTE_ORDER);
|
||||
kaddr = (unsigned long *)pte;
|
||||
if (address & 0x80000000)
|
||||
for (i = 0; i < (PAGE_SIZE/4); i++)
|
||||
*(kaddr + i) = 0x1;
|
||||
else
|
||||
clear_page(kaddr);
|
||||
pte = (pte_t *) __get_free_page(GFP_KERNEL);
|
||||
if (!pte)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++)
|
||||
(pte + i)->pte_low = _PAGE_GLOBAL;
|
||||
|
||||
return pte;
|
||||
}
|
||||
|
||||
static inline struct page *pte_alloc_one(struct mm_struct *mm,
|
||||
unsigned long address)
|
||||
static inline struct page *pte_alloc_one(struct mm_struct *mm)
|
||||
{
|
||||
struct page *pte;
|
||||
unsigned long *kaddr, i;
|
||||
|
||||
pte = alloc_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL, PTE_ORDER);
|
||||
if (pte) {
|
||||
kaddr = kmap_atomic(pte);
|
||||
if (address & 0x80000000) {
|
||||
for (i = 0; i < (PAGE_SIZE/4); i++)
|
||||
*(kaddr + i) = 0x1;
|
||||
} else
|
||||
clear_page(kaddr);
|
||||
kunmap_atomic(kaddr);
|
||||
pgtable_page_ctor(pte);
|
||||
pte = alloc_pages(GFP_KERNEL | __GFP_ZERO, 0);
|
||||
if (!pte)
|
||||
return NULL;
|
||||
|
||||
if (!pgtable_page_ctor(pte)) {
|
||||
__free_page(pte);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pte;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
#if defined(__CSKYABIV2__)
|
||||
#ifdef CONFIG_CPU_CK810
|
||||
#define IS_BSR32(hi16, lo16) (((hi16) & 0xFC00) == 0xE000)
|
||||
#define IS_JSRI32(hi16, lo16) ((hi16) == 0xEAE0)
|
||||
|
||||
@ -25,6 +25,26 @@
|
||||
*(uint16_t *)(addr) = 0xE8Fa; \
|
||||
*((uint16_t *)(addr) + 1) = 0x0000; \
|
||||
} while (0)
|
||||
|
||||
static void jsri_2_lrw_jsr(uint32_t *location)
|
||||
{
|
||||
uint16_t *location_tmp = (uint16_t *)location;
|
||||
|
||||
if (IS_BSR32(*location_tmp, *(location_tmp + 1)))
|
||||
return;
|
||||
|
||||
if (IS_JSRI32(*location_tmp, *(location_tmp + 1))) {
|
||||
/* jsri 0x... --> lrw r26, 0x... */
|
||||
CHANGE_JSRI_TO_LRW(location);
|
||||
/* lsli r0, r0 --> jsr r26 */
|
||||
SET_JSR32_R26(location + 1);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void inline jsri_2_lrw_jsr(uint32_t *location)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
|
||||
@ -35,9 +55,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
|
||||
Elf32_Sym *sym;
|
||||
uint32_t *location;
|
||||
short *temp;
|
||||
#if defined(__CSKYABIV2__)
|
||||
uint16_t *location_tmp;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
|
||||
/* This is where to make the change */
|
||||
@ -59,18 +76,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
|
||||
case R_CSKY_PCRELJSR_IMM11BY2:
|
||||
break;
|
||||
case R_CSKY_PCRELJSR_IMM26BY2:
|
||||
#if defined(__CSKYABIV2__)
|
||||
location_tmp = (uint16_t *)location;
|
||||
if (IS_BSR32(*location_tmp, *(location_tmp + 1)))
|
||||
break;
|
||||
|
||||
if (IS_JSRI32(*location_tmp, *(location_tmp + 1))) {
|
||||
/* jsri 0x... --> lrw r26, 0x... */
|
||||
CHANGE_JSRI_TO_LRW(location);
|
||||
/* lsli r0, r0 --> jsr r26 */
|
||||
SET_JSR32_R26(location + 1);
|
||||
}
|
||||
#endif
|
||||
jsri_2_lrw_jsr(location);
|
||||
break;
|
||||
case R_CSKY_ADDR_HI16:
|
||||
temp = ((short *)location) + 1;
|
||||
|
@ -1,4 +1,5 @@
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += kvm_para.h
|
||||
generic-y += shmparam.h
|
||||
generic-y += ucontext.h
|
||||
|
@ -1,3 +1,4 @@
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += shmparam.h
|
||||
generic-y += ucontext.h
|
||||
|
@ -2,3 +2,4 @@ include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generated-y += unistd_32.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += shmparam.h
|
||||
|
@ -2,4 +2,5 @@ include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generated-y += unistd_32.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += shmparam.h
|
||||
generic-y += ucontext.h
|
||||
|
@ -129,9 +129,9 @@ ltq_dma_alloc(struct ltq_dma_channel *ch)
|
||||
unsigned long flags;
|
||||
|
||||
ch->desc = 0;
|
||||
ch->desc_base = dma_zalloc_coherent(ch->dev,
|
||||
LTQ_DESC_NUM * LTQ_DESC_SIZE,
|
||||
&ch->phys, GFP_ATOMIC);
|
||||
ch->desc_base = dma_alloc_coherent(ch->dev,
|
||||
LTQ_DESC_NUM * LTQ_DESC_SIZE,
|
||||
&ch->phys, GFP_ATOMIC);
|
||||
|
||||
spin_lock_irqsave(<q_dma_lock, flags);
|
||||
ltq_dma_w32(ch->nr, LTQ_DMA_CS);
|
||||
|
@ -58,8 +58,12 @@
|
||||
/* Ensure that addr is below task's addr_limit */
|
||||
#define __addr_ok(addr) ((unsigned long) addr < get_fs())
|
||||
|
||||
#define access_ok(addr, size) \
|
||||
__range_ok((unsigned long)addr, (unsigned long)size)
|
||||
#define access_ok(addr, size) \
|
||||
({ \
|
||||
unsigned long __ao_addr = (unsigned long)(addr); \
|
||||
unsigned long __ao_size = (unsigned long)(size); \
|
||||
__range_ok(__ao_addr, __ao_size); \
|
||||
})
|
||||
|
||||
/*
|
||||
* These are the main single-value transfer routines. They automatically
|
||||
|
@ -1,4 +1,5 @@
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += kvm_para.h
|
||||
generic-y += shmparam.h
|
||||
generic-y += ucontext.h
|
||||
|
@ -255,7 +255,7 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size)
|
||||
|
||||
chan->ring_size = ring_size;
|
||||
|
||||
chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev,
|
||||
chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev,
|
||||
ring_size * sizeof(u64),
|
||||
&chan->ring_dma, GFP_KERNEL);
|
||||
|
||||
|
@ -756,9 +756,10 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
|
||||
}
|
||||
|
||||
/* Initialize outbound message descriptor ring */
|
||||
rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
|
||||
rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
|
||||
&rmu->msg_tx_ring.phys, GFP_KERNEL);
|
||||
rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
|
||||
rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
|
||||
&rmu->msg_tx_ring.phys,
|
||||
GFP_KERNEL);
|
||||
if (!rmu->msg_tx_ring.virt) {
|
||||
rc = -ENOMEM;
|
||||
goto out_dma;
|
||||
|
@ -28,11 +28,13 @@ config RISCV
|
||||
select GENERIC_STRNLEN_USER
|
||||
select GENERIC_SMP_IDLE_THREAD
|
||||
select GENERIC_ATOMIC64 if !64BIT || !RISCV_ISA_A
|
||||
select HAVE_ARCH_AUDITSYSCALL
|
||||
select HAVE_MEMBLOCK_NODE_MAP
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
select HAVE_GENERIC_DMA_COHERENT
|
||||
select HAVE_PERF_EVENTS
|
||||
select HAVE_SYSCALL_TRACEPOINTS
|
||||
select IRQ_DOMAIN
|
||||
select RISCV_ISA_A if SMP
|
||||
select SPARSE_IRQ
|
||||
@ -40,6 +42,7 @@ config RISCV
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_PCI
|
||||
select MODULES_USE_ELF_RELA if MODULES
|
||||
select MODULE_SECTIONS if MODULES
|
||||
select THREAD_INFO_IN_TASK
|
||||
select PCI_DOMAINS_GENERIC if PCI
|
||||
select PCI_MSI if PCI
|
||||
@ -152,7 +155,6 @@ choice
|
||||
bool "2GiB"
|
||||
config MAXPHYSMEM_128GB
|
||||
depends on 64BIT && CMODEL_MEDANY
|
||||
select MODULE_SECTIONS if MODULES
|
||||
bool "128GiB"
|
||||
endchoice
|
||||
|
||||
|
@ -9,12 +9,12 @@
|
||||
#define MODULE_ARCH_VERMAGIC "riscv"
|
||||
|
||||
struct module;
|
||||
u64 module_emit_got_entry(struct module *mod, u64 val);
|
||||
u64 module_emit_plt_entry(struct module *mod, u64 val);
|
||||
unsigned long module_emit_got_entry(struct module *mod, unsigned long val);
|
||||
unsigned long module_emit_plt_entry(struct module *mod, unsigned long val);
|
||||
|
||||
#ifdef CONFIG_MODULE_SECTIONS
|
||||
struct mod_section {
|
||||
struct elf64_shdr *shdr;
|
||||
Elf_Shdr *shdr;
|
||||
int num_entries;
|
||||
int max_entries;
|
||||
};
|
||||
@ -26,18 +26,18 @@ struct mod_arch_specific {
|
||||
};
|
||||
|
||||
struct got_entry {
|
||||
u64 symbol_addr; /* the real variable address */
|
||||
unsigned long symbol_addr; /* the real variable address */
|
||||
};
|
||||
|
||||
static inline struct got_entry emit_got_entry(u64 val)
|
||||
static inline struct got_entry emit_got_entry(unsigned long val)
|
||||
{
|
||||
return (struct got_entry) {val};
|
||||
}
|
||||
|
||||
static inline struct got_entry *get_got_entry(u64 val,
|
||||
static inline struct got_entry *get_got_entry(unsigned long val,
|
||||
const struct mod_section *sec)
|
||||
{
|
||||
struct got_entry *got = (struct got_entry *)sec->shdr->sh_addr;
|
||||
struct got_entry *got = (struct got_entry *)(sec->shdr->sh_addr);
|
||||
int i;
|
||||
for (i = 0; i < sec->num_entries; i++) {
|
||||
if (got[i].symbol_addr == val)
|
||||
@ -62,7 +62,9 @@ struct plt_entry {
|
||||
#define REG_T0 0x5
|
||||
#define REG_T1 0x6
|
||||
|
||||
static inline struct plt_entry emit_plt_entry(u64 val, u64 plt, u64 got_plt)
|
||||
static inline struct plt_entry emit_plt_entry(unsigned long val,
|
||||
unsigned long plt,
|
||||
unsigned long got_plt)
|
||||
{
|
||||
/*
|
||||
* U-Type encoding:
|
||||
@ -76,7 +78,7 @@ static inline struct plt_entry emit_plt_entry(u64 val, u64 plt, u64 got_plt)
|
||||
* +------------+------------+--------+----------+----------+
|
||||
*
|
||||
*/
|
||||
u64 offset = got_plt - plt;
|
||||
unsigned long offset = got_plt - plt;
|
||||
u32 hi20 = (offset + 0x800) & 0xfffff000;
|
||||
u32 lo12 = (offset - hi20);
|
||||
return (struct plt_entry) {
|
||||
@ -86,7 +88,7 @@ static inline struct plt_entry emit_plt_entry(u64 val, u64 plt, u64 got_plt)
|
||||
};
|
||||
}
|
||||
|
||||
static inline int get_got_plt_idx(u64 val, const struct mod_section *sec)
|
||||
static inline int get_got_plt_idx(unsigned long val, const struct mod_section *sec)
|
||||
{
|
||||
struct got_entry *got_plt = (struct got_entry *)sec->shdr->sh_addr;
|
||||
int i;
|
||||
@ -97,9 +99,9 @@ static inline int get_got_plt_idx(u64 val, const struct mod_section *sec)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline struct plt_entry *get_plt_entry(u64 val,
|
||||
const struct mod_section *sec_plt,
|
||||
const struct mod_section *sec_got_plt)
|
||||
static inline struct plt_entry *get_plt_entry(unsigned long val,
|
||||
const struct mod_section *sec_plt,
|
||||
const struct mod_section *sec_got_plt)
|
||||
{
|
||||
struct plt_entry *plt = (struct plt_entry *)sec_plt->shdr->sh_addr;
|
||||
int got_plt_idx = get_got_plt_idx(val, sec_got_plt);
|
||||
|
@ -113,6 +113,11 @@ static inline void frame_pointer_set(struct pt_regs *regs,
|
||||
SET_FP(regs, val);
|
||||
}
|
||||
|
||||
static inline unsigned long regs_return_value(struct pt_regs *regs)
|
||||
{
|
||||
return regs->a0;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _ASM_RISCV_PTRACE_H */
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef _ASM_RISCV_SYSCALL_H
|
||||
#define _ASM_RISCV_SYSCALL_H
|
||||
|
||||
#include <uapi/linux/audit.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/err.h>
|
||||
|
||||
@ -99,4 +100,13 @@ static inline void syscall_set_arguments(struct task_struct *task,
|
||||
memcpy(®s->a1 + i * sizeof(regs->a1), args, n * sizeof(regs->a0));
|
||||
}
|
||||
|
||||
static inline int syscall_get_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_64BIT
|
||||
return AUDIT_ARCH_RISCV64;
|
||||
#else
|
||||
return AUDIT_ARCH_RISCV32;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* _ASM_RISCV_SYSCALL_H */
|
||||
|
@ -80,13 +80,19 @@ struct thread_info {
|
||||
#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
|
||||
#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
|
||||
#define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
|
||||
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing */
|
||||
|
||||
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
||||
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
||||
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
||||
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
|
||||
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
|
||||
|
||||
#define _TIF_WORK_MASK \
|
||||
(_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED)
|
||||
|
||||
#define _TIF_SYSCALL_WORK \
|
||||
(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
|
||||
|
||||
#endif /* _ASM_RISCV_THREAD_INFO_H */
|
||||
|
@ -19,3 +19,5 @@
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
|
||||
#include <uapi/asm/unistd.h>
|
||||
|
||||
#define NR_syscalls (__NR_syscalls)
|
||||
|
@ -201,7 +201,7 @@ handle_syscall:
|
||||
REG_S s2, PT_SEPC(sp)
|
||||
/* Trace syscalls, but only if requested by the user. */
|
||||
REG_L t0, TASK_TI_FLAGS(tp)
|
||||
andi t0, t0, _TIF_SYSCALL_TRACE
|
||||
andi t0, t0, _TIF_SYSCALL_WORK
|
||||
bnez t0, handle_syscall_trace_enter
|
||||
check_syscall_nr:
|
||||
/* Check to make sure we don't jump to a bogus syscall number. */
|
||||
@ -221,7 +221,7 @@ ret_from_syscall:
|
||||
REG_S a0, PT_A0(sp)
|
||||
/* Trace syscalls, but only if requested by the user. */
|
||||
REG_L t0, TASK_TI_FLAGS(tp)
|
||||
andi t0, t0, _TIF_SYSCALL_TRACE
|
||||
andi t0, t0, _TIF_SYSCALL_WORK
|
||||
bnez t0, handle_syscall_trace_exit
|
||||
|
||||
ret_from_exception:
|
||||
|
@ -9,14 +9,14 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
u64 module_emit_got_entry(struct module *mod, u64 val)
|
||||
unsigned long module_emit_got_entry(struct module *mod, unsigned long val)
|
||||
{
|
||||
struct mod_section *got_sec = &mod->arch.got;
|
||||
int i = got_sec->num_entries;
|
||||
struct got_entry *got = get_got_entry(val, got_sec);
|
||||
|
||||
if (got)
|
||||
return (u64)got;
|
||||
return (unsigned long)got;
|
||||
|
||||
/* There is no duplicate entry, create a new one */
|
||||
got = (struct got_entry *)got_sec->shdr->sh_addr;
|
||||
@ -25,10 +25,10 @@ u64 module_emit_got_entry(struct module *mod, u64 val)
|
||||
got_sec->num_entries++;
|
||||
BUG_ON(got_sec->num_entries > got_sec->max_entries);
|
||||
|
||||
return (u64)&got[i];
|
||||
return (unsigned long)&got[i];
|
||||
}
|
||||
|
||||
u64 module_emit_plt_entry(struct module *mod, u64 val)
|
||||
unsigned long module_emit_plt_entry(struct module *mod, unsigned long val)
|
||||
{
|
||||
struct mod_section *got_plt_sec = &mod->arch.got_plt;
|
||||
struct got_entry *got_plt;
|
||||
@ -37,27 +37,29 @@ u64 module_emit_plt_entry(struct module *mod, u64 val)
|
||||
int i = plt_sec->num_entries;
|
||||
|
||||
if (plt)
|
||||
return (u64)plt;
|
||||
return (unsigned long)plt;
|
||||
|
||||
/* There is no duplicate entry, create a new one */
|
||||
got_plt = (struct got_entry *)got_plt_sec->shdr->sh_addr;
|
||||
got_plt[i] = emit_got_entry(val);
|
||||
plt = (struct plt_entry *)plt_sec->shdr->sh_addr;
|
||||
plt[i] = emit_plt_entry(val, (u64)&plt[i], (u64)&got_plt[i]);
|
||||
plt[i] = emit_plt_entry(val,
|
||||
(unsigned long)&plt[i],
|
||||
(unsigned long)&got_plt[i]);
|
||||
|
||||
plt_sec->num_entries++;
|
||||
got_plt_sec->num_entries++;
|
||||
BUG_ON(plt_sec->num_entries > plt_sec->max_entries);
|
||||
|
||||
return (u64)&plt[i];
|
||||
return (unsigned long)&plt[i];
|
||||
}
|
||||
|
||||
static int is_rela_equal(const Elf64_Rela *x, const Elf64_Rela *y)
|
||||
static int is_rela_equal(const Elf_Rela *x, const Elf_Rela *y)
|
||||
{
|
||||
return x->r_info == y->r_info && x->r_addend == y->r_addend;
|
||||
}
|
||||
|
||||
static bool duplicate_rela(const Elf64_Rela *rela, int idx)
|
||||
static bool duplicate_rela(const Elf_Rela *rela, int idx)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < idx; i++) {
|
||||
@ -67,13 +69,13 @@ static bool duplicate_rela(const Elf64_Rela *rela, int idx)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void count_max_entries(Elf64_Rela *relas, int num,
|
||||
static void count_max_entries(Elf_Rela *relas, int num,
|
||||
unsigned int *plts, unsigned int *gots)
|
||||
{
|
||||
unsigned int type, i;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
type = ELF64_R_TYPE(relas[i].r_info);
|
||||
type = ELF_RISCV_R_TYPE(relas[i].r_info);
|
||||
if (type == R_RISCV_CALL_PLT) {
|
||||
if (!duplicate_rela(relas, i))
|
||||
(*plts)++;
|
||||
@ -118,9 +120,9 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
|
||||
|
||||
/* Calculate the maxinum number of entries */
|
||||
for (i = 0; i < ehdr->e_shnum; i++) {
|
||||
Elf64_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset;
|
||||
int num_rela = sechdrs[i].sh_size / sizeof(Elf64_Rela);
|
||||
Elf64_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info;
|
||||
Elf_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset;
|
||||
int num_rela = sechdrs[i].sh_size / sizeof(Elf_Rela);
|
||||
Elf_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info;
|
||||
|
||||
if (sechdrs[i].sh_type != SHT_RELA)
|
||||
continue;
|
||||
|
@ -18,12 +18,15 @@
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/syscall.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <linux/audit.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/regset.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
#include <linux/tracehook.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/syscalls.h>
|
||||
|
||||
enum riscv_regset {
|
||||
@ -163,15 +166,19 @@ void do_syscall_trace_enter(struct pt_regs *regs)
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
|
||||
trace_sys_enter(regs, syscall_get_nr(current, regs));
|
||||
#endif
|
||||
|
||||
audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
|
||||
}
|
||||
|
||||
void do_syscall_trace_exit(struct pt_regs *regs)
|
||||
{
|
||||
audit_syscall_exit(regs);
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE))
|
||||
tracehook_report_syscall_exit(regs, 0);
|
||||
|
||||
#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
|
||||
trace_sys_exit(regs, regs->regs[0]);
|
||||
trace_sys_exit(regs, regs_return_value(regs));
|
||||
#endif
|
||||
}
|
||||
|
@ -149,7 +149,14 @@ asmlinkage void __init setup_vm(void)
|
||||
|
||||
void __init parse_dtb(unsigned int hartid, void *dtb)
|
||||
{
|
||||
early_init_dt_scan(__va(dtb));
|
||||
if (!early_init_dt_scan(__va(dtb)))
|
||||
return;
|
||||
|
||||
pr_err("No DTB passed to the kernel\n");
|
||||
#ifdef CONFIG_CMDLINE_FORCE
|
||||
strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
|
||||
pr_info("Forcing kernel command line to: %s\n", boot_command_line);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init setup_bootmem(void)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user