From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic. Date: Tue, 4 Sep 2012 09:59:48 -0400 Message-ID: <5FAB9986-A743-451A-AE04-CA049E776F1D@suse.de> References: <877gsia8rm.fsf@rustcorp.com.au> <87mx1dsfuc.fsf@rustcorp.com.au> <5041D3AE.6090804@redhat.com> <873931539z.fsf@rustcorp.com.au> <5044765A.30702@redhat.com> <87wr0b2smh.fsf@rustcorp.com.au> <5045EA77.5060407@redhat.com> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: Rusty Russell , Rusty Russell , Peter Maydell , Christoffer Dall , "kvmarm@lists.cs.columbia.edu" , kvm-devel To: Avi Kivity Return-path: Received: from cantor2.suse.de ([195.135.220.15]:35098 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752953Ab2IECBR convert rfc822-to-8bit (ORCPT ); Tue, 4 Sep 2012 22:01:17 -0400 In-Reply-To: <5045EA77.5060407@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04.09.2012, at 07:48, Avi Kivity wrote: > On 09/03/2012 03:33 PM, Rusty Russell wrote: >> Avi Kivity writes: >>> On 09/01/2012 03:35 PM, Rusty Russell wrote: >>>> Passing an address in a struct is pretty bad, since it involves >>>> compatibility wrappers. >>> >>> Right, some s390 thing. >> >> Err, no, i386 on x86-64, or ppc32 on ppc64, or arm on arm64.... >> >> Any time you put a pointer in a structure which is exposed to userspace, >> you have to deal with this. > > Not is you pack the pointer in a __u64, which is what we do to preserve > padding. Then it is only s390 which needs extra love. I doubt that anyone wants to run 31-bit user space on an s390x system. In fact, I wouldn't be surprised if exactly that case is broken already. > >>>> I don't think that is what makes the API hard >>>> to use. >>> >>> What is it then? I forgot what the original complaints/complainers were. >> >> I have no idea, since I didn't hear the complaints. But any non-fixed >> size array has issues in C; there's not much we can do about it. >> >> x86 manages this fine for msrs, and I didn't have a problem using it for >> my test programs. That's the limit of my experience, however. > > Another option is to use the size parameter from the ioctl. It just > sits there doing nothing. It would require quite a bunch of changes throughout the stack. Even in user space, like strace... Alex