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



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to