caching - 读取 CPU 缓存内容

标签 caching hardware cpu cpu-cache

有没有办法读取CPU缓存内容?
架构适用于 ARM。

我正在使一系列地址无效,然后想确定它是否无效。
虽然我可以在有和没有无效和检查无效的情况下读取和写入地址范围,但我想知道是否可以读取缓存内容

谢谢!!

最佳答案

ARM9 提供高速缓存操作和测试寄存器,允许您检查高速缓存的状态。这是一个合理的起点:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0151c/Chdcfejb.html

The ICache and DCache are maintained using MCR and MRC instructions to CP15 registers 7 and 9, defined by the ARM v4T programmer’s model. Additional operations are available using MCR and MRC to CP15 register 15. These operations are combined with those using registers 7 and 9 to enable testing of the caches entirely in software.



这些是特权指令,因此可能无法在您的目标平台上访问。

我将从一个简单的程序开始,该程序转储所有缓存行的状态。这应该为您提供足够的信息,只需读取缓存标签提供的内存位置即可读取缓存中的数据。

关于caching - 读取 CPU 缓存内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1006981/

相关文章:

drupal - 在 Drupal 模板中运行未缓存的 PHP?

caching - 使用ehcache优于静态HashMap的优势

concurrency - 关于 DMA 和 CPU 并发

performance - 相当于硬盘扫描的CPU消耗

ios - NSURLRequestReturnCacheDataElseLoad 不工作?

c - 带按钮的内部上拉电阻如何设置?

assembly - 编写自己的SVC调用ARM汇编

optimization - 什么是桌面 CPU 上的 8 位寄存器?

cpu - "CPU performs an endless jump"是什么意思?

java.sql.SQLSyntaxErrorException : Table/View 'SEQUENCE' does not exist