All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: elena.ufimtseva@oracle.com, wei.liu2@citrix.com,
	stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com,
	dario.faggioli@citrix.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	keir@xen.org, dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v7 2/5] sysctl: Add sysctl interface for querying PCI topology
Date: Fri, 1 May 2015 14:56:23 +0100	[thread overview]
Message-ID: <1430488583.15640.36.camel@citrix.com> (raw)
In-Reply-To: <553A8087.8000107@oracle.com>

On Fri, 2015-04-24 at 13:42 -0400, Boris Ostrovsky wrote:
> On 04/24/2015 10:09 AM, Boris Ostrovsky wrote:
> >
> > On 04/24/2015 03:19 AM, Jan Beulich wrote:
> >>>>> On 24.04.15 at 00:20, <boris.ostrovsky@oracle.com> wrote:
> >>> On 04/21/2015 03:01 AM, Jan Beulich wrote:
> >>>>> +                 ((++dev_cnt > 0x3f) && hypercall_preempt_check()) )
> >>>>> +                break;
> >>>>> +        }
> >>>>> +
> >>>>> +        if ( (!ret || (ret == -ENODEV)) &&
> >>>>> +             __copy_field_to_guest(u_sysctl, op, 
> >>>>> u.pcitopoinfo.first_dev) )
> >>>>> +            ret = -EFAULT;
> >>>>> +    }
> >>>>> +    break;
> >>>>> +#endif
> >>>> With the continuation-less model now used I don't think it makes
> >>>> sense to have first_dev and num_devs - for re-invocation all the
> >>>> caller needs to do is increment the buffer pointer suitably. I.e.
> >>>> you can get away with just a count of devices afaict.
> >>>>
> >>> This would require walking xc_hypercall_buffer_t->hbuf. Would 
> >>> something like
> >>>
> >>>       set_xen_guest_handle_raw(sysctl..., (void 
> >>> *)HYPERCALL_BUFFER_AS_ARG(foo) + offset)
> >>>
> >>> be acceptable? I don't think I see anything better.
> >>>
> >>> I thought of adding set_xen_guest_handle_offset() that would look
> >>> similar to set_xen_guest_handle() but then I felt that having this in
> >>> API may not be a good idea since xc_hypercall_buffer_t->hbuf would end
> >>> up pointing to memory that is not allocated for full
> >>> xc_hypercall_buffer_t->sz.
> >> There ought to be a way to create a guest handle from other than
> >> the start of an allocated hypercall buffer, but that's really more a
> >> question for the tool stack folks.
> >
> > Yes, this was question for toolstack people.
> 
> (Adjusted TO/CC to reflect this).

Not sure if I've got the full context but would it be possible to
rearrange things such that libxc was bouncing/unbouncing only the slice
of the input which is needed for the invocation? Perhaps by pushing it
into whichever loop there is.

If not then I think set_xen_guest_handle_offset or perhaps
guest_handle_add_offset (in line with the xen side equivalent) would be
the way to go.

Under no circumstances should set_xen_guest_handle_raw be being used.

Ian.

  reply	other threads:[~2015-05-01 13:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 16:59 [PATCH v7 0/5] Display IO topology when PXM data is available (plus some cleanup) Boris Ostrovsky
2015-04-17 16:59 ` [PATCH v7 1/5] sysctl: Make XEN_SYSCTL_numainfo a little more efficient Boris Ostrovsky
2015-04-17 17:14   ` Andrew Cooper
2015-04-17 16:59 ` [PATCH v7 2/5] sysctl: Add sysctl interface for querying PCI topology Boris Ostrovsky
2015-04-17 17:16   ` Andrew Cooper
2015-04-21  7:01   ` Jan Beulich
2015-04-21 12:56     ` Boris Ostrovsky
2015-04-21 13:14       ` Andrew Cooper
2015-04-21 13:13         ` Boris Ostrovsky
2015-04-21 13:30           ` Andrew Cooper
2015-04-21 13:18       ` Jan Beulich
2015-04-23 22:20     ` Boris Ostrovsky
2015-04-24  7:19       ` Jan Beulich
2015-04-24 14:09         ` Boris Ostrovsky
2015-04-24 17:42           ` Boris Ostrovsky
2015-05-01 13:56             ` Ian Campbell [this message]
2015-05-01 15:20               ` Boris Ostrovsky
2015-05-01 15:31                 ` Ian Campbell
2015-04-17 16:59 ` [PATCH v7 3/5] libxl/libxc: Move libxl_get_cpu_topology()'s hypercall buffer management to libxc Boris Ostrovsky
2015-04-17 16:59 ` [PATCH v7 4/5] libxl/libxc: Move libxl_get_numainfo()'s " Boris Ostrovsky
2015-04-17 16:59 ` [PATCH v7 5/5] libxl: Add interface for querying hypervisor about PCI topology Boris Ostrovsky
2015-04-21 11:27   ` Ian Campbell

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=1430488583.15640.36.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dario.faggioli@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=elena.ufimtseva@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.