projects/linux·commit 0ca2ce81

Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

0ca2ce81 · Linus Torvalds <[email protected]> · 2020-12-14 16:24:30 -08:00

Pull arm64 updates from Catalin Marinas:

 - Expose tag address bits in siginfo. The original arm64 ABI did not
   expose any of the bits 63:56 of a tagged address in siginfo. In the
   presence of user ASAN or MTE, this information may be useful. The
   implementation is generic to other architectures supporting tags
   (like SPARC ADI, subject to wiring up the arch code). The user will
   have to opt in via sigaction(SA_EXPOSE_TAGBITS) so that the extra
   bits, if available, become visible in si_addr.

 - Default to 32-bit wide ZONE_DMA. Previously, ZONE_DMA was set to the
   lowest 1GB to cope with the Raspberry Pi 4 limitations, to the
   detriment of other platforms. With these changes, the kernel scans
   the Device Tree dma-ranges and the ACPI IORT information before
   deciding on a smaller ZONE_DMA.

 - Strengthen READ_ONCE() to acquire when CONFIG_LTO=y. When building
   with LTO, there is an increased risk of the compiler converting an
   address dependency headed by a READ_ONCE() invocation into a control
   dependency and consequently allowing for harmful reordering by the
   CPU.

 - Add CPPC FFH support using arm64 AMU counters.

 - set_fs() removal on arm64. This renders the User Access Override
   (UAO) ARMv8 feature unnecessary.

 - Perf updates: PMU driver for the ARM DMC-620 memory controller, sysfs
   identifier file for SMMUv3, stop event counters support for i.MX8MP,
   enable the perf events-based hard lockup detector.

 - Reorganise the kernel VA space slightly so that 52-bit VA
   configurations can use more virtual address space.

 - Improve the robustness of the arm64 memory offline event notifier.

 - Pad the Image header to 64K following the EFI header definition
   updated recently to increase the section alignment to 64K.

 - Support CONFIG_CMDLINE_EXTEND on arm64.

 - Do not use tagged PC in the kernel (TCR_EL1.TBID1==1), freeing up 8
   bits for PtrAuth.

 - Switch to vmapped shadow call stacks.

 - Miscellaneous clean-ups.

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (78 commits)
  perf/imx_ddr: Add system PMU identifier for userspace
  bindings: perf: imx-ddr: add compatible string
  arm64: Fix build failure when HARDLOCKUP_DETECTOR_PERF is enabled
  arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE
  arm64: mark __system_matches_cap as __maybe_unused
  arm64: uaccess: remove vestigal UAO support
  arm64: uaccess: remove redundant PAN toggling
  arm64: uaccess: remove addr_limit_user_check()
  arm64: uaccess: remove set_fs()
  arm64: uaccess cleanup macro naming
  arm64: uaccess: split user/kernel routines
  arm64: uaccess: refactor __{get,put}_user
  arm64: uaccess: simplify __copy_user_flushcache()
  arm64: uaccess: rename privileged uaccess routines
  arm64: sdei: explicitly simulate PAN/UAO entry
  arm64: sdei: move uaccess logic to arch/arm64/
  arm64: head.S: always initialize PSTATE
  arm64: head.S: cleanup SCTLR_ELx initialization
  arm64: head.S: rename el2_setup -> init_kernel_el
  arm64: add C wrappers for SET_PSTATE_*()
  ...
Commit
0ca2ce81eb8ee30f3ba8ac7967fef9cfbb44dbdb
Parents
58659247 · d8897975

Merge commit. Changes below are compared with the first parent: 58659247.

Changes

114 files changed · +2603 −1314

FileStatusAddDelContent
Documentation/arm64/kasan-offsets.shmodified+1−2View file
Documentation/arm64/memory.rstmodified+21−24View file
Documentation/arm64/tagged-pointers.rstmodified+19−6View file
Documentation/devicetree/bindings/perf/fsl-imx-ddr.yamlmodified+3−0View file
arch/alpha/include/uapi/asm/signal.hmodified+0−14View file
arch/arm/include/asm/signal.hmodified+2−0View file
arch/arm/include/uapi/asm/signal.hmodified+3−24View file
arch/arm64/Kconfigmodified+37−33View file
arch/arm64/include/asm/alternative-macros.hadded+217−0View file
arch/arm64/include/asm/alternative.hmodified+2−265View file
arch/arm64/include/asm/asm-uaccess.hmodified+32−3View file
arch/arm64/include/asm/cpucaps.hmodified+2−3View file
arch/arm64/include/asm/cpufeature.hmodified+22−1View file
arch/arm64/include/asm/exception.hmodified+1−1View file
arch/arm64/include/asm/exec.hmodified+0−1View file
arch/arm64/include/asm/futex.hmodified+4−4View file
arch/arm64/include/asm/insn.hmodified+1−2View file
arch/arm64/include/asm/kernel-pgtable.hmodified+0−6View file
arch/arm64/include/asm/kprobes.hmodified+0−7View file
arch/arm64/include/asm/memory.hmodified+10−12View file
arch/arm64/include/asm/mmu_context.hmodified+3−3View file
arch/arm64/include/asm/pgtable-hwdef.hmodified+1−0View file
arch/arm64/include/asm/pgtable.hmodified+2−1View file
arch/arm64/include/asm/processor.hmodified+1−3View file
arch/arm64/include/asm/ptrace.hmodified+6−2View file
arch/arm64/include/asm/rwonce.hadded+73−0View file
arch/arm64/include/asm/signal.hadded+25−0View file
arch/arm64/include/asm/sysreg.hmodified+16−6View file
arch/arm64/include/asm/system_misc.hmodified+1−1View file
arch/arm64/include/asm/thread_info.hmodified+2−8View file
arch/arm64/include/asm/topology.hmodified+3−1View file
arch/arm64/include/asm/traps.hmodified+3−3View file
arch/arm64/include/asm/uaccess.hmodified+75−103View file
arch/arm64/kernel/Makefilemodified+0−1View file
arch/arm64/kernel/alternative.cmodified+4−3View file
arch/arm64/kernel/armv8_deprecated.cmodified+2−2View file
arch/arm64/kernel/asm-offsets.cmodified+1−2View file
arch/arm64/kernel/cpufeature.cmodified+22−37View file
arch/arm64/kernel/debug-monitors.cmodified+2−3View file
arch/arm64/kernel/efi-header.Smodified+49−35View file
arch/arm64/kernel/entry-common.cmodified+0−2View file
arch/arm64/kernel/entry.Smodified+10−21View file
arch/arm64/kernel/head.Smodified+33−37View file
arch/arm64/kernel/irq.cmodified+21−0View file
arch/arm64/kernel/kaslr.cmodified+18−8View file
arch/arm64/kernel/mte.cmodified+2−1View file
arch/arm64/kernel/perf_event.cmodified+39−2View file
arch/arm64/kernel/probes/kprobes.cmodified+12−41View file
arch/arm64/kernel/process.cmodified+8−21View file
arch/arm64/kernel/proton-pack.cmodified+3−2View file
arch/arm64/kernel/ptrace.cmodified+2−5View file
arch/arm64/kernel/scs.cdeleted+0−16View before deletion
arch/arm64/kernel/sdei.cmodified+108−11View file
arch/arm64/kernel/setup.cmodified+3−3View file
arch/arm64/kernel/signal.cmodified+0−3View file
arch/arm64/kernel/sleep.Smodified+1−1View file
arch/arm64/kernel/smp.cmodified+7−8View file
arch/arm64/kernel/suspend.cmodified+0−1View file
arch/arm64/kernel/sys_compat.cmodified+2−3View file
arch/arm64/kernel/syscall.cmodified+1−1View file
arch/arm64/kernel/topology.cmodified+110−26View file
arch/arm64/kernel/traps.cmodified+15−14View file
arch/arm64/kernel/vdso/Makefilemodified+1−1View file
arch/arm64/kernel/vdso32/Makefilemodified+1−1View file
arch/arm64/kernel/vmlinux.lds.Smodified+5−7View file
arch/arm64/lib/clear_user.Smodified+4−4View file
arch/arm64/lib/copy_from_user.Smodified+4−4View file
arch/arm64/lib/copy_in_user.Smodified+8−8View file
arch/arm64/lib/copy_to_user.Smodified+4−4View file
arch/arm64/lib/mte.Smodified+3−3View file
arch/arm64/lib/uaccess_flushcache.cmodified+1−3View file
arch/arm64/mm/fault.cmodified+50−38View file
arch/arm64/mm/init.cmodified+35−21View file
arch/arm64/mm/mmu.cmodified+117−32View file
arch/arm64/mm/proc.Smodified+3−3View file
arch/h8300/include/uapi/asm/signal.hmodified+0−24View file
arch/ia64/include/uapi/asm/signal.hmodified+0−24View file
arch/m68k/include/uapi/asm/signal.hmodified+0−24View file
arch/mips/include/uapi/asm/signal.hmodified+0−12View file
arch/parisc/include/asm/signal.hmodified+2−0View file
arch/parisc/include/uapi/asm/signal.hmodified+1−33View file
arch/powerpc/include/uapi/asm/signal.hmodified+0−24View file
arch/s390/include/uapi/asm/signal.hmodified+0−24View file
arch/sparc/include/uapi/asm/signal.hmodified+1−3View file
arch/x86/include/uapi/asm/signal.hmodified+0−24View file
arch/x86/kernel/signal_compat.cmodified+0−7View file
arch/xtensa/include/uapi/asm/signal.hmodified+0−24View file
drivers/acpi/arm64/iort.cmodified+55−0View file
drivers/firmware/arm_sdei.cmodified+0−14View file
drivers/of/address.cmodified+42−0View file
drivers/of/unittest.cmodified+21−0View file
drivers/perf/Kconfigmodified+7−0View file
drivers/perf/Makefilemodified+1−0View file
drivers/perf/arm_dmc620_pmu.cadded+748−0View file
drivers/perf/arm_dsu_pmu.cmodified+0−3View file
drivers/perf/arm_pmu.cmodified+5−0View file
drivers/perf/arm_smmuv3_pmu.cmodified+39−0View file
drivers/perf/fsl_imx8_ddr_perf.cmodified+109−26View file
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.cmodified+16−0View file
drivers/perf/hisilicon/hisi_uncore_hha_pmu.cmodified+16−0View file
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.cmodified+16−0View file
drivers/perf/hisilicon/hisi_uncore_pmu.cmodified+10−0View file
drivers/perf/hisilicon/hisi_uncore_pmu.hmodified+7−0View file
include/linux/acpi_iort.hmodified+4−0View file
include/linux/mmzone.hmodified+0−20View file
include/linux/of.hmodified+7−0View file
include/linux/perf/arm_pmu.hmodified+2−0View file
include/linux/scs.hmodified+6−10View file
include/linux/signal.hmodified+14−0View file
include/linux/signal_types.hmodified+12−0View file
include/uapi/asm-generic/signal-defs.hmodified+63−0View file
include/uapi/asm-generic/signal.hmodified+0−29View file
kernel/scs.cmodified+60−11View file
kernel/signal.cmodified+40−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/arm64/kasan-offsets.sh

