diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2011-05-29 09:02:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:16:04 -0400 |
commit | 5c5df76b8b32055956ee4cca338d29046016b13e (patch) | |
tree | 572e449ac053fd778289bafcbd2216bbc176dcfe /arch/x86/kvm/emulate.c | |
parent | 1bd5f469b2d54330ba41d9c4b857dc5051e8dcf7 (diff) |
KVM: x86 emulator: Clean up INT n/INTO/INT 3(CC/CD/CE)
Call emulate_int() directly to avoid spaghetti goto's.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 5561680c1e9c..d7df7ba17b89 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -3769,7 +3769,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) | |||
3769 | struct decode_cache *c = &ctxt->decode; | 3769 | struct decode_cache *c = &ctxt->decode; |
3770 | int rc = X86EMUL_CONTINUE; | 3770 | int rc = X86EMUL_CONTINUE; |
3771 | int saved_dst_type = c->dst.type; | 3771 | int saved_dst_type = c->dst.type; |
3772 | int irq; /* Used for int 3, int, and into */ | ||
3773 | 3772 | ||
3774 | c->mem_read.pos = 0; | 3773 | c->mem_read.pos = 0; |
3775 | 3774 | ||
@@ -3963,18 +3962,14 @@ special_insn: | |||
3963 | rc = emulate_load_segment(ctxt, VCPU_SREG_DS); | 3962 | rc = emulate_load_segment(ctxt, VCPU_SREG_DS); |
3964 | break; | 3963 | break; |
3965 | case 0xcc: /* int3 */ | 3964 | case 0xcc: /* int3 */ |
3966 | irq = 3; | 3965 | rc = emulate_int(ctxt, 3); |
3967 | goto do_interrupt; | 3966 | break; |
3968 | case 0xcd: /* int n */ | 3967 | case 0xcd: /* int n */ |
3969 | irq = c->src.val; | 3968 | rc = emulate_int(ctxt, c->src.val); |
3970 | do_interrupt: | ||
3971 | rc = emulate_int(ctxt, irq); | ||
3972 | break; | 3969 | break; |
3973 | case 0xce: /* into */ | 3970 | case 0xce: /* into */ |
3974 | if (ctxt->eflags & EFLG_OF) { | 3971 | if (ctxt->eflags & EFLG_OF) |
3975 | irq = 4; | 3972 | rc = emulate_int(ctxt, 4); |
3976 | goto do_interrupt; | ||
3977 | } | ||
3978 | break; | 3973 | break; |
3979 | case 0xd0 ... 0xd1: /* Grp2 */ | 3974 | case 0xd0 ... 0xd1: /* Grp2 */ |
3980 | rc = em_grp2(ctxt); | 3975 | rc = em_grp2(ctxt); |