On 12/4/21 4:32 PM, Reinette Chatre wrote:
I am not sure what the right way is to fix it though - my original intention, what the code uses, was to add a snippet as below as is the custom for all tests needing to run cpuid. There are many usages of cpuid among the selftests but none rely on the cpuid.h to bring in __cpuid_count. I do not know the motivation for this but preferred to stick with the custom for my implementation.
+static inline void __cpuid(unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) +{ + asm volatile("cpuid" + : "=a" (*eax), + "=b" (*ebx), + "=c" (*ecx), + "=d" (*edx) + : "0" (*eax), "2" (*ecx) + : "memory"); +}
Reinette, is there some reason using __cpuid_count() won't work for the SGX test? Or is your concern that it _might_ break something because you haven't tested it?