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.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.
Is it fair to expect PAE to be present on the system?
- blobmiester
- Member
- Posts: 45
- Joined: Fri Jul 16, 2010 9:49 am
Re: Is it fair to expect PAE to be present on the system?
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Is it fair to expect PAE to be present on the system?
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.
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?
Hi,
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:
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
Intel did release some "32-bit only" Pentium 4 (Prescott) CPUs that don't support long mode but do support NX.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.
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;
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Is it fair to expect PAE to be present on the system?
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