提交 51b958e5 编写于 作者: D David Edmondson 提交者: Paolo Bonzini

KVM: x86: clflushopt should be treated as a no-op by emulation

The instruction emulator ignores clflush instructions, yet fails to
support clflushopt. Treat both similarly.

Fixes: 13e457e0 ("KVM: x86: Emulator does not decode clflush well")
Signed-off-by: NDavid Edmondson <david.edmondson@oracle.com>
Message-Id: <20201103120400.240882-1-david.edmondson@oracle.com>
Reviewed-by: NJoao Martins <joao.m.martins@oracle.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 2c38234c
...@@ -4046,6 +4046,12 @@ static int em_clflush(struct x86_emulate_ctxt *ctxt) ...@@ -4046,6 +4046,12 @@ static int em_clflush(struct x86_emulate_ctxt *ctxt)
return X86EMUL_CONTINUE; return X86EMUL_CONTINUE;
} }
static int em_clflushopt(struct x86_emulate_ctxt *ctxt)
{
/* emulating clflushopt regardless of cpuid */
return X86EMUL_CONTINUE;
}
static int em_movsxd(struct x86_emulate_ctxt *ctxt) static int em_movsxd(struct x86_emulate_ctxt *ctxt)
{ {
ctxt->dst.val = (s32) ctxt->src.val; ctxt->dst.val = (s32) ctxt->src.val;
...@@ -4585,7 +4591,7 @@ static const struct opcode group11[] = { ...@@ -4585,7 +4591,7 @@ static const struct opcode group11[] = {
}; };
static const struct gprefix pfx_0f_ae_7 = { static const struct gprefix pfx_0f_ae_7 = {
I(SrcMem | ByteOp, em_clflush), N, N, N, I(SrcMem | ByteOp, em_clflush), I(SrcMem | ByteOp, em_clflushopt), N, N,
}; };
static const struct group_dual group15 = { { static const struct group_dual group15 = { {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册