diff options
author | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2012-11-12 17:03:20 +0000 |
---|---|---|
committer | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2012-11-12 17:03:20 +0000 |
commit | 38ede5d03b3cf5e929302fc539c00756e432fb8d (patch) | |
tree | 8c49ae02d17d098a9f43e7790b4da03f27a1c415 /tools/libxc | |
parent | a5bf5e04494fe280813c0b8e912b8d7856499f93 (diff) | |
download | xen-38ede5d03b3cf5e929302fc539c00756e432fb8d.tar.gz xen-38ede5d03b3cf5e929302fc539c00756e432fb8d.tar.bz2 xen-38ede5d03b3cf5e929302fc539c00756e432fb8d.zip |
tools: Synchronize privcmd header constants
Since Linux's git commit ceb90fa0a8008059ecbbf9114cb89dc71a730bb6,
the privcmd.h interface between Linux and libxc specifies two new
constants, PRIVCMD_MMAPBATCH_MFN_ERROR and
PRIVCMD_MMAPBATCH_PAGED_ERROR. These constants represent the error
codes encoded in the top nibble of an mfn slot passed to the legacy
MMAPBATCH ioctl.
In particular, libxenctrl checks for the equivalent of the latter
constant when dealing with paged out frames that might be the target
of a foreign map.
Previously, the relevant constant was defined in the domctl hypervisor
interface header (XEN_DOMCTL_PFINFO_PAGEDTAB). Because this
top-nibble encoding is a contract between the dom0 kernel and libxc,
a domctl.h definition is misplaced.
- Sync the privcmd.h header to that now available in upstream Linux
- Update libxc appropriately
- Remove the unnecessary constant in domctl.h
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbelL@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r-- | tools/libxc/xc_linux_osdep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c index 787e74285e..ca545d8228 100644 --- a/tools/libxc/xc_linux_osdep.c +++ b/tools/libxc/xc_linux_osdep.c @@ -129,7 +129,7 @@ static int xc_map_foreign_batch_single(int fd, uint32_t dom, do { - *mfn ^= XEN_DOMCTL_PFINFO_PAGEDTAB; + *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR; usleep(100); rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx); } @@ -166,8 +166,8 @@ static void *linux_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle for ( i = 0; i < num; i++ ) { - if ( (arr[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == - XEN_DOMCTL_PFINFO_PAGEDTAB ) + if ( (arr[i] & PRIVCMD_MMAPBATCH_MFN_ERROR) == + PRIVCMD_MMAPBATCH_PAGED_ERROR ) { unsigned long paged_addr = (unsigned long)addr + (i << XC_PAGE_SHIFT); rc = xc_map_foreign_batch_single(fd, dom, &arr[i], @@ -323,12 +323,12 @@ static void *linux_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h default: err[i] = -EINVAL; continue; - case XEN_DOMCTL_PFINFO_PAGEDTAB: + case PRIVCMD_MMAPBATCH_PAGED_ERROR: if ( rc != -ENOENT ) { err[i] = rc ?: -EINVAL; continue; - } + } rc = xc_map_foreign_batch_single(fd, dom, pfn + i, (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT)); if ( rc < 0 ) |