Commit Graph

68321 Commits

Author SHA1 Message Date
Marius Strobl
bdebc2daa5 Announce the speed of the PCI bus for informational purpose.
MFC after:	3 days
2008-08-24 16:22:04 +00:00
Ed Schouten
dd63e2a189 Make sysmouse(4) use its own locks, instead of using Giant.
When I changed syscons(4) to work with the MPSAFE TTY code, I just
locked all device nodes down using the compatibility feature that allows
you to override the TTY's lock (Giant in this case). Upon closer
inspection, it seems sysmouse(4) only has two internal variables that
need locking: mouse_level and mouse_status.

I haven't done any performance benchmarks on this, though I think it
won't have any dramatic improvements on the system. It is good to get
rid of Giant here, because the third argument of tty_alloc() has only
been added to ease migration to MPSAFE TTY. It should not be used when
not needed.

While there, remove SC_MOUSE, which is a leftover from the MPSAFE TTY
import.
2008-08-24 15:20:44 +00:00
Marius Strobl
c87ba3b18c The PCI specifications don't explain the details on how to calculate
the latency based on the Min_Gnt register so use the algorithm found
in OpenSolaris as they probably know how to interpret the value Sun
puts into these registers (previously, the latency calculated for
66MHz was most likely wrong) and for bridges additionally set up the
secondary latency register. Also set up the bridge control register
the way it's done in OpenSolaris. As the latency register don't apply
to PCI-Express and the bridge control setup wasn't tested on sun4v
(besides most likely not being needed), expand the #ifndef SUN4V
accordingly.

MFC after:	3 days
2008-08-24 15:05:46 +00:00
Bjoern A. Zeeb
f0c042211b Make the checks for ptp interfaces in ifa_ifwithdstaddr() and
ifa_ifwithnet() look more similar by comparing the pointer to NULL
in both cases.

MFC after:	3 months
2008-08-24 11:03:43 +00:00
Warner Losh
5b4ae40039 MFp4 (my newcard tree):
ISACFGATTR_MULTI is unused.  Retire it, and a function that has no
side effects used to compute it.
2008-08-24 07:40:14 +00:00
Kip Macy
2be5c100cf Evidently the block device starts at 767.
MFC after:	1 month
2008-08-24 04:42:41 +00:00
Christian S.J. Peron
db8502672e Use sbuf_putc instead of sbuf_cat. This makes more sense, since we are
appending a single character to the buffer.

MFC after:	2 weeks
2008-08-24 03:12:17 +00:00
Kip Macy
4570959392 Don't calculate checksum if it has already been validated
Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-08-24 02:31:09 +00:00
Warner Losh
4b8e067a75 Some PC Card variants of the 82365 don't seem to like setting the IRQ
number in the irq register.  While there are other issues with these
variants, avoiding writing to it helps interrupt generation on at
least one card, and doesn't hurt on the others.  Flag ISA attachment
as needing INT_NO_REG written, and don't update the PC Card attachment
(which will have the effect of not touching it for PC Cards).

Document this in a comment, and tweak one or two formatting nits while
I'm here.
2008-08-24 00:22:42 +00:00
Warner Losh
c3a27a2cf5 White space nit. 2008-08-23 23:44:45 +00:00
Warner Losh
5f00fec406 Whitespace nit. 2008-08-23 23:35:08 +00:00
Warner Losh
e04ca6236a Fix style nit: s/^ }/}/ in two places. 2008-08-23 23:30:54 +00:00
Warner Losh
be63007e99 Style nit: s/^ }/}/ 2008-08-23 23:28:33 +00:00
Kip Macy
5ce36d5254 make block devices start at 0 2008-08-23 21:30:08 +00:00
John Baldwin
aa7c1c059f Add a very simple dpms(4) driver that uses the VESA BIOS DPMS calls to
turn off the external display during suspend and restore it to its
original state on resume.

MFC after:	2 weeks
2008-08-23 21:00:40 +00:00
Robert Noland
a2a2d95441 Update drm kernel drivers.
This is a sync to mesa/drm pre-gem, with a few fixes on top of that.
It also contains one local patch supplied by kib@ that I can't apply to
git.master shared code.

