I'm curious as to how one can detect the presence of the CR4
register in assembler, as I'm sure it's possible, but I've just
#ifndefed out the offending instruction in this patch and it
seems to work with this change.
regards,
Biff.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
One way is to execute the instruction and trap the #UD exception if it
is not supported. Not sure whether you have an IDT set up or whether
your cpu traps on mov cr4.
If your cpu supports cpuid you can test for features that indicate bits
in cr4 are available, for example VME, DE, PSE, PVI, and PAE. If none
are available you likely don't have cr4 (and even if you do, it's
pointless to reset it).
--
error compiling committee.c: too many arguments to function
In general, I believe, existence of CPUID == existence of CR4.
(There were some late 486's which had CPUID, I believe they also had
CR4.) The first-principles test of catching the trap is more direct,
though. Inside the kernel we have read_cr4_safe() for that.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.