Commit Graph

150475 Commits

Author SHA1 Message Date
Marcel Moolenaar
8d077f48f0 Reimplement the lazy FP context switching:
o   Move all code into a single file for easier maintenance.
o   Use a single global lock to avoid having to handle either
    multiple locks or race conditions.
o   Make sure to disable the high FP registers after saving
    or dropping them.
o   use msleep() to wait for the other CPU to save the high
    FP registers.

This change fixes the high FP inconsistency panics.

A single global lock typically serializes too much, which may
be noticable when a lot of threads use the high FP registers,
but in that case it's probably better to switch the high FP
context synchronuously. Put differently: cpu_switch() should
switch the high FP registers if the incoming and outgoing
threads both use the high FP registers.
2009-10-31 22:27:31 +00:00
Nathan Whitehorn
156ef7611e Unbreak cpu_switch(). The register allocator in my brain is clearly
broken. Also, Altivec context switching worked before only by accident,
but should work now by design.
2009-10-31 20:59:13 +00:00
Nathan Whitehorn
011db0bc81 Remove an unnecessary sync that crept in the last commit. 2009-10-31 18:04:34 +00:00
Nathan Whitehorn
e2cd4c2a65 Fix a race in casuword() exposed by csup. casuword() non-atomically read
the current value of its argument before atomically replacing it, which
could occasionally return the wrong value on an SMP system. This resulted
in user mutex operations hanging when using threaded applications.
2009-10-31 17:59:24 +00:00
Nathan Whitehorn
ad26477892 Loop on blocked threads when using ULE scheduler, removing an
XXX MP comment.
2009-10-31 17:55:48 +00:00
Nathan Whitehorn
2bbd567acb Garbage collect set_user_sr(), which is declared static inline and
never called.
2009-10-31 17:46:50 +00:00
Alan Cox
e4ed417a35 Correct an error in vm_fault_copy_entry() that has existed since the first
version of this file.  When a process forks, any wired pages are immediately
copied because copy-on-write is not supported for wired pages.  In other
words, the child process is given its own private copy of each wired page
from its parent's address space.  Unfortunately, to date, these copied pages
have been mapped into the child's address space with the wrong permissions,
typically VM_PROT_ALL.  This change corrects the permissions.

Reviewed by:	kib
2009-10-31 17:39:56 +00:00
Stefan Eßer
7bcfccda40 While certain supported Symbios/LSI SCSI chips (532c896, 53c1000, 53c1010)
do support 64bit addresses, the current SCRIPTS code supports only 32bit
addresses causing data corruption for buffer addresses >4GB. This problem
affects 64bit machines with more than 4GB RAM or amd64 with 4GB and
memory hole remapping.
Work-around this problem with a bus_dma tag that requests bounce-buffers
for addresses >4GB. This causes some overhead, but given the maximum SCSI
bus speed of 160MB/s compared, the effect should hardly be noticeable.
The problem was reported by Mike Watters (mike at mwatters net) who also
verified that this fix cures the problem.

Since this change is a NOOP on systems with less than 4GB RAM and fixes
data corruption (in RAM and on disk) on systems with more than 4GB, I hope
that this change is accepted for 8.0.

MFC after:	3 days (pending approval)
2009-10-31 17:06:36 +00:00
Alexander Motin
25dd82a35b Allow newly added controllers to use full I/O sizes. 2009-10-31 14:19:50 +00:00
Alexander Motin
ebbb35ba70 MFp4:
- Remove most of direct relations between ATA(4) peripherial and controller
levels. It makes logic more transparent and is a mandatory step to wrap
ATA(4) controller level into ATA-native CAM SIM.
- Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger
I/O transaction sizes without additional cost.
2009-10-31 13:24:14 +00:00
Christian Brueffer
a65653d16a The majors file was removed long ago, 0 should be used instead.
PR:		139230
Submitted by:	pluknet <pluknet@gmail.com>
MFC after:	1 week
2009-10-31 12:22:23 +00:00
Alexander Motin
7f8fbd60d4 MFp4:
Sync connection speed reporting with kernel.
Report speed in identify command, same as done by inquiry.
2009-10-31 10:47:47 +00:00
Alexander Motin
1e637ba677 MFp4:
- Reduce code duplication in ATA XPT and PMP driver.
- Move PIO size setting from ada driver to ATA XPT. It is XPT business
to negotiate transfer details. ada driver is now stateless.
- Report PIO size to SIM. It is required for correct PATA SIM operation.
- Tune PMP scan timings. It workarounds some problems with SiI.
- If reset hapens during PMP initialization - restart it.
- Introduce early-initialized periph drivers, which are used during initial
scan process. Use it for xpt, probe, aprobe and pmp. It gives pmp chance
to finish scan before mountroot and numerate devices in right order.
2009-10-31 10:43:38 +00:00
Ed Schouten
4c88ba2d70 Unobfuscate unit number handling in apm(4).
There is no need to use the lower 4 bits of the unit number to store the
device type number. Just use 0 and 1 to distinguish them. devfs also
guarantees that there can never be an open call on a device that has a
unit number different to 0 and 1, so there is no need to check for this
in open().
2009-10-31 10:38:30 +00:00
Ed Schouten
2d2a89dd2d Turn unused structure fields of cdevsw into spares.
d_uid, d_gid and d_mode are unused, because permissions are stored in
cdevpriv nowadays. d_kind doesn't seem to be used at all. We no longer
keep a list of cdevsw's, so d_list is also unused.

uid_t and gid_t are 32 bits, but mode_t is 16 bits, Because of alignment
constraints of d_kind, we can safely turn it into three 32-bit integers.
d_kind and d_list is equal in size to three pointers.

Discussed with:	kib
2009-10-31 10:35:41 +00:00
Alexander Motin
d521940e9a MFp4:
Ensure target/lun passed from user-level supported on this bus.
Scanning unsupported IDs causes different issues from duplicate
devices to system crash.
2009-10-31 09:03:48 +00:00
Pawel Jakub Dawidek
fd66267ffb - zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call
zfs_access() instead of vaccess() in this case as well.
- If VADMIN is specified with another V* flag (unlikely) call both
  zfs_access() and vaccess() after spliting V* flags.

This fixes "dirtying snapshot!" panic.

PR:		kern/139806
Reported by:	Carl Chave <carl@chave.us>
In co-operation with:	jh
MFC after:	3 days
2009-10-30 23:33:06 +00:00
Kirk McKusick
4145bb53bf When reading input from a file or device (via -f option) set the
input to be in non-buffering mode so that input lines are logged
as they occur rather than being saved up until a buffer's worth of
input has been logged.
2009-10-30 21:54:53 +00:00
Alexander Motin
6aca3a5d0b Add support for different request block format used by Gen-IIe Marvell SATA.
This adds support for Marvell 6042/7042 chips and Adaptec 1430SA controller.
2009-10-30 20:28:49 +00:00
Robert Noland
d2217702c1 Fix botched git -> svn merge.
MFC after:	2 weeks
2009-10-30 18:30:13 +00:00
Robert Noland
11de9e8c79 Cleanup in r600_blit
- Don't bother to assign vb until we know we have enough space
 - Add variables for sx2, sy2, dx2, dy2 so that these aren't
   calculated over and over, also reduce chance of errors.
 - Use switch to assign color/format

MFC after:	3 days
2009-10-30 18:08:46 +00:00
Robert Noland
29e3ffd4f5 A bit of cleanup work on radeon_freelist_get()
* Fix the main loop to search all buffers before sleeping.
  * Remove dead code

MFC after:	3 days
2009-10-30 18:07:22 +00:00
Robert Noland
615fb6e9bc Some general cleanup of scatter/gather memory allocation
- We don't need to check malloc return values with M_WAITOK
 - remove variables that we don't really need
 - cleanup the error paths by just calling drm_sg_cleanup()
 - fix drm_sg_cleanup() to be safe to call at any time

MFC after:	2 weeks
2009-10-30 18:02:10 +00:00
Robert Noland
6d68455174 Use system specified memory barriers rather than rolling our own. 2009-10-30 16:59:58 +00:00
Robert Noland
883759335f Fix blitter support for RS880 chips
MFC after:	3 days
2009-10-30 16:55:31 +00:00
Christian Brueffer
a452248814 Add support for Adaptec 39320LPE adapters.
PR:		124202
Submitted by:	Andre Albsmeier <Andre.Albsmeier@siemens.com>
Reviewed by:	gibbs
MFC after:	1 week
2009-10-30 16:23:56 +00:00
Nathan Whitehorn
ff301ae2af Make procstat -k work on PowerPC by avoiding mistakenly using signed
compares with a low address (0x1000) and a high address
(the KVA kernel stack).
2009-10-30 16:00:34 +00:00
Colin Percival
2bc706c648 Add notes pointing out that bsdiff does not store file hashes and
bspatch thus does not verify file hashes, and that consequently it
is recommended that users store hashes separately and verify files
before and after running bspatch.

Requested by:	BugMagnet
MFC after:	1 week
2009-10-30 11:13:00 +00:00
Konstantin Belousov
80a8b0f3bf Trapsignal() and postsig() call kern_sigprocmask() with both process
lock and curproc->p_sigacts->ps_mtx. Reschedule_signals may need to have
ps_mtx locked to decide and wakeup a thread, causing recursion on the
mutex.

Inform kern_sigprocmask() and reschedule_signals() about lock state
of the ps_mtx by new flag SIGPROCMASK_PS_LOCKED to avoid recursion.

Reported and tested by:	keramida
MFC after:	1 month
2009-10-30 10:10:39 +00:00
Alexander Motin
6bd41d5bc2 Add missing ATA kernel options dependencies.
MFC after:	3 days
2009-10-29 20:53:26 +00:00
John Baldwin
62ec4c19c4 - Numerous whitespace and style fixes.
- More descriptive error messages when failing to parse components during
  attach.
2009-10-29 18:03:16 +00:00
Michael Tuexen
08abf6399a Improve round robin stream scheduler and cleanup some code.
Approved by: rrs (mentor)
MFC after: 3 days
2009-10-29 17:40:33 +00:00
John Baldwin
f786e2f82e When fetching sum stats (vmstat -s) from a crash dump, fetch per-CPU counts
and sum them to form the total counts.

PR:		bin/135893
Submitted by:	Mikolaj Golub  to my trociny of gmail
MFC after:	1 week
2009-10-29 17:34:02 +00:00
Ed Maste
8e43cc231b Add additional featuresState.fBits entries to simplify compiling and
testing Adaptec's vendor driver.

Submitted by:	Adaptec, driver 17517
2009-10-29 17:21:41 +00:00
Ed Maste
c89d07b9f5 Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver. 2009-10-29 17:14:18 +00:00
Christian Brueffer
6652a11014 Revert part of r198363, there is no "device cam", it is
included in "device scbus".

MFC after:	3 days
2009-10-29 15:59:27 +00:00
Ed Maste
e46b9eeada Rename aac_fast_intr to aac_filter to reflect its current use. Eliminate
the fallback of using the filter as an interrupt handler, as it is no
longer needed.

Discussed with:	scottl, jhb
2009-10-29 14:53:45 +00:00
Konstantin Belousov
8084540253 Trapsignal() calls kern_sigprocmask() when delivering catched signal
with proc lock held.

Reported and tested by:	Mykola Dzham  freebsd at levsha org ua
MFC after:	1 month
2009-10-29 14:34:24 +00:00
Nathan Whitehorn
d8cd25d022 Turn off Altivec data-stream prefetching before going into power-save
mode on those CPUs that need it.
2009-10-29 14:22:09 +00:00
Alexander Motin
21a2ac1953 Define identify fields described in CF specification. 2009-10-29 13:52:34 +00:00
John Baldwin
c5229b9d2b Include the output of the ddb(4) capture buffer.
Submitted by:	Mikolaj Golub  to my trociny of gmail
MFC after:	3 days
2009-10-29 13:45:33 +00:00
John Baldwin
742765c971 When extracting the capture buffer from a crashdump, only read the valid
portion of the capture buffer (db_capture_bufoff vs db_capture_bufsize).
This could result in outputting garbage (e.g. lots of 'p' characters if
DIAGNOSTIC is enabled) after the end of the capture buffer.  While here,
fix a spelling nit.

Reported by:	Mikolaj Golub  to my trociny of gmail
MFC after:	3 days
2009-10-29 13:44:58 +00:00
Nathan Whitehorn
e5310f3310 Add some magic taken from OS X and Linux to support early revision K2
SATA controllers, like those found on the G5 Xserve.

Reviewed by:	mav
2009-10-29 13:28:37 +00:00
Nathan Whitehorn
f3755df16d Turn off use of ATA_A_4BIT on modern hardware. This flag was already
obsoleted in 1996 by ATA-2, and crashes some modern hardware like some
revisions of the Serverworks K2 SATA controller. Even very ancient
hardware seems not to require it. In the unlikely event this causes
problems, the previous behavior can be re-enabled by defining
ATA_LEGACY_SUPPORT at the top of this file.

Reviewed by:	Alexander Motin <mav@freebsd.org>
2009-10-29 13:27:14 +00:00
Rui Paulo
71a7750434 Update the route's sequence number upon receiving a RANN.
MFC after:	3 days
2009-10-29 12:19:10 +00:00
Konstantin Belousov
7415a41f4a Fix style issue. 2009-10-29 10:03:08 +00:00
Ruslan Ermilov
f7e95633c6 Update some comments regarding ktr(4). 2009-10-29 09:51:13 +00:00
Ruslan Ermilov
9589412053 Back in 2003, get_cyclecount() was changed to use binuptime() instead
of nanotime().  Reflect this change in a manpage.

Reviewed by:	phk, markm
2009-10-29 09:45:05 +00:00
Ruslan Ermilov
052e971d25 HZ is now 1000 on most platforms, update a comment.
Reviewed by:	phk, markm
2009-10-29 09:27:09 +00:00
John Baldwin
f12c034874 Fix some problems with effective mmap() offsets > 32 bits. This was
partially fixed on amd64 earlier.  Rather than forcing linux_mmap_common()
to use a 32-bit offset, have it accept a 64-bit file offset.  This offset
is then passed to the real mmap() call.  Rather than inventing a structure
to hold the normal linux_mmap args that has a 64-bit offset, just pass
each of the arguments individually to linux_mmap_common() since that more
closes matches the existing style of various kern_foo() functions.

Submitted by:	Christian Zander @ Nvidia
MFC after:	1 week
2009-10-28 20:17:54 +00:00