Approved by:	flz
Obtained from:	mesa/drm git.master
MFC after:	2 weeks
2008-08-23 20:59:12 +00:00
Marius Strobl
993a741ac6 - Use m_collapse(9) instead of m_defrag(9) if possible. This results
in a noticeable reduction in system time spent.
- If bus_dmamap_load_mbuf_sg(9) fails with EFBIG and we already have
  defragmented the mbuf chain, don't bother to defragment and load it
  a second time just yet as it's likely to fail again anyway.

MFC after:	3 days
2008-08-23 20:57:48 +00:00
Marius Strobl
6adb632eeb Update the comment regarding the workaround for the BlackBird
TICK_COMPARE bug and the instruction alignment used for it based
on information found in the OpenSolaris source.

MFC after:	3 days
2008-08-23 20:53:27 +00:00
Warner Losh
a4e1d2d2cf Make sure that we handle errors in device_get_children correctly. 2008-08-23 18:27:10 +00:00
Warner Losh
25ee8cca07 Handle the error case properly for device_get_children. 2008-08-23 18:22:49 +00:00
Warner Losh
099ea4b570 Handle errors from device_get_children. 2008-08-23 16:38:20 +00:00
Marius Strobl
47c657e929 - Provide and consume module dependency information.
- Fix whitespace bugs.

MFC after:	3 days
2008-08-23 16:07:20 +00:00
Ed Schouten
1a643b0f02 Allow the user to suppress the rate-limited pty(4) warning.
The pty(4) driver raises up to warnings when an old BSD-style PTY is
created. The reason why I added this warning, was to make it easier to
spot applications that allocate BSD-style PTY's, while they should just
use openpty() or posix_openpt().

Add a sysctl, which allows you to override the number of remaining
messages, making it possible to suppress the warnings.

Requested by:	kib
Reviewed by:	kib
2008-08-23 16:03:00 +00:00
Warner Losh
d444cd5f28 When device_get_children returns an error, ignore that bus' children. 2008-08-23 15:57:43 +00:00
Warner Losh
60e984e137 Move the code that looks for the companion phy to a subroutine to make
sure we get the error handling right in both places.  This also
simplifies the code somewhat.
2008-08-23 15:50:18 +00:00
Marius Strobl
ceb21176c2 - Removed unused sc_node.
- Provide module dependency information.
- Static'ize ebus_release_resource() in order to match prototype.
- Remove outdated and/or obsolete comments.
- Fix whitespace bugs.

MFC after:	3 days
2008-08-23 15:44:13 +00:00
Warner Losh
3106346290 There actually were bugs in the original handling that I missed last
night.

Free the children after each pci bus that is searched.  Otherwise we
leak them.  With free in the new place, we also have to free children
before going to done when we find the device we're looking for.

Also, if we can't get the children of a device, just ignore that bus.
2008-08-23 15:34:31 +00:00
Warner Losh
373444e7a1 It turns out that my analysis of the error handling here was wrong.
When there's an error, we don't want to free the children, since it
will be stack garbage.  While we did fail to dereference it by setting
devs to 0, we didn't fail to call free.  We never failed to fail, it
was the easiest thing to do.
2008-08-23 15:29:28 +00:00
Robert Watson
6356dba0b4 Introduce two related changes to the TrustedBSD MAC Framework:
(1) Abstract interpreter vnode labeling in execve(2) and mac_execve(2)
    so that the general exec code isn't aware of the details of
    allocating, copying, and freeing labels, rather, simply passes in
    a void pointer to start and stop functions that will be used by
    the framework.  This change will be MFC'd.

(2) Introduce a new flags field to the MAC_POLICY_SET(9) interface
    allowing policies to declare which types of objects require label
    allocation, initialization, and destruction, and define a set of
    flags covering various supported object types (MPC_OBJECT_PROC,
    MPC_OBJECT_VNODE, MPC_OBJECT_INPCB, ...).  This change reduces the
    overhead of compiling the MAC Framework into the kernel if policies
    aren't loaded, or if policies require labels on only a small number
    or even no object types.  Each time a policy is loaded or unloaded,
    we recalculate a mask of labeled object types across all policies
    present in the system.  Eliminate MAC_ALWAYS_LABEL_MBUF option as it
    is no longer required.

