Don't (ab)use uvm_map_pageable() to allocate PT pages. Instead, do
some internal reference counting on PT pages. We still allocate them
with the page fault routine (a wire-fault, now), but no longer free
PT pages from pmap_pageable().
Anyway, just because a drive doesn't support the LOAD (to BOT) command does
not mean that the drive doesn't support the UNLOAD command. Also note and
print errors in rewinds and unloads (and errors in writing closing filemarks
for same).
allocation strategy no longer works at all. Move pmap.new.* to pmap.*.
To read the revision history of PMAP_NEW up until this merge, use cvs
rlog of the old pmap.new.* files.
allocation strategy no longer works at all. Move pmap.new.* to pmap.*.
To read the revision history of PMAP_NEW up until this merge, use cvs
rlog of the old pmap.new.* files.
pmap_change_wiring(...,FALSE) unless the map entry claims the address
is unwired. This fixes the following scenario, as described on
tech-kern@netbsd.org on Wed 6/16/1999 12:25:23:
- User mlock(2)'s a buffer, to guarantee it will never become
non-resident while he is using it.
- User then does physio to that buffer. Physio calls uvm_vslock()
to lock down the pages and ensure that page faults do not happen
while the I/O is in progress (possibly in interrupt context).
- Physio does the I/O.
- Physio calls uvm_vsunlock(). This calls uvm_fault_unwire().
>>> HERE IS WHERE THE PROBLEM OCCURS <<<
uvm_fault_unwire() calls pmap_change_wiring(..., FALSE),
which now gives the pmap free reign to recycle the mapping
information for that page, which is illegal; the mapping is
still wired (due to the mlock(2)), but now access of the
page could cause a non-protection page fault (disallowed).
NOTE: This could eventually lead to a panic when the user
subsequently munlock(2)'s the buffer and the mapping info
has been recycled for use by another mapping!
the map be at least read-locked to call this function. This requirement
will be taken advantage of in a future commit.
* Write a uvm_fault_unwire() wrapper which read-locks the map and calls
uvm_fault_unwire_locked().
* Update the comments describing the locking contraints of uvm_fault_wire()
and uvm_fault_unwire().
semantics. That is, regardless of the number of mlock/mlockall calls,
an munlock/munlockall actually unlocks the region (i.e. sets wiring count
to 0).
Add a comment describing why uvm_map_pageable() should not be used for
transient page wirings (e.g. for physio) -- note, it's currently only
(ab)used in this way by a few pieces of code which are known to be
broken, i.e. the Amiga and Atari pmaps, and i386 and pc532 if PMAP_NEW is
not used. The i386 GDT code uses uvm_map_pageable(), but in a safe
way, and could be trivially converted to use uvm_fault_wire() instead.
* Provide POSIX 1003.1b mlockall(2) and munlockall(2) system calls.
MCL_CURRENT is presently implemented. MCL_FUTURE is not fully
implemented. Also, the same one-unlock-for-every-lock caveat
currently applies here as it does to mlock(2). This will be
addressed in a future commit.
* Provide the mincore(2) system call, with the same semantics as
Solaris.
* Clean up the error recovery in uvm_map_pageable().
* Fix a bug where a process would hang if attempting to mlock a
zero-fill region where none of the pages in that region are resident.
[ This fix has been submitted for inclusion in 1.4.1 ]
a bug in fragment extension that could run the count negative. Also, don't
overcount for inodes, and don't count segment summaries. Thus, for empty
segments the live bytes count should now be exactly zero.
some internal reference counting on PT pages. We still allocate them
with the page fault routine (a wire-fault, now), but no longer free
PT pages from pmap_pageable().
is unused in our USB stack.
Once upon a time, when I started writing the USB stack for NetBSD, there
was an effort to make a standard for how USB device drivers should interact
with the rest of the USB stack. This effort had contributors from just
about all Un*x camps (but not Micro$oft :). I based my design on one of their
early proposals since I thought it would be a good idea if we could all
share device drivers with a minimum effort. Shortly after I started my work
all the free Un*x people were thrown out of the USBDI work since we did not
pay the USB membership fee. Well, some time has passed now and the work of
the standardization group is almost public again. But alas, the new standard
has grown to be a monster! I do not want to have this as the basis for the
*BSD USB stack; it is far too complicated.
So, since we are not even close to being compilant with the standard, I've
thrown out some old baggage.
is written. This significantly reduces, if not eliminates, the problem reported in
PR#5510. It stops the problem on my 5000/200, and two other people have verified that
it fixes the problem on their 5000/200s. I'm waiting for confirmation from the PR
originator before closing the PR.
Should fix part of console keyboard problems on macppc. The usb keyboard will
now work on boot! Doesn't fix problems with keyboard freaking out when
changing LED state.
Thanks to Mattias & Lennart & Tsubai for input on resolving this problem.
thing in both the calibrator function and the actual delay function. At
this point, _delay() does all of the work, so we can garbage collect
dummy_delay() and make _delay() an alternate entry point for delay().
This results in a small (but measurable) improvement on the IIci.
be instead of hardcoding values.
+ Print the host SCSI ID in siiattach().
XXX - probably should do the same to the ASC driver?? The manuals for
the 5000 series machines don't mention the scsiidN env variable, but it
is present on all the models I've looked at...
+ Add prom_scsiid() to read and decode the prom scsiidN environment
variable that says what the host SCSI id should be.
+ Include <pmax/pmax/machdep.h> instead of declaring our own
prom_*() prototypes.
the process (i.e. pre-Reno behavior). The 4.4BSD behavior (introduced
in Reno) caused transient errors to stick incorrectly.
This is from PR #7640 (Havard Eidnes), cross-checked w/ FreeBSD, where
Bill Fenner committed the same fix (as described in a comment in the
Vat sources, by Van Jacobsen).
either endian. Not a perfect solution which would be revealed on
a certain condition when va_arg() is applied to magical struct
arguments passed by value. format_bytes() is now saved. With the
help from Noriyuki Soda and Masanari Tsubai.
bus. Without this, cbiiisc used to hang if nothing was connected.
Reported by Matthias Scheler. A similar method to avoid this was suggested
by Ralph Schmidt.
Remove the entire idea of fasttrap interrupts since V9 traps are really cheap,
the CPUs are really fast, and the completely different trap frames would make
these handlers really difficult to implement.
pmap_changeprot() was only used by the clock and one other place; deprecate it.
probeget() and probeset() now take 64-bit addresses even in 32-bit mode so we
can probe IO locations by physical addresses.
Some pmap cleanup.
Some more copyright cleanup.
Connectivity Products:
ABP510/5150 - Bus-Master ISA (240 CDB) (Footnote 1)
ABP5140 - Bus-Master ISA (16 CDB) (Footnote 1) (Footnote 2)
ABP5142 - Bus-Master ISA with floppy (16 CDB) (Footnote 3)
Single Channel Products:
ABP542 - Bus-Master ISA with floppy (240 CDB)
Footnotes:
1. This board has been shipped by HP with the 4020i CD-R drive.
The board has no BIOS so it cannot control a boot device, but
it can control any secondary SCSI device.
2. This board has been sold by SIIG as the i540 SpeedMaster.
3. This board has been sold by SIIG as the i542 SpeedMaster.
the arguments are changed so the address is first and the ASI second so we
can have the address in %o0:%o1 and not worry about unused registers.
Also a bit of copyright cleanup.
non-cached. XXX clean this up by looking at the "non-cacheable" bit of
the full physical address.
avoid having 'nbuf' change between calls to `mdallocsys()' by setting it
in mdallocsys() like the MI allocsys() does. XXX fix this too!
fix some printf lossage.
update for probeget() changes -- though bus_space_probe() appears to be
unused on the sparc64.
looking up a kernel address, check to see if the address is on this
"interrupt-safe" list. If so, return failure immediately. This prevents
a locking screw if a page fault is taken on an interrupt-safe map in or
out of interrupt context.
device declaration, we don't want it). pull in psycho, pci,
ata and pciide code. clock, eeprom and power attach at sbus
*and* ebus now (clock as `eeprom' works). add `lpt at ebus',
wd major number, and other misc. commented devices.
looking up a kernel address, check to see if the address is on this
"interrupt-safe" list. If so, return failure immediately. This prevents
a locking screw if a page fault is taken on an interrupt-safe map in or
out of interrupt context.
before the elimination of typematic events.
This fixes the case where the "extended" prefix was not ignored and
affected the next keystroke. (seen with the AltGr key)
(`SUNW,sabre') for now, and it doesn't really quite work there yet anyway.
the bus space/dma code is cloned from the sbus driver. the IOMMU code also
is cloned from the sbus code, but separated out into iommu.c so that we can
share it with the sbus driver. hopefully, much of the bus space/dma code
can also be re-shared with the sbus driver and the ebus driver but for now
these copies will do.
support for the real UltraSPARC PCI (`SUNW,psycho') is unwritten, though
most of this code is shared with it.
we can probe PCI config space and try to configue devices, but interrupts
don't work yet...
the bus space/dma code is cloned from the PCI code to do the same thing
which itself was cloned from the sbus bus space/dma code. the bus dma
code is non-functional at this point.
component failures! Also: remember to configure the disk queues for
the spares -- failure to do that is Bad(tm).
Huge Thanks to Martin Laubach for helping track this down.
setting recursive has no effect! The kernel lock manager doesn't allow
an exclusive recursion into a shared lock. This situation must simply
be avoided. The only place where this might be a problem is the (ab)use
of uvm_map_pageable() in the Utah-derived pmaps for m68k (they should
either toss the iffy scheme they use completely, or use something like
uvm_fault_wire()).
In addition, once we have looped over uvm_fault_wire(), only upgrade to
an exclusive (write) lock if we need to modify the map again (i.e.
wiring a page failed).
don't unlock a kernel map (!!!) and then relock it later; a recursive lock,
as it used in the user map case, is fine. Also, don't change map entries
while only holding a read lock on the map. Instead, if we fail to wire
a page, clear recursive locking, and upgrade back to a write lock before
dropping the wiring count on the remaining map entries.
bytes/sector correctly.
Submitted by Detlev Würkner in PR 7653.
Non-trivial merge with the 1.30 change (handle old AmigaDOS fs partitions
with simulated sectorsperblock > 1) by myself, so don't blame Detlev if it
doesn't work (but I checked!).
XXX We still need changes to the file systems to handle this fully.
at levels 5 (sound) and 6 (via1) on the Q700.
Raise splhigh when reading and writing registers. It's ugly, but it's
possible that we could get an interrupt from a higher-level source,
causing a re-read of a memory location.
This is not good when, e.g., we are reading the interrupt register.
Ideally, we would just raise splhigh() in ncr53c9x_readregs(), but
that's m.i. code, and it may be expensive on other architectures.
will DTRT with vnodes marked VDIROP. In particular, the message
"flushing VDIROP" will no longer appear, and the filesystem will remain
stable in the event of a crash.
This was particularly a problem with NFS-exported LFSes, since fsync
was called on every file close.
I've fixed most (not all) m68k FPE bugs that give bogus
calculation results, esp. fsqrt instruction. Also, the internal FP
representation has been reduced from 115-bit mantissa to 67-bit
mantissa which reduced the required mantissa operation roughly by one
fourth. I've done an extensive (though not exhaustive - it's
impossible!) test on the internal routines by feeding them randomly
generated FP numbers, and found that the new code is more precise than
MC68040 FPU (it seems to have a rounding bug).
[ Only change was to keep fpu_calcea.c's name instead of renaming to
fpu_ea.c in Ken's patch. --akb ]
instead of ldstub, but since we aren't doing n-way locking it makes little
difference. N.B. Need to decide what to do with sparc64/sparc64/asm.h which
has name conflicts with sparc64/include/asm.h. So far most of
sparc64/sparc64/asm.h has been moved to ctlreg.h.
after various m_adj()s have been done. Kludge around this with a cheesy
macro that knows where the drivers put the mac header in the first mbuf.
XXX There should be a better way to do this.
is a muting control, not a level control, change the name to reflect that.
XXX The fact that the audio code depends on the string names of the
XXX mixer devices is bogus.
(1) Fix sense of a strcmp() test so that the monitor subdevice of the
mixer is properly identified.
(2) Use hw_if->set_port() instead of hw_if->get_port() when changinh
the monitor level in audiosetinfo().
Fixes PR kern/7661.
TLBUpdate() routine is used for dual purposes. In TLBmod case, just ok
to call 'tlbwi' (as designed). Result in saving of extraneous execution
path. MIPS1 only this moment.
locks (and thus, never shared locks). Move the "set/clear recursive"
functions to uvm_map.c, which is the only placed they're used (and
they should go away anyhow). Delete some unused cruft.
right access_type to pass to uvm_fault_wire(). This way, if the entry has
VM_PROT_WRITE, and the entry is marked COW, the copy will happen immediately
in uvm_fault(), as if the access were performed.
access_type to pmap_enter() to ensure that when these mappings are accessed,
possibly in interrupt context, that they won't cause mod/ref emulation
page faults.
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.
ensure we don't take mod/ref emulation faults in an interrupt context
(e.g. during the i/o operation). This is safe because:
- For a pageout operation, the page is already known to be
modified, and the pagedaemon will pmap_clear_modify() after
the pageout has completed.
- For a pagein operation, pagers must already pmap_clear_modify()
after the pagein operation is complete, because the i/o may have
been done with e.g. programmed i/o.
XXX It would be nice to know the i/o direction so that we can call
XXX pmap_enter() with only the protection and access_type necessary.
vslocking here?! copyout() on its own seems to suffice just about everwhere
else, and it's not like the process is going to exit; it's in a system
call!
to uvm_fault_wire(), to guarantee that the kernel stacks will not
cause even a mod/ref emulation fault.
- uvm_vslock(): pass VM_PROT_NONE until this function is updated.
managed pages, into KVA space. Since the pages are managed, we should
use pmap_enter(), not pmap_kenter_pa().
Also, when entering the mappings, enter with an access_type of
VM_PROT_READ | VM_PROT_WRITE. We do this for a couple of reasons:
(1) On systems that have H/W mod/ref attributes, the hardware
may not be able to track mod/ref done by a bus master.
(2) On systems that have to do mod/ref emulation, this prevents
a mod/ref page fault from potentially happening while in an
interrupt context, which can be problematic.
This latter change is fairly important if we ever want to be able to
transfer DMA-safe memory pages to anonymous memory objects; we will need
to know that the pages are modified, or else data could be lost!
Note that while the pages are unowned (i.e. "just DMA-safe memory pages"),
they won't consume any swap resources, as the mappings are wired, and
the pages aren't on the active or inactive queues.
which can be used in an interrupt context. Use pmap_kenter*() and
pmap_kremove() only for mappings owned by these objects.
Fixes some locking protocol issues related to MP support, and eliminates
all of the pmap_enter vs. pmap_kremove inconsistencies.
routines now reside in locore.S. No functional difference is expected.
- Replace abused splx() abuse with _splset() to change MIPS processor
interrupt mask bit. 'mips/trap.c' side will be fixed soon.
are still owned by the object which is paging, and so the test for a kernel
object in uvm_unmap_remove() will cause pmap_remove() to be used instead
of pmap_kremove().
This was a MAJOR source of pmap_remove() vs pmap_kremove() inconsistency
(which caused the busted kernel pmap statistics, and a cause of much
locking hair on MP systems).