> -----Original Message-----
> From: Jan Beulich [mailto:jbeul...@suse.com]
> Sent: 09 August 2018 10:09
> To: Paul Durrant <paul.durr...@citrix.com>
> Cc: Andrew Cooper <andrew.coop...@citrix.com>; George Dunlap
> <george.dun...@citrix.com>; Ian Jackson <ian.jack...@citrix.com>; Wei Liu
> <wei.l...@citrix.com>; Stefano Stabellini <sstabell...@kernel.org>; xen-
> devel <xen-devel@lists.xenproject.org>; Konrad Rzeszutek Wilk
> <konrad.w...@oracle.com>; Tim (Xen.org) <t...@xen.org>
> Subject: RE: [PATCH v22 1/2] common: add a new mappable resource type:
> XENMEM_resource_grant_table
> 
> >>> On 09.08.18 at 11:07,  wrote:
> >>>> On 09.08.18 at 10:55, <paul.durr...@citrix.com> wrote:
> > >> From: Jan Beulich [mailto:jbeul...@suse.com]
> > >> Sent: 09 August 2018 09:47
> > >>
> > >> >>> On 08.08.18 at 16:16, <paul.durr...@citrix.com> wrote:
> > >> > @@ -1046,6 +1090,16 @@ static int acquire_resource(
> > >> >          xen_pfn_t gfn_list[ARRAY_SIZE(mfn_list)];
> > >> >          unsigned int i;
> > >> >
> > >> > +        /*
> > >> > +         * FIXME: Until foreign pages inserted into the P2M are 
> > >> > properly
> > >> > +         *        reference counted, it is unsafe to allow mapping of
> > >> > +         *        non-caller-owned resource pages unless the caller is
> > >> > +         *        the hardware domain.
> > >> > +         */
> > >> > +        if ( !(xmar.flags & XENMEM_rsrc_acq_caller_owned) &&
> > >> > +             !is_hardware_domain(currd) )
> > >> > +            return -EOPNOTSUPP;
> > >> > +
> > >>
> > >> Now that I look at this again - wouldn't this check better live ahead
> > >> of the main switch()? I find it odd, for example, that in this case the
> > >> grant table would still have got grown.
> > >
> > > This can't live ahead of the main switch because
> > > XENMEM_rsrc_acq_caller_owned is passed-out flag, not a passed-in one.
> >
> > Oh, right. Except that only arch_acquire_resource() could currently
> > set the flag, and hence from this patch's perspective it's not visible
> > that this is an "out" flag. I guess you mean to set the flag in
> > acquire_grant_table() or next to the call to it.
> 
> Rubbish - the flag is supposed to be clear here. I'm sorry for the noise.
> 

I was just poised to say that :-)

 Paul

> Jan
> 


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

Reply via email to