Opcode 0F 00 /3.  Encountered during Windows XP secondary processor bringup.

Signed-off-by: Avi Kivity <a...@redhat.com>
---
 arch/x86/kvm/emulate.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

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 int check_perm_out(struct x86_emulate_ctxt *ctxt)
        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,
 };
 
-- 
1.7.11

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to