qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/9] valgrind/i386: avoid false positives on KVM


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 7/9] valgrind/i386: avoid false positives on KVM_GET_MSRS ioctl
Date: Wed, 05 Nov 2014 11:37:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


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 <address@hidden>
> 
> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]