File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 12
12
#include <linux/types.h>
13
13
#include <asm/asm.h>
14
14
15
+ #define HAVE_JUMP_LABEL_BATCH
16
+
15
17
#define JUMP_LABEL_NOP_SIZE 4
16
18
17
19
static __always_inline bool arch_static_branch (struct static_key * const key ,
Original file line number Diff line number Diff line change 9
9
#include <linux/memory.h>
10
10
#include <linux/mutex.h>
11
11
#include <asm/bug.h>
12
+ #include <asm/cacheflush.h>
12
13
#include <asm/patch.h>
13
14
14
15
#define RISCV_INSN_NOP 0x00000013U
15
16
#define RISCV_INSN_JAL 0x0000006fU
16
17
17
- void arch_jump_label_transform (struct jump_entry * entry ,
18
- enum jump_label_type type )
18
+ bool arch_jump_label_transform_queue (struct jump_entry * entry ,
19
+ enum jump_label_type type )
19
20
{
20
21
void * addr = (void * )jump_entry_code (entry );
21
22
u32 insn ;
@@ -24,7 +25,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
24
25
long offset = jump_entry_target (entry ) - jump_entry_code (entry );
25
26
26
27
if (WARN_ON (offset & 1 || offset < -524288 || offset >= 524288 ))
27
- return ;
28
+ return true ;
28
29
29
30
insn = RISCV_INSN_JAL |
30
31
(((u32 )offset & GENMASK (19 , 12 )) << (12 - 12 )) |
@@ -36,6 +37,13 @@ void arch_jump_label_transform(struct jump_entry *entry,
36
37
}
37
38
38
39
mutex_lock (& text_mutex );
39
- patch_text_nosync (addr , & insn , sizeof (insn ));
40
+ patch_insn_write (addr , & insn , sizeof (insn ));
40
41
mutex_unlock (& text_mutex );
42
+
43
+ return true;
44
+ }
45
+
46
+ void arch_jump_label_transform_apply (void )
47
+ {
48
+ flush_icache_all ();
41
49
}
You can’t perform that action at this time.
0 commit comments