Retrieving the process descriptor during syscall

In Linux, there is a per-process kernel stack that stores at the bottom of it (or top if the stack grows upwards) a small struct named thread_info, which in turn points to the task_struct of the related process. This way it is easy to retrieve the pointer to the process’s descriptor when handling a syscall in kernel-mode.

But how does the kernel even switch to this per-process stack? In which step during the context switch, does the kernel check/store data about the underlying process?

Can someone please provide a good explaination of the steps involved during such user-space -> syscall -> kernel-space context switch?

A lot of sources online try to explain the workings of context switching, but most of them mainly say general concepts and not detailed explainations of the procedure.