summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-06-13 16:33:29 +0300
committerAvi Kivity <avi@redhat.com>2012-07-09 14:19:05 +0300
commit80890006167ec3e570bfd7cee7a05db17d339726 (patch)
tree613300ec7c04969ea591d4ff059ff849f0ec0c95 /arch/x86/kvm/emulate.c
parent869be99c7579c857885643ba2aed87ced339c6a2 (diff)
downloadop-kernel-dev-80890006167ec3e570bfd7cee7a05db17d339726.zip
op-kernel-dev-80890006167ec3e570bfd7cee7a05db17d339726.tar.gz
KVM: x86 emulator: implement LTR
Opcode 0F 00 /3. Encountered during Windows XP secondary processor bringup. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 92a1add..97d9a99 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3033,6 +3033,15 @@ static int em_lldt(struct x86_emulate_ctxt *ctxt)
return load_segment_descriptor(ctxt, sel, VCPU_SREG_LDTR);
}
+static int em_ltr(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_TR);
+}
+
static int em_invlpg(struct x86_emulate_ctxt *ctxt)
{
int rc;
@@ -3579,7 +3588,7 @@ static struct opcode group6[] = {
DI(Prot, sldt),
DI(Prot, str),
II(Prot | Priv | SrcMem16, em_lldt, lldt),
- DI(Prot | Priv, ltr),
+ II(Prot | Priv | SrcMem16, em_ltr, ltr),
N, N, N, N,
};
OpenPOWER on IntegriCloud