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

Re: [Xen-devel] [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.Durrant@xxxxxxxxxx> wrote:
> >> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> >> Sent: 09 August 2018 09:47
> >> 
> >> >>> On 08.08.18 at 16:16, <paul.durrant@xxxxxxxxxx> 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.

Jan



_______________________________________________
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®.