您的位置:首页 > Web前端

80386 programmer's reference manual Chapter 6 Protection notes

2014-02-01 00:18 357 查看
1. Why protection?

Identify and detect bugs.

2. Overview: 5 aspects

Type checking

Limit checking

Restriction of addressable domain

Restriction of procedure entry points

Restriction of instruction set

Protection is a hardware mechanism, applies both to segment translation and to page translation.

3. Segment level protection.

Here we mainly talking about Privilege levels.

Segment descriptor contains a filed called DPL(descriptor privilege level)

Selectors contains RPL(requestor's privilege level)

An internal register contains CPL(current privilege level), usually CPL = DPL, it changes when controls transferred to different segments.

The processor automatically evaluates the right of a procedure to access

another segment by comparing the CPL to one or more other privilege levels.

The evaluation is performed at the time the selector of a descriptor is
loaded into a segment register. The criteria used for evaluating access to
data differs from that for evaluating transfers of control to
executable


segments; therefore, the two types of access are considered separately in

the following sections.

DPL >= max(CPL, RPL);

The instructions that affect system data structures can only be executed

when CPL is zero. If the CPU encounters one of these instructions when CPL

is greater than zero, it signals a general protection exception. These

instructions include:

CLTS
HLT

LGDT

LIDT

LLDT

LMSW

LTR

MOV to/from CRn

MOV to /from DRn

MOV to/from TRn
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  SMP x86 privilege
相关文章推荐