Li, Xin B
2007-Jul-02 16:03 UTC
[Xen-devel] [PATCH] add mov instruction decoder in protected to real mode in vmxassist
decode mov instruction in protected to real mode in vmxassist. Also some clean up. Signed-off-by: Xin Li <xin.b.li@intel.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2007-Jul-03 08:29 UTC
Re: [Xen-devel] [PATCH] add mov instruction decoder in protected toreal mode in vmxassist
>>> "Li, Xin B" <xin.b.li@intel.com> 02.07.07 18:03 >>> >decode mov instruction in protected to real mode in vmxassist. >Also some clean up. > >Signed-off-by: Xin Li <xin.b.li@intel.com>This is what I really don''t like about decoder adjustments: Even when changes for a certain instruction type are found necessary, no care is taken that similar instructions are also updated/added. In this case, for instance, you add the register destination/source case for opcode 0x89/0x8B, but the same adjustments aren''t made for opcode 0x88/0x8A. This is calling for future problems, as much as e.g. the absence of emulation of opcode 0xC7 despite present emulation of 0xC6. I''m not going to continue, but I suppose you get my point. Also, how come that the mode/address size conditions are different for 0x88/0x8A versus 0x89/0x8B (they were identical so far for 0x88, 0x8A, and 0x8B, with some extra code for 0x89)? Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Li, Xin B
2007-Jul-03 09:16 UTC
RE: [Xen-devel] [PATCH] add mov instruction decoder inprotected toreal mode in vmxassist
>This is what I really don''t like about decoder adjustments: >Even when changes for a certain instruction type are found necessary,no care is>taken that similar instructions are also updated/added. In this case,for>instance, you add the register destination/source case for opcode0x89/0x8B, but the>same adjustments aren''t made for opcode 0x88/0x8A. This is calling forfuture>problems, as much as e.g. the absence of emulation of opcode 0xC7despite>present emulation of 0xC6. I''m not going to continue, but I suppose youget my point. A complete, maybe perfect, decoder, that''s also my ultimate goal :-).> >Also, how come that the mode/address size conditions are different for >0x88/0x8A versus 0x89/0x8B (they were identical so far for 0x88, 0x8A,and>0x8B, with some extra code for 0x89)?I don''t expect 0x89/0x8B (movb) will be used in switching from protected mode to real mode. Intel SDM says, once software changes CR0.PE, it should *immediately* use a long jump instruction to finish the mode switching between real-address mode and protected mode. But this is not strictly obeyed, and this is why I added the mov decoder here. I will prefer to keep the VMXAssist decoder relatively small. -Xin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel