[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40be9675-0918-8099-da93-8d085ba738bc@intel.com>
Date: Mon, 24 Apr 2023 14:15:15 +0800
From: "Yang, Weijiang" <weijiang.yang@...el.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>
CC: <rick.p.edgecombe@...el.com>,
Zhang Yi Z <yi.z.zhang@...ux.intel.com>, <seanjc@...gle.com>,
<peterz@...radead.org>, <pbonzini@...hat.com>,
<john.allen@....com>, <linux-kernel@...r.kernel.org>,
<kvm@...r.kernel.org>
Subject: Re: [PATCH v2 07/21] KVM:x86: Refresh CPUID on write to guest
MSR_IA32_XSS
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);
>>
[...]
Powered by blists - more mailing lists