Commit Graph

90202 Commits

Author SHA1 Message Date
thorpej
88371dafeb We can't currently build a toolchain for x86-64 here, so don't
attempt to do so.
2001-12-31 22:35:41 +00:00
chs
43973be0c5 introduce a new UVM fault type, VM_FAULT_WIREMAX. this is different
from VM_FAULT_WIRE in that when the pages being wired are faulted in,
the simulated fault is at the maximum protection allowed for the mapping
instead of the current protection.  use this in uvm_map_pageable{,_all}()
to fix the problem where writing via ptrace() to shared libraries that
are also mapped with wired mappings in another process causes a
diagnostic panic when the wired mapping is removed.

this is a really obscure problem so it deserves some more explanation.
ptrace() writing to another process ends up down in uvm_map_extract(),
which for MAP_PRIVATE mappings (such as shared libraries) will cause
the amap to be copied or created.  then the amap is made shared
(ie. the AMAP_SHARED flag is set) between the kernel and the ptrace()d
process so that the kernel can modify pages in the amap and have the
ptrace()d process see the changes.  then when the page being modified
is actually faulted on, the object pages (from the shared library vnode)
is copied to a new anon page and inserted into the shared amap.
to make all the processes sharing the amap actually see the new anon
page instead of the vnode page that was there before, we need to
invalidate all the pmap-level mappings of the vnode page in the pmaps
of the processes sharing the amap, but we don't have a good way of
doing this.  the amap doesn't keep track of the vm_maps which map it.
so all we can do at this point is to remove all the mappings of the
page with pmap_page_protect(), but this has the unfortunate side-effect
of removing wired mappings as well.  removing wired mappings with
pmap_page_protect() is a legitimate operation, it can happen when a file
with a wired mapping is truncated.  so the pmap has no way of knowing
whether a request to remove a wired mapping is normal or when it's due to
this weird situation.  so the pmap has to remove the weird mapping.
the process being ptrace()d goes away and life continues.  then,
much later when we go to unwire or remove the wired vm_map mapping,
we discover that the pmap mapping has been removed when it should
still be there, and we panic.

so where did we go wrong?  the problem is that we don't have any way
to update just the pmap mappings that need to be updated in this
scenario.  we could invent a mechanism to do this, but that is much
more complicated than this change and it doesn't seem like the right
way to go in the long run either.

the real underlying problem here is that wired pmap mappings just
aren't a good concept.  one of the original properties of the pmap
design was supposed to be that all the information in the pmap could
be thrown away at any time and the VM system could regenerate it all
through fault processing, but wired pmap mappings don't allow that.
a better design for UVM would not require wired pmap mappings,
and Chuck C. and I are talking about this, but it won't be done
anytime soon, so this change will do for now.

this change has the effect of causing MAP_PRIVATE mappings to be
copied to anonymous memory when they are mlock()d, so that uvm_fault()
doesn't need to copy these pages later when called from ptrace(), thus
avoiding the call to pmap_page_protect() and the panic that results
from this when the mlock()d region is unlocked or freed.  note that
this change doesn't help the case where the wired mapping is MAP_SHARED.

