别名的定义/含义? (CPU缓存体系结构) [英] Definition/meaning of Aliasing? (CPU cache architectures)

查看:200
本文介绍了别名的定义/含义? (CPU缓存体系结构)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对CPU缓存和物理地址之间的别名" 的含义感到困惑. 首先,我在Wikipedia上找到了它的定义:

I'm a little confused by the meaning of "Aliasing" between CPU-cache and Physical address. First I found It's definition on Wikipedia :

但是,VIVT遇到混淆问题,其中几个不同的虚拟地址可能引用相同的物理地址.另一个问题是同音异义词,其中同一个虚拟地址映射到几个不同的物理地址.

However, VIVT suffers from aliasing problems, where several different virtual addresses may refer to the same physical address. Another problem is homonyms, where the same virtual address maps to several different physical addresses.

但是过了一会儿,我在演示文稿上看到了一个不同的定义( ppt ) DAC'05:针对具有以下功能的嵌入式处理器的节能物理标记式缓存 虚拟内存"

but after a while I saw a different definition on a presentation(ppt) of DAC'05: "Energy-Efficient Physically Tagged Caches for Embedded Processors with Virtual Memory"

缓存别名和同义词:

Cache aliasing and synonyms:

别名:来自不同上下文的相同虚拟地址映射到不同的物理地址同义词:不同虚拟地址映射到相同的物理地址(数据共享)

Alias: Same virtual address from different contexts mapped to different physical addresses Synonym: Different virtual address mapped to the same physical address (data sharing)

由于我不是母语人士,所以我不知道哪个是正确的, 尽管我认为Wiki的定义是正确的.

As I'm not a native speaker, I don't know which is correct, though I feel the Wiki's definition is correct.

CPU高速缓存中别名"的概念通常表示同义词",相反是同源".在更一般的级别上,混叠"是令人困惑"或混乱"或类似的东西.所以在我看来,锯齿"恰好意味着(X-> Y)的映射是非双射的",其中

Concept of "aliasing" in CPU cache usually means "synonym", on the contrary is "homonym". In a more generic level, "aliasing" is "confusing" or "chaos" or something like that. So In my opinion, "aliasing" exactly means the mapping of (X->Y) is "not bijective", where

"X" =已缓存的物理地址单元的子集. (每个元素都是一行字节)

"X" = the subset of physical addresses units which has been cached. (each element is a line of byte)

"Y" =有效高速缓存行的集合. (元素也是行")

"Y" = the set of valid cache lines. (elements a also "line")

推荐答案

您需要首先了解虚拟内存,但基本上就是这样:

You'd need to learn about Virtual Memory first, but basically it's this:

  • 程序使用的内存地址不是RAM使用的物理地址.它们是CPU映射为物理地址的虚拟地址.

  • The memory addresses your program uses aren't the physical addresses that the RAM uses; they're virtual addresses mapped to physical addresses by the CPU.

多个虚拟地址可以指向相同的物理地址.

Multiple virtual addressses can point to the same physical address.

这意味着您可以在不知道的情况下在缓存的不同部分中拥有同一数据的两个副本...并且它们不会正确更新,因此您将得到错误的结果.

That means that you can have two copies of the same data in separate parts of the cache without knowing it... and they wouldn't be updated correctly, so you'd get wrong results.

参考的摘要:

当对内存的物理页面的多个映射具有冲突的缓存状态(例如,已缓存和未缓存)时,会发生

缓存别名.由于这些冲突状态,当刷新处理器的缓存时,该物理页面中的数据可能会损坏.如果驱动程序正在将该页面用于DMA,则可能导致硬件稳定性问题和系统锁定.

Cache aliasing occurs when multiple mappings to a physical page of memory have conflicting caching states, such as cached and uncached. Due to these conflicting states, data in that physical page may become corrupted when the processor's cache is flushed. If that page is being used for DMA by a driver, this can lead to hardware stability problems and system lockups.


对于仍不确信的人:

在ARMv4和ARMv5处理器上,缓存被组织为虚拟索引的虚拟标记(VIVT)缓存,其中索引和标记均基于虚拟地址.此方法的主要优点是,由于虚拟后备缓存行的匹配不涉及转换后备缓冲器(TLB),因此缓存查找速度更快.但是,由于缓存别名,此缓存方法确实需要更频繁的缓存刷新,其中相同的物理地址可以映射到多个虚拟地址 .

这篇关于别名的定义/含义? (CPU缓存体系结构)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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