Hi Joerg,
First bad commit (maybe != root cause):
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git
sev-es-client-tip-5.9
head: 7e2e0f5fb47e16dec0e6b81ce2ee36abb4c28eb9
commit: 35d875a68ff6c7753a1dde4507599371e65cc3aa [41/76] x86/sev-es: Compile early handler
code into kernel image
config: x86_64-randconfig-m001-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
arch/x86/kernel/sev-es-shared.c:267 vc_ioio_exitinfo() warn: should
'insn->immediate.value << 16' be a 64 bit type?
Old smatch warnings:
arch/x86/kernel/sev-es-shared.c:274 vc_ioio_exitinfo() warn: should
'insn->immediate.value << 16' be a 64 bit type?
#
https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git/commit/?id...
git remote add joro
https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git
git fetch --no-tags joro sev-es-client-tip-5.9
git checkout 35d875a68ff6c7753a1dde4507599371e65cc3aa
vim +267 arch/x86/kernel/sev-es-shared.c
3baee4b43311883 Tom Lendacky 2020-07-24 240
3baee4b43311883 Tom Lendacky 2020-07-24 241 static enum es_result
vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
3baee4b43311883 Tom Lendacky 2020-07-24 242 {
3baee4b43311883 Tom Lendacky 2020-07-24 243 struct insn *insn = &ctxt->insn;
3baee4b43311883 Tom Lendacky 2020-07-24 244 *exitinfo = 0;
3baee4b43311883 Tom Lendacky 2020-07-24 245
3baee4b43311883 Tom Lendacky 2020-07-24 246 switch (insn->opcode.bytes[0]) {
3baee4b43311883 Tom Lendacky 2020-07-24 247 /* INS opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 248 case 0x6c:
3baee4b43311883 Tom Lendacky 2020-07-24 249 case 0x6d:
3baee4b43311883 Tom Lendacky 2020-07-24 250 *exitinfo |= IOIO_TYPE_INS;
3baee4b43311883 Tom Lendacky 2020-07-24 251 *exitinfo |= IOIO_SEG_ES;
3baee4b43311883 Tom Lendacky 2020-07-24 252 *exitinfo |= (ctxt->regs->dx &
0xffff) << 16;
3baee4b43311883 Tom Lendacky 2020-07-24 253 break;
3baee4b43311883 Tom Lendacky 2020-07-24 254
3baee4b43311883 Tom Lendacky 2020-07-24 255 /* OUTS opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 256 case 0x6e:
3baee4b43311883 Tom Lendacky 2020-07-24 257 case 0x6f:
3baee4b43311883 Tom Lendacky 2020-07-24 258 *exitinfo |= IOIO_TYPE_OUTS;
3baee4b43311883 Tom Lendacky 2020-07-24 259 *exitinfo |= IOIO_SEG_DS;
3baee4b43311883 Tom Lendacky 2020-07-24 260 *exitinfo |= (ctxt->regs->dx &
0xffff) << 16;
3baee4b43311883 Tom Lendacky 2020-07-24 261 break;
3baee4b43311883 Tom Lendacky 2020-07-24 262
3baee4b43311883 Tom Lendacky 2020-07-24 263 /* IN immediate opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 264 case 0xe4:
3baee4b43311883 Tom Lendacky 2020-07-24 265 case 0xe5:
3baee4b43311883 Tom Lendacky 2020-07-24 266 *exitinfo |= IOIO_TYPE_IN;
3baee4b43311883 Tom Lendacky 2020-07-24 @267 *exitinfo |= insn->immediate.value
<< 16;
3baee4b43311883 Tom Lendacky 2020-07-24 268 break;
3baee4b43311883 Tom Lendacky 2020-07-24 269
3baee4b43311883 Tom Lendacky 2020-07-24 270 /* OUT immediate opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 271 case 0xe6:
3baee4b43311883 Tom Lendacky 2020-07-24 272 case 0xe7:
3baee4b43311883 Tom Lendacky 2020-07-24 273 *exitinfo |= IOIO_TYPE_OUT;
3baee4b43311883 Tom Lendacky 2020-07-24 274 *exitinfo |= insn->immediate.value
<< 16;
3baee4b43311883 Tom Lendacky 2020-07-24 275 break;
3baee4b43311883 Tom Lendacky 2020-07-24 276
3baee4b43311883 Tom Lendacky 2020-07-24 277 /* IN register opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 278 case 0xec:
3baee4b43311883 Tom Lendacky 2020-07-24 279 case 0xed:
3baee4b43311883 Tom Lendacky 2020-07-24 280 *exitinfo |= IOIO_TYPE_IN;
3baee4b43311883 Tom Lendacky 2020-07-24 281 *exitinfo |= (ctxt->regs->dx &
0xffff) << 16;
3baee4b43311883 Tom Lendacky 2020-07-24 282 break;
3baee4b43311883 Tom Lendacky 2020-07-24 283
3baee4b43311883 Tom Lendacky 2020-07-24 284 /* OUT register opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 285 case 0xee:
3baee4b43311883 Tom Lendacky 2020-07-24 286 case 0xef:
3baee4b43311883 Tom Lendacky 2020-07-24 287 *exitinfo |= IOIO_TYPE_OUT;
3baee4b43311883 Tom Lendacky 2020-07-24 288 *exitinfo |= (ctxt->regs->dx &
0xffff) << 16;
3baee4b43311883 Tom Lendacky 2020-07-24 289 break;
3baee4b43311883 Tom Lendacky 2020-07-24 290
3baee4b43311883 Tom Lendacky 2020-07-24 291 default:
3baee4b43311883 Tom Lendacky 2020-07-24 292 return ES_DECODE_FAILED;
3baee4b43311883 Tom Lendacky 2020-07-24 293 }
3baee4b43311883 Tom Lendacky 2020-07-24 294
3baee4b43311883 Tom Lendacky 2020-07-24 295 switch (insn->opcode.bytes[0]) {
3baee4b43311883 Tom Lendacky 2020-07-24 296 case 0x6c:
3baee4b43311883 Tom Lendacky 2020-07-24 297 case 0x6e:
3baee4b43311883 Tom Lendacky 2020-07-24 298 case 0xe4:
3baee4b43311883 Tom Lendacky 2020-07-24 299 case 0xe6:
3baee4b43311883 Tom Lendacky 2020-07-24 300 case 0xec:
3baee4b43311883 Tom Lendacky 2020-07-24 301 case 0xee:
3baee4b43311883 Tom Lendacky 2020-07-24 302 /* Single byte opcodes */
3baee4b43311883 Tom Lendacky 2020-07-24 303 *exitinfo |= IOIO_DATA_8;
3baee4b43311883 Tom Lendacky 2020-07-24 304 break;
3baee4b43311883 Tom Lendacky 2020-07-24 305 default:
3baee4b43311883 Tom Lendacky 2020-07-24 306 /* Length determined by instruction
parsing */
3baee4b43311883 Tom Lendacky 2020-07-24 307 *exitinfo |= (insn->opnd_bytes == 2) ?
IOIO_DATA_16
3baee4b43311883 Tom Lendacky 2020-07-24 308 : IOIO_DATA_32;
3baee4b43311883 Tom Lendacky 2020-07-24 309 }
3baee4b43311883 Tom Lendacky 2020-07-24 310 switch (insn->addr_bytes) {
3baee4b43311883 Tom Lendacky 2020-07-24 311 case 2:
3baee4b43311883 Tom Lendacky 2020-07-24 312 *exitinfo |= IOIO_ADDR_16;
3baee4b43311883 Tom Lendacky 2020-07-24 313 break;
3baee4b43311883 Tom Lendacky 2020-07-24 314 case 4:
3baee4b43311883 Tom Lendacky 2020-07-24 315 *exitinfo |= IOIO_ADDR_32;
3baee4b43311883 Tom Lendacky 2020-07-24 316 break;
3baee4b43311883 Tom Lendacky 2020-07-24 317 case 8:
3baee4b43311883 Tom Lendacky 2020-07-24 318 *exitinfo |= IOIO_ADDR_64;
3baee4b43311883 Tom Lendacky 2020-07-24 319 break;
3baee4b43311883 Tom Lendacky 2020-07-24 320 }
3baee4b43311883 Tom Lendacky 2020-07-24 321
3baee4b43311883 Tom Lendacky 2020-07-24 322 if (insn_has_rep_prefix(insn))
3baee4b43311883 Tom Lendacky 2020-07-24 323 *exitinfo |= IOIO_REP;
3baee4b43311883 Tom Lendacky 2020-07-24 324
3baee4b43311883 Tom Lendacky 2020-07-24 325 return ES_OK;
3baee4b43311883 Tom Lendacky 2020-07-24 326 }
3baee4b43311883 Tom Lendacky 2020-07-24 327
:::::: The code at line 267 was first introduced by commit
:::::: 3baee4b43311883285fb9c7e1f0f79383f25e0a4 x86/sev-es: Add support for handling IOIO
exceptions
:::::: TO: Tom Lendacky <thomas.lendacky(a)amd.com>
:::::: CC: Joerg Roedel <jroedel(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org