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

Re: [Xen-devel] [PATCH 5/3] x86/shadow: emulate_gva_to_mfn() should respect p2m_ioreq_server



At 12:44 +0000 on 14 Nov (1542199496), Paul Durrant wrote:
> > -----Original Message-----
> > From: Tim Deegan [mailto:tim@xxxxxxx]
> > Sent: 14 November 2018 12:42
> > To: Jan Beulich <JBeulich@xxxxxxxx>
> > Cc: Paul Durrant <Paul.Durrant@xxxxxxxxxx>; Andrew Cooper
> > <Andrew.Cooper3@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; xen-devel
> > <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> > Subject: Re: [PATCH 5/3] x86/shadow: emulate_gva_to_mfn() should respect
> > p2m_ioreq_server
> > 
> > At 04:22 -0700 on 13 Nov (1542082936), Jan Beulich wrote:
> > > >>> On 13.11.18 at 11:59, <Paul.Durrant@xxxxxxxxxx> wrote:
> > > >> Subject: [PATCH 5/3] x86/shadow: emulate_gva_to_mfn() should respect
> > > >> p2m_ioreq_server
> > > >>
> > > >> Writes to such pages would need to be handed to the emulator, which
> > we're
> > > >> not prepared to do at this point.
> > > >>
> > > >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> > > >>
> > > >> --- a/xen/arch/x86/mm/shadow/hvm.c
> > > >> +++ b/xen/arch/x86/mm/shadow/hvm.c
> > > >> @@ -338,7 +338,7 @@ static mfn_t emulate_gva_to_mfn(struct v
> > > >>      {
> > > >>          return _mfn(BAD_GFN_TO_MFN);
> > > >>      }
> > > >> -    if ( p2m_is_discard_write(p2mt) )
> > > >> +    if ( p2m_is_discard_write(p2mt) || p2mt == p2m_ioreq_server )
> > > >>      {
> > > >>          put_page(page);
> > > >>          return _mfn(READONLY_GFN);
> > > >
> > > > Is this what we want here? I would have thought we want to return
> > > > BAD_GFN_TO_MFN in the p2m_ioreq_server case so that the caller treats
> > this in
> > > > the same way it would MMIO.
> > >
> > > I'm not sure which behavior is better; I'm certainly fine with switching
> > > as you say, but I'd first like to see Tim's opinion as well.
> > 
> > I'm not clear on what behaviour you want for this kind of page in
> > general -- I suspect I have missed or forgotten some context.  If the
> > guest's not supposed to write to it, then IMO you should add it to
> > P2M_DISCARD_WRITE_TYPES rather than special-casing it here.
> 
> The type has an odd semantic... it needs to read as normal RAM but writes 
> need to hit emulation. The use-case is for GVT-g where the emulator needs to 
> intercept writes to the graphics pagetables in guest RAM.

I see, thanks.  In that case, I agree with you that you should signal
this as BAD_GFN_TO_MFN here to trigger the MMIO path.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.