[prev in list] [next in list] [prev in thread] [next in thread]
List: xen-devel
Subject: [Xen-devel] [PATCH v6 07/11] DO NOT APPLY: x86/hyperv: issue an hypercall
From: Wei Liu <wl () xen ! org>
Date: 2020-01-31 17:49:26
Message-ID: 20200131174930.31045-8-liuwe () microsoft ! com
[Download RAW message or body]
Test if the infrastructure works.
Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
xen/arch/x86/guest/hyperv/hyperv.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c
index 7c2a96d70e..052b053160 100644
--- a/xen/arch/x86/guest/hyperv/hyperv.c
+++ b/xen/arch/x86/guest/hyperv/hyperv.c
@@ -23,6 +23,7 @@
#include <asm/fixmap.h>
#include <asm/guest.h>
+#include <asm/guest/hyperv-hcall.h>
#include <asm/guest/hyperv-tlfs.h>
#include <asm/processor.h>
@@ -114,6 +115,19 @@ static void __init setup_hypercall_page(void)
BUG_ON(!hypercall_msr.enable);
set_fixmap_x(FIX_X_HYPERV_HCALL, mfn << PAGE_SHIFT);
+
+ /* XXX Wei: Issue an hypercall here to make sure things are set up
+ * correctly. When there is actual use of the hypercall facility,
+ * this can be removed.
+ */
+ {
+ uint16_t r = hv_do_hypercall(0xffff, 0, 0);
+ BUG_ON(r != HV_STATUS_INVALID_HYPERCALL_CODE);
+ r = hv_do_fast_hypercall(0xffff, 0, 0);
+ BUG_ON(r != HV_STATUS_INVALID_HYPERCALL_CODE);
+
+ printk("Successfully issued Hyper-V hypercalls\n");
+ }
}
static void __init setup(void)
--
2.20.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic