2017-05-08 17:03:36 |
dann frazier |
description |
[Impact]
Userspace reads of CNTVCT_EL0 are broken on HiSilicon D05 systems, which breaks some applications such as OpenMPI.
[Test Case]
#include <sys/times.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
unsigned int freq;
__asm__ __volatile__ ("mrs %0, CNTFRQ_EL0" : "=r" (freq));
printf("freq %d\n",freq);
return (int)freq;
}
==================================
gcc test.c test
./test
This will report an illegal instruction, but should print a frequency value.
[Regression Risk]
The best way we can minimize risk is to verify on both a system that has an errata handler for the timer (D05) and a system that doesn't. We should then be exercising both code paths. |
[Impact]
Userspace reads of CNTVCT_EL0 are broken on HiSilicon D05 systems, which breaks some applications such as OpenMPI.
[Test Case]
#include <sys/times.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
unsigned int freq;
__asm__ __volatile__ ("mrs %0, CNTFRQ_EL0" : "=r" (freq));
printf("freq %d\n",freq);
return (int)freq;
}
==================================
gcc test.c test
./test
This will report an illegal instruction, but should print a frequency value.
[Regression Risk]
The best way we can minimize risk is to verify on both a system that has an errata handler for the timer (D05) and a system that doesn't. We should then be exercising both code paths.
I have regression tested this, using the above test case, on the HP m400, the QDT Centriq 2400, and a Cavium ThunderX CRB. |
|