View file
diff --git a/Documentation/arm64/kasan-offsets.sh b/Documentation/arm64/kasan-offsets.sh
index 2b7a021..2dc5f9e 100644
--- a/Documentation/arm64/kasan-offsets.sh
+++ b/Documentation/arm64/kasan-offsets.sh
@@ -1,12 +1,11 @@
#!/bin/sh
# Print out the KASAN_SHADOW_OFFSETS required to place the KASAN SHADOW
-# start address at the mid-point of the kernel VA space
+# start address at the top of the linear region
print_kasan_offset () {
printf "%02d\t" $1
printf "0x%08x00000000\n" $(( (0xffffffff & (-1 << ($1 - 1 - 32))) \
- + (1 << ($1 - 32 - $2)) \
- (1 << (64 - 32 - $2)) ))
}

Documentation/arm64/memory.rst

View file
diff --git a/Documentation/arm64/memory.rst b/Documentation/arm64/memory.rst
index cf03b32..e7522e5 100644
--- a/Documentation/arm64/memory.rst
+++ b/Documentation/arm64/memory.rst
@@ -32,17 +32,16 @@ AArch64 Linux memory layout with 4KB pages + 4 levels (48-bit)::
-----------------------------------------------------------------------
0000000000000000 0000ffffffffffff 256TB user
ffff000000000000 ffff7fffffffffff 128TB kernel logical memory map
- ffff800000000000 ffff9fffffffffff 32TB kasan shadow region
- ffffa00000000000 ffffa00007ffffff 128MB bpf jit region
- ffffa00008000000 ffffa0000fffffff 128MB modules
- ffffa00010000000 fffffdffbffeffff ~93TB vmalloc
- fffffdffbfff0000 fffffdfffe5f8fff ~998MB [guard region]
- fffffdfffe5f9000 fffffdfffe9fffff 4124KB fixed mappings
- fffffdfffea00000 fffffdfffebfffff 2MB [guard region]
- fffffdfffec00000 fffffdffffbfffff 16MB PCI I/O space
- fffffdffffc00000 fffffdffffdfffff 2MB [guard region]
- fffffdffffe00000 ffffffffffdfffff 2TB vmemmap
- ffffffffffe00000 ffffffffffffffff 2MB [guard region]
+ [ffff600000000000 ffff7fffffffffff] 32TB [kasan shadow region]
+ ffff800000000000 ffff800007ffffff 128MB bpf jit region
+ ffff800008000000 ffff80000fffffff 128MB modules
+ ffff800010000000 fffffbffefffffff 124TB vmalloc
+ fffffbfff0000000 fffffbfffdffffff 224MB fixed mappings (top down)
+ fffffbfffe000000 fffffbfffe7fffff 8MB [guard region]
+ fffffbfffe800000 fffffbffff7fffff 16MB PCI I/O space
+ fffffbffff800000 fffffbffffffffff 8MB [guard region]
+ fffffc0000000000 fffffdffffffffff 2TB vmemmap
+ fffffe0000000000 ffffffffffffffff 2TB [guard region]
AArch64 Linux memory layout with 64KB pages + 3 levels (52-bit with HW support)::
@@ -50,19 +49,17 @@ AArch64 Linux memory layout with 64KB pages + 3 levels (52-bit with HW support):
Start End Size Use
-----------------------------------------------------------------------
0000000000000000 000fffffffffffff 4PB user
- fff0000000000000 fff7ffffffffffff 2PB kernel logical memory map
- fff8000000000000 fffd9fffffffffff 1440TB [gap]
- fffda00000000000 ffff9fffffffffff 512TB kasan shadow region
- ffffa00000000000 ffffa00007ffffff 128MB bpf jit region
- ffffa00008000000 ffffa0000fffffff 128MB modules
- ffffa00010000000 fffff81ffffeffff ~88TB vmalloc
- fffff81fffff0000 fffffc1ffe58ffff ~3TB [guard region]
- fffffc1ffe590000 fffffc1ffe9fffff 4544KB fixed mappings
- fffffc1ffea00000 fffffc1ffebfffff 2MB [guard region]
- fffffc1ffec00000 fffffc1fffbfffff 16MB PCI I/O space
- fffffc1fffc00000 fffffc1fffdfffff 2MB [guard region]
- fffffc1fffe00000 ffffffffffdfffff 3968GB vmemmap
- ffffffffffe00000 ffffffffffffffff 2MB [guard region]
+ fff0000000000000 ffff7fffffffffff ~4PB kernel logical memory map
+ [fffd800000000000 ffff7fffffffffff] 512TB [kasan shadow region]
+ ffff800000000000 ffff800007ffffff 128MB bpf jit region
+ ffff800008000000 ffff80000fffffff 128MB modules
+ ffff800010000000 fffffbffefffffff 124TB vmalloc
+ fffffbfff0000000 fffffbfffdffffff 224MB fixed mappings (top down)
+ fffffbfffe000000 fffffbfffe7fffff 8MB [guard region]
+ fffffbfffe800000 fffffbffff7fffff 16MB PCI I/O space
+ fffffbffff800000 fffffbffffffffff 8MB [guard region]
+ fffffc0000000000 ffffffdfffffffff ~4TB vmemmap
+ ffffffe000000000 ffffffffffffffff 128GB [guard region]
Translation table lookup with 4KB pages::

