0

I need to identify the set of all the privileged instructions in x86_64 architecture. I know some of them such as cli for clearing interrupts, but when searching in the net for a whole list, I can not find something useful even in the official Intel manuals. Any help, resources, links are welcome.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Oualid
  • 139
  • 9
  • @Michael Petch: thank you for the reference. Sometimes, it is not obvious to find the right place. Nonetheless, there are two issues with the previous question (answer): the list is not exhaustive and some instructions are not privileged such as the last one (rdtsc) for monitoring execution time. – Oualid May 06 '18 at 21:56
  • RDTSC can probably considered privileged since the TSD flag in register CR4 being set to 1 can make it a privileged instruction that can only be used in ring 0. I think that should probably be noted in that answer. Which other instructions do you consider privileged that aren't in the list? `in` and `out` aren't privileged. – Michael Petch May 06 '18 at 22:08
  • 1
    `sti`, `cli` `in` `out`, `popf` are generally not considered privileged since they can be made to run in rings other than 0 if IOPL is set appropriately. – Michael Petch May 06 '18 at 22:28
  • 1
    @Oualid: the first comment on the linked duplicate has your real answer, then, if you're worried that list isn't exhaustive. Search Intel's volume-2 manual for instructions that say `#GP(0) If the current privilege level is not 0`. – Peter Cordes May 07 '18 at 01:36
  • Thank you for your replies. I think I understood: there is no whole list in the manuals for privileged instructions but depending on the context of every instruction. If an instruction induces general protection when executed with CPL <> 0, then it is considered as a privileged instruction. – Oualid May 07 '18 at 05:56

0 Answers0