diff options
author | Carsten Otte <cotte@de.ibm.com> | 2012-01-04 04:25:23 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-05 07:52:19 -0500 |
commit | 5b1c1493afe8d69909f9df3221bb2fffdf479f4a (patch) | |
tree | f64fa2be60cb44e4d9cb7cc9338b4dabba65348a /arch | |
parent | e168bf8de33e16a909df2401af1f7d419c5780de (diff) |
KVM: s390: ucontrol: export SIE control block to user
This patch exports the s390 SIE hardware control block to userspace
via the mapping of the vcpu file descriptor. In order to do so,
a new arch callback named kvm_arch_vcpu_fault is introduced for all
architectures. It allows to map architecture specific pages.
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-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 |
4 files changed, 28 insertions, 0 deletions
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; |