MFC after:	1 week ((1) only)
Reviewed by:	csjp
Obtained from:	TrustedBSD Project
Sponsored by:	Apple, Inc.
2008-08-23 15:26:36 +00:00
Marius Strobl
99448af81e Provide and consume module dependency information.
MFC after:	3 days
2008-08-23 15:20:33 +00:00
John Baldwin
969bf150df Fix a race condition with concurrent LOOKUP namecache operations for a vnode
not in the namecache when shared lookups are enabled (vfs.lookup_shared=1,
it is currently off by default) and the filesystem supports shared lookups
(e.g. NFS client).  Specifically, if multiple concurrent LOOKUPs both miss
in the name cache in parallel, each of the lookups may each end up adding an
entry to the namecache resulting in duplicate entries in the namecache
for the same pathname.  A subsequent removal of the mapping of that
pathname to that vnode (via remove or rename) would only evict one of the
entries from the name cache.  As a result, subseqent lookups for that
pathname would still return the old vnode.

This race was observed with shared lookups over NFS where a file was updated
by writing a new file out to a temporary file name and then renaming that
temporary file to the "real" file to effect atomic updates of a file.  Other
processes on the same client that were periodically reading the file would
occasionally receive an ESTALE error from open(2) because the VOP_GETATTR()
in nfs_open() would receive that error when given the stale vnode.

The fix here is to check for duplicates in cache_enter() and just return
if an entry for this same directory and leaf file name for this vnode is
already in the cache.  The check for duplicates is done by walking the
per-vnode list of name cache entries.  It is expected that this list should
be very small in the common case (usually 0 or 1 entries during a
cache_enter() since most files only have 1 "leaf" name).

Reviewed by:	ups, scottl
MFC after:	2 months
2008-08-23 15:13:39 +00:00
Marius Strobl
78d22f42a8 - Restore the behavior of enabling the MII buffer for an internal
PHY only and not also in the case of an external PHY currently
  doing full duplex, which accidentally got broken in r172334.
  It's still not clear to me why we need to enable the buffer for
  an internal PHY though.
- Count excess and late collisions as output errors. [1]
- Count receive errors as input errors. [1]

Obtained from:	NetBSD [1]
MFC after:	3 days
2008-08-23 15:03:26 +00:00
Robert Watson
cc10282298 When getaudit(2) is unable to fit the terminal IPv6 address into the
space provided by its argument structure, return EOVERFLOW instead of
E2BIG.  The latter is documented in Solaris's man page, but the
former is implemented.  In either case, the caller should use
getaudit_addr(2) to return the IPv6 address.

Submitted by:	sson
Obtained from:	Apple, Inc.
MFC after:	3 days
2008-08-23 14:39:01 +00:00
Marius Strobl
9888af9c4e Remove clkbrd(4) as a separate device and compile it solely based
on the presence of fhc(4) instead; we by far don't support all of
the functionality provide by the clock board but in general it's
an integral part of FireHose-based systems which shouldn't be
possible to omit.
2008-08-23 14:28:44 +00:00
Bjoern A. Zeeb
c06f087ccb Cache the cred locally in _syncache_add() while holding the locks, so
we can be sure that it's valid.
In case we abort early free it again else put it into the syncache.

We need the cred in the syncache to be able to restrict what will be
exportet by the sysctl helper function syncache_pcblist() (to netstat)
within jails.

PR:		kern/126493
Reviewed by:	rwatson (earlier versions)
MFC after:	3 days
2008-08-23 14:22:12 +00:00
Marius Strobl
3b7c344be4 - Add kbdmux(4); since sunkbd(4) was tought to emulate atkbd(4) like
ukbd(4) does and that emulation was enabled by default, all three of
  them work together with kbdmux(4) out of the box just fine.
