This patch exports the SIE hardware control block to userspace
via the mapping of the vcpu file descriptor.

Signed-off-by: Carsten Otte <co...@de.ibm.com>
---
---
 arch/s390/include/asm/kvm_host.h |    2 ++
 virt/kvm/kvm_main.c              |    5 +++++
 2 files changed, 7 insertions(+)

--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -24,6 +24,8 @@
 /* memory slots that does not exposed to userspace */
 #define KVM_PRIVATE_MEM_SLOTS 4
 
+#define KVM_SIE_PAGE_OFFSET 1
+
 struct sca_entry {
        atomic_t scn;
        __u32   reserved;
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1656,6 +1656,11 @@ static int kvm_vcpu_fault(struct vm_area
        else if (vmf->pgoff == KVM_COALESCED_MMIO_PAGE_OFFSET)
                page = virt_to_page(vcpu->kvm->coalesced_mmio_ring);
 #endif
+#if defined(CONFIG_S390) && defined(CONFIG_KVM_UCONTROL)
+       else if ((vmf->pgoff == KVM_SIE_PAGE_OFFSET)
+                && (!(vcpu->kvm->arch.gmap)))
+               page = virt_to_page(vcpu->arch.sie_block);
+#endif
        else
                return VM_FAULT_SIGBUS;
        get_page(page);

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to