x86.c (28ab1bb0e8f031dd7dd3462ff8f6b2e93fc77e7f) x86.c (e5d83c74a5800c2a1fa3ba982c1c4b2b39ae6db2)
1/*
2 * Kernel-based Virtual Machine driver for Linux
3 *
4 * derived from drivers/kvm/kvm_main.c
5 *
6 * Copyright (C) 2006 Qumranet, Inc.
7 * Copyright (C) 2008 Qumranet, Inc.
8 * Copyright IBM Corporation, 2008

--- 2994 unchanged lines hidden (view full) ---

3003 case KVM_CAP_XSAVE:
3004 case KVM_CAP_ASYNC_PF:
3005 case KVM_CAP_GET_TSC_KHZ:
3006 case KVM_CAP_KVMCLOCK_CTRL:
3007 case KVM_CAP_READONLY_MEM:
3008 case KVM_CAP_HYPERV_TIME:
3009 case KVM_CAP_IOAPIC_POLARITY_IGNORED:
3010 case KVM_CAP_TSC_DEADLINE_TIMER:
1/*
2 * Kernel-based Virtual Machine driver for Linux
3 *
4 * derived from drivers/kvm/kvm_main.c
5 *
6 * Copyright (C) 2006 Qumranet, Inc.
7 * Copyright (C) 2008 Qumranet, Inc.
8 * Copyright IBM Corporation, 2008

--- 2994 unchanged lines hidden (view full) ---

3003 case KVM_CAP_XSAVE:
3004 case KVM_CAP_ASYNC_PF:
3005 case KVM_CAP_GET_TSC_KHZ:
3006 case KVM_CAP_KVMCLOCK_CTRL:
3007 case KVM_CAP_READONLY_MEM:
3008 case KVM_CAP_HYPERV_TIME:
3009 case KVM_CAP_IOAPIC_POLARITY_IGNORED:
3010 case KVM_CAP_TSC_DEADLINE_TIMER:
3011 case KVM_CAP_ENABLE_CAP_VM:
3012 case KVM_CAP_DISABLE_QUIRKS:
3013 case KVM_CAP_SET_BOOT_CPU_ID:
3014 case KVM_CAP_SPLIT_IRQCHIP:
3015 case KVM_CAP_IMMEDIATE_EXIT:
3016 case KVM_CAP_GET_MSR_FEATURES:
3017 case KVM_CAP_MSR_PLATFORM_INFO:
3018 case KVM_CAP_EXCEPTION_PAYLOAD:
3019 r = 1;

--- 1406 unchanged lines hidden (view full) ---

4426 return -ENXIO;
4427
4428 irq_event->status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
4429 irq_event->irq, irq_event->level,
4430 line_status);
4431 return 0;
4432}
4433
3011 case KVM_CAP_DISABLE_QUIRKS:
3012 case KVM_CAP_SET_BOOT_CPU_ID:
3013 case KVM_CAP_SPLIT_IRQCHIP:
3014 case KVM_CAP_IMMEDIATE_EXIT:
3015 case KVM_CAP_GET_MSR_FEATURES:
3016 case KVM_CAP_MSR_PLATFORM_INFO:
3017 case KVM_CAP_EXCEPTION_PAYLOAD:
3018 r = 1;

--- 1406 unchanged lines hidden (view full) ---

4425 return -ENXIO;
4426
4427 irq_event->status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
4428 irq_event->irq, irq_event->level,
4429 line_status);
4430 return 0;
4431}
4432
4434static int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
4435 struct kvm_enable_cap *cap)
4433int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
4434 struct kvm_enable_cap *cap)
4436{
4437 int r;
4438
4439 if (cap->flags)
4440 return -EINVAL;
4441
4442 switch (cap->cap) {
4443 case KVM_CAP_DISABLE_QUIRKS:

--- 316 unchanged lines hidden (view full) ---

4760 memset(&user_ns.pad, 0, sizeof(user_ns.pad));
4761
4762 r = -EFAULT;
4763 if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
4764 goto out;
4765 r = 0;
4766 break;
4767 }
4435{
4436 int r;
4437
4438 if (cap->flags)
4439 return -EINVAL;
4440
4441 switch (cap->cap) {
4442 case KVM_CAP_DISABLE_QUIRKS:

--- 316 unchanged lines hidden (view full) ---

4759 memset(&user_ns.pad, 0, sizeof(user_ns.pad));
4760
4761 r = -EFAULT;
4762 if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
4763 goto out;
4764 r = 0;
4765 break;
4766 }
4768 case KVM_ENABLE_CAP: {
4769 struct kvm_enable_cap cap;
4770
4771 r = -EFAULT;
4772 if (copy_from_user(&cap, argp, sizeof(cap)))
4773 goto out;
4774 r = kvm_vm_ioctl_enable_cap(kvm, &cap);
4775 break;
4776 }
4777 case KVM_MEMORY_ENCRYPT_OP: {
4778 r = -ENOTTY;
4779 if (kvm_x86_ops->mem_enc_op)
4780 r = kvm_x86_ops->mem_enc_op(kvm, argp);
4781 break;
4782 }
4783 case KVM_MEMORY_ENCRYPT_REG_REGION: {
4784 struct kvm_enc_region region;

--- 4958 unchanged lines hidden ---
4767 case KVM_MEMORY_ENCRYPT_OP: {
4768 r = -ENOTTY;
4769 if (kvm_x86_ops->mem_enc_op)
4770 r = kvm_x86_ops->mem_enc_op(kvm, argp);
4771 break;
4772 }
4773 case KVM_MEMORY_ENCRYPT_REG_REGION: {
4774 struct kvm_enc_region region;

--- 4958 unchanged lines hidden ---