xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
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>,
	KonradRzeszutek Wilk <konrad.wilk@oracle.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@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v9 10/11] common: add a new mappable resource type: XENMEM_resource_grant_table
Date: Wed, 11 Oct 2017 08:54:33 +0000	[thread overview]
Message-ID: <007174b4c34542359e774601ac13ed6e@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <59DDF6B80200007800184BFC@prv-mh.provo.novell.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 11 October 2017 09:47
> 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@lists.xenproject.org; KonradRzeszutek Wilk
> <konrad.wilk@oracle.com>; Tim (Xen.org) <tim@xen.org>
> Subject: RE: [Xen-devel] [PATCH v9 10/11] common: add a new mappable
> resource type: XENMEM_resource_grant_table
> 
> >>> On 10.10.17 at 18:01, <Paul.Durrant@citrix.com> wrote:
> >> > @@ -3795,6 +3807,18 @@ int gnttab_map_frame(struct domain *d,
> >> unsigned long idx, gfn_t gfn,
> >> >      return rc;
> >> >  }
> >> >
> >> > +int gnttab_get_frame(struct domain *d, unsigned long idx, mfn_t
> *mfn)
> >>
> >> const struct domain * (I realize now that the same should have
> >> been done for gnttab_map_frame() when it was introduced;
> >> perhaps you could change that at the same time).
> >
> > Again, the problem is that grow_table and functions it calls don't take a
> > const pointer. I tried cascading the const through to the underlying function
> > but the patch started to balloon so I think such work should be deferred.
> 
> Right, I had overlooked that. And it won't work, as
> share_xen_page_with_guest() can't be passed a const pointer.
> 
> >> > @@ -993,6 +1018,11 @@ static int acquire_resource(const
> >> xen_mem_acquire_resource_t *xmar)
> >> >                                           xmar->nr_frames, mfn_list);
> >> >          break;
> >> >
> >> > +    case XENMEM_resource_grant_table:
> >> > +        rc = acquire_grant_table(d, xmar->id, xmar->frame,
> >> > +                                 xmar->nr_frames, mfn_list);
> >> > +        break;
> >>
> >> Is this really generally useful with mfn_list[] having just two entries?
> >>
> >
> > Good point. I'll increase the size of the array in this patch (to the
> > default table size of 32... I think that's a reasonable value to choose).
> 
> I suppose for the only current use you have for this (seeding the
> grant table from the tool stack) even the two entries you have
> right now would suffice. If, however, a full grant table is supposed
> to be accessible this way, I can't see how a static upper limit will do.
> Or if you intend the caller to do multiple invocations in such a case,
> there ought to be a way to find out the (implementation) limit.

I'm open to ideas but there clearly needs to be some sort of upper limit, or we do away with being able to map multiple frames in a single invocation. The dm_op hypercalls currently have a similar upper limit on the size of the buffer array. I'd rather not have to introduce another hypercall just to find out such a thing. It's a tools-only hypercall so could I not just add a comment on what the limit currently is?

  Paul

> 
> Jan


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

  reply	other threads:[~2017-10-11  8:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 12:25 [PATCH v9 00/11] x86: guest resource mapping Paul Durrant
2017-10-06 12:25 ` [PATCH v9 01/11] x86/hvm/ioreq: maintain an array of ioreq servers rather than a list Paul Durrant
2017-10-09 12:40   ` Jan Beulich
2017-10-09 12:45     ` Paul Durrant
2017-10-06 12:25 ` [PATCH v9 02/11] x86/hvm/ioreq: simplify code and use consistent naming Paul Durrant
2017-10-06 12:25 ` [PATCH v9 03/11] x86/hvm/ioreq: use gfn_t in struct hvm_ioreq_page Paul Durrant
2017-10-06 12:25 ` [PATCH v9 04/11] x86/hvm/ioreq: defer mapping gfns until they are actually requsted Paul Durrant
2017-10-09 12:45   ` Jan Beulich
2017-10-09 12:47     ` Paul Durrant
2017-10-06 12:25 ` [PATCH v9 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources Paul Durrant
2017-10-09 13:05   ` Jan Beulich
2017-10-10 13:26     ` Paul Durrant
2017-10-11  8:20       ` Jan Beulich
2017-10-09 14:23   ` Jan Beulich
2017-10-10 14:10     ` Paul Durrant
2017-10-10 14:37       ` Paul Durrant
2017-10-11  8:30         ` Jan Beulich
2017-10-11  8:38           ` Paul Durrant
2017-10-11  8:48             ` Jan Beulich
2017-10-06 12:25 ` [PATCH v9 06/11] x86/hvm/ioreq: add a new mappable resource type Paul Durrant
2017-10-09 15:20   ` Jan Beulich
2017-10-10 14:45     ` Paul Durrant
2017-10-11  8:35       ` Jan Beulich
2017-10-06 12:25 ` [PATCH v9 07/11] x86/mm: add an extra command to HYPERVISOR_mmu_update Paul Durrant
2017-10-09 15:44   ` Jan Beulich
2017-10-06 12:25 ` [PATCH v9 08/11] tools/libxenforeignmemory: add support for resource mapping Paul Durrant
2017-10-06 12:25 ` [PATCH v9 09/11] tools/libxenforeignmemory: reduce xenforeignmemory_restrict code footprint Paul Durrant
2017-10-06 12:25 ` [PATCH v9 10/11] common: add a new mappable resource type: XENMEM_resource_grant_table Paul Durrant
2017-10-10 10:25   ` Jan Beulich
2017-10-10 16:01     ` Paul Durrant
2017-10-11  8:47       ` Jan Beulich
2017-10-11  8:54         ` Paul Durrant [this message]
2017-10-11  9:43           ` Jan Beulich
2017-10-11  9:54             ` Paul Durrant
2017-10-11 10:12               ` Jan Beulich
2017-10-06 12:25 ` [PATCH v9 11/11] 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=007174b4c34542359e774601ac13ed6e@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=konrad.wilk@oracle.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).