From 3c42cc803c2163daa199021852224b9ca476e9c5 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 3 Dec 2021 11:17:50 +0100 Subject: [PATCH] x86/HVM: skip offline vCPU-s when dumping VMCBs/VMCSes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There's not really any register state associated with vCPU-s that haven't been initialized yet, so avoid spamming the log with largely useless information while still leaving an indication of the fact. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- xen/arch/x86/hvm/svm/vmcb.c | 5 +++++ xen/arch/x86/hvm/vmx/vmcs.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index 565e997155..efa085032b 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -242,6 +242,11 @@ static void vmcb_dump(unsigned char ch) printk("\n>>> Domain %d <<<\n", d->domain_id); for_each_vcpu ( d, v ) { + if ( !v->is_initialised ) + { + printk("\tVCPU %u: not initialized\n", v->vcpu_id); + continue; + } printk("\tVCPU %d\n", v->vcpu_id); svm_vmcb_dump("key_handler", v->arch.hvm.svm.vmcb); } diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index f9f9bc18cd..7ab15e07a0 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -2133,6 +2133,11 @@ static void vmcs_dump(unsigned char ch) printk("\n>>> Domain %d <<<\n", d->domain_id); for_each_vcpu ( d, v ) { + if ( !v->is_initialised ) + { + printk("\tVCPU %u: not initialized\n", v->vcpu_id); + continue; + } printk("\tVCPU %d\n", v->vcpu_id); vmcs_dump_vcpu(v); } -- 2.30.2