Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: x86: Introduce EM_ASM_2R

Replace the FASTOP2R instruction.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Sean Christopherson <seanjc@google.com>
Link: https://lkml.kernel.org/r/20250714103440.024933524@infradead.org

+12 -4
+12 -4
arch/x86/kvm/emulate.c
··· 326 326 ON64(case 8: __EM_ASM_2(op##q, rax, rdx); break;) \ 327 327 EM_ASM_END 328 328 329 + /* 2-operand, reversed */ 330 + #define EM_ASM_2R(op, name) \ 331 + EM_ASM_START(name) \ 332 + case 1: __EM_ASM_2(op##b, dl, al); break; \ 333 + case 2: __EM_ASM_2(op##w, dx, ax); break; \ 334 + case 4: __EM_ASM_2(op##l, edx, eax); break; \ 335 + ON64(case 8: __EM_ASM_2(op##q, rdx, rax); break;) \ 336 + EM_ASM_END 337 + 329 338 /* 330 339 * fastop functions have a special calling convention: 331 340 * ··· 1086 1077 FASTOP2W(btr); 1087 1078 FASTOP2W(btc); 1088 1079 1089 - 1090 - FASTOP2R(cmp, cmp_r); 1080 + EM_ASM_2R(cmp, cmp_r); 1091 1081 1092 1082 static int em_bsf_c(struct x86_emulate_ctxt *ctxt) 1093 1083 { ··· 4344 4336 I2bv(DstAcc | SrcMem | Mov | MemAbs, em_mov), 4345 4337 I2bv(DstMem | SrcAcc | Mov | MemAbs | PageTable, em_mov), 4346 4338 I2bv(SrcSI | DstDI | Mov | String | TwoMemOp, em_mov), 4347 - F2bv(SrcSI | DstDI | String | NoWrite | TwoMemOp, em_cmp_r), 4339 + I2bv(SrcSI | DstDI | String | NoWrite | TwoMemOp, em_cmp_r), 4348 4340 /* 0xA8 - 0xAF */ 4349 4341 I2bv(DstAcc | SrcImm | NoWrite, em_test), 4350 4342 I2bv(SrcAcc | DstDI | Mov | String, em_mov), 4351 4343 I2bv(SrcSI | DstAcc | Mov | String, em_mov), 4352 - F2bv(SrcAcc | DstDI | String | NoWrite, em_cmp_r), 4344 + I2bv(SrcAcc | DstDI | String | NoWrite, em_cmp_r), 4353 4345 /* 0xB0 - 0xB7 */ 4354 4346 X8(I(ByteOp | DstReg | SrcImm | Mov, em_mov)), 4355 4347 /* 0xB8 - 0xBF */