From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 04/12] [PATCH] kvm-s390-ucontrol: export SIE control block to user Date: Thu, 01 Dec 2011 15:25:48 +0200 Message-ID: <4ED7805C.2000609@redhat.com> References: <20111201125732.085553111@de.ibm.com> <20111201130409.221824848@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tossati , Christian Borntraeger , Heiko Carstens , Martin Schwidefsky , Cornelia Huck , KVM , Joachim von Buttlar , Jens Freimann , Constantin Werner To: Carsten Otte Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8503 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753929Ab1LANZ5 (ORCPT ); Thu, 1 Dec 2011 08:25:57 -0500 In-Reply-To: <20111201130409.221824848@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/01/2011 02:57 PM, Carsten Otte wrote: > 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 > + How does userspace get to know what this value is? Coalesced mmio does this with the return value of KVM_CAP_COALESCED_MMIO. You can hardcode it, but in a user visible header please. > 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 kvm_arch_vcpu_fault() -- error compiling committee.c: too many arguments to function