读取CPU缓存内容 [英] read CPU cache contents

查看:81
本文介绍了读取CPU缓存内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法读取CPU缓存内容?
体系结构适用于ARM。

Is there any way to read the CPU cache contents? Architecture is for ARM.

我要使一系列地址无效,然后要确保其是否无效。
尽管我可以在使无效和检查无效的情况下读写地址范围,但我想知道是否可以读取缓存内容

I m invalidating a range of addresses and then want to make sure whether it is invalidated or not. Although I can do read and write of the range of addresses with and without invalidating and checking the invalidation, I want to know whether it is possible to read the cache contents

谢谢!

推荐答案

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

ARM9 provides cache manipulation and test registers that allow you to examine the state of the cache. Here's a reasonable starting point:

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


ICache和DCache使用对CP15寄存器7和9的MCR和MRC指令维护,由ARM v4T程序员的模型定义。使用MCR和MRC到CP15寄存器15可以进行其他操作。这些操作与使用寄存器7和9的操作结合使用,可以完全在软件中测试缓存。

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.

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

These are privileged instructions so they may not be accessible on your target platform.

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

I'd start with a simple program that dumps the state of all the cache lines. That should give you enough information to read the data in the cache simply by reading the memory locations the cache tags provide.

这篇关于读取CPU缓存内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