discussed at great length with Chuck Cranor.
fixes PRs 10363, 12554, 12604, 13041, 13487, 14580 and 14853.
2001-12-31 22:34:39 +00:00
thorpej
6ca57419d1 Labels must be followed by statements. 2001-12-31 22:07:58 +00:00
thorpej
f9df4d877e Avoid an "unmamed fields" warning (gcc 3.1). 2001-12-31 22:06:47 +00:00
thorpej
17da611b51 Fix a "pointers are not permitted as case values" gcc 3.1 warning. 2001-12-31 21:55:46 +00:00
thorpej
fdb5b56e5f Do not compare an integer to NULL. 2001-12-31 21:37:22 +00:00
thorpej
aedf82267c Move the declaration of an enum to avoid an "unnamed field not allowed"
warning in gcc 3.1.
2001-12-31 21:30:01 +00:00
chs
23c75a9a98 in uvm_map_clean(), add PGO_CLEANIT to the flags passed to an object's pager.
we need to make sure that vnode pages are written to disk at least once,
otherwise processes could gain access to whatever data was previously stored
in disk blocks which are freshly allocated to a file.
2001-12-31 20:34:01 +00:00
thorpej
9e94d2a9fe When compiling for userland, need <stdlib.h> for abort() prototype
(noticed by gcc 3.1).
2001-12-31 20:20:28 +00:00
thorpej
57a44a3d17 Need <string.h> for memcpy() prototype (noticed by gcc 3.1). 2001-12-31 20:19:14 +00:00
thorpej
ed2b20a87a Need <stdlib.h> for exit() prototype (noticed by gcc 3.1). 2001-12-31 20:16:34 +00:00
thorpej
19a95cad9c Fix warnings generated by gcc 3.1. 2001-12-31 20:09:53 +00:00
thorpej
6b3e0a100a Remove -I${DESTDIR}/usr/include and -I${DESTDIR}/usr/include/openssl
from CPPFLAGS.
2001-12-31 20:04:47 +00:00
thorpej
bf0e32f7fc Remove unneeded/unused TREE_ISEMPTY() (which also happens to clash
with the TREE_ISEMPTY() in menutree.h, which gcc 3.1 correctly warns
about).
2001-12-31 20:00:40 +00:00
thorpej
c31bd4704c Fix gcc 3.1 printf format warnings generated by extra arguments being
passed to varargs CPP macros.
2001-12-31 19:52:45 +00:00
thorpej
dbaa175ee7 Add comment delimiters around the token after an #endif 2001-12-31 19:46:57 +00:00
thorpej
1b1d20a895 Need <strings.h> for ffs() prototype (noticed by gcc 3.1). 2001-12-31 19:45:03 +00:00
thorpej
aa38e62655 Need <stdlib.h> for abort() prototype (noticed by gcc 3.1). 2001-12-31 19:44:27 +00:00
thorpej
82f66ec4a0 Add -I${.CUDRIR} to CPPFLAGS. 2001-12-31 19:41:37 +00:00
thorpej
429c29847e Statements must follow labels. 2001-12-31 19:33:58 +00:00
thorpej
d5b972580e Need <string.h> for strcmp() prototype (noticed by gcc 3.1). 2001-12-31 19:31:23 +00:00
thorpej
097956219f Remove -I${DESTDIR}/usr/include and -I${DESTDIR}/usr/include/openssl
from CPPFLAGS.
2001-12-31 19:26:59 +00:00
thorpej
4d1b7fd158 Remove -I${DESTDIR}/usr/include and -I${DESTDIR}/usr/include/openssl from
CPPFLAGS.
2001-12-31 19:25:36 +00:00
thorpej
7532b272b3 Remove -I${DESTDIR}/usr/include/openssl from CPPFLAGS; it's unnecessary,
and having it causes the wrong <err.h> to be included.
2001-12-31 19:24:12 +00:00
chs
ef57a67ca1 fix locking for loaning. in general we should be looking at the page's
uobject and uanon pointers rather than at the PQ_ANON flag to determine
which lock to hold, since PQ_ANON can be clear even when the anon's lock
is the one which we should hold (if the page was loaned from an object
and then freed by the object).
2001-12-31 19:21:36 +00:00
thorpej
f8fdb0d1c9 Remove -I${DESTDIR}/usr/include from CPPFLAGS; it is unnecessary, and
it makes gcc 3.1 unhappy (because -isystem ${DESTDIR}/usr/include is
specified later).
2001-12-31 19:02:49 +00:00
thorpej
3d561f4807 Avoid an "operation on foo may be undefined" warning (gcc 3.1). 2001-12-31 18:53:32 +00:00
thorpej
2aa37f4ab3 Change some:
foo += sscanf(++foo, ...);

constructs to:

	++foo;
	foo += sscanf(foo, ...);

to avoid the following warning from gcc 3.1:

	warning: operation on `pos' may be undefined
2001-12-31 18:45:04 +00:00
thorpej
5d537fa0b9 Need <string.h> for memset() and strcmp() prototypes (noticed by
gcc 3.1).
2001-12-31 18:38:32 +00:00
dbj
0057f73f87 save and restore sprg[0-3] when calling openfirmware
this fixes calling OF_finddevice() with invalid devices,
and as a result fixes booting with -d.
Apparently openfirmware expects persistence of sprg2 and/or sprg3
I suspect this is used when handling exceptions
2001-12-31 18:35:26 +00:00
thorpej
ffe66c84f5 Need <string.h> for strcmp() prototype (noticed by gcc 3.1). 2001-12-31 18:34:52 +00:00
thorpej
6c46adefc6 Labels must be followed by statements. 2001-12-31 18:31:59 +00:00
dbj
98cbceb382 handle have_address=TRUE 2001-12-31 18:29:07 +00:00
matt
873f33f78e Make the same change to icache/dcache size calculation as was done to ecache.
Fixes PR 12844.
2001-12-31 16:26:10 +00:00
augustss
cec9735688 Delay bus enumeration a little in case the controller is a companion
controller.  This way the main controller can gain ownership of the port
before enumeration starts.
2001-12-31 15:55:51 +00:00
augustss
d8e5a1dc07 Dump enpoint number instead of endpoint index. 2001-12-31 15:54:27 +00:00
lukem
1f5f54d132 add <sys/systm.h> (for libkern.h) now that -ffree-standing is in effect 2001-12-31 15:01:51 +00:00
uwe
0207013726 Now that sbus_bus_mmap was converted to do the proper address
translation, get rid of sbus_bus_addr.  Since sbus_bus_addr is used by
framebuffer drivers that are shared with sparc64 we cannot just change
the callers to use BUS_ADDR() w/out coordinating the change with
sparc64 that uses a different calling protocol, so stub our
sbus_bus_addr to just return BUS_ADDR.
2001-12-31 15:00:58 +00:00
blymn
64df79afe7 fix __startwin() so it outputs the init strings to the correct device. 2001-12-31 14:23:11 +00:00
blymn
4118c45610 * Fixed uninitialiased variable problem in newterm
* Implemented better fix for screen not clearing for refresh()
  when newterm used to start curses.
2001-12-31 14:16:01 +00:00
augustss
88da42185c Don't try to deactivate child if we have no bus yet. 2001-12-31 12:52:50 +00:00
augustss
0498c38d3d Whitespace fixes (from FreeBSD). 2001-12-31 12:37:13 +00:00
augustss
637dc4b2fe Change xfer abort to wait for the softintr to run. 2001-12-31 12:20:35 +00:00
augustss
096f451f64 Change abort slightly.
Change debug output.
2001-12-31 12:16:57 +00:00
augustss
f1397b7e37 Dump more of the command. 2001-12-31 12:15:46 +00:00
augustss
152efb1a0e Make a typedef for struct proc to make portingeasier. 2001-12-31 12:15:21 +00:00
augustss
d14e739b92 Don't allow setting the configuration when an endpoint is open. From
FreeBSD.
2001-12-31 11:56:37 +00:00
augustss
0a3269865e Only clear stall if endpoint is stalled. From FreeBSD. 2001-12-31 11:54:06 +00:00
mrg
e5fc1d934a clarify usage. idea from david obrien. 2001-12-31 09:44:04 +00:00
matt
0bc218f05c When determining ecache size, try using ecache-size. if it doesn't exist,
fallback to the old method (ecache-nlines * ecache-linesize).
2001-12-31 07:30:46 +00:00