Documentation/arm64/tagged-pointers.rst

View file
diff --git a/Documentation/arm64/tagged-pointers.rst b/Documentation/arm64/tagged-pointers.rst
index eab4323..19d284b 100644
--- a/Documentation/arm64/tagged-pointers.rst
+++ b/Documentation/arm64/tagged-pointers.rst
@@ -53,12 +53,25 @@ visibility.
Preserving tags
---------------
-Non-zero tags are not preserved when delivering signals. This means that
-signal handlers in applications making use of tags cannot rely on the
-tag information for user virtual addresses being maintained for fields
-inside siginfo_t. One exception to this rule is for signals raised in
-response to watchpoint debug exceptions, where the tag information will
-be preserved.
+When delivering signals, non-zero tags are not preserved in
+siginfo.si_addr unless the flag SA_EXPOSE_TAGBITS was set in
+sigaction.sa_flags when the signal handler was installed. This means
+that signal handlers in applications making use of tags cannot rely
+on the tag information for user virtual addresses being maintained
+in these fields unless the flag was set.
+
+Due to architecture limitations, bits 63:60 of the fault address
+are not preserved in response to synchronous tag check faults
+(SEGV_MTESERR) even if SA_EXPOSE_TAGBITS was set. Applications should
+treat the values of these bits as undefined in order to accommodate
+future architecture revisions which may preserve the bits.
+
+For signals raised in response to watchpoint debug exceptions, the
+tag information will be preserved regardless of the SA_EXPOSE_TAGBITS
+flag setting.
+
+Non-zero tags are never preserved in sigcontext.fault_address
+regardless of the SA_EXPOSE_TAGBITS flag setting.
The architecture prevents the use of a tagged PC, so the upper byte will
be set to a sign-extension of bit 55 on exception return.

Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml

View file
diff --git a/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml b/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml
index 5aad9f4..80a9238 100644
--- a/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml
+++ b/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml
@@ -15,6 +15,9 @@ properties:
- enum:
- fsl,imx8-ddr-pmu
- fsl,imx8m-ddr-pmu
+ - fsl,imx8mq-ddr-pmu
+ - fsl,imx8mm-ddr-pmu
+ - fsl,imx8mn-ddr-pmu
- fsl,imx8mp-ddr-pmu
- items:
- enum:

arch/alpha/include/uapi/asm/signal.h

