]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Apply TSX_CTRL_CPUID_CLEAR if and only if the vCPU has RTM or HLE
authorSean Christopherson <seanjc@google.com>
Wed, 11 Dec 2024 01:33:00 +0000 (17:33 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 18:16:31 +0000 (10:16 -0800)
commit7e9f735e7ac4b95207e108ec67d04a9c4cb9cced
tree1839f067c39ca19fc85730a2163cd6d7c229ee5c
parentaa93b6f96f6486fa1a78b7b92ebe43f49f35d8bf
KVM: x86: Apply TSX_CTRL_CPUID_CLEAR if and only if the vCPU has RTM or HLE

When emulating CPUID, retrieve MSR_IA32_TSX_CTRL.TSX_CTRL_CPUID_CLEAR if
and only if RTM and/or HLE feature bits need to be cleared.  Getting the
MSR value is unnecessary if neither bit is set, and avoiding the lookup
saves ~80 cycles for vCPUs without RTM or HLE.

Cc: Jim Mattson <jmattson@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20241211013302.1347853-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/cpuid.c