Re:Reverse engineering the Intel 386 processor's register cell
by colejohnson66 on Friday November 10, 2023 @03:57PM
(#38224416)
I always assumed CR8 was used because (a) it prevents access outside 64-bit mode, and (b) being the creators of 64-bit mode, there's a guarantee Intel has no plans of using such a register for something else.
[ Parent
| on HN ]
Re:Reverse engineering the Intel 386 processor's register cell
by ajross on Monday November 13, 2023 @11:52AM
(#38252275)
To be clear, sure, that's surely the case. The REX encoding added an extra bit to the register field used by the movcr instructions, giving you 16. So... might as well.
Nonetheless the "official" means for adding state to an x86 is an MSR. And in particular there's no good reason for putting this in legacy spaces like CRs: CR8 is an interrupt control register, unrelated to the MMU control in CR0/2/3.
(In fact the proof of this is that within the decade, x86 interrupt handling needed to evolve in the direction of MSI's and x2apic, something that even the newly-expanded CR registers were completely inadequate to do. So we do that stuff in MSRs too.)