Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [ardb:for-kernelci 15/18] arch/x86/boot/startup/sev-startup.c:141:15: error: '__section__' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties
@ 2025-05-08 16:19 kernel test robot
  2025-05-08 16:50 ` Ard Biesheuvel
  0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2025-05-08 16:19 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git for-kernelci
head:   f309d115ff0674e0ce4fe010e587d40bfb5b6e4e
commit: 54ae382c92b4521365fde402a792038b968188f8 [15/18] x86/boot: Move startup code out of __head section
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250509/202505090001.FS7smjqJ-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250509/202505090001.FS7smjqJ-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/202505090001.FS7smjqJ-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> arch/x86/boot/startup/sev-startup.c:141:15: error: '__section__' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties
     141 | static struct __init cc_blob_sev_info *find_cc_blob(struct boot_params *bp)
         |               ^
   include/linux/init.h:52:17: note: expanded from macro '__init'
      52 | #define __init          __section(".init.text") __cold  __latent_entropy __noinitretpoline
         |                         ^
   include/linux/compiler_attributes.h:321:56: note: expanded from macro '__section'
     321 | #define __section(section)              __attribute__((__section__(section)))
         |                                                        ^
>> arch/x86/boot/startup/sev-startup.c:141:15: warning: '__cold__' attribute only applies to functions [-Wignored-attributes]
   include/linux/init.h:52:41: note: expanded from macro '__init'
      52 | #define __init          __section(".init.text") __cold  __latent_entropy __noinitretpoline
         |                                                 ^
   include/linux/compiler_types.h:113:34: note: expanded from macro '__cold'
     113 | #define __cold                          __attribute__((__cold__))
         |                                                        ^
   1 warning and 1 error generated.


vim +/__section__ +141 arch/x86/boot/startup/sev-startup.c

   127	
   128	/*
   129	 * Initial set up of SNP relies on information provided by the
   130	 * Confidential Computing blob, which can be passed to the kernel
   131	 * in the following ways, depending on how it is booted:
   132	 *
   133	 * - when booted via the boot/decompress kernel:
   134	 *   - via boot_params
   135	 *
   136	 * - when booted directly by firmware/bootloader (e.g. CONFIG_PVH):
   137	 *   - via a setup_data entry, as defined by the Linux Boot Protocol
   138	 *
   139	 * Scan for the blob in that order.
   140	 */
 > 141	static struct __init cc_blob_sev_info *find_cc_blob(struct boot_params *bp)
   142	{
   143		struct cc_blob_sev_info *cc_info;
   144	
   145		/* Boot kernel would have passed the CC blob via boot_params. */
   146		if (bp->cc_blob_address) {
   147			cc_info = (struct cc_blob_sev_info *)(unsigned long)bp->cc_blob_address;
   148			goto found_cc_info;
   149		}
   150	
   151		/*
   152		 * If kernel was booted directly, without the use of the
   153		 * boot/decompression kernel, the CC blob may have been passed via
   154		 * setup_data instead.
   155		 */
   156		cc_info = find_cc_blob_setup_data(bp);
   157		if (!cc_info)
   158			return NULL;
   159	
   160	found_cc_info:
   161		if (cc_info->magic != CC_BLOB_SEV_HDR_MAGIC)
   162			snp_abort();
   163	
   164		return cc_info;
   165	}
   166	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-08 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 16:19 [ardb:for-kernelci 15/18] arch/x86/boot/startup/sev-startup.c:141:15: error: '__section__' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties kernel test robot
2025-05-08 16:50 ` Ard Biesheuvel
2025-05-08 16:57   ` Nathan Chancellor
2025-05-08 17:22     ` Ard Biesheuvel
2025-05-08 17:22       ` Ard Biesheuvel
2025-05-08 17:39       ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox