diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2011-05-01 13:29:17 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:48:05 -0400 |
commit | 51187683cb11b959535d32eb91b673c6a9a03e88 (patch) | |
tree | cac660625747fcde1ef09f361fc7309d51bf578e /arch/x86/kvm | |
parent | 3b9be3bf2e4d45828f84ba615283a53d11ebf470 (diff) |
KVM: x86 emulator: Rename emulate_grpX() to em_grpX()
The prototypes are changed appropriately.
We also replaces "goto grp45;" with simple em_grp45() call.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 569e57dd1d55..d9ebf6939e49 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -1687,14 +1687,14 @@ static inline int emulate_iret(struct x86_emulate_ctxt *ctxt, | |||
1687 | } | 1687 | } |
1688 | } | 1688 | } |
1689 | 1689 | ||
1690 | static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt) | 1690 | static int em_grp1a(struct x86_emulate_ctxt *ctxt) |
1691 | { | 1691 | { |
1692 | struct decode_cache *c = &ctxt->decode; | 1692 | struct decode_cache *c = &ctxt->decode; |
1693 | 1693 | ||
1694 | return emulate_pop(ctxt, &c->dst.val, c->dst.bytes); | 1694 | return emulate_pop(ctxt, &c->dst.val, c->dst.bytes); |
1695 | } | 1695 | } |
1696 | 1696 | ||
1697 | static inline void emulate_grp2(struct x86_emulate_ctxt *ctxt) | 1697 | static int em_grp2(struct x86_emulate_ctxt *ctxt) |
1698 | { | 1698 | { |
1699 | struct decode_cache *c = &ctxt->decode; | 1699 | struct decode_cache *c = &ctxt->decode; |
1700 | switch (c->modrm_reg) { | 1700 | switch (c->modrm_reg) { |
@@ -1721,10 +1721,10 @@ static inline void emulate_grp2(struct x86_emulate_ctxt *ctxt) | |||
1721 | emulate_2op_SrcB("sar", c->src, c->dst, ctxt->eflags); | 1721 | emulate_2op_SrcB("sar", c->src, c->dst, ctxt->eflags); |
1722 | break; | 1722 | break; |
1723 | } | 1723 | } |
1724 | return X86EMUL_CONTINUE; | ||
1724 | } | 1725 | } |
1725 | 1726 | ||
1726 | static inline int emulate_grp3(struct x86_emulate_ctxt *ctxt, | 1727 | static int em_grp3(struct x86_emulate_ctxt *ctxt) |
1727 | struct x86_emulate_ops *ops) | ||
1728 | { | 1728 | { |
1729 | struct decode_cache *c = &ctxt->decode; | 1729 | struct decode_cache *c = &ctxt->decode; |
1730 | unsigned long *rax = &c->regs[VCPU_REGS_RAX]; | 1730 | unsigned long *rax = &c->regs[VCPU_REGS_RAX]; |
@@ -1763,7 +1763,7 @@ static inline int emulate_grp3(struct x86_emulate_ctxt *ctxt, | |||
1763 | return X86EMUL_CONTINUE; | 1763 | return X86EMUL_CONTINUE; |
1764 | } | 1764 | } |
1765 | 1765 | ||
1766 | static int emulate_grp45(struct x86_emulate_ctxt *ctxt) | 1766 | static int em_grp45(struct x86_emulate_ctxt *ctxt) |
1767 | { | 1767 | { |
1768 | struct decode_cache *c = &ctxt->decode; | 1768 | struct decode_cache *c = &ctxt->decode; |
1769 | int rc = X86EMUL_CONTINUE; | 1769 | int rc = X86EMUL_CONTINUE; |
@@ -1793,8 +1793,7 @@ static int emulate_grp45(struct x86_emulate_ctxt *ctxt) | |||
1793 | return rc; | 1793 | return rc; |
1794 | } | 1794 | } |
1795 | 1795 | ||
1796 | static inline int emulate_grp9(struct x86_emulate_ctxt *ctxt, | 1796 | static int em_grp9(struct x86_emulate_ctxt *ctxt) |
1797 | struct x86_emulate_ops *ops) | ||
1798 | { | 1797 | { |
1799 | struct decode_cache *c = &ctxt->decode; | 1798 | struct decode_cache *c = &ctxt->decode; |
1800 | u64 old = c->dst.orig_val64; | 1799 | u64 old = c->dst.orig_val64; |
@@ -3916,7 +3915,7 @@ special_insn: | |||
3916 | break; | 3915 | break; |
3917 | } | 3916 | } |
3918 | case 0x8f: /* pop (sole member of Grp1a) */ | 3917 | case 0x8f: /* pop (sole member of Grp1a) */ |
3919 | rc = emulate_grp1a(ctxt); | 3918 | rc = em_grp1a(ctxt); |
3920 | break; | 3919 | break; |
3921 | case 0x90 ... 0x97: /* nop / xchg reg, rax */ | 3920 | case 0x90 ... 0x97: /* nop / xchg reg, rax */ |
3922 | if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX]) | 3921 | if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX]) |
@@ -3932,7 +3931,7 @@ special_insn: | |||
3932 | case 0xa8 ... 0xa9: /* test ax, imm */ | 3931 | case 0xa8 ... 0xa9: /* test ax, imm */ |
3933 | goto test; | 3932 | goto test; |
3934 | case 0xc0 ... 0xc1: | 3933 | case 0xc0 ... 0xc1: |
3935 | emulate_grp2(ctxt); | 3934 | rc = em_grp2(ctxt); |
3936 | break; | 3935 | break; |
3937 | case 0xc3: /* ret */ | 3936 | case 0xc3: /* ret */ |
3938 | c->dst.type = OP_REG; | 3937 | c->dst.type = OP_REG; |
@@ -3967,11 +3966,11 @@ special_insn: | |||
3967 | rc = emulate_iret(ctxt, ops); | 3966 | rc = emulate_iret(ctxt, ops); |
3968 | break; | 3967 | break; |
3969 | case 0xd0 ... 0xd1: /* Grp2 */ | 3968 | case 0xd0 ... 0xd1: /* Grp2 */ |
3970 | emulate_grp2(ctxt); | 3969 | rc = em_grp2(ctxt); |
3971 | break; | 3970 | break; |
3972 | case 0xd2 ... 0xd3: /* Grp2 */ | 3971 | case 0xd2 ... 0xd3: /* Grp2 */ |
3973 | c->src.val = c->regs[VCPU_REGS_RCX]; | 3972 | c->src.val = c->regs[VCPU_REGS_RCX]; |
3974 | emulate_grp2(ctxt); | 3973 | rc = em_grp2(ctxt); |
3975 | break; | 3974 | break; |
3976 | case 0xe0 ... 0xe2: /* loop/loopz/loopnz */ | 3975 | case 0xe0 ... 0xe2: /* loop/loopz/loopnz */ |
3977 | register_address_increment(c, &c->regs[VCPU_REGS_RCX], -1); | 3976 | register_address_increment(c, &c->regs[VCPU_REGS_RCX], -1); |
@@ -4040,7 +4039,7 @@ special_insn: | |||
4040 | ctxt->eflags ^= EFLG_CF; | 4039 | ctxt->eflags ^= EFLG_CF; |
4041 | break; | 4040 | break; |
4042 | case 0xf6 ... 0xf7: /* Grp3 */ | 4041 | case 0xf6 ... 0xf7: /* Grp3 */ |
4043 | rc = emulate_grp3(ctxt, ops); | 4042 | rc = em_grp3(ctxt); |
4044 | break; | 4043 | break; |
4045 | case 0xf8: /* clc */ | 4044 | case 0xf8: /* clc */ |
4046 | ctxt->eflags &= ~EFLG_CF; | 4045 | ctxt->eflags &= ~EFLG_CF; |
@@ -4071,13 +4070,13 @@ special_insn: | |||
4071 | ctxt->eflags |= EFLG_DF; | 4070 | ctxt->eflags |= EFLG_DF; |
4072 | break; | 4071 | break; |
4073 | case 0xfe: /* Grp4 */ | 4072 | case 0xfe: /* Grp4 */ |
4074 | grp45: | 4073 | rc = em_grp45(ctxt); |
4075 | rc = emulate_grp45(ctxt); | ||
4076 | break; | 4074 | break; |
4077 | case 0xff: /* Grp5 */ | 4075 | case 0xff: /* Grp5 */ |
4078 | if (c->modrm_reg == 5) | 4076 | if (c->modrm_reg == 5) |
4079 | goto jump_far; | 4077 | goto jump_far; |
4080 | goto grp45; | 4078 | rc = em_grp45(ctxt); |
4079 | break; | ||
4081 | default: | 4080 | default: |
4082 | goto cannot_emulate; | 4081 | goto cannot_emulate; |
4083 | } | 4082 | } |
@@ -4344,7 +4343,7 @@ twobyte_insn: | |||
4344 | (u64) c->src.val; | 4343 | (u64) c->src.val; |
4345 | break; | 4344 | break; |
4346 | case 0xc7: /* Grp9 (cmpxchg8b) */ | 4345 | case 0xc7: /* Grp9 (cmpxchg8b) */ |
4347 | rc = emulate_grp9(ctxt, ops); | 4346 | rc = em_grp9(ctxt); |
4348 | break; | 4347 | break; |
4349 | default: | 4348 | default: |
4350 | goto cannot_emulate; | 4349 | goto cannot_emulate; |