2 ms·
So is copying the thing to itself the only solution in the interim in order to force the thing to copy itself correctly into the thing?
by jancsika 4y ago
So is copying the thing to itself the only solution in the interim in order to force the thing to copy itself correctly into the thing?
- Veserv 4y agoYou manually flush the addresses of the framebuffer via a cache maintenance instruction. The internet tells me the phone has a A53 which should be ARMv8, so probably a loop of DC CIVAC (Data Cache Clean and Invalidate by Virtual Address to Coherency) instructions over the framebuffer. Though the buffer might be large enough to not even fit in the cache, so it might be more efficient to just flush the entire cache.
- aidenn0 4y agoOr just map the FB as WT.
- ajross 4y agoNo, ARM has cache management hardware (and a memory ordering model which you need to understand on the OOO cores). You just have to use it.
- monocasa 4y agoNot only is copying it over itself not the only solution (all you need to do is issue the right sequence of cache flushes over the affected area, so first CPU cache flush instructions, and then maybe an additional set of MMIO based cache flushes depending on how your L2 and/or L3 work), but copying over itself isn't even enough to be correct. They lucked out that it seems to work, but it's kind of by chance. That cache is more than in the right to still not flush some lines even with this big copy.