This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] passing hypercall parameters by pointer

On Aug 19, 2005, at 9:35 AM, Keir Fraser wrote:

On 19 Aug 2005, at 14:57, Hollis Blanchard wrote:

- replace libxc calls to mlock() with register_this_address() (which could be a privcmd ioctl)

Yep. I think libxc would request via a privcmd ioctl. The kernel can extend the parameter-passing region, or allocate a subsection of the existing region, and mmap it into user space. It would also return to libxc the range of parameter-passing addresses that have been allocated to it.

- libxc ignorantly creates its structures with userspace addresses

libxc would create structs with parameter-passing addresses.

Does "parameter-passing addresses" mean offsets inside the parameter passing space?

I think pseudocode is going to be more effective than English here. Let's take DOM0_PERFCCONTROL as an example:

main() {
    xc_perfc_desc_t *desc = malloc();
    mlock(desc); // <------------- [1]

xc_perfc_control(xc_perfc_desc_t *desc) {
    dom0_op_t dop;

    dop.cmd = DOM0_PERFCCONTROL;
    dop.u.perfccontrol.desc = desc; // <------------ [2]

Even if you replace malloc/mlock at [1] with a call that maps "parameter passing" space into this process, what address will you put in the struct at [2]? That would have to be an offset within the parameter passing space, right?

Hollis Blanchard
IBM Linux Technology Center

Xen-devel mailing list