From: Prarit Bhargava <prarit@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>, Avi Kivity <avi@redhat.com>,
Gleb Natapov <gleb@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
Marcelo Tostatti <mtosatti@redhat.com>,
Ingo Molnar <mingo@redhat.com>,
kvm@vger.kernel.org, x86@kernel.org
Subject: [PATCH] x86, add hypervisor name to dump_stack()
Date: Wed, 10 Oct 2012 10:27:48 -0400 [thread overview]
Message-ID: <1349879268-3573-1-git-send-email-prarit@redhat.com> (raw)
Debugging crash, panics, stack trace WARN_ONs, etc., from both virtual and
bare-metal boots can get difficult very quickly. While there are ways to
decipher the output and determine if the output is from a virtual guest,
the in-kernel hypervisors now have a single registration point and set
x86_hyper. We can use this to output a single extra line on virtual
machines that indicates the hypervisor type.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Marcelo Tostatti <mtosatti@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: kvm@vger.kernel.org
Cc: x86@kernel.org
---
arch/x86/kernel/dumpstack.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index ae42418b..75a635e 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -17,6 +17,7 @@
#include <linux/sysfs.h>
#include <asm/stacktrace.h>
+#include <asm/hypervisor.h>
int panic_on_unrecovered_nmi;
@@ -193,6 +194,8 @@ void dump_stack(void)
init_utsname()->release,
(int)strcspn(init_utsname()->version, " "),
init_utsname()->version);
+ if (x86_hyper && x86_hyper->name)
+ printk("Hypervisor: %s\n", x86_hyper->name);
show_trace(NULL, NULL, &stack, bp);
}
EXPORT_SYMBOL(dump_stack);
--
1.7.9.3
next reply other threads:[~2012-10-10 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 14:27 Prarit Bhargava [this message]
2012-10-24 9:49 ` Ingo Molnar
2012-10-24 12:15 ` Prarit Bhargava
2012-10-24 12:58 ` Ingo Molnar
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=1349879268-3573-1-git-send-email-prarit@redhat.com \
--to=prarit@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=x86@kernel.org \
/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
Powered by JetHome