From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-6.6 2632/2632] arch/x86/kernel/head64.c:382:12: warning: no previous prototype for 'early_clflush_bss_decrypted_section'
Date: Sun, 3 Aug 2025 08:50:41 +0200 [thread overview]
Message-ID: <202508030825.1WNeA3KA-lkp@intel.com> (raw)
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: e5f0407c7ee0aba1c7b2ab0f516e9dfb707a0ee2
commit: ca0c1fa1ec4b6d9040cec7e543d50a93fc88d4c6 [2632/2632] x86/head/64: Flush caches for .bss..decrypted section after CR3 switches to early_top_pgt
config: x86_64-buildonly-randconfig-2001-20250803 (https://download.01.org/0day-ci/archive/20250803/202508030825.1WNeA3KA-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250803/202508030825.1WNeA3KA-lkp@intel.com/reproduce)
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/202508030825.1WNeA3KA-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 'early_clflush_bss_decrypted_section' [-Wmissing-prototypes]
382 | void __ref early_clflush_bss_decrypted_section(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
reply other threads:[~2025-08-03 6:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202508030825.1WNeA3KA-lkp@intel.com \
--to=lkp@intel.com \
--cc=kernel@openeuler.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.