From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic. Date: Tue, 04 Sep 2012 14:48:07 +0300 Message-ID: <5045EA77.5060407@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Rusty Russell , Peter Maydell , Christoffer Dall , Alexander Graf , kvmarm@lists.cs.columbia.edu, kvm-devel To: Rusty Russell Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19425 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756811Ab2IDLs0 (ORCPT ); Tue, 4 Sep 2012 07:48:26 -0400 In-Reply-To: <87wr0b2smh.fsf@rustcorp.com.au> Sender: kvm-owner@vger.kernel.org List-ID: 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 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. -- error compiling committee.c: too many arguments to function