freebsd-nq/sys
John Baldwin 391664b110 The variable MTRR registers actually have variable-sized PhysBase and
PhysMask fields based on the number of physical address bits supported
by the current CPU.  The old code assumed 36 bits on i386 and 40 bits on
amd64.  In truth, all Intel CPUs up until recently used 36 bits (a newer
Intel CPU uses 38 bits) and all the Opteron CPUs used 40 bits.

In at least one case (the new Intel CPU) having the size of the mask field
wrong resulted in writing questionable values into the MTRR registers on
the application processors (BSP as well if you modify the MTRRs via
memcontrol or running X, etc.).  The result of the questionable physmask
was that all of memory was apparently treated as uncached rather than
write-back resulting in a very significant performance hit.

Fix this by constructing a run-time mask for the PhysBase and PhysMask
fields based on the number of physical address bits supported by the CPU.
All 64-bit capable CPUs provide a count of PA bits supported via the
0x80000008 extended CPUID feature, so use that if it is available.  If that
feature is not available, then assume 36 PA bits.

While I'm here, expand the (now-unused) macros for the PhysBase and
PhysMask fields to the current largest possible value (52 PA bits).

MFC after:	1 week
PR:		i386/120516
Reported by:	Nokia
2008-03-12 22:09:19 +00:00
..
amd64 The variable MTRR registers actually have variable-sized PhysBase and 2008-03-12 22:09:19 +00:00
arm Respect RF_SHAREABLE flag in ARM nexus_setup_intr() 2008-03-12 15:46:25 +00:00
boot Improve handling U-Boot's "eth%daddr" while PowerPC metadata preparation. 2008-03-12 16:12:48 +00:00
bsm Merge OpenBSM 1.0 changes to src/sys/bsm: 2007-10-29 18:47:25 +00:00
cam When probing a newly found device, don't automatically assume that the 2008-02-27 08:47:13 +00:00
cddl Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is 2008-02-25 18:45:57 +00:00
compat Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
conf Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
contrib Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is 2008-02-25 18:45:57 +00:00
crypto Make test00 compilable again. 2008-01-15 18:34:47 +00:00
ddb Add a /S mode to DDB "ex" command, which interprets and prints the 2008-03-07 18:09:07 +00:00
dev Relax the BIOS/OS sempahore handoff code to workaround different hard 2008-03-12 20:57:17 +00:00
fs Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
gdb Add support for kgdb's 'detach' command. 2008-02-29 01:57:20 +00:00
geom Add support for VTOC8 labels (aka sun disk labels). When a label does 2008-03-02 00:52:49 +00:00
gnu Introduce some functions in the vnode locks namespace and in the ffs 2008-02-24 16:38:58 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 The variable MTRR registers actually have variable-sized PhysBase and 2008-03-12 22:09:19 +00:00
ia64 Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
isa Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY(). 2008-01-17 18:59:38 +00:00
kern Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
libkern Add prototype for __cmpd2(). 2008-02-23 22:40:05 +00:00
modules Update file list and Makefile after repocopying vr(4) from 2008-03-11 03:50:57 +00:00
net Improve convergence of bpf_filter.c toward style(9). 2008-03-09 21:13:43 +00:00
net80211 Fix adhoc mode to scan all available channels for a bss to join 2008-02-29 04:07:07 +00:00
netatalk Annotate two possible bugs in a comment: (1) we allocate and explicitly 2007-11-20 18:50:54 +00:00
netatm Disconnect netatm from the build as it is not MPSAFE and relies on 2007-07-14 21:49:24 +00:00
netgraph Improve apply callback error reporting: 2008-03-11 21:58:48 +00:00
netinet -Don't pass down the entire pkt to ProtoAliasIn, ProtoAliasOut, FragmentIn 2008-03-12 11:58:29 +00:00
netinet6 Rather than passing around a cached 'priv', pass in an ucred to 2008-02-02 14:11:31 +00:00
netipsec Fix bugs when allocating and passing information of current lifetime and 2008-03-02 17:12:28 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm
netncp - Handle buffer lock waiters count directly in the buffer cache instead 2008-03-01 19:47:50 +00:00
netsmb Remove unused vc_tnode field from struct smb_vc. 2008-03-10 14:55:34 +00:00
nfs
nfs4client - Handle buffer lock waiters count directly in the buffer cache instead 2008-03-01 19:47:50 +00:00
nfsclient Expand the nfs_opts array to include all possible string 2008-03-05 10:09:29 +00:00
nfsserver Fix the Giant leak in the nfsrv_remove(). 2008-03-04 11:05:03 +00:00
opencrypto Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
pc98 Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
pccard
pci vr(4) was repocopied to src/sys/dev/vr. 2008-03-11 03:53:53 +00:00
powerpc Obtain TSEC h/w address from the parent bus (OCP) and not rely blindly on what 2008-03-12 16:32:08 +00:00
rpc Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
security Remove XXX to remind me to check the free space calculation, which to my 2008-03-10 18:15:02 +00:00
sparc64 Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
sun4v - Rather than repeating the same preemption code everywhere call the scheduler 2008-03-10 01:32:48 +00:00
sys Add missing comma. 2008-03-12 18:25:47 +00:00
tools Introduce a standalone shell script for embedding MFS image. 2008-02-05 10:46:30 +00:00
ufs Remove include of opt_quota.h; as of revision 1.205 there is no longer 2008-03-10 18:44:07 +00:00
vm Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
Makefile o Add boot, gdb, nfsserver and opencrypto dirs to CSCOPEDIRS; sort. 2008-01-23 08:50:34 +00:00