VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Reading the 80486 manual, it lists the following control instructions as priveleged(CPL0 only, any other CPL levels(1,2,3) are illegal):
- CLTS
- HLT
- LGDT
- LIDT
- LLDT
- LMSW
- LTR
- MOV to/from CR0
- MOV to/from DRn
- MOV to/from TRn

Does that mean that MOV to/from CR2/CR3 is allowed always(CR1 being #UD always)? Or is that a documentation error?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 1, by Stenzek

User metadata
Rank Newbie
Rank
Newbie

From the Pentium manual:
- PMode: #GP(0) if CPL != 0 for all control registers, #GP(0) if writing to reserved bits of CR4
- Real Mode: Interrupt 13 (which is #GP) if writing to reserved bits of CR4
- V8086 Mode: #GP(0) unconditionally

Which makes sense, you wouldn't want userspace to be able to change the page directory address, as that would render the protection useless.