mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
libxencall: osdep_hypercall() should return long
Some hypercalls, memory-op in particular, can return values requiring
more than 31 bits to represent. Hence the underlying layers need to make
sure they won't truncate such values. (Note that for Solaris the
function also gets renamed, to match the other OSes.)
Due to them merely propagating ioctl()'s return value, this change is
benign on Linux and Solaris. IOW there's an actual effect here only for
the BSDs and MiniOS, but even then further adjustments are needed at the
xencall<N>() level.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
Backport-requested-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 6409210a5f)
This commit is contained in:
1 parent
0f1002d406
commit
c773053bdb
6 files changed
+6
-6
No files matched your search
@@ -62,7 +62,7 @@ int osdep_xencall_close(xencall_handle *xcall)
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
long osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
{
|
||||
int fd = xcall->fd;
|
||||
int ret;
|
||||
|
||||
@@ -80,7 +80,7 @@ int osdep_xencall_close(xencall_handle *xcall)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
long osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
{
|
||||
return ioctl(xcall->fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ int osdep_xencall_close(xencall_handle *xcall)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
long osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
{
|
||||
multicall_entry_t call;
|
||||
int i, ret;
|
||||
|
||||
@@ -96,7 +96,7 @@ void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
long osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
{
|
||||
int fd = xcall->fd;
|
||||
int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
|
||||
|
||||
@@ -55,7 +55,7 @@ struct xencall_handle {
|
||||
int osdep_xencall_open(xencall_handle *xcall);
|
||||
int osdep_xencall_close(xencall_handle *xcall);
|
||||
|
||||
int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall);
|
||||
long osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall);
|
||||
|
||||
void *osdep_alloc_pages(xencall_handle *xcall, size_t nr_pages);
|
||||
void osdep_free_pages(xencall_handle *xcall, void *p, size_t nr_pages);
|
||||
|
||||
@@ -80,7 +80,7 @@ void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
long osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
|
||||
{
|
||||
int fd = xcall->fd;
|
||||
return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
|
||||
|
||||