public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yuan Yao <yuan.yao@intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Isaku Yamahata <isaku.yamahata@intel.com>
Subject: [intel-tdx:kvm-upstream-workaround 449/453] arch/x86/kernel/fpu/xstate.c:719:7: warning: format specifies type 'long' but the argument has type 'unsigned int'
Date: Fri, 10 Jun 2022 01:55:31 +0800	[thread overview]
Message-ID: <202206100124.87NJ8YRo-lkp@intel.com> (raw)

tree:   https://github.com/intel/tdx.git kvm-upstream-workaround
head:   64f3ddf316eab9398414b94e62a01d185e6e94c8
commit: c00f6297349a8d81049eefe338ee079179787e28 [449/453] X86: FPU: Fix unexpected #PF while executing XRSTORS
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220610/202206100124.87NJ8YRo-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 971e13d69e3e7b687213fef22952be6a328c426c)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel/tdx/commit/c00f6297349a8d81049eefe338ee079179787e28
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx kvm-upstream-workaround
        git checkout c00f6297349a8d81049eefe338ee079179787e28
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/fpu/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/fpu/xstate.c:719:7: warning: format specifies type 'long' but the argument has type 'unsigned int' [-Wformat]
                sizeof(init_fpstate_full), kernel_size);
                ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:133:29: note: expanded from macro 'WARN'
                   __WARN_printf(TAINT_WARN, format);                      \
                                             ^~~~~~
   include/asm-generic/bug.h:105:17: note: expanded from macro '__WARN_printf'
                   __warn_printk(arg);                                     \
                                 ^~~
   1 warning generated.


vim +719 arch/x86/kernel/fpu/xstate.c

   685	
   686	static int __init init_xstate_size(void)
   687	{
   688		/* Recompute the context size for enabled features: */
   689		unsigned int user_size, kernel_size, kernel_default_size;
   690		bool compacted = cpu_feature_enabled(X86_FEATURE_XSAVES);
   691	
   692		/* Uncompacted user space size */
   693		user_size = get_xsave_size_user();
   694	
   695		/*
   696		 * XSAVES kernel size includes supervisor states and
   697		 * uses compacted format when available.
   698		 *
   699		 * XSAVE does not support supervisor states so
   700		 * kernel and user size is identical.
   701		 */
   702		if (compacted)
   703			kernel_size = get_xsaves_size_no_independent();
   704		else
   705			kernel_size = user_size;
   706	
   707		kernel_default_size =
   708			xstate_calculate_size(fpu_kernel_cfg.default_features, compacted);
   709	
   710		/* Ensure we have the space to store all default enabled features. */
   711		if (!is_supported_xstate_size(kernel_default_size))
   712			return -EINVAL;
   713	
   714		if (!paranoid_xstate_size_valid(kernel_size))
   715			return -EINVAL;
   716	
   717		WARN(kernel_size > sizeof(init_fpstate_full),
   718		     "Too small init_fpstate size:%ld expected:%d\n",
 > 719		     sizeof(init_fpstate_full), kernel_size);
   720	
   721		fpu_kernel_cfg.max_size = kernel_size;
   722		fpu_user_cfg.max_size = user_size;
   723	
   724		fpu_kernel_cfg.default_size = kernel_default_size;
   725		fpu_user_cfg.default_size =
   726			xstate_calculate_size(fpu_user_cfg.default_features, false);
   727	
   728		return 0;
   729	}
   730	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-06-09 17:55 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=202206100124.87NJ8YRo-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=yuan.yao@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox