History

xen/privcmd: Add IOCTL_PRIVCMD_DM_OP

Recently a new dm_op[1] hypercall was added to Xen to provide a mechanism for restricting device emulators (such as QEMU) to a limited set of hypervisor operations, and being able to audit those operations in the kernel of the domain in which they run. This patch adds IOCTL_PRIVCMD_DM_OP as gateway for __HYPERVISOR_dm_op. NOTE: There is no requirement for user-space code to bounce data through locked memory buffers (as with IOCTL_PRIVCMD_HYPERCALL) since privcmd has enough information to lock the original buffers directly. [1] http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=524a98c2

Paul Durrant committed 9 years ago

Commit ab520be1 parent dc9eab69 files · +196 −0Browse files

Showing the changes to include/uapi (1 of 9 files). Show all

Unified · Split

include/uapi/xen/privcmd.h+13−0
@@ -77,6 +77,17 @@ struct privcmd_mmapbatch_v2 { · 76 unmodified lines
7777 int __user *err; /* array of error codes */
7878 };
7979
80+struct privcmd_dm_op_buf {
81+ void __user *uptr;
82+ size_t size;
83+};
84+
85+struct privcmd_dm_op {
86+ domid_t dom;
87+ __u16 num;
88+ const struct privcmd_dm_op_buf __user *ubufs;
89+};
90+
8091 /*
8192 * @cmd: IOCTL_PRIVCMD_HYPERCALL
8293 * @arg: &privcmd_hypercall_t
@@ -98,5 +109,7 @@ struct privcmd_mmapbatch_v2 { · 15 unmodified lines
98109 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
99110 #define IOCTL_PRIVCMD_MMAPBATCH_V2 \
100111 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
112+#define IOCTL_PRIVCMD_DM_OP \
113+ _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
101114
102115 #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */