From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlxy7-0006u8-QM for qemu-devel@nongnu.org; Wed, 05 Nov 2014 05:37:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xlxy0-0000kl-VS for qemu-devel@nongnu.org; Wed, 05 Nov 2014 05:37:39 -0500 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:47418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlxy0-0000kd-KF for qemu-devel@nongnu.org; Wed, 05 Nov 2014 05:37:32 -0500 Received: by mail-lb0-f181.google.com with SMTP id l4so395886lbv.12 for ; Wed, 05 Nov 2014 02:37:30 -0800 (PST) Sender: Paolo Bonzini Message-ID: <5459FDE5.4010300@redhat.com> Date: Wed, 05 Nov 2014 11:37:25 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1414661809-21383-1-git-send-email-borntraeger@de.ibm.com> <1414661809-21383-8-git-send-email-borntraeger@de.ibm.com> <5459FCE1.9060903@redhat.com> In-Reply-To: <5459FCE1.9060903@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/9] valgrind/i386: avoid false positives on KVM_GET_MSRS ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger , Peter Maydell Cc: qemu-devel On 05/11/2014 11:33, Paolo Bonzini wrote: > On 30/10/2014 10:36, Christian Borntraeger wrote: >> struct kvm_msrs contains a pad field. Lets initialize this pad >> field. A designated initializer seems not appropriate here, as >> struct kvm_msrs is embedded in the msr_data structure. >> >> Signed-off-by: Christian Borntraeger > > What about this: > > msr_data.info = (struct kvm_msrs) { > .nmsrs = n > }; > > ? It would also be applicable to other uses of kvm_msrs. Also, KVM_SET_MSRS has to deal with a reserved field in struct kvm_msr_entry. Currently you handle it with a relatively large memset produced by the designated initializer "= {}" in kvm_put_msrs. However, you could set it in kvm_msr_entry_set, and avoid the memset. Paolo > Also, you're missing one occurrence in kvm_put_msr_feature_control.