Skip to contentSkip to conversation

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

PATCH Applied Jarkko Sakkinen 3 participants 3 messages Jul 28, 2022 – Jul 29, 2022

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/kvm/svm/sev.c +3 -0
index 0c240ed04f96..6d44aaba321a 100644
@@ -603,6 +603,9 @@ static int sev_es_sync_vmsa(struct vcpu_svm *svm)
 	save->xss  = svm->vcpu.arch.ia32_xss;
 	save->dr6  = svm->vcpu.arch.dr6;
 
+	pr_debug("Virtual Machine Save Area (VMSA):\n");
+	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);
+
 	return 0;
 }
 
Signature · 1 line
2.37.1
maintainer Applied
#1 lore raw
Quoted 15 lines · Jarkko Sakkinen

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 | 3 +++
  1 file changed, 3 insertions(+)
arch/x86/kvm/svm/sev.c +0 -0
index 0c240ed04f96..6d44aaba321a 100644

arch/x86/kvm/svm/sev.c static int sev_es_sync_vmsa(struct vcpu_svm *svm) · line 611

Quoted 9 lines
arch/x86/kvm/svm/sev.c +3 -0
@@ -603,6 +603,9 @@ static int sev_es_sync_vmsa(struct vcpu_svm *svm)
  	save->xss  = svm->vcpu.arch.ia32_xss;
  	save->dr6  = svm->vcpu.arch.dr6;
 
+	pr_debug("Virtual Machine Save Area (VMSA):\n");
+	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);
+
  	return 0;
  }
 

Queued, thanks.

Paolo

#2 lore raw
Quoted 26 lines · Paolo Bonzini
Quoted 15 lines · Jarkko Sakkinen

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 | 3 +++
  1 file changed, 3 insertions(+)
arch/x86/kvm/svm/sev.c +0 -0
index 0c240ed04f96..6d44aaba321a 100644

arch/x86/kvm/svm/sev.c static int sev_es_sync_vmsa(struct vcpu_svm *svm) · line 609

Quoted 7 lines
arch/x86/kvm/svm/sev.c +3 -0
@@ -603,6 +603,9 @@ static int sev_es_sync_vmsa(struct vcpu_svm *svm)
  	save->xss  = svm->vcpu.arch.ia32_xss;
  	save->dr6  = svm->vcpu.arch.dr6;
+	pr_debug("Virtual Machine Save Area (VMSA):\n");
+	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);
+
  	return 0;
  }

Queued, thanks.

Quoted 1 line

Paolo

Ugh, I made a mistake, sorry.

It should have been:

print_hex_dump(KERN_DEBUG, "VMSA:", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);

I sent wrong version of the patch.

BR, Jarkko