diff options
author | Avi Kivity <avi@redhat.com> | 2012-06-13 09:28:33 (GMT) |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-07-09 11:19:04 (GMT) |
commit | a14e579f224ba929fe2f1d9bbbff688ae67e2ec4 (patch) | |
tree | 6f03c2c154c71d259ff39784b78434124ff64704 /arch/x86/kvm/emulate.c | |
parent | 9299836e6379d5703826a540fb3c704223fac520 (diff) | |
download | linux-fsl-qoriq-a14e579f224ba929fe2f1d9bbbff688ae67e2ec4.tar.xz |
KVM: x86 emulator: emulate LLDT
Opcode 0F 00 /2. Used by isolinux durign the protected mode transition.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index cfa5cc3..7b575ad 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3015,6 +3015,15 @@ static int em_mov_sreg_rm(struct x86_emulate_ctxt *ctxt) return load_segment_descriptor(ctxt, sel, ctxt->modrm_reg); } +static int em_lldt(struct x86_emulate_ctxt *ctxt) +{ + u16 sel = ctxt->src.val; + + /* Disable writeback. */ + ctxt->dst.type = OP_NONE; + return load_segment_descriptor(ctxt, sel, VCPU_SREG_LDTR); +} + static int em_invlpg(struct x86_emulate_ctxt *ctxt) { int rc; @@ -3560,7 +3569,7 @@ static struct opcode group5[] = { static struct opcode group6[] = { DI(Prot, sldt), DI(Prot, str), - DI(Prot | Priv, lldt), + II(Prot | Priv | SrcMem16, em_lldt, lldt), DI(Prot | Priv, ltr), N, N, N, N, }; |