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
77 int __user *err; /* array of error codes */77 int __user *err; /* array of error codes */
78};78};
79 79
80struct privcmd_dm_op_buf {
81 void __user *uptr;
82 size_t size;
83};
84
85struct privcmd_dm_op {
86 domid_t dom;
87 __u16 num;
88 const struct privcmd_dm_op_buf __user *ubufs;
89};
90
80/*91/*
81 * @cmd: IOCTL_PRIVCMD_HYPERCALL92 * @cmd: IOCTL_PRIVCMD_HYPERCALL
82 * @arg: &privcmd_hypercall_t93 * @arg: &privcmd_hypercall_t
@@ -98,5 +109,7 @@ struct privcmd_mmapbatch_v2 { · 15 unmodified lines
98 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))109 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
99#define IOCTL_PRIVCMD_MMAPBATCH_V2 \110#define IOCTL_PRIVCMD_MMAPBATCH_V2 \
100 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))111 _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))
101 114
102#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */115#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */