diff options
-rw-r--r-- | drivers/kvm/kvm_main.c | 8 | ||||
-rw-r--r-- | include/linux/kvm.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index df85f5f65489..cba0b87c34e4 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2436,7 +2436,7 @@ static long kvm_dev_ioctl(struct file *filp, | |||
2436 | unsigned int ioctl, unsigned long arg) | 2436 | unsigned int ioctl, unsigned long arg) |
2437 | { | 2437 | { |
2438 | void __user *argp = (void __user *)arg; | 2438 | void __user *argp = (void __user *)arg; |
2439 | int r = -EINVAL; | 2439 | long r = -EINVAL; |
2440 | 2440 | ||
2441 | switch (ioctl) { | 2441 | switch (ioctl) { |
2442 | case KVM_GET_API_VERSION: | 2442 | case KVM_GET_API_VERSION: |
@@ -2478,6 +2478,12 @@ static long kvm_dev_ioctl(struct file *filp, | |||
2478 | */ | 2478 | */ |
2479 | r = 0; | 2479 | r = 0; |
2480 | break; | 2480 | break; |
2481 | case KVM_GET_VCPU_MMAP_SIZE: | ||
2482 | r = -EINVAL; | ||
2483 | if (arg) | ||
2484 | goto out; | ||
2485 | r = PAGE_SIZE; | ||
2486 | break; | ||
2481 | default: | 2487 | default: |
2482 | ; | 2488 | ; |
2483 | } | 2489 | } |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index c0d10cd8088e..dad90816cad8 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -253,6 +253,10 @@ struct kvm_signal_mask { | |||
253 | * return is 1 (yes) or 0 (no, sorry). | 253 | * return is 1 (yes) or 0 (no, sorry). |
254 | */ | 254 | */ |
255 | #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) | 255 | #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) |
256 | /* | ||
257 | * Get size for mmap(vcpu_fd) | ||
258 | */ | ||
259 | #define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ | ||
256 | 260 | ||
257 | /* | 261 | /* |
258 | * ioctls for VM fds | 262 | * ioctls for VM fds |