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_2CL

Replace the FASTOP2CL instructions.

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

+24 -15
+24 -15
arch/x86/kvm/emulate.c
··· 344 344 ON64(case 8: __EM_ASM_2(op##q, rax, rdx); break;) \ 345 345 EM_ASM_END 346 346 347 + /* 2-operand, using "a" (dst) and CL (src2) */ 348 + #define EM_ASM_2CL(op) \ 349 + EM_ASM_START(op) \ 350 + case 1: __EM_ASM_2(op##b, al, cl); break; \ 351 + case 2: __EM_ASM_2(op##w, ax, cl); break; \ 352 + case 4: __EM_ASM_2(op##l, eax, cl); break; \ 353 + ON64(case 8: __EM_ASM_2(op##q, rax, cl); break;) \ 354 + EM_ASM_END 355 + 347 356 /* 348 357 * fastop functions have a special calling convention: 349 358 * ··· 1089 1080 EM_ASM_1(inc); 1090 1081 EM_ASM_1(dec); 1091 1082 1092 - FASTOP2CL(rol); 1093 - FASTOP2CL(ror); 1094 - FASTOP2CL(rcl); 1095 - FASTOP2CL(rcr); 1096 - FASTOP2CL(shl); 1097 - FASTOP2CL(shr); 1098 - FASTOP2CL(sar); 1083 + EM_ASM_2CL(rol); 1084 + EM_ASM_2CL(ror); 1085 + EM_ASM_2CL(rcl); 1086 + EM_ASM_2CL(rcr); 1087 + EM_ASM_2CL(shl); 1088 + EM_ASM_2CL(shr); 1089 + EM_ASM_2CL(sar); 1099 1090 1100 1091 EM_ASM_2W(bsf); 1101 1092 EM_ASM_2W(bsr); ··· 4088 4079 }; 4089 4080 4090 4081 static const struct opcode group2[] = { 4091 - F(DstMem | ModRM, em_rol), 4092 - F(DstMem | ModRM, em_ror), 4093 - F(DstMem | ModRM, em_rcl), 4094 - F(DstMem | ModRM, em_rcr), 4095 - F(DstMem | ModRM, em_shl), 4096 - F(DstMem | ModRM, em_shr), 4097 - F(DstMem | ModRM, em_shl), 4098 - F(DstMem | ModRM, em_sar), 4082 + I(DstMem | ModRM, em_rol), 4083 + I(DstMem | ModRM, em_ror), 4084 + I(DstMem | ModRM, em_rcl), 4085 + I(DstMem | ModRM, em_rcr), 4086 + I(DstMem | ModRM, em_shl), 4087 + I(DstMem | ModRM, em_shr), 4088 + I(DstMem | ModRM, em_shl), 4089 + I(DstMem | ModRM, em_sar), 4099 4090 }; 4100 4091 4101 4092 static const struct opcode group3[] = {