History

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

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_*() ...

Linus Torvalds committed 5 years ago

Commit 0ca2ce82 parents 5865924 d889797114 files · +2603 −1314Browse files

Showing the changes to include (9 of 114 files). Show all

Unified · Split

9 files
  1. include/linux/acpi_iort.h +4 −0
  2. include/linux/mmzone.h +0 −20
  3. include/linux/of.h +7 −0
  4. include/linux/perf/arm_pmu.h +2 −0
  5. include/linux/scs.h +6 −10
  6. include/linux/signal.h +14 −0
  7. include/linux/signal_types.h +12 −0
  8. include/uapi/asm-generic/signal-defs.h +63 −0
  9. include/uapi/asm-generic/signal.h +0 −29
include/linux/acpi_iort.h+4−0
@@ -38,6 +38,7 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *size); · 37 unmodified lines
38const struct iommu_ops *iort_iommu_configure_id(struct device *dev,38const struct iommu_ops *iort_iommu_configure_id(struct device *dev,
39 const u32 *id_in);39 const u32 *id_in);
40int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head);40int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head);
41phys_addr_t acpi_iort_dma_get_max_cpu_address(void);
41#else42#else
42static inline void acpi_iort_init(void) { }43static inline void acpi_iort_init(void) { }
43static inline u32 iort_msi_map_id(struct device *dev, u32 id)44static inline u32 iort_msi_map_id(struct device *dev, u32 id)
@@ -55,6 +56,9 @@ static inline const struct iommu_ops *iort_iommu_configure_id( · 11 unmodified lines
55static inline56static inline
56int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head)57int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head)
57{ return 0; }58{ return 0; }
59
60static inline phys_addr_t acpi_iort_dma_get_max_cpu_address(void)
61{ return PHYS_ADDR_MAX; }
58#endif62#endif
59 63
60#endif /* __ACPI_IORT_H__ */64#endif /* __ACPI_IORT_H__ */
include/linux/mmzone.h+0−20
@@ -354,26 +354,6 @@ enum zone_type { · 353 unmodified lines
354 * DMA mask is assumed when ZONE_DMA32 is defined. Some 64-bit354 * DMA mask is assumed when ZONE_DMA32 is defined. Some 64-bit
355 * platforms may need both zones as they support peripherals with355 * platforms may need both zones as they support peripherals with
356 * different DMA addressing limitations.356 * different DMA addressing limitations.
357 *
358 * Some examples:
359 *
360 * - i386 and x86_64 have a fixed 16M ZONE_DMA and ZONE_DMA32 for the
361 * rest of the lower 4G.
362 *
363 * - arm only uses ZONE_DMA, the size, up to 4G, may vary depending on
364 * the specific device.
365 *
366 * - arm64 has a fixed 1G ZONE_DMA and ZONE_DMA32 for the rest of the
367 * lower 4G.
368 *
369 * - powerpc only uses ZONE_DMA, the size, up to 2G, may vary
370 * depending on the specific device.
371 *
372 * - s390 uses ZONE_DMA fixed to the lower 2G.
373 *
374 * - ia64 and riscv only use ZONE_DMA32.
375 *
376 * - parisc uses neither.
377 */357 */
378#ifdef CONFIG_ZONE_DMA358#ifdef CONFIG_ZONE_DMA
379 ZONE_DMA,359 ZONE_DMA,
include/linux/of.h+7−0
@@ -558,6 +558,8 @@ int of_map_id(struct device_node *np, u32 id, · 557 unmodified lines
558 const char *map_name, const char *map_mask_name,558 const char *map_name, const char *map_mask_name,
559 struct device_node **target, u32 *id_out);559 struct device_node **target, u32 *id_out);
560 560
561phys_addr_t of_dma_get_max_cpu_address(struct device_node *np);
562
561#else /* CONFIG_OF */563#else /* CONFIG_OF */
562 564
563static inline void of_core_init(void)565static inline void of_core_init(void)
@@ -995,6 +997,11 @@ static inline int of_map_id(struct device_node *np, u32 id, · 431 unmodified lines
995 return -EINVAL;997 return -EINVAL;
996}998}
997 999
1000static inline phys_addr_t of_dma_get_max_cpu_address(struct device_node *np)
1001{
1002 return PHYS_ADDR_MAX;
1003}
1004
998#define of_match_ptr(_ptr) NULL1005#define of_match_ptr(_ptr) NULL
999#define of_match_node(_matches, _node) NULL1006#define of_match_node(_matches, _node) NULL
1000#endif /* CONFIG_OF */1007#endif /* CONFIG_OF */
include/linux/perf/arm_pmu.h+2−0
@@ -163,6 +163,8 @@ int arm_pmu_acpi_probe(armpmu_init_fn init_fn); · 162 unmodified lines
163static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; }163static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; }
164#endif164#endif
165 165
166bool arm_pmu_irq_is_nmi(void);
167
166/* Internal functions only for core arm_pmu code */168/* Internal functions only for core arm_pmu code */
167struct arm_pmu *armpmu_alloc(void);169struct arm_pmu *armpmu_alloc(void);
168struct arm_pmu *armpmu_alloc_atomic(void);170struct arm_pmu *armpmu_alloc_atomic(void);
include/linux/scs.h+6−10
@@ -15,24 +15,18 @@ · 14 unmodified lines
15 15
16#ifdef CONFIG_SHADOW_CALL_STACK16#ifdef CONFIG_SHADOW_CALL_STACK
17 17
18/*18#define SCS_ORDER 0
19 * In testing, 1 KiB shadow stack size (i.e. 128 stack frames on a 64-bit19#define SCS_SIZE (PAGE_SIZE << SCS_ORDER)
20 * architecture) provided ~40% safety margin on stack usage while keeping
21 * memory allocation overhead reasonable.
22 */
23#define SCS_SIZE SZ_1K
24#define GFP_SCS (GFP_KERNEL | __GFP_ZERO)20#define GFP_SCS (GFP_KERNEL | __GFP_ZERO)
25 21
26/* An illegal pointer value to mark the end of the shadow stack. */22/* An illegal pointer value to mark the end of the shadow stack. */
27#define SCS_END_MAGIC (0x5f6UL + POISON_POINTER_DELTA)23#define SCS_END_MAGIC (0x5f6UL + POISON_POINTER_DELTA)
28 24
29/* Allocate a static per-CPU shadow stack */
30#define DEFINE_SCS(name) \
31 DEFINE_PER_CPU(unsigned long [SCS_SIZE/sizeof(long)], name) \
32
33#define task_scs(tsk) (task_thread_info(tsk)->scs_base)25#define task_scs(tsk) (task_thread_info(tsk)->scs_base)
34#define task_scs_sp(tsk) (task_thread_info(tsk)->scs_sp)26#define task_scs_sp(tsk) (task_thread_info(tsk)->scs_sp)
35 27
28void *scs_alloc(int node);
29void scs_free(void *s);
36void scs_init(void);30void scs_init(void);
37int scs_prepare(struct task_struct *tsk, int node);31int scs_prepare(struct task_struct *tsk, int node);
38void scs_release(struct task_struct *tsk);32void scs_release(struct task_struct *tsk);
@@ -61,6 +55,8 @@ static inline bool task_scs_end_corrupted(struct task_struct *tsk) · 22 unmodified lines
61 55
62#else /* CONFIG_SHADOW_CALL_STACK */56#else /* CONFIG_SHADOW_CALL_STACK */
63 57
58static inline void *scs_alloc(int node) { return NULL; }
59static inline void scs_free(void *s) {}
64static inline void scs_init(void) {}60static inline void scs_init(void) {}
65static inline void scs_task_reset(struct task_struct *tsk) {}61static inline void scs_task_reset(struct task_struct *tsk) {}
66static inline int scs_prepare(struct task_struct *tsk, int node) { return 0; }62static inline int scs_prepare(struct task_struct *tsk, int node) { return 0; }
include/linux/signal.h+14−0
@@ -469,4 +469,18 @@ struct seq_file; · 468 unmodified lines
469extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);469extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
470#endif470#endif
471 471
472#ifndef arch_untagged_si_addr
473/*
474 * Given a fault address and a signal and si_code which correspond to the
475 * _sigfault union member, returns the address that must appear in si_addr if
476 * the signal handler does not have SA_EXPOSE_TAGBITS enabled in sa_flags.
477 */
478static inline void __user *arch_untagged_si_addr(void __user *addr,
479 unsigned long sig,
480 unsigned long si_code)
481{
482 return addr;
483}
484#endif
485
472#endif /* _LINUX_SIGNAL_H */486#endif /* _LINUX_SIGNAL_H */
include/linux/signal_types.h+12−0
@@ -68,4 +68,16 @@ struct ksignal { · 67 unmodified lines
68 int sig;68 int sig;
69};69};
70 70
71#ifndef __ARCH_UAPI_SA_FLAGS
72#ifdef SA_RESTORER
73#define __ARCH_UAPI_SA_FLAGS SA_RESTORER
74#else
75#define __ARCH_UAPI_SA_FLAGS 0
76#endif
77#endif
78
79#define UAPI_SA_FLAGS \
80 (SA_NOCLDSTOP | SA_NOCLDWAIT | SA_SIGINFO | SA_ONSTACK | SA_RESTART | \
81 SA_NODEFER | SA_RESETHAND | SA_EXPOSE_TAGBITS | __ARCH_UAPI_SA_FLAGS)
82
71#endif /* _LINUX_SIGNAL_TYPES_H */83#endif /* _LINUX_SIGNAL_TYPES_H */
include/uapi/asm-generic/signal-defs.h+63−0
@@ -4,6 +4,69 @@ · 3 unmodified lines
4 4
5#include <linux/compiler.h>5#include <linux/compiler.h>
6 6
7/*
8 * SA_FLAGS values:
9 *
10 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
12 * SA_SIGINFO delivers the signal with SIGINFO structs.
13 * SA_ONSTACK indicates that a registered stack_t will be used.
14 * SA_RESTART flag to get restarting signals (which were the default long ago)
15 * SA_NODEFER prevents the current signal from being masked in the handler.
16 * SA_RESETHAND clears the handler when the signal is delivered.
17 * SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from
18 * before the introduction of SA_UNSUPPORTED did not clear unknown bits from
19 * sa_flags when read using the oldact argument to sigaction and rt_sigaction,
20 * so this bit allows flag bit support to be detected from userspace while
21 * allowing an old kernel to be distinguished from a kernel that supports every
22 * flag bit.
23 * SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in
24 * siginfo.si_addr.
25 *
26 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
27 * Unix names RESETHAND and NODEFER respectively.
28 */
29#ifndef SA_NOCLDSTOP
30#define SA_NOCLDSTOP 0x00000001
31#endif
32#ifndef SA_NOCLDWAIT
33#define SA_NOCLDWAIT 0x00000002
34#endif
35#ifndef SA_SIGINFO
36#define SA_SIGINFO 0x00000004
37#endif
38/* 0x00000008 used on alpha, mips, parisc */
39/* 0x00000010 used on alpha, parisc */
40/* 0x00000020 used on alpha, parisc, sparc */
41/* 0x00000040 used on alpha, parisc */
42/* 0x00000080 used on parisc */
43/* 0x00000100 used on sparc */
44/* 0x00000200 used on sparc */
45#define SA_UNSUPPORTED 0x00000400
46#define SA_EXPOSE_TAGBITS 0x00000800
47/* 0x00010000 used on mips */
48/* 0x01000000 used on x86 */
49/* 0x02000000 used on x86 */
50/*
51 * New architectures should not define the obsolete
52 * SA_RESTORER 0x04000000
53 */
54#ifndef SA_ONSTACK
55#define SA_ONSTACK 0x08000000
56#endif
57#ifndef SA_RESTART
58#define SA_RESTART 0x10000000
59#endif
60#ifndef SA_NODEFER
61#define SA_NODEFER 0x40000000
62#endif
63#ifndef SA_RESETHAND
64#define SA_RESETHAND 0x80000000
65#endif
66
67#define SA_NOMASK SA_NODEFER
68#define SA_ONESHOT SA_RESETHAND
69
7#ifndef SIG_BLOCK70#ifndef SIG_BLOCK
8#define SIG_BLOCK 0 /* for blocking signals */71#define SIG_BLOCK 0 /* for blocking signals */
9#endif72#endif
include/uapi/asm-generic/signal.h+0−29
@@ -52,35 +52,6 @@ · 51 unmodified lines
52#define SIGRTMAX _NSIG52#define SIGRTMAX _NSIG
53#endif53#endif
54 54
55/*
56 * SA_FLAGS values:
57 *
58 * SA_ONSTACK indicates that a registered stack_t will be used.
59 * SA_RESTART flag to get restarting signals (which were the default long ago)
60 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
61 * SA_RESETHAND clears the handler when the signal is delivered.
62 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
63 * SA_NODEFER prevents the current signal from being masked in the handler.
64 *
65 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
66 * Unix names RESETHAND and NODEFER respectively.
67 */
68#define SA_NOCLDSTOP 0x00000001
69#define SA_NOCLDWAIT 0x00000002
70#define SA_SIGINFO 0x00000004
71#define SA_ONSTACK 0x08000000
72#define SA_RESTART 0x10000000
73#define SA_NODEFER 0x40000000
74#define SA_RESETHAND 0x80000000
75
76#define SA_NOMASK SA_NODEFER
77#define SA_ONESHOT SA_RESETHAND
78
79/*
80 * New architectures should not define the obsolete
81 * SA_RESTORER 0x04000000
82 */
83
84#if !defined MINSIGSTKSZ || !defined SIGSTKSZ55#if !defined MINSIGSTKSZ || !defined SIGSTKSZ
85#define MINSIGSTKSZ 204856#define MINSIGSTKSZ 2048
86#define SIGSTKSZ 819257#define SIGSTKSZ 8192

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t