Skip to contentSkip to conversation

KVM: SVM: Dump Virtual Machine Save Area (VMSA) to klog

PATCH New Jarkko Sakkinen 1 participant 1 message Jul 29, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 KVM: SVM: Dump Virtual Machine Save Area (VMSA) to klog

As Virtual Machine Save Area (VMSA) is essential in troubleshooting attestation, dump it to the klog with the KERN_DEBUG level of priority.

---
 arch/x86/kvm/svm/sev.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/kvm/svm/sev.c +4 -0
index 0c240ed04f96..c91a905436d5 100644
@@ -603,6 +603,10 @@ static int sev_es_sync_vmsa(struct vcpu_svm *svm)
 	save->xss  = svm->vcpu.arch.ia32_xss;
 	save->dr6  = svm->vcpu.arch.dr6;
 
+	if (printk_ratelimit()) {
+		print_hex_dump(KERN_DEBUG, "VMSA", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);
+	}
+
 	return 0;
 }
 
Signature · 4 lines
v2:
- Use KERN_DEBUG for print_hex_dump()
- Check for ratelimit.
2.37.1