同时在Aarch64上存在不同大小的页面 [英] Simultaneous existence of different-sized pages on Aarch64

查看:113
本文介绍了同时在Aarch64上存在不同大小的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据体系结构概述文档,Aarch64支持4k和64k页面.一些CPU还支持16k页面.查看地址转换方案的详细信息,我得出的结论是,此类CPU 不支持同时存在不同大小的页面(与x86_64不同,它允许这样做).我说的对吗?

According to the architecture overview document Aarch64 supports 4k and 64k pages. Some CPUs also support 16k pages. Looking into address translation scheme details I come to the conclusion that such CPUs don't support the simultaneous existence of different-sized pages (unlike x86_64 which allows that). Am I right?

推荐答案

在这里,您将两种尽管相关的不同东西混为一谈-页面大小与粒度.

You're conflating two different, albeit related, things here - page size vs. granularity.

在AArch64中,您有3种可能的翻译颗粒可供选择,每一种都会导致不同的页面大小集:

In AArch64, you have 3 possible translation granules to choose from, each of which results in a different set of page sizes:

  • 4KB粒度:4KB,2MB和1GB页面.
  • 16KB粒度:16KB和32MB页面.
  • 64KB粒度:64KB和512MB页面.

翻译粒度通常定义翻译体制的各种属性,因此它适用于整个表集,从某种意义上来说,您不能混合和匹配表中的颗粒是正确的,尽管它非常适合同时为不同表使用不同的粒度(例如,在不同的异常级别).

The translation granule defines various properties of the translation regime in general, so it applies to a whole set of tables and you are correct in the sense that you can't mix and match granules within a table, although it's perfectly fine to use different granules for different tables at the same time (e.g. at different exception levels).

相比之下,x86始终具有4KB的粒度,但是所提供的页面大小范围因模式而异:

Comparatively, x86 always has 4KB granularity, but the range of page sizes on offer varies depending on the mode:

  • 32位:4KB和4MB页面.
  • PAE:4KB和2MB页面.
  • 64位:4KB,2MB和(如果支持)1GB页面.

在两种情况下,大于基本粒度的页面大小代表中间表级别的块条目.换句话说,使用常见的4KB粒度3级 * ,例如:

In both cases, the page sizes larger than the basic granule represent block entries at intermediate table levels. In other words, using the common 4KB granule, 3-level*, example:

  • 第一级表中的每个有效条目都指向自然对齐的1GB内存区域,或指向描述该1GB地址空间的第二级表.
  • 第二级表中的每个有效条目都指向自然对齐的2MB内存区域,或指向描述该2MB地址空间的第三级表.
  • 第三级表中的每个有效条目都指向一个自然对齐的4KB内存区域.

*取决于实际的地址空间大小,在此之上可能有一个第0级表,但是两种架构都不允许在该级进行块条目(无论如何,它们实际上是巨大的).对于AArch64,较大的颗粒仅支持级别2和3的块/页面条目,而64KB颗粒则根本不具有级别0.

这篇关于同时在Aarch64上存在不同大小的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