Re: [PATCH] x86/asm/bitops: Change function return types from long to int

From: kernel test robot
Date: Sat May 25 2024 - 23:56:59 EST


Hi Thorsten,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 0b32d436c015d5a88b3368405e3d8fe82f195a54]

url: https://github.com/intel-lab-lkp/linux/commits/Thorsten-Blum/x86-asm-bitops-Change-function-return-types-from-long-to-int/20240526-014828
base: 0b32d436c015d5a88b3368405e3d8fe82f195a54
patch link: https://lore.kernel.org/r/20240525174448.174824-2-thorsten.blum%40toblux.com
patch subject: [PATCH] x86/asm/bitops: Change function return types from long to int
config: x86_64-randconfig-121-20240526 (https://download.01.org/0day-ci/archive/20240526/202405261132.5bA1MUEH-lkp@xxxxxxxxx/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240526/202405261132.5bA1MUEH-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405261132.5bA1MUEH-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
arch/x86/kvm/emulate.c:5105:21: sparse: sparse: arithmetics on pointers to functions
arch/x86/kvm/emulate.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/mm.h, ...):
include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false
include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false
>> arch/x86/kvm/emulate.c:5105:49: sparse: sparse: non size-preserving pointer to integer cast
>> arch/x86/kvm/emulate.c:5105:49: sparse: sparse: non size-preserving integer to pointer cast

vim +5105 arch/x86/kvm/emulate.c

cbe2c9d30aa69b Avi Kivity 2012-04-09 5099
3009afc6e39e78 Sean Christopherson 2020-01-21 5100 static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop)
e28bbd44dad134 Avi Kivity 2013-01-04 5101 {
e28bbd44dad134 Avi Kivity 2013-01-04 5102 ulong flags = (ctxt->eflags & EFLAGS_MASK) | X86_EFLAGS_IF;
4548f63e651164 Josh Poimboeuf 2016-03-09 5103
b9fa409b00a1ed Avi Kivity 2013-02-09 5104 if (!(ctxt->d & ByteOp))
e28bbd44dad134 Avi Kivity 2013-01-04 @5105 fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE;
4548f63e651164 Josh Poimboeuf 2016-03-09 5106
1a29b5b7f347a1 Peter Zijlstra 2018-01-25 5107 asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf; pop %[flags]\n"
b8c0b6ae498fe5 Avi Kivity 2013-02-09 5108 : "+a"(ctxt->dst.val), "+d"(ctxt->src.val), [flags]"+D"(flags),
1a29b5b7f347a1 Peter Zijlstra 2018-01-25 5109 [thunk_target]"+S"(fop), ASM_CALL_CONSTRAINT
b8c0b6ae498fe5 Avi Kivity 2013-02-09 5110 : "c"(ctxt->src2.val));
4548f63e651164 Josh Poimboeuf 2016-03-09 5111
e28bbd44dad134 Avi Kivity 2013-01-04 5112 ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);
b8c0b6ae498fe5 Avi Kivity 2013-02-09 5113 if (!fop) /* exception is returned in fop variable */
b8c0b6ae498fe5 Avi Kivity 2013-02-09 5114 return emulate_de(ctxt);
e28bbd44dad134 Avi Kivity 2013-01-04 5115 return X86EMUL_CONTINUE;
e28bbd44dad134 Avi Kivity 2013-01-04 5116 }
dd856efafe6097 Avi Kivity 2012-08-27 5117

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