diff options
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 5 | ||||
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 5 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 13 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 5 | ||||
-rw-r--r-- | include/linux/kvm.h | 2 | ||||
-rw-r--r-- | include/linux/kvm_host.h | 1 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
8 files changed, 37 insertions, 1 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 6e53ff51422f..5ebf47d99e56 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -218,6 +218,11 @@ allocation of vcpu ids. For example, if userspace wants | |||
218 | single-threaded guest vcpus, it should make all vcpu ids be a multiple | 218 | single-threaded guest vcpus, it should make all vcpu ids be a multiple |
219 | of the number of vcpus per vcore. | 219 | of the number of vcpus per vcore. |
220 | 220 | ||
221 | For virtual cpus that have been created with S390 user controlled virtual | ||
222 | machines, the resulting vcpu fd can be memory mapped at page offset | ||
223 | KVM_S390_SIE_PAGE_OFFSET in order to obtain a memory map of the virtual | ||
224 | cpu's hardware control block. | ||
225 | |||
221 | 4.8 KVM_GET_DIRTY_LOG (vm ioctl) | 226 | 4.8 KVM_GET_DIRTY_LOG (vm ioctl) |
222 | 227 | ||
223 | Capability: basic | 228 | Capability: basic |
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index df6b14194051..8ca7261e7b3d 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1566,6 +1566,11 @@ out: | |||
1566 | return r; | 1566 | return r; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) | ||
1570 | { | ||
1571 | return VM_FAULT_SIGBUS; | ||
1572 | } | ||
1573 | |||
1569 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 1574 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
1570 | struct kvm_memory_slot *memslot, | 1575 | struct kvm_memory_slot *memslot, |
1571 | struct kvm_memory_slot old, | 1576 | struct kvm_memory_slot old, |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 83f244569874..a5671616af86 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -659,6 +659,11 @@ out: | |||
659 | return r; | 659 | return r; |
660 | } | 660 | } |
661 | 661 | ||
662 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) | ||
663 | { | ||
664 | return VM_FAULT_SIGBUS; | ||
665 | } | ||
666 | |||
662 | static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) | 667 | static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) |
663 | { | 668 | { |
664 | u32 inst_lis = 0x3c000000; | 669 | u32 inst_lis = 0x3c000000; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index af05328aca25..d6bc65aeb950 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -763,6 +763,19 @@ long kvm_arch_vcpu_ioctl(struct file *filp, | |||
763 | return r; | 763 | return r; |
764 | } | 764 | } |
765 | 765 | ||
766 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) | ||
767 | { | ||
768 | #ifdef CONFIG_KVM_S390_UCONTROL | ||
769 | if ((vmf->pgoff == KVM_S390_SIE_PAGE_OFFSET) | ||
770 | && (kvm_is_ucontrol(vcpu->kvm))) { | ||
771 | vmf->page = virt_to_page(vcpu->arch.sie_block); | ||
772 | get_page(vmf->page); | ||
773 | return 0; | ||
774 | } | ||
775 | #endif | ||
776 | return VM_FAULT_SIGBUS; | ||
777 | } | ||
778 | |||
766 | /* Section: memory related */ | 779 | /* Section: memory related */ |
767 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 780 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
768 | struct kvm_memory_slot *memslot, | 781 | struct kvm_memory_slot *memslot, |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 06925b4bcc27..a3ce196d21fe 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2814,6 +2814,11 @@ out: | |||
2814 | return r; | 2814 | return r; |
2815 | } | 2815 | } |
2816 | 2816 | ||
2817 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) | ||
2818 | { | ||
2819 | return VM_FAULT_SIGBUS; | ||
2820 | } | ||
2821 | |||
2817 | static int kvm_vm_ioctl_set_tss_addr(struct kvm *kvm, unsigned long addr) | 2822 | static int kvm_vm_ioctl_set_tss_addr(struct kvm *kvm, unsigned long addr) |
2818 | { | 2823 | { |
2819 | int ret; | 2824 | int ret; |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 7f686f6708b0..8f888df206a2 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -440,6 +440,8 @@ struct kvm_ppc_pvinfo { | |||
440 | /* machine type bits, to be used as argument to KVM_CREATE_VM */ | 440 | /* machine type bits, to be used as argument to KVM_CREATE_VM */ |
441 | #define KVM_VM_S390_UCONTROL 1 | 441 | #define KVM_VM_S390_UCONTROL 1 |
442 | 442 | ||
443 | #define KVM_S390_SIE_PAGE_OFFSET 1 | ||
444 | |||
443 | /* | 445 | /* |
444 | * ioctls for /dev/kvm fds: | 446 | * ioctls for /dev/kvm fds: |
445 | */ | 447 | */ |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 82375e145e64..d4d4d7092110 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -450,6 +450,7 @@ long kvm_arch_dev_ioctl(struct file *filp, | |||
450 | unsigned int ioctl, unsigned long arg); | 450 | unsigned int ioctl, unsigned long arg); |
451 | long kvm_arch_vcpu_ioctl(struct file *filp, | 451 | long kvm_arch_vcpu_ioctl(struct file *filp, |
452 | unsigned int ioctl, unsigned long arg); | 452 | unsigned int ioctl, unsigned long arg); |
453 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf); | ||
453 | 454 | ||
454 | int kvm_dev_ioctl_check_extension(long ext); | 455 | int kvm_dev_ioctl_check_extension(long ext); |
455 | 456 | ||
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 32e3b048a6cf..64be836f3348 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -1657,7 +1657,7 @@ static int kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1657 | page = virt_to_page(vcpu->kvm->coalesced_mmio_ring); | 1657 | page = virt_to_page(vcpu->kvm->coalesced_mmio_ring); |
1658 | #endif | 1658 | #endif |
1659 | else | 1659 | else |
1660 | return VM_FAULT_SIGBUS; | 1660 | return kvm_arch_vcpu_fault(vcpu, vmf); |
1661 | get_page(page); | 1661 | get_page(page); |
1662 | vmf->page = page; | 1662 | vmf->page = page; |
1663 | return 0; | 1663 | return 0; |