From: Wei Liu <wl@xen.org>
To: Xen Development List <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <liuwe@microsoft.com>, "Wei Liu" <wl@xen.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Michael Kelley" <mikelley@microsoft.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH for-next v2 8/9] x86: be more verbose when running on a hypervisor
Date: Mon, 30 Sep 2019 16:00:42 +0100 [thread overview]
Message-ID: <20190930150044.5734-9-liuwe@microsoft.com> (raw)
In-Reply-To: <20190930150044.5734-1-liuwe@microsoft.com>
Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
xen/arch/x86/guest/hypervisor.c | 5 +++++
xen/arch/x86/setup.c | 6 +++++-
xen/include/asm-x86/guest/hypervisor.h | 2 ++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/guest/hypervisor.c b/xen/arch/x86/guest/hypervisor.c
index 30453b6a7a..8161b26c5a 100644
--- a/xen/arch/x86/guest/hypervisor.c
+++ b/xen/arch/x86/guest/hypervisor.c
@@ -43,6 +43,11 @@ bool hypervisor_probe(void)
return !!hops;
}
+const char *hypervisor_name(void)
+{
+ return hops->name;
+}
+
void hypervisor_setup(void)
{
if ( hops && hops->setup )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 0ee11b15a6..cf5a7b8e1e 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -689,6 +689,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
int i, j, e820_warn = 0, bytes = 0;
bool acpi_boot_table_init_done = false, relocated = false;
int ret;
+ bool running_on_hypervisor;
struct ns16550_defaults ns16550 = {
.data_bits = 8,
.parity = 'n',
@@ -763,7 +764,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
* allocing any xenheap structures wanted in lower memory. */
kexec_early_calculations();
- hypervisor_probe();
+ running_on_hypervisor = hypervisor_probe();
parse_video_info();
@@ -789,6 +790,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
printk("Xen image load base address: %#lx\n", xen_phys_start);
+ if ( running_on_hypervisor )
+ printk("Running on %s\n", hypervisor_name());
+
#ifdef CONFIG_VIDEO
printk("Video information:\n");
diff --git a/xen/include/asm-x86/guest/hypervisor.h b/xen/include/asm-x86/guest/hypervisor.h
index 38344e2e89..a7d75bf9cf 100644
--- a/xen/include/asm-x86/guest/hypervisor.h
+++ b/xen/include/asm-x86/guest/hypervisor.h
@@ -36,6 +36,7 @@ bool hypervisor_probe(void);
void hypervisor_setup(void);
void hypervisor_ap_setup(void);
void hypervisor_resume(void);
+const char *hypervisor_name(void);
#else
@@ -45,6 +46,7 @@ static inline bool hypervisor_probe(void) { return false; }
static inline void hypervisor_setup(void) {}
static inline void hypervisor_ap_setup(void) {}
static inline void hypervisor_resume(void) {}
+static inline char *hypervisor_name(void) { return NULL; }
#endif /* CONFIG_GUEST */
--
2.20.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-09-30 15:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 15:00 [Xen-devel] [PATCH for-next v2 0/9] Port Xen to Hyper-V Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 1/9] x86: introduce CONFIG_GUEST and move code Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 2/9] x86: include asm_defns.h directly in hypercall.h Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 3/9] x86: drop hypervisor_cpuid_base Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 4/9] x86: include xen/lib.h in guest/hypercall.h Wei Liu
2019-10-21 9:02 ` Roger Pau Monné
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 5/9] x86: introduce hypervisor framework Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 6/9] x86: rename hypervisor_{alloc, free}_unused_page Wei Liu
2019-10-21 9:11 ` Roger Pau Monné
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 7/9] x86: switch xen implementation to use hypervisor framework Wei Liu
2019-10-21 9:56 ` Roger Pau Monné
2019-10-21 14:35 ` Wei Liu
2019-09-30 15:00 ` Wei Liu [this message]
2019-10-21 10:00 ` [Xen-devel] [PATCH for-next v2 8/9] x86: be more verbose when running on a hypervisor Roger Pau Monné
2019-10-21 14:35 ` Wei Liu
2019-10-23 13:22 ` Jan Beulich
2019-11-05 11:17 ` Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next v2 9/9] x86: introduce CONFIG_HYPERV and detection code Wei Liu
2019-09-30 15:04 ` Wei Liu
2019-10-21 10:22 ` Roger Pau Monné
2019-10-21 10:26 ` Roger Pau Monné
2019-10-21 15:02 ` Andrew Cooper
2019-10-21 15:26 ` Wei Liu
2019-10-21 14:56 ` Wei Liu
2019-10-21 15:11 ` Roger Pau Monné
2019-10-21 15:20 ` Wei Liu
2019-09-30 15:00 ` [Xen-devel] [PATCH for-next RFC 0/8] Port Xen to Hyper-V Wei Liu
2019-10-21 8:58 ` [Xen-devel] [PATCH for-next v2 0/9] " Wei Liu
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=20190930150044.5734-9-liuwe@microsoft.com \
--to=wl@xen.org \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=liuwe@microsoft.com \
--cc=mikelley@microsoft.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.