lkml.org 
[lkml]   [2022]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] KVM: x86: Use memcmp in kvm_cpuid_check_equal()
Date
Joe Perches <joe@perches.com> writes:

> On Mon, 2022-01-24 at 11:36 +0100, Vitaly Kuznetsov wrote:
>> kvm_cpuid_check_equal() should also check .flags equality but instead
>> of adding it to the existing check, just switch to using memcmp() for
>> the whole 'struct kvm_cpuid_entry2'.
>
> Is the struct padding guaranteed to be identical ?
>

Well, yes (or we're all doomeed):
- 'struct kvm_cpuid_entry2' is part of KVM userspace ABI, it is supposed
to be stable.
- Here we compare structs which come from the same userspace during one
session (vCPU fd stays open), I can't imagine how structure layout can
change on-the-fly.

--
Vitaly

\
 
 \ /
  Last update: 2022-01-26 11:05    [W:0.136 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site