View file
diff --git a/arch/alpha/include/uapi/asm/signal.h b/arch/alpha/include/uapi/asm/signal.h
index 74c750b..a69dd8d 100644
--- a/arch/alpha/include/uapi/asm/signal.h
+++ b/arch/alpha/include/uapi/asm/signal.h
@@ -60,20 +60,6 @@ typedef unsigned long sigset_t;
#define SIGRTMIN 32
#define SIGRTMAX _NSIG
-/*
- * SA_FLAGS values:
- *
- * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
- * SA_RESETHAND clears the handler when the signal is delivered.
- * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
- * SA_NODEFER prevents the current signal from being masked in the handler.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-
#define SA_ONSTACK 0x00000001
#define SA_RESTART 0x00000002
#define SA_NOCLDSTOP 0x00000004

arch/arm/include/asm/signal.h

View file
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
index 65530a0..430be77 100644
--- a/arch/arm/include/asm/signal.h
+++ b/arch/arm/include/asm/signal.h
@@ -17,6 +17,8 @@ typedef struct {
unsigned long sig[_NSIG_WORDS];
} sigset_t;
+#define __ARCH_UAPI_SA_FLAGS (SA_THIRTYTWO | SA_RESTORER)
+
#define __ARCH_HAS_SA_RESTORER
#include <asm/sigcontext.h>

arch/arm/include/uapi/asm/signal.h

View file
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
index 9b4185b..c9a3ea1 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -60,33 +60,12 @@ typedef unsigned long sigset_t;
#define SIGSWI 32
/*
- * SA_FLAGS values:
- *
- * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
- * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
- * SA_SIGINFO deliver the signal with SIGINFO structs
- * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
- * is running in 26-bit.
- * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
- * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_NODEFER prevents the current signal from being masked in the handler.
- * SA_RESETHAND clears the handler when the signal is delivered.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
+ * SA_THIRTYTWO historically meant deliver the signal in 32-bit mode, even if
+ * the task is running in 26-bit. But since the kernel no longer supports
+ * 26-bit mode, the flag has no effect.
*/
-#define SA_NOCLDSTOP 0x00000001
-#define SA_NOCLDWAIT 0x00000002
-#define SA_SIGINFO 0x00000004
#define SA_THIRTYTWO 0x02000000
#define SA_RESTORER 0x04000000
-#define SA_ONSTACK 0x08000000
-#define SA_RESTART 0x10000000
-#define SA_NODEFER 0x40000000
-#define SA_RESETHAND 0x80000000
-
-#define SA_NOMASK SA_NODEFER
-#define SA_ONESHOT SA_RESETHAND
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192

arch/arm64/Kconfig

