linux - 在 MIPS TLB 中,除了 ASID 字段之外,两个条目是否可能相同?

标签 linux mips paging tlb mips64

是否可以映射具有相同虚拟地址和物理地址但 ASID 不同的两个条目?

最佳答案

http://pages.cs.wisc.edu/~remzi/OSTEP/vm-tlbs.pdf

A Real TLB Entry

Finally, let’s briefly look at a real TLB. This example is from the MIPS R4000 [H93], a modern system that uses software-managed TLBs; a slightly simplified MIPS TLB entry can be seen in Figure 19.4.

The MIPS R4000 supports a 32-bit address space with 4KB pages. Thus, we would expect a 20-bit VPN and 12-bit offset in our typical virtual address. However, as you can see in the TLB, there are only 19 bits for the VPN; as it turns out, user addresses will only come from half the address space (the rest reserved for the kernel) and hence only 19 bits of VPN are needed. The VPN translates to up to a 24-bit physical frame number (PFN), and hence can support systems with up to 64GB of (physical) main memory (2^24 4KB pages).

There are a few other interesting bits in the MIPS TLB. We see a global bit (G), which is used for pages that are globally-shared among processes. Thus, if the global bit is set, the ASID is ignored. We also see the 8-bit ASID, which the OS can use to distinguish between address spaces (as described above). One question for you: what should the OS do if there are more than 256 (2^8) processes running at a time? Finally, we see 3 Coherence (C) bits, which determine how a page is cached by the hardware (a bit beyond the scope of these notes); a dirty bit which is marked when the page has been written to (we’ll see the use of this later); a valid bit which tells the hardware if there is a valid translation present in the entry. There is also a page mask field (not shown), which supports multiple page sizes; we’ll see later why having larger pages might be useful. Finally, some of the 64 bits are unused (shaded gray in the diagram).

是的,根据一本操作系统教科书(Operating Systems: Three Easy Pieces),对于某些MIPS系统(例如,e MIPS R4000),他们确实有这种方案。例如,2 个进程之间共享的操作系统的全局页面符合您的描述。

关于linux - 在 MIPS TLB 中,除了 ASID 字段之外,两个条目是否可能相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28506358/

相关文章:

Linux 上的 Java System.loadLibrary 调用卡住

linux - 如何在 Linux 上获得整体 CPU 使用率(例如 57%)

linux - 通过插件 OS X 和 Linux 将 ffmpeg 集成到 unity

linux - 脚本有随机 'Operation Not Permitted' 错误

c - Mips32中的Printf和Scanf以及其他问题

gcc - LLVM 与 GCC MIPS 代码生成,任何基准?

animation - 覆盖 scrollViewWillEndDragging 时,UIScrollView 并不总是动画减速

assembly - MIPS 汇编中的跳转指令

java - Android - 如何高效地在 TextView 中加载大量文本?

paging - 了解虚拟地址、虚拟内存和分页