Using alternative_if makes the code a bit more streamlined.
Take the opportunity to use the new auto-nop infrastructure to avoid
counting the number of nop in the else part for arch/arm/arm64/entry.S
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
* If the SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT has been set in the cpu
* feature, the checking of pending SErrors will be skipped.
*/
- ALTERNATIVE("nop",
- "b skip_check",
- SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT)
+ alternative_if SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT
+ b skip_check
+ alternative_else_nop_endif
+
/*
* Start to check pending virtual abort in the gap of Guest -> HYP
* world switch.
* is not set. If a vSError took place, the initial exception will be
* skipped. Exit ASAP
*/
- ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f",
- "nop; nop",
- SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT)
+ alternative_if_not SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT
+ bl check_pending_vserror
+ cbnz x0, 1f
+ alternative_else_nop_endif
+
bl enter_hypervisor_from_guest_preirq
msr daifclr, \iflags
bl enter_hypervisor_from_guest