View file
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a6b5b7e..e5bcb49 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -171,6 +171,8 @@ config ARM64
select HAVE_NMI
select HAVE_PATA_PLATFORM
select HAVE_PERF_EVENTS
+ select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI && HW_PERF_EVENTS
+ select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
select HAVE_PERF_REGS
select HAVE_PERF_USER_STACK_DUMP
select HAVE_REGS_AND_STACK_ACCESS_API
@@ -196,7 +198,6 @@ config ARM64
select PCI_SYSCALL if PCI
select POWER_RESET
select POWER_SUPPLY
- select SET_FS
select SPARSE_IRQ
select SWIOTLB
select SYSCTL_EXCEPTION_TRACE
@@ -332,16 +333,16 @@ config BROKEN_GAS_INST
config KASAN_SHADOW_OFFSET
hex
depends on KASAN
- default 0xdfffa00000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && !KASAN_SW_TAGS
- default 0xdfffd00000000000 if ARM64_VA_BITS_47 && !KASAN_SW_TAGS
- default 0xdffffe8000000000 if ARM64_VA_BITS_42 && !KASAN_SW_TAGS
- default 0xdfffffd000000000 if ARM64_VA_BITS_39 && !KASAN_SW_TAGS
- default 0xdffffffa00000000 if ARM64_VA_BITS_36 && !KASAN_SW_TAGS
- default 0xefff900000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && KASAN_SW_TAGS
- default 0xefffc80000000000 if ARM64_VA_BITS_47 && KASAN_SW_TAGS
- default 0xeffffe4000000000 if ARM64_VA_BITS_42 && KASAN_SW_TAGS
- default 0xefffffc800000000 if ARM64_VA_BITS_39 && KASAN_SW_TAGS
- default 0xeffffff900000000 if ARM64_VA_BITS_36 && KASAN_SW_TAGS
+ default 0xdfff800000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && !KASAN_SW_TAGS
+ default 0xdfffc00000000000 if ARM64_VA_BITS_47 && !KASAN_SW_TAGS
+ default 0xdffffe0000000000 if ARM64_VA_BITS_42 && !KASAN_SW_TAGS
+ default 0xdfffffc000000000 if ARM64_VA_BITS_39 && !KASAN_SW_TAGS
+ default 0xdffffff800000000 if ARM64_VA_BITS_36 && !KASAN_SW_TAGS
+ default 0xefff800000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && KASAN_SW_TAGS
+ default 0xefffc00000000000 if ARM64_VA_BITS_47 && KASAN_SW_TAGS
+ default 0xeffffe0000000000 if ARM64_VA_BITS_42 && KASAN_SW_TAGS
+ default 0xefffffc000000000 if ARM64_VA_BITS_39 && KASAN_SW_TAGS
+ default 0xeffffff800000000 if ARM64_VA_BITS_36 && KASAN_SW_TAGS
default 0xffffffffffffffff
source "arch/arm64/Kconfig.platforms"
@@ -1389,6 +1390,9 @@ config ARM64_PAN
The feature is detected at runtime, and will remain as a 'nop'
instruction if the cpu does not implement the feature.
+config AS_HAS_LDAPR
+ def_bool $(as-instr,.arch_extension rcpc)
+
config ARM64_LSE_ATOMICS
bool
default ARM64_USE_LSE_ATOMICS
@@ -1426,27 +1430,6 @@ endmenu
menu "ARMv8.2 architectural features"
-config ARM64_UAO
- bool "Enable support for User Access Override (UAO)"
- default y
- help
- User Access Override (UAO; part of the ARMv8.2 Extensions)
- causes the 'unprivileged' variant of the load/store instructions to
- be overridden to be privileged.
-
- This option changes get_user() and friends to use the 'unprivileged'
- variant of the load/store instructions. This ensures that user-space
- really did have access to the supplied memory. When addr_limit is
- set to kernel memory the UAO bit will be set, allowing privileged
- access to kernel memory.
-
- Choosing this option will cause copy_to_user() et al to use user-space
- memory permissions.
-
- The feature is detected at runtime, the kernel will use the
- regular load/store instructions if the cpu does not implement the
- feature.
-
config ARM64_PMEM
bool "Enable support for persistent memory"
select ARCH_HAS_PMEM_API
@@ -1847,15 +1830,36 @@ config CMDLINE
entering them here. As a minimum, you should specify the the
root device (e.g. root=/dev/nfs).
+choice
+ prompt "Kernel command line type" if CMDLINE != ""
+ default CMDLINE_FROM_BOOTLOADER
+ help
+ Choose how the kernel will handle the provided default kernel
+ command line string.
+
+config CMDLINE_FROM_BOOTLOADER
+ bool "Use bootloader kernel arguments if available"
+ help
+ Uses the command-line options passed by the boot loader. If
+ the boot loader doesn't provide any, the default kernel command
+ string provided in CMDLINE will be used.
+
+config CMDLINE_EXTEND
+ bool "Extend bootloader kernel arguments"
+ help
+ The command-line arguments provided by the boot loader will be
+ appended to the default kernel command string.
+
config CMDLINE_FORCE
bool "Always use the default kernel command string"
- depends on CMDLINE != ""
help
Always use the default kernel command string, even if the boot
loader passes other arguments to the kernel.
This is useful if you cannot or don't want to change the
command-line options your boot loader passes to the kernel.
+endchoice
+
config EFI_STUB
bool

arch/arm64/include/asm/alternative-macros.h

