All of lore.kernel.org
 help / color / mirror / Atom feed
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 RFC 6/8] x86: make probe_xen return boolean value
Date: Mon, 23 Sep 2019 11:09:29 +0100	[thread overview]
Message-ID: <20190923100931.29670-7-liuwe@microsoft.com> (raw)
In-Reply-To: <20190923100931.29670-1-liuwe@microsoft.com>

We need indication whether it has succeeded or not.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
 xen/arch/x86/guest/hypervisor.c | 5 ++++-
 xen/arch/x86/guest/xen/xen.c    | 7 ++++---
 xen/include/asm-x86/guest/xen.h | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/guest/hypervisor.c b/xen/arch/x86/guest/hypervisor.c
index b0a724bf13..fb572b0402 100644
--- a/xen/arch/x86/guest/hypervisor.c
+++ b/xen/arch/x86/guest/hypervisor.c
@@ -34,7 +34,10 @@ void __init probe_hypervisor(void)
     if ( !(cpuid_ecx(1) & cpufeat_mask(X86_FEATURE_HYPERVISOR)) )
         return;
 
-    probe_xen();
+    if ( probe_xen() )
+        return;
+
+    /* Hyper-V probing to follow. */
 }
 
 static void __init init_memmap(void)
diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index a730e6ad1b..8390b045f0 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -66,20 +66,21 @@ static void __init find_xen_leaves(void)
     }
 }
 
-void __init probe_xen(void)
+bool __init probe_xen(void)
 {
     if ( xen_guest )
-        return;
+        return true;
 
     find_xen_leaves();
 
     if ( !xen_cpuid_base )
-        return;
+        return false;
 
     /* Fill the hypercall page. */
     wrmsrl(cpuid_ebx(xen_cpuid_base + 2), __pa(hypercall_page));
 
     xen_guest = true;
+    return true;
 }
 
 static void map_shared_info(void)
diff --git a/xen/include/asm-x86/guest/xen.h b/xen/include/asm-x86/guest/xen.h
index d031f1f70d..7eda3d4956 100644
--- a/xen/include/asm-x86/guest/xen.h
+++ b/xen/include/asm-x86/guest/xen.h
@@ -32,7 +32,7 @@ extern bool xen_guest;
 extern bool pv_console;
 extern uint32_t xen_cpuid_base;
 
-void probe_xen(void);
+bool probe_xen(void);
 void xen_setup(void);
 void xen_ap_setup(void);
 void xen_resume(void);
@@ -45,7 +45,7 @@ DECLARE_PER_CPU(struct vcpu_info *, vcpu_info);
 #define xen_guest 0
 #define pv_console 0
 
-static inline void probe_xen(void) {}
+static inline bool probe_xen(void) { return false; }
 
 #endif /* CONFIG_XEN_GUEST */
 #endif /* __X86_GUEST_XEN_H__ */
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-09-23 10:10 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23 10:09 [Xen-devel] [PATCH for-next RFC 0/8] Port Xen to Hyper-V Wei Liu
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 1/8] x86: introduce CONFIG_GUEST and move code Wei Liu
2019-09-25  9:59   ` Roger Pau Monné
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 2/8] x86: include asm_defns.h directly in hypercall.h Wei Liu
2019-09-25 10:02   ` Roger Pau Monné
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 3/8] x86: drop hypervisor_cpuid_base Wei Liu
2019-09-25 10:07   ` Roger Pau Monné
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 4/8] x86: factor out xen variants for hypervisor setup code Wei Liu
2019-09-25 10:23   ` Roger Pau Monné
2019-09-27 11:30     ` Wei Liu
2019-09-27 11:39       ` Jan Beulich
2019-09-27 12:47         ` Wei Liu
2019-09-27 12:56           ` Jan Beulich
2019-09-27 11:41       ` Roger Pau Monné
2019-09-27 12:46         ` Wei Liu
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 5/8] x86: factor out hypervisor agnostic code Wei Liu
2019-09-25 10:39   ` Roger Pau Monné
2019-09-27 11:18     ` Wei Liu
2019-09-23 10:09 ` Wei Liu [this message]
2019-09-25 10:44   ` [Xen-devel] [PATCH for-next RFC 6/8] x86: make probe_xen return boolean value Roger Pau Monné
2019-09-27 11:18     ` Wei Liu
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 7/8] x86: introduce CONFIG_HYPERV and hyperv directory Wei Liu
2019-09-25 10:48   ` Roger Pau Monné
2019-09-27 11:18     ` Wei Liu
2019-09-23 10:09 ` [Xen-devel] [PATCH for-next RFC 8/8] x86: be more verbose when running nested Wei Liu
2019-09-25 10:54   ` Roger Pau Monné
2019-09-23 10:48 ` [Xen-devel] [PATCH for-next RFC 0/8] Port Xen to Hyper-V Paul Durrant
2019-09-23 11:27   ` Wei Liu
2019-09-23 12:11     ` Paul Durrant
2019-09-23 12:54       ` Wei Liu
2019-09-23 13:33         ` Wei Liu
2019-09-23 13:47           ` Paul Durrant
2019-09-23 14:21             ` Wei Liu
2019-09-23 14:39               ` Paul Durrant
2019-09-23 14:41                 ` Wei Liu
2019-09-25 11:02 ` Roger Pau Monné
2019-09-25 15:36   ` Wei Liu
2019-09-26 10:37     ` Wei Liu
2019-09-26 10:41     ` Roger Pau Monné
2019-09-26 10:50       ` 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=20190923100931.29670-7-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.