]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: SVM: Return TSA_SQ_NO and TSA_L1_NO bits in __do_cpuid_func()
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 12 Sep 2025 22:29:14 +0000 (18:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:29:56 +0000 (16:29 +0200)
Commit c334ae4a545a ("KVM: SVM: Advertise TSA CPUID bits to guests")
set VERW_CLEAR, TSA_SQ_NO and TSA_L1_NO kvm_caps bits that are
supposed to be provided to guest when it requests CPUID 0x80000021.
However, the latter two (in the %ecx register) are instead returned as
zeroes in __do_cpuid_func().

Return values of TSA_SQ_NO and TSA_L1_NO as set in the kvm_cpu_caps.

This fix is stable-only.

Cc: <stable@vger.kernel.org> # 6.1.y
Fixes: c334ae4a545a ("KVM: SVM: Advertise TSA CPUID bits to guests")
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/cpuid.c

index 4f60341b1e94b342d677e898a9ad4ea166937ed6..e53ccf8a090d3a7d1e884815eaa9597a80bc76a5 100644 (file)
@@ -1259,8 +1259,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
                entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
                break;
        case 0x80000021:
-               entry->ebx = entry->ecx = entry->edx = 0;
+               entry->ebx = entry->edx = 0;
                cpuid_entry_override(entry, CPUID_8000_0021_EAX);
+               cpuid_entry_override(entry, CPUID_8000_0021_ECX);
                break;
        /*Add support for Centaur's CPUID instruction*/
        case 0xC0000000: