Commit 12bb40b
riscv: patch: skip fixmap mapping when kernel text is already writable
Currently patch_map() always creates a temporary writable mapping via
fixmap for kernel text addresses, even when CONFIG_STRICT_MODULE_RWX
is disabled and the kernel text is already mapped with _PAGE_WRITE.
This is unnecessary overhead at best, and on minimal configurations
it can cause page faults.
Skip the fixmap path for kernel text when CONFIG_STRICT_MODULE_RWX
is not enabled, since the text pages are already writable in this case.
Signed-off-by: Xiaofeng Yuan <xiaofengmian@163.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>1 parent 6832114 commit 12bb40b
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | | - | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
55 | | - | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
0 commit comments