[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 11/12] i386/sev: sev-snp: add support for CPUID valida
From: |
Dov Murik |
Subject: |
Re: [RFC PATCH v2 11/12] i386/sev: sev-snp: add support for CPUID validation |
Date: |
Tue, 7 Sep 2021 20:44:04 +0300 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
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