Skip to content

Commit c50d1fa

Browse files
authored
Merge pull request torvalds#175 from zandrey/5.4.x+fslc
Update 5.4.x+fslc to v5.4.78
2 parents e2f51de + cc2d9cf commit c50d1fa

File tree

177 files changed

+1740
-783
lines changed

Some content is hidden

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

177 files changed

+1740
-783
lines changed

Documentation/networking/j1939.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ Send:
414414
.can_family = AF_CAN,
415415
.can_addr.j1939 = {
416416
.name = J1939_NO_NAME;
417-
.pgn = 0x30,
418-
.addr = 0x12300,
417+
.addr = 0x30,
418+
.pgn = 0x12300,
419419
},
420420
};
421421

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 = 77
4+
SUBLEVEL = 78
55
EXTRAVERSION =
66
NAME = Kleptomaniac Octopus
77

arch/arm/include/asm/kprobes.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ int kprobe_exceptions_notify(struct notifier_block *self,
4444
unsigned long val, void *data);
4545

4646
/* optinsn template addresses */
47-
extern __visible kprobe_opcode_t optprobe_template_entry;
48-
extern __visible kprobe_opcode_t optprobe_template_val;
49-
extern __visible kprobe_opcode_t optprobe_template_call;
50-
extern __visible kprobe_opcode_t optprobe_template_end;
51-
extern __visible kprobe_opcode_t optprobe_template_sub_sp;
52-
extern __visible kprobe_opcode_t optprobe_template_add_sp;
53-
extern __visible kprobe_opcode_t optprobe_template_restore_begin;
54-
extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn;
55-
extern __visible kprobe_opcode_t optprobe_template_restore_end;
47+
extern __visible kprobe_opcode_t optprobe_template_entry[];
48+
extern __visible kprobe_opcode_t optprobe_template_val[];
49+
extern __visible kprobe_opcode_t optprobe_template_call[];
50+
extern __visible kprobe_opcode_t optprobe_template_end[];
51+
extern __visible kprobe_opcode_t optprobe_template_sub_sp[];
52+
extern __visible kprobe_opcode_t optprobe_template_add_sp[];
53+
extern __visible kprobe_opcode_t optprobe_template_restore_begin[];
54+
extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn[];
55+
extern __visible kprobe_opcode_t optprobe_template_restore_end[];
5656

5757
#define MAX_OPTIMIZED_LENGTH 4
5858
#define MAX_OPTINSN_SIZE \
59-
((unsigned long)&optprobe_template_end - \
60-
(unsigned long)&optprobe_template_entry)
59+
((unsigned long)optprobe_template_end - \
60+
(unsigned long)optprobe_template_entry)
6161
#define RELATIVEJUMP_SIZE 4
6262

6363
struct arch_optimized_insn {

arch/arm/probes/kprobes/opt-arm.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,21 @@ asm (
8585
"optprobe_template_end:\n");
8686

8787
#define TMPL_VAL_IDX \
88-
((unsigned long *)&optprobe_template_val - (unsigned long *)&optprobe_template_entry)
88+
((unsigned long *)optprobe_template_val - (unsigned long *)optprobe_template_entry)
8989
#define TMPL_CALL_IDX \
90-
((unsigned long *)&optprobe_template_call - (unsigned long *)&optprobe_template_entry)
90+
((unsigned long *)optprobe_template_call - (unsigned long *)optprobe_template_entry)
9191
#define TMPL_END_IDX \
92-
((unsigned long *)&optprobe_template_end - (unsigned long *)&optprobe_template_entry)
92+
((unsigned long *)optprobe_template_end - (unsigned long *)optprobe_template_entry)
9393
#define TMPL_ADD_SP \
94-
((unsigned long *)&optprobe_template_add_sp - (unsigned long *)&optprobe_template_entry)
94+
((unsigned long *)optprobe_template_add_sp - (unsigned long *)optprobe_template_entry)
9595
#define TMPL_SUB_SP \
96-
((unsigned long *)&optprobe_template_sub_sp - (unsigned long *)&optprobe_template_entry)
96+
((unsigned long *)optprobe_template_sub_sp - (unsigned long *)optprobe_template_entry)
9797
#define TMPL_RESTORE_BEGIN \
98-
((unsigned long *)&optprobe_template_restore_begin - (unsigned long *)&optprobe_template_entry)
98+
((unsigned long *)optprobe_template_restore_begin - (unsigned long *)optprobe_template_entry)
9999
#define TMPL_RESTORE_ORIGN_INSN \
100-
((unsigned long *)&optprobe_template_restore_orig_insn - (unsigned long *)&optprobe_template_entry)
100+
((unsigned long *)optprobe_template_restore_orig_insn - (unsigned long *)optprobe_template_entry)
101101
#define TMPL_RESTORE_END \
102-
((unsigned long *)&optprobe_template_restore_end - (unsigned long *)&optprobe_template_entry)
102+
((unsigned long *)optprobe_template_restore_end - (unsigned long *)optprobe_template_entry)
103103

104104
/*
105105
* ARM can always optimize an instruction when using ARM ISA, except
@@ -234,7 +234,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
234234
}
235235

236236
/* Copy arch-dep-instance from template. */
237-
memcpy(code, (unsigned long *)&optprobe_template_entry,
237+
memcpy(code, (unsigned long *)optprobe_template_entry,
238238
TMPL_END_IDX * sizeof(kprobe_opcode_t));
239239

240240
/* Adjust buffer according to instruction. */

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,16 +1132,6 @@ static unsigned int sve_visibility(const struct kvm_vcpu *vcpu,
11321132
return REG_HIDDEN_USER | REG_HIDDEN_GUEST;
11331133
}
11341134

1135-
/* Visibility overrides for SVE-specific ID registers */
1136-
static unsigned int sve_id_visibility(const struct kvm_vcpu *vcpu,
1137-
const struct sys_reg_desc *rd)
1138-
{
1139-
if (vcpu_has_sve(vcpu))
1140-
return 0;
1141-
1142-
return REG_HIDDEN_USER;
1143-
}
1144-
11451135
/* Generate the emulated ID_AA64ZFR0_EL1 value exposed to the guest */
11461136
static u64 guest_id_aa64zfr0_el1(const struct kvm_vcpu *vcpu)
11471137
{
@@ -1168,9 +1158,6 @@ static int get_id_aa64zfr0_el1(struct kvm_vcpu *vcpu,
11681158
{
11691159
u64 val;
11701160

1171-
if (WARN_ON(!vcpu_has_sve(vcpu)))
1172-
return -ENOENT;
1173-
11741161
val = guest_id_aa64zfr0_el1(vcpu);
11751162
return reg_to_user(uaddr, &val, reg->id);
11761163
}
@@ -1183,9 +1170,6 @@ static int set_id_aa64zfr0_el1(struct kvm_vcpu *vcpu,
11831170
int err;
11841171
u64 val;
11851172

1186-
if (WARN_ON(!vcpu_has_sve(vcpu)))
1187-
return -ENOENT;
1188-
11891173
err = reg_from_user(&val, uaddr, id);
11901174
if (err)
11911175
return err;
@@ -1448,7 +1432,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
14481432
ID_SANITISED(ID_AA64PFR1_EL1),
14491433
ID_UNALLOCATED(4,2),
14501434
ID_UNALLOCATED(4,3),
1451-
{ SYS_DESC(SYS_ID_AA64ZFR0_EL1), access_id_aa64zfr0_el1, .get_user = get_id_aa64zfr0_el1, .set_user = set_id_aa64zfr0_el1, .visibility = sve_id_visibility },
1435+
{ SYS_DESC(SYS_ID_AA64ZFR0_EL1), access_id_aa64zfr0_el1, .get_user = get_id_aa64zfr0_el1, .set_user = set_id_aa64zfr0_el1, },
14521436
ID_UNALLOCATED(4,5),
14531437
ID_UNALLOCATED(4,6),
14541438
ID_UNALLOCATED(4,7),

arch/powerpc/kernel/eeh_cache.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,17 @@ static int eeh_addr_cache_show(struct seq_file *s, void *v)
272272
{
273273
struct pci_io_addr_range *piar;
274274
struct rb_node *n;
275+
unsigned long flags;
275276

276-
spin_lock(&pci_io_addr_cache_root.piar_lock);
277+
spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
277278
for (n = rb_first(&pci_io_addr_cache_root.rb_root); n; n = rb_next(n)) {
278279
piar = rb_entry(n, struct pci_io_addr_range, rb_node);
279280

280281
seq_printf(s, "%s addr range [%pap-%pap]: %s\n",
281282
(piar->flags & IORESOURCE_IO) ? "i/o" : "mem",
282283
&piar->addr_lo, &piar->addr_hi, pci_name(piar->pcidev));
283284
}
284-
spin_unlock(&pci_io_addr_cache_root.piar_lock);
285+
spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
285286

286287
return 0;
287288
}

arch/powerpc/kernel/head_32.S

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,7 @@ InstructionTLBMiss:
418418
cmplw 0,r1,r3
419419
#endif
420420
mfspr r2, SPRN_SPRG_PGDIR
421-
#ifdef CONFIG_SWAP
422421
li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
423-
#else
424-
li r1,_PAGE_PRESENT | _PAGE_EXEC
425-
#endif
426422
#if defined(CONFIG_MODULES) || defined(CONFIG_DEBUG_PAGEALLOC)
427423
bge- 112f
428424
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
@@ -484,11 +480,7 @@ DataLoadTLBMiss:
484480
lis r1,PAGE_OFFSET@h /* check if kernel address */
485481
cmplw 0,r1,r3
486482
mfspr r2, SPRN_SPRG_PGDIR
487-
#ifdef CONFIG_SWAP
488483
li r1, _PAGE_PRESENT | _PAGE_ACCESSED
489-
#else
490-
li r1, _PAGE_PRESENT
491-
#endif
492484
bge- 112f
493485
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
494486
addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */
@@ -564,11 +556,7 @@ DataStoreTLBMiss:
564556
lis r1,PAGE_OFFSET@h /* check if kernel address */
565557
cmplw 0,r1,r3
566558
mfspr r2, SPRN_SPRG_PGDIR
567-
#ifdef CONFIG_SWAP
568559
li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED
569-
#else
570-
li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT
571-
#endif
572560
bge- 112f
573561
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
574562
addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */

arch/riscv/kernel/head.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ ENTRY(_start)
2626
/* reserved */
2727
.word 0
2828
.balign 8
29+
#ifdef CONFIG_RISCV_M_MODE
30+
/* Image load offset (0MB) from start of RAM for M-mode */
31+
.dword 0
32+
#else
2933
#if __riscv_xlen == 64
3034
/* Image load offset(2MB) from start of RAM */
3135
.dword 0x200000
3236
#else
3337
/* Image load offset(4MB) from start of RAM */
3438
.dword 0x400000
39+
#endif
3540
#endif
3641
/* Effective size of kernel image */
3742
.dword _end - _start

arch/s390/kernel/smp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,13 +845,14 @@ void __init smp_detect_cpus(void)
845845

846846
static void smp_init_secondary(void)
847847
{
848-
int cpu = smp_processor_id();
848+
int cpu = raw_smp_processor_id();
849849

850850
S390_lowcore.last_update_clock = get_tod_clock();
851851
restore_access_regs(S390_lowcore.access_regs_save_area);
852852
set_cpu_flag(CIF_ASCE_PRIMARY);
853853
set_cpu_flag(CIF_ASCE_SECONDARY);
854854
cpu_init();
855+
rcu_cpu_starting(cpu);
855856
preempt_disable();
856857
init_cpu_timer();
857858
vtime_init();

arch/x86/kernel/cpu/bugs.c

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,24 +1252,41 @@ static int ssb_prctl_set(struct task_struct *task, unsigned long ctrl)
12521252
return 0;
12531253
}
12541254

1255+
static bool is_spec_ib_user_controlled(void)
1256+
{
1257+
return spectre_v2_user_ibpb == SPECTRE_V2_USER_PRCTL ||
1258+
spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
1259+
spectre_v2_user_stibp == SPECTRE_V2_USER_PRCTL ||
1260+
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP;
1261+
}
1262+
12551263
static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
12561264
{
12571265
switch (ctrl) {
12581266
case PR_SPEC_ENABLE:
12591267
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
12601268
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
12611269
return 0;
1262-
/*
1263-
* Indirect branch speculation is always disabled in strict
1264-
* mode. It can neither be enabled if it was force-disabled
1265-
* by a previous prctl call.
12661270

1271+
/*
1272+
* With strict mode for both IBPB and STIBP, the instruction
1273+
* code paths avoid checking this task flag and instead,
1274+
* unconditionally run the instruction. However, STIBP and IBPB
1275+
* are independent and either can be set to conditionally
1276+
* enabled regardless of the mode of the other.
1277+
*
1278+
* If either is set to conditional, allow the task flag to be
1279+
* updated, unless it was force-disabled by a previous prctl
1280+
* call. Currently, this is possible on an AMD CPU which has the
1281+
* feature X86_FEATURE_AMD_STIBP_ALWAYS_ON. In this case, if the
1282+
* kernel is booted with 'spectre_v2_user=seccomp', then
1283+
* spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP and
1284+
* spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED.
12671285
*/
1268-
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
1269-
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
1270-
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED ||
1286+
if (!is_spec_ib_user_controlled() ||
12711287
task_spec_ib_force_disable(task))
12721288
return -EPERM;
1289+
12731290
task_clear_spec_ib_disable(task);
12741291
task_update_spec_tif(task);
12751292
break;
@@ -1282,10 +1299,10 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
12821299
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
12831300
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
12841301
return -EPERM;
1285-
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
1286-
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
1287-
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
1302+
1303+
if (!is_spec_ib_user_controlled())
12881304
return 0;
1305+
12891306
task_set_spec_ib_disable(task);
12901307
if (ctrl == PR_SPEC_FORCE_DISABLE)
12911308
task_set_spec_ib_force_disable(task);
@@ -1350,20 +1367,17 @@ static int ib_prctl_get(struct task_struct *task)
13501367
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
13511368
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
13521369
return PR_SPEC_ENABLE;
1353-
else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
1354-
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
1355-
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
1356-
return PR_SPEC_DISABLE;
1357-
else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_PRCTL ||
1358-
spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
1359-
spectre_v2_user_stibp == SPECTRE_V2_USER_PRCTL ||
1360-
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP) {
1370+
else if (is_spec_ib_user_controlled()) {
13611371
if (task_spec_ib_force_disable(task))
13621372
return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE;
13631373
if (task_spec_ib_disable(task))
13641374
return PR_SPEC_PRCTL | PR_SPEC_DISABLE;
13651375
return PR_SPEC_PRCTL | PR_SPEC_ENABLE;
1366-
} else
1376+
} else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
1377+
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
1378+
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
1379+
return PR_SPEC_DISABLE;
1380+
else
13671381
return PR_SPEC_NOT_AFFECTED;
13681382
}
13691383

0 commit comments

Comments
 (0)