Message ID | 20230320131845.3138015-1-ardb@kernel.org (mailing list archive) |
---|---|
Headers | show |
Series | ARM: vfp: Switch to C API to en/disable softirqs | expand |
On Mon, Mar 20, 2023 at 02:18:33PM +0100, Ard Biesheuvel wrote: > As it turns out, enabling or disabling softirqs from asm code is more > tricky than it looks. Simply bumping the associated bit in preempt_count > does the trick for uninstrumented kernels, but with lockdep or preempt > debug enabled, we really need to call the C versions, as replicating > their behavior in asm fully is intractible. > > So let's rework the existing code a little bit so we can interpose a > little C helper 'vfp_entry()' that disables softirqs before calling the > existing vfpstate handling code in asm. Re-enabling softirqs from asm > code is more straight-forward, as we can simply perform a tail call via > a C routine that is guaranteed to be callable as a function. > > However, since calling these APIs from asm code is still not ideal, > let's reimplement the whole thing in C (patch #4) > FWIW, all my qemu tests passed for this series. Guenter
On Thu, 23 Mar 2023 at 03:44, Guenter Roeck <linux@roeck-us.net> wrote: > > On Mon, Mar 20, 2023 at 02:18:33PM +0100, Ard Biesheuvel wrote: > > As it turns out, enabling or disabling softirqs from asm code is more > > tricky than it looks. Simply bumping the associated bit in preempt_count > > does the trick for uninstrumented kernels, but with lockdep or preempt > > debug enabled, we really need to call the C versions, as replicating > > their behavior in asm fully is intractible. > > > > So let's rework the existing code a little bit so we can interpose a > > little C helper 'vfp_entry()' that disables softirqs before calling the > > existing vfpstate handling code in asm. Re-enabling softirqs from asm > > code is more straight-forward, as we can simply perform a tail call via > > a C routine that is guaranteed to be callable as a function. > > > > However, since calling these APIs from asm code is still not ideal, > > let's reimplement the whole thing in C (patch #4) > > > > FWIW, all my qemu tests passed for this series. > Thanks for testing!