ARM在进入向量table时是使用物理地址还是虚拟地址?

Does ARM use physcial address or a virtual address when entering the vector table?

当启用分页并发生异常时,是否会发生转换 table 遍历以访问地址 0x00000000 处的异常向量 table?

  1. 如果仍然启用分页,那么用户模式进程和向量如何 table 共享地址 0x00000000 - TTBR(翻译 table 基址寄存器)不会在异常进入时更新,并且TTBR 不是银行注册(我们在这里不是在谈论安全和非安全世界之间的切换)。
  2. 如果否,那么我们必须使用物理寻址输入异常,在这种情况下现在禁用分页?

When paging is enabled and an exception occurs does a translation table walk occur to access the exception vector table at address 0x00000000?

几乎所有的ARMCPUs都有配置异常table地址的方法。所以在大多数系统中,异常向量table不在地址0x00000000。但是,在发生异常时启用 MMU。 TLB(一个MMU/pagetable缓存)将包含矢量table物理地址。

在某些 SOC 中,引导向量 table 可能位于 0x0,但这通常由引导代码重新配置。

  1. If paging is still enabled then how do user mode processes and the vector table both share address 0x00000000 - the TTBR (translation table base register) does not get updated on exception entry and the TTBR is not a banked register (we are not talking here about switching between secure and non-secure worlds).

如果您想要地址 0x00000000 处的向量 table,除非您禁止它,否则用户 space 将看到它。禁止访问 0x0 可能是防止使用 NULL 指针的理想设计。许多操作系统没有从 0x0 开始的用户 space 运行,而是像 0x8000.

这样的地址

根据参数设置用户 space 故障非常有用,因为您可以在开发进程时捕获 NULL 指针访问。我建议始终保持开启状态,但有些人允许对生产代码进行 NULL 访问。

  1. If no then we must enter exceptions using physical addressing in which case is paging now disabled?

没有启用分页,因为缓存可能也已打开。如果某些访问是物理访问而其他访问是虚拟访问,CPU 的 load/store 单元会更复杂;特别是当缓存由传统 ARM 中的虚拟地址填充时 CPUs.