Skip to content

Commit 545cb71

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.6.y' into rpi-6.6.y
2 parents a452251 + c2e4205 commit 545cb71

File tree

141 files changed

+1041
-535
lines changed

Some content is hidden

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

141 files changed

+1041
-535
lines changed

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 = 6
33
PATCHLEVEL = 6
4-
SUBLEVEL = 70
4+
SUBLEVEL = 72
55
EXTRAVERSION =
66
NAME = Pinguïn Aangedreven
77

arch/arm/boot/dts/nxp/imx/imxrt1050.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
reg = <0x402c0000 0x4000>;
8888
interrupts = <110>;
8989
clocks = <&clks IMXRT1050_CLK_IPG_PDOF>,
90-
<&clks IMXRT1050_CLK_OSC>,
90+
<&clks IMXRT1050_CLK_AHB_PODF>,
9191
<&clks IMXRT1050_CLK_USDHC1>;
9292
clock-names = "ipg", "ahb", "per";
9393
bus-width = <4>;

arch/arm64/boot/dts/rockchip/rk3328.dtsi

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

305305
power-domain@RK3328_PD_HEVC {
306306
reg = <RK3328_PD_HEVC>;
307+
clocks = <&cru SCLK_VENC_CORE>;
307308
#power-domain-cells = <0>;
308309
};
309310
power-domain@RK3328_PD_VIDEO {

arch/riscv/include/asm/cacheflush.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ static inline void local_flush_icache_all(void)
1313
asm volatile ("fence.i" ::: "memory");
1414
}
1515

16+
static inline void local_flush_icache_range(unsigned long start,
17+
unsigned long end)
18+
{
19+
local_flush_icache_all();
20+
}
21+
1622
#define PG_dcache_clean PG_arch_1
1723

1824
static inline void flush_dcache_folio(struct folio *folio)

arch/riscv/include/asm/page.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ struct kernel_mapping {
122122

123123
extern struct kernel_mapping kernel_map;
124124
extern phys_addr_t phys_ram_base;
125+
extern unsigned long vmemmap_start_pfn;
125126

126127
#define is_kernel_mapping(x) \
127128
((x) >= kernel_map.virt_addr && (x) < (kernel_map.virt_addr + kernel_map.size))

arch/riscv/include/asm/patch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef _ASM_RISCV_PATCH_H
77
#define _ASM_RISCV_PATCH_H
88

9+
int patch_insn_write(void *addr, const void *insn, size_t len);
910
int patch_text_nosync(void *addr, const void *insns, size_t len);
1011
int patch_text_set_nosync(void *addr, u8 c, size_t len);
1112
int patch_text(void *addr, u32 *insns, int ninsns);

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
* Define vmemmap for pfn_to_page & page_to_pfn calls. Needed if kernel
8585
* is configured with CONFIG_SPARSEMEM_VMEMMAP enabled.
8686
*/
87-
#define vmemmap ((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT))
87+
#define vmemmap ((struct page *)VMEMMAP_START - vmemmap_start_pfn)
8888

8989
#define PCI_IO_SIZE SZ_16M
9090
#define PCI_IO_END VMEMMAP_START

arch/riscv/kernel/ftrace.c

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/ftrace.h>
99
#include <linux/uaccess.h>
1010
#include <linux/memory.h>
11+
#include <linux/stop_machine.h>
1112
#include <asm/cacheflush.h>
1213
#include <asm/patch.h>
1314

@@ -75,8 +76,7 @@ static int __ftrace_modify_call(unsigned long hook_pos, unsigned long target,
7576
make_call_t0(hook_pos, target, call);
7677

7778
/* Replace the auipc-jalr pair at once. Return -EPERM on write error. */
78-
if (patch_text_nosync
79-
((void *)hook_pos, enable ? call : nops, MCOUNT_INSN_SIZE))
79+
if (patch_insn_write((void *)hook_pos, enable ? call : nops, MCOUNT_INSN_SIZE))
8080
return -EPERM;
8181

8282
return 0;
@@ -88,7 +88,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
8888

8989
make_call_t0(rec->ip, addr, call);
9090

91-
if (patch_text_nosync((void *)rec->ip, call, MCOUNT_INSN_SIZE))
91+
if (patch_insn_write((void *)rec->ip, call, MCOUNT_INSN_SIZE))
9292
return -EPERM;
9393

9494
return 0;
@@ -99,7 +99,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
9999
{
100100
unsigned int nops[2] = {NOP4, NOP4};
101101

102-
if (patch_text_nosync((void *)rec->ip, nops, MCOUNT_INSN_SIZE))
102+
if (patch_insn_write((void *)rec->ip, nops, MCOUNT_INSN_SIZE))
103103
return -EPERM;
104104

105105
return 0;
@@ -120,6 +120,9 @@ int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec)
120120
out = ftrace_make_nop(mod, rec, MCOUNT_ADDR);
121121
mutex_unlock(&text_mutex);
122122

123+
if (!mod)
124+
local_flush_icache_range(rec->ip, rec->ip + MCOUNT_INSN_SIZE);
125+
123126
return out;
124127
}
125128

@@ -134,6 +137,42 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
134137

135138
return ret;
136139
}
140+
141+
struct ftrace_modify_param {
142+
int command;
143+
atomic_t cpu_count;
144+
};
145+
146+
static int __ftrace_modify_code(void *data)
147+
{
148+
struct ftrace_modify_param *param = data;
149+
150+
if (atomic_inc_return(&param->cpu_count) == num_online_cpus()) {
151+
ftrace_modify_all_code(param->command);
152+
/*
153+
* Make sure the patching store is effective *before* we
154+
* increment the counter which releases all waiting CPUs
155+
* by using the release variant of atomic increment. The
156+
* release pairs with the call to local_flush_icache_all()
157+
* on the waiting CPU.
158+
*/
159+
atomic_inc_return_release(&param->cpu_count);
160+
} else {
161+
while (atomic_read(&param->cpu_count) <= num_online_cpus())
162+
cpu_relax();
163+
}
164+
165+
local_flush_icache_all();
166+
167+
return 0;
168+
}
169+
170+
void arch_ftrace_update_code(int command)
171+
{
172+
struct ftrace_modify_param param = { command, ATOMIC_INIT(0) };
173+
174+
stop_machine(__ftrace_modify_code, &param, cpu_online_mask);
175+
}
137176
#endif
138177

