From: Chao Gao <chao.gao@intel.com>
To: seanjc@google.com, maz@kernel.org, kvm@vger.kernel.org,
pbonzini@redhat.com, kevin.tian@intel.com, tglx@linutronix.de
Cc: Chao Gao <chao.gao@intel.com>, linux-kernel@vger.kernel.org
Subject: [PATCH v4 3/6] KVM: Provide more information in kernel log if hardware enabling fails
Date: Wed, 16 Feb 2022 11:15:18 +0800 [thread overview]
Message-ID: <20220216031528.92558-4-chao.gao@intel.com> (raw)
In-Reply-To: <20220216031528.92558-1-chao.gao@intel.com>
From: Sean Christopherson <seanjc@google.com>
Provide the name of the calling function to hardware_enable_nolock() and
include it in the error message to provide additional information on
exactly what path failed.
Opportunistically bump the pr_info() to pr_warn(), failure to enable
virtualization support is warn-worthy as _something_ is wrong with the
system.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Chao Gao <chao.gao@intel.com>
---
virt/kvm/kvm_main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ee47d33d69e1..c7229f5c9f66 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4833,7 +4833,7 @@ static struct miscdevice kvm_dev = {
&kvm_chardev_ops,
};
-static void hardware_enable_nolock(void *junk)
+static void hardware_enable_nolock(void *caller_name)
{
int cpu = raw_smp_processor_id();
int r;
@@ -4848,7 +4848,8 @@ static void hardware_enable_nolock(void *junk)
if (r) {
cpumask_clear_cpu(cpu, cpus_hardware_enabled);
atomic_inc(&hardware_enable_failed);
- pr_info("kvm: enabling virtualization on CPU%d failed\n", cpu);
+ pr_warn("kvm: enabling virtualization on CPU%d failed during %s()\n",
+ cpu, (const char *)caller_name);
}
}
@@ -4856,7 +4857,7 @@ static int kvm_starting_cpu(unsigned int cpu)
{
raw_spin_lock(&kvm_count_lock);
if (kvm_usage_count)
- hardware_enable_nolock(NULL);
+ hardware_enable_nolock((void *)__func__);
raw_spin_unlock(&kvm_count_lock);
return 0;
}
@@ -4905,7 +4906,7 @@ static int hardware_enable_all(void)
kvm_usage_count++;
if (kvm_usage_count == 1) {
atomic_set(&hardware_enable_failed, 0);
- on_each_cpu(hardware_enable_nolock, NULL, 1);
+ on_each_cpu(hardware_enable_nolock, (void *)__func__, 1);
if (atomic_read(&hardware_enable_failed)) {
hardware_disable_all_nolock();
@@ -5530,7 +5531,7 @@ static void kvm_resume(void)
#ifdef CONFIG_LOCKDEP
WARN_ON(lockdep_is_held(&kvm_count_lock));
#endif
- hardware_enable_nolock(NULL);
+ hardware_enable_nolock((void *)__func__);
}
}
--
2.25.1
next prev parent reply other threads:[~2022-02-16 3:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 3:15 [PATCH v4 0/6] Improve KVM's interaction with CPU hotplug Chao Gao
2022-02-16 3:15 ` [PATCH v4 1/6] KVM: x86: Move check_processor_compatibility from init ops to runtime ops Chao Gao
2022-02-16 3:15 ` [PATCH v4 2/6] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs" Chao Gao
2022-02-16 3:25 ` Anup Patel
2022-02-16 16:21 ` Claudio Imbrenda
2022-03-17 13:24 ` Suzuki Kuruppassery Poulose
2022-02-16 3:15 ` Chao Gao [this message]
2022-02-16 3:15 ` [PATCH v4 4/6] KVM: arm64: Simplify the CPUHP logic Chao Gao
2022-03-17 17:36 ` Oliver Upton
2022-02-16 3:15 ` [PATCH v4 5/6] KVM: Rename and move CPUHP_AP_KVM_STARTING to ONLINE section Chao Gao
2022-02-18 18:34 ` Sean Christopherson
2022-02-16 3:15 ` [PATCH v4 6/6] KVM: Do compatibility checks on hotplugged CPUs Chao Gao
2022-03-17 9:15 ` [PATCH v4 0/6] Improve KVM's interaction with CPU hotplug Chao Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220216031528.92558-4-chao.gao@intel.com \
--to=chao.gao@intel.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®