linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tglx-devel:x86/fpu 74/82] arch/x86/kernel/fpu/xstate.c:1314:21: sparse: sparse: incompatible types for operation (==):
@ 2021-10-15 11:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-15 11:24 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4637 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu
head:   fbeb78415a1b32f890fa49e4355faa02bb0c0602
commit: 14b0c6c4efcd1654d291d501cca977f3476a5c10 [74/82] x86/fpu: Add sanity checks for XFD
config: x86_64-randconfig-s032-20211014 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git/commit/?id=14b0c6c4efcd1654d291d501cca977f3476a5c10
        git remote add tglx-devel https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git
        git fetch --no-tags tglx-devel x86/fpu
        git checkout 14b0c6c4efcd1654d291d501cca977f3476a5c10
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kernel/fpu/

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


sparse warnings: (new ones prefixed by >>)
   arch/x86/kernel/fpu/xstate.c:1353:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct lockdep_map const *lock @@     got struct lockdep_map [noderef] __rcu * @@
   arch/x86/kernel/fpu/xstate.c:1353:9: sparse:     expected struct lockdep_map const *lock
   arch/x86/kernel/fpu/xstate.c:1353:9: sparse:     got struct lockdep_map [noderef] __rcu *
   arch/x86/kernel/fpu/xstate.c:1468:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   arch/x86/kernel/fpu/xstate.c:1468:39: sparse:     expected struct spinlock [usertype] *lock
   arch/x86/kernel/fpu/xstate.c:1468:39: sparse:     got struct spinlock [noderef] __rcu *
   arch/x86/kernel/fpu/xstate.c:1471:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   arch/x86/kernel/fpu/xstate.c:1471:41: sparse:     expected struct spinlock [usertype] *lock
   arch/x86/kernel/fpu/xstate.c:1471:41: sparse:     got struct spinlock [noderef] __rcu *
>> arch/x86/kernel/fpu/xstate.c:1314:21: sparse: sparse: incompatible types for operation (==):
>> arch/x86/kernel/fpu/xstate.c:1314:21: sparse:    struct fpstate *fpstate
>> arch/x86/kernel/fpu/xstate.c:1314:21: sparse:    unsigned long long [usertype] xfd

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

  1304	
  1305	#ifdef CONFIG_X86_DEBUG_FPU
  1306	static inline bool xfd_valid(struct fpstate *fpstate, u64 mask, bool rstor)
  1307	{
  1308		u64 xfd = __this_cpu_read(xfd_state);
  1309	
  1310		if (fpstate->xfd == xfd)
  1311			return true;
  1312	
  1313		/* For current's fpstate the XFD state must be correct. */
> 1314		if (fpstate == current->thread.fpu.fpstate->xfd)
  1315			return false;
  1316	
  1317		/*
  1318		 * XRSTOR(S) from init_fpstate are always correct as it will just
  1319		 * bring all components into init state and not read from the
  1320		 * buffer. XSAVE(S) raises #PF after init.
  1321		 */
  1322		if (fpstate == &init_fpstate)
  1323			return rstor;
  1324	
  1325		/*
  1326		 * XSAVE(S): clone(), fpu_swap_kvm_fpu()
  1327		 * XRSTORS(S): fpu_swap_kvm_fpu()
  1328		 */
  1329	
  1330		/* Remove XFD disabled states from the mask. */
  1331		mask &= ~xfd;
  1332		/* Remove features which are valid in fpstate. */
  1333		mask &= ~fpstate->xfeatures;
  1334	
  1335		/*
  1336		 * Mask should be zero now which means no loads/stores
  1337		 * past the end of the register state buffer.
  1338		 */
  1339		return !mask;
  1340	}
  1341	
  1342	void xfd_validate_state(struct fpstate *fpstate, u64 mask, bool rstor)
  1343	{
  1344		WARN_ON_ONCE(!xfd_valid(fpstate, mask, rstor));
  1345	}
  1346	#endif /* CONFIG_X86_DEBUG_FPU */
  1347	
  1348	static int validate_sigaltstack(unsigned int usize)
  1349	{
  1350		struct task_struct *thread, *leader = current->group_leader;
  1351		unsigned long framesize = get_sigframe_size();
  1352	
> 1353		lockdep_assert_held(&current->sighand->siglock);
  1354	
  1355		/* get_sigframe_size() is based on fpu_user_cfg.max_size */
  1356		framesize -= fpu_user_cfg.max_size;
  1357		framesize += usize;
  1358		for_each_thread(leader, thread) {
  1359			if (thread->sas_ss_size && thread->sas_ss_size < framesize)
  1360				return -ENOSPC;
  1361		}
  1362		return 0;
  1363	}
  1364	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34519 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-15 11:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 11:24 [tglx-devel:x86/fpu 74/82] arch/x86/kernel/fpu/xstate.c:1314:21: sparse: sparse: incompatible types for operation (==): kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).