diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2011-04-04 06:39:30 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:02 -0400 |
commit | dee6bb70e4ac0588c98cc4e661664f0653117f89 (patch) | |
tree | 5ac61776dd5e6590b4b0b03b1ecc6e4cd031b85a /arch/x86/kvm/emulate.c | |
parent | 3b88e41a41344846ee28007ebfe1bb0defa7f86a (diff) |
KVM: SVM: Add intercept checks for descriptor table accesses
This patch add intercept checks into the KVM instruction
emulator to check for the 8 instructions that access the
descriptor table addresses.
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 | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index cd9ed9f45275..3ac830a135fd 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2630,8 +2630,18 @@ static struct opcode group5[] = { | |||
2630 | D(SrcMem | ModRM | Stack), N, | 2630 | D(SrcMem | ModRM | Stack), N, |
2631 | }; | 2631 | }; |
2632 | 2632 | ||
2633 | static struct opcode group6[] = { | ||
2634 | DI(ModRM | Prot, sldt), | ||
2635 | DI(ModRM | Prot, str), | ||
2636 | DI(ModRM | Prot | Priv, lldt), | ||
2637 | DI(ModRM | Prot | Priv, ltr), | ||
2638 | N, N, N, N, | ||
2639 | }; | ||
2640 | |||
2633 | static struct group_dual group7 = { { | 2641 | static struct group_dual group7 = { { |
2634 | N, N, DI(ModRM | SrcMem | Priv, lgdt), DI(ModRM | SrcMem | Priv, lidt), | 2642 | DI(ModRM | Mov | DstMem | Priv, sgdt), |
2643 | DI(ModRM | Mov | DstMem | Priv, sidt), | ||
2644 | DI(ModRM | SrcMem | Priv, lgdt), DI(ModRM | SrcMem | Priv, lidt), | ||
2635 | DI(SrcNone | ModRM | DstMem | Mov, smsw), N, | 2645 | DI(SrcNone | ModRM | DstMem | Mov, smsw), N, |
2636 | DI(SrcMem16 | ModRM | Mov | Priv, lmsw), | 2646 | DI(SrcMem16 | ModRM | Mov | Priv, lmsw), |
2637 | DI(SrcMem | ModRM | ByteOp | Priv | NoAccess, invlpg), | 2647 | DI(SrcMem | ModRM | ByteOp | Priv | NoAccess, invlpg), |
@@ -2766,7 +2776,7 @@ static struct opcode opcode_table[256] = { | |||
2766 | 2776 | ||
2767 | static struct opcode twobyte_table[256] = { | 2777 | static struct opcode twobyte_table[256] = { |
2768 | /* 0x00 - 0x0F */ | 2778 | /* 0x00 - 0x0F */ |
2769 | N, GD(0, &group7), N, N, | 2779 | G(0, group6), GD(0, &group7), N, N, |
2770 | N, D(ImplicitOps | VendorSpecific), DI(ImplicitOps | Priv, clts), N, | 2780 | N, D(ImplicitOps | VendorSpecific), DI(ImplicitOps | Priv, clts), N, |
2771 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, | 2781 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, |
2772 | N, D(ImplicitOps | ModRM), N, N, | 2782 | N, D(ImplicitOps | ModRM), N, N, |