All of lore.kernel.org
 help / color / mirror / Atom feed
* [peterz-queue:x86/ibt 5/8] arch/x86/kernel/traps.c:136:21: error: implicit declaration of function 'X86_MODRB_RM'; did you mean 'X86_MODRM_RM'?
@ 2024-11-17  4:43 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-17  4:43 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/ibt
head:   72c0a686dca37ac0f2ed213b2be9487ae091bb99
commit: 3b8ca79166ffec0c374f9efa2f30946f335c3442 [5/8] x86/traps: Cleanup and robustify decode_bug()
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20241117/202411171237.YTh4fEM8-lkp@intel.com/config)
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/20241117/202411171237.YTh4fEM8-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/oe-kbuild-all/202411171237.YTh4fEM8-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/x86/kernel/traps.c: In function 'decode_bug':
>> arch/x86/kernel/traps.c:136:21: error: implicit declaration of function 'X86_MODRB_RM'; did you mean 'X86_MODRM_RM'? [-Werror=implicit-function-declaration]
     136 |         case 0: if (X86_MODRB_RM(v) == 5)
         |                     ^~~~~~~~~~~~
         |                     X86_MODRM_RM
   cc1: some warnings being treated as errors


vim +136 arch/x86/kernel/traps.c

    94	
    95	/*
    96	 * Check for UD1 or UD2, accounting for Address Size Override Prefixes.
    97	 * If it's a UD1, further decode to determine its use:
    98	 *
    99	 * UBSan{0}:     67 0f b9 00             ud1    (%eax),%eax
   100	 * UBSan{10}:    67 0f b9 40 10          ud1    0x10(%eax),%eax
   101	 * static_call:  0f b9 cc                ud1    %esp,%ecx
   102	 *
   103	 * Notably UBSAN uses EAX, static_call uses ECX.
   104	 */
   105	__always_inline int decode_bug(unsigned long addr, s32 *imm, int *len)
   106	{
   107		unsigned long start = addr;
   108		u8 v;
   109	
   110		if (addr < TASK_SIZE_MAX)
   111			return BUG_NONE;
   112	
   113		v = *(u8 *)(addr++);
   114		if (v == INSN_ASOP)
   115			v = *(u8 *)(addr++);
   116		if (v != OPCODE_ESCAPE)
   117			return BUG_NONE;
   118	
   119		v = *(u8 *)(addr++);
   120		if (v == SECOND_BYTE_OPCODE_UD2) {
   121			*len = addr - start;
   122			return BUG_UD2;
   123		}
   124	
   125		if (v != SECOND_BYTE_OPCODE_UD1)
   126			return BUG_NONE;
   127	
   128		*imm = 0;
   129		v = *(u8 *)(addr++);		/* ModRM */
   130	
   131		if (X86_MODRM_MOD(v) != 3 && X86_MODRM_RM(v) == 4)
   132			addr++;			/* SIB */
   133	
   134		/* Decode immediate, if present */
   135		switch (X86_MODRM_MOD(v)) {
 > 136		case 0: if (X86_MODRB_RM(v) == 5)
   137				addr += 4; /* RIP + disp32 */
   138			break;
   139	
   140		case 1: *imm = *(s8 *)addr;
   141			addr += 1;
   142			break;
   143	
   144		case 2: *imm = *(s32 *)addr;
   145			addr += 4;
   146			break;
   147	
   148		case 3: break;
   149		}
   150	
   151		/* record instruction length */
   152		*len = addr - start;
   153	
   154		if (X86_MODRM_REG(v) == 0)	/* EAX */
   155			return BUG_UD1_UBSAN;
   156	
   157		return BUG_UD1;
   158	}
   159	

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

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

only message in thread, other threads:[~2024-11-17  4:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17  4:43 [peterz-queue:x86/ibt 5/8] arch/x86/kernel/traps.c:136:21: error: implicit declaration of function 'X86_MODRB_RM'; did you mean 'X86_MODRM_RM'? 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.