Re: [PATCH] KVM: SVM: Only dump VSMA to klog for debugging

From: Sean Christopherson
Date: Thu Nov 03 2022 - 18:25:42 EST


On Thu, Nov 03, 2022, Peter Gonda wrote:
> The KERN_CONT documentation says it defaults back to KERNL_DEFAULT if the

State what actually happens. Documentation is sometimes wrong, and just saying
"the docs say XYZ" makes it sound like this is a fix based on code inspection,
whereas you encountered a real problem. E.g.

Explicitly print the VMSA dump at KERN_DEBUG log level, KERN_CONT uses
KERNEL_DEFAULT if the previous log line has a newline, i.e. if there's
nothing to continuing, and as a result the VMSA gets dumped when it
shouldn't.

> previous log line has a newline. So switch from KERN_CONT to
> print_hex_dump_debug().

Jarkko pointed this out in the original submission, but the buggy patch got queued
without the fixup. This is a good opportunity to throw in a link so that it's
clear that the change is aligned with the original intent.

Link: https://lore.kernel.org/all/YuPMeWX4uuR1Tz3M@xxxxxxxxxx

> Cc: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
> Cc: Harald Hoyer <harald@xxxxxxxxxxx>
> Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Cc: Sean Christopherson <seanjc@xxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Cc: x86@xxxxxxxxxx
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> Cc: kvm@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Peter Gonda <pgonda@xxxxxxxxxx>
>
> Fixes: 6fac42f127b8 ("KVM: SVM: Dump Virtual Machine Save Area (VMSA) to klog")

Fixes: usually goes before everything else, and this should probably Cc stable@
as well.

With the above tweaks,

Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx>