diff options
author | Avi Kivity <avi@qumranet.com> | 2007-02-22 05:58:31 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 03:52:23 -0400 |
commit | 9a2bb7f486dc639a1cf2ad803bf2227f0dc0809d (patch) | |
tree | db323e11ae5a5286a1e344b444162be53bc4d9fc /include/linux/kvm.h | |
parent | 1ea252afcd4b264b71d9c3f55358ff5ba4c04f1b (diff) |
KVM: Use a shared page for kernel/user communication when runing a vcpu
Instead of passing a 'struct kvm_run' back and forth between the kernel and
userspace, allocate a page and allow the user to mmap() it. This reduces
needless copying and makes the interface expandable by providing lots of
free space.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r-- | include/linux/kvm.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 275354ffa1cb..d88e7508ee0a 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <linux/ioctl.h> | 12 | #include <linux/ioctl.h> |
13 | 13 | ||
14 | #define KVM_API_VERSION 4 | 14 | #define KVM_API_VERSION 5 |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Architectural interrupt line count, and the size of the bitmap needed | 17 | * Architectural interrupt line count, and the size of the bitmap needed |
@@ -49,7 +49,7 @@ enum kvm_exit_reason { | |||
49 | KVM_EXIT_SHUTDOWN = 8, | 49 | KVM_EXIT_SHUTDOWN = 8, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | /* for KVM_RUN */ | 52 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
53 | struct kvm_run { | 53 | struct kvm_run { |
54 | /* in */ | 54 | /* in */ |
55 | __u32 emulated; /* skip current instruction */ | 55 | __u32 emulated; /* skip current instruction */ |
@@ -233,7 +233,7 @@ struct kvm_dirty_log { | |||
233 | /* | 233 | /* |
234 | * ioctls for vcpu fds | 234 | * ioctls for vcpu fds |
235 | */ | 235 | */ |
236 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) | 236 | #define KVM_RUN _IO(KVMIO, 16) |
237 | #define KVM_GET_REGS _IOR(KVMIO, 3, struct kvm_regs) | 237 | #define KVM_GET_REGS _IOR(KVMIO, 3, struct kvm_regs) |
238 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) | 238 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) |
239 | #define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs) | 239 | #define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs) |