From: Andrew Cooper Date: Wed, 11 Dec 2019 17:23:47 +0000 (+0000) Subject: Splitlock X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fsplitlock;p=people%2Fandrewcoop%2Fxen-test-framework.git Splitlock --- diff --git a/docs/all-tests.dox b/docs/all-tests.dox index 892a9e4..ff88aee 100644 --- a/docs/all-tests.dox +++ b/docs/all-tests.dox @@ -176,6 +176,8 @@ states. @subpage test-msr - Print MSR information. +@subpage test-splitlock - Splitlock generator. + @subpage test-rtm-check - Probe for the RTM behaviour. diff --git a/tests/splitlock/Makefile b/tests/splitlock/Makefile new file mode 100644 index 0000000..e486f48 --- /dev/null +++ b/tests/splitlock/Makefile @@ -0,0 +1,9 @@ +include $(ROOT)/build/common.mk + +NAME := splitlock +CATEGORY := utility +TEST-ENVS := pv64 hvm64 + +obj-perenv += main.o + +include $(ROOT)/build/gen.mk diff --git a/tests/splitlock/main.c b/tests/splitlock/main.c new file mode 100644 index 0000000..a5dc180 --- /dev/null +++ b/tests/splitlock/main.c @@ -0,0 +1,33 @@ +/** + * @file tests/splitlock/main.c + * @ref test-splitlock + * + * @page test-splitlock splitlock + * + * @todo Docs for test-splitlock + * + * @see tests/splitlock/main.c + */ +#include + +const char test_title[] = "Test splitlock"; + +void test_main(void) +{ + unsigned int *ptr = _p(KB(8) - 2); + + for ( ;; ) + asm volatile ("lock incl %0" : "+m" (*ptr)); + + xtf_success(NULL); +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */