lkml.org 
[lkml]   [2023]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 07/21] KVM:x86: Refresh CPUID on write to guest MSR_IA32_XSS
From

On 4/24/2023 9:38 AM, Binbin Wu wrote:
>
> On 4/21/2023 9:46 PM, Yang Weijiang wrote:
>>
[...]
>> @@ -276,9 +276,14 @@ static void __kvm_update_cpuid_runtime(struct
>> kvm_vcpu *vcpu, struct kvm_cpuid_e
>>           best->ebx = xstate_required_size(vcpu->arch.xcr0, false);
>>         best = cpuid_entry2_find(entries, nent, 0xD, 1);
>> -    if (best && (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||
>> -             cpuid_entry_has(best, X86_FEATURE_XSAVEC)))
>> -        best->ebx = xstate_required_size(vcpu->arch.xcr0, true);
>> +    if (best) {
>> +        if (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||
>> +            cpuid_entry_has(best, X86_FEATURE_XSAVEC))  {
>
> Is it necessary to change to use two ifs?

Good catch! I changed the patch a bit, but forgot to re-shape it.

>
>
>> +            u64 xstate = vcpu->arch.xcr0 | vcpu->arch.ia32_xss;
>> +
>> +            best->ebx = xstate_required_size(xstate, true);
>>
[...]

\
 
 \ /
  Last update: 2023-04-24 08:16    [W:0.065 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site