[Lldb-commits] [PATCH] D24559: Use Intel CPU flags to determine target supported features.

Valentina Giusti via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 14 08:28:40 PDT 2016


valentinagiusti marked 2 inline comments as done.
valentinagiusti added a comment.

This fixes the fact that there is no proper check that the kernel or the hardware are actually supporting either AVX or MPX. Before this patch, the code only relied on a "hack" that checks if it's possible to do a ptrace to retrieve the XSAVE or FXSAVE areas: the assumption was that if XSAVE is there, then there must be also AVX and MPX, which obviously is not the correct thing to do.
The 'cpuid' calls (wrappers for the CPUID instruction) get the info directly from the hardware, and then the ptrace call is made to actually get either FXSAVE or XSAVE. If XSAVE is there, then 'cpuid' is used again to check the hardware for AVX and MPX, and then if this step is also successful, the XSAVE memory region is further checked to verify that the kernel is properly handling these features.
Basically it's both a refactoring and a fix, and it doesn't require a dedicated test: the fact that the current register tests succeed is proof enough.


https://reviews.llvm.org/D24559





More information about the lldb-commits mailing list