Skip to content

Commit 50c01da

Browse files
committed
Merge tag 'v5.10.106' into linux-5.10-mchp
This is the 5.10.106 stable release Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2 parents b8738fa + 327f1e7 commit 50c01da

80 files changed

Lines changed: 743 additions & 398 deletions

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 = 10
4-
SUBLEVEL = 105
4+
SUBLEVEL = 106
55
EXTRAVERSION = -linux4microchip-2021.10
66
NAME = Dare mighty things
77

arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
};
119119

120120
pinctrl_fwqspid_default: fwqspid_default {
121-
function = "FWQSPID";
121+
function = "FWSPID";
122122
groups = "FWQSPID";
123123
};
124124

arch/arm/boot/dts/bcm2711.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@
290290

291291
hvs: hvs@7e400000 {
292292
compatible = "brcm,bcm2711-hvs";
293+
reg = <0x7e400000 0x8000>;
293294
interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
294295
};
295296

arch/arm/include/asm/spectre.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ enum {
2525
SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
2626
};
2727

28+
#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
2829
void spectre_v2_update_state(unsigned int state, unsigned int methods);
30+
#else
31+
static inline void spectre_v2_update_state(unsigned int state,
32+
unsigned int methods)
33+
{}
34+
#endif
2935

3036
int spectre_bhb_update_vectors(unsigned int method);
3137

arch/arm/kernel/entry-armv.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,9 @@ vector_bhb_loop8_\name:
10431043

10441044
@ bhb workaround
10451045
mov r0, #8
1046-
1: b . + 4
1046+
3: b . + 4
10471047
subs r0, r0, #1
1048-
bne 1b
1048+
bne 3b
10491049
dsb
10501050
isb
10511051
b 2b

arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
aliases {
2020
spi0 = &spi0;
21+
ethernet0 = &eth0;
2122
ethernet1 = &eth1;
2223
mmc0 = &sdhci0;
2324
mmc1 = &sdhci1;
@@ -137,7 +138,9 @@
137138
/*
138139
* U-Boot port for Turris Mox has a bug which always expects that "ranges" DT property
139140
* contains exactly 2 ranges with 3 (child) address cells, 2 (parent) address cells and
140-
* 2 size cells and also expects that the second range starts at 16 MB offset. If these
141+
* 2 size cells and also expects that the second range starts at 16 MB offset. Also it
142+
* expects that first range uses same address for PCI (child) and CPU (parent) cells (so
143+
* no remapping) and that this address is the lowest from all specified ranges. If these
141144
* conditions are not met then U-Boot crashes during loading kernel DTB file. PCIe address
142145
* space is 128 MB long, so the best split between MEM and IO is to use fixed 16 MB window
143146
* for IO and the rest 112 MB (64+32+16) for MEM, despite that maximal IO size is just 64 kB.
@@ -146,6 +149,9 @@
146149
* https://source.denx.de/u-boot/u-boot/-/commit/cb2ddb291ee6fcbddd6d8f4ff49089dfe580f5d7
147150
* https://source.denx.de/u-boot/u-boot/-/commit/c64ac3b3185aeb3846297ad7391fc6df8ecd73bf
148151
* https://source.denx.de/u-boot/u-boot/-/commit/4a82fca8e330157081fc132a591ebd99ba02ee33
152+
* Bug related to requirement of same child and parent addresses for first range is fixed
153+
* in U-Boot version 2022.04 by following commit:
154+
* https://source.denx.de/u-boot/u-boot/-/commit/1fd54253bca7d43d046bba4853fe5fafd034bc17
149155
*/
150156
#address-cells = <3>;
151157
#size-cells = <2>;

arch/arm64/boot/dts/marvell/armada-37xx.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@
495495
* (totaling 127 MiB) for MEM.
496496
*/
497497
ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x07f00000 /* Port 0 MEM */
498-
0x81000000 0 0xefff0000 0 0xefff0000 0 0x00010000>; /* Port 0 IO */
498+
0x81000000 0 0x00000000 0 0xefff0000 0 0x00010000>; /* Port 0 IO */
499499
interrupt-map-mask = <0 0 0 7>;
500500
interrupt-map = <0 0 0 1 &pcie_intc 0>,
501501
<0 0 0 2 &pcie_intc 1>,

arch/riscv/kernel/module.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
#include <linux/pgtable.h>
1414
#include <asm/sections.h>
1515

16+
/*
17+
* The auipc+jalr instruction pair can reach any PC-relative offset
18+
* in the range [-2^31 - 2^11, 2^31 - 2^11)
19+
*/
20+
static bool riscv_insn_valid_32bit_offset(ptrdiff_t val)
21+
{
22+
#ifdef CONFIG_32BIT
23+
return true;
24+
#else
25+
return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11));
26+
#endif
27+
}
28+
1629
static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v)
1730
{
1831
if (v != (u32)v) {
@@ -95,7 +108,7 @@ static int apply_r_riscv_pcrel_hi20_rela(struct module *me, u32 *location,
95108
ptrdiff_t offset = (void *)v - (void *)location;
96109
s32 hi20;
97110

98-
if (offset != (s32)offset) {
111+
if (!riscv_insn_valid_32bit_offset(offset)) {
99112
pr_err(
100113
"%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",
101114
me->name, (long long)v, location);
@@ -197,10 +210,9 @@ static int apply_r_riscv_call_plt_rela(struct module *me, u32 *location,
197210
Elf_Addr v)
198211
{
199212
ptrdiff_t offset = (void *)v - (void *)location;
200-
s32 fill_v = offset;
201213
u32 hi20, lo12;
202214

203-
if (offset != fill_v) {
215+
if (!riscv_insn_valid_32bit_offset(offset)) {
204216
/* Only emit the plt entry if offset over 32-bit range */
205217
if (IS_ENABLED(CONFIG_MODULE_SECTIONS)) {
206218
offset = module_emit_plt_entry(me, v);
@@ -224,10 +236,9 @@ static int apply_r_riscv_call_rela(struct module *me, u32 *location,
224236
Elf_Addr v)
225237
{
226238
ptrdiff_t offset = (void *)v - (void *)location;
227-
s32 fill_v = offset;
228239
u32 hi20, lo12;
229240

230-
if (offset != fill_v) {
241+
if (!riscv_insn_valid_32bit_offset(offset)) {
231242
pr_err(
232243
"%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",
233244
me->name, (long long)v, location);

arch/x86/kernel/e820.c

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -995,15 +995,25 @@ early_param("memmap", parse_memmap_opt);
995995
*/
996996
void __init e820__reserve_setup_data(void)
997997
{
998+
struct setup_indirect *indirect;
998999
struct setup_data *data;
999-
u64 pa_data;
1000+
u64 pa_data, pa_next;
1001+
u32 len;
10001002

10011003
pa_data = boot_params.hdr.setup_data;
10021004
if (!pa_data)
10031005
return;
10041006

10051007
while (pa_data) {
10061008
data = early_memremap(pa_data, sizeof(*data));
1009+
if (!data) {
1010+
pr_warn("e820: failed to memremap setup_data entry\n");
1011+
return;
1012+
}
1013+
1014+
len = sizeof(*data);
1015+
pa_next = data->next;
1016+
10071017
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
10081018

10091019
/*
@@ -1015,18 +1025,27 @@ void __init e820__reserve_setup_data(void)
10151025
sizeof(*data) + data->len,
10161026
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
10171027

1018-
if (data->type == SETUP_INDIRECT &&
1019-
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) {
1020-
e820__range_update(((struct setup_indirect *)data->data)->addr,
1021-
((struct setup_indirect *)data->data)->len,
1022-
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
1023-
e820__range_update_kexec(((struct setup_indirect *)data->data)->addr,
1024-
((struct setup_indirect *)data->data)->len,
1025-
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
1028+
if (data->type == SETUP_INDIRECT) {
1029+
len += data->len;
1030+
early_memunmap(data, sizeof(*data));
1031+
data = early_memremap(pa_data, len);
1032+
if (!data) {
1033+
pr_warn("e820: failed to memremap indirect setup_data\n");
1034+
return;
1035+
}
1036+
1037+
indirect = (struct setup_indirect *)data->data;
1038+
1039+
if (indirect->type != SETUP_INDIRECT) {
1040+
e820__range_update(indirect->addr, indirect->len,
1041+
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
1042+
e820__range_update_kexec(indirect->addr, indirect->len,
1043+
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
1044+
}
10261045
}
10271046

1028-
pa_data = data->next;
1029-
early_memunmap(data, sizeof(*data));
1047+
pa_data = pa_next;
1048+
early_memunmap(data, len);
10301049
}
10311050

10321051
e820__update_table(e820_table);

arch/x86/kernel/kdebugfs.c

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ create_setup_data_node(struct dentry *parent, int no,
8888

8989
static int __init create_setup_data_nodes(struct dentry *parent)
9090
{
91+
struct setup_indirect *indirect;
9192
struct setup_data_node *node;
9293
struct setup_data *data;
93-
int error;
94+
u64 pa_data, pa_next;
9495
struct dentry *d;
95-
u64 pa_data;
96+
int error;
97+
u32 len;
9698
int no = 0;
9799

98100
d = debugfs_create_dir("setup_data", parent);
@@ -112,20 +114,37 @@ static int __init create_setup_data_nodes(struct dentry *parent)
112114
error = -ENOMEM;
113115
goto err_dir;
114116
}
115-
116-
if (data->type == SETUP_INDIRECT &&
117-
((struct setup_indirect *)data->data)->type != SETUP_INDIRECT) {
118-
node->paddr = ((struct setup_indirect *)data->data)->addr;
119-
node->type = ((struct setup_indirect *)data->data)->type;
120-
node->len = ((struct setup_indirect *)data->data)->len;
117+
pa_next = data->next;
118+
119+
if (data->type == SETUP_INDIRECT) {
120+
len = sizeof(*data) + data->len;
121+
memunmap(data);
122+
data = memremap(pa_data, len, MEMREMAP_WB);
123+
if (!data) {
124+
kfree(node);
125+
error = -ENOMEM;
126+
goto err_dir;
127+
}
128+
129+
indirect = (struct setup_indirect *)data->data;
130+
131+
if (indirect->type != SETUP_INDIRECT) {
132+
node->paddr = indirect->addr;
133+
node->type = indirect->type;
134+
node->len = indirect->len;
135+
} else {
136+
node->paddr = pa_data;
137+
node->type = data->type;
138+
node->len = data->len;
139+
}
121140
} else {
122141
node->paddr = pa_data;
123142
node->type = data->type;
124143
node->len = data->len;
125144
}
126145

127146
create_setup_data_node(d, no, node);
128-
pa_data = data->next;
147+
pa_data = pa_next;
129148

130149
memunmap(data);
131150
no++;

0 commit comments

Comments
 (0)