]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86: Restore caching of KVM CPUID base
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 12 Aug 2025 17:16:41 +0000 (18:16 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 18 Aug 2025 09:48:54 +0000 (10:48 +0100)
commitd5aa089f97632e96662a54dd63d746ff7aa84da7
tree7caa87d5546440820cb6aee26dad122fd40a7a21
parent33bea49c1d0e09a512fccc862a2f8249cc3fdc57
KVM: x86: Restore caching of KVM CPUID base

This mostly reverts commit a5b32718081e ("KVM: x86: Remove unnecessary
caching of KVM's PV CPUID base").

Sure, caching state which might change has certain risks, but KVM
already does cache the CPUID contents, and the whole point of calling
kvm_apply_cpuid_pv_features_quirk() from kvm_vcpu_after_set_cpuid() is
to cache the contents of that leaf too, so that guest_pv_has() can
access them quickly.

An upcoming commit is going to want to use vcpu->arch.kvm_cpuid from
kvm_cpuid() at runtime too, so put it back.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c