aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2011-12-06 04:07:27 -0500
committerAvi Kivity <avi@redhat.com>2011-12-27 04:23:38 -0500
commite0dac408d08c2a5e1bed2a6a9da7f3af3f7a9827 (patch)
tree321aefae4499c222d9bdce93b5194240f282e6a3 /arch
parentc04ec8393f3815e0f60dde1d6b29040bf1875d52 (diff)
KVM: x86 emulator: Use opcode::execute for Group 9 instruction
Group 9: 0F C7 Rename em_grp9() to em_cmpxchg8b() and register it. Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/emulate.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 5b78785de41b..de7be77820d5 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1784,7 +1784,7 @@ static int em_grp45(struct x86_emulate_ctxt *ctxt)
1784 return rc; 1784 return rc;
1785} 1785}
1786 1786
1787static int em_grp9(struct x86_emulate_ctxt *ctxt) 1787static int em_cmpxchg8b(struct x86_emulate_ctxt *ctxt)
1788{ 1788{
1789 u64 old = ctxt->dst.orig_val64; 1789 u64 old = ctxt->dst.orig_val64;
1790 1790
@@ -3261,7 +3261,7 @@ static struct opcode group8[] = {
3261}; 3261};
3262 3262
3263static struct group_dual group9 = { { 3263static struct group_dual group9 = { {
3264 N, D(DstMem64 | ModRM | Lock | PageTable), N, N, N, N, N, N, 3264 N, I(DstMem64 | ModRM | Lock | PageTable, em_cmpxchg8b), N, N, N, N, N, N,
3265}, { 3265}, {
3266 N, N, N, N, N, N, N, N, 3266 N, N, N, N, N, N, N, N,
3267} }; 3267} };
@@ -4202,9 +4202,6 @@ twobyte_insn:
4202 ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val : 4202 ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val :
4203 (u64) ctxt->src.val; 4203 (u64) ctxt->src.val;
4204 break; 4204 break;
4205 case 0xc7: /* Grp9 (cmpxchg8b) */
4206 rc = em_grp9(ctxt);
4207 break;
4208 default: 4205 default:
4209 goto cannot_emulate; 4206 goto cannot_emulate;
4210 } 4207 }