Skip to content

Commit 6463e5e

Browse files
committed
KVM: x86: Apply Intel's TSC_AUX reserved-bit behavior to Intel compat vCPUs
Extend Intel's check on MSR_TSC_AUX[63:32] to all vCPU models that are Intel compatible, i.e. aren't AMD or Hygon in KVM's world, as the behavior is architectural, i.e. applies to any CPU that is compatible with Intel's architecture. Applying the behavior strictly to Intel wasn't intentional, KVM simply didn't have a concept of "Intel compatible" as of commit 61a05d4 ("KVM: x86: Tie Intel and AMD behavior for MSR_TSC_AUX to guest CPU model"). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 5a4f8b3 commit 6463e5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/kvm/x86.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,11 +1878,11 @@ static int __kvm_set_msr(struct kvm_vcpu *vcpu, u32 index, u64 data,
18781878
* incomplete and conflicting architectural behavior. Current
18791879
* AMD CPUs completely ignore bits 63:32, i.e. they aren't
18801880
* reserved and always read as zeros. Enforce Intel's reserved
1881-
* bits check if and only if the guest CPU is Intel, and clear
1882-
* the bits in all other cases. This ensures cross-vendor
1883-
* migration will provide consistent behavior for the guest.
1881+
* bits check if the guest CPU is Intel compatible, otherwise
1882+
* clear the bits. This ensures cross-vendor migration will
1883+
* provide consistent behavior for the guest.
18841884
*/
1885-
if (guest_cpuid_is_intel(vcpu) && (data >> 32) != 0)
1885+
if (guest_cpuid_is_intel_compatible(vcpu) && (data >> 32) != 0)
18861886
return 1;
18871887

18881888
data = (u32)data;

0 commit comments

Comments
 (0)