简体   繁体   English

多重映射地址上的 AArch64 内存同步操作

[英]AArch64 memory synchronization operations on multiply-mapped addresses

Suppose I have two pages that map to the same physical memory.假设我有两个页面映射到相同的物理内存。 Would an acquire operation (or fence) on a virtual address in one page properly synchronize with a release operation (or fence) on a virtual address in the other?一个页面中虚拟地址上的获取操作(或围栏)是否会与另一页面中虚拟地址上的释放操作(或围栏)正确同步? Secondly, would cache maintenance operations ( dc , ic ), too, work with such multiply-mapped memory?其次,缓存维护操作( dcic )也可以使用这种多重映射内存吗?

In other words...换句话说...

  • ...would a stlr (or dmb ishst if fence) on one core to one page properly synchronize with ldar (or dmb ishld if fence) on another core to the other page? ...一个核心上的stlr (或dmb ishst ,如果栅栏)到一个页面是否会与另一个核心上的ldar (或dmb ishld ,如果栅栏)正确同步到另一页?
  • ...would a dc whatever on one virtual address have the same effect as a dc whatever on the other? ...一个虚拟地址上的dc whatever是否与另一个虚拟地址上的dc whatever具有相同的效果?

As to memory ordering, yes, this is fine.至于内存排序,是的,这很好。 The ARMv8 memory model is defined in terms of reads and writes of a Location , which is defined as "a byte that is associated with an address in the physical address space". ARMv8 内存模型是根据Location的读取和写入来定义的,它被定义为“与物理地址空间中的地址相关联的字节”。 See B2.3.1 in the Architecture Reference Manual, version Ha (Older versions left out the "physical" part so it seems someone noticed that this was ambiguous.)请参阅架构参考手册中的 B2.3.1,版本 Ha(旧版本省略了“物理”部分,因此似乎有人注意到这是模棱两可的。)

Likewise, an exclusive load ldxr says in the manual that it marks the physical address as an exclusive access.同样,独占加载ldxr在手册中说它将物理地址标记为独占访问。

Note that if this weren't the case, then on typical OSes, shared memory between processes (eg shmget , mmap(MAP_SHARED) , etc) would be unusable, as the shared mappings are normally at different virtual addresses in the different processes.请注意,如果不是这种情况,那么在典型的操作系统上,进程之间的共享内存(例如shmgetmmap(MAP_SHARED)等)将不可用,因为共享映射通常位于不同进程中的不同虚拟地址。

I can't answer the part about cache right now.我现在无法回答有关缓存的部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM