Re: [PATCH 4/4] KVM: x86 emulator: Avoid pushing back ModRM byte in decode_opcode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Tue, 24 Apr 2012 17:10:08 +0300
Avi Kivity <avi@xxxxxxxxxx> wrote:

> > +	if (!modrm_fetched && (ctxt->d & ModRM))
> > +		ctxt->modrm = insn_fetch(u8, ctxt);
> 
> Instead of adding yet another conditional, how about doing something like
> 
>    if ((c->d & ModRM) || (gtype == Group) || (gtype == GroupDual))
>           ctxt->modrm = insn_fetch(u8, ctxt);
> 
> somewhere early?

Looks nicer than mine.

> In fact even that is too much.  All groups have ModRM somewhere in their
> encoding; all we have to do is move it to the main tables (opcode_table
> or twobyte_table) and just move the existing modrm fetch before group
> parsing.

I see.

Then, the best way to go seems to be drop patch-4 and work on the ModRM
fetch issue separately.

Modifying the tables needs some care.

Thanks,
	Takuya
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[KVM ARM]     [KVM ia64]     [KVM ppc]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux