PowerPC PPC460-S MMU

来源:互联网 发布:oracle云计算平台实战 编辑:程序博客网 时间:2024/06/05 15:07

    • 入门介绍
      • 基本介绍 Overview
      • MMU功能
      • TLB
        • Overview
        • Attribute
        • Address Translation
        • Performance Improving
        • Others

入门介绍

基本介绍 Overview

The PPC460-S supports a Flat,36-bit(64GB) real(physical) address space.
36位的物理地址通过MMU产生(内核根据取值、取指的32位有效地址翻译而来)

MMU功能

The MMU provides address translation,access protection,and storage attitude control for embedded applications.
MMU提供了如下功能:

  • 32位的有效地址(effective address)转译成36位物理地址空间
  • 页读、写、执行控制
  • Storage attributes for cache policy, byte order, and speculative memory access .
  • Software control of page replacement strategy

TLB

Overview

The translation lookaside buffer( 后备转译缓存)是基本的硬件资源
(如同指令和数据Cache,只是用来存储页表,已加快地址翻译以及提供内存保护)。

Attribute

It consists of 64 entries, each specifying the various attributes of a given page of the address space.
The TLB is fully-associative, the entry for a given page can be placed anywhere in the TLB. The TLB Tag and data memory arrays are parity protected against soft errors, which causes a machine check exception.
一般由软件来管理TLB入口的建立和替换,这样给用户在定义页表转换策略提供了灵活性。
例如,你可以定义全局可访问的静态映射的TLB入口,以提高转译的效率。
TLB的相关操作指令是特权级的,因此处理器必须处于内核态来处理。

Address Translation

  1. 首先将有效地址翻译为虚拟地址(virtual address)

    • 41位虚拟地址来源:32位有效地址, 8位Process ID(PID), 1位Address Space Identifier
    • PID值从PID寄存器获取
    • AS Identifier从MSR寄存器获取
  2. 使用TLB将41位虚拟地址翻译成36位物理地址

NOTE:只有对在TLB中含有有效的虚拟地址的页的入口地址才会发生翻译,否则会引发指令或数据TLB异常

Performance Improving

为了提升性能,指令Cache和数据Cache都保留了独立的TLB影子缓存(Shadow TLB Array).

  • The Instruction Shadow TLB(ITLB)可保留4个入口;
  • The Data Shadow TLB(DTLB)可保留8个入口entry;

在取值和取指过程中,只有当在各自的影子TLB中缺页时,才会访问保护64入口的统一TLB区
(当然,在影子TLB缺页时也就会带来3个指令周期的损耗);
对于ITLB和DTLB的替换以及有效性处理均由硬件管理,软件不需要做什么操作。

Others

  • 每个TLB Entry都提供了单独的用户态及内核态的读、写、执行权限
    • 如果软件企图访问一个权限不匹配的页,指令取指或数据加载异常就会发生;
  • 每个TLB Entry也提供了对相关页的存储属性的集合
    • 缓存规则(可缓存性、直写Write-Through/回写Copy-Back)
    • 字节序(大端/小端)
    • 页随机访问的使能(enabling of speculative access for the page )
    • 4个可自定义的属性

以上内容参考《PowerPC 460-S Embedded Processor Core —- User manual》

    • 入门介绍
      • 基本介绍 Overview
      • MMU功能
      • TLB
        • Overview
        • Attribute
        • Address Translation
        • Performance Improving
        • Others

0 0
原创粉丝点击