It's been about 6 months since v2. Sorry for the delay. Initially, this was a single patch to add information to KVM_EXIT_FAIL_ENTRY to help identify a defective CPU. It has gotten a little more complicated, since Peter Shier pointed out that the vCPU thread may have migrated between the time of failure and the KVM exit. Fortunately, the SEV folks started to make the necessary information available with "last_cpu," but only on AMD and only with SEV. The current version expands upon that by making "last_cpu" available in all configurations on AMD and Intel. v2: Use vcpu->cpu rather than raw_smp_processor_id() (Liran). v3: Record the last logical processor to run the vCPU thread (Peter). Add the "last CPU" information to KVM_EXIT_INTERNAL_ERROR exits as well as KVM_EXIT_FAIL_ENTRY [except for "EMULATION" errors]. (Liran & Paolo). v4: Move last_cpu into kvm_vcpu_arch as last_vmentry_cpu, and set this field in vcpu_enter_guest (Sean). Jim Mattson (6): kvm: svm: Prefer vcpu->cpu to raw_smp_processor_id() kvm: svm: Always set svm->last_cpu on VMRUN kvm: vmx: Add last_cpu to struct vcpu_vmx kvm: x86: Add "last CPU" to some KVM_EXIT information kvm: x86: Move last_cpu into kvm_vcpu_arch as last_vmentry_cpu kvm: x86: Set last_vmentry_cpu in vcpu_enter_guest Documentation/virt/kvm/api.rst | 1 + arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/svm/sev.c | 3 +-- arch/x86/kvm/svm/svm.c | 13 ++++++------- arch/x86/kvm/svm/svm.h | 3 --- arch/x86/kvm/vmx/vmx.c | 10 ++++++++-- arch/x86/kvm/x86.c | 2 ++ include/uapi/linux/kvm.h | 2 ++ 8 files changed, 23 insertions(+), 14 deletions(-) -- 2.27.0.rc2.251.g90737beb825-goog