]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/arm: asm: Replace use of ALTERNATIVE with alternative_if
authorJulien Grall <julien.grall@arm.com>
Tue, 24 Sep 2019 12:33:44 +0000 (13:33 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 1 Nov 2019 14:33:15 +0000 (14:33 +0000)
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>
xen/arch/arm/arm32/entry.S
xen/arch/arm/arm64/entry.S

index d5c2982e4a0f107f0671c941474d681f30456f17..6185f461145ad5be73eb1b624d1ebb169103f9a1 100644 (file)
@@ -59,9 +59,10 @@ prepare_context_from_guest:
          * 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.
index d4fb5fdc1c3d00f89c993d421c85c2d41d509cad..a8ba7ab961f1b4180134fcaa2e5803204fc99569 100644 (file)
          * 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