Skip to content

Commit f7bb168

Browse files
committed
Merge remote-tracking branch 'stable/linux-5.4.y' into rpi-5.4.y
2 parents 576ac4a + b300b28 commit f7bb168

53 files changed

Lines changed: 330 additions & 171 deletions

File tree

Some content is hidden

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

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 5
33
PATCHLEVEL = 4
4-
SUBLEVEL = 73
4+
SUBLEVEL = 74
55
EXTRAVERSION =
66
NAME = Kleptomaniac Octopus
77

‎arch/arm64/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
#
1111
# Copyright (C) 1995-2001 by Russell King
1212

13-
LDFLAGS_vmlinux :=--no-undefined -X
13+
LDFLAGS_vmlinux :=--no-undefined -X -z norelro
1414
CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
1515
GZFLAGS :=-9
1616

1717
ifeq ($(CONFIG_RELOCATABLE), y)
1818
# Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
1919
# for relative relocs, since this leads to better Image compression
2020
# with the relocation offsets always being zero.
21-
LDFLAGS_vmlinux += -shared -Bsymbolic -z notext -z norelro \
21+
LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \
2222
$(call ld-option, --no-apply-dynamic-relocs)
2323
endif
2424

‎arch/arm64/kernel/cpu_errata.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,12 @@ static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,
492492
return required;
493493
}
494494

495+
static void cpu_enable_ssbd_mitigation(const struct arm64_cpu_capabilities *cap)
496+
{
497+
if (ssbd_state != ARM64_SSBD_FORCE_DISABLE)
498+
cap->matches(cap, SCOPE_LOCAL_CPU);
499+
}
500+
495501
/* known invulnerable cores */
496502
static const struct midr_range arm64_ssb_cpus[] = {
497503
MIDR_ALL_VERSIONS(MIDR_CORTEX_A35),
@@ -635,6 +641,12 @@ check_branch_predictor(const struct arm64_cpu_capabilities *entry, int scope)
635641
return (need_wa > 0);
636642
}
637643

644+
static void
645+
cpu_enable_branch_predictor_hardening(const struct arm64_cpu_capabilities *cap)
646+
{
647+
cap->matches(cap, SCOPE_LOCAL_CPU);
648+
}
649+
638650
static const __maybe_unused struct midr_range tx2_family_cpus[] = {
639651
MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN),
640652
MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2),
@@ -894,9 +906,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
894906
},
895907
#endif
896908
{
909+
.desc = "Branch predictor hardening",
897910
.capability = ARM64_HARDEN_BRANCH_PREDICTOR,
898911
.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
899912
.matches = check_branch_predictor,
913+
.cpu_enable = cpu_enable_branch_predictor_hardening,
900914
},
901915
#ifdef CONFIG_HARDEN_EL2_VECTORS
902916
{
@@ -910,6 +924,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
910924
.capability = ARM64_SSBD,
911925
.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
912926
.matches = has_ssbd_mitigation,
927+
.cpu_enable = cpu_enable_ssbd_mitigation,
913928
.midr_range_list = arm64_ssb_cpus,
914929
},
915930
#ifdef CONFIG_ARM64_ERRATUM_1418040

‎arch/openrisc/include/asm/uaccess.h‎

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ struct __large_struct {
164164

165165
#define __get_user_nocheck(x, ptr, size) \
166166
({ \
167-
long __gu_err, __gu_val; \
168-
__get_user_size(__gu_val, (ptr), (size), __gu_err); \
169-
(x) = (__force __typeof__(*(ptr)))__gu_val; \
167+
long __gu_err; \
168+
__get_user_size((x), (ptr), (size), __gu_err); \
170169
__gu_err; \
171170
})
172171

173172
#define __get_user_check(x, ptr, size) \
174173
({ \
175-
long __gu_err = -EFAULT, __gu_val = 0; \
176-
const __typeof__(*(ptr)) * __gu_addr = (ptr); \
177-
if (access_ok(__gu_addr, size)) \
178-
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
179-
(x) = (__force __typeof__(*(ptr)))__gu_val; \
174+
long __gu_err = -EFAULT; \
175+
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
176+
if (access_ok(__gu_addr, size)) \
177+
__get_user_size((x), __gu_addr, (size), __gu_err); \
178+
else \
179+
(x) = (__typeof__(*(ptr))) 0; \
180180
__gu_err; \
181181
})
182182

@@ -190,11 +190,13 @@ do { \
190190
case 2: __get_user_asm(x, ptr, retval, "l.lhz"); break; \
191191
case 4: __get_user_asm(x, ptr, retval, "l.lwz"); break; \
192192
case 8: __get_user_asm2(x, ptr, retval); break; \
193-
default: (x) = __get_user_bad(); \
193+
default: (x) = (__typeof__(*(ptr)))__get_user_bad(); \
194194
} \
195195
} while (0)
196196

