Skip to content

Commit d45d7ff

Browse files
brooniectmarinas
authored andcommitted
arm64/sme: Disable streaming mode and ZA when flushing CPU state
Both streaming mode and ZA may increase power consumption when they are enabled and streaming mode makes many FPSIMD and SVE instructions undefined which will cause problems for any kernel mode floating point so disable both when we flush the CPU state. This covers both kernel_neon_begin() and idle and after flushing the state a reload is always required anyway. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 776b4a1 commit d45d7ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,15 @@ static void fpsimd_flush_cpu_state(void)
17591759
{
17601760
WARN_ON(!system_supports_fpsimd());
17611761
__this_cpu_write(fpsimd_last_state.st, NULL);
1762+
1763+
/*
1764+
* Leaving streaming mode enabled will cause issues for any kernel
1765+
* NEON and leaving streaming mode or ZA enabled may increase power
1766+
* consumption.
1767+
*/
1768+
if (system_supports_sme())
1769+
sme_smstop();
1770+
17621771
set_thread_flag(TIF_FOREIGN_FPSTATE);
17631772
}
17641773

0 commit comments

Comments
 (0)