From 7d7d28f26881e8f5856fb329015f46e4e53a18ef Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Fri, 21 Feb 2020 23:02:19 +0100 Subject: [PATCH] [rt] Refresh "arm64: fpsimd: use preemp_disable in addition to local_bh_disable()" for context changes in 4.19.105. --- debian/changelog | 2 + ...-preemp_disable-in-addition-to-local.patch | 42 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/debian/changelog b/debian/changelog index f5ff0ecdb..e85981248 100644 --- a/debian/changelog +++ b/debian/changelog @@ -903,6 +903,8 @@ linux (4.19.105-1) UNRELEASED; urgency=medium * [rt] Update to 4.19.103-rt42 * [rt] Refresh "powerpc/pseries/iommu: Use a locallock instead local_irq_save()" for context changes in 4.19.104. + * [rt] Refresh "arm64: fpsimd: use preemp_disable in addition to + local_bh_disable()" for context changes in 4.19.105. [ Ben Hutchings ] * [x86] Drop "Add a SysRq option to lift kernel lockdown" (Closes: #947021) diff --git a/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index f655f1557..ce9859b7e 100644 --- a/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/0213-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -14,15 +14,16 @@ saving/restoring those registers. Add preempt_disable()/enable() to enfore the required semantic on -RT. Signed-off-by: Sebastian Andrzej Siewior +[Salvatore Bonaccorso: Update for context changes in 4.19.105 due to +e074c64a27b5 ("arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag +cleanly")] --- arch/arm64/kernel/fpsimd.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) -diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c -index 58c53bc96928..71252cd8b594 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c -@@ -159,6 +159,16 @@ static void sve_free(struct task_struct *task) +@@ -159,6 +159,16 @@ __sve_free(task); } @@ -39,7 +40,7 @@ index 58c53bc96928..71252cd8b594 100644 /* * TIF_SVE controls whether a task can use SVE without trapping while * in userspace, and also the way a task's FPSIMD/SVE state is stored -@@ -547,6 +557,7 @@ int sve_set_vector_length(struct task_struct *task, +@@ -549,6 +559,7 @@ * non-SVE thread. */ if (task == current) { @@ -47,7 +48,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); fpsimd_save(); -@@ -557,8 +568,10 @@ int sve_set_vector_length(struct task_struct *task, +@@ -559,8 +570,10 @@ if (test_and_clear_tsk_thread_flag(task, TIF_SVE)) sve_to_fpsimd(task); @@ -59,7 +60,7 @@ index 58c53bc96928..71252cd8b594 100644 /* * Force reallocation of task SVE state to the correct size -@@ -813,6 +826,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) +@@ -815,6 +828,7 @@ sve_alloc(current); @@ -67,7 +68,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); fpsimd_save(); -@@ -826,6 +840,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) +@@ -828,6 +842,7 @@ WARN_ON(1); /* SVE access shouldn't have trapped */ local_bh_enable(); @@ -75,7 +76,7 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -892,10 +907,12 @@ void fpsimd_thread_switch(struct task_struct *next) +@@ -894,10 +909,12 @@ void fpsimd_flush_thread(void) { int vl, supported_vl; @@ -88,7 +89,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); memset(¤t->thread.uw.fpsimd_state, 0, -@@ -904,7 +921,7 @@ void fpsimd_flush_thread(void) +@@ -906,7 +923,7 @@ if (system_supports_sve()) { clear_thread_flag(TIF_SVE); @@ -97,7 +98,7 @@ index 58c53bc96928..71252cd8b594 100644 /* * Reset the task vector length as required. -@@ -940,6 +957,8 @@ void fpsimd_flush_thread(void) +@@ -942,6 +959,8 @@ set_thread_flag(TIF_FOREIGN_FPSTATE); local_bh_enable(); @@ -106,7 +107,7 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -951,9 +970,11 @@ void fpsimd_preserve_current_state(void) +@@ -953,9 +972,11 @@ if (!system_supports_fpsimd()) return; @@ -118,15 +119,15 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -1011,6 +1032,7 @@ void fpsimd_restore_current_state(void) - if (!system_supports_fpsimd()) +@@ -1026,6 +1047,7 @@ return; + } + preempt_disable(); local_bh_disable(); if (test_and_clear_thread_flag(TIF_FOREIGN_FPSTATE)) { -@@ -1019,6 +1041,7 @@ void fpsimd_restore_current_state(void) +@@ -1034,6 +1056,7 @@ } local_bh_enable(); @@ -134,15 +135,15 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -1031,6 +1054,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) - if (!system_supports_fpsimd()) +@@ -1046,6 +1069,7 @@ + if (WARN_ON(!system_supports_fpsimd())) return; + preempt_disable(); local_bh_disable(); current->thread.uw.fpsimd_state = *state; -@@ -1043,6 +1067,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) +@@ -1058,6 +1082,7 @@ clear_thread_flag(TIF_FOREIGN_FPSTATE); local_bh_enable(); @@ -150,7 +151,7 @@ index 58c53bc96928..71252cd8b594 100644 } /* -@@ -1088,6 +1113,7 @@ void kernel_neon_begin(void) +@@ -1104,6 +1129,7 @@ BUG_ON(!may_use_simd()); @@ -158,7 +159,7 @@ index 58c53bc96928..71252cd8b594 100644 local_bh_disable(); __this_cpu_write(kernel_neon_busy, true); -@@ -1101,6 +1127,7 @@ void kernel_neon_begin(void) +@@ -1117,6 +1143,7 @@ preempt_disable(); local_bh_enable(); @@ -166,6 +167,3 @@ index 58c53bc96928..71252cd8b594 100644 } EXPORT_SYMBOL(kernel_neon_begin); --- -2.25.0 -