Page 2 of 2
Re: Is it fair to expect PAE to be present on the system?
Posted: Thu Mar 10, 2011 7:43 pm
by blobmiester
Combuster wrote:Pentium 2 does not support NX. Many P4s don't either, and the P4s who do are likely to have long mode as well (if there is a XD-LM feature gap at all, Wikipedia is not explicit about it). I suggest you check your facts again.
You're right about the Pentium 2 not supporting NX. I should have been clearer. My Pentium 4 does support NX but even through my Pentium 2 doesn't -- it does support PAE. It's nice to have a (mostly) uniform paging interface. Note that i still chose to write for x86 for the time being.
Re: Is it fair to expect PAE to be present on the system?
Posted: Thu Mar 10, 2011 7:44 pm
by Owen
I believe that all CPUs which support NX also support Long Mode. The converse is not true (<-- And a good way to cause exceptions from setting illegal bits!).
If there are any CPUs which do NX but not LM, it will be oddities like the 32-bit only Atoms.
Re: Is it fair to expect PAE to be present on the system?
Posted: Thu Mar 10, 2011 9:48 pm
by Brendan
Hi,
Owen wrote:I believe that all CPUs which support NX also support Long Mode. The converse is not true (<-- And a good way to cause exceptions from setting illegal bits!).
If there are any CPUs which do NX but not LM, it will be oddities like the 32-bit only Atoms.
Intel did release some "32-bit only" Pentium 4 (Prescott) CPUs that don't support long mode but do support NX.
You're also right about Atom CPUs - all of the "32 bit only" Atom variants support NX (which includes some Atom CPUs that Intel only released last year). Ironically, NX is the only real reason to use PAE on these Atom CPUs, as they only support 32-bit physical addresses (and not 36-bit physical addresses, like people might be tempted to assume).
Of course PAE costs about twice as much RAM for page tables, etc; and the cost of TLB misses is worse (because there's more levels of paging structures); so you wouldn't want to use it without a good reason. This gives something like this:
Code: Select all
if( CPU_supports_long_mode() ) return USE_LONG_MODE;
if( CPU_supports_PAE() ) {
if( usable_RAM_above_4GiB() ) return USE_PAE;
if( CPU_supports_NX() ) {
/* Is it worth the extra RAM and TLB miss overheads? */
}
}
return USE_LEGACY_PAGING;
Of course you'd also want to allow the end-user to override this; so that (for e.g.) an OS developer can test a 32-bit kernel on a 64-bit system.
Cheers,
Brendan
Re: Is it fair to expect PAE to be present on the system?
Posted: Fri Mar 11, 2011 3:23 am
by Owen
PAE doesn't add any more levels of paging structures (As far as lookup time is concerned, anyway); the whole PDPT is loaded into a hidden register when CR3 is loaded