From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Jan Beulich' <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
Andrew Cooper <Andrew.Cooper3@citrix.com>,
"Tim (Xen.org)" <tim@xen.org>,
George Dunlap <George.Dunlap@citrix.com>,
Ian Jackson <Ian.Jackson@citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v22 1/2] common: add a new mappable resource type: XENMEM_resource_grant_table
Date: Thu, 9 Aug 2018 09:11:14 +0000 [thread overview]
Message-ID: <fe8a10229ca742328f3dbb9559ae868d@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <5B6C04A102000078001DC5F1@prv1-mh.provo.novell.com>
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 09 August 2018 10:09
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; George Dunlap
> <George.Dunlap@citrix.com>; Ian Jackson <Ian.Jackson@citrix.com>; Wei Liu
> <wei.liu2@citrix.com>; Stefano Stabellini <sstabellini@kernel.org>; xen-
> devel <xen-devel@lists.xenproject.org>; Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com>; Tim (Xen.org) <tim@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.Durrant@citrix.com> wrote:
> > >> From: Jan Beulich [mailto:JBeulich@suse.com]
> > >> Sent: 09 August 2018 09:47
> > >>
> > >> >>> On 08.08.18 at 16:16, <paul.durrant@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
next prev parent reply other threads:[~2018-08-09 9:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 14:16 [PATCH v22 0/2] guest resource mapping (reprise) Paul Durrant
2018-08-08 14:16 ` [PATCH v22 1/2] common: add a new mappable resource type: XENMEM_resource_grant_table Paul Durrant
2018-08-09 8:46 ` Jan Beulich
2018-08-09 8:55 ` Paul Durrant
2018-08-09 9:07 ` Jan Beulich
2018-08-09 9:13 ` Paul Durrant
2018-08-09 9:42 ` Jan Beulich
2018-08-09 9:08 ` Jan Beulich
2018-08-09 9:11 ` Paul Durrant [this message]
2018-08-08 14:16 ` [PATCH v22 2/2] tools/libxenctrl: use new xenforeignmemory API to seed grant table Paul Durrant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe8a10229ca742328f3dbb9559ae868d@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=George.Dunlap@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=JBeulich@suse.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).