Re: [PATCH v2 07/21] KVM:x86: Refresh CPUID on write to guest MSR_IA32_XSS

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

 




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);

[...]



[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