From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 2/2]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs Date: Tue, 20 Dec 2011 17:16:01 +0100 Message-ID: <4EF0B4C1.2010905@de.ibm.com> References: <4EF0577D.6010902@de.ibm.com> <4EF05AD0.8050808@redhat.com> <4EF05C9D.6040306@de.ibm.com> <4EF05EDA.2040604@redhat.com> <4EF07454.8000705@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , KVM list , Cornelia Huck , Jens Freimann , Martin Schwidefsky , Heiko Carstens , Carsten Otte To: Alexander Graf Return-path: Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:49328 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142Ab1LTQQ0 (ORCPT ); Tue, 20 Dec 2011 11:16:26 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Dec 2011 16:16:24 -0000 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBKGG6ca2605152 for ; Tue, 20 Dec 2011 16:16:06 GMT Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBKGG5Pd027326 for ; Tue, 20 Dec 2011 09:16:06 -0700 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 20/12/11 15:20, Alexander Graf wrote: >> +Reads special registers from the vcpu which are not covered by sregs. >> + >> +/* s390x */ >> +struct kvm_sregs2 { >> + __u64 ckc; /* clock comparator */ >> + __u64 cputm; /* cpu timer */ >> + __u64 gbea; /* guest breaking event address */ >> + __u32 todpr; /* tod programmable field */ >> + __u32 prefix; /* prefix register */ >> +}; > > Would it make sense to instead use the GET_ONE_REG and SET_ONE_REG interfaces? > > http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/80854 Still not sure if I like that interface or not, but it should work. I have some questions, though - how should userspace check if the kernel supports this specific register? - How would a GET_MANY_REGS / SET_MANY_REGS look like? - Is the interface limited to 56 registers? (see the ID) - scalability and performance. I dont know about other platforms, but the exit overhead on s390 is in the same order of magnitute as a system call overhead, so multiple ioctls on the exit path will make the exit overhead noticably more expensive (probably can be solved by a MANY variant). This might be a micro optimization though. (actually the only register that bothers me regarding performance right now is prefix. qemu will need the content if it has to write to the prefix page. Would be good to have an interface to get that without doing another system call) Christian