Skip to content

Commit db26450

Browse files
tlendackysean-jc
authored andcommitted
KVM: SVM: Add the type of VM for which the VMCB/VMSA is being dumped
Add the type of VM (SVM, SEV, SEV-ES, or SEV-SNP) being dumped to the dump_vmcb() function. Signed-off-by: Tom Lendacky <[email protected]> Acked-by: Borislav Petkov (AMD) <[email protected]> Tested-by: Kim Phillips <[email protected]> Link: https://lore.kernel.org/r/7a183a8beedf4ee26c42001160e073a884fe466e.1742477213.git.thomas.lendacky@amd.com Signed-off-by: Sean Christopherson <[email protected]>
1 parent 22f5c20 commit db26450

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3397,14 +3397,19 @@ static void dump_vmcb(struct kvm_vcpu *vcpu)
33973397
struct vmcb_control_area *control = &svm->vmcb->control;
33983398
struct vmcb_save_area *save = &svm->vmcb->save;
33993399
struct vmcb_save_area *save01 = &svm->vmcb01.ptr->save;
3400+
char *vm_type;
34003401

34013402
if (!dump_invalid_vmcb) {
34023403
pr_warn_ratelimited("set kvm_amd.dump_invalid_vmcb=1 to dump internal KVM state.\n");
34033404
return;
34043405
}
34053406

3406-
pr_err("VMCB %p, last attempted VMRUN on CPU %d\n",
3407-
svm->current_vmcb->ptr, vcpu->arch.last_vmentry_cpu);
3407+
vm_type = sev_snp_guest(vcpu->kvm) ? "SEV-SNP" :
3408+
sev_es_guest(vcpu->kvm) ? "SEV-ES" :
3409+
sev_guest(vcpu->kvm) ? "SEV" : "SVM";
3410+
3411+
pr_err("%s VMCB %p, last attempted VMRUN on CPU %d\n",
3412+
vm_type, svm->current_vmcb->ptr, vcpu->arch.last_vmentry_cpu);
34083413
pr_err("VMCB Control Area:\n");
34093414
pr_err("%-20s%04x\n", "cr_read:", control->intercepts[INTERCEPT_CR] & 0xffff);
34103415
pr_err("%-20s%04x\n", "cr_write:", control->intercepts[INTERCEPT_CR] >> 16);

0 commit comments

Comments
 (0)