mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 13:25:20 +02:00
Merge branch 'v5.6/base' into v5.6/standard/tiny/common-pc
This commit is contained in:
commit
30fc7a1551
|
@ -492,6 +492,7 @@ What: /sys/devices/system/cpu/vulnerabilities
|
|||
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass
|
||||
/sys/devices/system/cpu/vulnerabilities/l1tf
|
||||
/sys/devices/system/cpu/vulnerabilities/mds
|
||||
/sys/devices/system/cpu/vulnerabilities/srbds
|
||||
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort
|
||||
/sys/devices/system/cpu/vulnerabilities/itlb_multihit
|
||||
Date: January 2018
|
||||
|
|
|
@ -14,3 +14,4 @@ are configurable at compile, boot or run time.
|
|||
mds
|
||||
tsx_async_abort
|
||||
multihit.rst
|
||||
special-register-buffer-data-sampling.rst
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
SRBDS - Special Register Buffer Data Sampling
|
||||
=============================================
|
||||
|
||||
SRBDS is a hardware vulnerability that allows MDS :doc:`mds` techniques to
|
||||
infer values returned from special register accesses. Special register
|
||||
accesses are accesses to off core registers. According to Intel's evaluation,
|
||||
the special register reads that have a security expectation of privacy are
|
||||
RDRAND, RDSEED and SGX EGETKEY.
|
||||
|
||||
When RDRAND, RDSEED and EGETKEY instructions are used, the data is moved
|
||||
to the core through the special register mechanism that is susceptible
|
||||
to MDS attacks.
|
||||
|
||||
Affected processors
|
||||
--------------------
|
||||
Core models (desktop, mobile, Xeon-E3) that implement RDRAND and/or RDSEED may
|
||||
be affected.
|
||||
|
||||
A processor is affected by SRBDS if its Family_Model and stepping is
|
||||
in the following list, with the exception of the listed processors
|
||||
exporting MDS_NO while Intel TSX is available yet not enabled. The
|
||||
latter class of processors are only affected when Intel TSX is enabled
|
||||
by software using TSX_CTRL_MSR otherwise they are not affected.
|
||||
|
||||
============= ============ ========
|
||||
common name Family_Model Stepping
|
||||
============= ============ ========
|
||||
IvyBridge 06_3AH All
|
||||
|
||||
Haswell 06_3CH All
|
||||
Haswell_L 06_45H All
|
||||
Haswell_G 06_46H All
|
||||
|
||||
Broadwell_G 06_47H All
|
||||
Broadwell 06_3DH All
|
||||
|
||||
Skylake_L 06_4EH All
|
||||
Skylake 06_5EH All
|
||||
|
||||
Kabylake_L 06_8EH <= 0xC
|
||||
Kabylake 06_9EH <= 0xD
|
||||
============= ============ ========
|
||||
|
||||
Related CVEs
|
||||
------------
|
||||
|
||||
The following CVE entry is related to this SRBDS issue:
|
||||
|
||||
============== ===== =====================================
|
||||
CVE-2020-0543 SRBDS Special Register Buffer Data Sampling
|
||||
============== ===== =====================================
|
||||
|
||||
Attack scenarios
|
||||
----------------
|
||||
An unprivileged user can extract values returned from RDRAND and RDSEED
|
||||
executed on another core or sibling thread using MDS techniques.
|
||||
|
||||
|
||||
Mitigation mechanism
|
||||
-------------------
|
||||
Intel will release microcode updates that modify the RDRAND, RDSEED, and
|
||||
EGETKEY instructions to overwrite secret special register data in the shared
|
||||
staging buffer before the secret data can be accessed by another logical
|
||||
processor.
|
||||
|
||||
During execution of the RDRAND, RDSEED, or EGETKEY instructions, off-core
|
||||
accesses from other logical processors will be delayed until the special
|
||||
register read is complete and the secret data in the shared staging buffer is
|
||||
overwritten.
|
||||
|
||||
This has three effects on performance:
|
||||
|
||||
#. RDRAND, RDSEED, or EGETKEY instructions have higher latency.
|
||||
|
||||
#. Executing RDRAND at the same time on multiple logical processors will be
|
||||
serialized, resulting in an overall reduction in the maximum RDRAND
|
||||
bandwidth.
|
||||
|
||||
#. Executing RDRAND, RDSEED or EGETKEY will delay memory accesses from other
|
||||
logical processors that miss their core caches, with an impact similar to
|
||||
legacy locked cache-line-split accesses.
|
||||
|
||||
The microcode updates provide an opt-out mechanism (RNGDS_MITG_DIS) to disable
|
||||
the mitigation for RDRAND and RDSEED instructions executed outside of Intel
|
||||
Software Guard Extensions (Intel SGX) enclaves. On logical processors that
|
||||
disable the mitigation using this opt-out mechanism, RDRAND and RDSEED do not
|
||||
take longer to execute and do not impact performance of sibling logical
|
||||
processors memory accesses. The opt-out mechanism does not affect Intel SGX
|
||||
enclaves (including execution of RDRAND or RDSEED inside an enclave, as well
|
||||
as EGETKEY execution).
|
||||
|
||||
IA32_MCU_OPT_CTRL MSR Definition
|
||||
--------------------------------
|
||||
Along with the mitigation for this issue, Intel added a new thread-scope
|
||||
IA32_MCU_OPT_CTRL MSR, (address 0x123). The presence of this MSR and
|
||||
RNGDS_MITG_DIS (bit 0) is enumerated by CPUID.(EAX=07H,ECX=0).EDX[SRBDS_CTRL =
|
||||
9]==1. This MSR is introduced through the microcode update.
|
||||
|
||||
Setting IA32_MCU_OPT_CTRL[0] (RNGDS_MITG_DIS) to 1 for a logical processor
|
||||
disables the mitigation for RDRAND and RDSEED executed outside of an Intel SGX
|
||||
enclave on that logical processor. Opting out of the mitigation for a
|
||||
particular logical processor does not affect the RDRAND and RDSEED mitigations
|
||||
for other logical processors.
|
||||
|
||||
Note that inside of an Intel SGX enclave, the mitigation is applied regardless
|
||||
of the value of RNGDS_MITG_DS.
|
||||
|
||||
Mitigation control on the kernel command line
|
||||
---------------------------------------------
|
||||
The kernel command line allows control over the SRBDS mitigation at boot time
|
||||
with the option "srbds=". The option for this is:
|
||||
|
||||
============= =============================================================
|
||||
off This option disables SRBDS mitigation for RDRAND and RDSEED on
|
||||
affected platforms.
|
||||
============= =============================================================
|
||||
|
||||
SRBDS System Information
|
||||
-----------------------
|
||||
The Linux kernel provides vulnerability status information through sysfs. For
|
||||
SRBDS this can be accessed by the following sysfs file:
|
||||
/sys/devices/system/cpu/vulnerabilities/srbds
|
||||
|
||||
The possible values contained in this file are:
|
||||
|
||||
============================== =============================================
|
||||
Not affected Processor not vulnerable
|
||||
Vulnerable Processor vulnerable and mitigation disabled
|
||||
Vulnerable: No microcode Processor vulnerable and microcode is missing
|
||||
mitigation
|
||||
Mitigation: Microcode Processor is vulnerable and mitigation is in
|
||||
effect.
|
||||
Mitigation: TSX disabled Processor is only vulnerable when TSX is
|
||||
enabled while this system was booted with TSX
|
||||
disabled.
|
||||
Unknown: Dependent on
|
||||
hypervisor status Running on virtual guest processor that is
|
||||
affected but with no way to know if host
|
||||
processor is mitigated or vulnerable.
|
||||
============================== =============================================
|
||||
|
||||
SRBDS Default mitigation
|
||||
------------------------
|
||||
This new microcode serializes processor access during execution of RDRAND,
|
||||
RDSEED ensures that the shared buffer is overwritten before it is released for
|
||||
reuse. Use the "srbds=off" kernel command line to disable the mitigation for
|
||||
RDRAND and RDSEED.
|
|
@ -4659,6 +4659,26 @@
|
|||
spia_pedr=
|
||||
spia_peddr=
|
||||
|
||||
srbds= [X86,INTEL]
|
||||
Control the Special Register Buffer Data Sampling
|
||||
(SRBDS) mitigation.
|
||||
|
||||
Certain CPUs are vulnerable to an MDS-like
|
||||
exploit which can leak bits from the random
|
||||
number generator.
|
||||
|
||||
By default, this issue is mitigated by
|
||||
microcode. However, the microcode fix can cause
|
||||
the RDRAND and RDSEED instructions to become
|
||||
much slower. Among other effects, this will
|
||||
result in reduced throughput from /dev/urandom.
|
||||
|
||||
The microcode mitigation can be disabled with
|
||||
the following option:
|
||||
|
||||
off: Disable mitigation and remove
|
||||
performance impact to RDRAND and RDSEED
|
||||
|
||||
srcutree.counter_wrap_check [KNL]
|
||||
Specifies how frequently to check for
|
||||
grace-period sequence counter wrap for the
|
||||
|
|
|
@ -112,6 +112,20 @@ used when printing stack backtraces. The specifier takes into
|
|||
consideration the effect of compiler optimisations which may occur
|
||||
when tail-calls are used and marked with the noreturn GCC attribute.
|
||||
|
||||
Probed Pointers from BPF / tracing
|
||||
----------------------------------
|
||||
|
||||
::
|
||||
|
||||
%pks kernel string
|
||||
%pus user string
|
||||
|
||||
The ``k`` and ``u`` specifiers are used for printing prior probed memory from
|
||||
either kernel memory (k) or user memory (u). The subsequent ``s`` specifier
|
||||
results in printing a string. For direct use in regular vsnprintf() the (k)
|
||||
and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(),
|
||||
for example, it reads the memory it is pointing to without faulting.
|
||||
|
||||
Kernel Pointers
|
||||
---------------
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@ Required properties:
|
|||
- compatible :
|
||||
- "fsl,vf610-edma" for eDMA used similar to that on Vybrid vf610 SoC
|
||||
- "fsl,imx7ulp-edma" for eDMA2 used similar to that on i.mx7ulp
|
||||
- "fsl,fsl,ls1028a-edma" for eDMA used similar to that on Vybrid vf610 SoC
|
||||
- "fsl,ls1028a-edma" followed by "fsl,vf610-edma" for eDMA used on the
|
||||
LS1028A SoC.
|
||||
- reg : Specifies base physical address(s) and size of the eDMA registers.
|
||||
The 1st region is eDMA control register's address and size.
|
||||
The 2nd and the 3rd regions are programmable channel multiplexing
|
||||
|
|
|
@ -159,11 +159,15 @@ Byte sequences
|
|||
distance = 16384 + (H << 14) + D
|
||||
state = S (copy S literals after this block)
|
||||
End of stream is reached if distance == 16384
|
||||
In version 1 only, to prevent ambiguity with the RLE case when
|
||||
((distance & 0x803f) == 0x803f) && (261 <= length <= 264), the
|
||||
compressor must not emit block copies where distance and length
|
||||
meet these conditions.
|
||||
|
||||
In version 1 only, this instruction is also used to encode a run of
|
||||
zeros if distance = 0xbfff, i.e. H = 1 and the D bits are all 1.
|
||||
In this case, it is followed by a fourth byte, X.
|
||||
run length = ((X << 3) | (0 0 0 0 0 L L L)) + 4.
|
||||
run length = ((X << 3) | (0 0 0 0 0 L L L)) + 4
|
||||
|
||||
0 0 1 L L L L L (32..63)
|
||||
Copy of small block within 16kB distance (preferably less than 34B)
|
||||
|
|
26
Makefile
26
Makefile
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 9
|
||||
SUBLEVEL = 19
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
@ -708,12 +708,9 @@ else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
|||
KBUILD_CFLAGS += -Os
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
|
||||
KBUILD_CFLAGS += -Wno-maybe-uninitialized
|
||||
endif
|
||||
|
||||
# Tell gcc to never replace conditional load with a non-conditional one
|
||||
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
|
||||
|
||||
include scripts/Makefile.kcov
|
||||
include scripts/Makefile.gcc-plugins
|
||||
|
@ -861,6 +858,17 @@ KBUILD_CFLAGS += -Wno-pointer-sign
|
|||
# disable stringop warnings in gcc 8+
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
|
||||
|
||||
# We'll want to enable this eventually, but it's not going away for 5.7 at least
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
|
||||
|
||||
# Another good warning that we'll want to enable eventually
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
|
||||
|
||||
# Enabled with W=2, disabled by default as noisy
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
||||
|
||||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
|
@ -1240,11 +1248,15 @@ ifneq ($(dtstree),)
|
|||
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
|
||||
|
||||
PHONY += dtbs dtbs_install dtbs_check
|
||||
dtbs dtbs_check: include/config/kernel.release scripts_dtc
|
||||
dtbs: include/config/kernel.release scripts_dtc
|
||||
$(Q)$(MAKE) $(build)=$(dtstree)
|
||||
|
||||
ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
|
||||
dtbs: dt_binding_check
|
||||
endif
|
||||
|
||||
dtbs_check: export CHECK_DTBS=1
|
||||
dtbs_check: dt_binding_check
|
||||
dtbs_check: dtbs
|
||||
|
||||
dtbs_install:
|
||||
$(Q)$(MAKE) $(dtbinst)=$(dtstree)
|
||||
|
|
|
@ -65,6 +65,7 @@ CONFIG_DRM_UDL=y
|
|||
CONFIG_DRM_ETNAVIV=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_HCD_PLATFORM=y
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/clocksource.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/of_clk.h>
|
||||
#include <linux/of_fdt.h>
|
||||
|
@ -409,12 +410,12 @@ static void arc_chk_core_config(void)
|
|||
if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr)
|
||||
panic("Linux built with incorrect DCCM Base address\n");
|
||||
|
||||
if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz)
|
||||
if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz)
|
||||
panic("Linux built with incorrect DCCM Size\n");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ICCM
|
||||
if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz)
|
||||
if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz)
|
||||
panic("Linux built with incorrect ICCM Size\n");
|
||||
#endif
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
menuconfig ARC_PLAT_EZNPS
|
||||
bool "\"EZchip\" ARC dev platform"
|
||||
depends on ISA_ARCOMPACT
|
||||
select CPU_BIG_ENDIAN
|
||||
select CLKSRC_NPS if !PHYS_ADDR_T_64BIT
|
||||
select EZNPS_GIC
|
||||
|
|
|
@ -13,6 +13,7 @@ config ARM
|
|||
select ARCH_HAS_KEEPINITRD
|
||||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
|
||||
select ARCH_HAS_PHYS_TO_DMA
|
||||
select ARCH_HAS_SETUP_DMA_OPS
|
||||
|
|
|
@ -43,7 +43,7 @@ SECTIONS
|
|||
}
|
||||
.table : ALIGN(4) {
|
||||
_table_start = .;
|
||||
LONG(ZIMAGE_MAGIC(2))
|
||||
LONG(ZIMAGE_MAGIC(4))
|
||||
LONG(ZIMAGE_MAGIC(0x5a534c4b))
|
||||
LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))
|
||||
LONG(ZIMAGE_MAGIC(_kernel_bss_size))
|
||||
|
|
|
@ -125,8 +125,6 @@
|
|||
bus-width = <8>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_sdmmc0_default>;
|
||||
non-removable;
|
||||
mmc-ddr-1_8v;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
timer@20200 {
|
||||
compatible = "arm,cortex-a9-global-timer";
|
||||
reg = <0x20200 0x100>;
|
||||
interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
|
||||
clocks = <&periph_clk>;
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,7 @@
|
|||
compatible = "arm,cortex-a9-twd-timer";
|
||||
reg = <0x20600 0x20>;
|
||||
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) |
|
||||
IRQ_TYPE_LEVEL_HIGH)>;
|
||||
IRQ_TYPE_EDGE_RISING)>;
|
||||
clocks = <&periph_clk>;
|
||||
};
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
|||
compatible = "arm,cortex-a9-twd-wdt";
|
||||
reg = <0x20620 0x20>;
|
||||
interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) |
|
||||
IRQ_TYPE_LEVEL_HIGH)>;
|
||||
IRQ_TYPE_EDGE_RISING)>;
|
||||
clocks = <&periph_clk>;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
leds {
|
||||
act {
|
||||
gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -172,6 +172,7 @@
|
|||
#address-cells = <1>;
|
||||
ranges = <0x51000000 0x51000000 0x3000
|
||||
0x0 0x20000000 0x10000000>;
|
||||
dma-ranges;
|
||||
/**
|
||||
* To enable PCI endpoint mode, disable the pcie1_rc
|
||||
* node and enable pcie1_ep mode.
|
||||
|
@ -185,7 +186,6 @@
|
|||
device_type = "pci";
|
||||
ranges = <0x81000000 0 0 0x03000 0 0x00010000
|
||||
0x82000000 0 0x20013000 0x13000 0 0xffed000>;
|
||||
dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x00 0xff>;
|
||||
#interrupt-cells = <1>;
|
||||
num-lanes = <1>;
|
||||
|
@ -230,6 +230,7 @@
|
|||
#address-cells = <1>;
|
||||
ranges = <0x51800000 0x51800000 0x3000
|
||||
0x0 0x30000000 0x10000000>;
|
||||
dma-ranges;
|
||||
status = "disabled";
|
||||
pcie2_rc: pcie@51800000 {
|
||||
reg = <0x51800000 0x2000>, <0x51802000 0x14c>, <0x1000 0x2000>;
|
||||
|
@ -240,7 +241,6 @@
|
|||
device_type = "pci";
|
||||
ranges = <0x81000000 0 0 0x03000 0 0x00010000
|
||||
0x82000000 0 0x30013000 0x13000 0 0xffed000>;
|
||||
dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x00 0xff>;
|
||||
#interrupt-cells = <1>;
|
||||
num-lanes = <1>;
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
imx27-phycard-s-rdk {
|
||||
pinctrl_i2c1: i2c1grp {
|
||||
fsl,pins = <
|
||||
MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
|
||||
MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
|
||||
MX27_PAD_I2C_DATA__I2C_DATA 0x0
|
||||
MX27_PAD_I2C_CLK__I2C_CLK 0x0
|
||||
>;
|
||||
};
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
};
|
||||
|
||||
&switch_ports {
|
||||
/delete-node/ port@2;
|
||||
/delete-node/ port@3;
|
||||
};
|
||||
|
||||
&touchscreen {
|
||||
|
|
|
@ -65,13 +65,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
|
||||
<&clks IMX6QDL_CLK_PLL3_USB_OTG>;
|
||||
};
|
||||
|
||||
&ldb {
|
||||
status = "okay";
|
||||
|
||||
|
|
|
@ -65,13 +65,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
|
||||
<&clks IMX6QDL_CLK_PLL3_USB_OTG>;
|
||||
};
|
||||
|
||||
&ldb {
|
||||
status = "okay";
|
||||
|
||||
|
|
|
@ -53,17 +53,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD2_396M>;
|
||||
};
|
||||
|
||||
&ldb {
|
||||
fsl,dual-channel;
|
||||
status = "okay";
|
||||
|
|
|
@ -377,3 +377,18 @@
|
|||
#interrupt-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&clks {
|
||||
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
|
||||
<&clks IMX6QDL_CLK_LDB_DI1_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>,
|
||||
<&clks IMX6QDL_CLK_IPU2_DI1_PRE_SEL>;
|
||||
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
|
||||
<&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
|
||||
};
|
||||
|
|
|
@ -153,6 +153,7 @@
|
|||
bus-width = <4>;
|
||||
keep-power-in-suspend;
|
||||
mmc-pwrseq = <&pwrseq_ti_wifi>;
|
||||
cap-power-off-card;
|
||||
non-removable;
|
||||
vmmc-supply = <&vcc_3v3>;
|
||||
/* vqmmc-supply = <&nvcc_sd1>; - MMC layer doesn't like it! */
|
||||
|
|
|
@ -98,19 +98,19 @@
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&ssp3 {
|
||||
&ssp1 {
|
||||
status = "okay";
|
||||
cs-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
|
||||
|
||||
firmware-flash@0 {
|
||||
compatible = "st,m25p80", "jedec,spi-nor";
|
||||
compatible = "winbond,w25q32", "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <40000000>;
|
||||
spi-max-frequency = <104000000>;
|
||||
m25p,fast-read;
|
||||
};
|
||||
};
|
||||
|
||||
&ssp4 {
|
||||
cs-gpios = <&gpio 56 GPIO_ACTIVE_HIGH>;
|
||||
&ssp2 {
|
||||
cs-gpios = <&gpio 56 GPIO_ACTIVE_LOW>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -202,8 +202,7 @@
|
|||
};
|
||||
|
||||
hsic_phy0: hsic-phy@f0001800 {
|
||||
compatible = "marvell,mmp3-hsic-phy",
|
||||
"usb-nop-xceiv";
|
||||
compatible = "marvell,mmp3-hsic-phy";
|
||||
reg = <0xf0001800 0x40>;
|
||||
#phy-cells = <0>;
|
||||
status = "disabled";
|
||||
|
@ -224,8 +223,7 @@
|
|||
};
|
||||
|
||||
hsic_phy1: hsic-phy@f0002800 {
|
||||
compatible = "marvell,mmp3-hsic-phy",
|
||||
"usb-nop-xceiv";
|
||||
compatible = "marvell,mmp3-hsic-phy";
|
||||
reg = <0xf0002800 0x40>;
|
||||
#phy-cells = <0>;
|
||||
status = "disabled";
|
||||
|
@ -531,7 +529,7 @@
|
|||
};
|
||||
|
||||
soc_clocks: clocks@d4050000 {
|
||||
compatible = "marvell,mmp2-clock";
|
||||
compatible = "marvell,mmp3-clock";
|
||||
reg = <0xd4050000 0x1000>,
|
||||
<0xd4282800 0x400>,
|
||||
<0xd4015000 0x1000>;
|
||||
|
|
|
@ -367,6 +367,8 @@
|
|||
};
|
||||
|
||||
&mmc3 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc3_pins>;
|
||||
vmmc-supply = <&wl12xx_vmmc>;
|
||||
/* uart2_tx.sdmmc3_dat1 pad as wakeirq */
|
||||
interrupts-extended = <&wakeupgen GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH
|
||||
|
@ -472,6 +474,37 @@
|
|||
>;
|
||||
};
|
||||
|
||||
/*
|
||||
* Android uses PIN_OFF_INPUT_PULLDOWN | PIN_INPUT_PULLUP | MUX_MODE3
|
||||
* for gpio_100, but the internal pull makes wlan flakey on some
|
||||
* devices. Off mode value should be tested if we have off mode working
|
||||
* later on.
|
||||
*/
|
||||
mmc3_pins: pinmux_mmc3_pins {
|
||||
pinctrl-single,pins = <
|
||||
/* 0x4a10008e gpmc_wait2.gpio_100 d23 */
|
||||
OMAP4_IOPAD(0x08e, PIN_INPUT | MUX_MODE3)
|
||||
|
||||
/* 0x4a100102 abe_mcbsp1_dx.sdmmc3_dat2 ab25 */
|
||||
OMAP4_IOPAD(0x102, PIN_INPUT_PULLUP | MUX_MODE1)
|
||||
|
||||
/* 0x4a100104 abe_mcbsp1_fsx.sdmmc3_dat3 ac27 */
|
||||
OMAP4_IOPAD(0x104, PIN_INPUT_PULLUP | MUX_MODE1)
|
||||
|
||||
/* 0x4a100118 uart2_cts.sdmmc3_clk ab26 */
|
||||
OMAP4_IOPAD(0x118, PIN_INPUT | MUX_MODE1)
|
||||
|
||||
/* 0x4a10011a uart2_rts.sdmmc3_cmd ab27 */
|
||||
OMAP4_IOPAD(0x11a, PIN_INPUT_PULLUP | MUX_MODE1)
|
||||
|
||||
/* 0x4a10011c uart2_rx.sdmmc3_dat0 aa25 */
|
||||
OMAP4_IOPAD(0x11c, PIN_INPUT_PULLUP | MUX_MODE1)
|
||||
|
||||
/* 0x4a10011e uart2_tx.sdmmc3_dat1 aa26 */
|
||||
OMAP4_IOPAD(0x11e, PIN_INPUT_PULLUP | MUX_MODE1)
|
||||
>;
|
||||
};
|
||||
|
||||
/* gpmc_ncs0.gpio_50 */
|
||||
poweroff_gpio: pinmux_poweroff_pins {
|
||||
pinctrl-single,pins = <
|
||||
|
@ -690,14 +723,18 @@
|
|||
};
|
||||
|
||||
/*
|
||||
* As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for
|
||||
* uart1 wakeirq.
|
||||
* The uart1 port is wired to mdm6600 with rts and cts. The modem uses gpio_149
|
||||
* for wake-up events for both the USB PHY and the UART. We can use gpio_149
|
||||
* pad as the shared wakeirq for the UART rather than the RX or CTS pad as we
|
||||
* have gpio_149 trigger before the UART transfer starts.
|
||||
*/
|
||||
&uart1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart1_pins>;
|
||||
interrupts-extended = <&wakeupgen GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH
|
||||
&omap4_pmx_core 0xfc>;
|
||||
&omap4_pmx_core 0x110>;
|
||||
uart-has-rtscts;
|
||||
current-speed = <115200>;
|
||||
};
|
||||
|
||||
&uart3 {
|
||||
|
|
|
@ -131,7 +131,14 @@
|
|||
cmt1: timer@e6130000 {
|
||||
compatible = "renesas,r8a73a4-cmt1", "renesas,rcar-gen2-cmt1";
|
||||
reg = <0 0xe6130000 0 0x1004>;
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&mstp3_clks R8A73A4_CLK_CMT1>;
|
||||
clock-names = "fck";
|
||||
power-domains = <&pd_c5>;
|
||||
|
|
|
@ -479,7 +479,7 @@
|
|||
cpg_clocks: cpg_clocks@e6150000 {
|
||||
compatible = "renesas,r8a7740-cpg-clocks";
|
||||
reg = <0xe6150000 0x10000>;
|
||||
clocks = <&extal1_clk>, <&extalr_clk>;
|
||||
clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names = "system", "pllc0", "pllc1",
|
||||
"pllc2", "r",
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
assigned-clocks = <&cru SCLK_GPU>;
|
||||
assigned-clock-rates = <100000000>;
|
||||
clocks = <&cru SCLK_GPU>, <&cru SCLK_GPU>;
|
||||
clock-names = "core", "bus";
|
||||
clock-names = "bus", "core";
|
||||
resets = <&cru SRST_GPU>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
phy: phy@0 {
|
||||
phy: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22";
|
||||
reg = <0>;
|
||||
clocks = <&cru SCLK_MAC_PHY>;
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
phy: phy@0 {
|
||||
phy: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-id1234.d400",
|
||||
"ethernet-phy-ieee802.3-c22";
|
||||
reg = <0>;
|
||||
|
|
|
@ -561,7 +561,7 @@
|
|||
"pp1",
|
||||
"ppmmu1";
|
||||
clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
|
||||
clock-names = "core", "bus";
|
||||
clock-names = "bus", "core";
|
||||
resets = <&cru SRST_GPU_A>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
@ -1033,7 +1033,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
spi-0 {
|
||||
spi0 {
|
||||
spi0_clk: spi0-clk {
|
||||
rockchip,pins = <0 RK_PB1 2 &pcfg_pull_up>;
|
||||
};
|
||||
|
@ -1051,7 +1051,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
spi-1 {
|
||||
spi1 {
|
||||
spi1_clk: spi1-clk {
|
||||
rockchip,pins = <0 RK_PC7 2 &pcfg_pull_up>;
|
||||
};
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
compatible = "arm,mali-400";
|
||||
reg = <0x10090000 0x10000>;
|
||||
clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
|
||||
clock-names = "core", "bus";
|
||||
clock-names = "bus", "core";
|
||||
assigned-clocks = <&cru ACLK_GPU>;
|
||||
assigned-clock-rates = <100000000>;
|
||||
resets = <&cru SRST_GPU>;
|
||||
|
|
|
@ -91,9 +91,17 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes,
|
|||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
chacha_doneon(state, dst, src, bytes, nrounds);
|
||||
chacha_doneon(state, dst, src, todo, nrounds);
|
||||
kernel_neon_end();
|
||||
|
||||
bytes -= todo;
|
||||
src += todo;
|
||||
dst += todo;
|
||||
} while (bytes);
|
||||
}
|
||||
EXPORT_SYMBOL(chacha_crypt_arch);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc,
|
|||
return crypto_nhpoly1305_update(desc, src, srclen);
|
||||
|
||||
do {
|
||||
unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
|
||||
unsigned int n = min_t(unsigned int, srclen, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);
|
||||
|
|
|
@ -160,13 +160,20 @@ void poly1305_update_arch(struct poly1305_desc_ctx *dctx, const u8 *src,
|
|||
unsigned int len = round_down(nbytes, POLY1305_BLOCK_SIZE);
|
||||
|
||||
if (static_branch_likely(&have_neon) && do_neon) {
|
||||
do {
|
||||
unsigned int todo = min_t(unsigned int, len, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
poly1305_blocks_neon(&dctx->h, src, len, 1);
|
||||
poly1305_blocks_neon(&dctx->h, src, todo, 1);
|
||||
kernel_neon_end();
|
||||
|
||||
len -= todo;
|
||||
src += todo;
|
||||
} while (len);
|
||||
} else {
|
||||
poly1305_blocks_arm(&dctx->h, src, len, 1);
|
||||
}
|
||||
src += len;
|
||||
}
|
||||
nbytes %= POLY1305_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
#endif
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/domain.h>
|
||||
#include <asm/opcodes-virt.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/uaccess-asm.h>
|
||||
|
||||
#define IOMEM(x) (x)
|
||||
|
||||
|
@ -446,79 +446,6 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
|
|||
.size \name , . - \name
|
||||
.endm
|
||||
|
||||
.macro csdb
|
||||
#ifdef CONFIG_THUMB2_KERNEL
|
||||
.inst.w 0xf3af8014
|
||||
#else
|
||||
.inst 0xe320f014
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
|
||||
#ifndef CONFIG_CPU_USE_DOMAINS
|
||||
adds \tmp, \addr, #\size - 1
|
||||
sbcscc \tmp, \tmp, \limit
|
||||
bcs \bad
|
||||
#ifdef CONFIG_CPU_SPECTRE
|
||||
movcs \addr, #0
|
||||
csdb
|
||||
#endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
|
||||
#ifdef CONFIG_CPU_SPECTRE
|
||||
sub \tmp, \limit, #1
|
||||
subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
|
||||
addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
|
||||
subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
|
||||
movlo \addr, #0 @ if (tmp < 0) addr = NULL
|
||||
csdb
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_disable, tmp, isb=1
|
||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||
/*
|
||||
* Whenever we re-enter userspace, the domains should always be
|
||||
* set appropriately.
|
||||
*/
|
||||
mov \tmp, #DACR_UACCESS_DISABLE
|
||||
mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
|
||||
.if \isb
|
||||
instr_sync
|
||||
.endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_enable, tmp, isb=1
|
||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||
/*
|
||||
* Whenever we re-enter userspace, the domains should always be
|
||||
* set appropriately.
|
||||
*/
|
||||
mov \tmp, #DACR_UACCESS_ENABLE
|
||||
mcr p15, 0, \tmp, c3, c0, 0
|
||||
.if \isb
|
||||
instr_sync
|
||||
.endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_save, tmp
|
||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||
mrc p15, 0, \tmp, c3, c0, 0
|
||||
str \tmp, [sp, #SVC_DACR]
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_restore
|
||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||
ldr r0, [sp, #SVC_DACR]
|
||||
mcr p15, 0, r0, c3, c0, 0
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
|
||||
.macro ret\c, reg
|
||||
#if __LINUX_ARM_ARCH__ < 6
|
||||
|
|
|
@ -164,7 +164,12 @@ arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr)
|
|||
preempt_enable();
|
||||
#endif
|
||||
|
||||
if (!ret)
|
||||
/*
|
||||
* Store unconditionally. If ret != 0 the extra store is the least
|
||||
* of the worries but GCC cannot figure out that __futex_atomic_op()
|
||||
* is either setting ret to -EFAULT or storing the old value in
|
||||
* oldval which results in a uninitialized warning at the call site.
|
||||
*/
|
||||
*oval = oldval;
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -367,6 +367,7 @@ static inline unsigned long vcpu_data_host_to_guest(struct kvm_vcpu *vcpu,
|
|||
}
|
||||
}
|
||||
|
||||
static inline void vcpu_ptrauth_setup_lazy(struct kvm_vcpu *vcpu) {}
|
||||
static inline bool vcpu_has_ptrauth(struct kvm_vcpu *vcpu) { return false; }
|
||||
static inline void vcpu_ptrauth_disable(struct kvm_vcpu *vcpu) { }
|
||||
|
||||
#endif /* __ARM_KVM_EMULATE_H__ */
|
||||
|
|
|
@ -453,4 +453,6 @@ static inline bool kvm_arm_vcpu_is_finalized(struct kvm_vcpu *vcpu)
|
|||
return true;
|
||||
}
|
||||
|
||||
#define kvm_arm_vcpu_loaded(vcpu) (false)
|
||||
|
||||
#endif /* __ARM_KVM_HOST_H__ */
|
||||
|
|
117
arch/arm/include/asm/uaccess-asm.h
Normal file
117
arch/arm/include/asm/uaccess-asm.h
Normal file
|
@ -0,0 +1,117 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef __ASM_UACCESS_ASM_H__
|
||||
#define __ASM_UACCESS_ASM_H__
|
||||
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/domain.h>
|
||||
#include <asm/memory.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
.macro csdb
|
||||
#ifdef CONFIG_THUMB2_KERNEL
|
||||
.inst.w 0xf3af8014
|
||||
#else
|
||||
.inst 0xe320f014
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
|
||||
#ifndef CONFIG_CPU_USE_DOMAINS
|
||||
adds \tmp, \addr, #\size - 1
|
||||
sbcscc \tmp, \tmp, \limit
|
||||
bcs \bad
|
||||
#ifdef CONFIG_CPU_SPECTRE
|
||||
movcs \addr, #0
|
||||
csdb
|
||||
#endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
|
||||
#ifdef CONFIG_CPU_SPECTRE
|
||||
sub \tmp, \limit, #1
|
||||
subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
|
||||
addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
|
||||
subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
|
||||
movlo \addr, #0 @ if (tmp < 0) addr = NULL
|
||||
csdb
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_disable, tmp, isb=1
|
||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||
/*
|
||||
* Whenever we re-enter userspace, the domains should always be
|
||||
* set appropriately.
|
||||
*/
|
||||
mov \tmp, #DACR_UACCESS_DISABLE
|
||||
mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
|
||||
.if \isb
|
||||
instr_sync
|
||||
.endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro uaccess_enable, tmp, isb=1
|
||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||
/*
|
||||
* Whenever we re-enter userspace, the domains should always be
|
||||
* set appropriately.
|
||||
*/
|
||||
mov \tmp, #DACR_UACCESS_ENABLE
|
||||
mcr p15, 0, \tmp, c3, c0, 0
|
||||
.if \isb
|
||||
instr_sync
|
||||
.endif
|
||||
#endif
|
||||
.endm
|
||||
|
||||
#if defined(CONFIG_CPU_SW_DOMAIN_PAN) || defined(CONFIG_CPU_USE_DOMAINS)
|
||||
#define DACR(x...) x
|
||||
#else
|
||||
#define DACR(x...)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Save the address limit on entry to a privileged exception.
|
||||
*
|
||||
* If we are using the DACR for kernel access by the user accessors
|
||||
* (CONFIG_CPU_USE_DOMAINS=y), always reset the DACR kernel domain
|
||||
* back to client mode, whether or not \disable is set.
|
||||
*
|
||||
* If we are using SW PAN, set the DACR user domain to no access
|
||||
* if \disable is set.
|
||||
*/
|
||||
.macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
|
||||
ldr \tmp1, [\tsk, #TI_ADDR_LIMIT]
|
||||
mov \tmp2, #TASK_SIZE
|
||||
str \tmp2, [\tsk, #TI_ADDR_LIMIT]
|
||||
DACR( mrc p15, 0, \tmp0, c3, c0, 0)
|
||||
DACR( str \tmp0, [sp, #SVC_DACR])
|
||||
str \tmp1, [sp, #SVC_ADDR_LIMIT]
|
||||
.if \disable && IS_ENABLED(CONFIG_CPU_SW_DOMAIN_PAN)
|
||||
/* kernel=client, user=no access */
|
||||
mov \tmp2, #DACR_UACCESS_DISABLE
|
||||
mcr p15, 0, \tmp2, c3, c0, 0
|
||||
instr_sync
|
||||
.elseif IS_ENABLED(CONFIG_CPU_USE_DOMAINS)
|
||||
/* kernel=client */
|
||||
bic \tmp2, \tmp0, #domain_mask(DOMAIN_KERNEL)
|
||||
orr \tmp2, \tmp2, #domain_val(DOMAIN_KERNEL, DOMAIN_CLIENT)
|
||||
mcr p15, 0, \tmp2, c3, c0, 0
|
||||
instr_sync
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* Restore the user access state previously saved by uaccess_entry */
|
||||
.macro uaccess_exit, tsk, tmp0, tmp1
|
||||
ldr \tmp1, [sp, #SVC_ADDR_LIMIT]
|
||||
DACR( ldr \tmp0, [sp, #SVC_DACR])
|
||||
str \tmp1, [\tsk, #TI_ADDR_LIMIT]
|
||||
DACR( mcr p15, 0, \tmp0, c3, c0, 0)
|
||||
.endm
|
||||
|
||||
#undef DACR
|
||||
|
||||
#endif /* __ASM_UACCESS_ASM_H__ */
|
|
@ -27,6 +27,7 @@
|
|||
#include <asm/unistd.h>
|
||||
#include <asm/tls.h>
|
||||
#include <asm/system_info.h>
|
||||
#include <asm/uaccess-asm.h>
|
||||
|
||||
#include "entry-header.S"
|
||||
#include <asm/entry-macro-multi.S>
|
||||
|
@ -179,15 +180,7 @@ ENDPROC(__und_invalid)
|
|||
stmia r7, {r2 - r6}
|
||||
|
||||
get_thread_info tsk
|
||||
ldr r0, [tsk, #TI_ADDR_LIMIT]
|
||||
mov r1, #TASK_SIZE
|
||||
str r1, [tsk, #TI_ADDR_LIMIT]
|
||||
str r0, [sp, #SVC_ADDR_LIMIT]
|
||||
|
||||
uaccess_save r0
|
||||
.if \uaccess
|
||||
uaccess_disable r0
|
||||
.endif
|
||||
uaccess_entry tsk, r0, r1, r2, \uaccess
|
||||
|
||||
.if \trace
|
||||
#ifdef CONFIG_TRACE_IRQFLAGS
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <asm/asm-offsets.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/uaccess-asm.h>
|
||||
#include <asm/v7m.h>
|
||||
|
||||
@ Bad Abort numbers
|
||||
|
@ -217,9 +218,7 @@
|
|||
blne trace_hardirqs_off
|
||||
#endif
|
||||
.endif
|
||||
ldr r1, [sp, #SVC_ADDR_LIMIT]
|
||||
uaccess_restore
|
||||
str r1, [tsk, #TI_ADDR_LIMIT]
|
||||
uaccess_exit tsk, r0, r1
|
||||
|
||||
#ifndef CONFIG_THUMB2_KERNEL
|
||||
@ ARM mode SVC restore
|
||||
|
@ -263,9 +262,7 @@
|
|||
@ on the stack remains correct).
|
||||
@
|
||||
.macro svc_exit_via_fiq
|
||||
ldr r1, [sp, #SVC_ADDR_LIMIT]
|
||||
uaccess_restore
|
||||
str r1, [tsk, #TI_ADDR_LIMIT]
|
||||
uaccess_exit tsk, r0, r1
|
||||
#ifndef CONFIG_THUMB2_KERNEL
|
||||
@ ARM mode restore
|
||||
mov r0, sp
|
||||
|
|
|
@ -219,8 +219,8 @@ static struct undef_hook arm_break_hook = {
|
|||
};
|
||||
|
||||
static struct undef_hook thumb_break_hook = {
|
||||
.instr_mask = 0xffff,
|
||||
.instr_val = 0xde01,
|
||||
.instr_mask = 0xffffffff,
|
||||
.instr_val = 0x0000de01,
|
||||
.cpsr_mask = PSR_T_BIT,
|
||||
.cpsr_val = PSR_T_BIT,
|
||||
.fn = break_trap,
|
||||
|
|
|
@ -21,6 +21,7 @@ config ARM64
|
|||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_KEEPINITRD
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_DEVMAP
|
||||
select ARCH_HAS_PTE_SPECIAL
|
||||
select ARCH_HAS_SETUP_DMA_OPS
|
||||
|
|
|
@ -2204,7 +2204,7 @@
|
|||
reg = <0x0 0xff400000 0x0 0x40000>;
|
||||
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clkc CLKID_USB1_DDR_BRIDGE>;
|
||||
clock-names = "ddr";
|
||||
clock-names = "otg";
|
||||
phys = <&usb2_phy1>;
|
||||
phy-names = "usb2-phy";
|
||||
dr_mode = "peripheral";
|
||||
|
|
|
@ -152,6 +152,10 @@
|
|||
clock-latency = <50000>;
|
||||
};
|
||||
|
||||
&frddr_a {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&frddr_b {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -545,7 +545,7 @@
|
|||
&usb {
|
||||
status = "okay";
|
||||
dr_mode = "host";
|
||||
vbus-regulator = <&usb_pwr_en>;
|
||||
vbus-supply = <&usb_pwr_en>;
|
||||
};
|
||||
|
||||
&usb2_phy0 {
|
||||
|
|
|
@ -661,7 +661,7 @@
|
|||
reg = <0x30bd0000 0x10000>;
|
||||
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk IMX8MN_CLK_SDMA1_ROOT>,
|
||||
<&clk IMX8MN_CLK_SDMA1_ROOT>;
|
||||
<&clk IMX8MN_CLK_AHB>;
|
||||
clock-names = "ipg", "ahb";
|
||||
#dma-cells = <3>;
|
||||
fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
|
||||
|
|
|
@ -1401,8 +1401,8 @@
|
|||
"venc_lt_sel";
|
||||
assigned-clocks = <&topckgen CLK_TOP_VENC_SEL>,
|
||||
<&topckgen CLK_TOP_VENC_LT_SEL>;
|
||||
assigned-clock-parents = <&topckgen CLK_TOP_VENCPLL_D2>,
|
||||
<&topckgen CLK_TOP_UNIVPLL1_D2>;
|
||||
assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL>,
|
||||
<&topckgen CLK_TOP_VCODECPLL_370P5>;
|
||||
};
|
||||
|
||||
jpegdec: jpegdec@18004000 {
|
||||
|
|
|
@ -658,8 +658,8 @@
|
|||
s11 {
|
||||
qcom,saw-leader;
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1230000>;
|
||||
regulator-max-microvolt = <1230000>;
|
||||
regulator-min-microvolt = <980000>;
|
||||
regulator-max-microvolt = <980000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -908,10 +908,27 @@
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&q6asmdai {
|
||||
dai@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
dai@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
dai@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
&sound {
|
||||
compatible = "qcom,apq8096-sndcard";
|
||||
model = "DB820c";
|
||||
audio-routing = "RX_BIAS", "MCLK";
|
||||
audio-routing = "RX_BIAS", "MCLK",
|
||||
"MM_DL1", "MultiMedia1 Playback",
|
||||
"MM_DL2", "MultiMedia2 Playback",
|
||||
"MultiMedia3 Capture", "MM_UL3";
|
||||
|
||||
mm1-dai-link {
|
||||
link-name = "MultiMedia1";
|
||||
|
|
|
@ -2053,6 +2053,8 @@
|
|||
reg = <APR_SVC_ASM>;
|
||||
q6asmdai: dais {
|
||||
compatible = "qcom,q6asm-dais";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
#sound-dai-cells = <1>;
|
||||
iommus = <&lpass_q6_smmu 1>;
|
||||
};
|
||||
|
|
|
@ -1318,6 +1318,7 @@
|
|||
ipmmu_vip0: mmu@e7b00000 {
|
||||
compatible = "renesas,ipmmu-r8a77980";
|
||||
reg = <0 0xe7b00000 0 0x1000>;
|
||||
renesas,ipmmu-main = <&ipmmu_mm 4>;
|
||||
power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
|
||||
#iommu-cells = <1>;
|
||||
};
|
||||
|
@ -1325,6 +1326,7 @@
|
|||
ipmmu_vip1: mmu@e7960000 {
|
||||
compatible = "renesas,ipmmu-r8a77980";
|
||||
reg = <0 0xe7960000 0 0x1000>;
|
||||
renesas,ipmmu-main = <&ipmmu_mm 11>;
|
||||
power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
|
||||
#iommu-cells = <1>;
|
||||
};
|
||||
|
|
|
@ -86,13 +86,13 @@
|
|||
assigned-clock-rate = <50000000>;
|
||||
assigned-clocks = <&cru SCLK_MAC2PHY>;
|
||||
assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
|
||||
rk805: rk805@18 {
|
||||
rk805: pmic@18 {
|
||||
compatible = "rockchip,rk805";
|
||||
reg = <0x18>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
&i2c1 {
|
||||
status = "okay";
|
||||
|
||||
rk805: rk805@18 {
|
||||
rk805: pmic@18 {
|
||||
compatible = "rockchip,rk805";
|
||||
reg = <0x18>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
|
|
|
@ -410,7 +410,7 @@
|
|||
reset-names = "usb3-otg";
|
||||
status = "disabled";
|
||||
|
||||
usbdrd_dwc3_0: dwc3 {
|
||||
usbdrd_dwc3_0: usb@fe800000 {
|
||||
compatible = "snps,dwc3";
|
||||
reg = <0x0 0xfe800000 0x0 0x100000>;
|
||||
interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
|
@ -446,7 +446,7 @@
|
|||
reset-names = "usb3-otg";
|
||||
status = "disabled";
|
||||
|
||||
usbdrd_dwc3_1: dwc3 {
|
||||
usbdrd_dwc3_1: usb@fe900000 {
|
||||
compatible = "snps,dwc3";
|
||||
reg = <0x0 0xfe900000 0x0 0x100000>;
|
||||
interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
|
@ -1890,10 +1890,10 @@
|
|||
gpu: gpu@ff9a0000 {
|
||||
compatible = "rockchip,rk3399-mali", "arm,mali-t860";
|
||||
reg = <0x0 0xff9a0000 0x0 0x10000>;
|
||||
interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
<GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
<GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
interrupt-names = "gpu", "job", "mmu";
|
||||
interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
<GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
<GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
interrupt-names = "job", "mmu", "gpu";
|
||||
clocks = <&cru ACLK_GPU>;
|
||||
#cooling-cells = <2>;
|
||||
power-domains = <&power RK3399_PD_GPU>;
|
||||
|
|
|
@ -87,9 +87,17 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes,
|
|||
!crypto_simd_usable())
|
||||
return chacha_crypt_generic(state, dst, src, bytes, nrounds);
|
||||
|
||||
do {
|
||||
unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
chacha_doneon(state, dst, src, bytes, nrounds);
|
||||
chacha_doneon(state, dst, src, todo, nrounds);
|
||||
kernel_neon_end();
|
||||
|
||||
bytes -= todo;
|
||||
src += todo;
|
||||
dst += todo;
|
||||
} while (bytes);
|
||||
}
|
||||
EXPORT_SYMBOL(chacha_crypt_arch);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc,
|
|||
return crypto_nhpoly1305_update(desc, src, srclen);
|
||||
|
||||
do {
|
||||
unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
|
||||
unsigned int n = min_t(unsigned int, srclen, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);
|
||||
|
|
|
@ -143,13 +143,20 @@ void poly1305_update_arch(struct poly1305_desc_ctx *dctx, const u8 *src,
|
|||
unsigned int len = round_down(nbytes, POLY1305_BLOCK_SIZE);
|
||||
|
||||
if (static_branch_likely(&have_neon) && crypto_simd_usable()) {
|
||||
do {
|
||||
unsigned int todo = min_t(unsigned int, len, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
poly1305_blocks_neon(&dctx->h, src, len, 1);
|
||||
poly1305_blocks_neon(&dctx->h, src, todo, 1);
|
||||
kernel_neon_end();
|
||||
|
||||
len -= todo;
|
||||
src += todo;
|
||||
} while (len);
|
||||
} else {
|
||||
poly1305_blocks(&dctx->h, src, len, 1);
|
||||
}
|
||||
src += len;
|
||||
}
|
||||
nbytes %= POLY1305_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/efi.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/psci.h>
|
||||
#include <linux/stddef.h>
|
||||
|
||||
#include <asm/cputype.h>
|
||||
#include <asm/io.h>
|
||||
|
@ -31,14 +32,14 @@
|
|||
* is therefore used to delimit the MADT GICC structure minimum length
|
||||
* appropriately.
|
||||
*/
|
||||
#define ACPI_MADT_GICC_MIN_LENGTH ACPI_OFFSET( \
|
||||
#define ACPI_MADT_GICC_MIN_LENGTH offsetof( \
|
||||
struct acpi_madt_generic_interrupt, efficiency_class)
|
||||
|
||||
#define BAD_MADT_GICC_ENTRY(entry, end) \
|
||||
(!(entry) || (entry)->header.length < ACPI_MADT_GICC_MIN_LENGTH || \
|
||||
(unsigned long)(entry) + (entry)->header.length > (end))
|
||||
|
||||
#define ACPI_MADT_GICC_SPE (ACPI_OFFSET(struct acpi_madt_generic_interrupt, \
|
||||
#define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \
|
||||
spe_interrupt) + sizeof(u16))
|
||||
|
||||
/* Basic configuration for ACPI */
|
||||
|
|
|
@ -111,12 +111,6 @@ static inline void vcpu_ptrauth_disable(struct kvm_vcpu *vcpu)
|
|||
vcpu->arch.hcr_el2 &= ~(HCR_API | HCR_APK);
|
||||
}
|
||||
|
||||
static inline void vcpu_ptrauth_setup_lazy(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
if (vcpu_has_ptrauth(vcpu))
|
||||
vcpu_ptrauth_disable(vcpu);
|
||||
}
|
||||
|
||||
static inline unsigned long vcpu_get_vsesr(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->arch.vsesr_el2;
|
||||
|
|
|
@ -404,8 +404,10 @@ void vcpu_write_sys_reg(struct kvm_vcpu *vcpu, u64 val, int reg);
|
|||
* CP14 and CP15 live in the same array, as they are backed by the
|
||||
* same system registers.
|
||||
*/
|
||||
#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r)])
|
||||
#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r)])
|
||||
#define CPx_BIAS IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
|
||||
|
||||
#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS])
|
||||
#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS])
|
||||
|
||||
struct kvm_vm_stat {
|
||||
ulong remote_tlb_flush;
|
||||
|
@ -683,4 +685,6 @@ bool kvm_arm_vcpu_is_finalized(struct kvm_vcpu *vcpu);
|
|||
#define kvm_arm_vcpu_sve_finalized(vcpu) \
|
||||
((vcpu)->arch.flags & KVM_ARM64_VCPU_SVE_FINALIZED)
|
||||
|
||||
#define kvm_arm_vcpu_loaded(vcpu) ((vcpu)->arch.sysregs_loaded_on_cpu)
|
||||
|
||||
#endif /* __ARM64_KVM_HOST_H__ */
|
||||
|
|
|
@ -177,6 +177,7 @@ void machine_kexec(struct kimage *kimage)
|
|||
* the offline CPUs. Therefore, we must use the __* variant here.
|
||||
*/
|
||||
__flush_icache_range((uintptr_t)reboot_code_buffer,
|
||||
(uintptr_t)reboot_code_buffer +
|
||||
arm64_relocate_new_kernel_size);
|
||||
|
||||
/* Flush the kimage list and its buffers. */
|
||||
|
|
|
@ -1829,10 +1829,11 @@ static void tracehook_report_syscall(struct pt_regs *regs,
|
|||
|
||||
int syscall_trace_enter(struct pt_regs *regs)
|
||||
{
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE) ||
|
||||
test_thread_flag(TIF_SYSCALL_EMU)) {
|
||||
unsigned long flags = READ_ONCE(current_thread_info()->flags);
|
||||
|
||||
if (flags & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
|
||||
tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
|
||||
if (!in_syscall(regs) || test_thread_flag(TIF_SYSCALL_EMU))
|
||||
if (!in_syscall(regs) || (flags & _TIF_SYSCALL_EMU))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ UBSAN_SANITIZE := n
|
|||
OBJECT_FILES_NON_STANDARD := y
|
||||
KCOV_INSTRUMENT := n
|
||||
|
||||
CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny
|
||||
CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables
|
||||
|
||||
ifneq ($(c-gettimeofday-y),)
|
||||
CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
|
||||
|
|
|
@ -201,6 +201,13 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
|
|||
}
|
||||
|
||||
memcpy((u32 *)regs + off, valp, KVM_REG_SIZE(reg->id));
|
||||
|
||||
if (*vcpu_cpsr(vcpu) & PSR_MODE32_BIT) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
*vcpu_reg32(vcpu, i) = (u32)*vcpu_reg32(vcpu, i);
|
||||
}
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -162,32 +162,17 @@ static int handle_sve(struct kvm_vcpu *vcpu, struct kvm_run *run)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#define __ptrauth_save_key(regs, key) \
|
||||
({ \
|
||||
regs[key ## KEYLO_EL1] = read_sysreg_s(SYS_ ## key ## KEYLO_EL1); \
|
||||
regs[key ## KEYHI_EL1] = read_sysreg_s(SYS_ ## key ## KEYHI_EL1); \
|
||||
})
|
||||
|
||||
/*
|
||||
* Handle the guest trying to use a ptrauth instruction, or trying to access a
|
||||
* ptrauth register.
|
||||
*/
|
||||
void kvm_arm_vcpu_ptrauth_trap(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_cpu_context *ctxt;
|
||||
|
||||
if (vcpu_has_ptrauth(vcpu)) {
|
||||
if (vcpu_has_ptrauth(vcpu))
|
||||
vcpu_ptrauth_enable(vcpu);
|
||||
ctxt = vcpu->arch.host_cpu_context;
|
||||
__ptrauth_save_key(ctxt->sys_regs, APIA);
|
||||
__ptrauth_save_key(ctxt->sys_regs, APIB);
|
||||
__ptrauth_save_key(ctxt->sys_regs, APDA);
|
||||
__ptrauth_save_key(ctxt->sys_regs, APDB);
|
||||
__ptrauth_save_key(ctxt->sys_regs, APGA);
|
||||
} else {
|
||||
else
|
||||
kvm_inject_undefined(vcpu);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Guest usage of a ptrauth instruction (which the guest EL1 did not turn into
|
||||
|
|
|
@ -1280,10 +1280,16 @@ static bool access_clidr(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
|
|||
static bool access_csselr(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
|
||||
const struct sys_reg_desc *r)
|
||||
{
|
||||
int reg = r->reg;
|
||||
|
||||
/* See the 32bit mapping in kvm_host.h */
|
||||
if (p->is_aarch32)
|
||||
reg = r->reg / 2;
|
||||
|
||||
if (p->is_write)
|
||||
vcpu_write_sys_reg(vcpu, p->regval, r->reg);
|
||||
vcpu_write_sys_reg(vcpu, p->regval, reg);
|
||||
else
|
||||
p->regval = vcpu_read_sys_reg(vcpu, r->reg);
|
||||
p->regval = vcpu_read_sys_reg(vcpu, reg);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -230,6 +230,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
|
|||
ptep = (pte_t *)pudp;
|
||||
} else if (sz == (CONT_PTE_SIZE)) {
|
||||
pmdp = pmd_alloc(mm, pudp, addr);
|
||||
if (!pmdp)
|
||||
return NULL;
|
||||
|
||||
WARN_ON(addr & (sz - 1));
|
||||
/*
|
||||
|
|
|
@ -167,8 +167,8 @@
|
|||
* BA Reserved C D V
|
||||
*/
|
||||
cprcr r6, cpcr30
|
||||
lsri r6, 28
|
||||
lsli r6, 28
|
||||
lsri r6, 29
|
||||
lsli r6, 29
|
||||
addi r6, 0xe
|
||||
cpwcr r6, cpcr30
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#define LSAVE_A1 28
|
||||
#define LSAVE_A2 32
|
||||
#define LSAVE_A3 36
|
||||
#define LSAVE_A4 40
|
||||
#define LSAVE_A5 44
|
||||
|
||||
#define KSPTOUSP
|
||||
#define USPTOKSP
|
||||
|
@ -225,8 +227,8 @@
|
|||
*/
|
||||
mfcr r6, cr<30, 15> /* Get MSA0 */
|
||||
2:
|
||||
lsri r6, 28
|
||||
lsli r6, 28
|
||||
lsri r6, 29
|
||||
lsli r6, 29
|
||||
addi r6, 0x1ce
|
||||
mtcr r6, cr<30, 15> /* Set MSA0 */
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ do { \
|
|||
|
||||
extern int __get_user_bad(void);
|
||||
|
||||
#define __copy_user(to, from, n) \
|
||||
#define ___copy_to_user(to, from, n) \
|
||||
do { \
|
||||
int w0, w1, w2, w3; \
|
||||
asm volatile( \
|
||||
|
@ -289,31 +289,34 @@ do { \
|
|||
" subi %0, 4 \n" \
|
||||
" br 3b \n" \
|
||||
"5: cmpnei %0, 0 \n" /* 1B */ \
|
||||
" bf 8f \n" \
|
||||
" bf 13f \n" \
|
||||
" ldb %3, (%2, 0) \n" \
|
||||
"6: stb %3, (%1, 0) \n" \
|
||||
" addi %2, 1 \n" \
|
||||
" addi %1, 1 \n" \
|
||||
" subi %0, 1 \n" \
|
||||
" br 5b \n" \
|
||||
"7: br 8f \n" \
|
||||
"7: subi %0, 4 \n" \
|
||||
"8: subi %0, 4 \n" \
|
||||
"12: subi %0, 4 \n" \
|
||||
" br 13f \n" \
|
||||
".section __ex_table, \"a\" \n" \
|
||||
".align 2 \n" \
|
||||
".long 2b, 7b \n" \
|
||||
".long 9b, 7b \n" \
|
||||
".long 10b, 7b \n" \
|
||||
".long 2b, 13f \n" \
|
||||
".long 4b, 13f \n" \
|
||||
".long 6b, 13f \n" \
|
||||
".long 9b, 12b \n" \
|
||||
".long 10b, 8b \n" \
|
||||
".long 11b, 7b \n" \
|
||||
".long 4b, 7b \n" \
|
||||
".long 6b, 7b \n" \
|
||||
".previous \n" \
|
||||
"8: \n" \
|
||||
"13: \n" \
|
||||
: "=r"(n), "=r"(to), "=r"(from), "=r"(w0), \
|
||||
"=r"(w1), "=r"(w2), "=r"(w3) \
|
||||
: "0"(n), "1"(to), "2"(from) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define __copy_user_zeroing(to, from, n) \
|
||||
#define ___copy_from_user(to, from, n) \
|
||||
do { \
|
||||
int tmp; \
|
||||
int nsave; \
|
||||
|
@ -356,22 +359,22 @@ do { \
|
|||
" addi %1, 1 \n" \
|
||||
" subi %0, 1 \n" \
|
||||
" br 5b \n" \
|
||||
"8: mov %3, %0 \n" \
|
||||
" movi %4, 0 \n" \
|
||||
"9: stb %4, (%1, 0) \n" \
|
||||
" addi %1, 1 \n" \
|
||||
" subi %3, 1 \n" \
|
||||
" cmpnei %3, 0 \n" \
|
||||
" bt 9b \n" \
|
||||
" br 7f \n" \
|
||||
"8: stw %3, (%1, 0) \n" \
|
||||
" subi %0, 4 \n" \
|
||||
" bf 7f \n" \
|
||||
"9: subi %0, 8 \n" \
|
||||
" bf 7f \n" \
|
||||
"13: stw %3, (%1, 8) \n" \
|
||||
" subi %0, 12 \n" \
|
||||
" bf 7f \n" \
|
||||
".section __ex_table, \"a\" \n" \
|
||||
".align 2 \n" \
|
||||
".long 2b, 8b \n" \
|
||||
".long 2b, 7f \n" \
|
||||
".long 4b, 7f \n" \
|
||||
".long 6b, 7f \n" \
|
||||
".long 10b, 8b \n" \
|
||||
".long 11b, 8b \n" \
|
||||
".long 12b, 8b \n" \
|
||||
".long 4b, 8b \n" \
|
||||
".long 6b, 8b \n" \
|
||||
".long 11b, 9b \n" \
|
||||
".long 12b,13b \n" \
|
||||
".previous \n" \
|
||||
"7: \n" \
|
||||
: "=r"(n), "=r"(to), "=r"(from), "=r"(nsave), \
|
||||
|
|
|
@ -170,8 +170,10 @@ csky_syscall_trace:
|
|||
ldw a3, (sp, LSAVE_A3)
|
||||
#if defined(__CSKYABIV2__)
|
||||
subi sp, 8
|
||||
stw r5, (sp, 0x4)
|
||||
stw r4, (sp, 0x0)
|
||||
ldw r9, (sp, LSAVE_A4)
|
||||
stw r9, (sp, 0x0)
|
||||
ldw r9, (sp, LSAVE_A5)
|
||||
stw r9, (sp, 0x4)
|
||||
#else
|
||||
ldw r6, (sp, LSAVE_A4)
|
||||
ldw r7, (sp, LSAVE_A5)
|
||||
|
@ -318,8 +320,6 @@ ENTRY(__switch_to)
|
|||
|
||||
mfcr a2, psr /* Save PSR value */
|
||||
stw a2, (a3, THREAD_SR) /* Save PSR in task struct */
|
||||
bclri a2, 6 /* Disable interrupts */
|
||||
mtcr a2, psr
|
||||
|
||||
SAVE_SWITCH_STACK
|
||||
|
||||
|
|
|
@ -12,12 +12,17 @@ struct stackframe {
|
|||
|
||||
static int unwind_frame_kernel(struct stackframe *frame)
|
||||
{
|
||||
if (kstack_end((void *)frame->fp))
|
||||
unsigned long low = (unsigned long)task_stack_page(current);
|
||||
unsigned long high = low + THREAD_SIZE;
|
||||
|
||||
if (unlikely(frame->fp < low || frame->fp > high))
|
||||
return -EPERM;
|
||||
if (frame->fp & 0x3 || frame->fp < TASK_SIZE)
|
||||
|
||||
if (kstack_end((void *)frame->fp) || frame->fp & 0x3)
|
||||
return -EPERM;
|
||||
|
||||
*frame = *(struct stackframe *)frame->fp;
|
||||
|
||||
if (__kernel_text_address(frame->lr)) {
|
||||
int graph = 0;
|
||||
|
||||
|
|
|
@ -7,10 +7,7 @@
|
|||
unsigned long raw_copy_from_user(void *to, const void *from,
|
||||
unsigned long n)
|
||||
{
|
||||
if (access_ok(from, n))
|
||||
__copy_user_zeroing(to, from, n);
|
||||
else
|
||||
memset(to, 0, n);
|
||||
___copy_from_user(to, from, n);
|
||||
return n;
|
||||
}
|
||||
EXPORT_SYMBOL(raw_copy_from_user);
|
||||
|
@ -18,8 +15,7 @@ EXPORT_SYMBOL(raw_copy_from_user);
|
|||
unsigned long raw_copy_to_user(void *to, const void *from,
|
||||
unsigned long n)
|
||||
{
|
||||
if (access_ok(to, n))
|
||||
__copy_user(to, from, n);
|
||||
___copy_to_user(to, from, n);
|
||||
return n;
|
||||
}
|
||||
EXPORT_SYMBOL(raw_copy_to_user);
|
||||
|
|
|
@ -274,8 +274,12 @@ enum emulation_result {
|
|||
#define MIPS3_PG_SHIFT 6
|
||||
#define MIPS3_PG_FRAME 0x3fffffc0
|
||||
|
||||
#if defined(CONFIG_64BIT)
|
||||
#define VPN2_MASK GENMASK(cpu_vmbits - 1, 13)
|
||||
#else
|
||||
#define VPN2_MASK 0xffffe000
|
||||
#define KVM_ENTRYHI_ASID MIPS_ENTRYHI_ASID
|
||||
#endif
|
||||
#define KVM_ENTRYHI_ASID cpu_asid_mask(&boot_cpu_data)
|
||||
#define TLB_IS_GLOBAL(x) ((x).tlb_lo[0] & (x).tlb_lo[1] & ENTRYLO_G)
|
||||
#define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK)
|
||||
#define TLB_ASID(x) ((x).tlb_hi & KVM_ENTRYHI_ASID)
|
||||
|
|
|
@ -562,7 +562,7 @@ void __init mem_init(void)
|
|||
> BITS_PER_LONG);
|
||||
|
||||
high_memory = __va((max_pfn << PAGE_SHIFT));
|
||||
set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
|
||||
set_max_mapnr(max_low_pfn);
|
||||
memblock_free_all();
|
||||
|
||||
#ifdef CONFIG_PA11
|
||||
|
|
|
@ -125,11 +125,12 @@ config PPC
|
|||
select ARCH_HAS_MMIOWB if PPC64
|
||||
select ARCH_HAS_PHYS_TO_DMA
|
||||
select ARCH_HAS_PMEM_API
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_DEVMAP if PPC_BOOK3S_64
|
||||
select ARCH_HAS_PTE_SPECIAL
|
||||
select ARCH_HAS_MEMBARRIER_CALLBACKS
|
||||
select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
|
||||
select ARCH_HAS_STRICT_KERNEL_RWX if ((PPC_BOOK3S_64 || PPC32) && !HIBERNATION)
|
||||
select ARCH_HAS_STRICT_KERNEL_RWX if (PPC32 && !HIBERNATION)
|
||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||
select ARCH_HAS_UACCESS_FLUSHCACHE
|
||||
select ARCH_HAS_UACCESS_MCSAFE if PPC64
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
.macro kuap_check current, gpr
|
||||
#ifdef CONFIG_PPC_KUAP_DEBUG
|
||||
lwz \gpr2, KUAP(thread)
|
||||
lwz \gpr, KUAP(thread)
|
||||
999: twnei \gpr, 0
|
||||
EMIT_BUG_ENTRY 999b, __FILE__, __LINE__, (BUGFLAG_WARNING | BUGFLAG_ONCE)
|
||||
#endif
|
||||
|
|
|
@ -166,13 +166,17 @@ do { \
|
|||
({ \
|
||||
long __pu_err; \
|
||||
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
|
||||
__typeof__(*(ptr)) __pu_val = (x); \
|
||||
__typeof__(size) __pu_size = (size); \
|
||||
\
|
||||
if (!is_kernel_addr((unsigned long)__pu_addr)) \
|
||||
might_fault(); \
|
||||
__chk_user_ptr(ptr); \
|
||||
__chk_user_ptr(__pu_addr); \
|
||||
if (do_allow) \
|
||||
__put_user_size((x), __pu_addr, (size), __pu_err); \
|
||||
__put_user_size(__pu_val, __pu_addr, __pu_size, __pu_err); \
|
||||
else \
|
||||
__put_user_size_allowed((x), __pu_addr, (size), __pu_err); \
|
||||
__put_user_size_allowed(__pu_val, __pu_addr, __pu_size, __pu_err); \
|
||||
\
|
||||
__pu_err; \
|
||||
})
|
||||
|
||||
|
@ -180,9 +184,13 @@ do { \
|
|||
({ \
|
||||
long __pu_err = -EFAULT; \
|
||||
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
|
||||
__typeof__(*(ptr)) __pu_val = (x); \
|
||||
__typeof__(size) __pu_size = (size); \
|
||||
\
|
||||
might_fault(); \
|
||||
if (access_ok(__pu_addr, size)) \
|
||||
__put_user_size((x), __pu_addr, (size), __pu_err); \
|
||||
if (access_ok(__pu_addr, __pu_size)) \
|
||||
__put_user_size(__pu_val, __pu_addr, __pu_size, __pu_err); \
|
||||
\
|
||||
__pu_err; \
|
||||
})
|
||||
|
||||
|
@ -190,8 +198,12 @@ do { \
|
|||
({ \
|
||||
long __pu_err; \
|
||||
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
|
||||
__chk_user_ptr(ptr); \
|
||||
__put_user_size((x), __pu_addr, (size), __pu_err); \
|
||||
__typeof__(*(ptr)) __pu_val = (x); \
|
||||
__typeof__(size) __pu_size = (size); \
|
||||
\
|
||||
__chk_user_ptr(__pu_addr); \
|
||||
__put_user_size(__pu_val, __pu_addr, __pu_size, __pu_err); \
|
||||
\
|
||||
__pu_err; \
|
||||
})
|
||||
|
||||
|
@ -283,15 +295,18 @@ do { \
|
|||
long __gu_err; \
|
||||
__long_type(*(ptr)) __gu_val; \
|
||||
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
|
||||
__chk_user_ptr(ptr); \
|
||||
__typeof__(size) __gu_size = (size); \
|
||||
\
|
||||
__chk_user_ptr(__gu_addr); \
|
||||
if (!is_kernel_addr((unsigned long)__gu_addr)) \
|
||||
might_fault(); \
|
||||
barrier_nospec(); \
|
||||
if (do_allow) \
|
||||
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
|
||||
__get_user_size(__gu_val, __gu_addr, __gu_size, __gu_err); \
|
||||
else \
|
||||
__get_user_size_allowed(__gu_val, __gu_addr, (size), __gu_err); \
|
||||
__get_user_size_allowed(__gu_val, __gu_addr, __gu_size, __gu_err); \
|
||||
(x) = (__typeof__(*(ptr)))__gu_val; \
|
||||
\
|
||||
__gu_err; \
|
||||
})
|
||||
|
||||
|
@ -300,12 +315,15 @@ do { \
|
|||
long __gu_err = -EFAULT; \
|
||||
__long_type(*(ptr)) __gu_val = 0; \
|
||||
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
|
||||
__typeof__(size) __gu_size = (size); \
|
||||
\
|
||||
might_fault(); \
|
||||
if (access_ok(__gu_addr, (size))) { \
|
||||
if (access_ok(__gu_addr, __gu_size)) { \
|
||||
barrier_nospec(); \
|
||||
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
|
||||
__get_user_size(__gu_val, __gu_addr, __gu_size, __gu_err); \
|
||||
} \
|
||||
(x) = (__force __typeof__(*(ptr)))__gu_val; \
|
||||
\
|
||||
__gu_err; \
|
||||
})
|
||||
|
||||
|
@ -314,10 +332,13 @@ do { \
|
|||
long __gu_err; \
|
||||
__long_type(*(ptr)) __gu_val; \
|
||||
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
|
||||
__chk_user_ptr(ptr); \
|
||||
__typeof__(size) __gu_size = (size); \
|
||||
\
|
||||
__chk_user_ptr(__gu_addr); \
|
||||
barrier_nospec(); \
|
||||
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
|
||||
__get_user_size(__gu_val, __gu_addr, __gu_size, __gu_err); \
|
||||
(x) = (__force __typeof__(*(ptr)))__gu_val; \
|
||||
\
|
||||
__gu_err; \
|
||||
})
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ bool arch_ima_get_secureboot(void)
|
|||
* to be stored as an xattr or as an appended signature.
|
||||
*
|
||||
* To avoid duplicate signature verification as much as possible, the IMA
|
||||
* policy rule for module appraisal is added only if CONFIG_MODULE_SIG_FORCE
|
||||
* policy rule for module appraisal is added only if CONFIG_MODULE_SIG
|
||||
* is not enabled.
|
||||
*/
|
||||
static const char *const secure_rules[] = {
|
||||
"appraise func=KEXEC_KERNEL_CHECK appraise_flag=check_blacklist appraise_type=imasig|modsig",
|
||||
#ifndef CONFIG_MODULE_SIG_FORCE
|
||||
#ifndef CONFIG_MODULE_SIG
|
||||
"appraise func=MODULE_CHECK appraise_flag=check_blacklist appraise_type=imasig|modsig",
|
||||
#endif
|
||||
NULL
|
||||
|
@ -50,7 +50,7 @@ static const char *const secure_and_trusted_rules[] = {
|
|||
"measure func=KEXEC_KERNEL_CHECK template=ima-modsig",
|
||||
"measure func=MODULE_CHECK template=ima-modsig",
|
||||
"appraise func=KEXEC_KERNEL_CHECK appraise_flag=check_blacklist appraise_type=imasig|modsig",
|
||||
#ifndef CONFIG_MODULE_SIG_FORCE
|
||||
#ifndef CONFIG_MODULE_SIG
|
||||
"appraise func=MODULE_CHECK appraise_flag=check_blacklist appraise_type=imasig|modsig",
|
||||
#endif
|
||||
NULL
|
||||
|
|
|
@ -218,11 +218,11 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
|
|||
blr
|
||||
|
||||
/*
|
||||
* invalid clock
|
||||
* syscall fallback
|
||||
*/
|
||||
99:
|
||||
li r3, EINVAL
|
||||
crset so
|
||||
li r0,__NR_clock_getres
|
||||
sc
|
||||
blr
|
||||
.cfi_endproc
|
||||
V_FUNCTION_END(__kernel_clock_getres)
|
||||
|
|
|
@ -303,12 +303,6 @@ SECTIONS
|
|||
*(.branch_lt)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_INFO_BTF
|
||||
.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
|
||||
*(.BTF)
|
||||
}
|
||||
#endif
|
||||
|
||||
.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
|
||||
__start_opd = .;
|
||||
KEEP(*(.opd))
|
||||
|
|
|
@ -60,6 +60,7 @@ struct pg_state {
|
|||
unsigned long start_address;
|
||||
unsigned long start_pa;
|
||||
unsigned long last_pa;
|
||||
unsigned long page_size;
|
||||
unsigned int level;
|
||||
u64 current_flags;
|
||||
bool check_wx;
|
||||
|
@ -157,9 +158,9 @@ static void dump_addr(struct pg_state *st, unsigned long addr)
|
|||
#endif
|
||||
|
||||
pt_dump_seq_printf(st->seq, REG "-" REG " ", st->start_address, addr - 1);
|
||||
if (st->start_pa == st->last_pa && st->start_address + PAGE_SIZE != addr) {
|
||||
if (st->start_pa == st->last_pa && st->start_address + st->page_size != addr) {
|
||||
pt_dump_seq_printf(st->seq, "[" REG "]", st->start_pa);
|
||||
delta = PAGE_SIZE >> 10;
|
||||
delta = st->page_size >> 10;
|
||||
} else {
|
||||
pt_dump_seq_printf(st->seq, " " REG " ", st->start_pa);
|
||||
delta = (addr - st->start_address) >> 10;
|
||||
|
@ -190,7 +191,7 @@ static void note_prot_wx(struct pg_state *st, unsigned long addr)
|
|||
}
|
||||
|
||||
static void note_page(struct pg_state *st, unsigned long addr,
|
||||
unsigned int level, u64 val)
|
||||
unsigned int level, u64 val, unsigned long page_size)
|
||||
{
|
||||
u64 flag = val & pg_level[level].mask;
|
||||
u64 pa = val & PTE_RPN_MASK;
|
||||
|
@ -202,6 +203,7 @@ static void note_page(struct pg_state *st, unsigned long addr,
|
|||
st->start_address = addr;
|
||||
st->start_pa = pa;
|
||||
st->last_pa = pa;
|
||||
st->page_size = page_size;
|
||||
pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name);
|
||||
/*
|
||||
* Dump the section of virtual memory when:
|
||||
|
@ -213,7 +215,7 @@ static void note_page(struct pg_state *st, unsigned long addr,
|
|||
*/
|
||||
} else if (flag != st->current_flags || level != st->level ||
|
||||
addr >= st->marker[1].start_address ||
|
||||
(pa != st->last_pa + PAGE_SIZE &&
|
||||
(pa != st->last_pa + st->page_size &&
|
||||
(pa != st->start_pa || st->start_pa != st->last_pa))) {
|
||||
|
||||
/* Check the PTE flags */
|
||||
|
@ -241,6 +243,7 @@ static void note_page(struct pg_state *st, unsigned long addr,
|
|||
st->start_address = addr;
|
||||
st->start_pa = pa;
|
||||
st->last_pa = pa;
|
||||
st->page_size = page_size;
|
||||
st->current_flags = flag;
|
||||
st->level = level;
|
||||
} else {
|
||||
|
@ -256,7 +259,7 @@ static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start)
|
|||
|
||||
for (i = 0; i < PTRS_PER_PTE; i++, pte++) {
|
||||
addr = start + i * PAGE_SIZE;
|
||||
note_page(st, addr, 4, pte_val(*pte));
|
||||
note_page(st, addr, 4, pte_val(*pte), PAGE_SIZE);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +276,7 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
|
|||
/* pmd exists */
|
||||
walk_pte(st, pmd, addr);
|
||||
else
|
||||
note_page(st, addr, 3, pmd_val(*pmd));
|
||||
note_page(st, addr, 3, pmd_val(*pmd), PMD_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -289,7 +292,7 @@ static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start)
|
|||
/* pud exists */
|
||||
walk_pmd(st, pud, addr);
|
||||
else
|
||||
note_page(st, addr, 2, pud_val(*pud));
|
||||
note_page(st, addr, 2, pud_val(*pud), PUD_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +311,7 @@ static void walk_pagetables(struct pg_state *st)
|
|||
/* pgd exists */
|
||||
walk_pud(st, pgd, addr);
|
||||
else
|
||||
note_page(st, addr, 1, pgd_val(*pgd));
|
||||
note_page(st, addr, 1, pgd_val(*pgd), PGDIR_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,7 +366,7 @@ static int ptdump_show(struct seq_file *m, void *v)
|
|||
|
||||
/* Traverse kernel page tables */
|
||||
walk_pagetables(&st);
|
||||
note_page(&st, 0, 0, 0);
|
||||
note_page(&st, 0, 0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/msi.h>
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
#include <asm/prom.h>
|
||||
#include <asm/io.h>
|
||||
|
@ -1013,12 +1014,16 @@ EXPORT_SYMBOL_GPL(is_xive_irq);
|
|||
void xive_cleanup_irq_data(struct xive_irq_data *xd)
|
||||
{
|
||||
if (xd->eoi_mmio) {
|
||||
unmap_kernel_range((unsigned long)xd->eoi_mmio,
|
||||
1u << xd->esb_shift);
|
||||
iounmap(xd->eoi_mmio);
|
||||
if (xd->eoi_mmio == xd->trig_mmio)
|
||||
xd->trig_mmio = NULL;
|
||||
xd->eoi_mmio = NULL;
|
||||
}
|
||||
if (xd->trig_mmio) {
|
||||
unmap_kernel_range((unsigned long)xd->trig_mmio,
|
||||
1u << xd->esb_shift);
|
||||
iounmap(xd->trig_mmio);
|
||||
xd->trig_mmio = NULL;
|
||||
}
|
||||
|
|
|
@ -12,10 +12,11 @@ config SOC_SIFIVE
|
|||
|
||||
config SOC_VIRT
|
||||
bool "QEMU Virt Machine"
|
||||
select POWER_RESET
|
||||
select POWER_RESET_SYSCON
|
||||
select POWER_RESET_SYSCON_POWEROFF
|
||||
select GOLDFISH
|
||||
select RTC_DRV_GOLDFISH
|
||||
select RTC_DRV_GOLDFISH if RTC_CLASS
|
||||
select SIFIVE_PLIC
|
||||
help
|
||||
This enables support for QEMU Virt Machine.
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
#ifndef CONFIG_MMU
|
||||
#define pgprot_noncached(x) (x)
|
||||
#define pgprot_writecombine(x) (x)
|
||||
#define pgprot_device(x) (x)
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
/* Generic IO read/write. These perform native-endian accesses. */
|
||||
|
|
|
@ -12,19 +12,14 @@
|
|||
#include <linux/ptrace.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#ifdef CONFIG_RISCV_BASE_PMU
|
||||
#define RISCV_BASE_COUNTERS 2
|
||||
|
||||
/*
|
||||
* The RISCV_MAX_COUNTERS parameter should be specified.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_RISCV_BASE_PMU
|
||||
#define RISCV_MAX_COUNTERS 2
|
||||
#endif
|
||||
|
||||
#ifndef RISCV_MAX_COUNTERS
|
||||
#error "Please provide a valid RISCV_MAX_COUNTERS for the PMU."
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These are the indexes of bits in counteren register *minus* 1,
|
||||
|
@ -82,6 +77,7 @@ struct riscv_pmu {
|
|||
int irq;
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
#define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs
|
||||
#endif
|
||||
|
|
|
@ -460,12 +460,15 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
|
|||
|
||||
#else /* CONFIG_MMU */
|
||||
|
||||
#define PAGE_SHARED __pgprot(0)
|
||||
#define PAGE_KERNEL __pgprot(0)
|
||||
#define swapper_pg_dir NULL
|
||||
#define VMALLOC_START 0
|
||||
|
||||
#define TASK_SIZE 0xffffffffUL
|
||||
|
||||
static inline void __kernel_map_pages(struct page *page, int numpages, int enable) {}
|
||||
|
||||
#endif /* !CONFIG_MMU */
|
||||
|
||||
#define kern_addr_valid(addr) (1) /* FIXME */
|
||||
|
|
|
@ -38,7 +38,7 @@ obj-$(CONFIG_MODULE_SECTIONS) += module-sections.o
|
|||
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
|
||||
obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o
|
||||
|
||||
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
|
||||
obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o
|
||||
obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
|
||||
obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
|
||||
obj-$(CONFIG_RISCV_SBI) += sbi.o
|
||||
|
|
|
@ -63,7 +63,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
|||
|
||||
#else /* !CONFIG_FRAME_POINTER */
|
||||
|
||||
static void notrace walk_stackframe(struct task_struct *task,
|
||||
void notrace walk_stackframe(struct task_struct *task,
|
||||
struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg)
|
||||
{
|
||||
unsigned long sp, pc;
|
||||
|
|
|
@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
|
|||
$(call if_changed,vdsold)
|
||||
|
||||
# We also create a special relocatable object that should mirror the symbol
|
||||
# table and layout of the linked DSO. With ld -R we can then refer to
|
||||
# these symbols in the kernel code rather than hand-coded addresses.
|
||||
# table and layout of the linked DSO. With ld --just-symbols we can then
|
||||
# refer to these symbols in the kernel code rather than hand-coded addresses.
|
||||
|
||||
SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
|
||||
-Wl,--build-id -Wl,--hash-style=both
|
||||
$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
|
||||
$(call if_changed,vdsold)
|
||||
|
||||
LDFLAGS_vdso-syms.o := -r -R
|
||||
LDFLAGS_vdso-syms.o := -r --just-symbols
|
||||
$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
|
||||
$(call if_changed,ld)
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ static void setup_zero_page(void)
|
|||
memset((void *)empty_zero_page, 0, PAGE_SIZE);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
#if defined(CONFIG_MMU) && defined(CONFIG_DEBUG_VM)
|
||||
static inline void print_mlk(char *name, unsigned long b, unsigned long t)
|
||||
{
|
||||
pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
|
||||
|
@ -149,7 +149,8 @@ void __init setup_bootmem(void)
|
|||
memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
|
||||
|
||||
set_max_mapnr(PFN_DOWN(mem_size));
|
||||
max_low_pfn = PFN_DOWN(memblock_end_of_DRAM());
|
||||
max_pfn = PFN_DOWN(memblock_end_of_DRAM());
|
||||
max_low_pfn = max_pfn;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INITRD
|
||||
setup_initrd();
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
#include <linux/slab.h>
|
||||
#include <asm/pci_insn.h>
|
||||
|
||||
/* I/O size constraints */
|
||||
#define ZPCI_MAX_READ_SIZE 8
|
||||
#define ZPCI_MAX_WRITE_SIZE 128
|
||||
|
||||
/* I/O Map */
|
||||
#define ZPCI_IOMAP_SHIFT 48
|
||||
#define ZPCI_IOMAP_ADDR_BASE 0x8000000000000000UL
|
||||
|
@ -140,7 +144,8 @@ static inline int zpci_memcpy_fromio(void *dst,
|
|||
|
||||
while (n > 0) {
|
||||
size = zpci_get_max_write_size((u64 __force) src,
|
||||
(u64) dst, n, 8);
|
||||
(u64) dst, n,
|
||||
ZPCI_MAX_READ_SIZE);
|
||||
rc = zpci_read_single(dst, src, size);
|
||||
if (rc)
|
||||
break;
|
||||
|
@ -161,7 +166,8 @@ static inline int zpci_memcpy_toio(volatile void __iomem *dst,
|
|||
|
||||
while (n > 0) {
|
||||
size = zpci_get_max_write_size((u64 __force) dst,
|
||||
(u64) src, n, 128);
|
||||
(u64) src, n,
|
||||
ZPCI_MAX_WRITE_SIZE);
|
||||
if (size > 8) /* main path */
|
||||
rc = zpci_write_block(dst, src, size);
|
||||
else
|
||||
|
|
|
@ -151,7 +151,7 @@ static int kexec_file_add_initrd(struct kimage *image,
|
|||
buf.mem += crashk_res.start;
|
||||
buf.memsz = buf.bufsz;
|
||||
|
||||
data->parm->initrd_start = buf.mem;
|
||||
data->parm->initrd_start = data->memsz;
|
||||
data->parm->initrd_size = buf.memsz;
|
||||
data->memsz += buf.memsz;
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ int arch_kexec_do_relocs(int r_type, void *loc, unsigned long val,
|
|||
break;
|
||||
case R_390_64: /* Direct 64 bit. */
|
||||
case R_390_GLOB_DAT:
|
||||
case R_390_JMP_SLOT:
|
||||
*(u64 *)loc = val;
|
||||
break;
|
||||
case R_390_PC16: /* PC relative 16 bit. */
|
||||
|
|
|
@ -626,10 +626,12 @@ static int handle_pqap(struct kvm_vcpu *vcpu)
|
|||
* available for the guest are AQIC and TAPQ with the t bit set
|
||||
* since we do not set IC.3 (FIII) we currently will only intercept
|
||||
* the AQIC function code.
|
||||
* Note: running nested under z/VM can result in intercepts for other
|
||||
* function codes, e.g. PQAP(QCI). We do not support this and bail out.
|
||||
*/
|
||||
reg0 = vcpu->run->s.regs.gprs[0];
|
||||
fc = (reg0 >> 24) & 0xff;
|
||||
if (WARN_ON_ONCE(fc != 0x03))
|
||||
if (fc != 0x03)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* PQAP instruction is allowed for guest kernel only */
|
||||
|
|
|
@ -159,10 +159,13 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
|||
rste &= ~_SEGMENT_ENTRY_NOEXEC;
|
||||
|
||||
/* Set correct table type for 2G hugepages */
|
||||
if ((pte_val(*ptep) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3)
|
||||
rste |= _REGION_ENTRY_TYPE_R3 | _REGION3_ENTRY_LARGE;
|
||||
else
|
||||
if ((pte_val(*ptep) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) {
|
||||
if (likely(pte_present(pte)))
|
||||
rste |= _REGION3_ENTRY_LARGE;
|
||||
rste |= _REGION_ENTRY_TYPE_R3;
|
||||
} else if (likely(pte_present(pte)))
|
||||
rste |= _SEGMENT_ENTRY_LARGE;
|
||||
|
||||
clear_huge_pte_skeys(mm, rste);
|
||||
pte_val(*ptep) = rste;
|
||||
}
|
||||
|
|
|
@ -309,14 +309,13 @@ out:
|
|||
|
||||
int clp_disable_fh(struct zpci_dev *zdev)
|
||||
{
|
||||
u32 fh = zdev->fh;
|
||||
int rc;
|
||||
|
||||
if (!zdev_enabled(zdev))
|
||||
return 0;
|
||||
|
||||
rc = clp_set_pci_fn(zdev, 0, CLP_SET_DISABLE_PCI_FN);
|
||||
zpci_dbg(3, "dis fid:%x, fh:%x, rc:%d\n", zdev->fid, fh, rc);
|
||||
zpci_dbg(3, "dis fid:%x, fh:%x, rc:%d\n", zdev->fid, zdev->fh, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user