View file
diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h
new file mode 100644
index 0000000..5df500d
--- /dev/null
+++ b/arch/arm64/include/asm/alternative-macros.h
@@ -0,0 +1,217 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_ALTERNATIVE_MACROS_H
+#define __ASM_ALTERNATIVE_MACROS_H
+
+#include <asm/cpucaps.h>
+
+#define ARM64_CB_PATCH ARM64_NCAPS
+
+/* A64 instructions are always 32 bits. */
+#define AARCH64_INSN_SIZE 4
+
+#ifndef __ASSEMBLY__
+
+#include <linux/stringify.h>
+
+#define ALTINSTR_ENTRY(feature) \
+ " .word 661b - .\n" /* label */ \
+ " .word 663f - .\n" /* new instruction */ \
+ " .hword " __stringify(feature) "\n" /* feature bit */ \
+ " .byte 662b-661b\n" /* source len */ \
+ " .byte 664f-663f\n" /* replacement len */
+
+#define ALTINSTR_ENTRY_CB(feature, cb) \
+ " .word 661b - .\n" /* label */ \
+ " .word " __stringify(cb) "- .\n" /* callback */ \
+ " .hword " __stringify(feature) "\n" /* feature bit */ \
+ " .byte 662b-661b\n" /* source len */ \
+ " .byte 664f-663f\n" /* replacement len */
+
+/*
+ * alternative assembly primitive:
+ *
+ * If any of these .org directive fail, it means that insn1 and insn2
+ * don't have the same length. This used to be written as
+ *
+ * .if ((664b-663b) != (662b-661b))
+ * .error "Alternatives instruction length mismatch"
+ * .endif
+ *
+ * but most assemblers die if insn1 or insn2 have a .inst. This should
+ * be fixed in a binutils release posterior to 2.25.51.0.2 (anything
+ * containing commit 4e4d08cf7399b606 or c1baaddf8861).
+ *
+ * Alternatives with callbacks do not generate replacement instructions.
+ */
+#define __ALTERNATIVE_CFG(oldinstr, newinstr, feature, cfg_enabled) \
+ ".if "__stringify(cfg_enabled)" == 1\n" \
+ "661:\n\t" \
+ oldinstr "\n" \
+ "662:\n" \
+ ".pushsection .altinstructions,\"a\"\n" \
+ ALTINSTR_ENTRY(feature) \
+ ".popsection\n" \
+ ".subsection 1\n" \
+ "663:\n\t" \
+ newinstr "\n" \
+ "664:\n\t" \
+ ".org . - (664b-663b) + (662b-661b)\n\t" \
+ ".org . - (662b-661b) + (664b-663b)\n\t" \
+ ".previous\n" \
+ ".endif\n"
+
+#define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \
+ ".if "__stringify(cfg_enabled)" == 1\n" \
+ "661:\n\t" \
+ oldinstr "\n" \
+ "662:\n" \
+ ".pushsection .altinstructions,\"a\"\n" \
+ ALTINSTR_ENTRY_CB(feature, cb) \
+ ".popsection\n" \
+ "663:\n\t" \
+ "664:\n\t" \
+ ".endif\n"
+
+#define _ALTERNATIVE_CFG(oldinstr, newinstr, feature, cfg, ...) \
+ __ALTERNATIVE_CFG(oldinstr, newinstr, feature, IS_ENABLED(cfg))
+
+#define ALTERNATIVE_CB(oldinstr, cb) \
+ __ALTERNATIVE_CFG_CB(oldinstr, ARM64_CB_PATCH, 1, cb)
+#else
+
+#include <asm/assembler.h>
+
+.macro altinstruction_entry orig_offset alt_offset feature orig_len alt_len
+ .word \orig_offset - .
+ .word \alt_offset - .
+ .hword \feature
+ .byte \orig_len
+ .byte \alt_len
+.endm
+
+.macro alternative_insn insn1, insn2, cap, enable = 1
+ .if \enable
+661: \insn1
+662: .pushsection .altinstructions, "a"
+ altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f
+ .popsection
+ .subsection 1
+663: \insn2
+664: .previous
+ .org . - (664b-663b) + (662b-661b)
+ .org . - (662b-661b) + (664b-663b)
+ .endif
+.endm
+
+/*
+ * Alternative sequences
+ *
+ * The code for the case where the capability is not present will be
+ * assembled and linked as normal. There are no restrictions on this
+ * code.
+ *
+ * The code for the case where the capability is present will be
+ * assembled into a special section to be used for dynamic patching.
+ * Code for that case must:
+ *
+ * 1. Be exactly the same length (in bytes) as the default code
+ * sequence.
+ *
+ * 2. Not contain a branch target that is used outside of the
+ * alternative sequence it is defined in (branches into an
+ * alternative sequence are not fixed up).
+ */
+
+/*
+ * Begin an alternative code sequence.
+ */
+.macro alternative_if_not cap
+ .set .Lasm_alt_mode, 0
+ .pushsection .altinstructions, "a"
+ altinstruction_entry 661f, 663f, \cap, 662f-661f, 664f-663f
+ .popsection
+661:
+.endm
+
+.macro alternative_if cap
+ .set .Lasm_alt_mode, 1
+ .pushsection .altinstructions, "a"
+ altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f
+ .popsection
+ .subsection 1
+ .align 2 /* So GAS knows label 661 is suitably aligned */
+661:
+.endm
+
+.macro alternative_cb cb
+ .set .Lasm_alt_mode, 0
+ .pushsection .altinstructions, "a"
+ altinstruction_entry 661f, \cb, ARM64_CB_PATCH, 662f-661f, 0
+ .popsection
+661:
+.endm
+
+/*
+ * Provide the other half of the alternative code sequence.
+ */
+.macro alternative_else
+662:
+ .if .Lasm_alt_mode==0
+ .subsection 1
+ .else
+ .previous
+ .endif
+663:
+.endm
+
+/*
+ * Complete an alternative code sequence.
+ */
+.macro alternative_endif
+664:
+ .if .Lasm_alt_mode==0
+ .previous
+ .endif
+ .org . - (664b-663b) + (662b-661b)
+ .org . - (662b-661b) + (664b-663b)
+.endm
+
+/*
+ * Callback-based alternative epilogue
+ */
+.macro alternative_cb_end
+662:
+.endm
+
+/*
+ * Provides a trivial alternative or default sequence consisting solely
+ * of NOPs. The number of NOPs is chosen automatically to match the
+ * previous case.
+ */
+.macro alternative_else_nop_endif
+alternative_else
+ nops (662b-661b) / AARCH64_INSN_SIZE
+alternative_endif
+.endm
+
+#define _ALTERNATIVE_CFG(insn1, insn2, cap, cfg, ...) \
+ alternative_insn insn1, insn2, cap, IS_ENABLED(cfg)
+
+.macro user_alt, label, oldinstr, newinstr, cond
+9999: alternative_insn "\oldinstr", "\newinstr", \cond
+ _asm_extable 9999b, \label
+.endm
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * Usage: asm(ALTERNATIVE(oldinstr, newinstr, feature));
+ *
+ * Usage: asm(ALTERNATIVE(oldinstr, newinstr, feature, CONFIG_FOO));
+ * N.B. If CONFIG_FOO is specified, but not selected, the whole block
+ * will be omitted, including oldinstr.
+ */
+#define ALTERNATIVE(oldinstr, newinstr, ...) \
+ _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
+
+#endif /* __ASM_ALTERNATIVE_MACROS_H */

