diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-04 06:39:23 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:00 -0400 |
commit | 3c6e276f22cf29188035535127c4c35aeeafcabc (patch) | |
tree | 910d8cc7338d4e8f88b2cd4d069898c579f8c0b3 /arch/x86/kvm/emulate.c | |
parent | c4f035c60dad45ff8813550dc82540dbbc263df2 (diff) |
KVM: x86 emulator: add SVM intercepts
Add intercept codes for instructions defined by SVM as
interceptable.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a81486790ba8..c2260e57450a 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2469,15 +2469,15 @@ static struct opcode group5[] = { | |||
2469 | }; | 2469 | }; |
2470 | 2470 | ||
2471 | static struct group_dual group7 = { { | 2471 | static struct group_dual group7 = { { |
2472 | N, N, D(ModRM | SrcMem | Priv), D(ModRM | SrcMem | Priv), | 2472 | N, N, DI(ModRM | SrcMem | Priv, lgdt), DI(ModRM | SrcMem | Priv, lidt), |
2473 | D(SrcNone | ModRM | DstMem | Mov), N, | 2473 | DI(SrcNone | ModRM | DstMem | Mov, smsw), N, |
2474 | D(SrcMem16 | ModRM | Mov | Priv), | 2474 | DI(SrcMem16 | ModRM | Mov | Priv, lmsw), |
2475 | D(SrcMem | ModRM | ByteOp | Priv | NoAccess), | 2475 | DI(SrcMem | ModRM | ByteOp | Priv | NoAccess, invlpg), |
2476 | }, { | 2476 | }, { |
2477 | D(SrcNone | ModRM | Priv | VendorSpecific), N, | 2477 | D(SrcNone | ModRM | Priv | VendorSpecific), N, |
2478 | N, D(SrcNone | ModRM | Priv | VendorSpecific), | 2478 | N, D(SrcNone | ModRM | Priv | VendorSpecific), |
2479 | D(SrcNone | ModRM | DstMem | Mov), N, | 2479 | DI(SrcNone | ModRM | DstMem | Mov, smsw), N, |
2480 | D(SrcMem16 | ModRM | Mov | Priv), N, | 2480 | DI(SrcMem16 | ModRM | Mov | Priv, lmsw), N, |
2481 | } }; | 2481 | } }; |
2482 | 2482 | ||
2483 | static struct opcode group8[] = { | 2483 | static struct opcode group8[] = { |
@@ -2556,7 +2556,7 @@ static struct opcode opcode_table[256] = { | |||
2556 | /* 0x98 - 0x9F */ | 2556 | /* 0x98 - 0x9F */ |
2557 | D(DstAcc | SrcNone), I(ImplicitOps | SrcAcc, em_cwd), | 2557 | D(DstAcc | SrcNone), I(ImplicitOps | SrcAcc, em_cwd), |
2558 | I(SrcImmFAddr | No64, em_call_far), N, | 2558 | I(SrcImmFAddr | No64, em_call_far), N, |
2559 | D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N, | 2559 | DI(ImplicitOps | Stack, pushf), DI(ImplicitOps | Stack, popf), N, N, |
2560 | /* 0xA0 - 0xA7 */ | 2560 | /* 0xA0 - 0xA7 */ |
2561 | I2bv(DstAcc | SrcMem | Mov | MemAbs, em_mov), | 2561 | I2bv(DstAcc | SrcMem | Mov | MemAbs, em_mov), |
2562 | I2bv(DstMem | SrcAcc | Mov | MemAbs, em_mov), | 2562 | I2bv(DstMem | SrcAcc | Mov | MemAbs, em_mov), |
@@ -2579,7 +2579,8 @@ static struct opcode opcode_table[256] = { | |||
2579 | G(ByteOp, group11), G(0, group11), | 2579 | G(ByteOp, group11), G(0, group11), |
2580 | /* 0xC8 - 0xCF */ | 2580 | /* 0xC8 - 0xCF */ |
2581 | N, N, N, D(ImplicitOps | Stack), | 2581 | N, N, N, D(ImplicitOps | Stack), |
2582 | D(ImplicitOps), D(SrcImmByte), D(ImplicitOps | No64), D(ImplicitOps), | 2582 | D(ImplicitOps), DI(SrcImmByte, intn), |
2583 | D(ImplicitOps | No64), DI(ImplicitOps, iret), | ||
2583 | /* 0xD0 - 0xD7 */ | 2584 | /* 0xD0 - 0xD7 */ |
2584 | D2bv(DstMem | SrcOne | ModRM), D2bv(DstMem | ModRM), | 2585 | D2bv(DstMem | SrcOne | ModRM), D2bv(DstMem | ModRM), |
2585 | N, N, N, N, | 2586 | N, N, N, N, |
@@ -2594,7 +2595,8 @@ static struct opcode opcode_table[256] = { | |||
2594 | D2bv(SrcNone | DstAcc), D2bv(SrcAcc | ImplicitOps), | 2595 | D2bv(SrcNone | DstAcc), D2bv(SrcAcc | ImplicitOps), |
2595 | /* 0xF0 - 0xF7 */ | 2596 | /* 0xF0 - 0xF7 */ |
2596 | N, N, N, N, | 2597 | N, N, N, N, |
2597 | D(ImplicitOps | Priv), D(ImplicitOps), G(ByteOp, group3), G(0, group3), | 2598 | DI(ImplicitOps | Priv, hlt), D(ImplicitOps), |
2599 | G(ByteOp, group3), G(0, group3), | ||
2598 | /* 0xF8 - 0xFF */ | 2600 | /* 0xF8 - 0xFF */ |
2599 | D(ImplicitOps), D(ImplicitOps), D(ImplicitOps), D(ImplicitOps), | 2601 | D(ImplicitOps), D(ImplicitOps), D(ImplicitOps), D(ImplicitOps), |
2600 | D(ImplicitOps), D(ImplicitOps), G(0, group4), G(0, group5), | 2602 | D(ImplicitOps), D(ImplicitOps), G(0, group4), G(0, group5), |
@@ -2604,7 +2606,7 @@ static struct opcode twobyte_table[256] = { | |||
2604 | /* 0x00 - 0x0F */ | 2606 | /* 0x00 - 0x0F */ |
2605 | N, GD(0, &group7), N, N, | 2607 | N, GD(0, &group7), N, N, |
2606 | N, D(ImplicitOps | VendorSpecific), D(ImplicitOps | Priv), N, | 2608 | N, D(ImplicitOps | VendorSpecific), D(ImplicitOps | Priv), N, |
2607 | D(ImplicitOps | Priv), D(ImplicitOps | Priv), N, N, | 2609 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, |
2608 | N, D(ImplicitOps | ModRM), N, N, | 2610 | N, D(ImplicitOps | ModRM), N, N, |
2609 | /* 0x10 - 0x1F */ | 2611 | /* 0x10 - 0x1F */ |
2610 | N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N, | 2612 | N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N, |
@@ -2614,7 +2616,7 @@ static struct opcode twobyte_table[256] = { | |||
2614 | N, N, N, N, | 2616 | N, N, N, N, |
2615 | N, N, N, N, N, N, N, N, | 2617 | N, N, N, N, N, N, N, N, |
2616 | /* 0x30 - 0x3F */ | 2618 | /* 0x30 - 0x3F */ |
2617 | D(ImplicitOps | Priv), I(ImplicitOps, em_rdtsc), | 2619 | D(ImplicitOps | Priv), II(ImplicitOps, em_rdtsc, rdtsc), |
2618 | D(ImplicitOps | Priv), N, | 2620 | D(ImplicitOps | Priv), N, |
2619 | D(ImplicitOps | VendorSpecific), D(ImplicitOps | Priv | VendorSpecific), | 2621 | D(ImplicitOps | VendorSpecific), D(ImplicitOps | Priv | VendorSpecific), |
2620 | N, N, | 2622 | N, N, |