Re: [PATCH v2 6/8] KVM: x86 emulator: simplify instruction decode flags for opcodes C0-DF

Avi Kivity
2010-08-26T08:51:04Z

On 08/26/2010 11:47 AM, Wei Yongjun wrote:
>> Use the new byte/word dual opcode decode.
>>
>> Signed-off-by: Avi Kivity <avi@redhat.com>
>> ---
>> arch/x86/kvm/emulate.c | 7 +++----
>> 1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
>> index 935f98e..2610fc5 100644
>> --- a/arch/x86/kvm/emulate.c
>> +++ b/arch/x86/kvm/emulate.c
>> @@ -2466,17 +2466,16 @@ static struct opcode opcode_table[256] = {
>> /* 0xB8 - 0xBF */
>> X8(D(DstReg | SrcImm | Mov)),
>> /* 0xC0 - 0xC7 */
>> - D(ByteOp | DstMem | SrcImm | ModRM), D(DstMem | SrcImmByte | ModRM),
>> + D2bv(DstMem | SrcImm | ModRM),
>>
> 0xC1 takes imm8 as the source operand.

Good catch.

> So D2bv can not be used here.

It can, just needs to be D2bv(DstMem | SrcImmByte | ModRM).

--
error compiling committee.c: too many arguments to function