通常情况下,一个 descriptor 可能是以下的几种 entry:

  • 非法或者异常的 entry。
  • Table entry, 指向 next-level translation table。
  • Block entry, 定义内存访问的 memory properties。
  • Reserved format。

Descriptor 的 bit[1] 用于指示 descriptor 的类型,bit[0] 用于指示 descriptor 是否有效。

D4.3.1 VMSAv8-64 translation table level 0 level 1 and level 2 descriptor formats

在 VMSAv8-64 的 level 0、level 1 和 level 2 的 translation table descriptor 的格式主要存在以下的差异:

  • 是否存在 block entry。
  • block entry 所描述的内存块的大小。

在不同的 translation granule 下,不同 level 的差异如下:

4KB granule
Level 0 descriptor 不支持 block translation。
Block entry:

  • 在 level 1 table 中,映射 1GB 的 input address range
  • 在 level 2 table 中,映射 2MB 的 input address range

16KB granule
Level 0 和 level 1 descriptors 都不支持 block translation
在 Level 2 table 中,block entry 映射 32MB 的 input address range

64KB granule
不支持 Level 0 lookup 操作。
Level 1 descriptor 不支持 block translation
在 Level 2 table 中,block entry 映射 512MB 的 input address range

Figure D4-16 描述了 ARMv8 level 0, level 1, and level 2 descriptor 格式:

Descriptor encodings, ARMv8 level 0, level 1, and level 2 formats

Descriptor 的 bit[0] 指明该 descriptor 是否有效,该
bit 为 1 时,为有效的 descriptor。如果一次 lookup 操作返回一个无效的 descriptor,那么就意味着该 input
address 没有进行映射,当访问该 input address 时,会产生 Translation fault。Descriptor 的 bit[1] 指明该 descriptor 的类型,如下表所示:

     
0 Block Descriptor 包含了一个内存块的基地址和属性。
1 Table Descriptor 包含了下一级 translation table 的基地址,在 stage 1 translation 中,还包含对应的 translation 的属性信息。

有效的 descriptor 中的其他比特位的含义如下:

Block descriptor
Gives the base address and attributes of a block of memory, as follows:
包含一个 memory block 的基地址和属性信息,如下:

4KB translation granule

  • 在 level 1 Block descriptor 中,bits[47:30] 为 output address 的 bits[47:30]。此 output address 指向一个 1GB 的 memory block。
  • 在 level 2 Block descriptor 中,bits[47:21] 为 output address 的 bits[47:21]。此 output address 指向一个 2MB 的 memory block。

16KB translation granule

  • 在 level 2 Block descriptor 中,bits[47:25] 为 output address 的 bits[47:25]。此 output address 指向一个 32MB 的 memory block。

64KB translation granule

  • 在 level 2 Block descriptor 中,bits[47:29] 为 output address 的 bits[47:29]。此 output address 指向一个 512MB 的 memory block。

Bits[63:52, 11:2] 包含该 memory block 的属性信息。

Level 2 block descriptor 和 level 3 page descriptor 中的 Bits[63:52, 11:2] 含义是相同的。

Table descriptor
包含下一级 translation table 的基地址,如下:

4KB translation granule

  • bits[47:12] 为 output address 的 bits[47:12],同时:基地址的 Bits[11:0] 为 0.

    • 在 level 0 Table descriptor 中, output address 为 level 1 table 的基地址。
    • 在 level 1 Table descriptor 中, output address 为 level 2 table 的基地址
    • 在 level 2 Table descriptor 中, output address 为 level 3 table 的基地址

16KB translation granule

  • bits[47:14] 为 output address 的 bits[47:14],同时:基地址的 Bits[13:0] 为 0.

    • 在 level 0 Table descriptor 中, output address 为 level 1 table 的基地址。
    • 在 level 1 Table descriptor 中, output address 为 level 2 table 的基地址
    • 在 level 2 Table descriptor 中, output address 为 level 3 table 的基地址

64KB translation granule

  • bits[47:16] 为 output address 的 bits[47:16],同时:基地址的 Bits[15:0] 为 0。

    • 在 level 1 Table descriptor 中, output address 为 level 2 table 的基地址
    • 在 level 2 Table descriptor 中, output address 为 level 3 table 的基地址

在 stage 1 translation 中, bits[63:59] 包含 next-level lookup 的属性信息。

如果 translation table 属于 Non-secure EL1&0 stage 1 translation,那么 descriptor 中的 output address 为目标 block 或者 table 的 IPA,如果不属于,那么 output address 为目标 block 或者 table 的 PA。

D4.3.2 ARMv8 translation table level 3 descriptor formats

使用 4KB granule 时,level 3 table 中的每一个 entry 都映射了 4KB 的 input address range。
使用 16KB granule 时,level 3 table 中的每一个 entry 都映射了 16KB 的 input address range。
使用 64KB granule 时,level 3 table 中的每一个 entry 都映射了 64KB 的 input address range。
Figure D4-17 描述了 ARMv8 level 3 descriptor 的格式

Descriptor 的 bit[0] 指明该 descriptor 是否有效,该 bit 为 1 时,为有效的 descriptor。如果一次 lookup 操作返回一个无效的descriptor,那么就意味着该 input address 没有进行映射,当访问该 input address 时,会产生 Translation fault。Descriptor 的 bit[1] 指明该 descriptor 的类型,如下所示:

在此 level 中,只存在 Page descriptor。Page descriptor 的其他位的含义如下:在此 level 中,只存在 Page descriptor。Page descriptor 的其他位的含义如下:
Page descriptor
该 descriptor 包含了一个 page 的地址,如下所示:
4KB translation granule
Bits[47:12] 为 page 的地址的 bits[47:12]。
16KB translation granule
Bits[47:14] 为 page 的地址的 bits[47:14]。
64KB translation granule
Bits[47:16] 为 page 的地址的 bits[47:16]。
Bits[63:52, 11:2] 包含 page 的属性信息。

NOTE:
Page descriptor 的 bits[63:52, 11:2] 与 level 0、level 1 和 level 2 中的 block descriptor 中的 bits[63:52, 11:2] 的用途是相同的。
如果 translation table 属于 Non-secure EL1&0 stage 1 translation,那么 descriptor 中的 output address 为 page 的 IPA,如果不属于,那么 output address 为 page 的 PA

VMSAv8-64 translation table format descriptors的更多相关文章

  1. hive 使用笔记(table format;lateral view)

    1. create table 创建一张目标表,指定分隔符和存储格式: create table tmp_2 (resource_id bigint ,v int) ROW FORMAT DELIMI ...

  2. hive 使用笔记(table format;lateral view横表转纵表)

    1. create table 创建一张目标表,指定分隔符和存储格式: create table tmp_2 (resource_id bigint ,v int) ROW FORMAT DELIMI ...

  3. armv8 memory translation table descriptor

    上一节大致给出了descriptor的结构,这篇细致分析各个field: 1) Table Descriptor:stage2中不包含任何的attribute的field,每个level中的descr ...

  4. armv8 memory translation

    AArch32,arm的32bit架构: AArch64,arm的64bit架构: ARMv8.2-LPA,是armv8.2中的新feature,扩大了IPA和PA的支持范围,从48bit扩展到52b ...

  5. Armv8-A Memory management

    本文介绍Armv8-A的内存管理.内存管理指的是在系统中,内存访问是如何实现的. 使用内存管理机制,可以让每个应用之间的内存地址分离,即sandbox application,也可以让多个在物理内存上 ...

  6. 移植Linux-3.4.2内核到S3C2440

    一.BootLoader引导内核过程     1.Bootloader的工作     1.1.将内核读入内存     2.2.保存内核启动参数到指定位置,内核启动时去这个位置解析参数     3.3. ...

  7. arm-linux内核start_kernel之前启动分析(1)-接过bootloader的衣钵

    前段时间移植uboot细致研究过uboot启动过程,近期耐不住寂寞.想对kernel下手. Uboot启动过程分析博文连接例如以下: http://blog.csdn.net/skyflying201 ...

  8. Tiny4412 Linux 内核启动流程

    Linux内核的启动分为压缩内核和非压缩内核两种,这里我们以压缩内核为例.压缩内核运行时,将运行一段解压缩程序,得到真正的内核镜像,然后跳转到内核镜像运行.此时,Linux进入非压缩内核入口,在非压缩 ...

  9. 附录:ARM 手册 词汇表

    来自:<DDI0406C_C_arm_architecture_reference_manual.pdf>p2723 能够查询到:“RAZ RAO WI 等的意思” RAZ:Read-As ...

随机推荐

  1. iOS开发资料

    https://github.com/XCGit/awesome-objc-frameworks https://github.com/KevinHM/ios-good-practices-the-l ...

  2. Sql Server 表的复制

    声名:A,B ,都是表 --B表存在(两表结构一样)insert into B select * from A 若两表只是有部分(字段)相同,则 insert into B(col1,col2,col ...

  3. JQUERY操作JSON数组添加新的属性和值

    语法: var data = {}; data["Order"] =order; data["Sort"] = sort; 但是需要注意的是,如果data后面还 ...

  4. iOS进阶面试题

    1. 风格纠错题 修改完的代码: 修改方法有很多种,现给出一种做示例: // .h文件 // http://weibo.com/luohanchenyilong/ // https://github. ...

  5. 【C++学习笔记】 链式前向星

    链式前向星是一种常见的储存图的方式(是前向星存图法的优化版本),支持增边和查询,但不支持删边(如果想要删除指定的边建议用邻接矩阵). 储存方式 首先定义数组 head[ i ] 来储存从节点 i 出发 ...

  6. Springboot 入门创建hello world1!

    1.首先使用工具是Eclipse,安装插件,点击“Help”-“Eclipse Marketplace...”, 一步步直接Ok,等待安装完成 2.创建Springboot项目 到此 就创建成功了 3 ...

  7. FreeRTOS的学习路线

    背景 由于之前接触过一些嵌入式RTOS,如Keil-RTX,uCOS-II,也曾经关注过FreeRTOS,但一直没有机会采用FreeRTOS开发.目前FreeRTOS做为主流RTOS,风声正盛.作为嵌 ...

  8. 关于poi的坑

    背景故事 今天遇上一个坑,关于poi公式计算结果出错的问题,自己打断点debug了半天,虽然没彻底搞清楚为啥不行,但所幸找到了解决办法. 干货 下面不废话,直接贴干货,原先的公式处理代码如下: fin ...

  9. vim粘贴取消自动缩进

    Vim 复制粘贴探秘 Vim 作为最好用的文本编辑器之一,使用vim来编文档,写代码实在是很惬意的事情.每当学会了vim的一个新功能,就会很大地提高工作效率.有人使用vim几 十年,还没有完全掌握vi ...

  10. 分享 php array_column 函数 无法在低版本支持的 修改

    function i_array_column($input, $columnKey, $indexKey=null){ if(!function_exists('array_column')){ $ ...