Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/its: Fix build errors when CONFIG_MODULES=n

Fix several build errors when CONFIG_MODULES=n, including the following:

../arch/x86/kernel/alternative.c:195:25: error: incomplete definition of type 'struct module'
195 | for (int i = 0; i < mod->its_num_pages; i++) {

Fixes: 872df34d7c51 ("x86/its: Use dynamic thunks for indirect branches")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Eric Biggers and committed by
Linus Torvalds
9f35e331 405e6c37

+6
+6
arch/x86/kernel/alternative.c
··· 133 133 134 134 #ifdef CONFIG_MITIGATION_ITS 135 135 136 + #ifdef CONFIG_MODULES 136 137 static struct module *its_mod; 138 + #endif 137 139 static void *its_page; 138 140 static unsigned int its_offset; 139 141 ··· 173 171 return thunk + offset; 174 172 } 175 173 174 + #ifdef CONFIG_MODULES 176 175 void its_init_mod(struct module *mod) 177 176 { 178 177 if (!cpu_feature_enabled(X86_FEATURE_INDIRECT_THUNK_ITS)) ··· 212 209 } 213 210 kfree(mod->its_page_array); 214 211 } 212 + #endif /* CONFIG_MODULES */ 215 213 216 214 static void *its_alloc(void) 217 215 { ··· 221 217 if (!page) 222 218 return NULL; 223 219 220 + #ifdef CONFIG_MODULES 224 221 if (its_mod) { 225 222 void *tmp = krealloc(its_mod->its_page_array, 226 223 (its_mod->its_num_pages+1) * sizeof(void *), ··· 234 229 235 230 execmem_make_temp_rw(page, PAGE_SIZE); 236 231 } 232 + #endif /* CONFIG_MODULES */ 237 233 238 234 return no_free_ptr(page); 239 235 }