[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] libxc: free thread specific hypercall buffer on xc_interface_close



On Wed, 2010-08-18 at 17:04 +0100, Christoph Egger wrote:
> This patch prevents me from starting a guest until
> the outstanding issue - namely why is hcall_buf_prep() never called -
> is solved.

You wouldn't expect hcall_buf_prep to be called if you opened the xc
interface and then closed it without doing a hypercall which required
any locked down memory.

This updated version of the patch was intended to handle exactly this
case since it appears that under NetBSD it can cause issues.

Are you saying that you are seeing hypercalls which you expect to need
memory locking down but for which that has not happened?

The callers of hcall_buf_prep are pretty explicit and there aren't that
many of them.

With the attached patch to libxc I get the following output when
starting xend, so you see it is quite normal for the xc interface to be
called when hcall_buf_prep has never been called and we now handle that
case correctly.

        xc_interface_open
        xc_interface_open
        xc_interface_open
        xc_interface_close
        xc_clean_hcall_buf
        _xc_init_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_open
        xc_interface_open
        xc_interface_open
        xc_interface_open
        xc_interface_open
        xc_interface_open
        xc_interface_open
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf

When starting a PV domain I get

        xc_interface_open
        xc_interface_close
        xc_clean_hcall_buf
        _xc_init_hcall_buf
        _xc_clean_hcall_buf
        Using config file "/etc/xen/debian-x86_32p-1".
        xc_interface_open
        hcall_buf_prep(0xbfb56ca8,144)
        _xc_init_hcall_buf
        hcall_buf_prep hcall_buf allocated at 0x804b0d8
        hcall_buf_prep hcall_buf->buf allocated at 0x804c000
        hcall_buf_prep using preallocated buffer at 0x804c000 for 0xbfb56ca8
        hcall_buf_release(0x804c000,144)
        hcall_buf_release releasing preallocated buffer at 0x804c000 for 
0xbfb56ca8
        xc_interface_close
        xc_clean_hcall_buf
        _xc_clean_hcall_buf
        _xc_clean_hcall_buf unlock and free hcall_buf->buf 0x804c000
        _xc_clean_hcall_buf free hcall_buf 0x804b0d8

It is also safe to call _xc_clean_hcall_buf and then later call
hcall_buf_prep (and therefore allocate a buffer).

Ian.

Attachment: foo
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.