>From 9141a36374f52434a291e3be41bd259cfb9bda72 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 23 Nov 2017 18:31:40 +0000 Subject: [PATCH] MMIO failure trigger --- tests/hvm-print/Makefile | 9 +++++++++ tests/hvm-print/main.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/hvm-print/Makefile create mode 100644 tests/hvm-print/main.c diff --git a/tests/hvm-print/Makefile b/tests/hvm-print/Makefile new file mode 100644 index 0000000..c70bede --- /dev/null +++ b/tests/hvm-print/Makefile @@ -0,0 +1,9 @@ +include $(ROOT)/build/common.mk + +NAME := hvm-print +CATEGORY := utility +TEST-ENVS := hvm32 + +obj-perenv += main.o + +include $(ROOT)/build/gen.mk diff --git a/tests/hvm-print/main.c b/tests/hvm-print/main.c new file mode 100644 index 0000000..882b716 --- /dev/null +++ b/tests/hvm-print/main.c @@ -0,0 +1,40 @@ +/** + * @file tests/hvm-print/main.c + * @ref test-hvm-print + * + * @page test-hvm-print hvm-print + * + * @todo Docs for test-hvm-print + * + * @see tests/hvm-print/main.c + */ +#include + +const char test_title[] = "Test hvm-print"; + +static char buf[2 * PAGE_SIZE] __page_aligned_bss; + +void test_main(void) +{ + char *ptr = &buf[4090]; + size_t len; + + strcpy(ptr, "String crossing a page boundary\n"); + len = strlen(ptr); + + asm volatile("rep; outsb" + : "+S" (ptr), "+c" (len) + : "d" (0xe9)); + + xtf_success(NULL); +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ -- 2.1.4