免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3258 | 回复: 3
打印 上一主题 下一主题

linux arm h/w 页表是什么? [复制链接]

论坛徽章:
1
拜羊年徽章
日期:2015-03-03 16:15:43
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-17 10:30 |只看该作者 |倒序浏览
本帖最后由 linuxfellow 于 2012-02-17 10:36 编辑

Arm pte table前2K是linux 页表, 高2k是h/w页表, 这两个页表究竟是啥? 如何理解?
/*
* Allocate one PTE table.
*
* +--------------+ 0
* | Linux pt 0 |
* +--------------+
* | Linux pt 1 |
* +--------------+ 2048
* | h/w pt 0 |
* +--------------+
* | h/w pt 1 |
* +--------------+
*/
From d30e45eeabefadc6039d7f876a59e5f5f6cb11c6 Mon Sep 17 00:00:00 2001
From: Russell King <rmk+kernel@arm.linux.org.uk>
Date: Tue, 16 Nov 2010 00:16:01 +0000
Subject: [PATCH] ARM: pgtable: switch order of Linux vs hardware page tables
This switches the ordering of the Linux vs hardware page tables in
each page, thereby eliminating some of the arithmetic in the page
table walks. As we now place the Linux page table at the beginning
of the page, we can deal with the offset in the pgt by simply masking
it away, along with the other control bits.
This also makes the arithmetic all be positive, rather than a mixture.

论坛徽章:
4
戌狗
日期:2013-08-15 18:22:43技术图书徽章
日期:2013-08-21 13:48:45巨蟹座
日期:2013-09-26 17:06:39处女座
日期:2013-12-25 11:26:10
2 [报告]
发表于 2012-02-17 13:25 |只看该作者
ARM的每个PTE都有两份的

因为ARM的pte信息不足,缺少access及dirty位,所以搞了个假的,在真正设置pte时,会根据假的推算真的。

论坛徽章:
1
拜羊年徽章
日期:2015-03-03 16:15:43
3 [报告]
发表于 2012-02-17 13:38 |只看该作者
回复 2# 塑料袋
不知哪里有这样的信息:如何从假的推算真的?

   

论坛徽章:
4
戌狗
日期:2013-08-15 18:22:43技术图书徽章
日期:2013-08-21 13:48:45巨蟹座
日期:2013-09-26 17:06:39处女座
日期:2013-12-25 11:26:10
4 [报告]
发表于 2012-02-17 13:41 |只看该作者
C文件的注释里就有

真假相差2048字节,换算的过程大概在entry.S里,一个好像叫set_pte_ext的函数里。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP