All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] selftests: Fix cpuid / vendor checking build issues
@ 2024-08-29 13:16 Ilpo Järvinen
  2024-08-29 13:16 ` [PATCH v3 1/3] selftests/resctrl: Generalize non-contiguous CAT check Ilpo Järvinen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ilpo Järvinen @ 2024-08-29 13:16 UTC (permalink / raw)
  To: Muhammad Usama Anjum, Shuah Khan, Reinette Chatre,
	linux-kselftest
  Cc: linux-kernel, Shaopeng Tan, Fenghua Yu,
	Maciej Wieczór-Retman, Ilpo Järvinen

This series first generalizes resctrl selftest non-contiguous CAT check
to not assume non-AMD vendor implies Intel. Second, it improves
kselftest common parts and resctrl selftest such that the use of
__cpuid_count() does not lead into a build failure (happens at least on
ARM).

While ARM does not currently support resctrl features, there's an
ongoing work to enable resctrl support also for it on the kernel side.
In any case, a common header such as kselftest.h should have a proper
fallback in place for what it provides, thus it seems justified to fix
this common level problem on the common level rather than e.g.
disabling build for resctrl selftest for archs lacking resctrl support.

I've dropped reviewed and tested by tags from the last patch due to
major changes into the makefile logic. So it would be helpful if
Muhammad could retest with this version.

v3:
- Remove "empty" wording
- Also cast input parameters to void
- Initialize ARCH from uname -m if not set (this might allow cleaning
  up some other makefiles but that is left as future work)

v2:
- Removed RFC from the last patch & added Fixes and tags
- Fixed the error message's line splits
- Noted down the reason for void casts in the stub

Ilpo Järvinen (3):
  selftests/resctrl: Generalize non-contiguous CAT check
  selftests/resctrl: Always initialize ecx to avoid build warnings
  kselftest: Provide __cpuid_count() stub on non-x86 archs

 tools/testing/selftests/kselftest.h        |  6 +++++
 tools/testing/selftests/lib.mk             |  6 +++++
 tools/testing/selftests/resctrl/cat_test.c | 28 +++++++++++++---------
 3 files changed, 29 insertions(+), 11 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs
@ 2024-09-01  2:07 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2024-09-01  2:07 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240829131657.1917-4-ilpo.jarvinen@linux.intel.com>
References: <20240829131657.1917-4-ilpo.jarvinen@linux.intel.com>
TO: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>

Hi Ilpo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on shuah-kselftest/next]
[also build test WARNING on shuah-kselftest/fixes linus/master v6.11-rc5 next-20240830]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ilpo-J-rvinen/selftests-resctrl-Generalize-non-contiguous-CAT-check/20240829-212248
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
patch link:    https://lore.kernel.org/r/20240829131657.1917-4-ilpo.jarvinen%40linux.intel.com
patch subject: [PATCH v3 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240901/202409010931.Xl6TB9hc-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/r/202409010931.Xl6TB9hc-lkp@intel.com/

All warnings (new ones prefixed by >>):

   corrupt_xstate_header.c: In function 'xsave_enabled':
>> corrupt_xstate_header.c:29:20: warning: 'ecx' is used uninitialized [-Wuninitialized]
      29 |         return ecx & (1U << 27);
         |                ~~~~^~~~~~~~~~~~
   corrupt_xstate_header.c:24:32: note: 'ecx' was declared here
      24 |         unsigned int eax, ebx, ecx, edx;
         |                                ^~~
--
   amx.c: In function 'check_cpuid_xtiledata':
>> amx.c:123:19: warning: 'ebx' is used uninitialized [-Wuninitialized]
     123 |         xbuf_size = ebx;
         |         ~~~~~~~~~~^~~~~
   amx.c:111:23: note: 'ebx' was declared here
     111 |         uint32_t eax, ebx, ecx, edx;
         |                       ^~~
>> amx.c:131:13: warning: 'eax' is used uninitialized [-Wuninitialized]
     131 |         if (!eax || !ebx)
         |             ^~~~
   amx.c:111:18: note: 'eax' was declared here
     111 |         uint32_t eax, ebx, ecx, edx;
         |                  ^~~
--
   lam.c: In function 'cpu_has_lam':
>> lam.c:124:24: warning: 'cpuinfo' is used uninitialized [-Wuninitialized]
     124 |         return (cpuinfo[0] & (1 << 26));
         |                 ~~~~~~~^~~
   lam.c:120:22: note: 'cpuinfo' declared here
     120 |         unsigned int cpuinfo[4];
         |                      ^~~~~~~
   lam.c: In function 'cpu_has_la57':
   lam.c:134:24: warning: 'cpuinfo' is used uninitialized [-Wuninitialized]
     134 |         return (cpuinfo[2] & (1 << 16));
         |                 ~~~~~~~^~~
   lam.c:130:22: note: 'cpuinfo' declared here
     130 |         unsigned int cpuinfo[4];
         |                      ^~~~~~~


vim +/ecx +29 tools/testing/selftests/x86/corrupt_xstate_header.c

b7c11876d24bdd7 Andy Lutomirski 2021-06-08  21  
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  22  static inline int xsave_enabled(void)
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  23  {
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  24  	unsigned int eax, ebx, ecx, edx;
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  25  
170d1c23f2a3569 Reinette Chatre 2022-04-25  26  	__cpuid_count(0x1, 0x0, eax, ebx, ecx, edx);
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  27  
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  28  	/* Is CR4.OSXSAVE enabled ? */
b7c11876d24bdd7 Andy Lutomirski 2021-06-08 @29  	return ecx & (1U << 27);
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  30  }
b7c11876d24bdd7 Andy Lutomirski 2021-06-08  31  

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

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

end of thread, other threads:[~2024-09-03  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 13:16 [PATCH v3 0/3] selftests: Fix cpuid / vendor checking build issues Ilpo Järvinen
2024-08-29 13:16 ` [PATCH v3 1/3] selftests/resctrl: Generalize non-contiguous CAT check Ilpo Järvinen
2024-08-29 13:16 ` [PATCH v3 2/3] selftests/resctrl: Always initialize ecx to avoid build warnings Ilpo Järvinen
2024-08-29 13:16 ` [PATCH v3 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs Ilpo Järvinen
2024-09-01  5:06   ` kernel test robot
2024-09-03  9:57   ` Ilpo Järvinen
  -- strict thread matches above, loose matches on Subject: below --
2024-09-01  2:07 kernel test robot

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.