KVM: x86: Add a helper to query whether or not a vCPU has ever run
authorSean Christopherson <seanjc@google.com>
Sat, 11 Mar 2023 00:45:59 +0000 (16:45 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 6 Apr 2023 21:57:22 +0000 (14:57 -0700)
commitfb3146b4dc3bc6d0c0402a75f21d628eccf9bf8c
tree3e9367e61a94a0f0dc974268470f9b914862c0c1
parentb1932c5c19ddcbe9140b0583a0931b620c21ca02
KVM: x86: Add a helper to query whether or not a vCPU has ever run

Add a helper to query if a vCPU has run so that KVM doesn't have to open
code the check on last_vmentry_cpu being set to a magic value.

No functional change intended.

Suggested-by: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Like Xu <like.xu.linux@gmail.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20230311004618.920745-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.h