Skip to content

Commit 311da49

Browse files
committed
Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - Initial round of Spectre variant 1 and variant 2 fixes for 32-bit ARM - Clang support improvements - nommu updates for v8 MPU - enable ARM_MODULE_PLTS by default to avoid problems loading modules with larger kernels - vmlinux.lds and dma-mapping cleanups * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (31 commits) ARM: spectre-v1: fix syscall entry ARM: spectre-v1: add array_index_mask_nospec() implementation ARM: spectre-v1: add speculation barrier (csdb) macros ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1 ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15 ARM: KVM: invalidate icache on guest exit for Cortex-A15 ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17 ARM: spectre-v2: warn about incorrect context switching functions ARM: spectre-v2: add firmware based hardening ARM: spectre-v2: harden user aborts in kernel space ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit ARM: spectre-v2: harden branch predictor on context switches ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre ARM: bugs: add support for per-processor bug checking ARM: bugs: hook processor bug checking into SMP and suspend paths ARM: bugs: prepare processor bug infrastructure ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs ARM: 8774/1: remove no-op macro VMLINUX_SYMBOL() ARM: 8773/1: amba: Export amba_bustype ...
2 parents ca95bf6 + 0ac000e commit 311da49

41 files changed

Lines changed: 1318 additions & 210 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/Kconfig‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,7 @@ config ARCH_WANT_GENERAL_HUGETLB
16981698
config ARM_MODULE_PLTS
16991699
bool "Use PLTs to allow module memory to spill over into vmalloc area"
17001700
depends on MODULES
1701+
default y
17011702
help
17021703
Allocate PLTs when loading modules so that jumps and calls whose
17031704
targets are too far away for their relative offsets to be encoded
@@ -1708,7 +1709,8 @@ config ARM_MODULE_PLTS
17081709
rounding up to page size, the actual memory footprint is usually
17091710
the same.
17101711

1711-
Say y if you are getting out of memory errors while loading modules
1712+
Disabling this is usually safe for small single-platform
1713+
configurations. If unsure, say y.
17121714

17131715
source "mm/Kconfig"
17141716

‎arch/arm/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
106106
tune-y := $(tune-y)
107107

108108
ifeq ($(CONFIG_AEABI),y)
109-
CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp
109+
CFLAGS_ABI :=-mabi=aapcs-linux -mfpu=vfp
110110
else
111111
CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
112112
endif

‎arch/arm/boot/compressed/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ CFLAGS_fdt_ro.o := $(nossp_flags)
113113
CFLAGS_fdt_rw.o := $(nossp_flags)
114114
CFLAGS_fdt_wip.o := $(nossp_flags)
115115

116-
ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
116+
ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj)
117117
asflags-y := -DZIMAGE
118118

119119
# Supply kernel BSS size to the decompressor via a linker symbol.

‎arch/arm/include/asm/assembler.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,14 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
447447
.size \name , . - \name
448448
.endm
449449

450+
.macro csdb
451+
#ifdef CONFIG_THUMB2_KERNEL
452+
.inst.w 0xf3af8014
453+
#else
454+
.inst 0xe320f014
455+
#endif
456+
.endm
457+
450458
.macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
451459
#ifndef CONFIG_CPU_USE_DOMAINS
452460
adds \tmp, \addr, #\size - 1

‎arch/arm/include/asm/barrier.h‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define isb(option) __asm__ __volatile__ ("isb " #option : : : "memory")
1818
#define dsb(option) __asm__ __volatile__ ("dsb " #option : : : "memory")
1919
#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
20+
#ifdef CONFIG_THUMB2_KERNEL
21+
#define CSDB ".inst.w 0xf3af8014"
22+
#else
23+
#define CSDB ".inst 0xe320f014"
24+
#endif
25+
#define csdb() __asm__ __volatile__(CSDB : : : "memory")
2026
#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
2127
#define isb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
2228
: : "r" (0) : "memory")
@@ -37,6 +43,13 @@
3743
#define dmb(x) __asm__ __volatile__ ("" : : : "memory")
3844
#endif
3945

46+
#ifndef CSDB
47+
#define CSDB
48+
#endif
49+
#ifndef csdb
50+
#define csdb()
51+
#endif
52+
4053
#ifdef CONFIG_ARM_HEAVY_MB
4154
extern void (*soc_mb)(void);
4255
extern void arm_heavy_mb(void);
@@ -63,6 +76,25 @@ extern void arm_heavy_mb(void);
6376
#define __smp_rmb() __smp_mb()
6477
#define __smp_wmb() dmb(ishst)
6578

79+
#ifdef CONFIG_CPU_SPECTRE
80+
static inline unsigned long array_index_mask_nospec(unsigned long idx,
81+
unsigned long sz)
82+
{
83+
unsigned long mask;
84+
85+
asm volatile(
86+
"cmp %1, %2\n"
87+
" sbc %0, %1, %1\n"
88+
CSDB
89+
: "=r" (mask)
90+
: "r" (idx), "Ir" (sz)
91+
: "cc");
92+
93+
return mask;
94+
}
95+
#define array_index_mask_nospec array_index_mask_nospec
96+
#endif
97+
6698
#include <asm-generic/barrier.h>
6799

68100
#endif /* !__ASSEMBLY__ */

‎arch/arm/include/asm/bugs.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
#ifndef __ASM_BUGS_H
1111
#define __ASM_BUGS_H
1212

13-
#ifdef CONFIG_MMU
1413
extern void check_writebuffer_bugs(void);
1514

16-
#define check_bugs() check_writebuffer_bugs()
15+
#ifdef CONFIG_MMU
16+
extern void check_bugs(void);
17+
extern void check_other_bugs(void);
1718
#else
1819
#define check_bugs() do { } while (0)
20+
#define check_other_bugs() do { } while (0)
1921
#endif
2022

2123
#endif

‎arch/arm/include/asm/cp15.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
#define __write_sysreg(v, r, w, c, t) asm volatile(w " " c : : "r" ((t)(v)))
6666
#define write_sysreg(v, ...) __write_sysreg(v, __VA_ARGS__)
6767

68+
#define BPIALL __ACCESS_CP15(c7, 0, c5, 6)
69+
#define ICIALLU __ACCESS_CP15(c7, 0, c5, 0)
70+
6871
extern unsigned long cr_alignment; /* defined in entry-armv.S */
6972

7073
static inline unsigned long get_cr(void)

‎arch/arm/include/asm/cputype.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,16 @@
7777
#define ARM_CPU_PART_CORTEX_A12 0x4100c0d0
7878
#define ARM_CPU_PART_CORTEX_A17 0x4100c0e0
7979
#define ARM_CPU_PART_CORTEX_A15 0x4100c0f0
80+
#define ARM_CPU_PART_CORTEX_A53 0x4100d030
81+
#define ARM_CPU_PART_CORTEX_A57 0x4100d070
82+
#define ARM_CPU_PART_CORTEX_A72 0x4100d080
83+
#define ARM_CPU_PART_CORTEX_A73 0x4100d090
84+
#define ARM_CPU_PART_CORTEX_A75 0x4100d0a0
8085
#define ARM_CPU_PART_MASK 0xff00fff0
8186

87+
/* Broadcom cores */
88+
#define ARM_CPU_PART_BRAHMA_B15 0x420000f0
89+
8290
/* DEC implemented cores */
8391
#define ARM_CPU_PART_SA1100 0x4400a110
8492

‎arch/arm/include/asm/kgdb.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extern int kgdb_fault_expected;
7777

7878
#define KGDB_MAX_NO_CPUS 1
7979
#define BUFMAX 400
80-
#define NUMREGBYTES (DBG_MAX_REG_NUM << 2)
80+
#define NUMREGBYTES (GDB_MAX_REGS << 2)
8181
#define NUMCRITREGBYTES (32 << 2)
8282

8383
#define _R0 0

‎arch/arm/include/asm/kvm_asm.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ struct kvm_vcpu;
6161
extern char __kvm_hyp_init[];
6262
extern char __kvm_hyp_init_end[];
6363

64-
extern char __kvm_hyp_vector[];
65-
6664
extern void __kvm_flush_vm_context(void);
6765
extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
6866
extern void __kvm_tlb_flush_vmid(struct kvm *kvm);

0 commit comments

Comments
 (0)