[openeuler:OLK-6.6 2229/2229] arch/x86/kernel/head64.c:382:12: warning: no previous prototype for function 'early_clflush_bss_decrypted_section'

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: a53913bacac4876eee9ce118b3101dff842318ef commit: ca0c1fa1ec4b6d9040cec7e543d50a93fc88d4c6 [2229/2229] x86/head/64: Flush caches for .bss..decrypted section after CR3 switches to early_top_pgt config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250515/202505150041.GhGsIYWp-lkp@i...) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) rustc: rustc 1.73.0 (cc66ad468 2023-10-03) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250515/202505150041.GhGsIYWp-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202505150041.GhGsIYWp-lkp@intel.com/ Note: functions only called from assembly code should be annotated with the asmlinkage attribute All warnings (new ones prefixed by >>):
arch/x86/kernel/head64.c:382:12: warning: no previous prototype for function 'early_clflush_bss_decrypted_section' [-Wmissing-prototypes] 382 | void __ref early_clflush_bss_decrypted_section(void) | ^ arch/x86/kernel/head64.c:382:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 382 | void __ref early_clflush_bss_decrypted_section(void) | ^ | static 1 warning generated.
vim +/early_clflush_bss_decrypted_section +382 arch/x86/kernel/head64.c 381
382 void __ref early_clflush_bss_decrypted_section(void) 383 { 384 unsigned long vaddr, vaddr_end; 385 char *cl, *start, *end; 386 387 /* Only allow bsp flush these caches and the bsp must at early boot stage */ 388 if (bsp_flush_bss_decrypted_section_handled) 389 return; 390 391 if (read_cr3_pa() != __pa_nodebug(early_top_pgt)) 392 return; 393 394 /* Only Hygon CSV guest should do the clflush */ 395 if (!__should_do_clflush()) 396 goto handled; 397 398 /* 399 * The memory region of .bss..decrypted section maybe mapped 400 * with encryption in earlier stage. If the correspond stale 401 * caches lives in earlier stage were not flushed before we 402 * access that memory region, then Linux will crash later 403 * because the stale caches will pollute the memory. So we 404 * need flush the caches with encrypted mapping before we 405 * access .bss..decrypted section. 406 * 407 * The function __startup_64() have already filled the 408 * encrypted mapping for .bss..decrypted section, use that 409 * mapping here. 410 */ 411 vaddr = (unsigned long)__start_bss_decrypted - 412 __START_KERNEL_map + phys_base; 413 vaddr_end = (unsigned long)__end_bss_decrypted - 414 __START_KERNEL_map + phys_base; 415 416 /* Hardcode cl-size to 64 at this stage. */ 417 start = (char *)(vaddr & ~63); 418 end = (char *)((vaddr_end + 63) & ~63); 419 420 asm volatile("mfence" : : : "memory"); 421 for (cl = start; cl != end; cl += 64) 422 clflush(cl); 423 asm volatile("mfence" : : : "memory"); 424 425 handled: 426 bsp_flush_bss_decrypted_section_handled = true; 427 } 428 #endif 429
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot