All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yuan Yao <yuan.yao@intel.com>
Cc: 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:718:14: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'unsigned int'
Date: Thu, 9 Jun 2022 20:54:30 +0800	[thread overview]
Message-ID: <202206092038.sxicJCDm-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-tinyconfig (https://download.01.org/0day-ci/archive/20220609/202206092038.sxicJCDm-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # 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
        make 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 >>):

   In file included from include/linux/kernel.h:29,
                    from arch/x86/include/asm/percpu.h:27,
                    from arch/x86/include/asm/current.h:6,
                    from arch/x86/include/asm/processor.h:17,
                    from arch/x86/include/asm/timex.h:5,
                    from include/linux/timex.h:65,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/compat.h:10,
                    from arch/x86/kernel/fpu/xstate.c:8:
   arch/x86/kernel/fpu/xstate.c: In function 'init_xstate_size':
>> arch/x86/kernel/fpu/xstate.c:718:14: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'unsigned int' [-Wformat=]
     718 |              "Too small init_fpstate size:%ld expected:%d\n",
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     719 |              sizeof(init_fpstate_full), kernel_size);
         |              ~~~~~~~~~~~~~~~~~~~~~~~~~
         |              |
         |              unsigned int
   include/linux/printk.h:418:25: note: in definition of macro 'printk_index_wrap'
     418 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ^~~~
   include/linux/printk.h:132:17: note: in expansion of macro 'printk'
     132 |                 printk(fmt, ##__VA_ARGS__);             \
         |                 ^~~~~~
   include/asm-generic/bug.h:175:9: note: in expansion of macro 'no_printk'
     175 |         no_printk(format);                                              \
         |         ^~~~~~~~~
   arch/x86/kernel/fpu/xstate.c:717:9: note: in expansion of macro 'WARN'
     717 |         WARN(kernel_size > sizeof(init_fpstate_full),
         |         ^~~~
   arch/x86/kernel/fpu/xstate.c:718:45: note: format string is defined here
     718 |              "Too small init_fpstate size:%ld expected:%d\n",
         |                                           ~~^
         |                                             |
         |                                             long int
         |                                           %d


vim +718 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 12:54 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=202206092038.sxicJCDm-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=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 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.