Merge tag 'xfs-5.14-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-2.6-microblaze.git] / arch / arm64 / kernel / entry-fpsimd.S
index 3ecec60..0a7a647 100644 (file)
@@ -63,16 +63,24 @@ SYM_FUNC_END(sve_set_vq)
  * and the rest zeroed. All the other SVE registers will be zeroed.
  */
 SYM_FUNC_START(sve_load_from_fpsimd_state)
-               sve_load_vq     x1, x2, x3
-               fpsimd_restore  x0, 8
- _for n, 0, 15, _sve_pfalse    \n
-               _sve_wrffr      0
-               ret
+       sve_load_vq     x1, x2, x3
+       fpsimd_restore  x0, 8
+       sve_flush_p_ffr
+       ret
 SYM_FUNC_END(sve_load_from_fpsimd_state)
 
-/* Zero all SVE registers but the first 128-bits of each vector */
+/*
+ * Zero all SVE registers but the first 128-bits of each vector
+ *
+ * VQ must already be configured by caller, any further updates of VQ
+ * will need to ensure that the register state remains valid.
+ *
+ * x0 = VQ - 1
+ */
 SYM_FUNC_START(sve_flush_live)
-       sve_flush
+       cbz             x0, 1f  // A VQ-1 of 0 is 128 bits so no extra Z state
+       sve_flush_z
+1:     sve_flush_p_ffr
        ret
 SYM_FUNC_END(sve_flush_live)