summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2011-05-29 22:02:55 +0900
committerAvi Kivity <avi@redhat.com>2011-07-12 13:16:04 +0300
commit5c5df76b8b32055956ee4cca338d29046016b13e (patch)
tree572e449ac053fd778289bafcbd2216bbc176dcfe /arch/x86
parent1bd5f469b2d54330ba41d9c4b857dc5051e8dcf7 (diff)
downloadblackbird-op-linux-5c5df76b8b32055956ee4cca338d29046016b13e.tar.gz
blackbird-op-linux-5c5df76b8b32055956ee4cca338d29046016b13e.zip
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')
-rw-r--r--arch/x86/kvm/emulate.c15
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)
struct decode_cache *c = &ctxt->decode;
int rc = X86EMUL_CONTINUE;
int saved_dst_type = c->dst.type;
- int irq; /* Used for int 3, int, and into */
c->mem_read.pos = 0;
@@ -3963,18 +3962,14 @@ special_insn:
rc = emulate_load_segment(ctxt, VCPU_SREG_DS);
break;
case 0xcc: /* int3 */
- irq = 3;
- goto do_interrupt;
+ rc = emulate_int(ctxt, 3);
+ break;
case 0xcd: /* int n */
- irq = c->src.val;
- do_interrupt:
- rc = emulate_int(ctxt, irq);
+ rc = emulate_int(ctxt, c->src.val);
break;
case 0xce: /* into */
- if (ctxt->eflags & EFLG_OF) {
- irq = 4;
- goto do_interrupt;
- }
+ if (ctxt->eflags & EFLG_OF)
+ rc = emulate_int(ctxt, 4);
break;
case 0xd0 ... 0xd1: /* Grp2 */
rc = em_grp2(ctxt);
OpenPOWER on IntegriCloud