From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Ian Campbell <ian.campbell@citrix.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, 01 May 2015 11:20:16 -0400 [thread overview]
Message-ID: <554399B0.8030308@oracle.com> (raw)
In-Reply-To: <1430488583.15640.36.camel@citrix.com>
On 05/01/2015 09:56 AM, Ian Campbell wrote:
> 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
The hypervisor only processes part of the buffer and returns back to the
caller how many elements are done. The caller advances the buffer
pointer and retries the hypercall.
> 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.
Oh yes, that is certainly possible. I am just trying to avoid doing this
because of the overhead of copying buffers back and forth many times.
The worst thing is that with current bounce APIs I'd need to bounce full
buffer, even though I will only need to do so for a part of it.
In other words, imagine we have 1024 elements in the buffer originally
and the hypervisor only completes 256 elements at a time. I will then
need to bounce [0-1024], [256-1024], [512-1024] and then [768-1024]
elements. Not 4 chunks of 256 element as one would want.
I looked at HYPERCALL_BOUNCE_SET_SIZE but I don't think it will help
here since we only know "useful" (i.e. processed by the hypervisor)
buffer size after the hypercall (i.e. for the unbounce path).
>
> 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.
But it can be used inside the new set_xen_guest_handle_offset(), right?
-boris
next prev parent reply other threads:[~2015-05-01 15:20 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
2015-05-01 15:20 ` Boris Ostrovsky [this message]
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=554399B0.8030308@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=elena.ufimtseva@oracle.com \
--cc=ian.campbell@citrix.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.