x86/emul: Update emulation stubs to be CET-IBT compatible
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 1 Nov 2021 10:09:59 +0000 (10:09 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 25 Mar 2022 17:06:38 +0000 (17:06 +0000)
commit135521e6d7bcb5ccf98f0698307df4f945ca7950
tree8dd1fe5f7028ffcae80c9fc387b90aed752b9ee3
parent1857cff82c5ff3ae4971e644aad3a6e1391f0280
x86/emul: Update emulation stubs to be CET-IBT compatible

All indirect branches need to land on an endbr64 instruction.

For stub_selftests(), use endbr64 unconditionally for simplicity.  For ioport
and instruction emulation, add endbr64 conditionally.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 0d101568d29e8b4bfd33f20031fedec2652aa0cf)
xen/arch/x86/extable.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/x86_emulate.c