diff options
author | Andres Lagar-Cavilla <andreslc@gridcentric.ca> | 2012-08-31 09:59:30 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-09-05 16:36:26 -0400 |
commit | ceb90fa0a8008059ecbbf9114cb89dc71a730bb6 (patch) | |
tree | 0f0507ed14176b7e17508b551cd22fef722dde0a /include/xen/privcmd.h | |
parent | 69870a847856a1ba81f655a8633fce5f5b614730 (diff) |
xen/privcmd: add PRIVCMD_MMAPBATCH_V2 ioctl
PRIVCMD_MMAPBATCH_V2 extends PRIVCMD_MMAPBATCH with an additional
field for reporting the error code for every frame that could not be
mapped. libxc prefers PRIVCMD_MMAPBATCH_V2 over PRIVCMD_MMAPBATCH.
Also expand PRIVCMD_MMAPBATCH to return appropriate error-encoding top nibble
in the mfn array.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'include/xen/privcmd.h')
-rw-r--r-- | include/xen/privcmd.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h index 45c1aa14b83d..a85316811d79 100644 --- a/include/xen/privcmd.h +++ b/include/xen/privcmd.h | |||
@@ -58,13 +58,33 @@ struct privcmd_mmapbatch { | |||
58 | int num; /* number of pages to populate */ | 58 | int num; /* number of pages to populate */ |
59 | domid_t dom; /* target domain */ | 59 | domid_t dom; /* target domain */ |
60 | __u64 addr; /* virtual address */ | 60 | __u64 addr; /* virtual address */ |
61 | xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */ | 61 | xen_pfn_t __user *arr; /* array of mfns - or'd with |
62 | PRIVCMD_MMAPBATCH_*_ERROR on err */ | ||
63 | }; | ||
64 | |||
65 | #define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U | ||
66 | #define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U | ||
67 | |||
68 | struct privcmd_mmapbatch_v2 { | ||
69 | unsigned int num; /* number of pages to populate */ | ||
70 | domid_t dom; /* target domain */ | ||
71 | __u64 addr; /* virtual address */ | ||
72 | const xen_pfn_t __user *arr; /* array of mfns */ | ||
73 | int __user *err; /* array of error codes */ | ||
62 | }; | 74 | }; |
63 | 75 | ||
64 | /* | 76 | /* |
65 | * @cmd: IOCTL_PRIVCMD_HYPERCALL | 77 | * @cmd: IOCTL_PRIVCMD_HYPERCALL |
66 | * @arg: &privcmd_hypercall_t | 78 | * @arg: &privcmd_hypercall_t |
67 | * Return: Value returned from execution of the specified hypercall. | 79 | * Return: Value returned from execution of the specified hypercall. |
80 | * | ||
81 | * @cmd: IOCTL_PRIVCMD_MMAPBATCH_V2 | ||
82 | * @arg: &struct privcmd_mmapbatch_v2 | ||
83 | * Return: 0 on success (i.e., arg->err contains valid error codes for | ||
84 | * each frame). On an error other than a failed frame remap, -1 is | ||
85 | * returned and errno is set to EINVAL, EFAULT etc. As an exception, | ||
86 | * if the operation was otherwise successful but any frame failed with | ||
87 | * -ENOENT, then -1 is returned and errno is set to ENOENT. | ||
68 | */ | 88 | */ |
69 | #define IOCTL_PRIVCMD_HYPERCALL \ | 89 | #define IOCTL_PRIVCMD_HYPERCALL \ |
70 | _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) | 90 | _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) |
@@ -72,5 +92,7 @@ struct privcmd_mmapbatch { | |||
72 | _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) | 92 | _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) |
73 | #define IOCTL_PRIVCMD_MMAPBATCH \ | 93 | #define IOCTL_PRIVCMD_MMAPBATCH \ |
74 | _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) | 94 | _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) |
95 | #define IOCTL_PRIVCMD_MMAPBATCH_V2 \ | ||
96 | _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2)) | ||
75 | 97 | ||
76 | #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ | 98 | #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ |