Re: [RFC PATCH v2 11/12] i386/sev: sev-snp: add support for CPUID validation

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

 




On 07/09/2021 19:50, Michael Roth wrote:
> On Sun, Sep 05, 2021 at 01:02:12PM +0300, Dov Murik wrote:
>> On 27/08/2021 1:26, Michael Roth wrote:

[...]

>>> +    for (i = 0; i < old->count; i++) {
>>> +        SnpCpuidFunc *old_func, *new_func;
>>> +
>>> +        old_func = &old->entries[i];
>>> +        new_func = &new->entries[i];
>>> +
>>> +        if (memcmp(old_func, new_func, sizeof(SnpCpuidFunc))) {
>>
>> Maybe clearer:
>>
>>     if (*old_func != *new_func) ...
> 
> Not 2 structs can be compared this way, maybe I'll just compare the
> individual members.
> 

Oops, my bad; I was confusing it with struct assignment.  I guess memcmp
is fine as-is in this case.


-Dov




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux