[PATCH 2/2] selftests/powerpc: Test TM and VMX register state
Michael Ellerman
mpe at ellerman.id.au
Mon May 15 19:31:06 AEST 2017
Michael Neuling <mikey at neuling.org> writes:
> diff --git a/tools/testing/selftests/powerpc/tm/tm-vmx-unavail.c b/tools/testing/selftests/powerpc/tm/tm-vmx-unavail.c
> new file mode 100644
> index 0000000000..137185ba49
> --- /dev/null
> +++ b/tools/testing/selftests/powerpc/tm/tm-vmx-unavail.c
> @@ -0,0 +1,118 @@
> +/*
> + * Copyright 2017, Michael Neuling, IBM Corp.
> + * Licensed under GPLv2.
> + * Original: Breno Leitao <brenohl at br.ibm.com> &
> + * Gustavo Bueno Romero <gromero at br.ibm.com>
> + * Edited: Michael Neuling
> + *
> + * Force VMX unavailable during a transaction and see if it corrupts
> + * the checkpointed VMX register state after the abort.
> + */
> +
> +#include <inttypes.h>
> +#include <htmintrin.h>
> +#include <string.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <pthread.h>
> +#include <sys/mman.h>
> +#include <unistd.h>
> +#include <pthread.h>
> +
> +#include "tm.h"
> +#include "utils.h"
> +
> +int passed;
> +
> +void *worker(void *unused)
> +{
> + __int128 vmx0;
> + uint64_t texasr;
On BE:
ppc64-gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"v4.12-rc1-3-ge36b67a25585"' -I/home/michael/work/topics/powerpc-maint/src/maint/tools/testing/selftests/powerpc/include -mhtm -pthread tm-vmx-unavail.c ../harness.c ../utils.c -o /home/michael/work/topics/powerpc-maint/src/maint/tools/testing/selftests/powerpc/tm/tm-vmx-unavail
tm-vmx-unavail.c: In function ‘worker’:
tm-vmx-unavail.c:29:2: error: expected expression before ‘__int128’
__int128 vmx0;
^
tm-vmx-unavail.c:62:21: error: ‘vmx0’ undeclared (first use in this function)
: [vmx0_ptr] "r"(&vmx0)
^
tm-vmx-unavail.c:62:21: note: each undeclared identifier is reported only once for each function it appears in
tm-vmx-unavail.c:72:9: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
printf("Failure with error: %lx\n", _TEXASR_FAILURE_CODE(texasr));
^
tm-vmx-unavail.c:73:9: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
printf("Summary error : %lx\n", _TEXASR_FAILURE_SUMMARY(texasr));
^
tm-vmx-unavail.c:74:9: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
printf("TFIAR exact : %lx\n\n", _TEXASR_TFIAR_EXACT(texasr));
^
cc1: all warnings being treated as errors
I tried -maltivec/vsx but that didn't fix it.
cheers
More information about the Linuxppc-dev
mailing list