139178
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS

arch/riscv/kernel/patch.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ int patch_text_set_nosync(void *addr, u8 c, size_t len)
196196
}
197197
NOKPROBE_SYMBOL(patch_text_set_nosync);
198198

199-
static int patch_insn_write(void *addr, const void *insn, size_t len)
199+
int patch_insn_write(void *addr, const void *insn, size_t len)
200200
{
201201
size_t patched = 0;
202202
size_t size;
@@ -240,16 +240,24 @@ static int patch_text_cb(void *data)
240240
if (atomic_inc_return(&patch->cpu_count) == num_online_cpus()) {
241241
for (i = 0; ret == 0 && i < patch->ninsns; i++) {
242242
len = GET_INSN_LENGTH(patch->insns[i]);
243-
ret = patch_text_nosync(patch->addr + i * len,
244-
&patch->insns[i], len);
243+
ret = patch_insn_write(patch->addr + i * len, &patch->insns[i], len);
245244
}
246-
atomic_inc(&patch->cpu_count);
245+
/*
246+
* Make sure the patching store is effective *before* we
247+
* increment the counter which releases all waiting CPUs
248+
* by using the release variant of atomic increment. The
249+
* release pairs with the call to local_flush_icache_all()
250+
* on the waiting CPU.
251+
*/
252+
atomic_inc_return_release(&patch->cpu_count);
247253
} else {
248254
while (atomic_read(&patch->cpu_count) <= num_online_cpus())
249255
cpu_relax();
250256
smp_mb();
251257
}
252258

259+
local_flush_icache_all();
260+
253261
return ret;
254262
}
255263
NOKPROBE_SYMBOL(patch_text_cb);

arch/riscv/kernel/probes/kprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void __kprobes arch_prepare_ss_slot(struct kprobe *p)
2929
p->ainsn.api.restore = (unsigned long)p->addr + offset;
3030

3131
patch_text_nosync(p->ainsn.api.insn, &p->opcode, 1);
32-
patch_text_nosync(p->ainsn.api.insn + offset, &insn, 1);
32+
patch_text_nosync((void *)p->ainsn.api.insn + offset, &insn, 1);
3333
}
3434

3535
static void __kprobes arch_prepare_simulate(struct kprobe *p)

0 commit comments

Comments
 (0)