[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] ignore guest writes to read only memory regions or memory holes in EPT
Oh, another reason to reject this approach is that, just because an instruction's write to read-only memory should be thrown away, doesn't mean it doesn't have other necessary side effects. For example, STOS or MOVS must be emulated to have their required effect on the register file. So please comment on my suggested alternative sketched-out patch. -- Keir On 26/10/2009 08:27, "Jan Beulich" <JBeulich@xxxxxxxxxx> wrote: > After looking at the documentation I don't think using > __get_instruction_length() here is valid, i.e. you need to decode the > instruction in order to be able to skip it. Otherwise, could you have > your doc folks update the documentation (24.2.4) accordingly? > > Jan > >>>> "Li, Xin" <xin.li@xxxxxxxxx> 23.10.09 09:26 >>> > ignore guest writes to read only memory regions or memory holes in EPT. > > This patch prevents domain crash when running memtest86 with EPT. > > Signed-off-by: Xin Li <xin.li@xxxxxxxxx> > > diff -r 37829fd7c1e3 xen/arch/x86/hvm/vmx/vmx.c > --- a/xen/arch/x86/hvm/vmx/vmx.c Wed Oct 21 16:08:28 2009 +0100 > +++ b/xen/arch/x86/hvm/vmx/vmx.c Fri Oct 23 23:21:27 2009 +0800 > @@ -2184,6 +2184,17 @@ > return; > } > > + /* Ignore writes to: > + * 1. read only memory regions; > + * 2. memory holes. */ > + if ( (qualification & EPT_WRITE_VIOLATION) > + && (((gla_validity == EPT_GLA_VALIDITY_MATCH) && (t == p2m_ram_ro)) > + || (mfn_x(mfn) == INVALID_MFN)) ) { > + int inst_len = __get_instruction_length(); > + __update_guest_eip(inst_len); > + return; > + } > + > /* Everything else is an error. */ > gla = __vmread(GUEST_LINEAR_ADDRESS); > gdprintk(XENLOG_ERR, "EPT violation %#lx (%c%c%c/%c%c%c), " > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@xxxxxxxxxxxxxxxxxxx > http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |