[ammarfaizi2-block:stable/linux-stable-rc/queue/5.15 176/176] arch/x86/mm/extable.c:200:9: error: duplicate case value

From: kernel test robot
Date: Tue Jul 26 2022 - 01:05:49 EST


tree: https://github.com/ammarfaizi2/linux-block stable/linux-stable-rc/queue/5.15
head: 9780829ed8d15de556424bed96704c95dfc357f6
commit: 9780829ed8d15de556424bed96704c95dfc357f6 [176/176] x86/extable: Provide EX_TYPE_DEFAULT_MCE_SAFE and EX_TYPE_FAULT_MCE_SAFE
config: x86_64-randconfig-c002 (https://download.01.org/0day-ci/archive/20220726/202207261212.h1KDeJ11-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/ammarfaizi2/linux-block/commit/9780829ed8d15de556424bed96704c95dfc357f6
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block stable/linux-stable-rc/queue/5.15
git checkout 9780829ed8d15de556424bed96704c95dfc357f6
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from arch/x86/include/asm/asm.h:125,
from arch/x86/include/asm/alternative.h:7,
from arch/x86/include/asm/bitops.h:17,
from include/linux/bitops.h:33,
from include/linux/kernel.h:12,
from arch/x86/include/asm/percpu.h:27,
from arch/x86/include/asm/current.h:6,
from include/linux/sched.h:12,
from include/linux/uaccess.h:8,
from arch/x86/mm/extable.c:3:
arch/x86/include/asm/extable_fixup_types.h:49: warning: "EX_TYPE_DEFAULT_MCE_SAFE" redefined
49 | #define EX_TYPE_DEFAULT_MCE_SAFE 12
|
arch/x86/include/asm/extable_fixup_types.h:42: note: this is the location of the previous definition
42 | #define EX_TYPE_DEFAULT_MCE_SAFE 14
|
arch/x86/include/asm/extable_fixup_types.h:50: warning: "EX_TYPE_FAULT_MCE_SAFE" redefined
50 | #define EX_TYPE_FAULT_MCE_SAFE 13
|
arch/x86/include/asm/extable_fixup_types.h:43: note: this is the location of the previous definition
43 | #define EX_TYPE_FAULT_MCE_SAFE 15
|
arch/x86/mm/extable.c: In function 'fixup_exception':
>> arch/x86/mm/extable.c:200:9: error: duplicate case value
200 | case EX_TYPE_WRMSR_IN_MCE:
| ^~~~
arch/x86/mm/extable.c:177:9: note: previously used here
177 | case EX_TYPE_DEFAULT_MCE_SAFE:
| ^~~~
arch/x86/mm/extable.c:203:9: error: duplicate case value
203 | case EX_TYPE_RDMSR_IN_MCE:
| ^~~~
arch/x86/mm/extable.c:180:9: note: previously used here
180 | case EX_TYPE_FAULT_MCE_SAFE:
| ^~~~


vim +200 arch/x86/mm/extable.c

6d48583ba9ade6 Harvey Harrison 2008-01-30 166
548acf19234dbd Tony Luck 2016-02-17 167 e = search_exception_tables(regs->ip);
548acf19234dbd Tony Luck 2016-02-17 168 if (!e)
6d48583ba9ade6 Harvey Harrison 2008-01-30 169 return 0;
548acf19234dbd Tony Luck 2016-02-17 170
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 171 type = FIELD_GET(EX_DATA_TYPE_MASK, e->data);
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 172 reg = FIELD_GET(EX_DATA_REG_MASK, e->data);
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 173 imm = FIELD_GET(EX_DATA_IMM_MASK, e->data);
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 174
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 175 switch (type) {
f6647d25769d7d Thomas Gleixner 2021-09-08 176 case EX_TYPE_DEFAULT:
fd96c41f8fa7b6 Thomas Gleixner 2021-09-08 177 case EX_TYPE_DEFAULT_MCE_SAFE:
f6647d25769d7d Thomas Gleixner 2021-09-08 178 return ex_handler_default(e, regs);
f6647d25769d7d Thomas Gleixner 2021-09-08 179 case EX_TYPE_FAULT:
fd96c41f8fa7b6 Thomas Gleixner 2021-09-08 180 case EX_TYPE_FAULT_MCE_SAFE:
f6647d25769d7d Thomas Gleixner 2021-09-08 181 return ex_handler_fault(e, regs, trapnr);
f6647d25769d7d Thomas Gleixner 2021-09-08 182 case EX_TYPE_UACCESS:
f6647d25769d7d Thomas Gleixner 2021-09-08 183 return ex_handler_uaccess(e, regs, trapnr);
f6647d25769d7d Thomas Gleixner 2021-09-08 184 case EX_TYPE_COPY:
f6647d25769d7d Thomas Gleixner 2021-09-08 185 return ex_handler_copy(e, regs, trapnr);
f6647d25769d7d Thomas Gleixner 2021-09-08 186 case EX_TYPE_CLEAR_FS:
f6647d25769d7d Thomas Gleixner 2021-09-08 187 return ex_handler_clear_fs(e, regs);
f6647d25769d7d Thomas Gleixner 2021-09-08 188 case EX_TYPE_FPU_RESTORE:
f6647d25769d7d Thomas Gleixner 2021-09-08 189 return ex_handler_fprestore(e, regs);
f6647d25769d7d Thomas Gleixner 2021-09-08 190 case EX_TYPE_BPF:
f6647d25769d7d Thomas Gleixner 2021-09-08 191 return ex_handler_bpf(e, regs);
67cae747a093a8 Peter Zijlstra 2021-11-10 192 case EX_TYPE_WRMSR:
67cae747a093a8 Peter Zijlstra 2021-11-10 193 return ex_handler_msr(e, regs, true, false, reg);
67cae747a093a8 Peter Zijlstra 2021-11-10 194 case EX_TYPE_RDMSR:
67cae747a093a8 Peter Zijlstra 2021-11-10 195 return ex_handler_msr(e, regs, false, false, reg);
67cae747a093a8 Peter Zijlstra 2021-11-10 196 case EX_TYPE_WRMSR_SAFE:
67cae747a093a8 Peter Zijlstra 2021-11-10 197 return ex_handler_msr(e, regs, true, true, reg);
67cae747a093a8 Peter Zijlstra 2021-11-10 198 case EX_TYPE_RDMSR_SAFE:
67cae747a093a8 Peter Zijlstra 2021-11-10 199 return ex_handler_msr(e, regs, false, true, reg);
f6647d25769d7d Thomas Gleixner 2021-09-08 @200 case EX_TYPE_WRMSR_IN_MCE:
f6647d25769d7d Thomas Gleixner 2021-09-08 201 ex_handler_msr_mce(regs, true);
f6647d25769d7d Thomas Gleixner 2021-09-08 202 break;
67cae747a093a8 Peter Zijlstra 2021-11-10 203 case EX_TYPE_RDMSR_IN_MCE:
67cae747a093a8 Peter Zijlstra 2021-11-10 204 ex_handler_msr_mce(regs, false);
67cae747a093a8 Peter Zijlstra 2021-11-10 205 break;
54ad742e5119ea Peter Zijlstra 2021-11-10 206 case EX_TYPE_POP_ZERO:
54ad742e5119ea Peter Zijlstra 2021-11-10 207 return ex_handler_pop_zero(e, regs);
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 208 case EX_TYPE_IMM_REG:
d00a02f6f57ef8 Peter Zijlstra 2021-11-10 209 return ex_handler_imm_reg(e, regs, reg, imm);
f6647d25769d7d Thomas Gleixner 2021-09-08 210 }
f6647d25769d7d Thomas Gleixner 2021-09-08 211 BUG();
6d48583ba9ade6 Harvey Harrison 2008-01-30 212 }
6a1ea279c210e7 H. Peter Anvin 2012-04-19 213

:::::: The code at line 200 was first introduced by commit
:::::: f6647d25769d7dc7c50b9bbd6fd364bb148743b5 x86/extable: Rework the exception table mechanics

:::::: TO: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
:::::: CC: Sasha Levin <sashal@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://01.org/lkp