On Tue, Oct 17, 2023 at 02:42:01PM +0100, Mark Rutland wrote:
So unless sve_alloc() failed, at the instant the IRQ was taken:
- `task->thread.sve_state` should be non-NULL
- `task->thread_info.flags & TIF_SVE` should be 0
... so if `task->thread.sve_state` becomes NULL, I wonder if we end up accidentally blatting that as part of the context switch? I can't immedaitely see how/
We're possibly missing a fpsimd_bind_task_to_cpu() somewhere since all the hilarity with KVM means that we don't use the task_struct to save state, though the task that's taking the SVE trap shouldn't be impacted there if it didn't set TIF_SVE yet. There *is* a window where we have TIF_SVE set but didn't yet do the rebind but that should be in a preempt disabled section.