From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Otte Subject: [patch 04/12] [PATCH] kvm-s390-ucontrol: export SIE control block to user Date: Thu, 01 Dec 2011 13:57:36 +0100 Message-ID: <20111201130409.221824848@de.ibm.com> References: <20111201125732.085553111@de.ibm.com> Cc: Christian Borntraeger , Heiko Carstens , Martin Schwidefsky , Cornelia Huck , KVM , Joachim von Buttlar , Jens Freimann , Constantin Werner To: Avi Kivity , Marcelo Tossati Return-path: Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:41256 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753939Ab1LANEO (ORCPT ); Thu, 1 Dec 2011 08:04:14 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Dec 2011 13:04:13 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pB1D4Acj2203648 for ; Thu, 1 Dec 2011 13:04:10 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pB1D49XO023097 for ; Thu, 1 Dec 2011 06:04:09 -0700 Content-Disposition: inline; filename=sie-control-block-to-user.patch Sender: kvm-owner@vger.kernel.org List-ID: This patch exports the SIE hardware control block to userspace via the mapping of the vcpu file descriptor. Signed-off-by: Carsten Otte --- --- 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);