mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.3-rc4
Cross-merge BPF and other fixes after downstream PR. Conflicts: kernel/bpf/helpers.c tools/testing/selftests/bpf/prog_tests/cb_refs.c tools/testing/selftests/bpf/prog_tests/verifier.c Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
commit
0e4cf80d0d
|
|
@ -4,6 +4,8 @@ Alyssa Rosenzweig <alyssa@rosenzweig.io>
|
|||
Askar Safin <safinaskar@gmail.com>
|
||||
Christoph Hellwig <hch@lst.de>
|
||||
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Johannes Berg <johannes@sipsolutions.net>
|
||||
Marc Gonzalez <marc.w.gonzalez@free.fr>
|
||||
Nathan Chancellor <nathan@kernel.org>
|
||||
Ralf Baechle <ralf@linux-mips.org>
|
||||
|
|
|
|||
12
.mailmap
12
.mailmap
|
|
@ -211,7 +211,8 @@ Christophe Leroy <chleroy@kernel.org> <christophe.leroy@c-s.fr>
|
|||
Christophe Leroy <chleroy@kernel.org> <christophe.leroy@csgroup.eu>
|
||||
Christophe Leroy <chleroy@kernel.org> <christophe.leroy2@cs-soprasteria.com>
|
||||
Christophe Ricard <christophe.ricard@gmail.com>
|
||||
Christopher Obbard <christopher.obbard@linaro.org> <chris.obbard@collabora.com>
|
||||
Christopher Obbard <chris.obbard@oss.qualcomm.com> <chris.obbard@collabora.com>
|
||||
Christopher Obbard <chris.obbard@oss.qualcomm.com> <christopher.obbard@linaro.org>
|
||||
Christoph Hellwig <hch@lst.de>
|
||||
Christoph Manszewski <c.manszewski@gmail.com> <christoph.manszewski@intel.com>
|
||||
Christoph Paasch <cpaasch@openai.com> <christoph.paasch@gmail.com>
|
||||
|
|
@ -222,6 +223,7 @@ Chuck Lever <cel@kernel.org> <chuck.lever@oracle.com>
|
|||
Chuck Lever <cel@kernel.org> <cel@netapp.com>
|
||||
Chuck Lever <cel@kernel.org> <cel@citi.umich.edu>
|
||||
Claudiu Beznea <claudiu.beznea@tuxon.dev> <claudiu.beznea@microchip.com>
|
||||
Coiby Xu <coiby.xu@gmail.com> <coxu@redhat.com>
|
||||
Colin Ian King <colin.i.king@gmail.com> <colin.king@canonical.com>
|
||||
Corey Minyard <minyard@acm.org>
|
||||
Damian Hobson-Garcia <dhobsong@igel.co.jp>
|
||||
|
|
@ -353,6 +355,8 @@ Hans Verkuil <hverkuil@kernel.org> <hverkuil-cisco@xs4all.nl>
|
|||
Hans Verkuil <hverkuil@kernel.org> <hansverk@cisco.com>
|
||||
Hans Verkuil <hverkuil@kernel.org> <hans.verkuil@cisco.com>
|
||||
Hao Ge <hao.ge@linux.dev> <gehao@kylinos.cn>
|
||||
Haowen Bai <baihaowen88@gmail.com> <baihaowen@meizu.com>
|
||||
Haowen Bai <baihaowen88@gmail.com> <calvin.bai@ugreen.com>
|
||||
Harry Yoo <harry.yoo@oracle.com> <42.hyeyoo@gmail.com>
|
||||
Harry Yoo <harry@kernel.org> <harry.yoo@oracle.com>
|
||||
Heiko Carstens <hca@linux.ibm.com> <h.carstens@de.ibm.com>
|
||||
|
|
@ -421,6 +425,7 @@ Jens Axboe <axboe@kernel.dk> <axboe@suse.de>
|
|||
Jens Axboe <axboe@kernel.dk> <jens.axboe@oracle.com>
|
||||
Jens Axboe <axboe@kernel.dk> <axboe@fb.com>
|
||||
Jens Axboe <axboe@kernel.dk> <axboe@meta.com>
|
||||
Jens Axboe <axboe@kernel.dk> <axboe@anthropic.com>
|
||||
Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
|
||||
Jens Wiklander <jenswi@kernel.org> <jens.wiklander@linaro.org>
|
||||
Jernej Skrabec <jernej.skrabec@gmail.com> <jernej.skrabec@siol.net>
|
||||
|
|
@ -551,6 +556,9 @@ Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org>
|
|||
Lior David <quic_liord@quicinc.com> <liord@codeaurora.org>
|
||||
Loic Poulain <loic.poulain@oss.qualcomm.com> <loic.poulain@linaro.org>
|
||||
Loic Poulain <loic.poulain@oss.qualcomm.com> <loic.poulain@intel.com>
|
||||
Lorenzo Bianconi <lorenzo@kernel.org> <lorenzo.bianconi@redhat.com>
|
||||
Lorenzo Bianconi <lorenzo@kernel.org> <lorenzo.bianconi@st.com>
|
||||
Lorenzo Bianconi <lorenzo@kernel.org> <lorenzo.bianconi83@gmail.com>
|
||||
Lorenzo Pieralisi <lpieralisi@kernel.org> <lorenzo.pieralisi@arm.com>
|
||||
Lorenzo Stoakes <ljs@kernel.org> <lstoakes@gmail.com>
|
||||
Lorenzo Stoakes <ljs@kernel.org> <lorenzo.stoakes@oracle.com>
|
||||
|
|
@ -976,6 +984,8 @@ Wesley Cheng <quic_wcheng@quicinc.com> <wcheng@codeaurora.org>
|
|||
Will Deacon <will@kernel.org> <will.deacon@arm.com>
|
||||
Wolfram Sang <wsa@kernel.org> <w.sang@pengutronix.de>
|
||||
Wolfram Sang <wsa@kernel.org> <wsa@the-dreams.de>
|
||||
Xu Xin <xu.xin@linux.dev> <xu.xin16@zte.com.cn>
|
||||
Xu Xin <xu.xin@linux.dev> xu xin <cgel.zte@gmail.com>
|
||||
Yakir Yang <kuankuan.y@gmail.com> <ykk@rock-chips.com>
|
||||
Yanteng Si <si.yanteng@linux.dev> <siyanteng@loongson.cn>
|
||||
Ying Huang <huang.ying.caritas@gmail.com> <ying.huang@intel.com>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Contact: linux-input@vger.kernel.org
|
|||
Description:
|
||||
(RW) Trackpoint sensitivity.
|
||||
|
||||
What: /sys/devices/platform/i8042/.../intertia
|
||||
What: /sys/devices/platform/i8042/.../inertia
|
||||
Date: Aug, 2005
|
||||
KernelVersion: 2.6.14
|
||||
Contact: linux-input@vger.kernel.org
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Description: Shows all enabled kernel features.
|
|||
Supported features:
|
||||
compr_cfgs, big_pcluster, chunked_file, device_table,
|
||||
compr_head2, sb_chksum, ztailpacking, dedupe, fragments,
|
||||
48bit, metabox.
|
||||
xattr_prefixes, 48bit, metabox.
|
||||
|
||||
What: /sys/fs/erofs/<disk>/sync_decompress
|
||||
Date: November 2021
|
||||
|
|
|
|||
|
|
@ -589,6 +589,9 @@ Kernel parameters
|
|||
arm64.nosve [ARM64] Unconditionally disable Scalable Vector
|
||||
Extension support
|
||||
|
||||
arm64.nowfxt [ARM64] Unconditionally disable Wait For Event with
|
||||
Timeout and Wait For Interrupt with Timeout support
|
||||
|
||||
ataflop= [HW,M68k]
|
||||
|
||||
atarimouse= [HW,MOUSE] Atari Mouse
|
||||
|
|
@ -5003,18 +5006,6 @@ Kernel parameters
|
|||
Set to non-zero if a chip is present that snoops speed
|
||||
changes. Disabled by default.
|
||||
|
||||
pata_legacy.ht6560a= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for HT 6560A on the primary channel,
|
||||
the secondary channel, or both channels respectively.
|
||||
Disabled by default.
|
||||
|
||||
pata_legacy.ht6560b= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for HT 6560B on the primary channel,
|
||||
the secondary channel, or both channels respectively.
|
||||
Disabled by default.
|
||||
|
||||
pata_legacy.iordy_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
IORDY enable mask. Set individual bits to allow IORDY
|
||||
|
|
@ -5027,18 +5018,6 @@ Kernel parameters
|
|||
with the sequence. By default IORDY is allowed across
|
||||
all channels.
|
||||
|
||||
pata_legacy.opti82c46x= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for Opti 82c611A on the primary
|
||||
channel, the secondary channel, or both channels
|
||||
respectively. Disabled by default.
|
||||
|
||||
pata_legacy.opti82c611a= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to 1, 2, or 3 for Opti 82c465MV on the primary
|
||||
channel, the secondary channel, or both channels
|
||||
respectively. Disabled by default.
|
||||
|
||||
pata_legacy.pio_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
PIO mode mask for autospeed devices. Set individual
|
||||
|
|
@ -5062,19 +5041,6 @@ Kernel parameters
|
|||
the first port in the list above (0x1f0), and so on.
|
||||
By default all supported ports are probed.
|
||||
|
||||
pata_legacy.qdi= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero to probe QDI controllers. By default
|
||||
set to 1 if CONFIG_PATA_QDI_MODULE, 0 otherwise.
|
||||
|
||||
pata_legacy.winbond= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Set to non-zero to probe Winbond controllers. Use
|
||||
the standard I/O port (0x130) if 1, otherwise the
|
||||
value given is the I/O port to use (typically 0x1b0).
|
||||
By default set to 1 if CONFIG_PATA_WINBOND_VLB_MODULE,
|
||||
0 otherwise.
|
||||
|
||||
pata_platform.pio_mask= [HW,LIBATA]
|
||||
Format: <int>
|
||||
Supported PIO mode mask. Set individual bits to allow
|
||||
|
|
|
|||
|
|
@ -1416,7 +1416,7 @@ Controls whether userspace may arm Syscall User Dispatch via
|
|||
== ===================================================================
|
||||
|
||||
Only present when the kernel is built with ``CONFIG_SYSCALL_USER_DISPATCH``
|
||||
and ``CONFIG_PROC_SYSCTL``.
|
||||
and ``CONFIG_SYSCTL``.
|
||||
|
||||
|
||||
sysctl_writes_strict
|
||||
|
|
|
|||
|
|
@ -465,6 +465,7 @@ Before jumping into the kernel, the following conditions must be met:
|
|||
- HDFGWTR2_EL2.nPMICNTR_EL0 (bit 2) must be initialised to 0b1.
|
||||
- HDFGWTR2_EL2.nPMICFILTR_EL0 (bit 3) must be initialised to 0b1.
|
||||
- HDFGWTR2_EL2.nPMUACR_EL1 (bit 4) must be initialised to 0b1.
|
||||
- HDFGWTR2_EL2.nPMZR_EL0 (bit 21) must be initialised to 0b1.
|
||||
|
||||
For CPUs with SPE data source filtering (FEAT_SPE_FDS):
|
||||
|
||||
|
|
|
|||
|
|
@ -208,11 +208,10 @@ will use the corresponding aligned address.
|
|||
tracer's space cannot be accessed or does not have valid tags.
|
||||
- ``-EPERM`` - the specified process cannot be traced.
|
||||
- ``-EIO`` - the tracee's address range cannot be accessed (e.g. invalid
|
||||
address) and no tags copied. ``iov_len`` not updated.
|
||||
address) or does not have valid tags (not mapped with the ``PROT_MTE``
|
||||
flag) and no tags copied. ``iov_len`` not updated.
|
||||
- ``-EFAULT`` - fault on accessing the tracer's memory (``struct iovec``
|
||||
or ``iov_base`` buffer) and no tags copied. ``iov_len`` not updated.
|
||||
- ``-EOPNOTSUPP`` - the tracee's address does not have valid tags (never
|
||||
mapped with the ``PROT_MTE`` flag). ``iov_len`` not updated.
|
||||
|
||||
**Note**: There are no transient errors for the requests above, so user
|
||||
programs should not retry in case of a non-zero system call return.
|
||||
|
|
|
|||
|
|
@ -155,7 +155,8 @@ The following keys are defined:
|
|||
defined in version 1.0 of the RISC-V Cryptography Extensions Volume II.
|
||||
|
||||
* :c:macro:`RISCV_HWPROBE_EXT_ZFH`: The Zfh extension version 1.0 is supported
|
||||
as defined in the RISC-V ISA manual.
|
||||
as defined in the RISC-V ISA manual. Zfh is a superset of Zfhmin, so
|
||||
RISCV_HWPROBE_EXT_ZFHMIN is reported whenever RISCV_HWPROBE_EXT_ZFH is.
|
||||
|
||||
* :c:macro:`RISCV_HWPROBE_EXT_ZFHMIN`: The Zfhmin extension version 1.0 is
|
||||
supported as defined in the RISC-V ISA manual.
|
||||
|
|
@ -164,8 +165,9 @@ The following keys are defined:
|
|||
is supported as defined in the RISC-V ISA manual.
|
||||
|
||||
* :c:macro:`RISCV_HWPROBE_EXT_ZVFH`: The Zvfh extension is supported as
|
||||
defined in the RISC-V Vector manual starting from commit e2ccd0548d6c
|
||||
("Remove draft warnings from Zvfh[min]").
|
||||
defined in the RISC-V Vector manual starting from commit e2ccd0548d6c
|
||||
("Remove draft warnings from Zvfh[min]"). Zvfh is a superset of Zvfhmin,
|
||||
so RISCV_HWPROBE_EXT_ZVFHMIN is reported whenever RISCV_HWPROBE_EXT_ZVFH is.
|
||||
|
||||
* :c:macro:`RISCV_HWPROBE_EXT_ZVFHMIN`: The Zvfhmin extension is supported as
|
||||
defined in the RISC-V Vector manual starting from commit e2ccd0548d6c
|
||||
|
|
|
|||
|
|
@ -522,6 +522,16 @@ Example usage in BPF program:
|
|||
/* note that the last argument is omitted */
|
||||
bpf_task_work_schedule_signal(task, &work->tw, &arrmap, task_work_callback);
|
||||
|
||||
2.5.10 KF_PERFMON flag
|
||||
----------------------
|
||||
|
||||
The KF_PERFMON flag is used for kfuncs that can expose kernel memory or kernel
|
||||
addresses to the BPF program, for example by reading through a pointer that the
|
||||
verifier does not check. Calling such a kfunc requires CAP_PERFMON, or
|
||||
CAP_SYS_ADMIN, in the same way that the equivalent BPF helpers are gated in
|
||||
bpf_base_func_proto(). A program loaded with CAP_BPF alone is rejected at load
|
||||
time.
|
||||
|
||||
2.6 Registering the kfuncs
|
||||
--------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ examples:
|
|||
reg = <0>;
|
||||
|
||||
dpu_intf0_out: endpoint {
|
||||
remote-endpoint = <&mdss_dp0_in>;
|
||||
remote-endpoint = <&mdss_dp0_in>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -352,9 +352,9 @@ examples:
|
|||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
reg = <1>;
|
||||
|
||||
mdss_dp_out: endpoint { };
|
||||
mdss_dp_out: endpoint { };
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -248,9 +248,9 @@ examples:
|
|||
remote-endpoint = <&usb_dp_qmpphy_dp_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp_opp_table: opp-table {
|
||||
dp_opp_table: opp-table {
|
||||
compatible = "operating-points-v2";
|
||||
|
||||
opp-162000000 {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ examples:
|
|||
port@1 {
|
||||
reg = <1>;
|
||||
dpu_intf1_out: endpoint {
|
||||
remote-endpoint = <&mdss_dsi0_in>;
|
||||
remote-endpoint = <&mdss_dsi0_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -90,18 +90,18 @@ examples:
|
|||
compatible = "operating-points-v2";
|
||||
|
||||
opp-19200000 {
|
||||
opp-hz = /bits/ 64 <19200000>;
|
||||
required-opps = <&rpmhpd_opp_low_svs>;
|
||||
opp-hz = /bits/ 64 <19200000>;
|
||||
required-opps = <&rpmhpd_opp_low_svs>;
|
||||
};
|
||||
|
||||
opp-25600000 {
|
||||
opp-hz = /bits/ 64 <25600000>;
|
||||
required-opps = <&rpmhpd_opp_svs>;
|
||||
opp-hz = /bits/ 64 <25600000>;
|
||||
required-opps = <&rpmhpd_opp_svs>;
|
||||
};
|
||||
|
||||
opp-307200000 {
|
||||
opp-hz = /bits/ 64 <307200000>;
|
||||
required-opps = <&rpmhpd_opp_nom>;
|
||||
opp-hz = /bits/ 64 <307200000>;
|
||||
required-opps = <&rpmhpd_opp_nom>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ examples:
|
|||
phys = <&mdss_dsi0_phy>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
|
|
|
|||
|
|
@ -208,47 +208,47 @@ examples:
|
|||
#sound-dai-cells = <0>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
|
||||
mdss_dp0_in: endpoint {
|
||||
remote-endpoint = <&mdss_intf0_out>;
|
||||
};
|
||||
};
|
||||
mdss_dp0_in: endpoint {
|
||||
remote-endpoint = <&mdss_intf0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
|
||||
mdss_dp0_out: endpoint {
|
||||
};
|
||||
};
|
||||
mdss_dp0_out: endpoint {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mdss_dp0_opp_table: opp-table {
|
||||
compatible = "operating-points-v2";
|
||||
compatible = "operating-points-v2";
|
||||
|
||||
opp-160000000 {
|
||||
opp-hz = /bits/ 64 <160000000>;
|
||||
required-opps = <&rpmhpd_opp_low_svs>;
|
||||
};
|
||||
opp-160000000 {
|
||||
opp-hz = /bits/ 64 <160000000>;
|
||||
required-opps = <&rpmhpd_opp_low_svs>;
|
||||
};
|
||||
|
||||
opp-270000000 {
|
||||
opp-hz = /bits/ 64 <270000000>;
|
||||
required-opps = <&rpmhpd_opp_svs>;
|
||||
};
|
||||
opp-270000000 {
|
||||
opp-hz = /bits/ 64 <270000000>;
|
||||
required-opps = <&rpmhpd_opp_svs>;
|
||||
};
|
||||
|
||||
opp-540000000 {
|
||||
opp-hz = /bits/ 64 <540000000>;
|
||||
required-opps = <&rpmhpd_opp_svs_l1>;
|
||||
};
|
||||
opp-540000000 {
|
||||
opp-hz = /bits/ 64 <540000000>;
|
||||
required-opps = <&rpmhpd_opp_svs_l1>;
|
||||
};
|
||||
|
||||
opp-810000000 {
|
||||
opp-hz = /bits/ 64 <810000000>;
|
||||
required-opps = <&rpmhpd_opp_nom>;
|
||||
};
|
||||
opp-810000000 {
|
||||
opp-hz = /bits/ 64 <810000000>;
|
||||
required-opps = <&rpmhpd_opp_nom>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ properties:
|
|||
- const: mediatek,mt6779-keypad
|
||||
- items:
|
||||
- enum:
|
||||
- mediatek,mt6572-keypad
|
||||
- mediatek,mt6873-keypad
|
||||
- mediatek,mt8183-keypad
|
||||
- mediatek,mt8365-keypad
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ $defs:
|
|||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
|
||||
enum: [ aoss_cti, atest_char, atest_usb20, atest_usb21,
|
||||
enum: [ gpio, aoss_cti, atest_char, atest_usb20, atest_usb21,
|
||||
aud_intfc0_clk, aud_intfc0_data, aud_intfc0_ws,
|
||||
aud_intfc10_clk, aud_intfc10_data, aud_intfc10_ws,
|
||||
aud_intfc1_clk, aud_intfc1_data, aud_intfc1_ws,
|
||||
|
|
@ -98,9 +98,10 @@ $defs:
|
|||
pcie3_clk_req_n, phase_flag, pll_bist_sync, pll_clk_aux,
|
||||
prng_rosc0, prng_rosc1, pwrbrk_i_n, qdss, qdss_cti, qspi,
|
||||
qup0_se0, qup0_se1, qup0_se2, qup0_se3, qup0_se4, qup0_se5,
|
||||
qup1_se0, qup1_se1, qup1_se3, qup1_se2, qup1_se4, qup1_se5,
|
||||
qup1_se0, qup1_se1, qup1_se2_01, qup1_se2_23, qup1_se3_01,
|
||||
qup1_se3_23, qup1_se4, qup1_se5,
|
||||
qup1_se6, qup2_se0, qup2_se1, qup2_se2, qup2_se3, qup2_se4,
|
||||
qup2_se5, qup2_se6,
|
||||
qup2_se5, qup2_se6, qup3_se0_mira, qup3_se0_mirb,
|
||||
sailss_ospi, sdc4_clk, sdc4_cmd, sdc4_data, smb_alert,
|
||||
smb_alert_n, smb_clk, smb_dat, tb_trig_sdc4, tmess_prng0,
|
||||
tmess_prng1, tsc_timer, tsense_pwm, usb0_hs,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ properties:
|
|||
- silergy,syr827
|
||||
- silergy,syr828
|
||||
- tcs,tcs4525
|
||||
- tcs,tcs4526
|
||||
- items:
|
||||
- const: rockchip,rk8601
|
||||
- const: rockchip,rk8600
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ properties:
|
|||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description:
|
||||
VLEN/8, the vector register length in bytes. This property is required on
|
||||
thead systems where the vector register length is not identical on all harts, or
|
||||
the vlenb CSR is not available.
|
||||
thead systems where the vector register length is not identical on all
|
||||
harts, or the vlenb CSR is not available.
|
||||
|
||||
# RISC-V has multiple properties for cache op block sizes as the sizes
|
||||
# differ between individual CBO extensions
|
||||
|
|
@ -151,8 +151,8 @@ anyOf:
|
|||
- riscv,isa-base
|
||||
|
||||
dependencies:
|
||||
riscv,isa-base: [ "riscv,isa-extensions" ]
|
||||
riscv,isa-extensions: [ "riscv,isa-base" ]
|
||||
riscv,isa-base: ["riscv,isa-extensions"]
|
||||
riscv,isa-extensions: ["riscv,isa-base"]
|
||||
|
||||
required:
|
||||
- interrupt-controller
|
||||
|
|
|
|||
|
|
@ -44,6 +44,21 @@ allOf:
|
|||
else:
|
||||
properties:
|
||||
starfive,sfc-filter-syscon: false
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: ultrarisc,dp1000-spi
|
||||
then:
|
||||
properties:
|
||||
reg:
|
||||
maxItems: 1
|
||||
clocks:
|
||||
minItems: 2
|
||||
clock-names:
|
||||
minItems: 2
|
||||
required:
|
||||
- clock-names
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
|
|
@ -63,6 +78,7 @@ properties:
|
|||
- mscc,jaguar2-spi
|
||||
- sophgo,sg2042-spi
|
||||
- thead,th1520-spi
|
||||
- ultrarisc,dp1000-spi
|
||||
- const: snps,dw-apb-ssi
|
||||
- description: Vendor controllers compatible with v1.01a
|
||||
items:
|
||||
|
|
|
|||
|
|
@ -28,34 +28,44 @@ system.
|
|||
Name Description
|
||||
============= ======================
|
||||
temp1_input CPU temperature
|
||||
temp2_input Box temperature
|
||||
temp2_input Case temperature
|
||||
temp3_input Ambient temperature
|
||||
temp4_input Board temperature
|
||||
temp5_input Carrier temperature
|
||||
temp6_input Chipset temperature
|
||||
temp7_input Video temperature
|
||||
temp4_input CPU Board temperature
|
||||
temp5_input Carrier Board temperature
|
||||
temp6_input System Chipset temperature
|
||||
temp7_input Video Controller/Board temperature
|
||||
temp8_input Other temperature
|
||||
temp9_input TOPDIM temperature
|
||||
temp10_input BOTTOMDIM temperature
|
||||
in0_input CPU voltage
|
||||
temp9_input Top DIMM 0 temperature
|
||||
temp10_input Bottom DIMM 0 temperature
|
||||
temp11_input Alternate Board temperature
|
||||
temp12_input Top DIMM 1 temperature
|
||||
temp13_input Top DIMM 2 temperature
|
||||
temp14_input Top DIMM 3 temperature
|
||||
temp15_input Top DIMM 4 temperature
|
||||
temp16_input Top DIMM 5 temperature
|
||||
temp17_input Top DIMM 6 temperature
|
||||
temp18_input Top DIMM 7 temperature
|
||||
temp19_input Bottom DIMM 1 temperature
|
||||
in0_input CPU Core voltage
|
||||
in1_input DC Runtime voltage
|
||||
in2_input DC Standby voltage
|
||||
in3_input CMOS Battery voltage
|
||||
in4_input Battery voltage
|
||||
in4_input Battery Supply voltage
|
||||
in5_input AC voltage
|
||||
in6_input Other voltage
|
||||
in7_input 5V voltage
|
||||
in7_input 5V Runtime voltage
|
||||
in8_input 5V Standby voltage
|
||||
in9_input 3V3 voltage
|
||||
in9_input 3V3 Runtime voltage
|
||||
in10_input 3V3 Standby voltage
|
||||
in11_input VCore A voltage
|
||||
in12_input VCore B voltage
|
||||
in13_input 12V voltage
|
||||
curr1_input DC current
|
||||
curr2_input 5V current
|
||||
curr3_input 12V current
|
||||
in13_input 12V Runtime voltage
|
||||
in14_input 12V Standby voltage
|
||||
curr1_input DC Runtime current
|
||||
curr2_input 5V Runtime current
|
||||
curr3_input 12V Runtime current
|
||||
fan1_input CPU fan
|
||||
fan2_input Box fan
|
||||
fan2_input Case fan
|
||||
fan3_input Ambient fan
|
||||
fan4_input Chiptset fan
|
||||
fan5_input Video fan
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ pwm1_enable
|
|||
at full speed. Write "1" to set to manual, write "2" to let the EC control
|
||||
decide fan speed. Read this attribute to see current status.
|
||||
|
||||
NB:In consideration of the safety of the device, when setting to manual mode,
|
||||
NB: In consideration of the safety of the device, when setting to manual mode,
|
||||
the pwm speed will be set to the maximum value (255) by default. You can set
|
||||
a different value by writing pwm1 later.
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ register/unregister functions::
|
|||
|
||||
char *devm_hwmon_sanitize_name(struct device *dev, const char *name);
|
||||
|
||||
int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type,
|
||||
u32 attr, int channel);
|
||||
|
||||
void hwmon_lock(struct device *dev);
|
||||
void hwmon_unlock(struct device *dev);
|
||||
|
||||
|
|
@ -90,6 +93,18 @@ implemented in the driver, or debugfs functions, hwmon_lock() and hwmon_unlock()
|
|||
can be used to ensure that calls to those functions are serialized. Those
|
||||
functions also support guard() and scoped_guard() variants.
|
||||
|
||||
Drivers can call hwmon_notify_event() to notify userspace and the thermal
|
||||
subsystem when a hardware monitoring event (such as an alarm or a fault
|
||||
condition) occurs or clears. The parameters are the hwmon device, the sensor
|
||||
type, the attribute identifier associated with the event (such as
|
||||
hwmon_temp_max_alarm or hwmon_fan_fault), and the sensor channel number.
|
||||
hwmon_notify_event() generates a sysfs event (calling sysfs_notify()) and a
|
||||
udev event with the attribute name passed in the NAME environment property
|
||||
(e.g., "NAME=temp1_max_alarm"). If the event is for a temperature sensor and
|
||||
the sensor is attached to a thermal zone, it also notifies the thermal
|
||||
subsystem to update the thermal zone. hwmon_notify_event() returns 0 on
|
||||
success or a negative error code on failure.
|
||||
|
||||
Using devm_hwmon_device_register_with_info()
|
||||
--------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -898,6 +898,8 @@ attribute-sets:
|
|||
-
|
||||
name: txqlen
|
||||
type: u32
|
||||
checks:
|
||||
max: 32767
|
||||
-
|
||||
name: map
|
||||
type: binary
|
||||
|
|
|
|||
|
|
@ -341,6 +341,9 @@ attribute-sets:
|
|||
-
|
||||
name: interval-probe-time-ms
|
||||
type: u64
|
||||
checks:
|
||||
min: 1
|
||||
max: 86400000
|
||||
|
||||
operations:
|
||||
enum-model: directional
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ neigh/default/unres_qlen - INTEGER
|
|||
|
||||
neigh/default/interval_probe_time_ms - INTEGER
|
||||
The probe interval for neighbor entries with NTF_MANAGED flag,
|
||||
the min value is 1.
|
||||
the min value is 1, and the max value is 86400000 (1 day).
|
||||
|
||||
Default: 5000
|
||||
|
||||
|
|
@ -874,6 +874,8 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
|
|||
case this value is ignored.
|
||||
Default: between 131072 and 32MB, depending on RAM size.
|
||||
|
||||
Each of the three values cannot be set below 4096.
|
||||
|
||||
tcp_sack - BOOLEAN
|
||||
Enable select acknowledgments (SACKS).
|
||||
|
||||
|
|
|
|||
|
|
@ -15,19 +15,41 @@ arch/riscv 开发者维护指南
|
|||
|
||||
概述
|
||||
----
|
||||
RISC-V指令集体系结构是公开开发的:
|
||||
RISC-V 指令集体系结构是公开开发的:
|
||||
正在进行的草案可供所有人查看和测试实现。新模块或者扩展草案可能会在开发过程中发
|
||||
生更改---有时以不兼容的方式对以前的草案进行更改。这种灵活性可能会给RISC-V Linux
|
||||
维护者带来挑战。Linux开发过程更喜欢经过良好检查和测试的代码,而不是试验代码。我
|
||||
们希望推广同样的规则到即将被内核合并的RISC-V相关代码。
|
||||
生更改 --- 有时以不兼容的方式对以前的草案进行更改。这种灵活性可能会给 RISC-V
|
||||
Linux 维护者带来挑战。Linux 维护者不赞成频繁的变更,且 Linux 开发过程更喜欢经过
|
||||
良好检查和测试的代码,而不是试验代码。我们希望推广同样的规则到即将被内核合并的
|
||||
RISC-V 相关代码。
|
||||
|
||||
Patchwork
|
||||
---------
|
||||
|
||||
RISC-V 有一个 patchwork 实例,可以在那里查看补丁的状态:
|
||||
|
||||
https://patchwork.kernel.org/project/linux-riscv/list/
|
||||
|
||||
如果你的补丁不在默认视图中出现,那么 RISC-V 维护者很有可能已要求修改,或者希望
|
||||
将其应用到另一个代码树上。
|
||||
|
||||
自动化流程会在该 patchwork 实例上运行,在每个补丁到达时立刻对其进行构建/测试。
|
||||
自动化流程会根据补丁是否被识别为修复,选用 RISC-V `for-next` 或 `fixes` 分支
|
||||
当前的 HEAD;若上述均应用失败,则使用 RISC-V `master` 分支。补丁系列被应用到的具
|
||||
体提交将标注在 patchwork 上。任何检查未通过的补丁通常不会被应用,并且在大多数情
|
||||
况下将需要重新提交。
|
||||
|
||||
附加的提交检查单
|
||||
----------------
|
||||
我们仅接受相关标准已经被RISC-V基金会标准为“已批准”或“已冻结”的扩展或模块的补丁。
|
||||
(开发者当然可以维护自己的Linux内核树,其中包含所需代码扩展草案的代码。)
|
||||
我们仅接受针对新模块或扩展的补丁,前提是这些模块或扩展的规范被列为未来不太可能发
|
||||
生不兼容的变更。对于来自 RISC-V 基金会的规范,这意味着“已冻结”或“已批准”,对于
|
||||
UEFI 论坛的规范,这意味着已发布的 ECR。(开发者当然可以维护自己的 Linux 内核树,
|
||||
其中包含他们所需的任何扩展草案的代码。)
|
||||
|
||||
此外,RISC-V规范允许爱好者创建自己的自定义扩展。这些自定义拓展不需要通过RISC-V
|
||||
基金会的任何审核或批准。为了避免将爱好者一些特别的RISC-V拓展添加进内核代码带来
|
||||
的维护复杂性和对性能的潜在影响,我们将只接受RISC-V基金会正式冻结或批准的的扩展
|
||||
补丁。(开发者当然可以维护自己的Linux内核树,其中包含他们想要的任何自定义扩展
|
||||
的代码。)
|
||||
此外,RISC-V 规范允许实现者创建自己的自定义扩展。这些自定义扩展不需要通过 RISC-V
|
||||
基金会的任何审核或批准流程。为了避免因添加实现者特定的 RISC-V 扩展带来的维护复杂
|
||||
性和对性能的潜在影响,我们将只考虑符合以下任一条件的扩展补丁:
|
||||
|
||||
- 已由 RISC-V 基金会正式冻结或批准
|
||||
- 已按照标准 Linux 惯例,在广泛可用的硬件中实现
|
||||
|
||||
(实现者当然可以维护自己的 Linux 内核树,其中包含他们所需的任何自定义扩展的代码。)
|
||||
|
|
|
|||
31
MAINTAINERS
31
MAINTAINERS
|
|
@ -4512,7 +4512,7 @@ AYANEO PLATFORM EC DRIVER
|
|||
M: Antheas Kapenekakis <lkml@antheas.dev>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-platform-ayaneo
|
||||
F: Documentation/ABI/testing/sysfs-platform-ayaneo-ec
|
||||
F: drivers/platform/x86/ayaneo-ec.c
|
||||
|
||||
AZ6007 DVB DRIVER
|
||||
|
|
@ -9324,6 +9324,7 @@ F: Documentation/devicetree/bindings/interrupt-controller/econet,en751221-intc.y
|
|||
F: Documentation/devicetree/bindings/mips/econet.yaml
|
||||
F: Documentation/devicetree/bindings/timer/econet,en751221-timer.yaml
|
||||
F: arch/mips/boot/dts/econet/
|
||||
F: arch/mips/configs/econet_en751221_defconfig
|
||||
F: arch/mips/econet/
|
||||
F: drivers/clocksource/timer-econet-en751221.c
|
||||
F: drivers/irqchip/irq-econet-en751221.c
|
||||
|
|
@ -15020,6 +15021,8 @@ M: Madhavan Srinivasan <maddy@linux.ibm.com>
|
|||
R: Michael Ellerman <mpe@ellerman.id.au>
|
||||
R: Nicholas Piggin <npiggin@gmail.com>
|
||||
R: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
|
||||
R: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
|
||||
R: Shrikanth Hegde <sshegde@linux.ibm.com>
|
||||
L: linuxppc-dev@lists.ozlabs.org
|
||||
S: Supported
|
||||
W: https://github.com/linuxppc/wiki/wiki
|
||||
|
|
@ -17029,8 +17032,8 @@ MEMBLOCK AND MEMORY MANAGEMENT INITIALIZATION
|
|||
M: Mike Rapoport <rppt@kernel.org>
|
||||
L: linux-mm@kvack.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git for-next
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git fixes
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mm/memblock.git for-next
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mm/memblock.git fixes
|
||||
F: Documentation/core-api/boot-time-mm.rst
|
||||
F: include/linux/kho/abi/memblock.h
|
||||
F: include/linux/memblock.h
|
||||
|
|
@ -17191,7 +17194,7 @@ F: tools/testing/selftests/mm/gup_test.c
|
|||
MEMORY MANAGEMENT - KSM (Kernel Samepage Merging)
|
||||
M: Andrew Morton <akpm@linux-foundation.org>
|
||||
M: David Hildenbrand <david@kernel.org>
|
||||
R: Xu Xin <xu.xin16@zte.com.cn>
|
||||
R: Xu Xin <xu.xin@linux.dev>
|
||||
R: Chengming Zhou <chengming.zhou@linux.dev>
|
||||
L: linux-mm@kvack.org
|
||||
S: Maintained
|
||||
|
|
@ -17239,6 +17242,8 @@ R: Barry Song <baohua@kernel.org>
|
|||
R: Axel Rasmussen <axelrasmussen@google.com>
|
||||
R: Yuanchu Xie <yuanchu@google.com>
|
||||
R: Wei Xu <weixugc@google.com>
|
||||
R: Baoquan He <baoquan.he@linux.dev>
|
||||
R: Baolin Wang <baolin.wang@linux.alibaba.com>
|
||||
L: linux-mm@kvack.org
|
||||
S: Maintained
|
||||
W: http://www.linux-mm.org
|
||||
|
|
@ -25334,8 +25339,8 @@ F: Documentation/networking/timestamping.rst
|
|||
F: include/linux/net_tstamp.h
|
||||
F: include/uapi/linux/net_tstamp.h
|
||||
F: tools/testing/selftests/bpf/*/net_timestamping*
|
||||
F: tools/testing/selftests/drivers/net/so_txtime.*
|
||||
F: tools/testing/selftests/net/*timestamp*
|
||||
F: tools/testing/selftests/net/so_txtime.c
|
||||
|
||||
SOEKRIS NET48XX LED SUPPORT
|
||||
M: Chris Boot <bootc@bootc.net>
|
||||
|
|
@ -28607,7 +28612,6 @@ L: iommu@lists.linux.dev
|
|||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/iommu/verisilicon,iommu.yaml
|
||||
F: drivers/iommu/vsi-iommu.c
|
||||
F: include/linux/vsi-iommu.h
|
||||
|
||||
VF610 NAND DRIVER
|
||||
M: Stefan Agner <stefan@agner.ch>
|
||||
|
|
@ -28867,8 +28871,8 @@ F: include/uapi/linux/virtio_console.h
|
|||
VIRTIO CORE
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
M: Eugenio Pérez <eperezma@redhat.com>
|
||||
R: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
L: virtualization@lists.linux.dev
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-bus-vdpa
|
||||
|
|
@ -28945,7 +28949,7 @@ F: include/uapi/linux/virtio_gpu.h
|
|||
VIRTIO HOST (VHOST)
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
M: Eugenio Pérez <eperezma@redhat.com>
|
||||
L: kvm@vger.kernel.org
|
||||
L: virtualization@lists.linux.dev
|
||||
L: netdev@vger.kernel.org
|
||||
|
|
@ -29000,8 +29004,8 @@ F: include/uapi/linux/virtio_mem.h
|
|||
VIRTIO NET DRIVER
|
||||
M: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
M: Jason Wang <jasowangio@gmail.com>
|
||||
M: Eugenio Pérez <eperezma@redhat.com>
|
||||
R: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
|
||||
R: Eugenio Pérez <eperezma@redhat.com>
|
||||
L: netdev@vger.kernel.org
|
||||
L: virtualization@lists.linux.dev
|
||||
S: Maintained
|
||||
|
|
@ -29017,6 +29021,13 @@ S: Maintained
|
|||
F: drivers/nvdimm/nd_virtio.c
|
||||
F: drivers/nvdimm/virtio_pmem.c
|
||||
|
||||
VIRTIO RNG DRIVER
|
||||
M: Laurent Vivier <lvivier@redhat.com>
|
||||
L: virtualization@lists.linux.dev
|
||||
S: Maintained
|
||||
F: drivers/char/hw_random/virtio-rng.c
|
||||
F: include/uapi/linux/virtio_rng.h
|
||||
|
||||
VIRTIO RTC DRIVER
|
||||
M: Peter Hilber <peter.hilber@oss.qualcomm.com>
|
||||
L: virtualization@lists.linux.dev
|
||||
|
|
@ -29348,7 +29359,7 @@ M: Guenter Roeck <linux@roeck-us.net>
|
|||
L: linux-watchdog@vger.kernel.org
|
||||
S: Maintained
|
||||
W: http://www.linux-watchdog.org/
|
||||
T: git git://www.linux-watchdog.org/linux-watchdog.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
|
||||
F: Documentation/devicetree/bindings/watchdog/
|
||||
F: Documentation/watchdog/
|
||||
F: drivers/watchdog/
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -2,7 +2,7 @@
|
|||
VERSION = 7
|
||||
PATCHLEVEL = 3
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc4
|
||||
NAME = Baby Opossum Posse
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ menuconfig ARCH_INTEL_SOCFPGA
|
|||
select ARM_ERRATA_775420
|
||||
select PL310_ERRATA_588369
|
||||
select PL310_ERRATA_727915
|
||||
select PL310_ERRATA_753970 if PL310
|
||||
select PL310_ERRATA_753970
|
||||
select PL310_ERRATA_769419
|
||||
select RESET_CONTROLLER
|
||||
|
||||
|
|
|
|||
0
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dtsi
Executable file → Normal file
0
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dtsi
Executable file → Normal file
0
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_emmc.dts
Executable file → Normal file
0
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_emmc.dts
Executable file → Normal file
|
|
@ -33,7 +33,7 @@ xtal: xtal-clk {
|
|||
};
|
||||
|
||||
&uart_a {
|
||||
clocks = <&xtal>, <&xtal>, <&xtal>;
|
||||
clocks = <&xtal>, <&clkc_periphs CLKID_SYS_UART_A>, <&xtal>;
|
||||
clock-names = "xtal", "pclk", "baud";
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ sd_3v3: regulator-sdcard-3v3 {
|
|||
vin-supply = <&vddao_3v3>;
|
||||
gpio = <&gpio GPIOD_11 GPIO_ACTIVE_LOW>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
sdio_pwrseq: sdio-pwrseq {
|
||||
|
|
@ -105,6 +104,66 @@ vcc5v0_usb: regulator-vcc-usb {
|
|||
enable-active-high;
|
||||
};
|
||||
|
||||
vdd_ddr: regulator-vddddr {
|
||||
/*
|
||||
* SY8003ADFC Regulator.
|
||||
*/
|
||||
compatible = "pwm-regulator";
|
||||
regulator-name = "VDDDDR";
|
||||
regulator-min-microvolt = <690000>;
|
||||
regulator-max-microvolt = <890000>;
|
||||
pwm-supply = <&dc_in>;
|
||||
pwms = <&pwm_ao_gh 0 1500 0>;
|
||||
pwm-dutycycle-range = <100 0>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vdd_ee: regulator-vddee {
|
||||
/*
|
||||
* MP8756GD Regulator.
|
||||
*/
|
||||
compatible = "pwm-regulator";
|
||||
regulator-name = "VDDEE";
|
||||
regulator-min-microvolt = <700000>;
|
||||
regulator-max-microvolt = <922000>;
|
||||
pwm-supply = <&dc_in>;
|
||||
pwms = <&pwm_ao_ab 0 1500 0>;
|
||||
pwm-dutycycle-range = <100 0>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vdd_gpu: regulator-vddgpu {
|
||||
/*
|
||||
* SY8003ADFC Regulator.
|
||||
*/
|
||||
compatible = "pwm-regulator";
|
||||
regulator-name = "VDDGPU";
|
||||
regulator-min-microvolt = <700000>;
|
||||
regulator-max-microvolt = <922000>;
|
||||
pwm-supply = <&dc_in>;
|
||||
pwms = <&pwm_ao_ef 0 1500 0>;
|
||||
pwm-dutycycle-range = <100 0>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vdd_npu: regulator-vddnpu {
|
||||
/*
|
||||
* SY8003ADFC Regulator.
|
||||
*/
|
||||
compatible = "pwm-regulator";
|
||||
regulator-name = "VDDNPU";
|
||||
regulator-min-microvolt = <733000>;
|
||||
regulator-max-microvolt = <933000>;
|
||||
pwm-supply = <&dc_in>;
|
||||
pwms = <&pwm_ao_ef 1 1500 0>;
|
||||
pwm-dutycycle-range = <100 0>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vddao_1v8: regulator-vddao-1v8 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "VDDAO_1V8";
|
||||
|
|
@ -123,6 +182,36 @@ vddao_3v3: regulator-vddao-3v3 {
|
|||
regulator-always-on;
|
||||
};
|
||||
|
||||
vddcpu_a: regulator-vddcpu-a {
|
||||
/*
|
||||
* MP8756GD Regulator.
|
||||
*/
|
||||
compatible = "pwm-regulator";
|
||||
regulator-name = "VDDCPU_A";
|
||||
regulator-min-microvolt = <689000>;
|
||||
regulator-max-microvolt = <1049000>;
|
||||
pwm-supply = <&dc_in>;
|
||||
pwms = <&pwm_ao_cd 1 1500 0>;
|
||||
pwm-dutycycle-range = <100 0>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vddcpu_b: regulator-vddcpu-b {
|
||||
/*
|
||||
* MP8756GD Regulator.
|
||||
*/
|
||||
compatible = "pwm-regulator";
|
||||
regulator-name = "VDDCPU_B";
|
||||
regulator-min-microvolt = <689000>;
|
||||
regulator-max-microvolt = <1049000>;
|
||||
pwm-supply = <&dc_in>;
|
||||
pwms = <&pwm_ao_ab 1 1500 0>;
|
||||
pwm-dutycycle-range = <100 0>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vddio_1v8: regulator-vddio-1v8 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "VDDIO_1V8";
|
||||
|
|
@ -173,9 +262,27 @@ &pwm_ab {
|
|||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&pwm_ao_ab {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pwm_ao_a_pins>, <&pwm_ao_b_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&pwm_ao_cd {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pwm_ao_c_d_pins>;
|
||||
pinctrl-0 = <&pwm_ao_c_d_pins>, <&pwm_ao_d_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&pwm_ao_ef {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pwm_ao_e_pins>, <&pwm_ao_f_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&pwm_ao_gh {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pwm_ao_g_e_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
|
|
@ -266,6 +373,6 @@ &sd_emmc_c {
|
|||
|
||||
&uart_a {
|
||||
status = "okay";
|
||||
clocks = <&xtal>, <&xtal>, <&xtal>;
|
||||
clocks = <&xtal>, <&clkc_periphs CLKID_SYS_UART_A>, <&xtal>;
|
||||
clock-names = "xtal", "pclk", "baud";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -458,9 +458,25 @@ mux {
|
|||
};
|
||||
};
|
||||
|
||||
pwm_ao_g_pins: pwm-ao-g {
|
||||
pwm_ao_g_d11_pins: pwm-ao-g-d11 {
|
||||
mux {
|
||||
groups = "pwm_ao_g";
|
||||
groups = "pwm_ao_g_d11";
|
||||
function = "pwm_ao_g";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
pwm_ao_g_d7_pins: pwm-ao-g-d7 {
|
||||
mux {
|
||||
groups = "pwm_ao_g_d7";
|
||||
function = "pwm_ao_g";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
pwm_ao_g_e_pins: pwm-ao-g-e {
|
||||
mux {
|
||||
groups = "pwm_ao_g_e";
|
||||
function = "pwm_ao_g";
|
||||
bias-disable;
|
||||
};
|
||||
|
|
@ -474,9 +490,17 @@ mux {
|
|||
};
|
||||
};
|
||||
|
||||
pwm_ao_h_pins: pwm-ao-h {
|
||||
pwm_ao_h_d5_pins: pwm-ao-h-d5 {
|
||||
mux {
|
||||
groups = "pwm_ao_h";
|
||||
groups = "pwm_ao_h_d5";
|
||||
function = "pwm_ao_h";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
pwm_ao_h_d10_pins: pwm-ao-h-d10 {
|
||||
mux {
|
||||
groups = "pwm_ao_h_d10";
|
||||
function = "pwm_ao_h";
|
||||
bias-disable;
|
||||
};
|
||||
|
|
@ -522,9 +546,17 @@ mux {
|
|||
};
|
||||
};
|
||||
|
||||
pwm_vs_pins: pwm-vs {
|
||||
pwm_vs_y_pins: pwm-vs-y {
|
||||
mux {
|
||||
groups = "pwm_vs";
|
||||
groups = "pwm_vs_y";
|
||||
function = "pwm_vs";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
pwm_vs_h_pins: pwm-vs-h {
|
||||
mux {
|
||||
groups = "pwm_vs_h";
|
||||
function = "pwm_vs";
|
||||
bias-disable;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -901,6 +901,7 @@ ufs: ufs@e6860000 {
|
|||
clocks = <&cpg CPG_MOD 1514>, <&ufs30_clk>;
|
||||
clock-names = "fck", "ref_clk";
|
||||
freq-table-hz = <200000000 200000000>, <38400000 38400000>;
|
||||
lanes-per-direction = <1>;
|
||||
power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
|
||||
resets = <&cpg 1514>;
|
||||
status = "disabled";
|
||||
|
|
|
|||
|
|
@ -1913,23 +1913,28 @@ queue3 {
|
|||
|
||||
mtl_tx_setup0: tx-queues-config {
|
||||
snps,tx-queues-to-use = <4>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x4>;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x18>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x8>;
|
||||
};
|
||||
|
|
@ -2013,23 +2018,28 @@ queue3 {
|
|||
|
||||
mtl_tx_setup1: tx-queues-config {
|
||||
snps,tx-queues-to-use = <4>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x4>;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x18>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x8>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1585,23 +1585,28 @@ queue3 {
|
|||
|
||||
mtl_tx_setup0: tx-queues-config {
|
||||
snps,tx-queues-to-use = <4>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x4>;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x18>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x8>;
|
||||
};
|
||||
|
|
@ -1686,23 +1691,28 @@ queue3 {
|
|||
|
||||
mtl_tx_setup1: tx-queues-config {
|
||||
snps,tx-queues-to-use = <4>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x4>;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x18>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x8>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1715,23 +1715,28 @@ queue3 {
|
|||
|
||||
mtl_tx_setup0: tx-queues-config {
|
||||
snps,tx-queues-to-use = <4>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x4>;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x18>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x8>;
|
||||
};
|
||||
|
|
@ -1816,23 +1821,28 @@ queue3 {
|
|||
|
||||
mtl_tx_setup1: tx-queues-config {
|
||||
snps,tx-queues-to-use = <4>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x4>;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x18>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x8>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -642,36 +642,45 @@ queue7 {
|
|||
|
||||
mtl_tx_setup0: tx-queues-config {
|
||||
snps,tx-queues-to-use = <8>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x13>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue4 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue5 {
|
||||
snps,weight = <0x15>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue6 {
|
||||
snps,weight = <0x16>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue7 {
|
||||
snps,weight = <0x17>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
};
|
||||
|
|
@ -788,36 +797,45 @@ queue7 {
|
|||
|
||||
mtl_tx_setup1: tx-queues-config {
|
||||
snps,tx-queues-to-use = <8>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x13>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue4 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue5 {
|
||||
snps,weight = <0x15>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue6 {
|
||||
snps,weight = <0x16>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue7 {
|
||||
snps,weight = <0x17>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
};
|
||||
|
|
@ -934,36 +952,45 @@ queue7 {
|
|||
|
||||
mtl_tx_setup2: tx-queues-config {
|
||||
snps,tx-queues-to-use = <8>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x13>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue4 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue5 {
|
||||
snps,weight = <0x15>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue6 {
|
||||
snps,weight = <0x16>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue7 {
|
||||
snps,weight = <0x17>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -643,36 +643,45 @@ queue7 {
|
|||
|
||||
mtl_tx_setup0: tx-queues-config {
|
||||
snps,tx-queues-to-use = <8>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x13>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue4 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue5 {
|
||||
snps,weight = <0x15>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue6 {
|
||||
snps,weight = <0x16>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue7 {
|
||||
snps,weight = <0x17>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
};
|
||||
|
|
@ -790,36 +799,45 @@ queue7 {
|
|||
|
||||
mtl_tx_setup1: tx-queues-config {
|
||||
snps,tx-queues-to-use = <8>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x13>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue4 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue5 {
|
||||
snps,weight = <0x15>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue6 {
|
||||
snps,weight = <0x16>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue7 {
|
||||
snps,weight = <0x17>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
};
|
||||
|
|
@ -937,36 +955,45 @@ queue7 {
|
|||
|
||||
mtl_tx_setup2: tx-queues-config {
|
||||
snps,tx-queues-to-use = <8>;
|
||||
snps,tx-sched-wrr;
|
||||
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue3 {
|
||||
snps,weight = <0x13>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue4 {
|
||||
snps,weight = <0x14>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue5 {
|
||||
snps,weight = <0x15>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue6 {
|
||||
snps,weight = <0x16>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
|
||||
queue7 {
|
||||
snps,weight = <0x17>;
|
||||
snps,dcb-algorithm;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -418,6 +418,7 @@
|
|||
b.lt .Lskip_fgt2_\@
|
||||
|
||||
mov x0, xzr
|
||||
mov x2, xzr
|
||||
mrs x1, id_aa64dfr0_el1
|
||||
ubfx x1, x1, #ID_AA64DFR0_EL1_PMUVer_SHIFT, #4
|
||||
cmp x1, #ID_AA64DFR0_EL1_PMUVer_V3P9
|
||||
|
|
@ -426,6 +427,11 @@
|
|||
orr x0, x0, #HDFGRTR2_EL2_nPMICNTR_EL0
|
||||
orr x0, x0, #HDFGRTR2_EL2_nPMICFILTR_EL0
|
||||
orr x0, x0, #HDFGRTR2_EL2_nPMUACR_EL1
|
||||
orr x2, x2, #HDFGWTR2_EL2_nPMICNTR_EL0
|
||||
orr x2, x2, #HDFGWTR2_EL2_nPMICFILTR_EL0
|
||||
orr x2, x2, #HDFGWTR2_EL2_nPMUACR_EL1
|
||||
/* PMZR_EL0 is write-only, so it has no read trap to disable */
|
||||
orr x2, x2, #HDFGWTR2_EL2_nPMZR_EL0
|
||||
.Lskip_pmuv3p9_\@:
|
||||
/* If SPE is implemented, */
|
||||
__spe_vers_imp .Lskip_spefds_\@, ID_AA64DFR0_EL1_PMSVer_IMP, x1
|
||||
|
|
@ -436,10 +442,11 @@
|
|||
cbz x1, .Lskip_spefds_\@
|
||||
/* disable traps of PMSDSFR to EL2. */
|
||||
orr x0, x0, #HDFGRTR2_EL2_nPMSDSFR_EL1
|
||||
orr x2, x2, #HDFGWTR2_EL2_nPMSDSFR_EL1
|
||||
|
||||
.Lskip_spefds_\@:
|
||||
msr_s SYS_HDFGRTR2_EL2, x0
|
||||
msr_s SYS_HDFGWTR2_EL2, x0
|
||||
msr_s SYS_HDFGWTR2_EL2, x2
|
||||
msr_s SYS_HFGRTR2_EL2, xzr
|
||||
msr_s SYS_HFGWTR2_EL2, xzr
|
||||
msr_s SYS_HFGITR2_EL2, xzr
|
||||
|
|
|
|||
|
|
@ -280,7 +280,8 @@ static inline void __iomem *ioremap_prot(phys_addr_t phys, size_t size,
|
|||
pgprot_t prot;
|
||||
ptval_t user_prot_val = pgprot_val(user_prot);
|
||||
|
||||
if (WARN_ON_ONCE(!(user_prot_val & PTE_USER)))
|
||||
/* Reject PROT_NONE and exec-only */
|
||||
if (!(user_prot_val & PTE_USER))
|
||||
return NULL;
|
||||
|
||||
prot = __pgprot_modify(PAGE_KERNEL, PTE_ATTRINDX_MASK,
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ __percpu_##name##_case_##sz(void *ptr, unsigned long val) \
|
|||
" stxr" #sfx "\t%w[loop], %" #w "[tmp], %[ptr]\n" \
|
||||
" cbnz %w[loop], 1b", \
|
||||
/* LSE atomics */ \
|
||||
#op_lse "\t%" #w "[val], %" #w "[tmp], %[ptr]\n" \
|
||||
#op_lse #sfx "\t%" #w "[val], %" #w "[tmp], %[ptr]\n" \
|
||||
__nops(3)) \
|
||||
: [loop] "=&r" (loop), [tmp] "=&r" (tmp), \
|
||||
[ptr] "+Q"(*(u##sz *)ptr) \
|
||||
|
|
@ -98,7 +98,7 @@ __percpu_##name##_return_case_##sz(void *ptr, unsigned long val) \
|
|||
" stxr" #sfx "\t%w[loop], %" #w "[ret], %[ptr]\n" \
|
||||
" cbnz %w[loop], 1b", \
|
||||
/* LSE atomics */ \
|
||||
#op_lse "\t%" #w "[val], %" #w "[ret], %[ptr]\n" \
|
||||
#op_lse #sfx "\t%" #w "[val], %" #w "[ret], %[ptr]\n" \
|
||||
#op_llsc "\t%" #w "[ret], %" #w "[ret], %" #w "[val]\n" \
|
||||
__nops(2)) \
|
||||
: [loop] "=&r" (loop), [ret] "=&r" (ret), \
|
||||
|
|
@ -179,13 +179,13 @@ PERCPU_RET_OP(add, add, ldadd)
|
|||
_pcp_protect_return(__percpu_read_64, pcp)
|
||||
|
||||
#define this_cpu_write_1(pcp, val) \
|
||||
_pcp_protect(__percpu_write_8, pcp, (unsigned long)val)
|
||||
_pcp_protect(__percpu_write_8, pcp, (unsigned long)(val))
|
||||
#define this_cpu_write_2(pcp, val) \
|
||||
_pcp_protect(__percpu_write_16, pcp, (unsigned long)val)
|
||||
_pcp_protect(__percpu_write_16, pcp, (unsigned long)(val))
|
||||
#define this_cpu_write_4(pcp, val) \
|
||||
_pcp_protect(__percpu_write_32, pcp, (unsigned long)val)
|
||||
_pcp_protect(__percpu_write_32, pcp, (unsigned long)(val))
|
||||
#define this_cpu_write_8(pcp, val) \
|
||||
_pcp_protect(__percpu_write_64, pcp, (unsigned long)val)
|
||||
_pcp_protect(__percpu_write_64, pcp, (unsigned long)(val))
|
||||
|
||||
#define this_cpu_add_1(pcp, val) \
|
||||
_pcp_protect(__percpu_add_case_8, pcp, val)
|
||||
|
|
@ -206,13 +206,13 @@ PERCPU_RET_OP(add, add, ldadd)
|
|||
_pcp_protect_return(__percpu_add_return_case_64, pcp, val)
|
||||
|
||||
#define this_cpu_and_1(pcp, val) \
|
||||
_pcp_protect(__percpu_andnot_case_8, pcp, ~val)
|
||||
_pcp_protect(__percpu_andnot_case_8, pcp, ~(u8)(val))
|
||||
#define this_cpu_and_2(pcp, val) \
|
||||
_pcp_protect(__percpu_andnot_case_16, pcp, ~val)
|
||||
_pcp_protect(__percpu_andnot_case_16, pcp, ~(u16)(val))
|
||||
#define this_cpu_and_4(pcp, val) \
|
||||
_pcp_protect(__percpu_andnot_case_32, pcp, ~val)
|
||||
_pcp_protect(__percpu_andnot_case_32, pcp, ~(u32)(val))
|
||||
#define this_cpu_and_8(pcp, val) \
|
||||
_pcp_protect(__percpu_andnot_case_64, pcp, ~val)
|
||||
_pcp_protect(__percpu_andnot_case_64, pcp, ~(u64)(val))
|
||||
|
||||
#define this_cpu_or_1(pcp, val) \
|
||||
_pcp_protect(__percpu_or_case_8, pcp, val)
|
||||
|
|
|
|||
|
|
@ -28,18 +28,21 @@ bool cpu_errata_set_target_impl(u64 num, void *impl_cpus)
|
|||
return true;
|
||||
}
|
||||
|
||||
static inline bool __is_midr_in_range(u32 midr, struct midr_range const *range)
|
||||
{
|
||||
return midr_is_cpu_model_range(midr, range->model,
|
||||
range->rv_min, range->rv_max);
|
||||
}
|
||||
|
||||
static inline bool is_midr_in_range(struct midr_range const *range)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!target_impl_cpu_num)
|
||||
return midr_is_cpu_model_range(read_cpuid_id(), range->model,
|
||||
range->rv_min, range->rv_max);
|
||||
return __is_midr_in_range(read_cpuid_id(), range);
|
||||
|
||||
for (i = 0; i < target_impl_cpu_num; i++) {
|
||||
if (midr_is_cpu_model_range(target_impl_cpus[i].midr,
|
||||
range->model,
|
||||
range->rv_min, range->rv_max))
|
||||
if (__is_midr_in_range(target_impl_cpus[i].midr, range))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -59,7 +62,7 @@ __is_affected_midr_range(const struct arm64_cpu_capabilities *entry,
|
|||
u32 midr, u32 revidr)
|
||||
{
|
||||
const struct arm64_midr_revidr *fix;
|
||||
if (!is_midr_in_range(&entry->midr_range))
|
||||
if (!__is_midr_in_range(midr, &entry->midr_range))
|
||||
return false;
|
||||
|
||||
midr &= MIDR_REVISION_MASK | MIDR_VARIANT_MASK;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ alternative_insn "dc cvau, x4", "dc civac, x4", ARM64_WORKAROUND_CLEAN_CACHE
|
|||
isb
|
||||
|
||||
cbz x24, 3f /* Do we need to re-initialise EL2? */
|
||||
mov x1, x24
|
||||
mov x0, #HVC_SET_VECTORS
|
||||
hvc #0
|
||||
3: ret
|
||||
SYM_CODE_END(swsusp_arch_suspend_exit)
|
||||
|
|
|
|||
|
|
@ -423,8 +423,8 @@ int __nocfi swsusp_arch_resume(void)
|
|||
* Create a second copy of just the linear map, and use this when
|
||||
* restoring.
|
||||
*/
|
||||
rc = trans_pgd_create_copy(&trans_info, &tmp_pg_dir, PAGE_OFFSET,
|
||||
PAGE_END);
|
||||
rc = trans_pgd_create_copy(&trans_info, &tmp_pg_dir,
|
||||
_PAGE_OFFSET(vabits_actual), PAGE_END);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr,
|
|||
* was never mapped with PROT_MTE.
|
||||
*/
|
||||
if (!(vma->vm_flags & VM_MTE)) {
|
||||
err = -EOPNOTSUPP;
|
||||
err = -EIO;
|
||||
put_page(page);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ static const struct ftr_set_desc isar2 __prel64_initconst = {
|
|||
.name = "id_aa64isar2",
|
||||
.override = &id_aa64isar2_override,
|
||||
.fields = {
|
||||
FIELD("wfxt", ID_AA64ISAR2_EL1_WFxT_SHIFT, NULL),
|
||||
FIELD("gpa3", ID_AA64ISAR2_EL1_GPA3_SHIFT, NULL),
|
||||
FIELD("apa3", ID_AA64ISAR2_EL1_APA3_SHIFT, NULL),
|
||||
FIELD("mops", ID_AA64ISAR2_EL1_MOPS_SHIFT, NULL),
|
||||
|
|
@ -254,6 +255,7 @@ static const struct {
|
|||
"id_aa64isar1.api=0 id_aa64isar1.apa=0 "
|
||||
"id_aa64isar2.gpa3=0 id_aa64isar2.apa3=0" },
|
||||
{ "arm64.nomops", "id_aa64isar2.mops=0" },
|
||||
{ "arm64.nowfxt", "id_aa64isar2.wfxt=0" },
|
||||
{ "arm64.nomte", "id_aa64pfr1.mte=0" },
|
||||
{ "nokaslr", "arm64_sw.nokaslr=1" },
|
||||
{ "rodata=off", "arm64_sw.rodataoff=1" },
|
||||
|
|
|
|||
|
|
@ -600,6 +600,8 @@ static int build_prologue(struct jit_ctx *ctx, bool ebpf_from_cbpf)
|
|||
* 12 registers are on the stack
|
||||
*/
|
||||
emit(A64_SUB_I(1, A64_SP, A64_FP, 96), ctx);
|
||||
/* The callback may use its own BPF stack, set up fp for it. */
|
||||
ctx->fp_used = true;
|
||||
}
|
||||
|
||||
/* Stack must be multiples of 16B */
|
||||
|
|
|
|||
|
|
@ -3761,7 +3761,9 @@ Sysreg ICC_CR0_EL1 3 1 12 0 1
|
|||
Res0 63:39
|
||||
Field 38 PID
|
||||
Field 37:32 IPPT
|
||||
Res0 31:1
|
||||
Res0 31:3
|
||||
Field 2 LINK_IDLE
|
||||
Field 1 LINK
|
||||
Field 0 EN
|
||||
EndSysreg
|
||||
|
||||
|
|
|
|||
|
|
@ -396,10 +396,7 @@ config ECONET
|
|||
bool "EcoNet MIPS family"
|
||||
select BOOT_RAW
|
||||
select DEBUG_ZBOOT if DEBUG_KERNEL
|
||||
select EARLY_PRINTK_8250
|
||||
select ECONET_EN751221_TIMER
|
||||
select SERIAL_8250
|
||||
select SERIAL_OF_PLATFORM
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_HAS_CPU_MIPS32_R1
|
||||
select SYS_HAS_CPU_MIPS32_R2
|
||||
|
|
@ -661,6 +658,7 @@ config EYEQ
|
|||
select USB_UHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
|
||||
select USE_OF
|
||||
select HOTPLUG_PARALLEL if HOTPLUG_CPU
|
||||
select WEAK_REORDERING_BEYOND_LLSC
|
||||
help
|
||||
Select this to build a kernel supporting EyeQ SoC from Mobileye.
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include <asm/octeon/octeon.h>
|
||||
#include <asm/octeon/cvmx-helper-board.h>
|
||||
|
||||
#ifdef CONFIG_USB
|
||||
#if IS_ENABLED(CONFIG_USB)
|
||||
#include <linux/usb/ehci_def.h>
|
||||
#include <linux/usb/ehci_pdriver.h>
|
||||
#include <linux/usb/ohci_pdriver.h>
|
||||
|
|
@ -1080,7 +1080,7 @@ int __init octeon_prune_device_tree(void)
|
|||
;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB
|
||||
#if IS_ENABLED(CONFIG_USB)
|
||||
/* OHCI/UHCI USB */
|
||||
alias_prop = fdt_getprop(initial_boot_params, aliases,
|
||||
"uctl", NULL);
|
||||
|
|
|
|||
264
arch/mips/configs/econet_en751221_defconfig
Normal file
264
arch/mips/configs/econet_en751221_defconfig
Normal file
|
|
@ -0,0 +1,264 @@
|
|||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_KERNEL_XZ=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
# CONFIG_CROSS_MEMORY_ATTACH is not set
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_BPF_SYSCALL=y
|
||||
CONFIG_BPF_JIT=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_CGROUP_SCHED=y
|
||||
CONFIG_CFS_BANDWIDTH=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
CONFIG_CGROUP_PIDS=y
|
||||
CONFIG_CGROUP_RDMA=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_CGROUP_BPF=y
|
||||
CONFIG_NAMESPACES=y
|
||||
# CONFIG_TIME_NS is not set
|
||||
CONFIG_USER_NS=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
# CONFIG_RD_GZIP is not set
|
||||
# CONFIG_RD_BZIP2 is not set
|
||||
# CONFIG_RD_LZMA is not set
|
||||
# CONFIG_RD_XZ is not set
|
||||
# CONFIG_RD_LZO is not set
|
||||
# CONFIG_RD_LZ4 is not set
|
||||
# CONFIG_RD_ZSTD is not set
|
||||
# CONFIG_INITRAMFS_PRESERVE_MTIME is not set
|
||||
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y
|
||||
CONFIG_EXPERT=y
|
||||
# CONFIG_SGETMASK_SYSCALL is not set
|
||||
# CONFIG_IO_URING is not set
|
||||
# CONFIG_RSEQ is not set
|
||||
# CONFIG_CACHESTAT_SYSCALL is not set
|
||||
CONFIG_ECONET=y
|
||||
CONFIG_CPU_MIPS32_R2=y
|
||||
CONFIG_ZBOOT_LOAD_ADDRESS=0x80020000
|
||||
CONFIG_ARCH_FORCE_MAX_ORDER=11
|
||||
# CONFIG_MIPS_FP_SUPPORT is not set
|
||||
CONFIG_NR_CPUS=2
|
||||
CONFIG_HZ_100=y
|
||||
CONFIG_MIPS_RAW_APPENDED_DTB=y
|
||||
# CONFIG_SCHED_SMT is not set
|
||||
CONFIG_JUMP_LABEL=y
|
||||
# CONFIG_STACKPROTECTOR_STRONG is not set
|
||||
# CONFIG_GCC_PLUGINS is not set
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
|
||||
CONFIG_BLK_DEV_THROTTLING=y
|
||||
# CONFIG_BLK_DEBUG_FS is not set
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_OF_PARTITION=y
|
||||
# CONFIG_MQ_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_MQ_IOSCHED_KYBER is not set
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_SLAB_FREELIST_RANDOM=y
|
||||
CONFIG_SLAB_FREELIST_HARDENED=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_LRU_GEN=y
|
||||
CONFIG_LRU_GEN_ENABLED=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_IP_ADVANCED_ROUTER=y
|
||||
CONFIG_IP_MULTIPLE_TABLES=y
|
||||
CONFIG_IP_ROUTE_MULTIPATH=y
|
||||
CONFIG_IP_ROUTE_VERBOSE=y
|
||||
CONFIG_IP_MROUTE=y
|
||||
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
|
||||
CONFIG_IP_PIMSM_V1=y
|
||||
CONFIG_IP_PIMSM_V2=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
# CONFIG_INET_DIAG is not set
|
||||
CONFIG_TCP_CONG_ADVANCED=y
|
||||
# CONFIG_TCP_CONG_BIC is not set
|
||||
# CONFIG_TCP_CONG_WESTWOOD is not set
|
||||
# CONFIG_TCP_CONG_HTCP is not set
|
||||
# CONFIG_IPV6_SIT is not set
|
||||
CONFIG_IPV6_SUBTREES=y
|
||||
CONFIG_IPV6_MROUTE=y
|
||||
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
|
||||
CONFIG_IPV6_PIMSM_V2=y
|
||||
CONFIG_IPV6_SEG6_LWTUNNEL=y
|
||||
CONFIG_MPTCP=y
|
||||
CONFIG_NETFILTER=y
|
||||
# CONFIG_NETFILTER_EGRESS is not set
|
||||
CONFIG_NF_CONNTRACK=m
|
||||
CONFIG_NF_CONNTRACK_MARK=y
|
||||
CONFIG_NF_CONNTRACK_ZONES=y
|
||||
CONFIG_NF_CONNTRACK_PROCFS=y
|
||||
CONFIG_NF_CONNTRACK_TIMEOUT=y
|
||||
# CONFIG_NF_CT_PROTO_SCTP is not set
|
||||
CONFIG_NF_TABLES=m
|
||||
CONFIG_NF_TABLES_INET=y
|
||||
CONFIG_NF_TABLES_NETDEV=y
|
||||
CONFIG_NFT_NUMGEN=m
|
||||
CONFIG_NFT_CT=m
|
||||
CONFIG_NFT_FLOW_OFFLOAD=m
|
||||
CONFIG_NFT_LOG=m
|
||||
CONFIG_NFT_LIMIT=m
|
||||
CONFIG_NFT_MASQ=m
|
||||
CONFIG_NFT_REDIR=m
|
||||
CONFIG_NFT_NAT=m
|
||||
CONFIG_NFT_QUOTA=m
|
||||
CONFIG_NFT_REJECT=m
|
||||
CONFIG_NFT_HASH=m
|
||||
CONFIG_NFT_FIB_INET=m
|
||||
CONFIG_NF_FLOW_TABLE_INET=m
|
||||
CONFIG_NF_FLOW_TABLE=m
|
||||
CONFIG_NFT_FIB_IPV4=m
|
||||
CONFIG_NF_TABLES_ARP=y
|
||||
CONFIG_NF_LOG_IPV4=m
|
||||
CONFIG_NFT_FIB_IPV6=m
|
||||
CONFIG_NF_LOG_IPV6=m
|
||||
CONFIG_NF_TABLES_BRIDGE=m
|
||||
CONFIG_BRIDGE=y
|
||||
CONFIG_BRIDGE_VLAN_FILTERING=y
|
||||
CONFIG_VLAN_8021Q=y
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_FQ_CODEL=y
|
||||
CONFIG_NET_SCH_DEFAULT=y
|
||||
CONFIG_DEFAULT_FQ_CODEL=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NET_L3_MASTER_DEV=y
|
||||
CONFIG_RFKILL=y
|
||||
# CONFIG_LWTUNNEL_BPF is not set
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
CONFIG_PCIEAER=y
|
||||
# CONFIG_PCIEASPM is not set
|
||||
CONFIG_PCI_MSI=y
|
||||
# CONFIG_VGA_ARB is not set
|
||||
CONFIG_PCIE_MEDIATEK=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_CFI_AMDSTD=y
|
||||
CONFIG_MTD_COMPLEX_MAPPINGS=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=13
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_NET_VENDOR_ASIX is not set
|
||||
# CONFIG_NET_VENDOR_ENGLEDER is not set
|
||||
# CONFIG_NET_VENDOR_FUNGIBLE is not set
|
||||
# CONFIG_NET_VENDOR_LITEX is not set
|
||||
# CONFIG_NET_VENDOR_MICROSOFT is not set
|
||||
# CONFIG_NET_VENDOR_VERTEXCOM is not set
|
||||
# CONFIG_NET_VENDOR_WANGXUN is not set
|
||||
CONFIG_PPP=m
|
||||
CONFIG_PPP_FILTER=y
|
||||
CONFIG_PPP_MULTILINK=y
|
||||
CONFIG_PPPOE=m
|
||||
CONFIG_PPP_ASYNC=m
|
||||
# CONFIG_WLAN_VENDOR_ADMTEK is not set
|
||||
# CONFIG_WLAN_VENDOR_ATH is not set
|
||||
# CONFIG_WLAN_VENDOR_ATMEL is not set
|
||||
# CONFIG_WLAN_VENDOR_BROADCOM is not set
|
||||
# CONFIG_WLAN_VENDOR_INTEL is not set
|
||||
# CONFIG_WLAN_VENDOR_INTERSIL is not set
|
||||
# CONFIG_WLAN_VENDOR_MARVELL is not set
|
||||
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
|
||||
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
|
||||
# CONFIG_WLAN_VENDOR_PURELIFI is not set
|
||||
# CONFIG_WLAN_VENDOR_RALINK is not set
|
||||
# CONFIG_WLAN_VENDOR_REALTEK is not set
|
||||
# CONFIG_WLAN_VENDOR_RSI is not set
|
||||
# CONFIG_WLAN_VENDOR_SILABS is not set
|
||||
# CONFIG_WLAN_VENDOR_ST is not set
|
||||
# CONFIG_WLAN_VENDOR_TI is not set
|
||||
# CONFIG_WLAN_VENDOR_ZYDAS is not set
|
||||
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
|
||||
# CONFIG_INPUT is not set
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_VT is not set
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_LEGACY_TIOCSTI is not set
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_DEVMEM is not set
|
||||
CONFIG_SPI=y
|
||||
# CONFIG_PTP_1588_CLOCK is not set
|
||||
CONFIG_GPIOLIB=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
# CONFIG_USB_PCI is not set
|
||||
CONFIG_NEW_LEDS=y
|
||||
CONFIG_LEDS_CLASS=y
|
||||
CONFIG_LEDS_CLASS_MULTICOLOR=y
|
||||
CONFIG_LEDS_GPIO=m
|
||||
CONFIG_LEDS_TRIGGERS=y
|
||||
CONFIG_LEDS_TRIGGER_TIMER=y
|
||||
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
||||
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
|
||||
CONFIG_LEDS_TRIGGER_NETDEV=y
|
||||
CONFIG_STAGING=y
|
||||
# CONFIG_MIPS_PLATFORM_DEVICES is not set
|
||||
CONFIG_COMMON_CLK_EN7523=y
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_PHY_ECONET_PCIE=y
|
||||
# CONFIG_DNOTIFY is not set
|
||||
CONFIG_FANOTIFY=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
# CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW is not set
|
||||
# CONFIG_PROC_PAGE_MONITOR is not set
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_JFFS2_SUMMARY=y
|
||||
CONFIG_JFFS2_FS_XATTR=y
|
||||
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
CONFIG_SQUASHFS=y
|
||||
CONFIG_SQUASHFS_FILE_DIRECT=y
|
||||
CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y
|
||||
# CONFIG_SQUASHFS_ZLIB is not set
|
||||
CONFIG_SQUASHFS_XZ=y
|
||||
CONFIG_SQUASHFS_EMBEDDED=y
|
||||
CONFIG_KEYS=y
|
||||
CONFIG_INIT_STACK_NONE=y
|
||||
CONFIG_FORTIFY_SOURCE=y
|
||||
CONFIG_HARDENED_USERCOPY=y
|
||||
CONFIG_LIST_HARDENED=y
|
||||
CONFIG_CRYPTO_NULL=y
|
||||
CONFIG_CRYPTO_AES=y
|
||||
CONFIG_CRYPTO_CCM=y
|
||||
CONFIG_CRYPTO_GCM=y
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
# CONFIG_XZ_DEC_X86 is not set
|
||||
# CONFIG_XZ_DEC_POWERPC is not set
|
||||
# CONFIG_XZ_DEC_ARM is not set
|
||||
# CONFIG_XZ_DEC_ARMTHUMB is not set
|
||||
# CONFIG_XZ_DEC_ARM64 is not set
|
||||
# CONFIG_XZ_DEC_SPARC is not set
|
||||
# CONFIG_XZ_DEC_RISCV is not set
|
||||
CONFIG_PRINTK_TIME=y
|
||||
# CONFIG_DEBUG_MISC is not set
|
||||
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
|
||||
CONFIG_DEBUG_INFO_REDUCED=y
|
||||
CONFIG_FRAME_WARN=1024
|
||||
CONFIG_STRIP_ASM_SYMS=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
# CONFIG_MAGIC_SYSRQ_SERIAL is not set
|
||||
CONFIG_DEBUG_FS=y
|
||||
# CONFIG_SLUB_DEBUG is not set
|
||||
CONFIG_SCHED_STACK_END_CHECK=y
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
CONFIG_PANIC_TIMEOUT=1
|
||||
CONFIG_RCU_CPU_STALL_TIMEOUT=60
|
||||
# CONFIG_RCU_TRACE is not set
|
||||
# CONFIG_FTRACE is not set
|
||||
|
|
@ -1183,7 +1183,7 @@ static void emit_jmp_i64(struct jit_context *ctx,
|
|||
emit(ctx, xor, tmp, lo(dst), tmp);
|
||||
}
|
||||
if (imm < 0) { /* Compare sign extension */
|
||||
emit(ctx, addu, MIPS_R_T9, hi(dst), 1);
|
||||
emit(ctx, addiu, MIPS_R_T9, hi(dst), 1);
|
||||
emit(ctx, or, tmp, tmp, MIPS_R_T9);
|
||||
} else { /* Compare zero extension */
|
||||
emit(ctx, or, tmp, tmp, hi(dst));
|
||||
|
|
|
|||
|
|
@ -382,8 +382,7 @@ static void emit_bswap_r64(struct jit_context *ctx, u8 dst, u32 width)
|
|||
case 16:
|
||||
emit_sext(ctx, dst, dst);
|
||||
emit_bswap_r(ctx, dst, width);
|
||||
if (cpu_has_mips64r2 || cpu_has_mips64r6)
|
||||
emit_zext(ctx, dst);
|
||||
emit_zext(ctx, dst);
|
||||
break;
|
||||
}
|
||||
clobber_reg(ctx, dst);
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H
|
||||
#define _ASM_PARISC_COMPAT_UCONTEXT_H
|
||||
|
||||
#include <linux/compat.h>
|
||||
|
||||
/* 32-bit ucontext as seen from an 64-bit kernel */
|
||||
struct compat_ucontext {
|
||||
compat_uint_t uc_flags;
|
||||
compat_uptr_t uc_link;
|
||||
compat_stack_t uc_stack; /* struct compat_sigaltstack (12 bytes)*/
|
||||
/* FIXME: Pad out to get uc_mcontext to start at an 8-byte aligned boundary */
|
||||
compat_uint_t pad[1];
|
||||
struct compat_sigcontext uc_mcontext;
|
||||
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
#endif /* !_ASM_PARISC_COMPAT_UCONTEXT_H */
|
||||
|
|
@ -24,7 +24,7 @@ struct thread_info {
|
|||
|
||||
/* thread information allocation */
|
||||
|
||||
#ifdef CONFIG_IRQSTACKS
|
||||
#if defined(CONFIG_IRQSTACKS) && !defined(CONFIG_64BIT)
|
||||
#define THREAD_SIZE_ORDER 2 /* PA-RISC requires at least 16k stack */
|
||||
#else
|
||||
#define THREAD_SIZE_ORDER 3 /* PA-RISC requires at least 32k stack */
|
||||
|
|
|
|||
|
|
@ -132,6 +132,18 @@ void __init setup_arch(char **cmdline_p)
|
|||
parisc_cache_init();
|
||||
paging_init();
|
||||
|
||||
/*
|
||||
* Parse early parameters before mm_core_init_early() runs.
|
||||
* Several early_param() handlers only record data that is consumed
|
||||
* from there - for example hugepages=, hugepagesz=,
|
||||
* default_hugepagesz=, hugetlb_cma= and hugetlb_free_vmemmap= - so
|
||||
* the generic parse_early_param() call in start_kernel() is too late
|
||||
* for them. jump_label_init() must come first, since early param
|
||||
* handlers may enable or disable static keys.
|
||||
*/
|
||||
jump_label_init();
|
||||
parse_early_param();
|
||||
|
||||
#ifdef CONFIG_PA11
|
||||
dma_ops_init();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sort.h>
|
||||
#include <linux/bsearch.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
|
@ -49,27 +50,23 @@ static DEFINE_SPINLOCK(unwind_lock);
|
|||
static struct unwind_table kernel_unwind_table __ro_after_init;
|
||||
static LIST_HEAD(unwind_tables);
|
||||
|
||||
static int cmp_unwind_entry(const void *key, const void *elt)
|
||||
{
|
||||
unsigned long addr = (unsigned long)key;
|
||||
const struct unwind_table_entry *e = elt;
|
||||
|
||||
if (addr < e->region_start)
|
||||
return -1;
|
||||
if (addr > e->region_end)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline const struct unwind_table_entry *
|
||||
find_unwind_entry_in_table(const struct unwind_table *table, unsigned long addr)
|
||||
{
|
||||
const struct unwind_table_entry *e = NULL;
|
||||
unsigned long lo, hi, mid;
|
||||
|
||||
lo = 0;
|
||||
hi = table->length - 1;
|
||||
|
||||
while (lo <= hi) {
|
||||
mid = (hi - lo) / 2 + lo;
|
||||
e = &table->table[mid];
|
||||
if (addr < e->region_start)
|
||||
hi = mid - 1;
|
||||
else if (addr > e->region_end)
|
||||
lo = mid + 1;
|
||||
else
|
||||
return e;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return bsearch((void *)addr, table->table, table->length,
|
||||
sizeof(*table->table), cmp_unwind_entry);
|
||||
}
|
||||
|
||||
static const struct unwind_table_entry *
|
||||
|
|
|
|||
|
|
@ -222,8 +222,6 @@ static inline void arch_interrupt_enter_prepare(struct pt_regs *regs)
|
|||
|
||||
if (user_mode(regs)) {
|
||||
kuap_lock();
|
||||
account_cpu_user_entry();
|
||||
account_stolen_time();
|
||||
} else {
|
||||
kuap_save_and_lock(regs);
|
||||
/*
|
||||
|
|
@ -270,7 +268,7 @@ static inline void arch_interrupt_exit_prepare(struct pt_regs *regs)
|
|||
}
|
||||
|
||||
/* irqentry_exit expects to be called with interrupts disabled */
|
||||
local_irq_disable();
|
||||
hard_irq_disable();
|
||||
}
|
||||
|
||||
static inline void arch_interrupt_async_enter_prepare(struct pt_regs *regs)
|
||||
|
|
@ -515,8 +513,14 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
|
|||
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
|
||||
local_paca->tm_scratch = regs->msr;
|
||||
#endif
|
||||
/* Restore user access locks last */
|
||||
kuap_user_restore(regs);
|
||||
/*
|
||||
* Do not restore KUAP here. Generic entry might treat this as the last
|
||||
* arch step before userspace but PowerPC still has kernel work after
|
||||
* irqentry_exit()/syscall_exit_to_user_mode() i.e. in
|
||||
* interrupt_exit_user_prepare() / syscall_exit_prepare() may enable
|
||||
* IRQs and retry. Those functions restore KUAP immediately before rfi,
|
||||
* which is where it should belong.
|
||||
*/
|
||||
}
|
||||
|
||||
#define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare
|
||||
|
|
|
|||
|
|
@ -533,9 +533,7 @@ static void eeh_rmv_device(struct eeh_dev *edev, void *userdata)
|
|||
if (rmv_data)
|
||||
list_add(&edev->rmv_entry, &rmv_data->removed_vf_list);
|
||||
} else {
|
||||
pci_lock_rescan_remove();
|
||||
pci_stop_and_remove_bus_device(dev);
|
||||
pci_unlock_rescan_remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ notrace unsigned long syscall_exit_restart(unsigned long r3, struct pt_regs *reg
|
|||
current_thread_info()->exit_flags &= ~_TIF_RESTOREALL;
|
||||
regs->exit_result |= ret;
|
||||
|
||||
return ret;
|
||||
return regs->exit_result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1076,7 +1076,7 @@ int iommu_tce_check_ioba(unsigned long page_shift,
|
|||
if (ioba < offset)
|
||||
return -EINVAL;
|
||||
|
||||
if ((ioba + 1) > (offset + size))
|
||||
if ((ioba + npages < ioba) || (ioba - offset + npages > size))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -824,7 +824,6 @@ void __init early_init_devtree(void *params)
|
|||
fadump_append_bootargs();
|
||||
|
||||
/* Scan memory nodes and rebuild MEMBLOCKs */
|
||||
early_init_dt_scan_root();
|
||||
early_init_dt_scan_memory_ppc();
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ int rtas_pci_dn_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
|
|||
if (!config_access_valid(pdn, where))
|
||||
return PCIBIOS_BAD_REGISTER_NUMBER;
|
||||
#ifdef CONFIG_EEH
|
||||
if (pdn->edev &&
|
||||
(pdn->edev->mode & EEH_DEV_REMOVED))
|
||||
return PCIBIOS_DEVICE_NOT_FOUND;
|
||||
|
||||
if (pdn->edev && pdn->edev->pe &&
|
||||
(pdn->edev->pe->state & EEH_PE_CFG_BLOCKED))
|
||||
return PCIBIOS_SET_FAILED;
|
||||
|
|
@ -105,6 +109,10 @@ int rtas_pci_dn_write_config(struct pci_dn *pdn, int where, int size, u32 val)
|
|||
if (!config_access_valid(pdn, where))
|
||||
return PCIBIOS_BAD_REGISTER_NUMBER;
|
||||
#ifdef CONFIG_EEH
|
||||
if (pdn->edev &&
|
||||
(pdn->edev->mode & EEH_DEV_REMOVED))
|
||||
return PCIBIOS_DEVICE_NOT_FOUND;
|
||||
|
||||
if (pdn->edev && pdn->edev->pe &&
|
||||
(pdn->edev->pe->state & EEH_PE_CFG_BLOCKED))
|
||||
return PCIBIOS_SET_FAILED;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,10 @@ notrace long system_call_exception(struct pt_regs *regs, unsigned long r0)
|
|||
long ret;
|
||||
syscall_fn f;
|
||||
|
||||
if (unlikely(!syscall_enter_from_user_mode_randomize_stack(regs, &r0)))
|
||||
if (unlikely(!syscall_enter_from_user_mode_randomize_stack(regs, &r0))) {
|
||||
clear_thread_flag(TIF_SYSCALL_RET);
|
||||
return syscall_get_error(current, regs);
|
||||
}
|
||||
|
||||
if (unlikely(test_and_clear_thread_flag(TIF_SYSCALL_RET)))
|
||||
return syscall_get_error(current, regs);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ static void *elf64_load(struct kimage *image, char *kernel_buf,
|
|||
cmdline = modified_cmdline;
|
||||
}
|
||||
|
||||
kexec_dprintk("Command line: %s", cmdline ? cmdline : "");
|
||||
|
||||
if (initrd != NULL) {
|
||||
kbuf.buffer = initrd;
|
||||
kbuf.bufsz = kbuf.memsz = initrd_len;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ int arch_check_excluded_range(struct kimage *image, unsigned long start,
|
|||
|
||||
emem = image->arch.exclude_ranges;
|
||||
for (i = 0; i < emem->nr_ranges; i++)
|
||||
if (start < emem->ranges[i].end && end > emem->ranges[i].start)
|
||||
if (start <= emem->ranges[i].end && end >= emem->ranges[i].start)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
|
@ -113,7 +113,7 @@ static int add_usable_mem(struct umem_info *um_info, u64 base, u64 end)
|
|||
loc_end = um_info->ranges[i].end;
|
||||
if (loc_base >= base && loc_end <= end)
|
||||
add = true;
|
||||
else if (base < loc_end && end > loc_base) {
|
||||
else if (base <= loc_end && end >= loc_base) {
|
||||
if (loc_base < base)
|
||||
loc_base = base;
|
||||
if (loc_end > end)
|
||||
|
|
@ -377,16 +377,12 @@ static int load_backup_segment(struct kimage *image, struct kexec_buf *kbuf)
|
|||
static unsigned int kdump_extra_elfcorehdr_size(struct crash_mem *cmem)
|
||||
{
|
||||
#if defined(CONFIG_CRASH_HOTPLUG) && defined(CONFIG_MEMORY_HOTPLUG)
|
||||
unsigned int extra_sz = 0;
|
||||
|
||||
if (CONFIG_CRASH_MAX_MEMORY_RANGES > (unsigned int)PN_XNUM)
|
||||
pr_warn("Number of Phdrs %u exceeds max\n", CONFIG_CRASH_MAX_MEMORY_RANGES);
|
||||
else if (cmem->nr_ranges >= CONFIG_CRASH_MAX_MEMORY_RANGES)
|
||||
pr_warn("Configured crash mem ranges may not be enough\n");
|
||||
else
|
||||
extra_sz = (CONFIG_CRASH_MAX_MEMORY_RANGES - cmem->nr_ranges) * sizeof(Elf64_Phdr);
|
||||
|
||||
return extra_sz;
|
||||
return (CONFIG_CRASH_MAX_MEMORY_RANGES - cmem->nr_ranges) * sizeof(Elf64_Phdr);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6140,12 +6140,12 @@ static int kvmppc_irq_bypass_add_producer_hv(struct irq_bypass_consumer *cons,
|
|||
struct kvm_kernel_irqfd *irqfd =
|
||||
container_of(cons, struct kvm_kernel_irqfd, consumer);
|
||||
|
||||
irqfd->producer = prod;
|
||||
|
||||
ret = kvmppc_set_passthru_irq(irqfd->kvm, prod->irq, irqfd->gsi);
|
||||
if (ret)
|
||||
pr_info("kvmppc_set_passthru_irq (irq %d, gsi %d) fails: %d\n",
|
||||
prod->irq, irqfd->gsi, ret);
|
||||
else
|
||||
irqfd->producer = prod;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1204,8 +1204,10 @@ static void kvmhv_emulate_tlbie_all_lpid(struct kvm_vcpu *vcpu, int ric)
|
|||
|
||||
spin_lock(&kvm->mmu_lock);
|
||||
idr_for_each_entry(&kvm->arch.kvm_nested_guest_idr, gp, lpid) {
|
||||
++gp->refcnt;
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
kvmhv_emulate_tlbie_lpid(vcpu, gp, ric);
|
||||
kvmhv_put_nested(gp);
|
||||
spin_lock(&kvm->mmu_lock);
|
||||
}
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
|
|
|
|||
|
|
@ -779,8 +779,11 @@ static int kvmppc_svm_page_in(struct vm_area_struct *vma,
|
|||
if (spage) {
|
||||
ret = uv_page_in(kvm->arch.lpid, pfn << page_shift,
|
||||
gpa, 0, page_shift);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
unlock_page(dpage);
|
||||
put_page(dpage);
|
||||
goto out_finalize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@ static int __init pas_setup_mce_regs(void)
|
|||
while (dev && reg < MAX_MCE_REGS) {
|
||||
mce_regs[reg].name = kasprintf(GFP_KERNEL,
|
||||
"mc%d_mcdebug_errsta", reg);
|
||||
if (!mce_regs[reg].name)
|
||||
return -ENOMEM;
|
||||
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x730);
|
||||
dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, dev);
|
||||
reg++;
|
||||
|
|
|
|||
|
|
@ -1623,15 +1623,13 @@ int64_t pnv_opal_pci_msi_eoi(struct irq_data *d)
|
|||
return opal_pci_msi_eoi(phb->opal_id, d->parent_data->hwirq);
|
||||
}
|
||||
|
||||
static struct irq_chip pnv_pci_msi_irq_chip;
|
||||
|
||||
/*
|
||||
* Returns true iff chip is something that we could call
|
||||
* pnv_opal_pci_msi_eoi for.
|
||||
*/
|
||||
bool is_pnv_opal_msi(struct irq_chip *chip)
|
||||
{
|
||||
return chip == &pnv_pci_msi_irq_chip;
|
||||
return chip && chip->name && str_has_prefix(chip->name, "PNV-");
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(is_pnv_opal_msi);
|
||||
|
||||
|
|
@ -1728,7 +1726,7 @@ static const struct msi_parent_ops pnv_msi_parent_ops = {
|
|||
.chip_flags = MSI_CHIP_FLAG_SET_EOI,
|
||||
.bus_select_token = DOMAIN_BUS_NEXUS,
|
||||
.bus_select_mask = MATCH_PCI_MSI,
|
||||
.prefix = "PNV-",
|
||||
.prefix = "PNV-", /* Note: is_pnv_opal_msi() uses this */
|
||||
.init_dev_msi_info = pnv_init_dev_msi_info,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
* Copyright 2006 Sony Corp.
|
||||
*/
|
||||
|
||||
#include <linux/minmax.h>
|
||||
|
||||
#include <asm/lv1call.h>
|
||||
|
||||
#include "platform.h"
|
||||
|
|
@ -74,8 +76,9 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
|
|||
static u64 make_first_field(const char *text, u64 index)
|
||||
{
|
||||
u64 n = 0;
|
||||
size_t len = min(strlen(text), sizeof(n));
|
||||
|
||||
memcpy((char *)&n, text, strnlen(text, sizeof(n)));
|
||||
memcpy(&n, text, len);
|
||||
return PS3_VENDOR_ID_NONE + (n >> 32) + index;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -527,28 +527,28 @@ static int htmdump_init_debugfs(void)
|
|||
htm_status_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!htm_status_buf) {
|
||||
pr_err("Failed to allocate htmstatus buf\n");
|
||||
return -ENOMEM;
|
||||
goto htm_status_buf_err;
|
||||
}
|
||||
|
||||
/* Debugfs interface file to present System Processor Configuration */
|
||||
htm_info_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!htm_info_buf) {
|
||||
pr_err("Failed to allocate htm info buf\n");
|
||||
return -ENOMEM;
|
||||
goto htm_info_buf_err;
|
||||
}
|
||||
|
||||
/* Debugfs interface file to present HTM capabilities */
|
||||
htm_caps_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!htm_caps_buf) {
|
||||
pr_err("Failed to allocate htm caps buf\n");
|
||||
return -ENOMEM;
|
||||
goto htm_caps_buf_err;
|
||||
}
|
||||
|
||||
/* Memory to present HTM system memory configuration */
|
||||
htm_mem_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!htm_mem_buf) {
|
||||
pr_err("Failed to allocate htm mem buf\n");
|
||||
return -ENOMEM;
|
||||
goto htm_mem_buf_err;
|
||||
}
|
||||
|
||||
debugfs_create_file("htmstatus", 0400, htmdump_debugfs_dir, htm_status_buf, &htmstatus_fops);
|
||||
|
|
@ -557,6 +557,17 @@ static int htmdump_init_debugfs(void)
|
|||
debugfs_create_file("htmsystem_mem", 0400, htmdump_debugfs_dir, htm_mem_buf, &htmsystem_mem_fops);
|
||||
|
||||
return 0;
|
||||
|
||||
htm_mem_buf_err:
|
||||
kfree(htm_caps_buf);
|
||||
htm_caps_buf_err:
|
||||
kfree(htm_info_buf);
|
||||
htm_info_buf_err:
|
||||
kfree(htm_status_buf);
|
||||
htm_status_buf_err:
|
||||
debugfs_remove_recursive(htmdump_debugfs_dir);
|
||||
kfree(htm_buf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static int __init htmdump_init(void)
|
||||
|
|
|
|||
|
|
@ -132,11 +132,14 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
|
|||
|
||||
/* First integer stores max config */
|
||||
max_config_vfs = of_read_number(&max_vfs[0], 1);
|
||||
if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) {
|
||||
dev_err(&pdev->dev,
|
||||
"Num VFs %x > %x Configurable VFs\n",
|
||||
num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ?
|
||||
MAX_VFS_FOR_MAP_PE : max_config_vfs);
|
||||
if (max_config_vfs < num_vfs) {
|
||||
dev_err(&pdev->dev, "Num VFs %x > %x Configurable VFs\n",
|
||||
num_vfs, max_config_vfs);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (num_vfs > MAX_VFS_FOR_MAP_PE) {
|
||||
dev_err(&pdev->dev, "Num VFs %x > %x PE mapping limit\n",
|
||||
num_vfs, MAX_VFS_FOR_MAP_PE);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ config STACKTRACE_SUPPORT
|
|||
config GENERIC_BUG
|
||||
def_bool y
|
||||
depends on BUG
|
||||
select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
|
||||
select GENERIC_BUG_RELATIVE_POINTERS
|
||||
|
||||
config GENERIC_BUG_RELATIVE_POINTERS
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -29,13 +29,8 @@
|
|||
|
||||
typedef u32 bug_insn_t;
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||
#define __BUG_ENTRY_ADDR RISCV_INT " 1b - ."
|
||||
#define __BUG_ENTRY_FILE(file) RISCV_INT " " file " - ."
|
||||
#else
|
||||
#define __BUG_ENTRY_ADDR RISCV_PTR " 1b"
|
||||
#define __BUG_ENTRY_FILE(file) RISCV_PTR " " file
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
#define __BUG_ENTRY(file, line, flags) \
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ static inline void __switch_to_fpu(struct task_struct *prev,
|
|||
|
||||
static __always_inline bool has_fpu(void)
|
||||
{
|
||||
return riscv_has_extension_likely(RISCV_ISA_EXT_F) ||
|
||||
riscv_has_extension_likely(RISCV_ISA_EXT_D);
|
||||
/* D extension depends on F, so checking D alone is sufficient. */
|
||||
return riscv_has_extension_likely(RISCV_ISA_EXT_D);
|
||||
}
|
||||
#else
|
||||
static __always_inline bool has_fpu(void) { return false; }
|
||||
|
|
|
|||
|
|
@ -412,6 +412,19 @@ static const unsigned int riscv_zvbb_exts[] = {
|
|||
RISCV_ISA_EXT_ZVKB
|
||||
};
|
||||
|
||||
/*
|
||||
* The RISC-V ISA manual specifies that Zfh implies Zfhmin and Zvfh implies
|
||||
* Zvfhmin. Report the implied subset extensions whenever the supersets are
|
||||
* detected (see https://github.com/riscv/riscv-isa-manual/pull/3070).
|
||||
*/
|
||||
static const unsigned int riscv_zfh_exts[] = {
|
||||
RISCV_ISA_EXT_ZFHMIN
|
||||
};
|
||||
|
||||
static const unsigned int riscv_zvfh_exts[] = {
|
||||
RISCV_ISA_EXT_ZVFHMIN
|
||||
};
|
||||
|
||||
#define RISCV_ISA_EXT_ZVE64F_IMPLY_LIST \
|
||||
RISCV_ISA_EXT_ZVE64X, \
|
||||
RISCV_ISA_EXT_ZVE32F, \
|
||||
|
|
@ -550,7 +563,8 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
|
|||
__RISCV_ISA_EXT_DATA(zawrs, RISCV_ISA_EXT_ZAWRS),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zfa, RISCV_ISA_EXT_ZFA, riscv_ext_f_depends),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zfbfmin, RISCV_ISA_EXT_ZFBFMIN, riscv_ext_f_depends),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zfh, RISCV_ISA_EXT_ZFH, riscv_ext_f_depends),
|
||||
__RISCV_ISA_EXT_SUPERSET_VALIDATE(zfh, RISCV_ISA_EXT_ZFH,
|
||||
riscv_zfh_exts, riscv_ext_f_depends),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zfhmin, RISCV_ISA_EXT_ZFHMIN, riscv_ext_f_depends),
|
||||
__RISCV_ISA_EXT_DATA(zca, RISCV_ISA_EXT_ZCA),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zcb, RISCV_ISA_EXT_ZCB, riscv_ext_zca_depends),
|
||||
|
|
@ -586,7 +600,9 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
|
|||
__RISCV_ISA_EXT_SUPERSET_VALIDATE(zve64x, RISCV_ISA_EXT_ZVE64X, riscv_zve64x_exts, riscv_ext_vector_x_validate),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zvfbfmin, RISCV_ISA_EXT_ZVFBFMIN, riscv_vector_f_validate),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zvfbfwma, RISCV_ISA_EXT_ZVFBFWMA, riscv_ext_zvfbfwma_validate),
|
||||
__RISCV_ISA_EXT_DATA(zvfh, RISCV_ISA_EXT_ZVFH),
|
||||
__RISCV_ISA_EXT_SUPERSET_VALIDATE(zvfh, RISCV_ISA_EXT_ZVFH,
|
||||
riscv_zvfh_exts,
|
||||
riscv_ext_vector_float_validate),
|
||||
__RISCV_ISA_EXT_DATA(zvfhmin, RISCV_ISA_EXT_ZVFHMIN),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zvkb, RISCV_ISA_EXT_ZVKB, riscv_ext_vector_crypto_validate),
|
||||
__RISCV_ISA_EXT_DATA_VALIDATE(zvkg, RISCV_ISA_EXT_ZVKG, riscv_ext_vector_crypto_validate),
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ static __always_inline void *patch_map(void *addr, const unsigned int fixmap)
|
|||
phys_addr_t phys;
|
||||
|
||||
if (core_kernel_text(uintaddr) || is_kernel_exittext(uintaddr)) {
|
||||
if (!IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))
|
||||
return addr;
|
||||
phys = __pa_symbol(addr);
|
||||
} else if (IS_ENABLED(CONFIG_STRICT_MODULE_RWX)) {
|
||||
struct page *page = vmalloc_to_page(addr);
|
||||
|
|
|
|||
|
|
@ -349,10 +349,8 @@ long set_tagged_addr_ctrl(struct task_struct *task, unsigned long arg)
|
|||
if (arg & PR_TAGGED_ADDR_ENABLE && (tagged_addr_disabled || !pmlen))
|
||||
return -EINVAL;
|
||||
|
||||
if (!(arg & PR_TAGGED_ADDR_ENABLE)) {
|
||||
if (!(arg & PR_TAGGED_ADDR_ENABLE))
|
||||
pmlen = PMLEN_0;
|
||||
pmm = ENVCFG_PMM_PMLEN_0;
|
||||
}
|
||||
|
||||
if (mmap_write_lock_killable(mm))
|
||||
return -EINTR;
|
||||
|
|
|
|||
|
|
@ -297,6 +297,8 @@ static u64 hwprobe_vec_misaligned(const struct cpumask *cpus)
|
|||
static void hwprobe_one_pair(struct riscv_hwprobe *pair,
|
||||
const struct cpumask *cpus)
|
||||
{
|
||||
pair->value = 0;
|
||||
|
||||
switch (pair->key) {
|
||||
case RISCV_HWPROBE_KEY_MVENDORID:
|
||||
case RISCV_HWPROBE_KEY_MARCHID:
|
||||
|
|
@ -331,17 +333,14 @@ static void hwprobe_one_pair(struct riscv_hwprobe *pair,
|
|||
break;
|
||||
|
||||
case RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE:
|
||||
pair->value = 0;
|
||||
if (hwprobe_ext0_has(cpus, RISCV_HWPROBE_EXT_ZICBOZ))
|
||||
pair->value = riscv_cboz_block_size;
|
||||
break;
|
||||
case RISCV_HWPROBE_KEY_ZICBOM_BLOCK_SIZE:
|
||||
pair->value = 0;
|
||||
if (hwprobe_ext0_has(cpus, RISCV_HWPROBE_EXT_ZICBOM))
|
||||
pair->value = riscv_cbom_block_size;
|
||||
break;
|
||||
case RISCV_HWPROBE_KEY_ZICBOP_BLOCK_SIZE:
|
||||
pair->value = 0;
|
||||
if (hwprobe_ext0_has(cpus, RISCV_HWPROBE_EXT_ZICBOP))
|
||||
pair->value = riscv_cbop_block_size;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -525,9 +525,8 @@ static int __init setup_global_riscv_enable(char *str)
|
|||
|
||||
if (riscv_nousercfi)
|
||||
pr_info("RISC-V user CFI disabled via cmdline - shadow stack status : %s, landing pad status : %s\n",
|
||||
(riscv_nousercfi & CMDLINE_DISABLE_RISCV_USERCFI_BCFI) ? "disabled" :
|
||||
"enabled", (riscv_nousercfi & CMDLINE_DISABLE_RISCV_USERCFI_FCFI) ?
|
||||
"disabled" : "enabled");
|
||||
str_disabled_enabled(riscv_nousercfi & CMDLINE_DISABLE_RISCV_USERCFI_BCFI),
|
||||
str_disabled_enabled(riscv_nousercfi & CMDLINE_DISABLE_RISCV_USERCFI_FCFI));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ SYM_FUNC_START(fallback_scalar_usercopy_sum_enabled)
|
|||
li a3, 9*SZREG-1 /* size must >= (word_copy stride + SZREG-1) */
|
||||
bltu a2, a3, .Lbyte_copy_tail
|
||||
|
||||
#if !defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
|
||||
/*
|
||||
* Copy first bytes until dst is aligned to word boundary.
|
||||
* a0 - start of dst
|
||||
|
|
@ -103,7 +104,7 @@ SYM_FUNC_START(fallback_scalar_usercopy_sum_enabled)
|
|||
/* a1 - start of src */
|
||||
andi a3, a1, SZREG-1
|
||||
bnez a3, .Lshift_copy
|
||||
|
||||
#endif
|
||||
.Lword_copy:
|
||||
/*
|
||||
* Both src and dst are aligned, unrolled word copy
|
||||
|
|
@ -137,6 +138,7 @@ SYM_FUNC_START(fallback_scalar_usercopy_sum_enabled)
|
|||
addi t0, t0, 8*SZREG /* revert to original value */
|
||||
j .Lbyte_copy_tail
|
||||
|
||||
#if !defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
|
||||
.Lshift_copy:
|
||||
|
||||
/*
|
||||
|
|
@ -189,6 +191,7 @@ SYM_FUNC_START(fallback_scalar_usercopy_sum_enabled)
|
|||
|
||||
/* Revert src to original unaligned value */
|
||||
add a1, a1, a3
|
||||
#endif
|
||||
|
||||
.Lbyte_copy_tail:
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1465,7 +1465,9 @@ struct execmem_info __init *execmem_arch_setup(void)
|
|||
[EXECMEM_KPROBES] = {
|
||||
.start = VMALLOC_START,
|
||||
.end = VMALLOC_END,
|
||||
.pgprot = PAGE_KERNEL_READ_EXEC,
|
||||
.pgprot = IS_ENABLED(CONFIG_STRICT_MODULE_RWX) ?
|
||||
PAGE_KERNEL_READ_EXEC :
|
||||
PAGE_KERNEL_EXEC,
|
||||
.alignment = 1,
|
||||
},
|
||||
[EXECMEM_BPF] = {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
# Cryptographic API
|
||||
#
|
||||
|
||||
CONTEXT_ANALYSIS := y
|
||||
|
||||
obj-$(CONFIG_CRYPTO_AES_S390) += aes_s390.o
|
||||
obj-$(CONFIG_CRYPTO_PAES_S390) += paes_s390.o
|
||||
obj-$(CONFIG_S390_PRNG) += prng.o
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/cpufeature.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/fips.h>
|
||||
#include <linux/semaphore.h>
|
||||
#include <linux/string.h>
|
||||
#include <crypto/xts.h>
|
||||
#include <asm/cpacf.h>
|
||||
|
||||
static u8 *ctrblk;
|
||||
static DEFINE_MUTEX(ctrblk_lock);
|
||||
static DEFINE_SEMAPHORE(ctrblk_sem, 1);
|
||||
|
||||
static cpacf_mask_t km_functions, kmc_functions, kmctr_functions,
|
||||
kma_functions;
|
||||
|
|
@ -129,7 +129,7 @@ static int ecb_aes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
return fallback_skcipher_crypt(sctx, req, modifier);
|
||||
|
||||
ret = skcipher_walk_virt(&walk, req, false);
|
||||
while ((nbytes = walk.nbytes) != 0) {
|
||||
while (!ret && ((nbytes = walk.nbytes) != 0)) {
|
||||
/* only use complete blocks */
|
||||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
cpacf_km(sctx->fc | modifier, sctx->key,
|
||||
|
|
@ -233,7 +233,7 @@ static int cbc_aes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
return ret;
|
||||
memcpy(param.iv, walk.iv, AES_BLOCK_SIZE);
|
||||
memcpy(param.key, sctx->key, sctx->key_len);
|
||||
while ((nbytes = walk.nbytes) != 0) {
|
||||
while (!ret && ((nbytes = walk.nbytes) != 0)) {
|
||||
/* only use complete blocks */
|
||||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
cpacf_kmc(sctx->fc | modifier, ¶m,
|
||||
|
|
@ -359,7 +359,7 @@ static int xts_aes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
memcpy(xts_param.key + offset, xts_ctx->key, xts_ctx->key_len);
|
||||
memcpy(xts_param.init, pcc_param.xts, 16);
|
||||
|
||||
while ((nbytes = walk.nbytes) != 0) {
|
||||
while (!ret && ((nbytes = walk.nbytes) != 0)) {
|
||||
/* only use complete blocks */
|
||||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
cpacf_km(xts_ctx->fc | modifier, xts_param.key + offset,
|
||||
|
|
@ -487,7 +487,7 @@ static int fullxts_aes_crypt(struct skcipher_request *req, unsigned long modifi
|
|||
memcpy(fxts_param.tweak, req->iv, AES_BLOCK_SIZE);
|
||||
fxts_param.nap[0] = 0x01; /* initial alpha power (1, little-endian) */
|
||||
|
||||
while ((nbytes = walk.nbytes) != 0) {
|
||||
while (!ret && ((nbytes = walk.nbytes) != 0)) {
|
||||
/* only use complete blocks */
|
||||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
cpacf_km(xts_ctx->fc | modifier, fxts_param.key + offset,
|
||||
|
|
@ -562,48 +562,64 @@ static unsigned int __ctrblk_init(u8 *ctrptr, u8 *iv, unsigned int nbytes)
|
|||
return n;
|
||||
}
|
||||
|
||||
static int __ctr_aes_crypt(struct s390_aes_ctx *sctx,
|
||||
struct skcipher_walk *walk, bool locked)
|
||||
{
|
||||
unsigned int n, nbytes;
|
||||
int ret = 0;
|
||||
u8 *ctrptr;
|
||||
|
||||
while (!ret && ((nbytes = walk->nbytes) >= AES_BLOCK_SIZE)) {
|
||||
n = AES_BLOCK_SIZE;
|
||||
if (nbytes >= 2 * AES_BLOCK_SIZE && locked)
|
||||
n = __ctrblk_init(ctrblk, walk->iv, nbytes);
|
||||
ctrptr = (n > AES_BLOCK_SIZE) ? ctrblk : walk->iv;
|
||||
cpacf_kmctr(sctx->fc, sctx->key, walk->dst.virt.addr,
|
||||
walk->src.virt.addr, n, ctrptr);
|
||||
if (ctrptr == ctrblk)
|
||||
memcpy(walk->iv, ctrptr + n - AES_BLOCK_SIZE,
|
||||
AES_BLOCK_SIZE);
|
||||
crypto_inc(walk->iv, AES_BLOCK_SIZE);
|
||||
ret = skcipher_walk_done(walk, nbytes - n);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ctr_aes_crypt(struct skcipher_request *req)
|
||||
{
|
||||
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||
struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm);
|
||||
u8 buf[AES_BLOCK_SIZE], *ctrptr;
|
||||
struct skcipher_walk walk;
|
||||
unsigned int n, nbytes;
|
||||
int ret, locked;
|
||||
u8 buf[AES_BLOCK_SIZE];
|
||||
int ret;
|
||||
|
||||
if (unlikely(!sctx->fc))
|
||||
return fallback_skcipher_crypt(sctx, req, 0);
|
||||
|
||||
locked = mutex_trylock(&ctrblk_lock);
|
||||
|
||||
ret = skcipher_walk_virt(&walk, req, false);
|
||||
while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
|
||||
n = AES_BLOCK_SIZE;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (nbytes >= 2*AES_BLOCK_SIZE && locked)
|
||||
n = __ctrblk_init(ctrblk, walk.iv, nbytes);
|
||||
ctrptr = (n > AES_BLOCK_SIZE) ? ctrblk : walk.iv;
|
||||
cpacf_kmctr(sctx->fc, sctx->key, walk.dst.virt.addr,
|
||||
walk.src.virt.addr, n, ctrptr);
|
||||
if (ctrptr == ctrblk)
|
||||
memcpy(walk.iv, ctrptr + n - AES_BLOCK_SIZE,
|
||||
AES_BLOCK_SIZE);
|
||||
crypto_inc(walk.iv, AES_BLOCK_SIZE);
|
||||
ret = skcipher_walk_done(&walk, nbytes - n);
|
||||
if (down_trylock(&ctrblk_sem) == 0) {
|
||||
ret = __ctr_aes_crypt(sctx, &walk, true);
|
||||
up(&ctrblk_sem);
|
||||
} else {
|
||||
ret = __ctr_aes_crypt(sctx, &walk, false);
|
||||
}
|
||||
if (locked)
|
||||
mutex_unlock(&ctrblk_lock);
|
||||
|
||||
/*
|
||||
* final block may be < AES_BLOCK_SIZE, copy only nbytes
|
||||
*/
|
||||
if (nbytes) {
|
||||
if (!ret && walk.nbytes > 0) {
|
||||
memset(buf, 0, AES_BLOCK_SIZE);
|
||||
memcpy(buf, walk.src.virt.addr, nbytes);
|
||||
memcpy(buf, walk.src.virt.addr, walk.nbytes);
|
||||
cpacf_kmctr(sctx->fc, sctx->key, buf, buf,
|
||||
AES_BLOCK_SIZE, walk.iv);
|
||||
memcpy(walk.dst.virt.addr, buf, nbytes);
|
||||
memcpy(walk.dst.virt.addr, buf, walk.nbytes);
|
||||
crypto_inc(walk.iv, AES_BLOCK_SIZE);
|
||||
ret = skcipher_walk_done(&walk, 0);
|
||||
memzero_explicit(buf, sizeof(buf));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
@ -895,10 +911,14 @@ static int gcm_aes_crypt(struct aead_request *req, unsigned int flags)
|
|||
gw_in.ptr, aad_bytes);
|
||||
|
||||
n = aad_bytes + pc_bytes;
|
||||
if (gcm_in_walk_done(&gw_in, n) != n)
|
||||
return -ENOMEM;
|
||||
if (gcm_out_walk_done(&gw_out, n) != n)
|
||||
return -ENOMEM;
|
||||
if (gcm_in_walk_done(&gw_in, n) != n) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
if (gcm_out_walk_done(&gw_out, n) != n) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
aadlen -= aad_bytes;
|
||||
pclen -= pc_bytes;
|
||||
} while (aadlen + pclen > 0);
|
||||
|
|
@ -910,7 +930,10 @@ static int gcm_aes_crypt(struct aead_request *req, unsigned int flags)
|
|||
} else
|
||||
scatterwalk_map_and_copy(param.t, req->dst, len, taglen, 1);
|
||||
|
||||
out:
|
||||
memzero_explicit(¶m, sizeof(param));
|
||||
memzero_explicit(gw_in.buf, sizeof(gw_in.buf));
|
||||
memzero_explicit(gw_out.buf, sizeof(gw_out.buf));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,10 @@ static int hash_data(const u8 *in, unsigned int inlen,
|
|||
|
||||
#undef PARAM_INIT
|
||||
|
||||
cpacf_klmd(func, ¶m, in, inlen);
|
||||
if (final)
|
||||
cpacf_klmd(func, ¶m, in, inlen);
|
||||
else
|
||||
cpacf_kimd(func, ¶m, in, inlen);
|
||||
|
||||
memcpy(digest, ¶m, digestsize);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/semaphore.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/algapi.h>
|
||||
|
|
@ -45,7 +45,7 @@ module_param_named(clrkey, pkey_clrkey_allowed, bool, 0444);
|
|||
MODULE_PARM_DESC(clrkey, "Allow clear key material (default N)");
|
||||
|
||||
static u8 *ctrblk;
|
||||
static DEFINE_MUTEX(ctrblk_lock);
|
||||
static DEFINE_SEMAPHORE(ctrblk_sem, 1);
|
||||
|
||||
static cpacf_mask_t km_functions, kmc_functions, kmctr_functions;
|
||||
|
||||
|
|
@ -220,6 +220,10 @@ static inline int convert_key(const u8 *key, unsigned int keylen,
|
|||
xflags);
|
||||
}
|
||||
|
||||
/* But finally map -EBUSY to -EIO to indicate an IO failure */
|
||||
if (rc == -EBUSY)
|
||||
rc = -EIO;
|
||||
|
||||
out:
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -432,8 +436,11 @@ static int ecb_paes_do_crypt(struct s390_paes_ctx *ctx,
|
|||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
k = cpacf_km(ctx->fc | req_ctx->modifier, param,
|
||||
walk->dst.virt.addr, walk->src.virt.addr, n);
|
||||
if (k)
|
||||
if (k) {
|
||||
rc = skcipher_walk_done(walk, nbytes - k);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
if (k < n) {
|
||||
if (!maysleep) {
|
||||
rc = -EKEYEXPIRED;
|
||||
|
|
@ -460,6 +467,7 @@ static int ecb_paes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
struct skcipher_walk *walk = &req_ctx->walk;
|
||||
bool tested = crypto_skcipher_tested(tfm);
|
||||
bool cleanup = true;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
|
|
@ -491,15 +499,17 @@ static int ecb_paes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
if (rc == 0 || rc == -EKEYEXPIRED) {
|
||||
atomic_inc(&ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_skcipher_request_to_engine(paes_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup && walk->nbytes)
|
||||
skcipher_walk_done(walk, rc);
|
||||
|
||||
out:
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup)
|
||||
memzero_explicit(&req_ctx->param, sizeof(req_ctx->param));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -549,7 +559,7 @@ static int ecb_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
rc = ecb_paes_do_crypt(ctx, req_ctx, tested, true);
|
||||
if (rc == -EKEYEXPIRED) {
|
||||
return pkey_handle_expired();
|
||||
} else if (rc) {
|
||||
} else if (rc && walk->nbytes) {
|
||||
skcipher_walk_done(walk, rc);
|
||||
}
|
||||
|
||||
|
|
@ -559,7 +569,7 @@ static int ecb_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
atomic_dec(&ctx->via_engine_ctr);
|
||||
crypto_finalize_skcipher_request(engine, req, rc);
|
||||
local_bh_enable();
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct skcipher_engine_alg ecb_paes_alg = {
|
||||
|
|
@ -567,6 +577,7 @@ static struct skcipher_engine_alg ecb_paes_alg = {
|
|||
.base.cra_name = "ecb(paes)",
|
||||
.base.cra_driver_name = "ecb-paes-s390",
|
||||
.base.cra_priority = 401, /* combo: aes + ecb + 1 */
|
||||
.base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_NO_FALLBACK,
|
||||
.base.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.base.cra_ctxsize = sizeof(struct s390_paes_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
|
@ -690,6 +701,8 @@ static int cbc_paes_do_crypt(struct s390_paes_ctx *ctx,
|
|||
if (k) {
|
||||
memcpy(walk->iv, param->iv, AES_BLOCK_SIZE);
|
||||
rc = skcipher_walk_done(walk, nbytes - k);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
if (k < n) {
|
||||
if (!maysleep) {
|
||||
|
|
@ -717,6 +730,7 @@ static int cbc_paes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
struct skcipher_walk *walk = &req_ctx->walk;
|
||||
bool tested = crypto_skcipher_tested(tfm);
|
||||
bool cleanup = true;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
|
|
@ -748,15 +762,17 @@ static int cbc_paes_crypt(struct skcipher_request *req, unsigned long modifier)
|
|||
if (rc == 0 || rc == -EKEYEXPIRED) {
|
||||
atomic_inc(&ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_skcipher_request_to_engine(paes_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup && walk->nbytes)
|
||||
skcipher_walk_done(walk, rc);
|
||||
|
||||
out:
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup)
|
||||
memzero_explicit(&req_ctx->param, sizeof(req_ctx->param));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -806,7 +822,7 @@ static int cbc_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
rc = cbc_paes_do_crypt(ctx, req_ctx, tested, true);
|
||||
if (rc == -EKEYEXPIRED) {
|
||||
return pkey_handle_expired();
|
||||
} else if (rc) {
|
||||
} else if (rc && walk->nbytes) {
|
||||
skcipher_walk_done(walk, rc);
|
||||
}
|
||||
|
||||
|
|
@ -816,7 +832,7 @@ static int cbc_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
atomic_dec(&ctx->via_engine_ctr);
|
||||
crypto_finalize_skcipher_request(engine, req, rc);
|
||||
local_bh_enable();
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct skcipher_engine_alg cbc_paes_alg = {
|
||||
|
|
@ -824,6 +840,7 @@ static struct skcipher_engine_alg cbc_paes_alg = {
|
|||
.base.cra_name = "cbc(paes)",
|
||||
.base.cra_driver_name = "cbc-paes-s390",
|
||||
.base.cra_priority = 402, /* cbc-paes-s390 + 1 */
|
||||
.base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_NO_FALLBACK,
|
||||
.base.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.base.cra_ctxsize = sizeof(struct s390_paes_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
|
@ -914,15 +931,62 @@ static inline unsigned int __ctrblk_init(u8 *ctrptr, u8 *iv, unsigned int nbytes
|
|||
return n;
|
||||
}
|
||||
|
||||
static int __ctr_paes_do_crypt(struct s390_paes_ctx *ctx,
|
||||
struct ctr_param *param,
|
||||
struct skcipher_walk *walk,
|
||||
bool tested, bool maysleep, bool locked)
|
||||
{
|
||||
unsigned int nbytes, n, k;
|
||||
u8 *ctrptr;
|
||||
int rc = 0;
|
||||
|
||||
/*
|
||||
* Note that in case of partial processing or failure the walk
|
||||
* is NOT unmapped here. So a follow up task may reuse the walk
|
||||
* or in case of unrecoverable failure needs to unmap it.
|
||||
*/
|
||||
while ((nbytes = walk->nbytes) >= AES_BLOCK_SIZE) {
|
||||
n = AES_BLOCK_SIZE;
|
||||
if (nbytes >= 2 * AES_BLOCK_SIZE && locked)
|
||||
n = __ctrblk_init(ctrblk, walk->iv, nbytes);
|
||||
ctrptr = (n > AES_BLOCK_SIZE) ? ctrblk : walk->iv;
|
||||
k = cpacf_kmctr(ctx->fc, param, walk->dst.virt.addr,
|
||||
walk->src.virt.addr, n, ctrptr);
|
||||
if (k) {
|
||||
if (ctrptr == ctrblk)
|
||||
memcpy(walk->iv, ctrptr + k - AES_BLOCK_SIZE,
|
||||
AES_BLOCK_SIZE);
|
||||
crypto_inc(walk->iv, AES_BLOCK_SIZE);
|
||||
rc = skcipher_walk_done(walk, nbytes - k);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
if (k < n) {
|
||||
if (!maysleep) {
|
||||
rc = -EKEYEXPIRED;
|
||||
goto out;
|
||||
}
|
||||
rc = paes_convert_key(ctx, tested);
|
||||
if (rc)
|
||||
goto out;
|
||||
spin_lock_bh(&ctx->pk_lock);
|
||||
memcpy(param->key, ctx->pk.protkey, sizeof(param->key));
|
||||
spin_unlock_bh(&ctx->pk_lock);
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int ctr_paes_do_crypt(struct s390_paes_ctx *ctx,
|
||||
struct s390_pctr_req_ctx *req_ctx,
|
||||
bool tested, bool maysleep)
|
||||
{
|
||||
struct ctr_param *param = &req_ctx->param;
|
||||
struct skcipher_walk *walk = &req_ctx->walk;
|
||||
u8 buf[AES_BLOCK_SIZE], *ctrptr;
|
||||
unsigned int nbytes, n, k;
|
||||
int pk_state, locked, rc = 0;
|
||||
u8 buf[AES_BLOCK_SIZE];
|
||||
int pk_state, rc = 0;
|
||||
|
||||
if (!req_ctx->param_init_done) {
|
||||
/* fetch and check protected key state */
|
||||
|
|
@ -948,52 +1012,17 @@ static int ctr_paes_do_crypt(struct s390_paes_ctx *ctx,
|
|||
if (rc)
|
||||
goto out;
|
||||
|
||||
locked = mutex_trylock(&ctrblk_lock);
|
||||
|
||||
/*
|
||||
* Note that in case of partial processing or failure the walk
|
||||
* is NOT unmapped here. So a follow up task may reuse the walk
|
||||
* or in case of unrecoverable failure needs to unmap it.
|
||||
*/
|
||||
while ((nbytes = walk->nbytes) >= AES_BLOCK_SIZE) {
|
||||
n = AES_BLOCK_SIZE;
|
||||
if (nbytes >= 2 * AES_BLOCK_SIZE && locked)
|
||||
n = __ctrblk_init(ctrblk, walk->iv, nbytes);
|
||||
ctrptr = (n > AES_BLOCK_SIZE) ? ctrblk : walk->iv;
|
||||
k = cpacf_kmctr(ctx->fc, param, walk->dst.virt.addr,
|
||||
walk->src.virt.addr, n, ctrptr);
|
||||
if (k) {
|
||||
if (ctrptr == ctrblk)
|
||||
memcpy(walk->iv, ctrptr + k - AES_BLOCK_SIZE,
|
||||
AES_BLOCK_SIZE);
|
||||
crypto_inc(walk->iv, AES_BLOCK_SIZE);
|
||||
rc = skcipher_walk_done(walk, nbytes - k);
|
||||
}
|
||||
if (k < n) {
|
||||
if (!maysleep) {
|
||||
if (locked)
|
||||
mutex_unlock(&ctrblk_lock);
|
||||
rc = -EKEYEXPIRED;
|
||||
goto out;
|
||||
}
|
||||
rc = paes_convert_key(ctx, tested);
|
||||
if (rc) {
|
||||
if (locked)
|
||||
mutex_unlock(&ctrblk_lock);
|
||||
goto out;
|
||||
}
|
||||
spin_lock_bh(&ctx->pk_lock);
|
||||
memcpy(param->key, ctx->pk.protkey, sizeof(param->key));
|
||||
spin_unlock_bh(&ctx->pk_lock);
|
||||
}
|
||||
if (down_trylock(&ctrblk_sem) == 0) {
|
||||
rc = __ctr_paes_do_crypt(ctx, param, walk, tested, maysleep, true);
|
||||
up(&ctrblk_sem);
|
||||
} else {
|
||||
rc = __ctr_paes_do_crypt(ctx, param, walk, tested, maysleep, false);
|
||||
}
|
||||
if (locked)
|
||||
mutex_unlock(&ctrblk_lock);
|
||||
|
||||
/* final block may be < AES_BLOCK_SIZE, copy only nbytes */
|
||||
if (nbytes) {
|
||||
if (!rc && walk->nbytes > 0) {
|
||||
memset(buf, 0, AES_BLOCK_SIZE);
|
||||
memcpy(buf, walk->src.virt.addr, nbytes);
|
||||
memcpy(buf, walk->src.virt.addr, walk->nbytes);
|
||||
while (1) {
|
||||
if (cpacf_kmctr(ctx->fc, param, buf,
|
||||
buf, AES_BLOCK_SIZE,
|
||||
|
|
@ -1010,12 +1039,13 @@ static int ctr_paes_do_crypt(struct s390_paes_ctx *ctx,
|
|||
memcpy(param->key, ctx->pk.protkey, sizeof(param->key));
|
||||
spin_unlock_bh(&ctx->pk_lock);
|
||||
}
|
||||
memcpy(walk->dst.virt.addr, buf, nbytes);
|
||||
memcpy(walk->dst.virt.addr, buf, walk->nbytes);
|
||||
crypto_inc(walk->iv, AES_BLOCK_SIZE);
|
||||
rc = skcipher_walk_done(walk, 0);
|
||||
}
|
||||
|
||||
out:
|
||||
memzero_explicit(buf, sizeof(buf));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1027,6 +1057,7 @@ static int ctr_paes_crypt(struct skcipher_request *req)
|
|||
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
struct skcipher_walk *walk = &req_ctx->walk;
|
||||
bool tested = crypto_skcipher_tested(tfm);
|
||||
bool cleanup = true;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
|
|
@ -1057,15 +1088,17 @@ static int ctr_paes_crypt(struct skcipher_request *req)
|
|||
if (rc == 0 || rc == -EKEYEXPIRED) {
|
||||
atomic_inc(&ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_skcipher_request_to_engine(paes_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup && walk->nbytes)
|
||||
skcipher_walk_done(walk, rc);
|
||||
|
||||
out:
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup)
|
||||
memzero_explicit(&req_ctx->param, sizeof(req_ctx->param));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -1105,7 +1138,7 @@ static int ctr_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
rc = ctr_paes_do_crypt(ctx, req_ctx, tested, true);
|
||||
if (rc == -EKEYEXPIRED) {
|
||||
return pkey_handle_expired();
|
||||
} else if (rc) {
|
||||
} else if (rc && walk->nbytes) {
|
||||
skcipher_walk_done(walk, rc);
|
||||
}
|
||||
|
||||
|
|
@ -1115,7 +1148,7 @@ static int ctr_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
atomic_dec(&ctx->via_engine_ctr);
|
||||
crypto_finalize_skcipher_request(engine, req, rc);
|
||||
local_bh_enable();
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct skcipher_engine_alg ctr_paes_alg = {
|
||||
|
|
@ -1123,6 +1156,7 @@ static struct skcipher_engine_alg ctr_paes_alg = {
|
|||
.base.cra_name = "ctr(paes)",
|
||||
.base.cra_driver_name = "ctr-paes-s390",
|
||||
.base.cra_priority = 402, /* ecb-paes-s390 + 1 */
|
||||
.base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_NO_FALLBACK,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct s390_paes_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
|
@ -1283,8 +1317,11 @@ static int xts_paes_do_crypt_fullkey(struct s390_pxts_ctx *ctx,
|
|||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
k = cpacf_km(ctx->fc | req_ctx->modifier, param->key + offset,
|
||||
walk->dst.virt.addr, walk->src.virt.addr, n);
|
||||
if (k)
|
||||
if (k) {
|
||||
rc = skcipher_walk_done(walk, nbytes - k);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
if (k < n) {
|
||||
if (!maysleep) {
|
||||
rc = -EKEYEXPIRED;
|
||||
|
|
@ -1337,7 +1374,7 @@ static inline int __xts_2keys_prep_param(struct s390_pxts_ctx *ctx,
|
|||
memcpy(param->init, pcc_param.xts, 16);
|
||||
}
|
||||
|
||||
memzero_explicit(pcc_param.key, sizeof(pcc_param.key));
|
||||
memzero_explicit(&pcc_param, sizeof(pcc_param));
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1377,8 +1414,11 @@ static int xts_paes_do_crypt_2keys(struct s390_pxts_ctx *ctx,
|
|||
n = nbytes & ~(AES_BLOCK_SIZE - 1);
|
||||
k = cpacf_km(ctx->fc | req_ctx->modifier, param->key + offset,
|
||||
walk->dst.virt.addr, walk->src.virt.addr, n);
|
||||
if (k)
|
||||
if (k) {
|
||||
rc = skcipher_walk_done(walk, nbytes - k);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
if (k < n) {
|
||||
if (!maysleep) {
|
||||
rc = -EKEYEXPIRED;
|
||||
|
|
@ -1450,6 +1490,7 @@ static inline int xts_paes_crypt(struct skcipher_request *req, unsigned long mod
|
|||
struct s390_pxts_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
struct skcipher_walk *walk = &req_ctx->walk;
|
||||
bool tested = crypto_skcipher_tested(tfm);
|
||||
bool cleanup = true;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
|
|
@ -1481,15 +1522,17 @@ static inline int xts_paes_crypt(struct skcipher_request *req, unsigned long mod
|
|||
if (rc == 0 || rc == -EKEYEXPIRED) {
|
||||
atomic_inc(&ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_skcipher_request_to_engine(paes_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup && walk->nbytes)
|
||||
skcipher_walk_done(walk, rc);
|
||||
|
||||
out:
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup)
|
||||
memzero_explicit(&req_ctx->param, sizeof(req_ctx->param));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -1539,7 +1582,7 @@ static int xts_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
rc = xts_paes_do_crypt(ctx, req_ctx, tested, true);
|
||||
if (rc == -EKEYEXPIRED) {
|
||||
return pkey_handle_expired();
|
||||
} else if (rc) {
|
||||
} else if (rc && walk->nbytes) {
|
||||
skcipher_walk_done(walk, rc);
|
||||
}
|
||||
|
||||
|
|
@ -1549,7 +1592,7 @@ static int xts_paes_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
atomic_dec(&ctx->via_engine_ctr);
|
||||
crypto_finalize_skcipher_request(engine, req, rc);
|
||||
local_bh_enable();
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct skcipher_engine_alg xts_paes_alg = {
|
||||
|
|
@ -1557,6 +1600,7 @@ static struct skcipher_engine_alg xts_paes_alg = {
|
|||
.base.cra_name = "xts(paes)",
|
||||
.base.cra_driver_name = "xts-paes-s390",
|
||||
.base.cra_priority = 402, /* ecb-paes-s390 + 1 */
|
||||
.base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_NO_FALLBACK,
|
||||
.base.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.base.cra_ctxsize = sizeof(struct s390_pxts_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -62,8 +62,10 @@ static inline int hwh_prepare(struct ahash_request *req,
|
|||
*/
|
||||
static inline int hwh_advance(struct hash_walk_helper *hwh, int n)
|
||||
{
|
||||
if (n < 0)
|
||||
if (n < 0) {
|
||||
hwh->walkbytes = n;
|
||||
return crypto_hash_walk_done(&hwh->walk, n);
|
||||
}
|
||||
|
||||
hwh->walkbytes -= n;
|
||||
hwh->walkaddr += n;
|
||||
|
|
@ -339,6 +341,10 @@ static inline int convert_key(const u8 *key, unsigned int keylen,
|
|||
xflags);
|
||||
}
|
||||
|
||||
/* But finally map -EBUSY to -EIO to indicate an IO failure */
|
||||
if (rc == -EBUSY)
|
||||
rc = -EIO;
|
||||
|
||||
out:
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -606,6 +612,7 @@ static int phmac_update(struct ahash_request *req)
|
|||
struct phmac_tfm_ctx *tfm_ctx = crypto_ahash_ctx(tfm);
|
||||
struct kmac_sha2_ctx *kmac_ctx = &req_ctx->kmac_ctx;
|
||||
struct hash_walk_helper *hwh = &req_ctx->hwh;
|
||||
bool cleanup = true;
|
||||
int rc;
|
||||
|
||||
/* prep the walk in the request context */
|
||||
|
|
@ -629,12 +636,15 @@ static int phmac_update(struct ahash_request *req)
|
|||
req_ctx->async_op = OP_UPDATE;
|
||||
atomic_inc(&tfm_ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_hash_request_to_engine(phmac_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&tfm_ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
if (rc != -EINPROGRESS) {
|
||||
hwh_advance(hwh, rc);
|
||||
if (cleanup) {
|
||||
if (hwh->walkbytes > 0)
|
||||
hwh_advance(hwh, rc);
|
||||
memzero_explicit(kmac_ctx, sizeof(*kmac_ctx));
|
||||
}
|
||||
|
||||
|
|
@ -649,6 +659,7 @@ static int phmac_final(struct ahash_request *req)
|
|||
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
|
||||
struct phmac_tfm_ctx *tfm_ctx = crypto_ahash_ctx(tfm);
|
||||
struct kmac_sha2_ctx *kmac_ctx = &req_ctx->kmac_ctx;
|
||||
bool cleanup = true;
|
||||
int rc = 0;
|
||||
|
||||
/* Try synchronous operation if no active engine usage */
|
||||
|
|
@ -667,12 +678,14 @@ static int phmac_final(struct ahash_request *req)
|
|||
req_ctx->async_op = OP_FINAL;
|
||||
atomic_inc(&tfm_ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_hash_request_to_engine(phmac_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&tfm_ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
out:
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup)
|
||||
memzero_explicit(kmac_ctx, sizeof(*kmac_ctx));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -685,6 +698,7 @@ static int phmac_finup(struct ahash_request *req)
|
|||
struct phmac_tfm_ctx *tfm_ctx = crypto_ahash_ctx(tfm);
|
||||
struct kmac_sha2_ctx *kmac_ctx = &req_ctx->kmac_ctx;
|
||||
struct hash_walk_helper *hwh = &req_ctx->hwh;
|
||||
bool cleanup = true;
|
||||
int rc;
|
||||
|
||||
/* prep the walk in the request context */
|
||||
|
|
@ -716,15 +730,17 @@ static int phmac_finup(struct ahash_request *req)
|
|||
/* req->async_op has been set to either OP_FINUP or OP_FINAL */
|
||||
atomic_inc(&tfm_ctx->via_engine_ctr);
|
||||
rc = crypto_transfer_hash_request_to_engine(phmac_crypto_engine, req);
|
||||
if (rc != -EINPROGRESS)
|
||||
if (rc == -EINPROGRESS || rc == -EBUSY)
|
||||
cleanup = false;
|
||||
else
|
||||
atomic_dec(&tfm_ctx->via_engine_ctr);
|
||||
}
|
||||
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup && hwh->walkbytes > 0)
|
||||
hwh_advance(hwh, rc);
|
||||
|
||||
out:
|
||||
if (rc != -EINPROGRESS)
|
||||
if (cleanup)
|
||||
memzero_explicit(kmac_ctx, sizeof(*kmac_ctx));
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
|
@ -914,7 +930,7 @@ static int phmac_do_one_request(struct crypto_engine *engine, void *areq)
|
|||
atomic_dec(&tfm_ctx->via_engine_ctr);
|
||||
crypto_finalize_hash_request(engine, req, rc);
|
||||
local_bh_enable();
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define S390_ASYNC_PHMAC_ALG(x) \
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ static __always_inline void pai_kernel_exit(struct pt_regs *regs)
|
|||
}
|
||||
|
||||
#define PAI_SAVE_AREA(x) ((x)->hw.event_base)
|
||||
#define PAI_CPU_MASK(x) ((x)->hw.addr_filters)
|
||||
#define PAI_PMU_IDX(x) ((x)->hw.last_tag)
|
||||
#define PAI_SWLIST(x) (&(x)->hw.tp_list)
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ static struct debug_param_t {
|
|||
static int debug_param_num;
|
||||
|
||||
/* functions */
|
||||
static void debug_get_param(const char *name, int *level, int *pages)
|
||||
static void debug_get_param(const char *name, int *level, int *pages, bool quiet)
|
||||
{
|
||||
struct debug_param_t *p;
|
||||
int i;
|
||||
|
|
@ -192,11 +192,13 @@ static void debug_get_param(const char *name, int *level, int *pages)
|
|||
if (!glob_match(p->name, name))
|
||||
continue;
|
||||
if (level && p->level != PARAM_UNSET) {
|
||||
pr_info("%s: override level to %d\n", name, p->level);
|
||||
if (!quiet)
|
||||
pr_info("%s: override level to %d\n", name, p->level);
|
||||
*level = p->level;
|
||||
}
|
||||
if (pages && p->pages != PARAM_UNSET) {
|
||||
pr_info("%s: override pages to %d\n", name, p->pages);
|
||||
if (!quiet)
|
||||
pr_info("%s: override pages to %d\n", name, p->pages);
|
||||
*pages = p->pages;
|
||||
}
|
||||
}
|
||||
|
|
@ -251,7 +253,7 @@ static int __init s390dbf_parse(char *arg)
|
|||
* regular memory allocations are possible.
|
||||
*/
|
||||
for (i = 0, id = __s390dbf_info; &id[i] < __s390dbf_info_end; i++)
|
||||
debug_get_param(id[i]->name, &id[i]->level, NULL);
|
||||
debug_get_param(id[i]->name, &id[i]->level, NULL, false);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -395,7 +397,7 @@ static debug_info_t *debug_info_create(const char *name, int pages_per_area,
|
|||
int level = DEBUG_DEFAULT_LEVEL;
|
||||
debug_info_t *rc;
|
||||
|
||||
debug_get_param(name, &level, &pages_per_area);
|
||||
debug_get_param(name, &level, &pages_per_area, false);
|
||||
rc = debug_info_alloc(name, pages_per_area, nr_areas, buf_size, level, ALL_AREAS);
|
||||
if (!rc)
|
||||
goto out;
|
||||
|
|
@ -960,7 +962,7 @@ void debug_register_static(debug_info_t *id, int pages_per_area, int nr_areas)
|
|||
return;
|
||||
}
|
||||
|
||||
debug_get_param(id->name, &id->level, &pages_per_area);
|
||||
debug_get_param(id->name, &id->level, &pages_per_area, false);
|
||||
copy = debug_info_alloc("", pages_per_area, nr_areas, id->buf_size,
|
||||
id->level, ALL_AREAS);
|
||||
if (!copy) {
|
||||
|
|
@ -1074,9 +1076,6 @@ static void _debug_set_level(debug_info_t *id, int new_level)
|
|||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (!id)
|
||||
return;
|
||||
|
||||
if (new_level == DEBUG_OFF_LEVEL) {
|
||||
pr_info("%s: switched off\n", id->name);
|
||||
} else if ((new_level > DEBUG_MAX_LEVEL) || (new_level < 0)) {
|
||||
|
|
@ -1101,8 +1100,14 @@ static void _debug_set_level(debug_info_t *id, int new_level)
|
|||
*/
|
||||
void debug_set_level(debug_info_t *id, int new_level)
|
||||
{
|
||||
/* Level specified via kernel parameter takes precedence */
|
||||
debug_get_param(id->name, &new_level, NULL);
|
||||
if (!id)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Level specified via kernel parameter takes precedence. The override
|
||||
* was already announced during registration, so stay quiet here.
|
||||
*/
|
||||
debug_get_param(id->name, &new_level, NULL, true);
|
||||
|
||||
_debug_set_level(id, new_level);
|
||||
}
|
||||
|
|
@ -1278,7 +1283,7 @@ void debug_set_critical(void)
|
|||
debug_entry_t *debug_event_common(debug_info_t *id, int level, const void *buf,
|
||||
int len)
|
||||
{
|
||||
debug_entry_t *active;
|
||||
debug_entry_t *active = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
if (!debug_active || !id->areas)
|
||||
|
|
@ -1289,6 +1294,8 @@ debug_entry_t *debug_event_common(debug_info_t *id, int level, const void *buf,
|
|||
} else {
|
||||
raw_spin_lock_irqsave(&id->lock, flags);
|
||||
}
|
||||
if (!id->areas)
|
||||
goto out;
|
||||
do {
|
||||
active = get_active_entry(id);
|
||||
memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size));
|
||||
|
|
@ -1298,7 +1305,7 @@ debug_entry_t *debug_event_common(debug_info_t *id, int level, const void *buf,
|
|||
len -= id->buf_size;
|
||||
buf += id->buf_size;
|
||||
} while (len > 0);
|
||||
|
||||
out:
|
||||
raw_spin_unlock_irqrestore(&id->lock, flags);
|
||||
return active;
|
||||
}
|
||||
|
|
@ -1311,7 +1318,7 @@ EXPORT_SYMBOL(debug_event_common);
|
|||
debug_entry_t *debug_exception_common(debug_info_t *id, int level,
|
||||
const void *buf, int len)
|
||||
{
|
||||
debug_entry_t *active;
|
||||
debug_entry_t *active = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
if (!debug_active || !id->areas)
|
||||
|
|
@ -1322,6 +1329,8 @@ debug_entry_t *debug_exception_common(debug_info_t *id, int level,
|
|||
} else {
|
||||
raw_spin_lock_irqsave(&id->lock, flags);
|
||||
}
|
||||
if (!id->areas)
|
||||
goto out;
|
||||
do {
|
||||
active = get_active_entry(id);
|
||||
memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size));
|
||||
|
|
@ -1331,7 +1340,7 @@ debug_entry_t *debug_exception_common(debug_info_t *id, int level,
|
|||
len -= id->buf_size;
|
||||
buf += id->buf_size;
|
||||
} while (len > 0);
|
||||
|
||||
out:
|
||||
raw_spin_unlock_irqrestore(&id->lock, flags);
|
||||
return active;
|
||||
}
|
||||
|
|
@ -1357,7 +1366,7 @@ static inline int debug_count_numargs(char *string)
|
|||
debug_entry_t *__debug_sprintf_event(debug_info_t *id, int level, char *string, ...)
|
||||
{
|
||||
debug_sprintf_entry_t *curr_event;
|
||||
debug_entry_t *active;
|
||||
debug_entry_t *active = NULL;
|
||||
unsigned long flags;
|
||||
int numargs, idx;
|
||||
va_list ap;
|
||||
|
|
@ -1372,6 +1381,8 @@ debug_entry_t *__debug_sprintf_event(debug_info_t *id, int level, char *string,
|
|||
} else {
|
||||
raw_spin_lock_irqsave(&id->lock, flags);
|
||||
}
|
||||
if (!id->areas)
|
||||
goto out;
|
||||
active = get_active_entry(id);
|
||||
curr_event = (debug_sprintf_entry_t *) DEBUG_DATA(active);
|
||||
va_start(ap, string);
|
||||
|
|
@ -1380,6 +1391,7 @@ debug_entry_t *__debug_sprintf_event(debug_info_t *id, int level, char *string,
|
|||
curr_event->args[idx] = va_arg(ap, long);
|
||||
va_end(ap);
|
||||
debug_finish_entry(id, active, level, 0);
|
||||
out:
|
||||
raw_spin_unlock_irqrestore(&id->lock, flags);
|
||||
|
||||
return active;
|
||||
|
|
@ -1392,7 +1404,7 @@ EXPORT_SYMBOL(__debug_sprintf_event);
|
|||
debug_entry_t *__debug_sprintf_exception(debug_info_t *id, int level, char *string, ...)
|
||||
{
|
||||
debug_sprintf_entry_t *curr_event;
|
||||
debug_entry_t *active;
|
||||
debug_entry_t *active = NULL;
|
||||
unsigned long flags;
|
||||
int numargs, idx;
|
||||
va_list ap;
|
||||
|
|
@ -1408,6 +1420,8 @@ debug_entry_t *__debug_sprintf_exception(debug_info_t *id, int level, char *stri
|
|||
} else {
|
||||
raw_spin_lock_irqsave(&id->lock, flags);
|
||||
}
|
||||
if (!id->areas)
|
||||
goto out;
|
||||
active = get_active_entry(id);
|
||||
curr_event = (debug_sprintf_entry_t *)DEBUG_DATA(active);
|
||||
va_start(ap, string);
|
||||
|
|
@ -1416,6 +1430,7 @@ debug_entry_t *__debug_sprintf_exception(debug_info_t *id, int level, char *stri
|
|||
curr_event->args[idx] = va_arg(ap, long);
|
||||
va_end(ap);
|
||||
debug_finish_entry(id, active, level, 1);
|
||||
out:
|
||||
raw_spin_unlock_irqrestore(&id->lock, flags);
|
||||
|
||||
return active;
|
||||
|
|
@ -1658,9 +1673,11 @@ static void debug_flush(debug_info_t *id, int area)
|
|||
unsigned long flags;
|
||||
int i, j;
|
||||
|
||||
if (!id || !id->areas)
|
||||
if (!id)
|
||||
return;
|
||||
raw_spin_lock_irqsave(&id->lock, flags);
|
||||
if (!id->areas)
|
||||
goto out;
|
||||
if (area == DEBUG_FLUSH_ALL) {
|
||||
id->active_area = 0;
|
||||
memset(id->active_entries, 0, id->nr_areas * sizeof(int));
|
||||
|
|
@ -1675,6 +1692,7 @@ static void debug_flush(debug_info_t *id, int area)
|
|||
for (i = 0; i < id->pages_per_area; i++)
|
||||
memset(id->areas[area][i], 0, PAGE_SIZE);
|
||||
}
|
||||
out:
|
||||
raw_spin_unlock_irqrestore(&id->lock, flags);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ struct pai_mapptr {
|
|||
|
||||
static struct pai_root { /* Anchor to per CPU data */
|
||||
refcount_t refcnt; /* Overall active events */
|
||||
atomic_t tskctx; /* Overall per-task events */
|
||||
struct pai_mapptr __percpu *mapptr;
|
||||
} pai_root[PAI_PMU_MAX];
|
||||
|
||||
|
|
@ -93,14 +94,15 @@ struct pai_pmu { /* Define PAI PMU characteristics */
|
|||
static struct pai_pmu pai_pmu[]; /* Forward declaration */
|
||||
|
||||
/* Free per CPU data when the last event is removed. */
|
||||
static void pai_root_free(int idx)
|
||||
static void pai_root_free(int idx, int tasks)
|
||||
{
|
||||
if (refcount_dec_and_test(&pai_root[idx].refcnt)) {
|
||||
if (refcount_sub_and_test(tasks, &pai_root[idx].refcnt)) {
|
||||
free_percpu(pai_root[idx].mapptr);
|
||||
pai_root[idx].mapptr = NULL;
|
||||
}
|
||||
debug_sprintf_event(paidbg, 5, "%s root[%d].refcount %d\n", __func__,
|
||||
idx, refcount_read(&pai_root[idx].refcnt));
|
||||
debug_sprintf_event(paidbg, 5, "%s root[%d].refcount %d tskctx %d\n",
|
||||
__func__, idx, refcount_read(&pai_root[idx].refcnt),
|
||||
atomic_read(&pai_root[idx].tskctx));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -137,40 +139,54 @@ static void pai_free(struct pai_mapptr *mp)
|
|||
mp->mapptr = NULL;
|
||||
}
|
||||
|
||||
/* Adjust usage counters and remove allocated memory when all users are
|
||||
* gone.
|
||||
*/
|
||||
static void pai_event_destroy_cpu(struct perf_event *event, int cpu)
|
||||
/* Called under mutex_lock */
|
||||
static void pai_event_destroy_cpu(int idx, int cpu, bool hotplug)
|
||||
{
|
||||
int idx = PAI_PMU_IDX(event);
|
||||
struct pai_mapptr *mp = per_cpu_ptr(pai_root[idx].mapptr, cpu);
|
||||
struct pai_map *cpump = mp->mapptr;
|
||||
struct pai_mapptr *mp;
|
||||
struct pai_map *cpump;
|
||||
int tasks = 1;
|
||||
|
||||
mutex_lock(&pai_reserve_mutex);
|
||||
debug_sprintf_event(paidbg, 5, "%s event %#llx idx %d cpu %d users %d "
|
||||
"refcnt %u\n", __func__, event->attr.config, idx,
|
||||
event->cpu, cpump->active_events,
|
||||
refcount_read(&cpump->refcnt));
|
||||
if (refcount_dec_and_test(&cpump->refcnt))
|
||||
/* Check reference count and return when all gone.
|
||||
* 1. An event is installed on online CPU X.
|
||||
* 2. CPU x is offlined and the per-CPU data is removed.
|
||||
* 3. Event is destroyed via close system call.
|
||||
*/
|
||||
if (!refcount_read(&pai_root[idx].refcnt))
|
||||
return; /* No events at all */
|
||||
mp = per_cpu_ptr(pai_root[idx].mapptr, cpu);
|
||||
if (!mp || !mp->mapptr) /* No events on that CPU */
|
||||
return;
|
||||
|
||||
/* When hotplug is true, invocation is from CPU hotplug callback.
|
||||
* Delete per-CPU resource and adjust refcnt when per-task events
|
||||
* are currently active. This can be more than one.
|
||||
* In this case adjust counters.
|
||||
*/
|
||||
if (hotplug)
|
||||
tasks = atomic_read(&pai_root[idx].tskctx);
|
||||
|
||||
cpump = mp->mapptr;
|
||||
if (refcount_sub_and_test(tasks, &cpump->refcnt))
|
||||
pai_free(mp);
|
||||
pai_root_free(idx);
|
||||
mutex_unlock(&pai_reserve_mutex);
|
||||
pai_root_free(idx, tasks);
|
||||
}
|
||||
|
||||
static void pai_event_destroy(struct perf_event *event)
|
||||
{
|
||||
int cpu;
|
||||
int cpu = 0, idx = PAI_PMU_IDX(event);
|
||||
|
||||
free_page(PAI_SAVE_AREA(event));
|
||||
cpus_read_lock();
|
||||
mutex_lock(&pai_reserve_mutex);
|
||||
if (event->cpu == -1) {
|
||||
struct cpumask *mask = PAI_CPU_MASK(event);
|
||||
|
||||
for_each_cpu(cpu, mask)
|
||||
pai_event_destroy_cpu(event, cpu);
|
||||
kfree(mask);
|
||||
atomic_dec(&pai_root[idx].tskctx);
|
||||
for_each_online_cpu(cpu)
|
||||
pai_event_destroy_cpu(idx, cpu, false);
|
||||
} else {
|
||||
pai_event_destroy_cpu(event, event->cpu);
|
||||
pai_event_destroy_cpu(idx, event->cpu, false);
|
||||
}
|
||||
mutex_unlock(&pai_reserve_mutex);
|
||||
cpus_read_unlock();
|
||||
}
|
||||
|
||||
static void paicrypt_event_destroy(struct perf_event *event)
|
||||
|
|
@ -234,25 +250,30 @@ static u64 paicrypt_getall(struct perf_event *event)
|
|||
return sum;
|
||||
}
|
||||
|
||||
/* Check concurrent access of counting and sampling for crypto events.
|
||||
* This function is called in process context and it is save to block.
|
||||
* When the event initialization functions fails, no other call back will
|
||||
* be invoked.
|
||||
*
|
||||
* Allocate the memory for the event.
|
||||
*/
|
||||
static int pai_alloc_cpu(struct perf_event *event, int cpu)
|
||||
/* Called under mutex_lock */
|
||||
static int pai_alloc_cpu(int idx, int cpu, bool hotplug)
|
||||
{
|
||||
int rc, idx = PAI_PMU_IDX(event);
|
||||
struct pai_map *cpump = NULL;
|
||||
bool need_paiext_cb = false;
|
||||
struct pai_mapptr *mp;
|
||||
int tasks = 1, rc = 0;
|
||||
|
||||
/* When hotplug is true, invocation is from CPU hotplug callback.
|
||||
* Allocate per-CPU resource when per-task events are currently active.
|
||||
* This can be more than one. In this case adjust all reference
|
||||
* counters. Otherwise return, this ensures memory is only allocated
|
||||
* when needed.
|
||||
*/
|
||||
if (hotplug) {
|
||||
tasks = atomic_read(&pai_root[idx].tskctx);
|
||||
if (!tasks)
|
||||
goto out;
|
||||
}
|
||||
|
||||
mutex_lock(&pai_reserve_mutex);
|
||||
/* Allocate root node */
|
||||
rc = pai_root_alloc(idx);
|
||||
if (rc)
|
||||
goto unlock;
|
||||
goto out;
|
||||
|
||||
/* Allocate node for this event */
|
||||
mp = per_cpu_ptr(pai_root[idx].mapptr, cpu);
|
||||
|
|
@ -296,28 +317,45 @@ static int pai_alloc_cpu(struct perf_event *event, int cpu)
|
|||
goto undo;
|
||||
}
|
||||
INIT_LIST_HEAD(&cpump->syswide_list);
|
||||
refcount_set(&cpump->refcnt, 1);
|
||||
refcount_set(&cpump->refcnt, tasks);
|
||||
rc = 0;
|
||||
} else {
|
||||
refcount_inc(&cpump->refcnt);
|
||||
refcount_add(tasks, &cpump->refcnt);
|
||||
}
|
||||
/* If tasks is greater than 1, we are called from CPU hotplug path
|
||||
* and need to adjust the pai_root[idx].refcnt by the number of
|
||||
* per-process events. Function pai_root_alloc(idx) already
|
||||
* incremented by one. Adjust for the rest.
|
||||
*/
|
||||
if (tasks > 1)
|
||||
refcount_add(tasks - 1, &pai_root[idx].refcnt);
|
||||
|
||||
undo:
|
||||
if (rc) {
|
||||
/* Error in allocation of event, decrement anchor. Since
|
||||
* the event in not created, its destroy() function is never
|
||||
* invoked. Adjust the reference counter for the anchor.
|
||||
* The failure happened in the case of variable
|
||||
* cpump == NULL branch above. The pai_root[XXX].refcnt has
|
||||
* been incremented by one. Then the per-CPU allocation
|
||||
* failed, so decrement it by one, regardless of tasks.
|
||||
*/
|
||||
pai_root_free(idx);
|
||||
pai_root_free(idx, 1);
|
||||
}
|
||||
unlock:
|
||||
mutex_unlock(&pai_reserve_mutex);
|
||||
out:
|
||||
/* If rc is non-zero, no increment of counter/sampler was done. */
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Check concurrent access of counting and sampling for PAI events.
|
||||
* This function is called in process context and it is safe to block.
|
||||
* When the event initialization functions fails, no other call back will
|
||||
* be invoked.
|
||||
* Called under mutex_lock.
|
||||
*/
|
||||
static int pai_alloc(struct perf_event *event)
|
||||
{
|
||||
int idx = PAI_PMU_IDX(event);
|
||||
struct cpumask *maskptr;
|
||||
int cpu, rc = -ENOMEM;
|
||||
|
||||
|
|
@ -326,24 +364,20 @@ static int pai_alloc(struct perf_event *event)
|
|||
goto out;
|
||||
|
||||
for_each_online_cpu(cpu) {
|
||||
rc = pai_alloc_cpu(event, cpu);
|
||||
rc = pai_alloc_cpu(idx, cpu, false);
|
||||
if (rc) {
|
||||
for_each_cpu(cpu, maskptr)
|
||||
pai_event_destroy_cpu(event, cpu);
|
||||
kfree(maskptr);
|
||||
goto out;
|
||||
pai_event_destroy_cpu(idx, cpu, false);
|
||||
goto undo;
|
||||
}
|
||||
cpumask_set_cpu(cpu, maskptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* On error all cpumask are freed and all events have been destroyed.
|
||||
* Save of which CPUs data structures have been allocated for.
|
||||
* Release them in pai_event_destroy call back function
|
||||
* for this event.
|
||||
*/
|
||||
PAI_CPU_MASK(event) = maskptr;
|
||||
rc = 0;
|
||||
/* Trace per-task events for CPU hotplug. */
|
||||
atomic_inc(&pai_root[idx].tskctx);
|
||||
undo:
|
||||
kfree(maskptr);
|
||||
out:
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -391,10 +425,14 @@ static int pai_event_init(struct perf_event *event, int idx)
|
|||
}
|
||||
}
|
||||
|
||||
cpus_read_lock();
|
||||
mutex_lock(&pai_reserve_mutex);
|
||||
if (event->cpu >= 0)
|
||||
rc = pai_alloc_cpu(event, event->cpu);
|
||||
rc = pai_alloc_cpu(idx, event->cpu, false);
|
||||
else
|
||||
rc = pai_alloc(event);
|
||||
mutex_unlock(&pai_reserve_mutex);
|
||||
cpus_read_unlock();
|
||||
if (rc) {
|
||||
free_page(PAI_SAVE_AREA(event));
|
||||
goto out;
|
||||
|
|
@ -1239,8 +1277,35 @@ static int __init paipmu_setup(void)
|
|||
return install_ok;
|
||||
}
|
||||
|
||||
static int pai_online_cpu(unsigned int cpu)
|
||||
{
|
||||
int rc;
|
||||
|
||||
mutex_lock(&pai_reserve_mutex);
|
||||
rc = pai_alloc_cpu(PAI_PMU_CRYPTO, cpu, true);
|
||||
if (rc)
|
||||
goto out;
|
||||
rc = pai_alloc_cpu(PAI_PMU_EXT, cpu, true);
|
||||
if (rc)
|
||||
pai_event_destroy_cpu(PAI_PMU_CRYPTO, cpu, true);
|
||||
out:
|
||||
mutex_unlock(&pai_reserve_mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int pai_offline_cpu(unsigned int cpu)
|
||||
{
|
||||
mutex_lock(&pai_reserve_mutex);
|
||||
pai_event_destroy_cpu(PAI_PMU_CRYPTO, cpu, true);
|
||||
pai_event_destroy_cpu(PAI_PMU_EXT, cpu, true);
|
||||
mutex_unlock(&pai_reserve_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init pai_init(void)
|
||||
{
|
||||
int state, rc;
|
||||
|
||||
/* Setup s390dbf facility */
|
||||
paidbg = debug_register("pai", 1, 1, 128);
|
||||
if (!paidbg) {
|
||||
|
|
@ -1249,13 +1314,24 @@ static int __init pai_init(void)
|
|||
}
|
||||
debug_register_view(paidbg, &debug_sprintf_view);
|
||||
|
||||
if (!paipmu_setup()) {
|
||||
/* No PMU registration, no need for debug buffer */
|
||||
debug_unregister_view(paidbg, &debug_sprintf_view);
|
||||
debug_unregister(paidbg);
|
||||
return -ENODEV;
|
||||
}
|
||||
/* CPUHP_BP_PREPARE_DYN --> before CPU is brought online */
|
||||
state = cpuhp_setup_state(CPUHP_BP_PREPARE_DYN, "perf/pai:prepare",
|
||||
pai_online_cpu, pai_offline_cpu);
|
||||
rc = state < 0 ? state : 0;
|
||||
if (rc < 0)
|
||||
goto out_debug;
|
||||
|
||||
rc = -ENODEV;
|
||||
if (!paipmu_setup())
|
||||
goto out_cpuhp;
|
||||
return 0;
|
||||
|
||||
out_cpuhp:
|
||||
cpuhp_remove_state(state);
|
||||
out_debug:
|
||||
debug_unregister_view(paidbg, &debug_sprintf_view);
|
||||
debug_unregister(paidbg);
|
||||
return rc;
|
||||
}
|
||||
|
||||
device_initcall(pai_init);
|
||||
|
|
|
|||
|
|
@ -204,10 +204,21 @@ config CC_HAS_MARCH_NATIVE
|
|||
# usage warnings that only appear wth '-march=native'.
|
||||
depends on CC_IS_GCC || CLANG_VERSION >= 190100
|
||||
|
||||
config RUSTC_HAS_APXF
|
||||
# The kernel isn't ready for in-kernel APX instructions. Without
|
||||
# explicit frontend gating of APX, the backend may emit those
|
||||
# instructions in native builds.
|
||||
#
|
||||
# Rust 1.88 added the `apxf` feature option, but versions before 1.93
|
||||
# emit an `apxf` target attribute that only LLVM 23+ can interpret.
|
||||
def_bool (RUSTC_VERSION >= 108800 && RUSTC_LLVM_MAJOR_VERSION >= 23) || \
|
||||
RUSTC_VERSION >= 109300
|
||||
|
||||
config X86_NATIVE_CPU
|
||||
bool "Build and optimize for local/native CPU"
|
||||
depends on X86_64
|
||||
depends on CC_HAS_MARCH_NATIVE
|
||||
depends on !RUST || RUSTC_HAS_APXF
|
||||
help
|
||||
Optimize for the current CPU used to compile the kernel.
|
||||
Use this option if you intend to build the kernel for your
|
||||
|
|
|
|||
|
|
@ -161,6 +161,11 @@ else
|
|||
|
||||
ifdef CONFIG_X86_NATIVE_CPU
|
||||
KBUILD_CFLAGS += -march=native
|
||||
# Prevent the compiler from generating EGPR use. The kernel is
|
||||
# not yet prepared for general in-kernel use.
|
||||
KBUILD_CFLAGS += $(call cc-option,-mno-apx-features=egpr)
|
||||
|
||||
# generate_rust_target.rs handles Rust APX gating.
|
||||
KBUILD_RUSTFLAGS += -Ctarget-cpu=native
|
||||
else
|
||||
KBUILD_CFLAGS += -march=x86-64 -mtune=generic
|
||||
|
|
|
|||
|
|
@ -982,6 +982,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_encrypt_32way)
|
|||
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
|
||||
%ymm15, %rax);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_aesni_avx2_encrypt_32way)
|
||||
|
|
@ -1007,6 +1008,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_decrypt_32way)
|
|||
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
|
||||
%ymm15, %rax);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_aesni_avx2_decrypt_32way)
|
||||
|
|
@ -1209,6 +1211,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_ctr_crypt_32way)
|
|||
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
|
||||
%ymm15, %r10);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_aesni_avx2_ctr_crypt_32way)
|
||||
|
|
@ -1359,6 +1362,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_encrypt_32way)
|
|||
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
|
||||
%ymm15, %rax);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_aesni_avx2_gfni_encrypt_32way)
|
||||
|
|
@ -1384,6 +1388,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_decrypt_32way)
|
|||
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
|
||||
%ymm15, %rax);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_aesni_avx2_gfni_decrypt_32way)
|
||||
|
|
@ -1428,6 +1433,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_ctr_crypt_32way)
|
|||
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
|
||||
%ymm15, %r10);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_aesni_avx2_gfni_ctr_crypt_32way)
|
||||
|
|
|
|||
|
|
@ -800,6 +800,7 @@ SYM_TYPED_FUNC_START(aria_gfni_avx512_encrypt_64way)
|
|||
%zmm9, %zmm8, %zmm11, %zmm10, %zmm12, %zmm13, %zmm14,
|
||||
%zmm15, %rax);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_gfni_avx512_encrypt_64way)
|
||||
|
|
@ -825,6 +826,7 @@ SYM_TYPED_FUNC_START(aria_gfni_avx512_decrypt_64way)
|
|||
%zmm9, %zmm8, %zmm11, %zmm10, %zmm12, %zmm13, %zmm14,
|
||||
%zmm15, %rax);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_gfni_avx512_decrypt_64way)
|
||||
|
|
@ -966,6 +968,7 @@ SYM_TYPED_FUNC_START(aria_gfni_avx512_ctr_crypt_64way)
|
|||
%zmm9, %zmm8, %zmm11, %zmm10, %zmm12, %zmm13, %zmm14,
|
||||
%zmm15, %r10);
|
||||
|
||||
vzeroupper;
|
||||
FRAME_END
|
||||
RET;
|
||||
SYM_FUNC_END(aria_gfni_avx512_ctr_crypt_64way)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <asm/desc.h>
|
||||
#include <asm/fred.h>
|
||||
#include <asm/idtentry.h>
|
||||
#include <asm/processor-flags.h>
|
||||
#include <asm/syscall.h>
|
||||
#include <asm/trapnr.h>
|
||||
#include <asm/traps.h>
|
||||
|
|
@ -71,7 +72,15 @@ static noinstr void fred_intx(struct pt_regs *regs)
|
|||
#endif
|
||||
|
||||
default:
|
||||
return exc_general_protection(regs, 0);
|
||||
/*
|
||||
* Reconstruct the #GP fault state that IDT delivery would produce.
|
||||
* Clear the software event flag so ERETU with TF set does not trap
|
||||
* before the resumed instruction. See prevent_single_step_upon_eretu().
|
||||
*/
|
||||
regs->ip -= regs->fred_ss.insnlen;
|
||||
regs->flags |= X86_EFLAGS_RF;
|
||||
regs->fred_ss.swevent = 0;
|
||||
return exc_general_protection(regs, (regs->fred_ss.vector << 3) | 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user