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>
Wed, 23 Feb 2022 15:33:43 +0000 (15:33 +0000)
commit0d101568d29e8b4bfd33f20031fedec2652aa0cf
treeb690d11a231de8f1624ebbbb8ce54048c3c73a75
parent4046ba97446e3974a4411db227263a9f11e0aeb4
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>
xen/arch/x86/extable.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/x86_emulate.c