- Fix some whitespace bugs.

MFC after:	3 days
2008-08-23 14:17:00 +00:00
Ed Schouten
ce570f82cc Remove unused tty_gone() checks inside ttyoutq_read_uio().
When my earlier MPSAFE TTY prototypes still implemented line
disciplines, we needed a mechanism to abort read()'s on PTY master
devices when inside the line discipline. Because this is no longer the
case, these checks have become unneeded.
2008-08-23 13:32:21 +00:00
John Baldwin
aa22af9438 If we are unable to obtain a frequency list from either ACPI or the static
tables, then attempt to build a simple list containing just the high and
low frequencies based on the current CPU frequency calculated during boot
and the contents of the MSR.

MFC after:	1 month
2008-08-23 12:53:42 +00:00
Antoine Brodin
2f2ea10a07 Remove unused variable nosleepwithlocks.
PR:		126609
Submitted by:	Mateusz Guzik
MFC after:	1 month
X-MFC:		to stable/7 only, this variable is still used in stable/6
2008-08-23 12:40:07 +00:00
John Baldwin
ad86a65e32 Adjust the handling the various timer frequencies when using the lapic
timer.  Previously, the various divisors were fixed which meant that while
it gave somewhat reasonable stathz, etc. at hz=1000, it went off the rails
with any other hz value.  With these changes, we now pick a lapic timer hz
based on the value of hz.  If hz is >= 1500, then the lapic timer runs at
hz.  If 1500 hz >= 750, we run the lapic timer at hz * 2.  If hz < 750, we
run at hz * 4.  We compute a divider at runtime to make stathz run as close
to 128 as we can since stathz really wants to be run at something close to
that frequency.  Profiling just runs on every clock tick.  So some examples:

With hz = 100, the lapic timer now runs at 400 instead of 2000.  stathz
will be 133, and profhz = 400.  With hz = 1000 (default), the lapic timer
is still at 2000 (as it is now), stathz is at 133 (as it is now), and
profhz will be 2000 (previously 666).

MFC after:	2 weeks
2008-08-23 12:35:43 +00:00
Bjoern A. Zeeb
bb580846dc Add an explicit comment why we NULLify the two variables.
Reviewed by:	rwatson
MFC after:	3 days
2008-08-23 12:27:18 +00:00
Warner Losh
195c96b714 Revert bogusly committed file. 2008-08-23 07:46:58 +00:00
Warner Losh
e1bd4ee68b Set devs to 0 in case device_get_children return an error. The right thing
to do here is nothing in that case...
2008-08-23 07:46:20 +00:00
Warner Losh
83bda63e3e Actually revert last... Upon closer inspection the code works in the
face of errors already...  A bit unorthodox, but none-the-less valid.
2008-08-23 07:43:03 +00:00
Warner Losh
b52943f026 Handle errors in device_get_children gracefully. 2008-08-23 07:41:21 +00:00
Warner Losh
da02572e7f Handle errors from device_get_chidlren.
Free child list when there's more children than we expected.
2008-08-23 07:38:00 +00:00
Warner Losh
696771ee0a Cope with errors from device_get_children(). These errors can happen
only in low memory situations, so the error fork of these fixes is
lightly tested, but they should do the least-wrong thing...

Submitted by:	Hans Petter Selasky
2008-08-23 07:23:52 +00:00
Warner Losh
de5d443f0f Cosmetic nit. 2008-08-23 07:18:30 +00:00
Warner Losh
e6b3a7a9c1 Add MIPS support.
Reviewed by:	jb@
2008-08-23 04:58:11 +00:00
Nathan Whitehorn
f620b5bf45 Allow the MD UMA allocator to use VM routines like kmem_*(). Existing code requires MD allocator to be available early in the boot process, before the VM is fully available. This defines a new VM define (UMA_MD_SMALL_ALLOC_NEEDS_VM) that allows an MD UMA small allocator to become available at the same time as the default UMA allocator.
Approved by:	marcel (mentor)
2008-08-23 01:35:36 +00:00