From 5c54742da4685ca0db0556454bfdd2b14e1bfc36 Mon Sep 17 00:00:00 2001 From: Alexander Ivchenko Date: Fri, 18 May 2018 11:58:25 +0000 Subject: [X86][CET] Changing -fcf-protection behavior to comply with gcc (LLVM part) This patch aims to match the changes introduced in gcc by https://gcc.gnu.org/ml/gcc-cvs/2018-04/msg00534.html. The IBT feature definition is removed, with the IBT instructions being freely available on all X86 targets. The shadow stack instructions are also being made freely available, and the use of all these CET instructions is controlled by the module flags derived from the -fcf-protection clang option. The hasSHSTK option remains since clang uses it to determine availability of shadow stack instruction intrinsics, but it is no longer directly used. Comes with a clang patch (D46881). Patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D46882 llvm-svn: 332705 --- llvm/lib/Support/Host.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'llvm/lib/Support/Host.cpp') diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index 9981bcc75f0..775db63d7de 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -1264,8 +1264,6 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["movdiri"] = HasLeaf7 && ((ECX >> 27) & 1); Features["movdir64b"] = HasLeaf7 && ((ECX >> 28) & 1); - Features["ibt"] = HasLeaf7 && ((EDX >> 20) & 1); - // There are two CPUID leafs which information associated with the pconfig // instruction: // EAX=0x7, ECX=0x0 indicates the availability of the instruction (via the 18th -- cgit v1.2.3