Skip to content

Commit 36612d5

Browse files
committed
Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
2 parents 5e64614 + 50961e4 commit 36612d5

File tree

158 files changed

+1210
-486
lines changed

Some content is hidden

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

158 files changed

+1210
-486
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 14
4-
SUBLEVEL = 78
4+
SUBLEVEL = 79
55
EXTRAVERSION =
66
NAME = Petit Gorille
77

@@ -487,6 +487,8 @@ CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
487487
endif
488488
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
489489
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
490+
KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
491+
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
490492
endif
491493

492494
RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
@@ -721,8 +723,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
721723
# See modpost pattern 2
722724
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
723725
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
724-
KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
725-
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
726726
else
727727

728728
# These warnings generated too much noise in a regular build.

arch/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,4 +965,12 @@ config REFCOUNT_FULL
965965
against various use-after-free conditions that can be used in
966966
security flaw exploits.
967967

968+
config HAVE_ARCH_COMPILER_H
969+
bool
970+
help
971+
An architecture can select this if it provides an
972+
asm/compiler.h header that should be included after
973+
linux/compiler-*.h in order to override macro definitions that those
974+
headers generally provide.
975+
968976
source "kernel/gcov/Kconfig"

arch/arm/boot/dts/bcm63138.dtsi

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,23 @@
106106
global_timer: timer@1e200 {
107107
compatible = "arm,cortex-a9-global-timer";
108108
reg = <0x1e200 0x20>;
109-
interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
109+
interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
110110
clocks = <&axi_clk>;
111111
};
112112

113113
local_timer: local-timer@1e600 {
114114
compatible = "arm,cortex-a9-twd-timer";
115115
reg = <0x1e600 0x20>;
116-
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
116+
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
117+
IRQ_TYPE_EDGE_RISING)>;
117118
clocks = <&axi_clk>;
118119
};
119120

120121
twd_watchdog: watchdog@1e620 {
121122
compatible = "arm,cortex-a9-twd-wdt";
122123
reg = <0x1e620 0x20>;
123-
interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>;
124+
interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) |
125+
IRQ_TYPE_LEVEL_HIGH)>;
124126
};
125127

126128
armpll: armpll {
@@ -158,7 +160,7 @@
158160
serial0: serial@600 {
159161
compatible = "brcm,bcm6345-uart";
160162
reg = <0x600 0x1b>;
161-
interrupts = <GIC_SPI 32 0>;
163+
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
162164
clocks = <&periph_clk>;
163165
clock-names = "periph";
164166
status = "disabled";
@@ -167,7 +169,7 @@
167169
serial1: serial@620 {
168170
compatible = "brcm,bcm6345-uart";
169171
reg = <0x620 0x1b>;
170-
interrupts = <GIC_SPI 33 0>;
172+
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
171173
clocks = <&periph_clk>;
172174
clock-names = "periph";
173175
status = "disabled";
@@ -180,7 +182,7 @@
180182
reg = <0x2000 0x600>, <0xf0 0x10>;
181183
reg-names = "nand", "nand-int-base";
182184
status = "disabled";
183-
interrupts = <GIC_SPI 38 0>;
185+
interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
184186
interrupt-names = "nand";
185187
};
186188

arch/arm/boot/dts/imx53-qsb-common.dtsi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@
130130
};
131131
};
132132

133+
&cpu0 {
134+
/* CPU rated to 1GHz, not 1.2GHz as per the default settings */
135+
operating-points = <
136+
/* kHz uV */
137+
166666 850000
138+
400000 900000
139+
800000 1050000
140+
1000000 1200000
141+
>;
142+
};
143+
133144
&esdhc1 {
134145
pinctrl-names = "default";
135146
pinctrl-0 = <&pinctrl_esdhc1>;

arch/arm/boot/dts/r8a7790.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153

154154
trips {
155155
cpu-crit {
156-
temperature = <115000>;
156+
temperature = <95000>;
157157
hysteresis = <0>;
158158
type = "critical";
159159
};

arch/arm/boot/dts/tegra20.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@
706706
phy_type = "ulpi";
707707
clocks = <&tegra_car TEGRA20_CLK_USB2>,
708708
<&tegra_car TEGRA20_CLK_PLL_U>,
709-
<&tegra_car TEGRA20_CLK_CDEV2>;
709+
<&tegra_car TEGRA20_CLK_PLL_P_OUT4>;
710710
clock-names = "reg", "pll_u", "ulpi-link";
711711
resets = <&tegra_car 58>, <&tegra_car 22>;
712712
reset-names = "usb", "utmi-pads";

arch/arm/mm/ioremap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ void pci_ioremap_set_mem_type(int mem_type)
473473

474474
int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
475475
{
476-
BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
476+
BUG_ON(offset + SZ_64K - 1 > IO_SPACE_LIMIT);
477477

478478
return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
479479
PCI_IO_VIRT_BASE + offset + SZ_64K,

arch/arm64/mm/hugetlbpage.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,14 @@ static pte_t get_clear_flush(struct mm_struct *mm,
118118

119119
/*
120120
* If HW_AFDBM is enabled, then the HW could turn on
121-
* the dirty bit for any page in the set, so check
122-
* them all. All hugetlb entries are already young.
121+
* the dirty or accessed bit for any page in the set,
122+
* so check them all.
123123
*/
124124
if (pte_dirty(pte))
125125
orig_pte = pte_mkdirty(orig_pte);
126+
127+
if (pte_young(pte))
128+
orig_pte = pte_mkyoung(orig_pte);
126129
}
127130

128131
if (valid)
@@ -347,10 +350,13 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
347350
if (!pte_same(orig_pte, pte))
348351
changed = 1;
349352

350-
/* Make sure we don't lose the dirty state */
353+
/* Make sure we don't lose the dirty or young state */
351354
if (pte_dirty(orig_pte))
352355
pte = pte_mkdirty(pte);
353356

357+
if (pte_young(orig_pte))
358+
pte = pte_mkyoung(pte);
359+
354360
hugeprot = pte_pgprot(pte);
355361
for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn)
356362
set_pte_at(vma->vm_mm, addr, ptep, pfn_pte(pfn, hugeprot));

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ config MIPS
2929
select GENERIC_SMP_IDLE_THREAD
3030
select GENERIC_TIME_VSYSCALL
3131
select HANDLE_DOMAIN_IRQ
32+
select HAVE_ARCH_COMPILER_H
3233
select HAVE_ARCH_JUMP_LABEL
3334
select HAVE_ARCH_KGDB
3435
select HAVE_ARCH_MMAP_RND_BITS if MMU

arch/mips/include/asm/compiler.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,41 @@
88
#ifndef _ASM_COMPILER_H
99
#define _ASM_COMPILER_H
1010

11+
/*
12+
* With GCC 4.5 onwards we can use __builtin_unreachable to indicate to the
13+
* compiler that a particular code path will never be hit. This allows it to be
14+
* optimised out of the generated binary.
15+
*
16+
* Unfortunately at least GCC 4.6.3 through 7.3.0 inclusive suffer from a bug
17+
* that can lead to instructions from beyond an unreachable statement being
18+
* incorrectly reordered into earlier delay slots if the unreachable statement
19+
* is the only content of a case in a switch statement. This can lead to
20+
* seemingly random behaviour, such as invalid memory accesses from incorrectly
21+
* reordered loads or stores. See this potential GCC fix for details:
22+
*
23+
* https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00360.html
24+
*
25+
* It is unclear whether GCC 8 onwards suffer from the same issue - nothing
26+
* relevant is mentioned in GCC 8 release notes and nothing obviously relevant
27+
* stands out in GCC commit logs, but these newer GCC versions generate very
28+
* different code for the testcase which doesn't exhibit the bug.
29+
*
30+
* GCC also handles stack allocation suboptimally when calling noreturn
31+
* functions or calling __builtin_unreachable():
32+
*
33+
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
34+
*
35+
* We work around both of these issues by placing a volatile asm statement,
36+
* which GCC is prevented from reordering past, prior to __builtin_unreachable
37+
* calls.
38+
*
39+
* The .insn statement is required to ensure that any branches to the
40+
* statement, which sadly must be kept due to the asm statement, are known to
41+
* be branches to code and satisfy linker requirements for microMIPS kernels.
42+
*/
43+
#undef barrier_before_unreachable
44+
#define barrier_before_unreachable() asm volatile(".insn")
45+
1146
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
1247
#define GCC_IMM_ASM() "n"
1348
#define GCC_REG_ACCUM "$0"

arch/powerpc/include/asm/topology.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ static inline int numa_update_cpu_topology(bool cpus_locked)
8181
{
8282
return 0;
8383
}
84+
85+
static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
86+
8487
#endif /* CONFIG_NUMA */
8588

8689
#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)

arch/sparc/mm/tlb.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,10 @@ static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr,
163163
pte_unmap(pte);
164164
}
165165

166-
void set_pmd_at(struct mm_struct *mm, unsigned long addr,
167-
pmd_t *pmdp, pmd_t pmd)
168-
{
169-
pmd_t orig = *pmdp;
170-
171-
*pmdp = pmd;
172166

167+
static void __set_pmd_acct(struct mm_struct *mm, unsigned long addr,
168+
pmd_t orig, pmd_t pmd)
169+
{
173170
if (mm == &init_mm)
174171
return;
175172

@@ -219,6 +216,15 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr,
219216
}
220217
}
221218

219+
void set_pmd_at(struct mm_struct *mm, unsigned long addr,
220+
pmd_t *pmdp, pmd_t pmd)
221+
{
222+
pmd_t orig = *pmdp;
223+
224+
*pmdp = pmd;
225+
__set_pmd_acct(mm, addr, orig, pmd);
226+
}
227+
222228
static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
223229
unsigned long address, pmd_t *pmdp, pmd_t pmd)
224230
{
@@ -227,6 +233,7 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
227233
do {
228234
old = *pmdp;
229235
} while (cmpxchg64(&pmdp->pmd, old.pmd, pmd.pmd) != old.pmd);
236+
__set_pmd_acct(vma->vm_mm, address, old, pmd);
230237

231238
return old;
232239
}

arch/x86/events/amd/uncore.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
static int num_counters_llc;
3737
static int num_counters_nb;
38+
static bool l3_mask;
3839

3940
static HLIST_HEAD(uncore_unused_list);
4041

@@ -208,6 +209,13 @@ static int amd_uncore_event_init(struct perf_event *event)
208209
hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;
209210
hwc->idx = -1;
210211

212+
/*
213+
* SliceMask and ThreadMask need to be set for certain L3 events in
214+
* Family 17h. For other events, the two fields do not affect the count.
215+
*/
216+
if (l3_mask)
217+
hwc->config |= (AMD64_L3_SLICE_MASK | AMD64_L3_THREAD_MASK);
218+
211219
if (event->cpu < 0)
212220
return -EINVAL;
213221

@@ -542,13 +550,15 @@ static int __init amd_uncore_init(void)
542550
amd_llc_pmu.name = "amd_l3";
543551
format_attr_event_df.show = &event_show_df;
544552
format_attr_event_l3.show = &event_show_l3;
553+
l3_mask = true;
545554
} else {
546555
num_counters_nb = NUM_COUNTERS_NB;
547556
num_counters_llc = NUM_COUNTERS_L2;
548557
amd_nb_pmu.name = "amd_nb";
549558
amd_llc_pmu.name = "amd_l2";
550559
format_attr_event_df = format_attr_event;
551560
format_attr_event_l3 = format_attr_event;
561+
l3_mask = false;
552562
}
553563

554564
amd_nb_pmu.attr_groups = amd_uncore_attr_groups_df;

arch/x86/events/intel/uncore_snbep.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,16 +3807,16 @@ static const struct pci_device_id skx_uncore_pci_ids[] = {
38073807
.driver_data = UNCORE_PCI_DEV_FULL_DATA(21, 5, SKX_PCI_UNCORE_M2PCIE, 3),
38083808
},
38093809
{ /* M3UPI0 Link 0 */
3810-
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x204C),
3811-
.driver_data = UNCORE_PCI_DEV_FULL_DATA(18, 0, SKX_PCI_UNCORE_M3UPI, 0),
3810+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x204D),
3811+
.driver_data = UNCORE_PCI_DEV_FULL_DATA(18, 1, SKX_PCI_UNCORE_M3UPI, 0),
38123812
},
38133813
{ /* M3UPI0 Link 1 */
3814-
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x204D),
3815-
.driver_data = UNCORE_PCI_DEV_FULL_DATA(18, 1, SKX_PCI_UNCORE_M3UPI, 1),
3814+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x204E),
3815+
.driver_data = UNCORE_PCI_DEV_FULL_DATA(18, 2, SKX_PCI_UNCORE_M3UPI, 1),
38163816
},
38173817
{ /* M3UPI1 Link 2 */
3818-
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x204C),
3819-
.driver_data = UNCORE_PCI_DEV_FULL_DATA(18, 4, SKX_PCI_UNCORE_M3UPI, 2),
3818+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x204D),
3819+
.driver_data = UNCORE_PCI_DEV_FULL_DATA(18, 5, SKX_PCI_UNCORE_M3UPI, 2),
38203820
},
38213821
{ /* end: all zeroes */ }
38223822
};

arch/x86/include/asm/perf_event.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
#define INTEL_ARCH_EVENT_MASK \
4747
(ARCH_PERFMON_EVENTSEL_UMASK | ARCH_PERFMON_EVENTSEL_EVENT)
4848

49+
#define AMD64_L3_SLICE_SHIFT 48
50+
#define AMD64_L3_SLICE_MASK \
51+
((0xFULL) << AMD64_L3_SLICE_SHIFT)
52+
53+
#define AMD64_L3_THREAD_SHIFT 56
54+
#define AMD64_L3_THREAD_MASK \
55+
((0xFFULL) << AMD64_L3_THREAD_SHIFT)
56+
4957
#define X86_RAW_EVENT_MASK \
5058
(ARCH_PERFMON_EVENTSEL_EVENT | \
5159
ARCH_PERFMON_EVENTSEL_UMASK | \

arch/x86/kernel/paravirt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ unsigned paravirt_patch_call(void *insnbuf,
9090

9191
if (len < 5) {
9292
#ifdef CONFIG_RETPOLINE
93-
WARN_ONCE("Failing to patch indirect CALL in %ps\n", (void *)addr);
93+
WARN_ONCE(1, "Failing to patch indirect CALL in %ps\n", (void *)addr);
9494
#endif
9595
return len; /* call too long for patch site */
9696
}
@@ -110,7 +110,7 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target,
110110

111111
if (len < 5) {
112112
#ifdef CONFIG_RETPOLINE
113-
WARN_ONCE("Failing to patch indirect JMP in %ps\n", (void *)addr);
113+
WARN_ONCE(1, "Failing to patch indirect JMP in %ps\n", (void *)addr);
114114
#endif
115115
return len; /* call too long for patch site */
116116
}

arch/x86/kvm/paging_tmpl.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,21 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
452452
* done by is_rsvd_bits_set() above.
453453
*
454454
* We set up the value of exit_qualification to inject:
455-
* [2:0] - Derive from [2:0] of real exit_qualification at EPT violation
455+
* [2:0] - Derive from the access bits. The exit_qualification might be
456+
* out of date if it is serving an EPT misconfiguration.
456457
* [5:3] - Calculated by the page walk of the guest EPT page tables
457458
* [7:8] - Derived from [7:8] of real exit_qualification
458459
*
459460
* The other bits are set to 0.
460461
*/
461462
if (!(errcode & PFERR_RSVD_MASK)) {
462-
vcpu->arch.exit_qualification &= 0x187;
463+
vcpu->arch.exit_qualification &= 0x180;
464+
if (write_fault)
465+
vcpu->arch.exit_qualification |= EPT_VIOLATION_ACC_WRITE;
466+
if (user_fault)
467+
vcpu->arch.exit_qualification |= EPT_VIOLATION_ACC_READ;
468+
if (fetch_fault)
469+
vcpu->arch.exit_qualification |= EPT_VIOLATION_ACC_INSTR;
463470
vcpu->arch.exit_qualification |= (pte_access & 0x7) << 3;
464471
}
465472
#endif

0 commit comments

Comments
 (0)