> -----Original Message----- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 13 November 2018 10:14 > To: xen-devel <xen-devel@lists.xenproject.org> > Cc: Andrew Cooper <andrew.coop...@citrix.com>; Paul Durrant > <paul.durr...@citrix.com>; Wei Liu <wei.l...@citrix.com> > Subject: [PATCH 2/3] x86/HVM: make hvmemul_map_linear_addr() honor > p2m_ioreq_server > > Write accesses to p2m_ioreq_server pages should get redirected to the > emulator also when using the mapping approach. Extend the > p2m_is_discard_write() check there, and restrict both to the write > access case (this is just a latent bug as currently we go this route > only for write accesses). > > Signed-off-by: Jan Beulich <jbeul...@suse.com>
Reviewed-by: Paul Durrant <paul.durr...@citrix.com> > > --- a/xen/arch/x86/hvm/emulate.c > +++ b/xen/arch/x86/hvm/emulate.c > @@ -613,10 +613,21 @@ static void *hvmemul_map_linear_addr( > > *mfn++ = page_to_mfn(page); > > - if ( p2m_is_discard_write(p2mt) ) > + if ( pfec & PFEC_write_access ) > { > - err = ERR_PTR(~X86EMUL_OKAY); > - goto out; > + if ( p2m_is_discard_write(p2mt) ) > + { > + err = ERR_PTR(~X86EMUL_OKAY); > + goto out; > + } > + > + if ( p2mt == p2m_ioreq_server ) > + { > + err = NULL; > + goto out; > + } > + > + ASSERT(p2mt == p2m_ram_logdirty || !p2m_is_readonly(p2mt)); > } > } > > > > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel