Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49597d81 authored by Stefan Hajnoczi's avatar Stefan Hajnoczi Committed by Marcelo Tosatti
Browse files

KVM: x86: emulate movdqa



An Ubuntu 9.10 Karmic Koala guest is unable to boot or install due to
missing movdqa emulation:

kvm_exit: reason EXCEPTION_NMI rip 0x7fef3e025a7b info 7fef3e799000 80000b0e
kvm_page_fault: address 7fef3e799000 error_code f
kvm_emulate_insn: 0:7fef3e025a7b: 66 0f 7f 07 (prot64)

movdqa %xmm0,(%rdi)

[avi: mark it explicitly aligned]

Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 1c11b376
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -2818,7 +2818,7 @@ static int em_rdpmc(struct x86_emulate_ctxt *ctxt)

static int em_mov(struct x86_emulate_ctxt *ctxt)
{
	ctxt->dst.val = ctxt->src.val;
	memcpy(ctxt->dst.valptr, ctxt->src.valptr, ctxt->op_bytes);
	return X86EMUL_CONTINUE;
}

@@ -2898,12 +2898,6 @@ static int em_mov_sreg_rm(struct x86_emulate_ctxt *ctxt)
	return load_segment_descriptor(ctxt, sel, ctxt->modrm_reg);
}

static int em_movdqu(struct x86_emulate_ctxt *ctxt)
{
	memcpy(&ctxt->dst.vec_val, &ctxt->src.vec_val, ctxt->op_bytes);
	return X86EMUL_CONTINUE;
}

static int em_invlpg(struct x86_emulate_ctxt *ctxt)
{
	int rc;
@@ -3443,7 +3437,7 @@ static struct opcode group11[] = {
};

static struct gprefix pfx_0f_6f_0f_7f = {
	N, N, N, I(Sse | Unaligned, em_movdqu),
	N, I(Sse | Aligned, em_mov), N, I(Sse | Unaligned, em_mov),
};

static struct opcode opcode_table[256] = {