]> xenbits.xensource.com Git - xtf.git/commitdiff
Add FEP utility
authorWei Liu <wei.liu2@citrix.com>
Mon, 20 Jun 2016 14:44:38 +0000 (15:44 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 20 Jun 2016 14:46:15 +0000 (15:46 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
docs/all-tests.dox
tests/fep/Makefile [new file with mode: 0644]
tests/fep/main.c [new file with mode: 0644]

index 3a64b9343d99ebe55fb92597e5dd9d43c159d51e..60ba4841aeb450003aad59325c841b9cb02e4723 100644 (file)
@@ -41,5 +41,7 @@ Coveres XSA-106 and XSA-156.
 
 @subpage test-cpuid - Print CPUID information.
 
+@subpage test-fep - Test availability of HVM Forced Emulation Prefix.
+
 @subpage test-msr - Print MSR information.
 */
diff --git a/tests/fep/Makefile b/tests/fep/Makefile
new file mode 100644 (file)
index 0000000..e9410c2
--- /dev/null
@@ -0,0 +1,12 @@
+MAKEFLAGS += -r
+ROOT := $(abspath $(CURDIR)/../..)
+
+include $(ROOT)/build/common.mk
+
+NAME      := fep
+CATEGORY  := utility
+TEST-ENVS := hvm32
+
+obj-perenv += main.o
+
+include $(ROOT)/build/gen.mk
diff --git a/tests/fep/main.c b/tests/fep/main.c
new file mode 100644 (file)
index 0000000..de00461
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * @file tests/fep/main.c
+ * @ref test-fep
+ *
+ * @page test-fep FEP
+ *
+ * Test the availability of HVM Forced Emulation Prefix (FEP), which
+ * allows HVM guest arbitrarily exercise the instruction emulator.
+ *
+ * Returns SUCCESS if FEP is available, FAILURE if not.
+ *
+ * @sa tests/fep/main.c
+ */
+#include <xtf.h>
+
+void test_main(void)
+{
+    printk("Test availability of HVM forced emulation prefix\n");
+
+    if ( xtf_has_fep )
+        xtf_success(NULL);
+    else
+        xtf_failure(NULL);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */