You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a DMA-like accelerator, and I am in the process of writing a kernel driver to control it from user space.
I need to clear the processor's cache so my user process does not read outdated data. When I previously tested my accelerator with a bare-metal program, I used the following macro:
But it uses machine-level CSRs, which of course causes an illegal instruction exception when ran inside a kernel module.
How can I do this? According to this, support for cache clearing is limited.
If the software route does not work out, I suppose there is a way to flush the data cache in hardware. I could maybe route a signal from my accelerator to the cache subsystem that forces a cache flush. Any ideas?
The text was updated successfully, but these errors were encountered:
Juan-Gg
changed the title
Clearing data cache from a kernel module
Clearing/flushing data cache from a kernel module
Jun 28, 2024
I have implemented a DMA-like accelerator, and I am in the process of writing a kernel driver to control it from user space.
I need to clear the processor's cache so my user process does not read outdated data. When I previously tested my accelerator with a bare-metal program, I used the following macro:
But it uses machine-level CSRs, which of course causes an illegal instruction exception when ran inside a kernel module.
How can I do this? According to this, support for cache clearing is limited.
If the software route does not work out, I suppose there is a way to flush the data cache in hardware. I could maybe route a signal from my accelerator to the cache subsystem that forces a cache flush. Any ideas?
The text was updated successfully, but these errors were encountered: