freebsd-nq/sys
Alan Cox 387aabc513 Long, long ago in r27464 special case code for mapping device-backed
memory with 4MB pages was added to pmap_object_init_pt().  This code
assumes that the pages of a OBJT_DEVICE object are always physically
contiguous.  Unfortunately, this is not always the case.  For example,
jhb@ informs me that the recently introduced /dev/ksyms driver creates
a OBJT_DEVICE object that violates this assumption.  Thus, this
revision modifies pmap_object_init_pt() to abort the mapping if the
OBJT_DEVICE object's pages are not physically contiguous.  This
revision also changes some inconsistent if not buggy behavior.  For
example, the i386 version aborts if the first 4MB virtual page that
would be mapped is already valid.  However, it incorrectly replaces
any subsequent 4MB virtual page mappings that it encounters,
potentially leaking a page table page.  The amd64 version has a bug of
my own creation.  It potentially busies the wrong page and always an
insufficent number of pages if it blocks allocating a page table page.

To my knowledge, there have been no reports of these bugs, hence,
their persistance.  I suspect that the existing restrictions that
pmap_object_init_pt() placed on the OBJT_DEVICE objects that it would
choose to map, for example, that the first page must be aligned on a 2
or 4MB physical boundary and that the size of the mapping must be a
multiple of the large page size, were enough to avoid triggering the
bug for drivers like ksyms.  However, one side effect of testing the
OBJT_DEVICE object's pages for physical contiguity is that a dubious
difference between pmap_object_init_pt() and the standard path for
mapping devices pages, i.e., vm_fault(), has been eliminated.
Previously, pmap_object_init_pt() would only instantiate the first
PG_FICTITOUS page being mapped because it never examined the rest.
Now, however, pmap_object_init_pt() uses the new function
vm_object_populate() to instantiate them all (in order to support
testing their physical contiguity).  These pages need to be
instantiated for the mechanism that I have prototyped for
automatically maintaining the consistency of the PAT settings across
multiple mappings, particularly, amd64's direct mapping, to work.
(Translation: This change is also being made to support jhb@'s work on
the Nvidia feature requests.)

Discussed with:	jhb@
2009-06-14 19:51:43 +00:00
..
amd64 Long, long ago in r27464 special case code for mapping device-backed 2009-06-14 19:51:43 +00:00
arm Move the memory layout definitions and logic from mvreg.h to mvwin.h 2009-06-12 20:00:38 +00:00
boot Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet 2009-06-10 02:07:58 +00:00
bsm Merge OpenBSM 1.1 from OpenBSM vendor branch to head. 2009-04-19 16:17:13 +00:00
cam Include <camlib.h> for cam_path_string(). 2009-06-14 12:46:34 +00:00
cddl Rename the host-related prison fields to be the same as the host.* 2009-06-13 15:39:12 +00:00
compat Unlock process lock when return error from getrobustlist call. 2009-06-14 17:53:55 +00:00
conf Add support for labels derived from GPT metadata. 2009-06-13 00:27:03 +00:00
contrib All consumers of in_cksum.h have been properly #ifdefed already, 2009-06-10 11:19:34 +00:00
crypto Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(), 2009-05-27 09:52:12 +00:00
ddb Place hostnames and similar information fully under the prison system. 2009-05-29 21:27:12 +00:00
dev Add more entries to the Unicode-to-CP437 table. 2009-06-14 12:04:34 +00:00
fs Eliminate unnecessary variables. 2009-06-13 20:21:08 +00:00
gdb
geom Add support for labels derived from GPT metadata. 2009-06-13 00:27:03 +00:00
gnu Fix r193923 by noting that type of a_fp is struct file *, not int. 2009-06-10 14:24:31 +00:00
i386 Long, long ago in r27464 special case code for mapping device-backed 2009-06-14 19:51:43 +00:00
ia64 Import ACPICA 20090521. 2009-06-05 18:44:36 +00:00
isa Rename statclock_disable variable to atrtcclock_disable that it actually is, 2009-05-03 17:47:21 +00:00
kern Rename the host-related prison fields to be the same as the host.* 2009-06-13 15:39:12 +00:00
kgssapi When the KOBJMETHOD() macro was updated, it resulted in the 2009-06-14 17:33:46 +00:00
libkern add explanatory header license 2009-06-09 21:29:16 +00:00
mips Fix typo... bad imp. 2009-06-14 03:32:52 +00:00
modules Last (hopefully) attempt to fix both parallel build and 2009-06-12 07:39:10 +00:00
net Add an optional callback function that will be invoked when a per-CPU 2009-06-14 17:15:18 +00:00
net80211 Rev IEEE80211_IOC_STA_INFO abi: ni_flags grew from 16 bits to 32 2009-06-13 23:43:00 +00:00
netatalk Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
netgraph Assign ng_eiface nodes a netgraph name on instantiation, in a way which 2009-06-12 09:20:31 +00:00
netinet Move the kernel option FLOWTABLE chacking from the header file to the 2009-06-12 20:46:36 +00:00
netinet6 Rename the host-related prison fields to be the same as the host.* 2009-06-13 15:39:12 +00:00
netipsec Added support for NAT-Traversal (RFC 3948) in IPsec stack. 2009-06-12 15:44:35 +00:00
netipx Put the variable declarations for TCPDEBUG under #ifdef INET as well. 2009-06-10 09:28:50 +00:00
netnatm Reimplement the netisr framework in order to support parallel netisr 2009-06-01 10:41:38 +00:00
netncp
netsmb Rework socket upcalls to close some races with setup/teardown of upcalls. 2009-06-01 21:17:03 +00:00
nfs Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
nfsclient Rename the host-related prison fields to be the same as the host.* 2009-06-13 15:39:12 +00:00
nfsserver Add a #include <sys/jail.h> so that it builds when 2009-06-12 20:18:08 +00:00
nlm Rename the host-related prison fields to be the same as the host.* 2009-06-13 15:39:12 +00:00
opencrypto Fix cryptodev UIO creation. 2009-05-23 13:23:46 +00:00
pc98 Remove MAC kernel config files and add "options MAC" to GENERIC, with the 2009-06-02 18:31:08 +00:00
pci When user_frac in the polling subsystem is low it is going to busy the 2009-05-30 15:14:44 +00:00
powerpc Correct the method of waking the page daemon when the number of allocated 2009-06-13 18:35:29 +00:00
rpc When a Solaris10 client does an NFS mount using krb5i or krb5p, the 2009-06-13 23:16:40 +00:00
security Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use 2009-06-10 20:59:32 +00:00
sparc64 Remove MAC kernel config files and add "options MAC" to GENERIC, with the 2009-06-02 18:31:08 +00:00
sun4v Adjust the padding of struct pcpu to r193219. 2009-06-03 19:31:26 +00:00
sys Rename the host-related prison fields to be the same as the host.* 2009-06-13 15:39:12 +00:00
tools Move all sound related scripts to its own 'sound' subdir. 2009-06-10 06:49:45 +00:00
ufs Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
vm Long, long ago in r27464 special case code for mapping device-backed 2009-06-14 19:51:43 +00:00
xdr MFdevbranch 192944 2009-05-28 08:18:12 +00:00
xen Make ipi_cpu() function as intended. 2009-05-30 08:53:13 +00:00
Makefile Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00