Consistent and non-consistent code segments

Source: Internet
Author: User

From: http://hi.baidu.com/formerdays/blog/item/5ddaad4e06564e0eb3de05c1.html

In the bucket descriptor, the type of the attribute area consists of 0-3 bits. Bit 3 is called the e bit, E = 1, indicating that this descriptor is used to describe the code segment. Bit 2 is called a C bit. Bit c = 1 indicates that the corresponding code segment is a consistent code segment; bit c = 0 indicates that the corresponding code segment is not a consistent code segment.

The so-called "consistent code segment" aims to share. For example, if the privileged level of the consistent code segment is 2, the consistent code can be accessed even if the privileged level is 3. That is, allow low-Permission code to access high-Permission code. After successful access, the current privileged level is not the target code's privileged level, but the original code's privileged level. That is to say, after the jump, CPL remains unchanged. It should be noted that the DPL definition of consistent code segments defines the highest permission to allow access to change consistent code segments, that is, if you have a higher permission than DPL in a consistent code segment, you are not allowed to access this consistent code segment.
Summary: DPL of the same code segment specifies the highest permission for successfully accessing it. Code with a higher permission cannot access it successfully. After a consistent code segment is successfully accessed, CPL remains the original permission. This setting is mainly for sharing, such as some function libraries, without permission restrictions. cpl = DPL, RPL <= DPL. for non-consistent code segments, only transfer at the same privilege level is allowed
Cause:
1. High-privilege Code cannot be called at the low-privilege level, that is, code at the High-privilege level is protected.
2. Low-privilege Code cannot be called at the High-privilege level. In order to prevent low-privilege code from obtaining high-privilege level code, some system commands can be executed. 1.
Transfer of consistent code segments, CPL unchanged after transfer
For the transfer of inconsistent code segments and the transfer by calling the door, the CPL after the transfer is the DPL of the segment.
2.
When assigning values to other register segments (except CS), The RPL of the Register is the RPL of the sub-register. DPL is the level of privileged access for the storage segment, CPL is the current level of privilege of the CPU, representing the level of privilege of the current program. RPL is the privilege level for selecting sub-requests. For non-consistent code segments, it is required to indicate that the current program privileged level CPL must be equal to the allowed access privilege level DPL of the storage segment, that is, for non-consistent code segments, the program can only access buckets of the same privileged level. Select the sub-Request access privileged level. RPL must be higher than the bucket's permitted access privileged level DPL.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.