I am writing my own OS for 64bit processors and I am stuck with the problem of general protection. My OS will not rely on page fault to implement user space protection mechanism, so I found there is a way to do it with segment limit checking:
This presentation from VMWare
http://download3.vmware.com/vmworld/2005/pac346.pdf
on page 20 says:
Initial AMD64 architecture did not include segmentation in 64-bit mode
- Segmentation also missing from EMT64T
How do we protect the VMM ?
- 64-bit guest support requires additional hardware assitance
- Segment limit checks available in 64-bit mode on newer AMD processors
Now, I have the newer AMD processor model and my question is how do I achieve limit segment limit check on AMD processor in 64-bit (long) mode ? I have downloaded the Sep 2011 version (lastest) of developer's manual and I can't find how to do this in any place, please help.
I think they're probably talking about the Long Mode Segment Limit Enable bit (
LMSLE
bit 13) in the "Extended Feature Enable Register" (EFER) in Volume 2 3.1.7 pg. 55. It is describe in a little more detail in "4.12.2 Data Limit Checks in 64-bit Mode" on page 114. Note thatEFER
is a model-specific register (more in "6.2.5 Accessing Model-Specific Register" pg. 156 also in volume 2).