Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
94adb5e29e
|
@ -976,6 +976,29 @@ All cgroup core files are prefixed with "cgroup."
|
|||
killing cgroups is a process directed operation, i.e. it affects
|
||||
the whole thread-group.
|
||||
|
||||
cgroup.pressure
|
||||
A read-write single value file that allowed values are "0" and "1".
|
||||
The default is "1".
|
||||
|
||||
Writing "0" to the file will disable the cgroup PSI accounting.
|
||||
Writing "1" to the file will re-enable the cgroup PSI accounting.
|
||||
|
||||
This control attribute is not hierarchical, so disable or enable PSI
|
||||
accounting in a cgroup does not affect PSI accounting in descendants
|
||||
and doesn't need pass enablement via ancestors from root.
|
||||
|
||||
The reason this control attribute exists is that PSI accounts stalls for
|
||||
each cgroup separately and aggregates it at each level of the hierarchy.
|
||||
This may cause non-negligible overhead for some workloads when under
|
||||
deep level of the hierarchy, in which case this control attribute can
|
||||
be used to disable PSI accounting in the non-leaf cgroups.
|
||||
|
||||
irq.pressure
|
||||
A read-write nested-keyed file.
|
||||
|
||||
Shows pressure stall information for IRQ/SOFTIRQ. See
|
||||
:ref:`Documentation/accounting/psi.rst <psi>` for details.
|
||||
|
||||
Controllers
|
||||
===========
|
||||
|
||||
|
|
|
@ -141,6 +141,10 @@ root_hash_sig_key_desc <key_description>
|
|||
also gain new certificates at run time if they are signed by a certificate
|
||||
already in the secondary trusted keyring.
|
||||
|
||||
try_verify_in_tasklet
|
||||
If verity hashes are in cache, verify data blocks in kernel tasklet instead
|
||||
of workqueue. This option can reduce IO latency.
|
||||
|
||||
Theory of operation
|
||||
===================
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ stable kernels.
|
|||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Cortex-A55 | #1530923 | ARM64_ERRATUM_1530923 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Cortex-A55 | #2441007 | ARM64_ERRATUM_2441007 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Cortex-A57 | #852523 | N/A |
|
||||
|
|
|
@ -66,6 +66,11 @@ properties:
|
|||
- enum:
|
||||
- allwinner,sun20i-d1-plic
|
||||
- const: thead,c900-plic
|
||||
- items:
|
||||
- const: sifive,plic-1.0.0
|
||||
- const: riscv,plic0
|
||||
deprecated: true
|
||||
description: For the QEMU virt machine only
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
|
|
@ -79,24 +79,27 @@ properties:
|
|||
the LED.
|
||||
$ref: /schemas/types.yaml#/definitions/string
|
||||
|
||||
enum:
|
||||
# LED will act as a back-light, controlled by the framebuffer system
|
||||
- backlight
|
||||
# LED will turn on (but for leds-gpio see "default-state" property in
|
||||
# Documentation/devicetree/bindings/leds/leds-gpio.yaml)
|
||||
- default-on
|
||||
# LED "double" flashes at a load average based rate
|
||||
- heartbeat
|
||||
# LED indicates disk activity
|
||||
- disk-activity
|
||||
# LED indicates IDE disk activity (deprecated), in new implementations
|
||||
# use "disk-activity"
|
||||
- ide-disk
|
||||
# LED flashes at a fixed, configurable rate
|
||||
- timer
|
||||
# LED alters the brightness for the specified duration with one software
|
||||
# timer (requires "led-pattern" property)
|
||||
- pattern
|
||||
oneOf:
|
||||
- enum:
|
||||
# LED will act as a back-light, controlled by the framebuffer system
|
||||
- backlight
|
||||
# LED will turn on (but for leds-gpio see "default-state" property in
|
||||
# Documentation/devicetree/bindings/leds/leds-gpio.yaml)
|
||||
- default-on
|
||||
# LED "double" flashes at a load average based rate
|
||||
- heartbeat
|
||||
# LED indicates disk activity
|
||||
- disk-activity
|
||||
# LED indicates IDE disk activity (deprecated), in new implementations
|
||||
# use "disk-activity"
|
||||
- ide-disk
|
||||
# LED flashes at a fixed, configurable rate
|
||||
- timer
|
||||
# LED alters the brightness for the specified duration with one software
|
||||
# timer (requires "led-pattern" property)
|
||||
- pattern
|
||||
# LED is triggered by SD/MMC activity
|
||||
- pattern: "^mmc[0-9]+$"
|
||||
|
||||
led-pattern:
|
||||
description: |
|
||||
|
|
|
@ -13,9 +13,6 @@ description: |
|
|||
This module is part of the MT6370 MFD device.
|
||||
Add MT6370 LED driver include 4-channel RGB LED support Register/PWM/Breath Mode
|
||||
|
||||
allOf:
|
||||
- $ref: leds-class-multicolor.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: mediatek,mt6370-indicator
|
||||
|
@ -29,6 +26,8 @@ properties:
|
|||
patternProperties:
|
||||
"^multi-led@[0-3]$":
|
||||
type: object
|
||||
$ref: leds-class-multicolor.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
properties:
|
||||
reg:
|
||||
|
|
|
@ -139,8 +139,8 @@ examples:
|
|||
|
||||
charger {
|
||||
compatible = "mediatek,mt6370-charger";
|
||||
interrupts = <48>, <68>, <6>;
|
||||
interrupt-names = "attach_i", "uvp_d_evt", "mivr";
|
||||
interrupts = <68>, <48>, <6>;
|
||||
interrupt-names = "uvp_d_evt", "attach_i", "mivr";
|
||||
io-channels = <&mt6370_adc MT6370_CHAN_IBUS>;
|
||||
|
||||
mt6370_otg_vbus: usb-otg-vbus-regulator {
|
||||
|
|
|
@ -8,7 +8,6 @@ title: Samsung S3FWRN5 NCI NFC Controller
|
|||
|
||||
maintainers:
|
||||
- Krzysztof Kozlowski <krzk@kernel.org>
|
||||
- Krzysztof Opasiak <k.opasiak@samsung.com>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
|
|
|
@ -9,6 +9,7 @@ title: RISC-V bindings for 'cpus' DT nodes
|
|||
maintainers:
|
||||
- Paul Walmsley <paul.walmsley@sifive.com>
|
||||
- Palmer Dabbelt <palmer@sifive.com>
|
||||
- Conor Dooley <conor@kernel.org>
|
||||
|
||||
description: |
|
||||
This document uses some terminology common to the RISC-V community
|
||||
|
@ -79,9 +80,7 @@ properties:
|
|||
insensitive, letters in the riscv,isa string must be all
|
||||
lowercase to simplify parsing.
|
||||
$ref: "/schemas/types.yaml#/definitions/string"
|
||||
enum:
|
||||
- rv64imac
|
||||
- rv64imafdc
|
||||
pattern: ^rv(?:64|32)imaf?d?q?c?b?v?k?h?(?:_[hsxz](?:[a-z])+)*$
|
||||
|
||||
# RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
|
||||
timebase-frequency: false
|
||||
|
|
|
@ -7,8 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
|
|||
title: Microchip PolarFire SoC-based boards
|
||||
|
||||
maintainers:
|
||||
- Cyril Jean <Cyril.Jean@microchip.com>
|
||||
- Lewis Hanly <lewis.hanly@microchip.com>
|
||||
- Conor Dooley <conor.dooley@microchip.com>
|
||||
- Daire McNamara <daire.mcnamara@microchip.com>
|
||||
|
||||
description:
|
||||
Microchip PolarFire SoC-based boards
|
||||
|
@ -17,12 +17,20 @@ properties:
|
|||
$nodename:
|
||||
const: '/'
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- microchip,mpfs-icicle-kit
|
||||
- microchip,mpfs-icicle-reference-rtlv2203
|
||||
- sundance,polarberry
|
||||
- const: microchip,mpfs
|
||||
oneOf:
|
||||
- items:
|
||||
- enum:
|
||||
- microchip,mpfs-icicle-reference-rtlv2203
|
||||
- microchip,mpfs-icicle-reference-rtlv2210
|
||||
- const: microchip,mpfs-icicle-kit
|
||||
- const: microchip,mpfs
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
- aries,m100pfsevp
|
||||
- microchip,mpfs-sev-kit
|
||||
- sundance,polarberry
|
||||
- const: microchip,mpfs
|
||||
|
||||
additionalProperties: true
|
||||
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
# Copyright (C) 2020 SiFive, Inc.
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/riscv/sifive-l2-cache.yaml#
|
||||
$id: http://devicetree.org/schemas/riscv/sifive,ccache0.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: SiFive L2 Cache Controller
|
||||
title: SiFive Composable Cache Controller
|
||||
|
||||
maintainers:
|
||||
- Sagar Kadam <sagar.kadam@sifive.com>
|
||||
- Paul Walmsley <paul.walmsley@sifive.com>
|
||||
|
||||
description:
|
||||
The SiFive Level 2 Cache Controller is used to provide access to fast copies
|
||||
of memory for masters in a Core Complex. The Level 2 Cache Controller also
|
||||
The SiFive Composable Cache Controller is used to provide access to fast copies
|
||||
of memory for masters in a Core Complex. The Composable Cache Controller also
|
||||
acts as directory-based coherency manager.
|
||||
All the properties in ePAPR/DeviceTree specification applies for this platform.
|
||||
|
||||
|
@ -22,6 +22,7 @@ select:
|
|||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- sifive,ccache0
|
||||
- sifive,fu540-c000-ccache
|
||||
- sifive,fu740-c000-ccache
|
||||
|
||||
|
@ -33,6 +34,7 @@ properties:
|
|||
oneOf:
|
||||
- items:
|
||||
- enum:
|
||||
- sifive,ccache0
|
||||
- sifive,fu540-c000-ccache
|
||||
- sifive,fu740-c000-ccache
|
||||
- const: cache
|
||||
|
@ -45,7 +47,7 @@ properties:
|
|||
const: 64
|
||||
|
||||
cache-level:
|
||||
const: 2
|
||||
enum: [2, 3]
|
||||
|
||||
cache-sets:
|
||||
enum: [1024, 2048]
|
||||
|
@ -115,6 +117,22 @@ allOf:
|
|||
cache-sets:
|
||||
const: 1024
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: sifive,ccache0
|
||||
|
||||
then:
|
||||
properties:
|
||||
cache-level:
|
||||
enum: [2, 3]
|
||||
|
||||
else:
|
||||
properties:
|
||||
cache-level:
|
||||
const: 2
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
|
@ -22,12 +22,18 @@ description:
|
|||
|
||||
properties:
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- sifive,fu540-c000-clint
|
||||
- starfive,jh7100-clint
|
||||
- canaan,k210-clint
|
||||
- const: sifive,clint0
|
||||
oneOf:
|
||||
- items:
|
||||
- enum:
|
||||
- sifive,fu540-c000-clint
|
||||
- starfive,jh7100-clint
|
||||
- canaan,k210-clint
|
||||
- const: sifive,clint0
|
||||
- items:
|
||||
- const: sifive,clint0
|
||||
- const: riscv,clint0
|
||||
deprecated: true
|
||||
description: For the QEMU virt machine only
|
||||
|
||||
description:
|
||||
Should be "<vendor>,<chip>-clint" and "sifive,clint<version>".
|
||||
|
|
|
@ -59,7 +59,7 @@ differences.
|
|||
* JFFS2 is a write-through file-system, while UBIFS supports write-back,
|
||||
which makes UBIFS much faster on writes.
|
||||
|
||||
Similarly to JFFS2, UBIFS supports on-the-flight compression which makes
|
||||
Similarly to JFFS2, UBIFS supports on-the-fly compression which makes
|
||||
it possible to fit quite a lot of data to the flash.
|
||||
|
||||
Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts.
|
||||
|
|
|
@ -38,22 +38,10 @@ not affect to allocation performance, especially if the static keys jump
|
|||
label patching functionality is available. Following is the kernel's code
|
||||
size change due to this facility.
|
||||
|
||||
- Without page owner::
|
||||
|
||||
text data bss dec hex filename
|
||||
48392 2333 644 51369 c8a9 mm/page_alloc.o
|
||||
|
||||
- With page owner::
|
||||
|
||||
text data bss dec hex filename
|
||||
48800 2445 644 51889 cab1 mm/page_alloc.o
|
||||
6662 108 29 6799 1a8f mm/page_owner.o
|
||||
1025 8 8 1041 411 mm/page_ext.o
|
||||
|
||||
Although, roughly, 8 KB code is added in total, page_alloc.o increase by
|
||||
520 bytes and less than half of it is in hotpath. Building the kernel with
|
||||
page owner and turning it on if needed would be great option to debug
|
||||
kernel memory problem.
|
||||
Although enabling page owner increases kernel size by several kilobytes,
|
||||
most of this code is outside page allocator and its hot path. Building
|
||||
the kernel with page owner and turning it on if needed would be great
|
||||
option to debug kernel memory problem.
|
||||
|
||||
There is one notice that is caused by implementation detail. page owner
|
||||
stores information into the memory from struct page extension. This memory
|
||||
|
|
|
@ -305,7 +305,7 @@ Possible BPF extensions are shown in the following table:
|
|||
vlan_tci skb_vlan_tag_get(skb)
|
||||
vlan_avail skb_vlan_tag_present(skb)
|
||||
vlan_tpid skb->vlan_proto
|
||||
rand prandom_u32()
|
||||
rand get_random_u32()
|
||||
=================================== =================================================
|
||||
|
||||
These extensions can also be prefixed with '#'.
|
||||
|
|
|
@ -379,7 +379,7 @@ to subscribe and unsubscribe from the list can be found at:
|
|||
There are archives of the mailing list on the web in many different
|
||||
places. Use a search engine to find these archives. For example:
|
||||
|
||||
http://dir.gmane.org/gmane.linux.kernel
|
||||
https://lore.kernel.org/lkml/
|
||||
|
||||
It is highly recommended that you search the archives about the topic
|
||||
you want to bring up, before you post it to the list. A lot of things
|
||||
|
|
|
@ -8,6 +8,7 @@ RISC-V architecture
|
|||
boot-image-header
|
||||
vm-layout
|
||||
patch-acceptance
|
||||
uabi
|
||||
|
||||
features
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
RISC-V Linux User ABI
|
||||
=====================
|
||||
|
||||
Misaligned accesses are supported in userspace, but they may perform poorly.
|
|
@ -39,7 +39,7 @@ higher than *30 us*. It is also set to stop the session if a *Thread* timer
|
|||
latency higher than *30 us* is hit. Finally, it is set to save the trace
|
||||
buffer if the stop condition is hit::
|
||||
|
||||
[root@alien ~]# rtla timerlat top -s 30 -t 30 -T
|
||||
[root@alien ~]# rtla timerlat top -s 30 -T 30 -t
|
||||
Timer Latency
|
||||
0 00:00:59 | IRQ Timer Latency (us) | Thread Timer Latency (us)
|
||||
CPU COUNT | cur min avg max | cur min avg max
|
||||
|
|
|
@ -564,7 +564,7 @@ of ftrace. Here is a list of some of the key files:
|
|||
|
||||
start::
|
||||
|
||||
trace_fd = open("trace_marker", WR_ONLY);
|
||||
trace_fd = open("trace_marker", O_WRONLY);
|
||||
|
||||
Note: Writing into the trace_marker file can also initiate triggers
|
||||
that are written into /sys/kernel/tracing/events/ftrace/print/trigger
|
||||
|
|
|
@ -394,7 +394,7 @@ trovati al sito:
|
|||
Ci sono diversi archivi della lista di discussione. Usate un qualsiasi motore
|
||||
di ricerca per trovarli. Per esempio:
|
||||
|
||||
http://dir.gmane.org/gmane.linux.kernel
|
||||
https://lore.kernel.org/lkml/
|
||||
|
||||
É caldamente consigliata una ricerca in questi archivi sul tema che volete
|
||||
sollevare, prima di pubblicarlo sulla lista. Molte cose sono già state
|
||||
|
|
|
@ -410,7 +410,7 @@ https://bugzilla.kernel.org に行ってください。もし今後のバグレ
|
|||
このメーリングリストのアーカイブは web 上の多数の場所に存在します。こ
|
||||
れらのアーカイブを探すにはサーチエンジンを使いましょう。例えば-
|
||||
|
||||
http://dir.gmane.org/gmane.linux.kernel
|
||||
https://lore.kernel.org/lkml/
|
||||
|
||||
リストに投稿する前にすでにその話題がアーカイブに存在するかどうかを検索
|
||||
することを是非やってください。多数の事がすでに詳細に渡って議論されてお
|
||||
|
|
|
@ -386,7 +386,7 @@ https://bugzilla.kernel.org 를 체크하고자 할 수도 있다; 소수의 커
|
|||
웹상의 많은 다른 곳에도 메일링 리스트의 아카이브들이 있다.
|
||||
이러한 아카이브들을 찾으려면 검색 엔진을 사용하라. 예를 들어:
|
||||
|
||||
http://dir.gmane.org/gmane.linux.kernel
|
||||
https://lore.kernel.org/lkml/
|
||||
|
||||
여러분이 새로운 문제에 관해 리스트에 올리기 전에 말하고 싶은 주제에 관한
|
||||
것을 아카이브에서 먼저 찾아보기를 강력히 권장한다. 이미 상세하게 토론된 많은
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
处理器体系结构
|
||||
==============
|
||||
|
||||
以下文档提供了具体架构实现的编程细节。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
mips/index
|
||||
arm64/index
|
||||
riscv/index
|
||||
openrisc/index
|
||||
parisc/index
|
||||
loongarch/index
|
||||
|
||||
TODOList:
|
||||
|
||||
* arm/index
|
||||
* ia64/index
|
||||
* m68k/index
|
||||
* nios2/index
|
||||
* powerpc/index
|
||||
* s390/index
|
||||
* sh/index
|
||||
* sparc/index
|
||||
* x86/index
|
||||
* xtensa/index
|
|
@ -1,7 +1,7 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: Documentation/Devicetree/changesets.rst
|
||||
:Original: Documentation/devicetree/changesets.rst
|
||||
|
||||
:翻译:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: Documentation/Devicetree/dynamic-resolution-notes.rst
|
||||
:Original: Documentation/devicetree/dynamic-resolution-notes.rst
|
||||
|
||||
:翻译:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: Documentation/Devicetree/kernel-api.rst
|
||||
:Original: Documentation/devicetree/kernel-api.rst
|
||||
|
||||
:翻译:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: Documentation/Devicetree/overlay-notes.rst
|
||||
:Original: Documentation/devicetree/overlay-notes.rst
|
||||
|
||||
:翻译:
|
||||
|
||||
|
|
|
@ -26,30 +26,78 @@
|
|||
顺便说下,中文文档也需要遵守内核编码风格,风格中中文和英文的主要不同就是中文
|
||||
的字符标点占用两个英文字符宽度, 所以,当英文要求不要超过每行100个字符时,
|
||||
中文就不要超过50个字符。另外,也要注意'-','=' 等符号与相关标题的对齐。在将
|
||||
补丁提交到社区之前,一定要进行必要的checkpatch.pl检查和编译测试。
|
||||
补丁提交到社区之前,一定要进行必要的 ``checkpatch.pl`` 检查和编译测试。
|
||||
|
||||
许可证文档
|
||||
----------
|
||||
与Linux 内核社区一起工作
|
||||
------------------------
|
||||
|
||||
下面的文档介绍了Linux内核源代码的许可证(GPLv2)、如何在源代码树中正确标记
|
||||
单个文件的许可证、以及指向完整许可证文本的链接。
|
||||
|
||||
* Documentation/translations/zh_CN/process/license-rules.rst
|
||||
|
||||
用户文档
|
||||
--------
|
||||
|
||||
下面的手册是为内核用户编写的——即那些试图让它在给定系统上以最佳方式工作的
|
||||
用户。
|
||||
与内核开发社区进行协作并将工作推向上游的基本指南。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
admin-guide/index
|
||||
process/development-process
|
||||
process/submitting-patches
|
||||
行为准则 <process/code-of-conduct>
|
||||
maintainer/index
|
||||
完整开发流程文档 <process/index>
|
||||
|
||||
内部API文档
|
||||
-----------
|
||||
|
||||
开发人员使用的内核内部交互接口手册。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
core-api/index
|
||||
driver-api/index
|
||||
内核中的锁 <locking/index>
|
||||
|
||||
TODOList:
|
||||
|
||||
* kbuild/index
|
||||
* subsystem-apis
|
||||
|
||||
开发工具和流程
|
||||
--------------
|
||||
|
||||
为所有内核开发人员提供有用信息的各种其他手册。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
process/license-rules
|
||||
doc-guide/index
|
||||
dev-tools/index
|
||||
dev-tools/testing-overview
|
||||
kernel-hacking/index
|
||||
|
||||
TODOList:
|
||||
|
||||
* trace/index
|
||||
* fault-injection/index
|
||||
* livepatch/index
|
||||
|
||||
面向用户的文档
|
||||
--------------
|
||||
|
||||
下列手册针对
|
||||
希望内核在给定系统上以最佳方式工作的*用户*,
|
||||
和查找内核用户空间API信息的程序开发人员。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
admin-guide/index
|
||||
admin-guide/reporting-issues.rst
|
||||
|
||||
TODOList:
|
||||
|
||||
* 内核构建系统 <kbuild/index>
|
||||
* 用户空间工具 <tools/index>
|
||||
* userspace-api/index
|
||||
|
||||
也可参考独立于内核文档的 `Linux 手册页 <https://www.kernel.org/doc/man-pages/>`_ 。
|
||||
|
||||
固件相关文档
|
||||
------------
|
||||
|
@ -65,126 +113,13 @@ TODOList:
|
|||
|
||||
* firmware-guide/index
|
||||
|
||||
应用程序开发人员文档
|
||||
--------------------
|
||||
|
||||
用户空间API手册涵盖了描述应用程序开发人员可见内核接口方面的文档。
|
||||
|
||||
TODOlist:
|
||||
|
||||
* userspace-api/index
|
||||
|
||||
内核开发简介
|
||||
体系结构文档
|
||||
------------
|
||||
|
||||
这些手册包含有关如何开发内核的整体信息。内核社区非常庞大,一年下来有数千名
|
||||
开发人员做出贡献。与任何大型社区一样,知道如何完成任务将使得更改合并的过程
|
||||
变得更加容易。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
process/index
|
||||
dev-tools/index
|
||||
doc-guide/index
|
||||
kernel-hacking/index
|
||||
maintainer/index
|
||||
|
||||
TODOList:
|
||||
|
||||
* trace/index
|
||||
* fault-injection/index
|
||||
* livepatch/index
|
||||
* rust/index
|
||||
|
||||
内核API文档
|
||||
-----------
|
||||
|
||||
以下手册从内核开发人员的角度详细介绍了特定的内核子系统是如何工作的。这里的
|
||||
大部分信息都是直接从内核源代码获取的,并根据需要添加补充材料(或者至少是在
|
||||
我们设法添加的时候——可能不是所有的都是有需要的)。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
core-api/index
|
||||
driver-api/index
|
||||
locking/index
|
||||
accounting/index
|
||||
cpu-freq/index
|
||||
iio/index
|
||||
infiniband/index
|
||||
power/index
|
||||
virt/index
|
||||
sound/index
|
||||
filesystems/index
|
||||
scheduler/index
|
||||
mm/index
|
||||
peci/index
|
||||
PCI/index
|
||||
|
||||
TODOList:
|
||||
|
||||
* block/index
|
||||
* cdrom/index
|
||||
* ide/index
|
||||
* fb/index
|
||||
* fpga/index
|
||||
* hid/index
|
||||
* i2c/index
|
||||
* isdn/index
|
||||
* leds/index
|
||||
* netlabel/index
|
||||
* networking/index
|
||||
* pcmcia/index
|
||||
* target/index
|
||||
* timers/index
|
||||
* spi/index
|
||||
* w1/index
|
||||
* watchdog/index
|
||||
* input/index
|
||||
* hwmon/index
|
||||
* gpu/index
|
||||
* security/index
|
||||
* crypto/index
|
||||
* bpf/index
|
||||
* usb/index
|
||||
* scsi/index
|
||||
* misc-devices/index
|
||||
* mhi/index
|
||||
|
||||
体系结构无关文档
|
||||
----------------
|
||||
|
||||
TODOList:
|
||||
|
||||
* asm-annotations
|
||||
|
||||
特定体系结构文档
|
||||
----------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
mips/index
|
||||
arm64/index
|
||||
riscv/index
|
||||
openrisc/index
|
||||
parisc/index
|
||||
loongarch/index
|
||||
|
||||
TODOList:
|
||||
|
||||
* arm/index
|
||||
* ia64/index
|
||||
* m68k/index
|
||||
* nios2/index
|
||||
* powerpc/index
|
||||
* s390/index
|
||||
* sh/index
|
||||
* sparc/index
|
||||
* x86/index
|
||||
* xtensa/index
|
||||
arch
|
||||
|
||||
其他文档
|
||||
--------
|
||||
|
@ -195,9 +130,9 @@ TODOList:
|
|||
TODOList:
|
||||
|
||||
* staging/index
|
||||
* watch_queue
|
||||
|
||||
目录和表格
|
||||
|
||||
索引和表格
|
||||
----------
|
||||
|
||||
* :ref:`genindex`
|
||||
|
|
|
@ -30,7 +30,7 @@ KSM的用户空间的接口在Documentation/translations/zh_CN/admin-guide/mm/ks
|
|||
KSM维护着稳定树中的KSM页的逆映射信息。
|
||||
|
||||
当KSM页面的共享数小于 ``max_page_sharing`` 的虚拟内存区域(VMAs)时,则代表了
|
||||
KSM页的稳定树其中的节点指向了一个rmap_item结构体类型的列表。同时,这个KSM页
|
||||
KSM页的稳定树其中的节点指向了一个ksm_rmap_item结构体类型的列表。同时,这个KSM页
|
||||
的 ``page->mapping`` 指向了该稳定树节点。
|
||||
|
||||
如果共享数超过了阈值,KSM将给稳定树添加第二个维度。稳定树就变成链接一个或多
|
||||
|
|
|
@ -74,15 +74,19 @@ page owner在默认情况下是禁用的。所以,如果你想使用它,你
|
|||
cat /sys/kernel/debug/page_owner > page_owner_full.txt
|
||||
./page_owner_sort page_owner_full.txt sorted_page_owner.txt
|
||||
|
||||
``page_owner_full.txt`` 的一般输出情况如下(输出信息无翻译价值)::
|
||||
``page_owner_full.txt`` 的一般输出情况如下::
|
||||
|
||||
Page allocated via order XXX, ...
|
||||
PFN XXX ...
|
||||
// Detailed stack
|
||||
// 栈详情
|
||||
|
||||
Page allocated via order XXX, ...
|
||||
PFN XXX ...
|
||||
// Detailed stack
|
||||
// 栈详情
|
||||
默认情况下,它将以一个给定的pfn开始,做完整的pfn转储,且page_owner支持fseek。
|
||||
|
||||
FILE *fp = fopen("/sys/kernel/debug/page_owner", "r");
|
||||
fseek(fp, pfn_start, SEEK_SET);
|
||||
|
||||
``page_owner_sort`` 工具忽略了 ``PFN`` 行,将剩余的行放在buf中,使用regexp提
|
||||
取页序值,计算buf的次数和页数,最后根据参数进行排序。
|
||||
|
|
|
@ -306,7 +306,7 @@ bugzilla.kernel.org是Linux内核开发者们用来跟踪内核Bug的网站。
|
|||
网上很多地方都有这个邮件列表的存档(archive)。可以使用搜索引擎来找到这些
|
||||
存档。比如:
|
||||
|
||||
http://dir.gmane.org/gmane.linux.kernel
|
||||
https://lore.kernel.org/lkml/
|
||||
|
||||
在发信之前,我们强烈建议你先在存档中搜索你想要讨论的问题。很多已经被详细
|
||||
讨论过的问题只在邮件列表的存档中可以找到。
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
.. _cn_process_index:
|
||||
|
||||
========================
|
||||
与Linux 内核社区一起工作
|
||||
========================
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ bugzilla.kernel.org是Linux內核開發者們用來跟蹤內核Bug的網站。
|
|||
網上很多地方都有這個郵件列表的存檔(archive)。可以使用搜尋引擎來找到這些
|
||||
存檔。比如:
|
||||
|
||||
http://dir.gmane.org/gmane.linux.kernel
|
||||
https://lore.kernel.org/lkml/
|
||||
|
||||
在發信之前,我們強烈建議你先在存檔中搜索你想要討論的問題。很多已經被詳細
|
||||
討論過的問題只在郵件列表的存檔中可以找到。
|
||||
|
|
38
MAINTAINERS
38
MAINTAINERS
|
@ -752,7 +752,7 @@ ALIBABA PMU DRIVER
|
|||
M: Shuai Xue <xueshuai@linux.alibaba.com>
|
||||
S: Supported
|
||||
F: Documentation/admin-guide/perf/alibaba_pmu.rst
|
||||
F: drivers/perf/alibaba_uncore_dwr_pmu.c
|
||||
F: drivers/perf/alibaba_uncore_drw_pmu.c
|
||||
|
||||
ALIENWARE WMI DRIVER
|
||||
L: Dell.Client.Kernel@dell.com
|
||||
|
@ -4459,13 +4459,15 @@ M: Josef Bacik <josef@toxicpanda.com>
|
|||
M: David Sterba <dsterba@suse.com>
|
||||
L: linux-btrfs@vger.kernel.org
|
||||
S: Maintained
|
||||
W: http://btrfs.wiki.kernel.org/
|
||||
Q: http://patchwork.kernel.org/project/linux-btrfs/list/
|
||||
W: https://btrfs.readthedocs.io
|
||||
W: https://btrfs.wiki.kernel.org/
|
||||
Q: https://patchwork.kernel.org/project/linux-btrfs/list/
|
||||
C: irc://irc.libera.chat/btrfs
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git
|
||||
F: Documentation/filesystems/btrfs.rst
|
||||
F: fs/btrfs/
|
||||
F: include/linux/btrfs*
|
||||
F: include/trace/events/btrfs.h
|
||||
F: include/uapi/linux/btrfs*
|
||||
|
||||
BTTV VIDEO4LINUX DRIVER
|
||||
|
@ -5266,6 +5268,7 @@ F: tools/testing/selftests/cgroup/
|
|||
|
||||
CONTROL GROUP - BLOCK IO CONTROLLER (BLKIO)
|
||||
M: Tejun Heo <tj@kernel.org>
|
||||
M: Josef Bacik <josef@toxicpanda.com>
|
||||
M: Jens Axboe <axboe@kernel.dk>
|
||||
L: cgroups@vger.kernel.org
|
||||
L: linux-block@vger.kernel.org
|
||||
|
@ -5273,6 +5276,7 @@ T: git git://git.kernel.dk/linux-block
|
|||
F: Documentation/admin-guide/cgroup-v1/blkio-controller.rst
|
||||
F: block/bfq-cgroup.c
|
||||
F: block/blk-cgroup.c
|
||||
F: block/blk-iocost.c
|
||||
F: block/blk-iolatency.c
|
||||
F: block/blk-throttle.c
|
||||
F: include/linux/blk-cgroup.h
|
||||
|
@ -15359,17 +15363,6 @@ L: linux-rdma@vger.kernel.org
|
|||
S: Supported
|
||||
F: drivers/infiniband/ulp/opa_vnic
|
||||
|
||||
OPEN FIRMWARE AND DEVICE TREE OVERLAYS
|
||||
M: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
|
||||
M: Frank Rowand <frowand.list@gmail.com>
|
||||
L: devicetree@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/dynamic-resolution-notes.rst
|
||||
F: Documentation/devicetree/overlay-notes.rst
|
||||
F: drivers/of/overlay.c
|
||||
F: drivers/of/resolver.c
|
||||
K: of_overlay_notifier_
|
||||
|
||||
OPEN FIRMWARE AND FLATTENED DEVICE TREE
|
||||
M: Rob Herring <robh+dt@kernel.org>
|
||||
M: Frank Rowand <frowand.list@gmail.com>
|
||||
|
@ -15382,6 +15375,9 @@ F: Documentation/ABI/testing/sysfs-firmware-ofw
|
|||
F: drivers/of/
|
||||
F: include/linux/of*.h
|
||||
F: scripts/dtc/
|
||||
K: of_overlay_notifier_
|
||||
K: of_overlay_fdt_apply
|
||||
K: of_overlay_remove
|
||||
|
||||
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
|
||||
M: Rob Herring <robh+dt@kernel.org>
|
||||
|
@ -15419,7 +15415,7 @@ M: Stafford Horne <shorne@gmail.com>
|
|||
L: openrisc@lists.librecores.org
|
||||
S: Maintained
|
||||
W: http://openrisc.io
|
||||
T: git git://github.com/openrisc/linux.git
|
||||
T: git https://github.com/openrisc/linux.git
|
||||
F: Documentation/devicetree/bindings/openrisc/
|
||||
F: Documentation/openrisc/
|
||||
F: arch/openrisc/
|
||||
|
@ -17710,6 +17706,7 @@ M: Palmer Dabbelt <palmer@dabbelt.com>
|
|||
M: Albert Ou <aou@eecs.berkeley.edu>
|
||||
L: linux-riscv@lists.infradead.org
|
||||
S: Supported
|
||||
Q: https://patchwork.kernel.org/project/linux-riscv/list/
|
||||
P: Documentation/riscv/patch-acceptance.rst
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
|
||||
F: arch/riscv/
|
||||
|
@ -17721,12 +17718,13 @@ M: Conor Dooley <conor.dooley@microchip.com>
|
|||
M: Daire McNamara <daire.mcnamara@microchip.com>
|
||||
L: linux-riscv@lists.infradead.org
|
||||
S: Supported
|
||||
F: Documentation/devicetree/bindings/clock/microchip,mpfs.yaml
|
||||
F: Documentation/devicetree/bindings/clock/microchip,mpfs*.yaml
|
||||
F: Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
|
||||
F: Documentation/devicetree/bindings/i2c/microchip,corei2c.yaml
|
||||
F: Documentation/devicetree/bindings/mailbox/microchip,mpfs-mailbox.yaml
|
||||
F: Documentation/devicetree/bindings/net/can/microchip,mpfs-can.yaml
|
||||
F: Documentation/devicetree/bindings/pwm/microchip,corepwm.yaml
|
||||
F: Documentation/devicetree/bindings/riscv/microchip.yaml
|
||||
F: Documentation/devicetree/bindings/soc/microchip/microchip,mpfs-sys-controller.yaml
|
||||
F: Documentation/devicetree/bindings/spi/microchip,mpfs-spi.yaml
|
||||
F: Documentation/devicetree/bindings/usb/microchip,mpfs-musb.yaml
|
||||
|
@ -18217,7 +18215,6 @@ F: include/media/drv-intf/s3c_camif.h
|
|||
|
||||
SAMSUNG S3FWRN5 NFC DRIVER
|
||||
M: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
|
||||
M: Krzysztof Opasiak <k.opasiak@samsung.com>
|
||||
L: linux-nfc@lists.01.org (subscribers-only)
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml
|
||||
|
@ -18523,8 +18520,7 @@ S: Maintained
|
|||
F: drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
|
||||
SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER
|
||||
M: Jonathan Derrick <jonathan.derrick@intel.com>
|
||||
M: Revanth Rajashekar <revanth.rajashekar@intel.com>
|
||||
M: Jonathan Derrick <jonathan.derrick@linux.dev>
|
||||
L: linux-block@vger.kernel.org
|
||||
S: Supported
|
||||
F: block/opal_proto.h
|
||||
|
@ -21300,7 +21296,7 @@ L: linux-usb@vger.kernel.org
|
|||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
W: https://github.com/petkan/pegasus
|
||||
T: git git://github.com/petkan/pegasus.git
|
||||
T: git https://github.com/petkan/pegasus.git
|
||||
F: drivers/net/usb/pegasus.*
|
||||
|
||||
USB PHY LAYER
|
||||
|
@ -21337,7 +21333,7 @@ L: linux-usb@vger.kernel.org
|
|||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
W: https://github.com/petkan/rtl8150
|
||||
T: git git://github.com/petkan/rtl8150.git
|
||||
T: git https://github.com/petkan/rtl8150.git
|
||||
F: drivers/net/usb/rtl8150.c
|
||||
|
||||
USB SERIAL SUBSYSTEM
|
||||
|
|
6
Makefile
6
Makefile
|
@ -1,8 +1,8 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 6
|
||||
PATCHLEVEL = 0
|
||||
PATCHLEVEL = 1
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -rc1
|
||||
NAME = Hurr durr I'ma ninja sloth
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -1979,6 +1979,8 @@ endif
|
|||
|
||||
single-goals := $(addprefix $(build-dir)/, $(single-no-ko))
|
||||
|
||||
KBUILD_MODULES := 1
|
||||
|
||||
endif
|
||||
|
||||
# Preset locale variables to speed up the build process. Limit locale
|
||||
|
|
|
@ -803,7 +803,7 @@ void __iomem *marvel_ioportmap (unsigned long addr)
|
|||
return (void __iomem *)addr;
|
||||
}
|
||||
|
||||
unsigned u8
|
||||
u8
|
||||
marvel_ioread8(const void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr;
|
||||
|
|
|
@ -371,7 +371,7 @@ static unsigned long sigpage_addr(const struct mm_struct *mm,
|
|||
|
||||
slots = ((last - first) >> PAGE_SHIFT) + 1;
|
||||
|
||||
offset = get_random_int() % slots;
|
||||
offset = prandom_u32_max(slots);
|
||||
|
||||
addr = first + (offset << PAGE_SHIFT);
|
||||
|
||||
|
|
|
@ -655,7 +655,7 @@ struct page *get_signal_page(void)
|
|||
PAGE_SIZE / sizeof(u32));
|
||||
|
||||
/* Give the signal return code some randomness */
|
||||
offset = 0x200 + (get_random_int() & 0x7fc);
|
||||
offset = 0x200 + (get_random_u16() & 0x7fc);
|
||||
signal_return_offset = offset;
|
||||
|
||||
/* Copy signal return handlers into the page */
|
||||
|
|
|
@ -238,7 +238,7 @@ void pxa_usb_phy_deinit(void __iomem *phy_reg)
|
|||
static u64 __maybe_unused usb_dma_mask = ~(u32)0;
|
||||
|
||||
#if IS_ENABLED(CONFIG_PHY_PXA_USB)
|
||||
struct resource pxa168_usb_phy_resources[] = {
|
||||
static struct resource pxa168_usb_phy_resources[] = {
|
||||
[0] = {
|
||||
.start = PXA168_U2O_PHYBASE,
|
||||
.end = PXA168_U2O_PHYBASE + USB_PHY_RANGE,
|
||||
|
@ -259,7 +259,7 @@ struct platform_device pxa168_device_usb_phy = {
|
|||
#endif /* CONFIG_PHY_PXA_USB */
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_MV_UDC)
|
||||
struct resource pxa168_u2o_resources[] = {
|
||||
static struct resource pxa168_u2o_resources[] = {
|
||||
/* regbase */
|
||||
[0] = {
|
||||
.start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET,
|
||||
|
@ -294,7 +294,7 @@ struct platform_device pxa168_device_u2o = {
|
|||
#endif /* CONFIG_USB_MV_UDC */
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_EHCI_MV_U2O)
|
||||
struct resource pxa168_u2oehci_resources[] = {
|
||||
static struct resource pxa168_u2oehci_resources[] = {
|
||||
[0] = {
|
||||
.start = PXA168_U2O_REGBASE,
|
||||
.end = PXA168_U2O_REGBASE + USB_REG_RANGE,
|
||||
|
@ -321,7 +321,7 @@ struct platform_device pxa168_device_u2oehci = {
|
|||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_MV_OTG)
|
||||
struct resource pxa168_u2ootg_resources[] = {
|
||||
static struct resource pxa168_u2ootg_resources[] = {
|
||||
/* regbase */
|
||||
[0] = {
|
||||
.start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET,
|
||||
|
|
|
@ -25,11 +25,8 @@ extern struct pl022_ssp_controller pl022_plat_data;
|
|||
extern struct pl08x_platform_data pl080_plat_data;
|
||||
|
||||
void __init spear_setup_of_timer(void);
|
||||
void __init spear3xx_clk_init(void __iomem *misc_base,
|
||||
void __iomem *soc_config_base);
|
||||
void __init spear3xx_map_io(void);
|
||||
void __init spear3xx_dt_init_irq(void);
|
||||
void __init spear6xx_clk_init(void __iomem *misc_base);
|
||||
void __init spear13xx_map_io(void);
|
||||
void __init spear13xx_l2x0_init(void);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/amba/pl022.h>
|
||||
#include <linux/amba/pl080.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk/spear.h>
|
||||
#include <linux/io.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include "pl080.h"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <linux/amba/pl08x.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk/spear.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
|
@ -339,7 +340,7 @@ static struct pl08x_platform_data spear6xx_pl080_plat_data = {
|
|||
* 0xD0000000 0xFD000000
|
||||
* 0xFC000000 0xFC000000
|
||||
*/
|
||||
struct map_desc spear6xx_io_desc[] __initdata = {
|
||||
static struct map_desc spear6xx_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = (unsigned long)VA_SPEAR6XX_ML_CPU_BASE,
|
||||
.pfn = __phys_to_pfn(SPEAR_ICM3_ML1_2_BASE),
|
||||
|
@ -359,12 +360,12 @@ struct map_desc spear6xx_io_desc[] __initdata = {
|
|||
};
|
||||
|
||||
/* This will create static memory mapping for selected devices */
|
||||
void __init spear6xx_map_io(void)
|
||||
static void __init spear6xx_map_io(void)
|
||||
{
|
||||
iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
|
||||
}
|
||||
|
||||
void __init spear6xx_timer_init(void)
|
||||
static void __init spear6xx_timer_init(void)
|
||||
{
|
||||
char pclk_name[] = "pll3_clk";
|
||||
struct clk *gpt_clk, *pclk;
|
||||
|
@ -394,7 +395,7 @@ void __init spear6xx_timer_init(void)
|
|||
}
|
||||
|
||||
/* Add auxdata to pass platform data */
|
||||
struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = {
|
||||
static struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = {
|
||||
OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL,
|
||||
&spear6xx_pl080_plat_data),
|
||||
{}
|
||||
|
|
|
@ -632,6 +632,23 @@ config ARM64_ERRATUM_1530923
|
|||
config ARM64_WORKAROUND_REPEAT_TLBI
|
||||
bool
|
||||
|
||||
config ARM64_ERRATUM_2441007
|
||||
bool "Cortex-A55: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
|
||||
default y
|
||||
select ARM64_WORKAROUND_REPEAT_TLBI
|
||||
help
|
||||
This option adds a workaround for ARM Cortex-A55 erratum #2441007.
|
||||
|
||||
Under very rare circumstances, affected Cortex-A55 CPUs
|
||||
may not handle a race between a break-before-make sequence on one
|
||||
CPU, and another CPU accessing the same page. This could allow a
|
||||
store to a page that has been unmapped.
|
||||
|
||||
Work around this by adding the affected CPUs to the list that needs
|
||||
TLB sequences to be done twice.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config ARM64_ERRATUM_1286807
|
||||
bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
|
||||
default y
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#define ARM_CPU_IMP_FUJITSU 0x46
|
||||
#define ARM_CPU_IMP_HISI 0x48
|
||||
#define ARM_CPU_IMP_APPLE 0x61
|
||||
#define ARM_CPU_IMP_AMPERE 0xC0
|
||||
|
||||
#define ARM_CPU_PART_AEM_V8 0xD0F
|
||||
#define ARM_CPU_PART_FOUNDATION 0xD00
|
||||
|
@ -123,6 +124,8 @@
|
|||
#define APPLE_CPU_PART_M1_ICESTORM_MAX 0x028
|
||||
#define APPLE_CPU_PART_M1_FIRESTORM_MAX 0x029
|
||||
|
||||
#define AMPERE_CPU_PART_AMPERE1 0xAC3
|
||||
|
||||
#define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
|
||||
#define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
|
||||
#define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
|
||||
|
@ -172,6 +175,7 @@
|
|||
#define MIDR_APPLE_M1_FIRESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_PRO)
|
||||
#define MIDR_APPLE_M1_ICESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_MAX)
|
||||
#define MIDR_APPLE_M1_FIRESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_MAX)
|
||||
#define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1)
|
||||
|
||||
/* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */
|
||||
#define MIDR_FUJITSU_ERRATUM_010001 MIDR_FUJITSU_A64FX
|
||||
|
|
|
@ -230,6 +230,11 @@ static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = {
|
|||
ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe),
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_ARM64_ERRATUM_2441007
|
||||
{
|
||||
ERRATA_MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_ARM64_ERRATUM_2441009
|
||||
{
|
||||
/* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */
|
||||
|
|
|
@ -48,7 +48,12 @@ static void mte_sync_page_tags(struct page *page, pte_t old_pte,
|
|||
if (!pte_is_tagged)
|
||||
return;
|
||||
|
||||
mte_clear_page_tags(page_address(page));
|
||||
/*
|
||||
* Test PG_mte_tagged again in case it was racing with another
|
||||
* set_pte_at().
|
||||
*/
|
||||
if (!test_and_set_bit(PG_mte_tagged, &page->flags))
|
||||
mte_clear_page_tags(page_address(page));
|
||||
}
|
||||
|
||||
void mte_sync_tags(pte_t old_pte, pte_t pte)
|
||||
|
@ -64,7 +69,7 @@ void mte_sync_tags(pte_t old_pte, pte_t pte)
|
|||
|
||||
/* if PG_mte_tagged is set, tags have already been initialised */
|
||||
for (i = 0; i < nr_pages; i++, page++) {
|
||||
if (!test_and_set_bit(PG_mte_tagged, &page->flags))
|
||||
if (!test_bit(PG_mte_tagged, &page->flags))
|
||||
mte_sync_page_tags(page, old_pte, check_swap,
|
||||
pte_is_tagged);
|
||||
}
|
||||
|
|
|
@ -591,7 +591,7 @@ unsigned long __get_wchan(struct task_struct *p)
|
|||
unsigned long arch_align_stack(unsigned long sp)
|
||||
{
|
||||
if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
|
||||
sp -= get_random_int() & ~PAGE_MASK;
|
||||
sp -= prandom_u32_max(PAGE_SIZE);
|
||||
return sp & ~0xf;
|
||||
}
|
||||
|
||||
|
|
|
@ -868,6 +868,10 @@ u8 spectre_bhb_loop_affected(int scope)
|
|||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
|
||||
{},
|
||||
};
|
||||
static const struct midr_range spectre_bhb_k11_list[] = {
|
||||
MIDR_ALL_VERSIONS(MIDR_AMPERE1),
|
||||
{},
|
||||
};
|
||||
static const struct midr_range spectre_bhb_k8_list[] = {
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
|
||||
|
@ -878,6 +882,8 @@ u8 spectre_bhb_loop_affected(int scope)
|
|||
k = 32;
|
||||
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k24_list))
|
||||
k = 24;
|
||||
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k11_list))
|
||||
k = 11;
|
||||
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k8_list))
|
||||
k = 8;
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno,
|
|||
*
|
||||
* The resulting 5 bits of entropy is seen in SP[8:4].
|
||||
*/
|
||||
choose_random_kstack_offset(get_random_int() & 0x1FF);
|
||||
choose_random_kstack_offset(get_random_u16() & 0x1FF);
|
||||
}
|
||||
|
||||
static inline bool has_syscall_work(unsigned long flags)
|
||||
|
|
|
@ -53,7 +53,12 @@ bool mte_restore_tags(swp_entry_t entry, struct page *page)
|
|||
if (!tags)
|
||||
return false;
|
||||
|
||||
mte_restore_page_tags(page_address(page), tags);
|
||||
/*
|
||||
* Test PG_mte_tagged again in case it was racing with another
|
||||
* set_pte_at().
|
||||
*/
|
||||
if (!test_and_set_bit(PG_mte_tagged, &page->flags))
|
||||
mte_restore_page_tags(page_address(page), tags);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -732,7 +732,7 @@ EndSysreg
|
|||
|
||||
Sysreg SCTLR_EL1 3 0 1 0 0
|
||||
Field 63 TIDCP
|
||||
Field 62 SPINMASK
|
||||
Field 62 SPINTMASK
|
||||
Field 61 NMI
|
||||
Field 60 EnTP2
|
||||
Res0 59:58
|
||||
|
|
|
@ -412,6 +412,9 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
|
|||
__update_tlb(vma, address, ptep);
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_UPDATE_MMU_TLB
|
||||
#define update_mmu_tlb update_mmu_cache
|
||||
|
||||
static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
|
||||
unsigned long address, pmd_t *pmdp)
|
||||
{
|
||||
|
|
|
@ -293,7 +293,7 @@ unsigned long stack_top(void)
|
|||
unsigned long arch_align_stack(unsigned long sp)
|
||||
{
|
||||
if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
|
||||
sp -= get_random_int() & ~PAGE_MASK;
|
||||
sp -= prandom_u32_max(PAGE_SIZE);
|
||||
|
||||
return sp & STACK_ALIGN;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ static unsigned long vdso_base(void)
|
|||
unsigned long base = STACK_TOP;
|
||||
|
||||
if (current->flags & PF_RANDOMIZE) {
|
||||
base += get_random_int() & (VDSO_RANDOMIZE_SIZE - 1);
|
||||
base += prandom_u32_max(VDSO_RANDOMIZE_SIZE);
|
||||
base = PAGE_ALIGN(base);
|
||||
}
|
||||
|
||||
|
|
|
@ -711,7 +711,7 @@ unsigned long mips_stack_top(void)
|
|||
unsigned long arch_align_stack(unsigned long sp)
|
||||
{
|
||||
if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
|
||||
sp -= get_random_int() & ~PAGE_MASK;
|
||||
sp -= prandom_u32_max(PAGE_SIZE);
|
||||
|
||||
return sp & ALMASK;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ static unsigned long vdso_base(void)
|
|||
}
|
||||
|
||||
if (current->flags & PF_RANDOMIZE) {
|
||||
base += get_random_int() & (VDSO_RANDOMIZE_SIZE - 1);
|
||||
base += prandom_u32_max(VDSO_RANDOMIZE_SIZE);
|
||||
base = PAGE_ALIGN(base);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,10 +74,10 @@ void *arch_dma_set_uncached(void *cpu_addr, size_t size)
|
|||
* We need to iterate through the pages, clearing the dcache for
|
||||
* them and setting the cache-inhibit bit.
|
||||
*/
|
||||
mmap_read_lock(&init_mm);
|
||||
error = walk_page_range(&init_mm, va, va + size, &set_nocache_walk_ops,
|
||||
NULL);
|
||||
mmap_read_unlock(&init_mm);
|
||||
mmap_write_lock(&init_mm);
|
||||
error = walk_page_range_novma(&init_mm, va, va + size,
|
||||
&set_nocache_walk_ops, NULL, NULL);
|
||||
mmap_write_unlock(&init_mm);
|
||||
|
||||
if (error)
|
||||
return ERR_PTR(error);
|
||||
|
@ -88,11 +88,11 @@ void arch_dma_clear_uncached(void *cpu_addr, size_t size)
|
|||
{
|
||||
unsigned long va = (unsigned long)cpu_addr;
|
||||
|
||||
mmap_read_lock(&init_mm);
|
||||
mmap_write_lock(&init_mm);
|
||||
/* walk_page_range shouldn't be able to fail here */
|
||||
WARN_ON(walk_page_range(&init_mm, va, va + size,
|
||||
&clear_nocache_walk_ops, NULL));
|
||||
mmap_read_unlock(&init_mm);
|
||||
WARN_ON(walk_page_range_novma(&init_mm, va, va + size,
|
||||
&clear_nocache_walk_ops, NULL, NULL));
|
||||
mmap_write_unlock(&init_mm);
|
||||
}
|
||||
|
||||
void arch_sync_dma_for_device(phys_addr_t addr, size_t size,
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
struct alt_instr {
|
||||
s32 orig_offset; /* offset to original instructions */
|
||||
s32 len; /* end of original instructions */
|
||||
u32 cond; /* see ALT_COND_XXX */
|
||||
s16 len; /* end of original instructions */
|
||||
u16 cond; /* see ALT_COND_XXX */
|
||||
u32 replacement; /* replacement instruction or code */
|
||||
};
|
||||
} __packed;
|
||||
|
||||
void set_kernel_text_rw(int enable_read_write);
|
||||
void apply_alternatives_all(void);
|
||||
|
@ -35,8 +35,9 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
|
|||
/* Alternative SMP implementation. */
|
||||
#define ALTERNATIVE(cond, replacement) "!0:" \
|
||||
".section .altinstructions, \"aw\" !" \
|
||||
".word (0b-4-.), 1, " __stringify(cond) "," \
|
||||
__stringify(replacement) " !" \
|
||||
".word (0b-4-.) !" \
|
||||
".hword 1, " __stringify(cond) " !" \
|
||||
".word " __stringify(replacement) " !" \
|
||||
".previous"
|
||||
|
||||
#else
|
||||
|
@ -44,15 +45,17 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
|
|||
/* to replace one single instructions by a new instruction */
|
||||
#define ALTERNATIVE(from, to, cond, replacement)\
|
||||
.section .altinstructions, "aw" ! \
|
||||
.word (from - .), (to - from)/4 ! \
|
||||
.word cond, replacement ! \
|
||||
.word (from - .) ! \
|
||||
.hword (to - from)/4, cond ! \
|
||||
.word replacement ! \
|
||||
.previous
|
||||
|
||||
/* to replace multiple instructions by new code */
|
||||
#define ALTERNATIVE_CODE(from, num_instructions, cond, new_instr_ptr)\
|
||||
.section .altinstructions, "aw" ! \
|
||||
.word (from - .), -num_instructions ! \
|
||||
.word cond, (new_instr_ptr - .) ! \
|
||||
.word (from - .) ! \
|
||||
.hword -num_instructions, cond ! \
|
||||
.word (new_instr_ptr - .) ! \
|
||||
.previous
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
|
|
@ -19,9 +19,6 @@ extern unsigned long parisc_pat_pdc_cap; /* PDC capabilities (PAT) */
|
|||
#define PDC_TYPE_SYSTEM_MAP 1 /* 32-bit, but supports PDC_SYSTEM_MAP */
|
||||
#define PDC_TYPE_SNAKE 2 /* Doesn't support SYSTEM_MAP */
|
||||
|
||||
void pdc_console_init(void); /* in pdc_console.c */
|
||||
void pdc_console_restart(void);
|
||||
|
||||
void setup_pdc(void); /* in inventory.c */
|
||||
|
||||
/* wrapper-functions from pdc.c */
|
||||
|
|
|
@ -192,6 +192,11 @@ extern void __update_cache(pte_t pte);
|
|||
#define _PAGE_PRESENT_BIT 22 /* (0x200) Software: translation valid */
|
||||
#define _PAGE_HPAGE_BIT 21 /* (0x400) Software: Huge Page */
|
||||
#define _PAGE_USER_BIT 20 /* (0x800) Software: User accessible page */
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
#define _PAGE_SPECIAL_BIT _PAGE_DMB_BIT /* DMB feature is currently unused */
|
||||
#else
|
||||
#define _PAGE_SPECIAL_BIT _PAGE_HPAGE_BIT /* use unused HUGE PAGE bit */
|
||||
#endif
|
||||
|
||||
/* N.B. The bits are defined in terms of a 32 bit word above, so the */
|
||||
/* following macro is ok for both 32 and 64 bit. */
|
||||
|
@ -219,7 +224,7 @@ extern void __update_cache(pte_t pte);
|
|||
#define _PAGE_PRESENT (1 << xlate_pabit(_PAGE_PRESENT_BIT))
|
||||
#define _PAGE_HUGE (1 << xlate_pabit(_PAGE_HPAGE_BIT))
|
||||
#define _PAGE_USER (1 << xlate_pabit(_PAGE_USER_BIT))
|
||||
#define _PAGE_SPECIAL (_PAGE_DMB)
|
||||
#define _PAGE_SPECIAL (1 << xlate_pabit(_PAGE_SPECIAL_BIT))
|
||||
|
||||
#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_ACCESSED)
|
||||
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL)
|
||||
|
|
|
@ -26,7 +26,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
|
|||
struct alt_instr *entry;
|
||||
int index = 0, applied = 0;
|
||||
int num_cpus = num_online_cpus();
|
||||
u32 cond_check;
|
||||
u16 cond_check;
|
||||
|
||||
cond_check = ALT_COND_ALWAYS |
|
||||
((num_cpus == 1) ? ALT_COND_NO_SMP : 0) |
|
||||
|
@ -45,8 +45,9 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
|
|||
|
||||
for (entry = start; entry < end; entry++, index++) {
|
||||
|
||||
u32 *from, cond, replacement;
|
||||
s32 len;
|
||||
u32 *from, replacement;
|
||||
u16 cond;
|
||||
s16 len;
|
||||
|
||||
from = (u32 *)((ulong)&entry->orig_offset + entry->orig_offset);
|
||||
len = entry->len;
|
||||
|
|
|
@ -499,6 +499,10 @@
|
|||
* Finally, _PAGE_READ goes in the top bit of PL1 (so we
|
||||
* trigger an access rights trap in user space if the user
|
||||
* tries to read an unreadable page */
|
||||
#if _PAGE_SPECIAL_BIT == _PAGE_DMB_BIT
|
||||
/* need to drop DMB bit, as it's used as SPECIAL flag */
|
||||
depi 0,_PAGE_SPECIAL_BIT,1,\pte
|
||||
#endif
|
||||
depd \pte,8,7,\prot
|
||||
|
||||
/* PAGE_USER indicates the page can be read with user privileges,
|
||||
|
@ -529,6 +533,10 @@
|
|||
* makes the tlb entry for the differently formatted pa11
|
||||
* insertion instructions */
|
||||
.macro make_insert_tlb_11 spc,pte,prot
|
||||
#if _PAGE_SPECIAL_BIT == _PAGE_DMB_BIT
|
||||
/* need to drop DMB bit, as it's used as SPECIAL flag */
|
||||
depi 0,_PAGE_SPECIAL_BIT,1,\pte
|
||||
#endif
|
||||
zdep \spc,30,15,\prot
|
||||
dep \pte,8,7,\prot
|
||||
extru,= \pte,_PAGE_NO_CACHE_BIT,1,%r0
|
||||
|
|
|
@ -1,46 +1,18 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* PDC Console support - ie use firmware to dump text via boot console
|
||||
* PDC early console support - use PDC firmware to dump text via boot console
|
||||
*
|
||||
* Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
|
||||
* Copyright (C) 2000 Martin K Petersen <mkp at mkp.net>
|
||||
* Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
|
||||
* Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
|
||||
* Copyright (C) 2000 Philipp Rumpf <prumpf with tux.org>
|
||||
* Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
|
||||
* Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org>
|
||||
* Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org>
|
||||
* Copyright (C) 2001 Helge Deller <deller at parisc-linux.org>
|
||||
* Copyright (C) 2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>
|
||||
* Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
|
||||
* Copyright (C) 2010 Guy Martin <gmsoft at tuxicoman.be>
|
||||
* Copyright (C) 2001-2022 Helge Deller <deller@gmx.de>
|
||||
*/
|
||||
|
||||
/*
|
||||
* The PDC console is a simple console, which can be used for debugging
|
||||
* boot related problems on HP PA-RISC machines. It is also useful when no
|
||||
* other console works.
|
||||
*
|
||||
* This code uses the ROM (=PDC) based functions to read and write characters
|
||||
* from and to PDC's boot path.
|
||||
*/
|
||||
|
||||
/* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems.
|
||||
* On production kernels EARLY_BOOTUP_DEBUG should be undefined. */
|
||||
#define EARLY_BOOTUP_DEBUG
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/kgdb.h>
|
||||
#include <asm/page.h> /* for PAGE0 */
|
||||
#include <asm/pdc.h> /* for iodc_call() proto and friends */
|
||||
|
||||
static DEFINE_SPINLOCK(pdc_console_lock);
|
||||
static struct console pdc_cons;
|
||||
|
||||
static void pdc_console_write(struct console *co, const char *s, unsigned count)
|
||||
{
|
||||
|
@ -54,7 +26,8 @@ static void pdc_console_write(struct console *co, const char *s, unsigned count)
|
|||
spin_unlock_irqrestore(&pdc_console_lock, flags);
|
||||
}
|
||||
|
||||
int pdc_console_poll_key(struct console *co)
|
||||
#ifdef CONFIG_KGDB
|
||||
static int kgdb_pdc_read_char(void)
|
||||
{
|
||||
int c;
|
||||
unsigned long flags;
|
||||
|
@ -63,201 +36,40 @@ int pdc_console_poll_key(struct console *co)
|
|||
c = pdc_iodc_getc();
|
||||
spin_unlock_irqrestore(&pdc_console_lock, flags);
|
||||
|
||||
return c;
|
||||
return (c <= 0) ? NO_POLL_CHAR : c;
|
||||
}
|
||||
|
||||
static int pdc_console_setup(struct console *co, char *options)
|
||||
static void kgdb_pdc_write_char(u8 chr)
|
||||
{
|
||||
return 0;
|
||||
if (PAGE0->mem_cons.cl_class != CL_DUPLEX)
|
||||
pdc_console_write(NULL, &chr, 1);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_PDC_CONSOLE)
|
||||
#include <linux/vt_kern.h>
|
||||
#include <linux/tty_flip.h>
|
||||
|
||||
#define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
|
||||
|
||||
static void pdc_console_poll(struct timer_list *unused);
|
||||
static DEFINE_TIMER(pdc_console_timer, pdc_console_poll);
|
||||
static struct tty_port tty_port;
|
||||
|
||||
static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
|
||||
{
|
||||
tty_port_tty_set(&tty_port, tty);
|
||||
mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp)
|
||||
{
|
||||
if (tty->count == 1) {
|
||||
del_timer_sync(&pdc_console_timer);
|
||||
tty_port_tty_set(&tty_port, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
|
||||
{
|
||||
pdc_console_write(NULL, buf, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
static unsigned int pdc_console_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 32768; /* no limit, no buffer used */
|
||||
}
|
||||
|
||||
static const struct tty_operations pdc_console_tty_ops = {
|
||||
.open = pdc_console_tty_open,
|
||||
.close = pdc_console_tty_close,
|
||||
.write = pdc_console_tty_write,
|
||||
.write_room = pdc_console_tty_write_room,
|
||||
static struct kgdb_io kgdb_pdc_io_ops = {
|
||||
.name = "kgdb_pdc",
|
||||
.read_char = kgdb_pdc_read_char,
|
||||
.write_char = kgdb_pdc_write_char,
|
||||
};
|
||||
|
||||
static void pdc_console_poll(struct timer_list *unused)
|
||||
{
|
||||
int data, count = 0;
|
||||
|
||||
while (1) {
|
||||
data = pdc_console_poll_key(NULL);
|
||||
if (data == -1)
|
||||
break;
|
||||
tty_insert_flip_char(&tty_port, data & 0xFF, TTY_NORMAL);
|
||||
count ++;
|
||||
}
|
||||
|
||||
if (count)
|
||||
tty_flip_buffer_push(&tty_port);
|
||||
|
||||
if (pdc_cons.flags & CON_ENABLED)
|
||||
mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
|
||||
}
|
||||
|
||||
static struct tty_driver *pdc_console_tty_driver;
|
||||
|
||||
static int __init pdc_console_tty_driver_init(void)
|
||||
{
|
||||
struct tty_driver *driver;
|
||||
int err;
|
||||
|
||||
/* Check if the console driver is still registered.
|
||||
* It is unregistered if the pdc console was not selected as the
|
||||
* primary console. */
|
||||
|
||||
struct console *tmp;
|
||||
|
||||
console_lock();
|
||||
for_each_console(tmp)
|
||||
if (tmp == &pdc_cons)
|
||||
break;
|
||||
console_unlock();
|
||||
|
||||
if (!tmp) {
|
||||
printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
printk(KERN_INFO "The PDC console driver is still registered, removing CON_BOOT flag\n");
|
||||
pdc_cons.flags &= ~CON_BOOT;
|
||||
|
||||
driver = tty_alloc_driver(1, TTY_DRIVER_REAL_RAW |
|
||||
TTY_DRIVER_RESET_TERMIOS);
|
||||
if (IS_ERR(driver))
|
||||
return PTR_ERR(driver);
|
||||
|
||||
tty_port_init(&tty_port);
|
||||
|
||||
driver->driver_name = "pdc_cons";
|
||||
driver->name = "ttyB";
|
||||
driver->major = MUX_MAJOR;
|
||||
driver->minor_start = 0;
|
||||
driver->type = TTY_DRIVER_TYPE_SYSTEM;
|
||||
driver->init_termios = tty_std_termios;
|
||||
tty_set_operations(driver, &pdc_console_tty_ops);
|
||||
tty_port_link_device(&tty_port, driver, 0);
|
||||
|
||||
err = tty_register_driver(driver);
|
||||
if (err) {
|
||||
printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
|
||||
tty_port_destroy(&tty_port);
|
||||
tty_driver_kref_put(driver);
|
||||
return err;
|
||||
}
|
||||
|
||||
pdc_console_tty_driver = driver;
|
||||
|
||||
return 0;
|
||||
}
|
||||
device_initcall(pdc_console_tty_driver_init);
|
||||
|
||||
static struct tty_driver * pdc_console_device (struct console *c, int *index)
|
||||
{
|
||||
*index = c->index;
|
||||
return pdc_console_tty_driver;
|
||||
}
|
||||
#else
|
||||
#define pdc_console_device NULL
|
||||
#endif
|
||||
|
||||
static struct console pdc_cons = {
|
||||
.name = "ttyB",
|
||||
.write = pdc_console_write,
|
||||
.device = pdc_console_device,
|
||||
.setup = pdc_console_setup,
|
||||
.flags = CON_BOOT | CON_PRINTBUFFER,
|
||||
.index = -1,
|
||||
};
|
||||
|
||||
static int pdc_console_initialized;
|
||||
|
||||
static void pdc_console_init_force(void)
|
||||
static int __init pdc_earlycon_setup(struct earlycon_device *device,
|
||||
const char *opt)
|
||||
{
|
||||
if (pdc_console_initialized)
|
||||
return;
|
||||
++pdc_console_initialized;
|
||||
|
||||
struct console *earlycon_console;
|
||||
|
||||
/* If the console is duplex then copy the COUT parameters to CIN. */
|
||||
if (PAGE0->mem_cons.cl_class == CL_DUPLEX)
|
||||
memcpy(&PAGE0->mem_kbd, &PAGE0->mem_cons, sizeof(PAGE0->mem_cons));
|
||||
|
||||
/* register the pdc console */
|
||||
register_console(&pdc_cons);
|
||||
}
|
||||
earlycon_console = device->con;
|
||||
earlycon_console->write = pdc_console_write;
|
||||
device->port.iotype = UPIO_MEM32BE;
|
||||
|
||||
void __init pdc_console_init(void)
|
||||
{
|
||||
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE)
|
||||
pdc_console_init_force();
|
||||
#endif
|
||||
#ifdef EARLY_BOOTUP_DEBUG
|
||||
printk(KERN_INFO "Initialized PDC Console for debugging.\n");
|
||||
#ifdef CONFIG_KGDB
|
||||
kgdb_register_io_module(&kgdb_pdc_io_ops);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Used for emergencies. Currently only used if an HPMC occurs. If an
|
||||
* HPMC occurs, it is possible that the current console may not be
|
||||
* properly initialised after the PDC IO reset. This routine unregisters
|
||||
* all of the current consoles, reinitializes the pdc console and
|
||||
* registers it.
|
||||
*/
|
||||
|
||||
void pdc_console_restart(void)
|
||||
{
|
||||
struct console *console;
|
||||
|
||||
if (pdc_console_initialized)
|
||||
return;
|
||||
|
||||
/* If we've already seen the output, don't bother to print it again */
|
||||
if (console_drivers != NULL)
|
||||
pdc_cons.flags &= ~CON_PRINTBUFFER;
|
||||
|
||||
while ((console = console_drivers) != NULL)
|
||||
unregister_console(console_drivers);
|
||||
|
||||
/* force registering the pdc console */
|
||||
pdc_console_init_force();
|
||||
}
|
||||
EARLYCON_DECLARE(pdc, pdc_earlycon_setup);
|
||||
|
|
|
@ -284,7 +284,7 @@ __get_wchan(struct task_struct *p)
|
|||
|
||||
static inline unsigned long brk_rnd(void)
|
||||
{
|
||||
return (get_random_int() & BRK_RND_MASK) << PAGE_SHIFT;
|
||||
return (get_random_u32() & BRK_RND_MASK) << PAGE_SHIFT;
|
||||
}
|
||||
|
||||
unsigned long arch_randomize_brk(struct mm_struct *mm)
|
||||
|
|
|
@ -70,6 +70,10 @@ void __init setup_cmdline(char **cmdline_p)
|
|||
strlcat(p, "tty0", COMMAND_LINE_SIZE);
|
||||
}
|
||||
|
||||
/* default to use early console */
|
||||
if (!strstr(p, "earlycon"))
|
||||
strlcat(p, " earlycon=pdc", COMMAND_LINE_SIZE);
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INITRD
|
||||
if (boot_args[2] != 0) /* did palo pass us a ramdisk? */
|
||||
{
|
||||
|
@ -139,8 +143,6 @@ void __init setup_arch(char **cmdline_p)
|
|||
if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
|
||||
panic("KERNEL_INITIAL_ORDER too small!");
|
||||
|
||||
pdc_console_init();
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
if(parisc_narrow_firmware) {
|
||||
printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
|
||||
|
|
|
@ -239,14 +239,14 @@ static unsigned long mmap_rnd(void)
|
|||
unsigned long rnd = 0;
|
||||
|
||||
if (current->flags & PF_RANDOMIZE)
|
||||
rnd = get_random_int() & MMAP_RND_MASK;
|
||||
rnd = get_random_u32() & MMAP_RND_MASK;
|
||||
|
||||
return rnd << PAGE_SHIFT;
|
||||
}
|
||||
|
||||
unsigned long arch_mmap_rnd(void)
|
||||
{
|
||||
return (get_random_int() & MMAP_RND_MASK) << PAGE_SHIFT;
|
||||
return (get_random_u32() & MMAP_RND_MASK) << PAGE_SHIFT;
|
||||
}
|
||||
|
||||
static unsigned long mmap_legacy_base(void)
|
||||
|
|
|
@ -239,13 +239,6 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
|
|||
/* unlock the pdc lock if necessary */
|
||||
pdc_emergency_unlock();
|
||||
|
||||
/* maybe the kernel hasn't booted very far yet and hasn't been able
|
||||
* to initialize the serial or STI console. In that case we should
|
||||
* re-enable the pdc console, so that the user will be able to
|
||||
* identify the problem. */
|
||||
if (!console_drivers)
|
||||
pdc_console_restart();
|
||||
|
||||
if (err)
|
||||
printk(KERN_CRIT "%s (pid %d): %s (code %ld)\n",
|
||||
current->comm, task_pid_nr(current), str, err);
|
||||
|
@ -429,10 +422,6 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o
|
|||
/* unlock the pdc lock if necessary */
|
||||
pdc_emergency_unlock();
|
||||
|
||||
/* restart pdc console if necessary */
|
||||
if (!console_drivers)
|
||||
pdc_console_restart();
|
||||
|
||||
/* Not all paths will gutter the processor... */
|
||||
switch(code){
|
||||
|
||||
|
@ -482,9 +471,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
|
|||
unsigned long fault_space = 0;
|
||||
int si_code;
|
||||
|
||||
if (code == 1)
|
||||
pdc_console_restart(); /* switch back to pdc if HPMC */
|
||||
else if (!irqs_disabled_flags(regs->gr[0]))
|
||||
if (!irqs_disabled_flags(regs->gr[0]))
|
||||
local_irq_enable();
|
||||
|
||||
/* Security check:
|
||||
|
|
|
@ -75,7 +75,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
|
|||
|
||||
map_base = mm->mmap_base;
|
||||
if (current->flags & PF_RANDOMIZE)
|
||||
map_base -= (get_random_int() & 0x1f) * PAGE_SIZE;
|
||||
map_base -= prandom_u32_max(0x20) * PAGE_SIZE;
|
||||
|
||||
vdso_text_start = get_unmapped_area(NULL, map_base, vdso_text_len, 0, 0);
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static int __init crc_test_init(void)
|
|||
|
||||
if (len <= offset)
|
||||
continue;
|
||||
prandom_bytes(data, len);
|
||||
get_random_bytes(data, len);
|
||||
len -= offset;
|
||||
|
||||
crypto_shash_update(crct10dif_shash, data+offset, len);
|
||||
|
|
|
@ -89,6 +89,22 @@ long compat_sys_rt_sigreturn(void);
|
|||
* responsible for combining parameter pairs.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
long sys_ppc_pread64(unsigned int fd,
|
||||
char __user *ubuf, compat_size_t count,
|
||||
u32 reg6, u32 pos1, u32 pos2);
|
||||
long sys_ppc_pwrite64(unsigned int fd,
|
||||
const char __user *ubuf, compat_size_t count,
|
||||
u32 reg6, u32 pos1, u32 pos2);
|
||||
long sys_ppc_readahead(int fd, u32 r4,
|
||||
u32 offset1, u32 offset2, u32 count);
|
||||
long sys_ppc_truncate64(const char __user *path, u32 reg4,
|
||||
unsigned long len1, unsigned long len2);
|
||||
long sys_ppc_ftruncate64(unsigned int fd, u32 reg4,
|
||||
unsigned long len1, unsigned long len2);
|
||||
long sys_ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
|
||||
size_t len, int advice);
|
||||
#endif
|
||||
#ifdef CONFIG_COMPAT
|
||||
long compat_sys_mmap2(unsigned long addr, size_t len,
|
||||
unsigned long prot, unsigned long flags,
|
||||
|
|
|
@ -73,6 +73,7 @@ obj-y := cputable.o syscalls.o \
|
|||
obj-y += ptrace/
|
||||
obj-$(CONFIG_PPC64) += setup_64.o irq_64.o\
|
||||
paca.o nvram_64.o note.o
|
||||
obj-$(CONFIG_PPC32) += sys_ppc32.o
|
||||
obj-$(CONFIG_COMPAT) += sys_ppc32.o signal_32.o
|
||||
obj-$(CONFIG_VDSO32) += vdso32_wrapper.o
|
||||
obj-$(CONFIG_PPC_WATCHDOG) += watchdog.o
|
||||
|
|
|
@ -538,7 +538,7 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_kernel)
|
|||
beq .Lfast_kernel_interrupt_return_\srr\() // EE already disabled
|
||||
lbz r11,PACAIRQHAPPENED(r13)
|
||||
andi. r10,r11,PACA_IRQ_MUST_HARD_MASK
|
||||
beq 1f // No HARD_MASK pending
|
||||
beq .Lfast_kernel_interrupt_return_\srr\() // No HARD_MASK pending
|
||||
|
||||
/* Must clear MSR_EE from _MSR */
|
||||
#ifdef CONFIG_PPC_BOOK3S
|
||||
|
@ -555,12 +555,23 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_kernel)
|
|||
b .Lfast_kernel_interrupt_return_\srr\()
|
||||
|
||||
.Linterrupt_return_\srr\()_soft_enabled:
|
||||
/*
|
||||
* In the soft-enabled case, need to double-check that we have no
|
||||
* pending interrupts that might have come in before we reached the
|
||||
* restart section of code, and restart the exit so those can be
|
||||
* handled.
|
||||
*
|
||||
* If there are none, it is be possible that the interrupt still
|
||||
* has PACA_IRQ_HARD_DIS set, which needs to be cleared for the
|
||||
* interrupted context. This clear will not clobber a new pending
|
||||
* interrupt coming in, because we're in the restart section, so
|
||||
* such would return to the restart location.
|
||||
*/
|
||||
#ifdef CONFIG_PPC_BOOK3S
|
||||
lbz r11,PACAIRQHAPPENED(r13)
|
||||
andi. r11,r11,(~PACA_IRQ_HARD_DIS)@l
|
||||
bne- interrupt_return_\srr\()_kernel_restart
|
||||
#endif
|
||||
1:
|
||||
li r11,0
|
||||
stb r11,PACAIRQHAPPENED(r13) // clear the possible HARD_DIS
|
||||
|
||||
|
|
|
@ -2303,6 +2303,6 @@ void notrace __ppc64_runlatch_off(void)
|
|||
unsigned long arch_align_stack(unsigned long sp)
|
||||
{
|
||||
if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
|
||||
sp -= get_random_int() & ~PAGE_MASK;
|
||||
sp -= prandom_u32_max(PAGE_SIZE);
|
||||
return sp & ~0xf;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* sys_ppc32.c: Conversion between 32bit and 64bit native syscalls.
|
||||
* sys_ppc32.c: 32-bit system calls with complex calling conventions.
|
||||
*
|
||||
* Copyright (C) 2001 IBM
|
||||
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
|
||||
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
|
||||
*
|
||||
* These routines maintain argument size conversion between 32bit and 64bit
|
||||
* environment.
|
||||
* 32-bit system calls with 64-bit arguments pass those in register pairs.
|
||||
* This must be specially dealt with on 64-bit kernels. The compat_arg_u64_dual
|
||||
* in generic compat syscalls is not always usable because the register
|
||||
* pairing is constrained depending on preceding arguments.
|
||||
*
|
||||
* An analogous problem exists on 32-bit kernels with ARCH_HAS_SYSCALL_WRAPPER,
|
||||
* the defined system call functions take the pt_regs as an argument, and there
|
||||
* is a mapping macro which maps registers to arguments
|
||||
* (SC_POWERPC_REGS_TO_ARGS) which also does not deal with these 64-bit
|
||||
* arguments.
|
||||
*
|
||||
* This file contains these system calls.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
@ -47,7 +57,17 @@
|
|||
#include <asm/syscalls.h>
|
||||
#include <asm/switch_to.h>
|
||||
|
||||
COMPAT_SYSCALL_DEFINE6(ppc_pread64,
|
||||
#ifdef CONFIG_PPC32
|
||||
#define PPC32_SYSCALL_DEFINE4 SYSCALL_DEFINE4
|
||||
#define PPC32_SYSCALL_DEFINE5 SYSCALL_DEFINE5
|
||||
#define PPC32_SYSCALL_DEFINE6 SYSCALL_DEFINE6
|
||||
#else
|
||||
#define PPC32_SYSCALL_DEFINE4 COMPAT_SYSCALL_DEFINE4
|
||||
#define PPC32_SYSCALL_DEFINE5 COMPAT_SYSCALL_DEFINE5
|
||||
#define PPC32_SYSCALL_DEFINE6 COMPAT_SYSCALL_DEFINE6
|
||||
#endif
|
||||
|
||||
PPC32_SYSCALL_DEFINE6(ppc_pread64,
|
||||
unsigned int, fd,
|
||||
char __user *, ubuf, compat_size_t, count,
|
||||
u32, reg6, u32, pos1, u32, pos2)
|
||||
|
@ -55,7 +75,7 @@ COMPAT_SYSCALL_DEFINE6(ppc_pread64,
|
|||
return ksys_pread64(fd, ubuf, count, merge_64(pos1, pos2));
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE6(ppc_pwrite64,
|
||||
PPC32_SYSCALL_DEFINE6(ppc_pwrite64,
|
||||
unsigned int, fd,
|
||||
const char __user *, ubuf, compat_size_t, count,
|
||||
u32, reg6, u32, pos1, u32, pos2)
|
||||
|
@ -63,28 +83,28 @@ COMPAT_SYSCALL_DEFINE6(ppc_pwrite64,
|
|||
return ksys_pwrite64(fd, ubuf, count, merge_64(pos1, pos2));
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE5(ppc_readahead,
|
||||
PPC32_SYSCALL_DEFINE5(ppc_readahead,
|
||||
int, fd, u32, r4,
|
||||
u32, offset1, u32, offset2, u32, count)
|
||||
{
|
||||
return ksys_readahead(fd, merge_64(offset1, offset2), count);
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE4(ppc_truncate64,
|
||||
PPC32_SYSCALL_DEFINE4(ppc_truncate64,
|
||||
const char __user *, path, u32, reg4,
|
||||
unsigned long, len1, unsigned long, len2)
|
||||
{
|
||||
return ksys_truncate(path, merge_64(len1, len2));
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE4(ppc_ftruncate64,
|
||||
PPC32_SYSCALL_DEFINE4(ppc_ftruncate64,
|
||||
unsigned int, fd, u32, reg4,
|
||||
unsigned long, len1, unsigned long, len2)
|
||||
{
|
||||
return ksys_ftruncate(fd, merge_64(len1, len2));
|
||||
}
|
||||
|
||||
COMPAT_SYSCALL_DEFINE6(ppc32_fadvise64,
|
||||
PPC32_SYSCALL_DEFINE6(ppc32_fadvise64,
|
||||
int, fd, u32, unused, u32, offset1, u32, offset2,
|
||||
size_t, len, int, advice)
|
||||
{
|
||||
|
|
|
@ -228,8 +228,10 @@
|
|||
176 64 rt_sigtimedwait sys_rt_sigtimedwait
|
||||
177 nospu rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo
|
||||
178 nospu rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend
|
||||
179 common pread64 sys_pread64 compat_sys_ppc_pread64
|
||||
180 common pwrite64 sys_pwrite64 compat_sys_ppc_pwrite64
|
||||
179 32 pread64 sys_ppc_pread64 compat_sys_ppc_pread64
|
||||
179 64 pread64 sys_pread64
|
||||
180 32 pwrite64 sys_ppc_pwrite64 compat_sys_ppc_pwrite64
|
||||
180 64 pwrite64 sys_pwrite64
|
||||
181 common chown sys_chown
|
||||
182 common getcwd sys_getcwd
|
||||
183 common capget sys_capget
|
||||
|
@ -242,10 +244,11 @@
|
|||
188 common putpmsg sys_ni_syscall
|
||||
189 nospu vfork sys_vfork
|
||||
190 common ugetrlimit sys_getrlimit compat_sys_getrlimit
|
||||
191 common readahead sys_readahead compat_sys_ppc_readahead
|
||||
191 32 readahead sys_ppc_readahead compat_sys_ppc_readahead
|
||||
191 64 readahead sys_readahead
|
||||
192 32 mmap2 sys_mmap2 compat_sys_mmap2
|
||||
193 32 truncate64 sys_truncate64 compat_sys_ppc_truncate64
|
||||
194 32 ftruncate64 sys_ftruncate64 compat_sys_ppc_ftruncate64
|
||||
193 32 truncate64 sys_ppc_truncate64 compat_sys_ppc_truncate64
|
||||
194 32 ftruncate64 sys_ppc_ftruncate64 compat_sys_ppc_ftruncate64
|
||||
195 32 stat64 sys_stat64
|
||||
196 32 lstat64 sys_lstat64
|
||||
197 32 fstat64 sys_fstat64
|
||||
|
@ -288,7 +291,8 @@
|
|||
230 common io_submit sys_io_submit compat_sys_io_submit
|
||||
231 common io_cancel sys_io_cancel
|
||||
232 nospu set_tid_address sys_set_tid_address
|
||||
233 common fadvise64 sys_fadvise64 compat_sys_ppc32_fadvise64
|
||||
233 32 fadvise64 sys_ppc32_fadvise64 compat_sys_ppc32_fadvise64
|
||||
233 64 fadvise64 sys_fadvise64
|
||||
234 nospu exit_group sys_exit_group
|
||||
235 nospu lookup_dcookie sys_lookup_dcookie compat_sys_lookup_dcookie
|
||||
236 common epoll_create sys_epoll_create
|
||||
|
|
|
@ -508,10 +508,10 @@ unsigned long kvmppc_h_svm_init_start(struct kvm *kvm)
|
|||
static int __kvmppc_svm_page_out(struct vm_area_struct *vma,
|
||||
unsigned long start,
|
||||
unsigned long end, unsigned long page_shift,
|
||||
struct kvm *kvm, unsigned long gpa)
|
||||
struct kvm *kvm, unsigned long gpa, struct page *fault_page)
|
||||
{
|
||||
unsigned long src_pfn, dst_pfn = 0;
|
||||
struct migrate_vma mig;
|
||||
struct migrate_vma mig = { 0 };
|
||||
struct page *dpage, *spage;
|
||||
struct kvmppc_uvmem_page_pvt *pvt;
|
||||
unsigned long pfn;
|
||||
|
@ -525,6 +525,7 @@ static int __kvmppc_svm_page_out(struct vm_area_struct *vma,
|
|||
mig.dst = &dst_pfn;
|
||||
mig.pgmap_owner = &kvmppc_uvmem_pgmap;
|
||||
mig.flags = MIGRATE_VMA_SELECT_DEVICE_PRIVATE;
|
||||
mig.fault_page = fault_page;
|
||||
|
||||
/* The requested page is already paged-out, nothing to do */
|
||||
if (!kvmppc_gfn_is_uvmem_pfn(gpa >> page_shift, kvm, NULL))
|
||||
|
@ -580,12 +581,14 @@ out_finalize:
|
|||
static inline int kvmppc_svm_page_out(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end,
|
||||
unsigned long page_shift,
|
||||
struct kvm *kvm, unsigned long gpa)
|
||||
struct kvm *kvm, unsigned long gpa,
|
||||
struct page *fault_page)
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&kvm->arch.uvmem_lock);
|
||||
ret = __kvmppc_svm_page_out(vma, start, end, page_shift, kvm, gpa);
|
||||
ret = __kvmppc_svm_page_out(vma, start, end, page_shift, kvm, gpa,
|
||||
fault_page);
|
||||
mutex_unlock(&kvm->arch.uvmem_lock);
|
||||
|
||||
return ret;
|
||||
|
@ -634,7 +637,7 @@ void kvmppc_uvmem_drop_pages(const struct kvm_memory_slot *slot,
|
|||
pvt->remove_gfn = true;
|
||||
|
||||
if (__kvmppc_svm_page_out(vma, addr, addr + PAGE_SIZE,
|
||||
PAGE_SHIFT, kvm, pvt->gpa))
|
||||
PAGE_SHIFT, kvm, pvt->gpa, NULL))
|
||||
pr_err("Can't page out gpa:0x%lx addr:0x%lx\n",
|
||||
pvt->gpa, addr);
|
||||
} else {
|
||||
|
@ -715,7 +718,7 @@ static struct page *kvmppc_uvmem_get_page(unsigned long gpa, struct kvm *kvm)
|
|||
|
||||
dpage = pfn_to_page(uvmem_pfn);
|
||||
dpage->zone_device_data = pvt;
|
||||
lock_page(dpage);
|
||||
zone_device_page_init(dpage);
|
||||
return dpage;
|
||||
out_clear:
|
||||
spin_lock(&kvmppc_uvmem_bitmap_lock);
|
||||
|
@ -736,7 +739,7 @@ static int kvmppc_svm_page_in(struct vm_area_struct *vma,
|
|||
bool pagein)
|
||||
{
|
||||
unsigned long src_pfn, dst_pfn = 0;
|
||||
struct migrate_vma mig;
|
||||
struct migrate_vma mig = { 0 };
|
||||
struct page *spage;
|
||||
unsigned long pfn;
|
||||
struct page *dpage;
|
||||
|
@ -994,7 +997,7 @@ static vm_fault_t kvmppc_uvmem_migrate_to_ram(struct vm_fault *vmf)
|
|||
|
||||
if (kvmppc_svm_page_out(vmf->vma, vmf->address,
|
||||
vmf->address + PAGE_SIZE, PAGE_SHIFT,
|
||||
pvt->kvm, pvt->gpa))
|
||||
pvt->kvm, pvt->gpa, vmf->page))
|
||||
return VM_FAULT_SIGBUS;
|
||||
else
|
||||
return 0;
|
||||
|
@ -1065,7 +1068,7 @@ kvmppc_h_svm_page_out(struct kvm *kvm, unsigned long gpa,
|
|||
if (!vma || vma->vm_start > start || vma->vm_end < end)
|
||||
goto out;
|
||||
|
||||
if (!kvmppc_svm_page_out(vma, start, end, page_shift, kvm, gpa))
|
||||
if (!kvmppc_svm_page_out(vma, start, end, page_shift, kvm, gpa, NULL))
|
||||
ret = H_SUCCESS;
|
||||
out:
|
||||
mmap_read_unlock(kvm->mm);
|
||||
|
|
|
@ -7,7 +7,7 @@ obj-y := lpar.o hvCall.o nvram.o reconfig.o \
|
|||
setup.o iommu.o event_sources.o ras.o \
|
||||
firmware.o power.o dlpar.o mobility.o rng.o \
|
||||
pci.o pci_dlpar.o eeh_pseries.o msi.o \
|
||||
papr_platform_attributes.o
|
||||
papr_platform_attributes.o dtl.o
|
||||
obj-$(CONFIG_SMP) += smp.o
|
||||
obj-$(CONFIG_KEXEC_CORE) += kexec.o
|
||||
obj-$(CONFIG_PSERIES_ENERGY) += pseries_energy.o
|
||||
|
@ -19,7 +19,6 @@ obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
|
|||
obj-$(CONFIG_HVCS) += hvcserver.o
|
||||
obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o
|
||||
obj-$(CONFIG_CMM) += cmm.o
|
||||
obj-$(CONFIG_DTL) += dtl.o
|
||||
obj-$(CONFIG_IO_EVENT_IRQ) += io_event_irq.o
|
||||
obj-$(CONFIG_LPARCFG) += lparcfg.o
|
||||
obj-$(CONFIG_IBMVIO) += vio.o
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <asm/plpar_wrappers.h>
|
||||
#include <asm/machdep.h>
|
||||
|
||||
#ifdef CONFIG_DTL
|
||||
struct dtl {
|
||||
struct dtl_entry *buf;
|
||||
int cpu;
|
||||
|
@ -57,78 +58,6 @@ static DEFINE_PER_CPU(struct dtl_ring, dtl_rings);
|
|||
|
||||
static atomic_t dtl_count;
|
||||
|
||||
/*
|
||||
* Scan the dispatch trace log and count up the stolen time.
|
||||
* Should be called with interrupts disabled.
|
||||
*/
|
||||
static notrace u64 scan_dispatch_log(u64 stop_tb)
|
||||
{
|
||||
u64 i = local_paca->dtl_ridx;
|
||||
struct dtl_entry *dtl = local_paca->dtl_curr;
|
||||
struct dtl_entry *dtl_end = local_paca->dispatch_log_end;
|
||||
struct lppaca *vpa = local_paca->lppaca_ptr;
|
||||
u64 tb_delta;
|
||||
u64 stolen = 0;
|
||||
u64 dtb;
|
||||
|
||||
if (!dtl)
|
||||
return 0;
|
||||
|
||||
if (i == be64_to_cpu(vpa->dtl_idx))
|
||||
return 0;
|
||||
while (i < be64_to_cpu(vpa->dtl_idx)) {
|
||||
dtb = be64_to_cpu(dtl->timebase);
|
||||
tb_delta = be32_to_cpu(dtl->enqueue_to_dispatch_time) +
|
||||
be32_to_cpu(dtl->ready_to_enqueue_time);
|
||||
barrier();
|
||||
if (i + N_DISPATCH_LOG < be64_to_cpu(vpa->dtl_idx)) {
|
||||
/* buffer has overflowed */
|
||||
i = be64_to_cpu(vpa->dtl_idx) - N_DISPATCH_LOG;
|
||||
dtl = local_paca->dispatch_log + (i % N_DISPATCH_LOG);
|
||||
continue;
|
||||
}
|
||||
if (dtb > stop_tb)
|
||||
break;
|
||||
if (dtl_consumer)
|
||||
dtl_consumer(dtl, i);
|
||||
stolen += tb_delta;
|
||||
++i;
|
||||
++dtl;
|
||||
if (dtl == dtl_end)
|
||||
dtl = local_paca->dispatch_log;
|
||||
}
|
||||
local_paca->dtl_ridx = i;
|
||||
local_paca->dtl_curr = dtl;
|
||||
return stolen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Accumulate stolen time by scanning the dispatch trace log.
|
||||
* Called on entry from user mode.
|
||||
*/
|
||||
void notrace pseries_accumulate_stolen_time(void)
|
||||
{
|
||||
u64 sst, ust;
|
||||
struct cpu_accounting_data *acct = &local_paca->accounting;
|
||||
|
||||
sst = scan_dispatch_log(acct->starttime_user);
|
||||
ust = scan_dispatch_log(acct->starttime);
|
||||
acct->stime -= sst;
|
||||
acct->utime -= ust;
|
||||
acct->steal_time += ust + sst;
|
||||
}
|
||||
|
||||
u64 pseries_calculate_stolen_time(u64 stop_tb)
|
||||
{
|
||||
if (!firmware_has_feature(FW_FEATURE_SPLPAR))
|
||||
return 0;
|
||||
|
||||
if (get_paca()->dtl_ridx != be64_to_cpu(get_lppaca()->dtl_idx))
|
||||
return scan_dispatch_log(stop_tb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The cpu accounting code controls the DTL ring buffer, and we get
|
||||
* given entries as they are processed.
|
||||
|
@ -436,3 +365,81 @@ static int dtl_init(void)
|
|||
return 0;
|
||||
}
|
||||
machine_arch_initcall(pseries, dtl_init);
|
||||
#endif /* CONFIG_DTL */
|
||||
|
||||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
||||
/*
|
||||
* Scan the dispatch trace log and count up the stolen time.
|
||||
* Should be called with interrupts disabled.
|
||||
*/
|
||||
static notrace u64 scan_dispatch_log(u64 stop_tb)
|
||||
{
|
||||
u64 i = local_paca->dtl_ridx;
|
||||
struct dtl_entry *dtl = local_paca->dtl_curr;
|
||||
struct dtl_entry *dtl_end = local_paca->dispatch_log_end;
|
||||
struct lppaca *vpa = local_paca->lppaca_ptr;
|
||||
u64 tb_delta;
|
||||
u64 stolen = 0;
|
||||
u64 dtb;
|
||||
|
||||
if (!dtl)
|
||||
return 0;
|
||||
|
||||
if (i == be64_to_cpu(vpa->dtl_idx))
|
||||
return 0;
|
||||
while (i < be64_to_cpu(vpa->dtl_idx)) {
|
||||
dtb = be64_to_cpu(dtl->timebase);
|
||||
tb_delta = be32_to_cpu(dtl->enqueue_to_dispatch_time) +
|
||||
be32_to_cpu(dtl->ready_to_enqueue_time);
|
||||
barrier();
|
||||
if (i + N_DISPATCH_LOG < be64_to_cpu(vpa->dtl_idx)) {
|
||||
/* buffer has overflowed */
|
||||
i = be64_to_cpu(vpa->dtl_idx) - N_DISPATCH_LOG;
|
||||
dtl = local_paca->dispatch_log + (i % N_DISPATCH_LOG);
|
||||
continue;
|
||||
}
|
||||
if (dtb > stop_tb)
|
||||
break;
|
||||
#ifdef CONFIG_DTL
|
||||
if (dtl_consumer)
|
||||
dtl_consumer(dtl, i);
|
||||
#endif
|
||||
stolen += tb_delta;
|
||||
++i;
|
||||
++dtl;
|
||||
if (dtl == dtl_end)
|
||||
dtl = local_paca->dispatch_log;
|
||||
}
|
||||
local_paca->dtl_ridx = i;
|
||||
local_paca->dtl_curr = dtl;
|
||||
return stolen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Accumulate stolen time by scanning the dispatch trace log.
|
||||
* Called on entry from user mode.
|
||||
*/
|
||||
void notrace pseries_accumulate_stolen_time(void)
|
||||
{
|
||||
u64 sst, ust;
|
||||
struct cpu_accounting_data *acct = &local_paca->accounting;
|
||||
|
||||
sst = scan_dispatch_log(acct->starttime_user);
|
||||
ust = scan_dispatch_log(acct->starttime);
|
||||
acct->stime -= sst;
|
||||
acct->utime -= ust;
|
||||
acct->steal_time += ust + sst;
|
||||
}
|
||||
|
||||
u64 pseries_calculate_stolen_time(u64 stop_tb)
|
||||
{
|
||||
if (!firmware_has_feature(FW_FEATURE_SPLPAR))
|
||||
return 0;
|
||||
|
||||
if (get_paca()->dtl_ridx != be64_to_cpu(get_lppaca()->dtl_idx))
|
||||
return scan_dispatch_log(stop_tb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -70,6 +70,7 @@ config RISCV
|
|||
select GENERIC_SMP_IDLE_THREAD
|
||||
select GENERIC_TIME_VSYSCALL if MMU && 64BIT
|
||||
select GENERIC_VDSO_TIME_NS if HAVE_GENERIC_VDSO
|
||||
select HARDIRQS_SW_RESEND
|
||||
select HAVE_ARCH_AUDITSYSCALL
|
||||
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
||||
select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
|
||||
|
|
|
@ -37,6 +37,7 @@ else
|
|||
endif
|
||||
|
||||
ifeq ($(CONFIG_LD_IS_LLD),y)
|
||||
ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0)
|
||||
KBUILD_CFLAGS += -mno-relax
|
||||
KBUILD_AFLAGS += -mno-relax
|
||||
ifndef CONFIG_AS_IS_LLVM
|
||||
|
@ -44,6 +45,7 @@ ifndef CONFIG_AS_IS_LLVM
|
|||
KBUILD_AFLAGS += -Wa,-mno-relax
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# ISA string setting
|
||||
riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
|
||||
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-m100pfsevp.dtb
|
||||
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-polarberry.dtb
|
||||
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-sev-kit.dtb
|
||||
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
|
||||
|
|
|
@ -2,20 +2,21 @@
|
|||
/* Copyright (c) 2020-2021 Microchip Technology Inc */
|
||||
|
||||
/ {
|
||||
compatible = "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpfs";
|
||||
compatible = "microchip,mpfs-icicle-reference-rtlv2210", "microchip,mpfs-icicle-kit",
|
||||
"microchip,mpfs";
|
||||
|
||||
core_pwm0: pwm@41000000 {
|
||||
core_pwm0: pwm@40000000 {
|
||||
compatible = "microchip,corepwm-rtl-v4";
|
||||
reg = <0x0 0x41000000 0x0 0xF0>;
|
||||
reg = <0x0 0x40000000 0x0 0xF0>;
|
||||
microchip,sync-update-mask = /bits/ 32 <0>;
|
||||
#pwm-cells = <2>;
|
||||
clocks = <&fabric_clk3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2c2: i2c@44000000 {
|
||||
i2c2: i2c@40000200 {
|
||||
compatible = "microchip,corei2c-rtl-v7";
|
||||
reg = <0x0 0x44000000 0x0 0x1000>;
|
||||
reg = <0x0 0x40000200 0x0 0x100>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
clocks = <&fabric_clk3>;
|
||||
|
@ -28,7 +29,7 @@
|
|||
fabric_clk3: fabric-clk3 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <62500000>;
|
||||
clock-frequency = <50000000>;
|
||||
};
|
||||
|
||||
fabric_clk1: fabric-clk1 {
|
||||
|
@ -36,4 +37,34 @@
|
|||
#clock-cells = <0>;
|
||||
clock-frequency = <125000000>;
|
||||
};
|
||||
|
||||
pcie: pcie@3000000000 {
|
||||
compatible = "microchip,pcie-host-1.0";
|
||||
#address-cells = <0x3>;
|
||||
#interrupt-cells = <0x1>;
|
||||
#size-cells = <0x2>;
|
||||
device_type = "pci";
|
||||
reg = <0x30 0x0 0x0 0x8000000>, <0x0 0x43000000 0x0 0x10000>;
|
||||
reg-names = "cfg", "apb";
|
||||
bus-range = <0x0 0x7f>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <119>;
|
||||
interrupt-map = <0 0 0 1 &pcie_intc 0>,
|
||||
<0 0 0 2 &pcie_intc 1>,
|
||||
<0 0 0 3 &pcie_intc 2>,
|
||||
<0 0 0 4 &pcie_intc 3>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
clocks = <&fabric_clk1>, <&fabric_clk3>;
|
||||
clock-names = "fic1", "fic3";
|
||||
ranges = <0x3000000 0x0 0x8000000 0x30 0x8000000 0x0 0x80000000>;
|
||||
dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000 0x1 0x00000000>;
|
||||
msi-parent = <&pcie>;
|
||||
msi-controller;
|
||||
status = "disabled";
|
||||
pcie_intc: interrupt-controller {
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-controller;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
/ {
|
||||
model = "Microchip PolarFire-SoC Icicle Kit";
|
||||
compatible = "microchip,mpfs-icicle-kit", "microchip,mpfs";
|
||||
compatible = "microchip,mpfs-icicle-reference-rtlv2210", "microchip,mpfs-icicle-kit",
|
||||
"microchip,mpfs";
|
||||
|
||||
aliases {
|
||||
ethernet0 = &mac1;
|
||||
|
@ -32,15 +33,26 @@
|
|||
|
||||
ddrc_cache_lo: memory@80000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x0 0x80000000 0x0 0x2e000000>;
|
||||
reg = <0x0 0x80000000 0x0 0x40000000>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ddrc_cache_hi: memory@1000000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x10 0x0 0x0 0x40000000>;
|
||||
reg = <0x10 0x40000000 0x0 0x40000000>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
hss_payload: region@BFC00000 {
|
||||
reg = <0x0 0xBFC00000 0x0 0x400000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&core_pwm0 {
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
/* Copyright (c) 2022 Microchip Technology Inc */
|
||||
|
||||
/ {
|
||||
fabric_clk3: fabric-clk3 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <62500000>;
|
||||
};
|
||||
|
||||
fabric_clk1: fabric-clk1 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <125000000>;
|
||||
};
|
||||
|
||||
pcie: pcie@2000000000 {
|
||||
compatible = "microchip,pcie-host-1.0";
|
||||
#address-cells = <0x3>;
|
||||
#interrupt-cells = <0x1>;
|
||||
#size-cells = <0x2>;
|
||||
device_type = "pci";
|
||||
reg = <0x20 0x0 0x0 0x8000000>, <0x0 0x43000000 0x0 0x10000>;
|
||||
reg-names = "cfg", "apb";
|
||||
bus-range = <0x0 0x7f>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <119>;
|
||||
interrupt-map = <0 0 0 1 &pcie_intc 0>,
|
||||
<0 0 0 2 &pcie_intc 1>,
|
||||
<0 0 0 3 &pcie_intc 2>,
|
||||
<0 0 0 4 &pcie_intc 3>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
clocks = <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>;
|
||||
clock-names = "fic0", "fic1", "fic3";
|
||||
ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>;
|
||||
msi-parent = <&pcie>;
|
||||
msi-controller;
|
||||
status = "disabled";
|
||||
pcie_intc: interrupt-controller {
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-controller;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,179 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Original all-in-one devicetree:
|
||||
* Copyright (C) 2021-2022 - Wolfgang Grandegger <wg@aries-embedded.de>
|
||||
* Rewritten to use includes:
|
||||
* Copyright (C) 2022 - Conor Dooley <conor.dooley@microchip.com>
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "mpfs.dtsi"
|
||||
#include "mpfs-m100pfs-fabric.dtsi"
|
||||
|
||||
/* Clock frequency (in Hz) of the rtcclk */
|
||||
#define MTIMER_FREQ 1000000
|
||||
|
||||
/ {
|
||||
model = "Aries Embedded M100PFEVPS";
|
||||
compatible = "aries,m100pfsevp", "microchip,mpfs";
|
||||
|
||||
aliases {
|
||||
ethernet0 = &mac0;
|
||||
ethernet1 = &mac1;
|
||||
serial0 = &mmuart0;
|
||||
serial1 = &mmuart1;
|
||||
serial2 = &mmuart2;
|
||||
serial3 = &mmuart3;
|
||||
serial4 = &mmuart4;
|
||||
gpio0 = &gpio0;
|
||||
gpio1 = &gpio2;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial1:115200n8";
|
||||
};
|
||||
|
||||
cpus {
|
||||
timebase-frequency = <MTIMER_FREQ>;
|
||||
};
|
||||
|
||||
ddrc_cache_lo: memory@80000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x0 0x80000000 0x0 0x40000000>;
|
||||
};
|
||||
ddrc_cache_hi: memory@1040000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x10 0x40000000 0x0 0x40000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&can0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
interrupts = <13>, <14>, <15>, <16>,
|
||||
<17>, <18>, <19>, <20>,
|
||||
<21>, <22>, <23>, <24>,
|
||||
<25>, <26>;
|
||||
ngpios = <14>;
|
||||
status = "okay";
|
||||
|
||||
pmic-irq-hog {
|
||||
gpio-hog;
|
||||
gpios = <13 0>;
|
||||
input;
|
||||
};
|
||||
|
||||
/* Set to low for eMMC, high for SD-card */
|
||||
mmc-sel-hog {
|
||||
gpio-hog;
|
||||
gpios = <12 0>;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
&gpio2 {
|
||||
interrupts = <13>, <14>, <15>, <16>,
|
||||
<17>, <18>, <19>, <20>,
|
||||
<21>, <22>, <23>, <24>,
|
||||
<25>, <26>, <27>, <28>,
|
||||
<29>, <30>, <31>, <32>,
|
||||
<33>, <34>, <35>, <36>,
|
||||
<37>, <38>, <39>, <40>,
|
||||
<41>, <42>, <43>, <44>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mac0 {
|
||||
status = "okay";
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&phy0>;
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&mac1 {
|
||||
status = "okay";
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&phy1>;
|
||||
phy1: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&mbox {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmc {
|
||||
max-frequency = <50000000>;
|
||||
bus-width = <4>;
|
||||
cap-mmc-highspeed;
|
||||
cap-sd-highspeed;
|
||||
no-1-8-v;
|
||||
sd-uhs-sdr12;
|
||||
sd-uhs-sdr25;
|
||||
sd-uhs-sdr50;
|
||||
sd-uhs-sdr104;
|
||||
disable-wp;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart3 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart4 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qspi {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&refclk {
|
||||
clock-frequency = <125000000>;
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&syscontroller {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
dr_mode = "host";
|
||||
};
|
|
@ -13,4 +13,33 @@
|
|||
#clock-cells = <0>;
|
||||
clock-frequency = <125000000>;
|
||||
};
|
||||
|
||||
pcie: pcie@2000000000 {
|
||||
compatible = "microchip,pcie-host-1.0";
|
||||
#address-cells = <0x3>;
|
||||
#interrupt-cells = <0x1>;
|
||||
#size-cells = <0x2>;
|
||||
device_type = "pci";
|
||||
reg = <0x20 0x0 0x0 0x8000000>, <0x0 0x43000000 0x0 0x10000>;
|
||||
reg-names = "cfg", "apb";
|
||||
bus-range = <0x0 0x7f>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <119>;
|
||||
interrupt-map = <0 0 0 1 &pcie_intc 0>,
|
||||
<0 0 0 2 &pcie_intc 1>,
|
||||
<0 0 0 3 &pcie_intc 2>,
|
||||
<0 0 0 4 &pcie_intc 3>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
clocks = <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>;
|
||||
clock-names = "fic0", "fic1", "fic3";
|
||||
ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>;
|
||||
msi-parent = <&pcie>;
|
||||
msi-controller;
|
||||
status = "disabled";
|
||||
pcie_intc: interrupt-controller {
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-controller;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
/* Copyright (c) 2022 Microchip Technology Inc */
|
||||
|
||||
/ {
|
||||
fabric_clk3: fabric-clk3 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <0>;
|
||||
};
|
||||
|
||||
fabric_clk1: fabric-clk1 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <125000000>;
|
||||
};
|
||||
|
||||
pcie: pcie@2000000000 {
|
||||
compatible = "microchip,pcie-host-1.0";
|
||||
#address-cells = <0x3>;
|
||||
#interrupt-cells = <0x1>;
|
||||
#size-cells = <0x2>;
|
||||
device_type = "pci";
|
||||
reg = <0x20 0x0 0x0 0x8000000>, <0x0 0x43000000 0x0 0x10000>;
|
||||
reg-names = "cfg", "apb";
|
||||
bus-range = <0x0 0x7f>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <119>;
|
||||
interrupt-map = <0 0 0 1 &pcie_intc 0>,
|
||||
<0 0 0 2 &pcie_intc 1>,
|
||||
<0 0 0 3 &pcie_intc 2>,
|
||||
<0 0 0 4 &pcie_intc 3>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
clocks = <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>;
|
||||
clock-names = "fic0", "fic1", "fic3";
|
||||
ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>;
|
||||
msi-parent = <&pcie>;
|
||||
msi-controller;
|
||||
status = "disabled";
|
||||
pcie_intc: interrupt-controller {
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-controller;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,145 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
/* Copyright (c) 2022 Microchip Technology Inc */
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "mpfs.dtsi"
|
||||
#include "mpfs-sev-kit-fabric.dtsi"
|
||||
|
||||
/* Clock frequency (in Hz) of the rtcclk */
|
||||
#define MTIMER_FREQ 1000000
|
||||
|
||||
/ {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
model = "Microchip PolarFire-SoC SEV Kit";
|
||||
compatible = "microchip,mpfs-sev-kit", "microchip,mpfs";
|
||||
|
||||
aliases {
|
||||
ethernet0 = &mac1;
|
||||
serial0 = &mmuart0;
|
||||
serial1 = &mmuart1;
|
||||
serial2 = &mmuart2;
|
||||
serial3 = &mmuart3;
|
||||
serial4 = &mmuart4;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial1:115200n8";
|
||||
};
|
||||
|
||||
cpus {
|
||||
timebase-frequency = <MTIMER_FREQ>;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
fabricbuf0ddrc: buffer@80000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x0 0x80000000 0x0 0x2000000>;
|
||||
};
|
||||
|
||||
fabricbuf1ddrnc: buffer@c4000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x0 0xc4000000 0x0 0x4000000>;
|
||||
};
|
||||
|
||||
fabricbuf2ddrncwcb: buffer@d4000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x0 0xd4000000 0x0 0x4000000>;
|
||||
};
|
||||
};
|
||||
|
||||
ddrc_cache: memory@1000000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x10 0x0 0x0 0x76000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio2 {
|
||||
interrupts = <53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mac0 {
|
||||
status = "okay";
|
||||
phy-mode = "sgmii";
|
||||
phy-handle = <&phy0>;
|
||||
phy1: ethernet-phy@9 {
|
||||
reg = <9>;
|
||||
};
|
||||
phy0: ethernet-phy@8 {
|
||||
reg = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
&mac1 {
|
||||
status = "okay";
|
||||
phy-mode = "sgmii";
|
||||
phy-handle = <&phy1>;
|
||||
};
|
||||
|
||||
&mbox {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmc {
|
||||
status = "okay";
|
||||
bus-width = <4>;
|
||||
disable-wp;
|
||||
cap-sd-highspeed;
|
||||
cap-mmc-highspeed;
|
||||
mmc-ddr-1_8v;
|
||||
mmc-hs200-1_8v;
|
||||
sd-uhs-sdr12;
|
||||
sd-uhs-sdr25;
|
||||
sd-uhs-sdr50;
|
||||
sd-uhs-sdr104;
|
||||
};
|
||||
|
||||
&mmuart1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart3 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmuart4 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&refclk {
|
||||
clock-frequency = <125000000>;
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&syscontroller {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
dr_mode = "otg";
|
||||
};
|
|
@ -330,7 +330,7 @@
|
|||
};
|
||||
|
||||
qspi: spi@21000000 {
|
||||
compatible = "microchip,mpfs-qspi";
|
||||
compatible = "microchip,mpfs-qspi", "microchip,coreqspi-rtl-v2";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x0 0x21000000 0x0 0x1000>;
|
||||
|
@ -464,35 +464,6 @@
|
|||
status = "disabled";
|
||||
};
|
||||
|
||||
pcie: pcie@2000000000 {
|
||||
compatible = "microchip,pcie-host-1.0";
|
||||
#address-cells = <0x3>;
|
||||
#interrupt-cells = <0x1>;
|
||||
#size-cells = <0x2>;
|
||||
device_type = "pci";
|
||||
reg = <0x20 0x0 0x0 0x8000000>, <0x0 0x43000000 0x0 0x10000>;
|
||||
reg-names = "cfg", "apb";
|
||||
bus-range = <0x0 0x7f>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <119>;
|
||||
interrupt-map = <0 0 0 1 &pcie_intc 0>,
|
||||
<0 0 0 2 &pcie_intc 1>,
|
||||
<0 0 0 3 &pcie_intc 2>,
|
||||
<0 0 0 4 &pcie_intc 3>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
clocks = <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>;
|
||||
clock-names = "fic0", "fic1", "fic3";
|
||||
ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>;
|
||||
msi-parent = <&pcie>;
|
||||
msi-controller;
|
||||
status = "disabled";
|
||||
pcie_intc: interrupt-controller {
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-controller;
|
||||
};
|
||||
};
|
||||
|
||||
mbox: mailbox@37020000 {
|
||||
compatible = "microchip,mpfs-mailbox";
|
||||
reg = <0x0 0x37020000 0x0 0x1000>, <0x0 0x2000318C 0x0 0x40>;
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
static bool errata_probe_pbmt(unsigned int stage,
|
||||
unsigned long arch_id, unsigned long impid)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_ERRATA_THEAD_PBMT))
|
||||
return false;
|
||||
|
||||
if (arch_id != 0 || impid != 0)
|
||||
return false;
|
||||
|
||||
|
@ -30,7 +33,9 @@ static bool errata_probe_pbmt(unsigned int stage,
|
|||
static bool errata_probe_cmo(unsigned int stage,
|
||||
unsigned long arch_id, unsigned long impid)
|
||||
{
|
||||
#ifdef CONFIG_ERRATA_THEAD_CMO
|
||||
if (!IS_ENABLED(CONFIG_ERRATA_THEAD_CMO))
|
||||
return false;
|
||||
|
||||
if (arch_id != 0 || impid != 0)
|
||||
return false;
|
||||
|
||||
|
@ -40,9 +45,6 @@ static bool errata_probe_cmo(unsigned int stage,
|
|||
riscv_cbom_block_size = L1_CACHE_BYTES;
|
||||
riscv_noncoherent_supported();
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static u32 thead_errata_probe(unsigned int stage,
|
||||
|
@ -51,10 +53,10 @@ static u32 thead_errata_probe(unsigned int stage,
|
|||
u32 cpu_req_errata = 0;
|
||||
|
||||
if (errata_probe_pbmt(stage, archid, impid))
|
||||
cpu_req_errata |= (1U << ERRATA_THEAD_PBMT);
|
||||
cpu_req_errata |= BIT(ERRATA_THEAD_PBMT);
|
||||
|
||||
if (errata_probe_cmo(stage, archid, impid))
|
||||
cpu_req_errata |= (1U << ERRATA_THEAD_CMO);
|
||||
cpu_req_errata |= BIT(ERRATA_THEAD_CMO);
|
||||
|
||||
return cpu_req_errata;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ static inline void riscv_init_cbom_blocksize(void) { }
|
|||
|
||||
#ifdef CONFIG_RISCV_DMA_NONCOHERENT
|
||||
void riscv_noncoherent_supported(void);
|
||||
#else
|
||||
static inline void riscv_noncoherent_supported(void) {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -99,6 +99,10 @@ do { \
|
|||
get_cache_size(2, CACHE_TYPE_UNIFIED)); \
|
||||
NEW_AUX_ENT(AT_L2_CACHEGEOMETRY, \
|
||||
get_cache_geometry(2, CACHE_TYPE_UNIFIED)); \
|
||||
NEW_AUX_ENT(AT_L3_CACHESIZE, \
|
||||
get_cache_size(3, CACHE_TYPE_UNIFIED)); \
|
||||
NEW_AUX_ENT(AT_L3_CACHEGEOMETRY, \
|
||||
get_cache_geometry(3, CACHE_TYPE_UNIFIED)); \
|
||||
} while (0)
|
||||
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
|
||||
struct linux_binprm;
|
||||
|
|
|
@ -101,9 +101,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar(addr))
|
|||
__io_reads_ins(ins, u8, b, __io_pbr(), __io_par(addr))
|
||||
__io_reads_ins(ins, u16, w, __io_pbr(), __io_par(addr))
|
||||
__io_reads_ins(ins, u32, l, __io_pbr(), __io_par(addr))
|
||||
#define insb(addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count)
|
||||
#define insw(addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count)
|
||||
#define insl(addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count)
|
||||
#define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count)
|
||||
#define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count)
|
||||
#define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
|
||||
|
||||
__io_writes_outs(writes, u8, b, __io_bw(), __io_aw())
|
||||
__io_writes_outs(writes, u16, w, __io_bw(), __io_aw())
|
||||
|
@ -115,22 +115,22 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw())
|
|||
__io_writes_outs(outs, u8, b, __io_pbw(), __io_paw())
|
||||
__io_writes_outs(outs, u16, w, __io_pbw(), __io_paw())
|
||||
__io_writes_outs(outs, u32, l, __io_pbw(), __io_paw())
|
||||
#define outsb(addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count)
|
||||
#define outsw(addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count)
|
||||
#define outsl(addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count)
|
||||
#define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count)
|
||||
#define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count)
|
||||
#define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
__io_reads_ins(reads, u64, q, __io_br(), __io_ar(addr))
|
||||
#define readsq(addr, buffer, count) __readsq(addr, buffer, count)
|
||||
|
||||
__io_reads_ins(ins, u64, q, __io_pbr(), __io_par(addr))
|
||||
#define insq(addr, buffer, count) __insq((void __iomem *)addr, buffer, count)
|
||||
#define insq(addr, buffer, count) __insq(PCI_IOBASE + (addr), buffer, count)
|
||||
|
||||
__io_writes_outs(writes, u64, q, __io_bw(), __io_aw())
|
||||
#define writesq(addr, buffer, count) __writesq(addr, buffer, count)
|
||||
|
||||
__io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
|
||||
#define outsq(addr, buffer, count) __outsq((void __iomem *)addr, buffer, count)
|
||||
#define outsq(addr, buffer, count) __outsq(PCI_IOBASE + (addr), buffer, count)
|
||||
#endif
|
||||
|
||||
#include <asm-generic/io.h>
|
||||
|
|
|
@ -16,7 +16,6 @@ typedef struct {
|
|||
atomic_long_t id;
|
||||
#endif
|
||||
void *vdso;
|
||||
void *vdso_info;
|
||||
#ifdef CONFIG_SMP
|
||||
/* A local icache flush is needed before user execution can resume. */
|
||||
cpumask_t icache_stale_mask;
|
||||
|
|
|
@ -30,8 +30,10 @@
|
|||
#define AT_L1D_CACHEGEOMETRY 43
|
||||
#define AT_L2_CACHESIZE 44
|
||||
#define AT_L2_CACHEGEOMETRY 45
|
||||
#define AT_L3_CACHESIZE 46
|
||||
#define AT_L3_CACHEGEOMETRY 47
|
||||
|
||||
/* entries in ARCH_DLINFO */
|
||||
#define AT_VECTOR_SIZE_ARCH 7
|
||||
#define AT_VECTOR_SIZE_ARCH 9
|
||||
|
||||
#endif /* _UAPI_ASM_RISCV_AUXVEC_H */
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
* Copyright (C) 2012 Regents of the University of California
|
||||
*/
|
||||
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/of.h>
|
||||
#include <asm/csr.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/sbi.h>
|
||||
#include <asm/smp.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
|
@ -68,6 +71,50 @@ int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
||||
struct riscv_cpuinfo {
|
||||
unsigned long mvendorid;
|
||||
unsigned long marchid;
|
||||
unsigned long mimpid;
|
||||
};
|
||||
static DEFINE_PER_CPU(struct riscv_cpuinfo, riscv_cpuinfo);
|
||||
|
||||
static int riscv_cpuinfo_starting(unsigned int cpu)
|
||||
{
|
||||
struct riscv_cpuinfo *ci = this_cpu_ptr(&riscv_cpuinfo);
|
||||
|
||||
#if IS_ENABLED(CONFIG_RISCV_SBI)
|
||||
ci->mvendorid = sbi_spec_is_0_1() ? 0 : sbi_get_mvendorid();
|
||||
ci->marchid = sbi_spec_is_0_1() ? 0 : sbi_get_marchid();
|
||||
ci->mimpid = sbi_spec_is_0_1() ? 0 : sbi_get_mimpid();
|
||||
#elif IS_ENABLED(CONFIG_RISCV_M_MODE)
|
||||
ci->mvendorid = csr_read(CSR_MVENDORID);
|
||||
ci->marchid = csr_read(CSR_MARCHID);
|
||||
ci->mimpid = csr_read(CSR_MIMPID);
|
||||
#else
|
||||
ci->mvendorid = 0;
|
||||
ci->marchid = 0;
|
||||
ci->mimpid = 0;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init riscv_cpuinfo_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "riscv/cpuinfo:starting",
|
||||
riscv_cpuinfo_starting, NULL);
|
||||
if (ret < 0) {
|
||||
pr_err("cpuinfo: failed to register hotplug callbacks.\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
device_initcall(riscv_cpuinfo_init);
|
||||
|
||||
#define __RISCV_ISA_EXT_DATA(UPROP, EXTID) \
|
||||
{ \
|
||||
.uprop = #UPROP, \
|
||||
|
@ -186,6 +233,7 @@ static int c_show(struct seq_file *m, void *v)
|
|||
{
|
||||
unsigned long cpu_id = (unsigned long)v - 1;
|
||||
struct device_node *node = of_get_cpu_node(cpu_id, NULL);
|
||||
struct riscv_cpuinfo *ci = per_cpu_ptr(&riscv_cpuinfo, cpu_id);
|
||||
const char *compat, *isa;
|
||||
|
||||
seq_printf(m, "processor\t: %lu\n", cpu_id);
|
||||
|
@ -196,6 +244,9 @@ static int c_show(struct seq_file *m, void *v)
|
|||
if (!of_property_read_string(node, "compatible", &compat)
|
||||
&& strcmp(compat, "riscv"))
|
||||
seq_printf(m, "uarch\t\t: %s\n", compat);
|
||||
seq_printf(m, "mvendorid\t: 0x%lx\n", ci->mvendorid);
|
||||
seq_printf(m, "marchid\t\t: 0x%lx\n", ci->marchid);
|
||||
seq_printf(m, "mimpid\t\t: 0x%lx\n", ci->mimpid);
|
||||
seq_puts(m, "\n");
|
||||
of_node_put(node);
|
||||
|
||||
|
|
|
@ -254,35 +254,28 @@ void __init riscv_fill_hwcap(void)
|
|||
#ifdef CONFIG_RISCV_ALTERNATIVE
|
||||
static bool __init_or_module cpufeature_probe_svpbmt(unsigned int stage)
|
||||
{
|
||||
#ifdef CONFIG_RISCV_ISA_SVPBMT
|
||||
switch (stage) {
|
||||
case RISCV_ALTERNATIVES_EARLY_BOOT:
|
||||
if (!IS_ENABLED(CONFIG_RISCV_ISA_SVPBMT))
|
||||
return false;
|
||||
default:
|
||||
return riscv_isa_extension_available(NULL, SVPBMT);
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
|
||||
return false;
|
||||
|
||||
return riscv_isa_extension_available(NULL, SVPBMT);
|
||||
}
|
||||
|
||||
static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage)
|
||||
{
|
||||
#ifdef CONFIG_RISCV_ISA_ZICBOM
|
||||
switch (stage) {
|
||||
case RISCV_ALTERNATIVES_EARLY_BOOT:
|
||||
if (!IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM))
|
||||
return false;
|
||||
default:
|
||||
if (riscv_isa_extension_available(NULL, ZICBOM)) {
|
||||
riscv_noncoherent_supported();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
|
||||
return false;
|
||||
|
||||
if (!riscv_isa_extension_available(NULL, ZICBOM))
|
||||
return false;
|
||||
|
||||
riscv_noncoherent_supported();
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -297,10 +290,10 @@ static u32 __init_or_module cpufeature_probe(unsigned int stage)
|
|||
u32 cpu_req_feature = 0;
|
||||
|
||||
if (cpufeature_probe_svpbmt(stage))
|
||||
cpu_req_feature |= (1U << CPUFEATURE_SVPBMT);
|
||||
cpu_req_feature |= BIT(CPUFEATURE_SVPBMT);
|
||||
|
||||
if (cpufeature_probe_zicbom(stage))
|
||||
cpu_req_feature |= (1U << CPUFEATURE_ZICBOM);
|
||||
cpu_req_feature |= BIT(CPUFEATURE_ZICBOM);
|
||||
|
||||
return cpu_req_feature;
|
||||
}
|
||||
|
|
|
@ -252,10 +252,10 @@ static void __init parse_dtb(void)
|
|||
pr_info("Machine model: %s\n", name);
|
||||
dump_stack_set_arch_desc("%s (DT)", name);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
pr_err("No DTB passed to the kernel\n");
|
||||
}
|
||||
|
||||
pr_err("No DTB passed to the kernel\n");
|
||||
#ifdef CONFIG_CMDLINE_FORCE
|
||||
strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
|
||||
pr_info("Forcing kernel command line to: %s\n", boot_command_line);
|
||||
|
|
|
@ -18,9 +18,6 @@ static long riscv_sys_mmap(unsigned long addr, unsigned long len,
|
|||
if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
|
||||
return -EINVAL;
|
||||
|
||||
if (unlikely((prot & PROT_WRITE) && !(prot & PROT_READ)))
|
||||
return -EINVAL;
|
||||
|
||||
return ksys_mmap_pgoff(addr, len, prot, flags, fd,
|
||||
offset >> (PAGE_SHIFT - page_shift_offset));
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue