I have an intel Xeon CPU E3-1245 v5 machine supporting Intel TSX technology (checked using https://github.com/andikleen/tsx-tools/blob/master/has-tsx.c). I tried to run the following RTM code:
#include <stdio.h>
#include <immintrin.h>
int main()
{
unsigned status = _xbegin();
if ((status == _XBEGIN_STARTED) {
printf("%d", _xtest());
_xend();
} else printf("Transaction failed");
return 0;
}
The code compiles without errors, but I got a "Segmentation Fault" error on _xend() instruction at runtime. Please, can anyone tell me how to setup a proper environment to write, compile and run TSX RTM programs?