197197
#define __get_user_asm(x, addr, err, op) \
198+
{ \
199+
unsigned long __gu_tmp; \
198200
__asm__ __volatile__( \
199201
"1: "op" %1,0(%2)\n" \
200202
"2:\n" \
@@ -208,10 +210,14 @@ do { \
208210
" .align 2\n" \
209211
" .long 1b,3b\n" \
210212
".previous" \
211-
: "=r"(err), "=r"(x) \
212-
: "r"(addr), "i"(-EFAULT), "0"(err))
213+
: "=r"(err), "=r"(__gu_tmp) \
214+
: "r"(addr), "i"(-EFAULT), "0"(err)); \
215+
(x) = (__typeof__(*(addr)))__gu_tmp; \
216+
}
213217

214218
#define __get_user_asm2(x, addr, err) \
219+
{ \
220+
unsigned long long __gu_tmp; \
215221
__asm__ __volatile__( \
216222
"1: l.lwz %1,0(%2)\n" \
217223
"2: l.lwz %H1,4(%2)\n" \
@@ -228,8 +234,11 @@ do { \
228234
" .long 1b,4b\n" \
229235
" .long 2b,4b\n" \
230236
".previous" \
231-
: "=r"(err), "=&r"(x) \
232-
: "r"(addr), "i"(-EFAULT), "0"(err))
237+
: "=r"(err), "=&r"(__gu_tmp) \
238+
: "r"(addr), "i"(-EFAULT), "0"(err)); \
239+
(x) = (__typeof__(*(addr)))( \
240+
(__typeof__((x)-(x)))__gu_tmp); \
241+
}
233242

234243
/* more complex routines */
235244

‎arch/x86/crypto/crc32c-pcl-intel-asm_64.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ continue_block:
170170

171171
## branch into array
172172
lea jump_table(%rip), bufp
173-
movzxw (bufp, %rax, 2), len
173+
movzwq (bufp, %rax, 2), len
174174
lea crc_array(%rip), bufp
175175
lea (bufp, len, 1), bufp
176176
JMP_NOSPEC bufp

‎arch/x86/events/amd/ibs.c‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ struct perf_ibs {
8989
u64 max_period;
9090
unsigned long offset_mask[1];
9191
int offset_max;
92+
unsigned int fetch_count_reset_broken : 1;
9293
struct cpu_perf_ibs __percpu *pcpu;
9394

9495
struct attribute **format_attrs;
@@ -363,7 +364,12 @@ perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event,
363364
static inline void perf_ibs_enable_event(struct perf_ibs *perf_ibs,
364365
struct hw_perf_event *hwc, u64 config)
365366
{
366-
wrmsrl(hwc->config_base, hwc->config | config | perf_ibs->enable_mask);
367+
u64 tmp = hwc->config | config;
368+
369+
if (perf_ibs->fetch_count_reset_broken)
370+
wrmsrl(hwc->config_base, tmp & ~perf_ibs->enable_mask);
371+
372+
wrmsrl(hwc->config_base, tmp | perf_ibs->enable_mask);
367373
}
368374

369375
/*
@@ -733,6 +739,13 @@ static __init void perf_event_ibs_init(void)
733739
{
734740
struct attribute **attr = ibs_op_format_attrs;
735741

742+
/*
743+
* Some chips fail to reset the fetch count when it is written; instead
744+
* they need a 0-1 transition of IbsFetchEn.
745+
*/
746+
if (boot_cpu_data.x86 >= 0x16 && boot_cpu_data.x86 <= 0x18)
747+
perf_ibs_fetch.fetch_count_reset_broken = 1;
748+
736749
perf_ibs_pmu_init(&perf_ibs_fetch, "ibs_fetch");
737750

738751
if (ibs_caps & IBS_CAPS_OPCNT) {

‎arch/x86/pci/intel_mid_pci.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <asm/hw_irq.h>
3434
#include <asm/io_apic.h>
3535
#include <asm/intel-mid.h>
36+
#include <asm/acpi.h>
3637

3738
#define PCIE_CAP_OFFSET 0x100
3839

‎arch/x86/xen/enlighten_pv.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,15 @@ asmlinkage __visible void __init xen_start_kernel(void)
13821382
x86_init.mpparse.get_smp_config = x86_init_uint_noop;
13831383

13841384
xen_boot_params_init_edd();
1385+
1386+
#ifdef CONFIG_ACPI
1387+
/*
1388+
* Disable selecting "Firmware First mode" for correctable
1389+
* memory errors, as this is the duty of the hypervisor to
1390+
* decide.
1391+
*/
1392+
acpi_disable_cmcff = 1;
1393+
#endif
13851394
}
13861395

13871396
if (!boot_params.screen_info.orig_video_isVGA)

‎drivers/ata/ahci.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ enum {
240240
as default lpm_policy */
241241
AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during
242242
suspend/resume */
243+
AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP
244+
from phy_power_on() */
243245

244246
/* ap->flags bits */
245247

‎drivers/ata/ahci_mvebu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = {
227227

228228
static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = {
229229
.plat_config = ahci_mvebu_armada_3700_config,
230-
.flags = AHCI_HFLAG_SUSPEND_PHYS,
230+
.flags = AHCI_HFLAG_SUSPEND_PHYS | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON,
231231
};
232232

233233
static const struct of_device_id ahci_mvebu_of_match[] = {

0 commit comments

Comments
 (0)