new file mode 100644
@@ -0,0 +1,9 @@
+include $(ROOT)/build/common.mk
+
+NAME := perf-PV-MMUEXT_MARK_SUPER-noop
+CATEGORY := benchmark
+TEST-ENVS := pv64
+
+obj-perenv += main.o
+
+include $(ROOT)/build/gen.mk
new file mode 100644
@@ -0,0 +1,80 @@
+/**
+ * Copyright (C) Amazon.com, Inc. or its affiliates.
+ * Author: Norbert Manthey <nmanthey@amazon.de>
+ *
+ * @file tests/perf-PV-MMUEXT_MARK_SUPER-noop/main.c
+ * @ref test-perf-PV-MMUEXT_MARK_SUPER-noop
+ *
+ * @page perf-PV-MMUEXT_MARK_SUPER-noop
+ *
+ * This test runs the hypercall mmuext_op with the command MMUEXT_MARK_SUPER in
+ * a tight loop, and measures how much time it takes for all loops. Finally, the
+ * test prints this time.
+ *
+ * Since this is a performance test, the actual value is furthermore printed
+ * using the predefined pattern on a separate line. The reported value
+ * represents the time it takes to run the mmuext_op hypercall in nano seconds.
+ * The average is calculated by running the call for about 5 minutes.
+ *
+ * perf <testname> <value>
+ *
+ * @see tests/perf-PV-MMUEXT_MARK_SUPER-noop/main.c
+ */
+
+/* To improve precision of the measurement, try to run the hypercall for this
+ amount of seconds. As the time per call can be different for test machines,
+ we measure the time for the below number of calls, and estimate the number of
+ calls to perform accordingly. */
+#define MEASUREMENT_SECONDS 300
+
+/* This number of calls to the function under test will be used to estimate how
+ many times we need to call the function to measure for about 5 minutes. */
+#define CALIBRATION_CALLS 1000
+
+#include <xtf/time.h>
+#include <xtf.h>
+
+const char test_title[] = "Test perf-MMUEXT_MARK_SUPER";
+
+/* Use a global struct to avoid local variables in call_MMUEXT_MARK_SUPER */
+mmuext_op_t op =
+{
+ .cmd = MMUEXT_MARK_SUPER,
+ .arg1.mfn = 1,
+};
+
+/* Schedule a no-op hypercall */
+int call_MMUEXT_MARK_SUPER(void)
+{
+ return hypercall_mmuext_op(&op, 1, NULL, DOMID_SELF);
+}
+
+void test_main(void)
+{
+ int rc = 0;
+
+ /* Test whether the hypercall is implemented as expected */
+ rc = call_MMUEXT_MARK_SUPER();
+ if(rc != -EOPNOTSUPP && rc != -EINVAL && rc != -ENOSYS)
+ return xtf_error("Unexpected MMUEXT_MARK_SUPER, rc %d\n", rc);
+
+ /* Measuring average execution time for given function, and print stats */
+ measure_performance(test_title,
+ "mmuext_op(MMUEXT_MARK_SUPER, ...)",
+ call_MMUEXT_MARK_SUPER,
+ MEASUREMENT_SECONDS,
+ CALIBRATION_CALLS,
+ 1);
+
+ return xtf_success("Success: performed MMUEXT_MARK_SUPER hypercall with expected result\n");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */