x86/clang: add retpoline support
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 18 Feb 2022 14:34:15 +0000 (15:34 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 21 Feb 2022 18:17:56 +0000 (18:17 +0000)
commit9412486707f8f1ca2eb31c2ef330c5e39c0a2f30
treeab2e683297f5ac795a128ca6053a176f2987e101
parente245bc154300b5d0367b64e8b937c9d1da508ad3
x86/clang: add retpoline support

Detect whether the compiler supports clang retpoline option and enable
by default if available, just like it's done for gcc.

Note clang already disables jump tables when retpoline is enabled, so
there's no need to also pass the fno-jump-tables parameter. Also clang
already passes the return address in a register always on amd64, so
there's no need for any equivalent mindirect-branch-register
parameter.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/Kconfig
xen/arch/x86/arch.mk