Can anyone explain me regarding the difference between RPL and CPL.
The definition of RPL (requested privilege level) is given as below
The RPL is an override privilege level that is assigned to segment
selectors.
and the requestor's privilege level (RPL) field of a segment
selector is intended to carry the privilege level of a calling
procedure (the calling procedure's CPL) to a called procedure.
My doubt if the RPL is privilege level of calling program then in case
of transferring control to the non-conforming code segment , the
condition is given as RPL must be lesser than or equal to CPL (
numerically) for the control transfer to take place.
So the calling program is at higher privilege than the called
program, which against conception that a higher privileged program
can access only the code segments on its privilege level
The general consideration that I took for accessing the code and data
segments with respect to its privilege level is given below
A task can access data only on its own level of protection or on that
which is numerically higher (i.e.) on outer one (ring) as related to
current). This results in ring 0 being the most protected in terms of
data access. From the point of view of code segments, ring 0 is the
most privileged as one having access to data areas in entire system.
Reverse situation exist s when looking at the code access: ring 0 can
invoke code that lives on its own level only, while ring 3 can call all
(unless restricted otherwise) code in entire OS
Is the consideration correct ..
2.In ARM processor we call change from one mode to to another mode so
that privilege level are varied by doing so
How can we program the privilege level of AMD64 processor.
or we allowed to set the privilege level by means of assembly
programming ..
Kindly clarify my doubts.
Regards,
senthilvelan
It's been a while, so it might not be 100% accurate.
RPL is the Privilege Level (PL) of the selector you're calling unless
it's a conforming (segment of a code) selector. So if you execute the
(far) call/jmp (without any violations) the CPL turns into this
RPL. This can only be called/jmped/ireted to lower or equal PL (higher
or equal numbers).
A (interrupt/call/task) gate can point to another code selector. This
is how you (can) raise the PL (lower numbers) as the gate can be PL 3
but pointing to PL 0.
If it's a conforming selector it's something else but the main thing
to remember is that CPL remains the same. And I've never quite
understood when it would be good or advisable to have a conforming
segment. The best so far I've come up with is having the kernel and
userland sharing the same far routines (like a far_strcmp()). Perhaps
it might be useful for microkernels?
Right,
MartinS