x86/altcall: Check and optimise altcall targets
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 26 Nov 2021 15:42:48 +0000 (15:42 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 15:33:43 +0000 (15:33 +0000)
commit12e3410e071e284398e49d125e7d9cec076d00e5
tree34d73bf56d694346f4cb27d8186da4ee4fba2068
parenta0d8a94360a6337efcb5048293d527274fea1c96
x86/altcall: Check and optimise altcall targets

When converting indirect to direct calls, there is no need to execute endbr64
instructions.  Detect and optimise this case, leaving a warning in the case
that no endbr64 was found, as it likely indicates a build error.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/alternative.c