]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: arm64/sha256 - fix build when CONFIG_PREEMPT_VOLUNTARY=y
authorEric Biggers <ebiggers@google.com>
Wed, 7 May 2025 17:09:01 +0000 (10:09 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 8 May 2025 01:36:45 +0000 (09:36 +0800)
Fix the build of sha256-ce.S when CONFIG_PREEMPT_VOLUNTARY=y by passing
the correct label to the cond_yield macro.  Also adjust the code to
execute only one branch instruction when CONFIG_PREEMPT_VOLUNTARY=n.

Fixes: 6e36be511d28 ("crypto: arm64/sha256 - implement library instead of shash")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505071811.yYpLUbav-lkp@intel.com/
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/lib/crypto/sha256-ce.S

index a8461d6dad634726ac5ef6fcaa867c251d69b3c5..f3e21c6d87d2e09fe3e3ffb5fc999b9d55029ed6 100644 (file)
@@ -123,10 +123,11 @@ CPU_LE(   rev32           v19.16b, v19.16b        )
        add             dgav.4s, dgav.4s, dg0v.4s
        add             dgbv.4s, dgbv.4s, dg1v.4s
 
+       /* return early if voluntary preemption is needed */
+       cond_yield      1f, x5, x6
+
        /* handled all input blocks? */
-       cbz             x2, 1f
-       cond_yield      3f, x5, x6
-       b               0b
+       cbnz            x2, 0b
 
        /* store new state */
 1:     st1             {dgav.4s, dgbv.4s}, [x0]