x86: Add ENDBR at function entries
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 18 Feb 2020 22:05:39 +0000 (14:05 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Mar 2020 23:38:46 +0000 (16:38 -0700)
commite352e7e792699661422218c1dc8ad06b4bbf6652
tree9ee41973d219b92449304596f171eae13ce271e7
parent9899a8e26c5c9063c3627e246981d727321e5ba3
x86: Add ENDBR at function entries

Intel Control-flow Enforcement Technology (CET):

https://software.intel.com/en-us/articles/intel-sdm

contains shadow stack (SHSTK) and indirect branch tracking (IBT).
When IBT is enabled, all indirect branch targets must start with
ENDBR instruction which is a NOP on non-CET processors.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2538
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ben Widawsky <ben.widawsky@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3865>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3865>
src/mapi/entry_x86-64_tls.h
src/mapi/entry_x86_tls.h
src/mapi/entry_x86_tsd.h