First post, by superfury
Strangely enough, looking at Bochs' tasking.cc, it doesn;t check CS privilege when it's conforming?
The 80386 programmer's reference manual says this:
- The conforming bit of the target code-segment descriptor is set, and
the DPL of the target is less than or equal to CPL.
So when DPL is greater than CPL(and RPL, when not gated, or just RPL during RETF/IRET), for example a RPL of 0 and DPL of 3, it faults? All other cases are allowed?
The same applies to CS loads during task switches?
Oddly enough, the 80386 programmer's reference manual says that "CS.RPL" must match something called "CS.CPL"? That cannot be right, as conforming segments would incorrectly fault? Also, does it mean CPL or CS.DPL when it says that? CPL is already the case, as it's CS.RPL becoming CPL before any segment is loaded and verified? CPL becomes SS.DPL after the SS descriptor is cached and verified(usually unchanging during V86 mode and Protected mode without faults)?
For a JMP instruction to a nonconforming segment, both of the following privilege rules must be satisfied; otherwise, a general […]
For a JMP instruction to a nonconforming segment, both of the following privilege rules must be satisfied; otherwise, a general protection exception results.
MAX (CPL,RPL) . gate DPL
target segment DPL = CPL
For a CALL instruction (or for a JMP instruction to a conforming segment), both of the following privilege rules must be satisfied; otherwise, a general protection exception results.
MAX (CPL,RPL) . gate DPL
target segment DPL . CPL
I also assume the "." that's in the privilege checks before figure 6.5 means "<=" instead?
Edit: Just found a scanned copy of the online documentation. Those "." are actually mistranslated "<=" symbols. So I was right on those.
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io