KVM: x86: Stuff vCPU's PAT with default value at RESET, not creation
authorSean Christopherson <seanjc@google.com>
Wed, 5 Jun 2024 23:19:11 +0000 (16:19 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 22 Aug 2024 18:25:48 +0000 (11:25 -0700)
commitb6717d35d8597d19f44736f11963e3bd5b8881b4
tree694104331bcbe5b3fd04d136d57d242a03612620
parentbeb2e446046f8dd96bbeed3267b5f26bf1926ef9
KVM: x86: Stuff vCPU's PAT with default value at RESET, not creation

Move the stuffing of the vCPU's PAT to the architectural "default" value
from kvm_arch_vcpu_create() to kvm_vcpu_reset(), guarded by !init_event,
to better capture that the default value is the value "Following Power-up
or Reset".  E.g. setting PAT only during creation would break if KVM were
to expose a RESET ioctl() to userspace (which is unlikely, but that's not
a good reason to have unintuitive code).

No functional change.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20240605231918.2915961-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c