arch/arm64/include/asm/alternative.h

View file
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
index 619db9b..a38b92e 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
@@ -2,17 +2,13 @@
#ifndef __ASM_ALTERNATIVE_H
#define __ASM_ALTERNATIVE_H
-#include <asm/cpucaps.h>
-#include <asm/insn.h>
-
-#define ARM64_CB_PATCH ARM64_NCAPS
+#include <asm/alternative-macros.h>
#ifndef __ASSEMBLY__
#include <linux/init.h>
#include <linux/types.h>
#include <linux/stddef.h>
-#include <linux/stringify.h>
struct alt_instr {
s32 orig_offset; /* offset to original instruction */
@@ -35,264 +31,5 @@ void apply_alternatives_module(void *start, size_t length);
static inline void apply_alternatives_module(void *start, size_t length) { }
#endif
-#define ALTINSTR_ENTRY(feature) \
- " .word 661b - .\n" /* label */ \
- " .word 663f - .\n" /* new instruction */ \
- " .hword " __stringify(feature) "\n" /* feature bit */ \
- " .byte 662b-661b\n" /* source len */ \
- " .byte 664f-663f\n" /* replacement len */
-
-#define ALTINSTR_ENTRY_CB(feature, cb) \
- " .word 661b - .\n" /* label */ \
- " .word " __stringify(cb) "- .\n" /* callback */ \
- " .hword " __stringify(feature) "\n" /* feature bit */ \
- " .byte 662b-661b\n" /* source len */ \
- " .byte 664f-663f\n" /* replacement len */
-
-/*
- * alternative assembly primitive:

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/asm-uaccess.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/cpucaps.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/cpufeature.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/exception.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/exec.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/futex.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/insn.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kernel-pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kprobes.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/memory.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/mmu_context.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/pgtable-hwdef.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/ptrace.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/rwonce.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/sysreg.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/system_misc.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/thread_info.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/topology.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/traps.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/uaccess.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/alternative.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/armv8_deprecated.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/asm-offsets.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/cpufeature.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/debug-monitors.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/efi-header.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/entry-common.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/entry.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/head.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/irq.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/kaslr.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/mte.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/perf_event.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/probes/kprobes.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/process.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/proton-pack.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/ptrace.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/scs.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/sdei.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/signal.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/sleep.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/smp.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/suspend.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/sys_compat.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/syscall.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/topology.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/traps.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/vdso/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/vdso32/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/vmlinux.lds.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/clear_user.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/copy_from_user.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/copy_in_user.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/copy_to_user.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/mte.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/uaccess_flushcache.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/fault.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/init.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/mmu.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/proc.S

View file

This diff is incomplete. Download the complete patch.

arch/h8300/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/ia64/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/m68k/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/parisc/include/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/parisc/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/signal_compat.c

View file

This diff is incomplete. Download the complete patch.

arch/xtensa/include/uapi/asm/signal.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/arm64/iort.c

View file

This diff is incomplete. Download the complete patch.

drivers/firmware/arm_sdei.c

View file

This diff is incomplete. Download the complete patch.

drivers/of/address.c

View file

This diff is incomplete. Download the complete patch.

drivers/of/unittest.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/perf/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_dmc620_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_dsu_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_smmuv3_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/fsl_imx8_ddr_perf.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_uncore_hha_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_uncore_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_uncore_pmu.h

View file

This diff is incomplete. Download the complete patch.

include/linux/acpi_iort.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmzone.h

View file

This diff is incomplete. Download the complete patch.

include/linux/of.h

View file

This diff is incomplete. Download the complete patch.

include/linux/perf/arm_pmu.h

View file

This diff is incomplete. Download the complete patch.

include/linux/scs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/signal.h

View file

This diff is incomplete. Download the complete patch.

include/linux/signal_types.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/asm-generic/signal-defs.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/asm-generic/signal.h

View file

This diff is incomplete. Download the complete patch.

kernel/scs.c

View file

This diff is incomplete. Download the complete patch.

kernel/signal.c

View file

This diff is incomplete. Download the complete patch.