While I'm thinking of it, we need to detect if a processor supports
the SYSENTER/SYSEXIT instructions and if so, save/restore the
MSR dedicated to CS, during our warp between the native OS
and the guest in FreeMWare.
If the host is using this feature (the CS MSR is not zero), we would
not want guest app code to be able to invoke a syscall in the
host OS. If the CS MSR is zero, a fault occurs. So we just
save it, and set it to zero. On the way back, just restore it.
Will look into adding some code for this after Christmas.
Relevant Intel info below.
-Kevin
-----------------------------------------------------------------------
(from the Intel docs)
The presence of this facility is indicated by the SYSENTER Present (SEP) bit 11 of
CPUID. An operating system that detects the presence of the SEP bit
must also qualify the processor family and model to ensure that the SYSENTER/SYSEXIT
instructions are actually present. For example:
IF (CPUID SEP bit is set)
IF (Family == 6) AND (Model < 3) AND (Stepping < 3)
THEN
Fast System Call NOT supported
FI;
ELSE Fast System Call is supported
FI
The Pentium � Pro processor (Model = 1) returns a set SEP CPUID feature bit,
but does not support the SYSENTER/SYSEXIT instructions.