diff mbox

[XTF,v2] tests: add fep test

Message ID 1466433878-19257-1-git-send-email-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu June 20, 2016, 2:44 p.m. UTC
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
v2:
1. Add test to index file
2. Only test hvm32 environment
3. Add more description
---
 docs/all-tests.dox |  2 ++
 tests/fep/Makefile | 12 ++++++++++++
 tests/fep/main.c   | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 tests/fep/Makefile
 create mode 100644 tests/fep/main.c

Comments

Andrew Cooper June 20, 2016, 2:48 p.m. UTC | #1
On 20/06/16 15:44, Wei Liu wrote:
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> and committed.
Thanks.

~Andrew
diff mbox

Patch

diff --git a/docs/all-tests.dox b/docs/all-tests.dox
index 3a64b93..60ba484 100644
--- a/docs/all-tests.dox
+++ b/docs/all-tests.dox
@@ -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
index 0000000..e9410c2
--- /dev/null
+++ b/tests/fep/Makefile
@@ -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
index 0000000..de00461
--- /dev/null
+++ b/tests/fep/main.c
@@ -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:
+ */