diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 4 | ||||
-rw-r--r-- | scripts/coccinelle/api/alloc/alloc_cast.cocci | 8 | ||||
-rw-r--r-- | scripts/coccinelle/api/alloc/zalloc-simple.cocci | 11 | ||||
-rw-r--r-- | scripts/gcc-plugins/arm_ssp_per_task_plugin.c | 23 | ||||
-rw-r--r-- | scripts/kconfig/Makefile | 2 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 2 |
6 files changed, 28 insertions, 22 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 525bff667a52..30816037036e 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -24,10 +24,6 @@ depfile = $(subst $(comma),_,$(dot-target).d) | |||
24 | basetarget = $(basename $(notdir $@)) | 24 | basetarget = $(basename $(notdir $@)) |
25 | 25 | ||
26 | ### | 26 | ### |
27 | # filename of first prerequisite with directory and extension stripped | ||
28 | baseprereq = $(basename $(notdir $<)) | ||
29 | |||
30 | ### | ||
31 | # Escape single quote for use in echo statements | 27 | # Escape single quote for use in echo statements |
32 | escsq = $(subst $(squote),'\$(squote)',$1) | 28 | escsq = $(subst $(squote),'\$(squote)',$1) |
33 | 29 | ||
diff --git a/scripts/coccinelle/api/alloc/alloc_cast.cocci b/scripts/coccinelle/api/alloc/alloc_cast.cocci index 408ee3879f9b..18fedf7c60ed 100644 --- a/scripts/coccinelle/api/alloc/alloc_cast.cocci +++ b/scripts/coccinelle/api/alloc/alloc_cast.cocci | |||
@@ -32,7 +32,7 @@ type T; | |||
32 | (T *) | 32 | (T *) |
33 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| | 33 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| |
34 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| | 34 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| |
35 | dma_alloc_coherent\|dma_zalloc_coherent\|devm_kmalloc\|devm_kzalloc\| | 35 | dma_alloc_coherent\|devm_kmalloc\|devm_kzalloc\| |
36 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| | 36 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| |
37 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| | 37 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| |
38 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) | 38 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) |
@@ -55,7 +55,7 @@ type r1.T; | |||
55 | * (T *) | 55 | * (T *) |
56 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| | 56 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| |
57 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| | 57 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| |
58 | dma_alloc_coherent\|dma_zalloc_coherent\|devm_kmalloc\|devm_kzalloc\| | 58 | dma_alloc_coherent\|devm_kmalloc\|devm_kzalloc\| |
59 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| | 59 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| |
60 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| | 60 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| |
61 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) | 61 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) |
@@ -78,7 +78,7 @@ type r1.T; | |||
78 | - (T *) | 78 | - (T *) |
79 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| | 79 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| |
80 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| | 80 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| |
81 | dma_alloc_coherent\|dma_zalloc_coherent\|devm_kmalloc\|devm_kzalloc\| | 81 | dma_alloc_coherent\|devm_kmalloc\|devm_kzalloc\| |
82 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| | 82 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| |
83 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| | 83 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| |
84 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) | 84 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) |
@@ -95,7 +95,7 @@ position p; | |||
95 | (T@p *) | 95 | (T@p *) |
96 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| | 96 | \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| |
97 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| | 97 | kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|vmalloc\|vzalloc\| |
98 | dma_alloc_coherent\|dma_zalloc_coherent\|devm_kmalloc\|devm_kzalloc\| | 98 | dma_alloc_coherent\|devm_kmalloc\|devm_kzalloc\| |
99 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| | 99 | kvmalloc\|kvzalloc\|kvmalloc_node\|kvzalloc_node\|pci_alloc_consistent\| |
100 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| | 100 | pci_zalloc_consistent\|kmem_alloc\|kmem_zalloc\|kmem_zone_alloc\| |
101 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) | 101 | kmem_zone_zalloc\|vmalloc_node\|vzalloc_node\)(...) |
diff --git a/scripts/coccinelle/api/alloc/zalloc-simple.cocci b/scripts/coccinelle/api/alloc/zalloc-simple.cocci index d819275b7fde..5cd1991c582e 100644 --- a/scripts/coccinelle/api/alloc/zalloc-simple.cocci +++ b/scripts/coccinelle/api/alloc/zalloc-simple.cocci | |||
@@ -69,15 +69,6 @@ statement S; | |||
69 | - x = (T)vmalloc(E1); | 69 | - x = (T)vmalloc(E1); |
70 | + x = (T)vzalloc(E1); | 70 | + x = (T)vzalloc(E1); |
71 | | | 71 | | |
72 | - x = dma_alloc_coherent(E2,E1,E3,E4); | ||
73 | + x = dma_zalloc_coherent(E2,E1,E3,E4); | ||
74 | | | ||
75 | - x = (T *)dma_alloc_coherent(E2,E1,E3,E4); | ||
76 | + x = dma_zalloc_coherent(E2,E1,E3,E4); | ||
77 | | | ||
78 | - x = (T)dma_alloc_coherent(E2,E1,E3,E4); | ||
79 | + x = (T)dma_zalloc_coherent(E2,E1,E3,E4); | ||
80 | | | ||
81 | - x = kmalloc_node(E1,E2,E3); | 72 | - x = kmalloc_node(E1,E2,E3); |
82 | + x = kzalloc_node(E1,E2,E3); | 73 | + x = kzalloc_node(E1,E2,E3); |
83 | | | 74 | | |
@@ -225,7 +216,7 @@ p << r2.p; | |||
225 | x << r2.x; | 216 | x << r2.x; |
226 | @@ | 217 | @@ |
227 | 218 | ||
228 | msg="WARNING: dma_zalloc_coherent should be used for %s, instead of dma_alloc_coherent/memset" % (x) | 219 | msg="WARNING: dma_alloc_coherent use in %s already zeroes out memory, so memset is not needed" % (x) |
229 | coccilib.report.print_report(p[0], msg) | 220 | coccilib.report.print_report(p[0], msg) |
230 | 221 | ||
231 | //----------------------------------------------------------------- | 222 | //----------------------------------------------------------------- |
diff --git a/scripts/gcc-plugins/arm_ssp_per_task_plugin.c b/scripts/gcc-plugins/arm_ssp_per_task_plugin.c index de70b8470971..89c47f57d1ce 100644 --- a/scripts/gcc-plugins/arm_ssp_per_task_plugin.c +++ b/scripts/gcc-plugins/arm_ssp_per_task_plugin.c | |||
@@ -13,7 +13,7 @@ static unsigned int arm_pertask_ssp_rtl_execute(void) | |||
13 | for (insn = get_insns(); insn; insn = NEXT_INSN(insn)) { | 13 | for (insn = get_insns(); insn; insn = NEXT_INSN(insn)) { |
14 | const char *sym; | 14 | const char *sym; |
15 | rtx body; | 15 | rtx body; |
16 | rtx masked_sp; | 16 | rtx mask, masked_sp; |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Find a SET insn involving a SYMBOL_REF to __stack_chk_guard | 19 | * Find a SET insn involving a SYMBOL_REF to __stack_chk_guard |
@@ -33,12 +33,13 @@ static unsigned int arm_pertask_ssp_rtl_execute(void) | |||
33 | * produces the address of the copy of the stack canary value | 33 | * produces the address of the copy of the stack canary value |
34 | * stored in struct thread_info | 34 | * stored in struct thread_info |
35 | */ | 35 | */ |
36 | mask = GEN_INT(sext_hwi(sp_mask, GET_MODE_PRECISION(Pmode))); | ||
36 | masked_sp = gen_reg_rtx(Pmode); | 37 | masked_sp = gen_reg_rtx(Pmode); |
37 | 38 | ||
38 | emit_insn_before(gen_rtx_SET(masked_sp, | 39 | emit_insn_before(gen_rtx_SET(masked_sp, |
39 | gen_rtx_AND(Pmode, | 40 | gen_rtx_AND(Pmode, |
40 | stack_pointer_rtx, | 41 | stack_pointer_rtx, |
41 | GEN_INT(sp_mask))), | 42 | mask)), |
42 | insn); | 43 | insn); |
43 | 44 | ||
44 | SET_SRC(body) = gen_rtx_PLUS(Pmode, masked_sp, | 45 | SET_SRC(body) = gen_rtx_PLUS(Pmode, masked_sp, |
@@ -52,6 +53,19 @@ static unsigned int arm_pertask_ssp_rtl_execute(void) | |||
52 | #define NO_GATE | 53 | #define NO_GATE |
53 | #include "gcc-generate-rtl-pass.h" | 54 | #include "gcc-generate-rtl-pass.h" |
54 | 55 | ||
56 | #if BUILDING_GCC_VERSION >= 9000 | ||
57 | static bool no(void) | ||
58 | { | ||
59 | return false; | ||
60 | } | ||
61 | |||
62 | static void arm_pertask_ssp_start_unit(void *gcc_data, void *user_data) | ||
63 | { | ||
64 | targetm.have_stack_protect_combined_set = no; | ||
65 | targetm.have_stack_protect_combined_test = no; | ||
66 | } | ||
67 | #endif | ||
68 | |||
55 | __visible int plugin_init(struct plugin_name_args *plugin_info, | 69 | __visible int plugin_init(struct plugin_name_args *plugin_info, |
56 | struct plugin_gcc_version *version) | 70 | struct plugin_gcc_version *version) |
57 | { | 71 | { |
@@ -99,5 +113,10 @@ __visible int plugin_init(struct plugin_name_args *plugin_info, | |||
99 | register_callback(plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP, | 113 | register_callback(plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP, |
100 | NULL, &arm_pertask_ssp_rtl_pass_info); | 114 | NULL, &arm_pertask_ssp_rtl_pass_info); |
101 | 115 | ||
116 | #if BUILDING_GCC_VERSION >= 9000 | ||
117 | register_callback(plugin_info->base_name, PLUGIN_START_UNIT, | ||
118 | arm_pertask_ssp_start_unit, NULL); | ||
119 | #endif | ||
120 | |||
102 | return 0; | 121 | return 0; |
103 | } | 122 | } |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index c05ab001b54c..181973509a05 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -206,4 +206,4 @@ filechk_conf_cfg = $(CONFIG_SHELL) $< | |||
206 | $(obj)/%conf-cfg: $(src)/%conf-cfg.sh FORCE | 206 | $(obj)/%conf-cfg: $(src)/%conf-cfg.sh FORCE |
207 | $(call filechk,conf_cfg) | 207 | $(call filechk,conf_cfg) |
208 | 208 | ||
209 | clean-files += conf-cfg | 209 | clean-files += *conf-cfg |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0de2fb236640..26bf886bd168 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -2185,7 +2185,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) | |||
2185 | /* Cannot check for assembler */ | 2185 | /* Cannot check for assembler */ |
2186 | static void add_retpoline(struct buffer *b) | 2186 | static void add_retpoline(struct buffer *b) |
2187 | { | 2187 | { |
2188 | buf_printf(b, "\n#ifdef RETPOLINE\n"); | 2188 | buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); |
2189 | buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); | 2189 | buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); |
2190 | buf_printf(b, "#endif\n"); | 2190 | buf_printf(b, "#endif\n"); |
2191 | } | 2191 | } |