All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: elena.ufimtseva@oracle.com, wei.liu2@citrix.com,
	ian.campbell@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, keir@xen.org,
	dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v7 2/5] sysctl: Add sysctl interface for querying PCI topology
Date: Fri, 24 Apr 2015 10:09:00 -0400	[thread overview]
Message-ID: <553A4E7C.90805@oracle.com> (raw)
In-Reply-To: <553A0AA6020000780007573E@mail.emea.novell.com>


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.

(And my second paragraph was not stated correctly, now that I re-read 
it. I meant to say that my understanding is that API is expected to make 
all safety checks on buffers and with set_xen_guest_handle_offset() that 
I was picturing in my head we could pass in pretty much any pointer. I 
suppose we could check 'hbuf+offset < sz')


-boris

  reply	other threads:[~2015-04-24 14:09 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 [this message]
2015-04-24 17:42           ` Boris Ostrovsky
2015-05-01 13:56             ` Ian Campbell
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=553A4E7C.90805@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.