mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
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>
This commit is contained in:
parent
1ea252afcd
commit
9a2bb7f486
3 changed files with 44 additions and 17 deletions
|
@ -11,7 +11,7 @@
|
|||
#include <asm/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define KVM_API_VERSION 4
|
||||
#define KVM_API_VERSION 5
|
||||
|
||||
/*
|
||||
* Architectural interrupt line count, and the size of the bitmap needed
|
||||
|
@ -49,7 +49,7 @@ enum kvm_exit_reason {
|
|||
KVM_EXIT_SHUTDOWN = 8,
|
||||
};
|
||||
|
||||
/* for KVM_RUN */
|
||||
/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
|
||||
struct kvm_run {
|
||||
/* in */
|
||||
__u32 emulated; /* skip current instruction */
|
||||
|
@ -233,7 +233,7 @@ struct kvm_dirty_log {
|
|||
/*
|
||||
* ioctls for vcpu fds
|
||||
*/
|
||||
#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run)
|
||||
#define KVM_RUN _IO(KVMIO, 16)
|
||||
#define KVM_GET_REGS _IOR(KVMIO, 3, struct kvm_regs)
|
||||
#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs)
|
||||
#define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue