IA-32平台的Control Register(控制寄存器)

A control register is a processor register which changes or controls the general behavior of a CPU or other digital device. Common tasks performed by control registers include interrupt control, switching the addressing mode, paging control, and coprocessor control.

控制寄存器(Control Register)是用来修改或控制CPU特性的寄存器。它通常的功能包括:中断控制,地址模式转换,页面控制和并行控制。例如cr0寄存器的第0位(PE位)置位,系统将运行在保护模型下,否则运行在实模式下。

cr0

Bit Name Full Name Description
31 PG Paging If 1, enable paging and use the CR3 register, else disable paging(是否允许内存分页)
30 CD Cache disable Globally enables/disable the memory cache
29 NW Not-write through Globally enables/disable write-back caching
18 AM Alignment mask Alignment check enabled if AM set, AC flag (in EFLAGS register) set, and privilege level is 3
16 WP Write protect Determines whether the CPU can write to pages marked read-only(root是否可写用户空间)
5 NE Numeric error Enable internal x87 floating point error reporting when set, else enables PC style x87 error detection
4 ET Extension type On the 386, it allowed to specify whether the external math coprocessor was an80287 or 80387
3 TS Task switched Allows saving x87 task context upon a task switch only after x87 instruction used
2 EM Emulation If set, no x87 floating point unit present, if clear, x87 FPU present
1 MP Monitor co-processor Controls interaction of WAIT/FWAIT instructions with TS flag in CR0
0 PE Protected Mode Enable If 1, system is in protected mode, else system is in real mode(实模式or保护模式)

cr1

保留

cr2

Used when virtual addressing is enabled, hence when the PG bit is set in CR0. CR3 enables the processor to translate linear addresses into physical addresses by locating the page directory and page tables for the current task. Typically, the upper 20 bits of CR3 become the page directory base register (PDBR), which stores the physical address of the first page directory entry.

cr3

Used in protected mode to control operations such as virtual-8086 support, enabling I/O breakpoints, page size extension and machine check exceptions.

Bit Name Full Name Description
21 SMAP Supervisor Mode Access Protection Enable If set, access of data in a higher ring generates a fault
20 SMEP Supervisor Mode Execution Protection Enable If set, execution of code in a higher ring generates a fault
18 OSXSAVE XSAVE and Processor Extended States Enable  
17 PCIDE PCID Enable If set, enables process-context identifiers (PCIDs).
14 SMXE Safer Mode Extensions Enable see Trusted Execution Technology (TXT)
13 VMXE Virtual Machine Extensions Enable see Intel VT-x
10 OSXMMEXCPT Operating System Support for Unmasked SIMD Floating-Point Exceptions If set, enables unmasked SSE exceptions.
9 OSFXSR Operating system support for FXSAVE and FXRSTOR instructions If set, enables SSE instructions and fast FPU save & restore
8 PCE Performance-Monitoring Counter enable If set, RDPMC can be executed at any privilege level, else RDPMC can only be used in ring 0.
7 PGE Page Global Enabled If set, address translations (PDE or PTE records) may be shared between address spaces.
6 MCE Machine Check Exception If set, enables machine check interrupts to occur.
5 PAE Physical Address Extension If set, changes page table layout to translate 32-bit virtual addresses into extended 36-bit physical addresses.
4 PSE Page Size Extension If unset, page size is 4 KiB, else page size is increased to 4 MiB (or 2 MiB with PAE set).
3 DE Debugging Extensions If set, enables debug register based breaks on I/O space access
2 TSD Time Stamp Disable If set, RDTSC instruction can only be executed when in ring 0, otherwise RDTSC can be used at any privilege level.
1 PVI Protected-mode Virtual Interrupts If set, enables support for the virtual interrupt flag (VIF) in protected mode.
0 VME Virtual 8086 Mode Extensions If set, enables support for the virtual interrupt flag (VIF) in virtual-8086 mode.

IA-32平台的Control Register(控制寄存器)

时间: 2024-10-09 16:43:01

IA-32平台的Control Register(控制寄存器)的相关文章

PatentTips - Control register access virtualization performance improvement

BACKGROUND OF THE INVENTION A conventional virtual-machine monitor (VMM) typically runs on a computer and presents to other software the abstraction of one or more virtual machines. Each virtual machine may function as a self-contained platform, runn

Tomcat Can't load AMD 64-bit .dll on a IA 32

1.下载64位的tcnative-1.dll替换tomcat中bin目录下的tcnative-1.dll就解决了 2.tcnative-1.dll下载地址 请点击 这里 Tomcat Can't load AMD 64-bit .dll on a IA 32

Win 32平台SDK中的文件操作

读取文件: HANDLE hFile ; // 声明文件操作内核对象句柄 hFile = CreateFile("1.txt", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL) ; char buf[100] ; DWORD num ; ReadFile(hFile, buf, 100, &num, NULL) ; // 第四个参数指定的是实际读取的文件大小 buf[num] = 0 ; //

32位平台代码向64位平台移植

1背景描述 从苹果A7处理器开始,就支持着两种不同的指令集:第一种为原有处理器所支持的32-bit ARM指令集,第二种为崭新的64-bit ARM体系结构.这种64-bit体系结构拥有更大的地址空间,最大支持16GB内存,同时它一次性可提取64位数据,比32-bit体系提高了一倍.现如今,苹果的LLVM编译器已经能够充分支持64-bit指令集. 正如苹果A7处理器一样,支持64-bit指令集的处理器已经很普遍了,如AMD公司的AMD-64.Intel公司的EM64T及IA-64.处理器属于硬件

xilinx Ultrascale 四核A53+双核R5+GPU+fpga 平台初识

一.boot启动: 1.硬件资源: 64KB rom 用于完成以下工作:Pre-boot tasks ° Clean PMU RAM ° Enable the System Monitor and check LP domain supply. ° Configure PLLs with initial settings. ° Trigger and sequence the necessary scan and BIST clear of PS. ° Release reset to CSU.

Renesas E2 平台启动时间调试

1.问题描述 仪表项目DM001,使用的是RenesasR-Car E2(R8A7740)平台,使用U-boot启动,Start Kernel之前的时间比较长,约有8~9秒.超出了系统要求,目标是把时间缩小到1秒以内. 此SoC的启动时,内置的ROM代码会从QSPI接口的Flash中读取前16K数据到0xe6300000地址,从这里开始运行,由于只读取16K数据,所以无法从U-Boot(180K左右)直接启动,解决方法是自己编写了一小段代码,叫做Miniboot,此代码负责把U-Boot加载到内

Zynq ZC702平台 QSPI + eMMC实现

预备知识: UG821 The processor system boot is a two-stage process: ? Another boot mode supported through FSBL is eMMC boot mode. This boot mode is possible only when the primary boot mode (set through the boot mode pins) is QSPI. This is used when you hav

Double prefix overrides to provide 16-bit operand size in a 32/64 operating mode

A processor supports an operating mode in which the default address size is greater than 32 bits and the default operand size is 32 bits. The default address size may be nominally indicated as 64 bits, although various embodiments of the processor ma

vs2015添加ActiveX Control Test Container工具(转载)

http://blog.csdn.net/lphbtm/article/details/8647565 vs2010 中添加 ActiveX Control Test Container工具(转载) vs2010中的TSTCON( ActiveX Control Test Container )工具非自动安装,而是作为一个例程提供.所以应找到该例程,并编译: 如vs2010安装在默认路径则 1, 进入:C:\Program Files\Microsoft Visual Studio 10.0\S