Linus Torvalds writes: (Summary) wrote:
Yes, doing something like "memcpy_fromio_avx()" is much more palatable, in that it works like the crypto functions do - if you do big chunks, the "kernel_fpu_begin/end()" isn't nearly the issue it can be otherwise.
be otherwise.
Note that we definitely have seen hardware that *depends* on the regular memcpy_fromio()" not doing big reads. So it really needs to be an explicitly named function that basically a driver can use to say "my hardware really likes big aligned accesses" and explicitly ask for some AVX version if possible.
[...]
memcpy_fromio or memcpy_toio operations?Yes, doing something like "memcpy_fromio_avx()" is much more palatable, in that it works like the crypto functions do - if you do big chunks, the "kernel_fpu_begin/end()" isn't nearly the issue it can be otherwise.
be otherwise.
Note that we definitely have seen hardware that *depends* on the regular memcpy_fromio()" not doing big reads. So it really needs to be an explicitly named function that basically a driver can use to say "my hardware really likes big aligned accesses" and explicitly ask for some AVX version if possible.