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: Sat, 01 Sep 2012 02:21:50 -0700 Message-ID: <5041D3AE.6090804@redhat.com> References: <877gsia8rm.fsf@rustcorp.com.au> <87mx1dsfuc.fsf@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: 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]:53394 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752950Ab2IAJWA (ORCPT ); Sat, 1 Sep 2012 05:22:00 -0400 In-Reply-To: <87mx1dsfuc.fsf@rustcorp.com.au> Sender: kvm-owner@vger.kernel.org List-ID: On 08/29/2012 11:39 AM, Rusty Russell wrote: > > > -4.76 KVM_VCPU_GET_MSR_INDEX_LIST > +4.76 KVM_VCPU_GET_REG_LIST > > -Capability: basic > +Capability: KVM_CAP_REG_LIST > Architectures: arm all > Type: vcpu ioctl > -Parameters: struct kvm_msr_list (in/out) > +Parameters: struct kvm_reg_list (in/out) > Returns: 0 on success; -1 on error > Errors: > - E2BIG: the msr index list is too big to fit in the array specified by > - the user. > + E2BIG: the reg index list is too big to fit in the array specified by > + the user (the number required will be written into n). > > struct kvm_msr_list { > - __u32 nmsrs; /* number of msrs in entries */ > - __u32 indices[0]; > + __u64 n; /* number of registers in reg[] */ > + __u64 reg[0]; > }; > People complain that this interface is hard to use. How about supplying the address of the array (in addition to n) so you don't have to deal with variable sized arrays, and dropping E2BIG in favour of always updating n (n changed to something bigger than you had -> reallocate and rerun) -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.