Su, Disheng
2008-Feb-01 06:24 UTC
[Xen-devel] [PATCH 1/4] Enable VirtualPC 2007 run on top of XEN : ltr emulation
LTR will set busy bit in TR descriptor. IF guest CR0.wp is 0 and that descriptor is ReadOnly, we have to emulate this instruction. Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Disheng Su <disheng.su.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2008-Feb-01 09:19 UTC
Re: [Xen-devel] [PATCH 1/4] Enable VirtualPC 2007 run on top of XEN :ltr emulation
>@@ -2878,6 +2878,29 @@ x86_emulate( > twobyte_special_insn: > switch ( b ) > { >+ case 0x00: /* Grp6 */ >+ switch ( modrm_reg ) >+ { >+ case 0x3: /* ltr */ >+ { >+ unsigned long sel = 0; >+ >+ if ( ea.type == OP_REG ) >+ sel = *ea.reg & 0xffff; >+ else >+ if ( (rc = ops->read(ea.mem.seg, ea.mem.off, >+ &sel, sizeof(uint16_t), ctxt)) ) >+ goto done; >+ >+ if ( (rc = ops->ltr(sel, ctxt)) )You should check ops->ltr against NULL before this call (perhaps the whole block should be inside a respective if() clause).>+ goto done; >+ } >+ break; >+ default: >+ goto cannot_emulate; >+ } >+ break; >+ > case 0x01: /* Grp7 */ { > struct segment_register reg; > unsigned long base, limit, cr0, cr0w;_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel