]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoSend the magic unlock packet the linux driver claims to have sniffed
imp [Mon, 25 Aug 2008 02:42:13 +0000 (02:42 +0000)]
Send the magic unlock packet the linux driver claims to have sniffed
to enable line control.

PR: 121184
Submitted by: Andriy Gapon

16 years agoNote that most Windows CE phones are supported by this driver.
imp [Mon, 25 Aug 2008 02:38:28 +0000 (02:38 +0000)]
Note that most Windows CE phones are supported by this driver.

# It would be nice if we had a good way to generate this list from the driver
# list itself, since there's now over 400 listed Ids.

16 years agoGreatly expand the devices listed as being supported. This list was
imp [Mon, 25 Aug 2008 02:36:27 +0000 (02:36 +0000)]
Greatly expand the devices listed as being supported.  This list was
taken from PR/121184 which was mechanically generated from similar
lists in the Linux ipaq driver.  I then took the numbers we had in
usbdevs and filled in the right symbols and eliminated duplicates.

PR: 121184

16 years agoSort the list of supported products alphabetically.
imp [Mon, 25 Aug 2008 02:06:26 +0000 (02:06 +0000)]
Sort the list of supported products alphabetically.

16 years agoUpdate uipaq for FreeBSD's driver:
imp [Mon, 25 Aug 2008 02:05:04 +0000 (02:05 +0000)]
Update uipaq for FreeBSD's driver:
o List all devices FreeBSD supports (more on the way)
o Sort the list of supported devices
o Note this was introduced with FreeBSD 7.0
o Include the FreeBSD configuration synopsis
o Bump the man page date
o Put $FreeBSD$ where all the other usb man pages have it.
And add to build.

16 years agoBring in verbatim copy of NetBSD's uipaq.4 man page. This in turn was
imp [Mon, 25 Aug 2008 01:51:40 +0000 (01:51 +0000)]
Bring in verbatim copy of NetBSD's uipaq.4 man page.  This in turn was
copied from OpenBSD.  I'll adjust the history section to reflect
FreeBSD's history, and attach it to the build later.

16 years agoMove some struct defs around. This is a prep step for Vimage.A
julian [Mon, 25 Aug 2008 00:33:30 +0000 (00:33 +0000)]
Move some struct defs around. This is a prep step for Vimage.A
No real effect of this at this time.

16 years agoUse the correct systime.c file instead of the "simulation mode" one.
roberto [Sun, 24 Aug 2008 23:28:56 +0000 (23:28 +0000)]
Use the correct systime.c file instead of the "simulation mode" one.
Should fix the current weirdness in ntpd/ntpdate where the current system
time is not read/updated.

Submitted by: naddy
MFC after: 2 weeks
Pointy hat to: me

16 years agoCorrect detection of particular wpi cards which only support b/g
benjsc [Sun, 24 Aug 2008 22:42:39 +0000 (22:42 +0000)]
Correct detection of particular wpi cards which only support b/g
and fix the output to indicate b/g not a/g

Submitted by: ischram at telenet.be
Reviewed by: thompsa
Approved by: sam (co-mentor)
MFC after: 1 month

16 years agoVIMAGE is a global option
julian [Sun, 24 Aug 2008 21:33:10 +0000 (21:33 +0000)]
VIMAGE is a global option

16 years agoAdd uipaq. HTC smart phones use it, and it seems like a reasonable
imp [Sun, 24 Aug 2008 21:27:01 +0000 (21:27 +0000)]
Add uipaq.  HTC smart phones use it, and it seems like a reasonable
thing to have laying around.

16 years agoRegenerate following r182123.
rwatson [Sun, 24 Aug 2008 21:23:08 +0000 (21:23 +0000)]
Regenerate following r182123.

16 years agoWhen MPSAFE ttys were merged, a new BSM audit event identifier was
rwatson [Sun, 24 Aug 2008 21:20:35 +0000 (21:20 +0000)]
When MPSAFE ttys were merged, a new BSM audit event identifier was
allocated for posix_openpt(2).  Unfortunately, that identifier
conflicts with other events already allocated to other systems in
OpenBSM.  Assign a new globally unique identifier and conform
better to the AUE_ event naming scheme.

This is a stopgap until a new OpenBSM import is done with the
correct identifier, so we'll maintain this as a local diff in svn
until then.

Discussed with: ed
Obtained from: TrustedBSD Project

16 years agoThere's a race in kmem(4) between checking whether a page is resident
marius [Sun, 24 Aug 2008 20:53:36 +0000 (20:53 +0000)]
There's a race in kmem(4) between checking whether a page is resident
in the kernel and copying it out, causing a panic when faulting on a
nofault entry. Handle this case gracefully by letting the kernel copy
functions return EFAULT instead. As such this change addresses the
same problem as r154721 does for i386.

MFC after: 3 days

16 years agoMFp4:
imp [Sun, 24 Aug 2008 20:40:00 +0000 (20:40 +0000)]
MFp4:

Remove all the OtherBSD ifdefs.  They are very out of date at this
point.  OtherBSD doesn't use this file verbatim, and they don't have
FreeBSD ifdefs in their code.

Reviewed by: bms@, joerg@

16 years agoRemove worrying printf warning on bootup when processing vnodes which
csjp [Sun, 24 Aug 2008 20:16:44 +0000 (20:16 +0000)]
Remove worrying printf warning on bootup when processing vnodes which
have NULL mount-points.  This is the case for special vnodes, such as the
one used in nameiinit() which is used for crossing mount points in lookup()
to avoid  lock ordering issues.

MFC after: 2 weeks
Discussed with: rwatson, kib

16 years agoMFamd64: r133413
marius [Sun, 24 Aug 2008 20:02:18 +0000 (20:02 +0000)]
MFamd64: r133413

In syscall, always make a copy of parameters from trapframe, this
becauses some syscalls using set_mcontext can sneakily change
parameters and later when those syscalls references parameters,
they will wrongly use register values in mcontext_t.

PR: 72998
MFC after: 3 days

16 years agoUse ERANGE instead of EOVERFLOW selected in r182059, this seems more
rwatson [Sun, 24 Aug 2008 19:55:10 +0000 (19:55 +0000)]
Use ERANGE instead of EOVERFLOW selected in r182059, this seems more
appropriate even if Solaris doesn't document it (E2BIG) or use it
(EOVERFLOW).

Submitted by: nectar at apple dot com
Sponsored by: Apple, Inc.
MFC after: 3 days

16 years agoMake syscons(4) use ttyv0 instead of consolectl as its primary window.
ed [Sun, 24 Aug 2008 19:50:57 +0000 (19:50 +0000)]
Make syscons(4) use ttyv0 instead of consolectl as its primary window.

When I was hacking on uart(4) to make it work with the MPSAFE TTY layer,
I noticed there was a difference between the way syscons and uart work
with respect to consoles:

- The uart(4) driver sets cn_name to the corresponding ttyu%r node,
  which means init(8) (which opens /dev/console) will have its output
  redirected to /dev/ttyu%r. After /etc/rc is done, it can spawn a getty
  on that device node as well.

- Syscons used a little different approach. Apart from the /dev/ttyv%r
  nodes, it creates a /dev/consolectl node. This device node is used by
  moused and others to deliver their data, but for some reason it also
  acts as a TTY, which shares its stat structure with ttyv0. This device
  node is used as a console (run conscontrol).

There are a couple advantages of this approach:

- Because we use two different TTY's to represent the 0th syscons
  window, we allocate two sets of TTY buffers. Even if you don't use
  /dev/consolectl after the system has booted (systems that don't run
  moused), it seems the buffers are still allocated.

- We have to apply an evil hack to redirect input to /dev/consolectl.
  Because each window (stat) is associated not associated with one TTY,
  syscons solves this by redirecting all input to closed TTY's to
  consolectl.

  This means that opening /dev/ttyv0 while in single user mode will
  probably cause strange things to happen with respect to keyboard input
  redirection.

The first patch that I discussed with philip@ turned consolectl into a
symlink to ttyv0, but this was not a good idea, because in theory we
would want consolectl to be a simple device node, which contains all the
`privileged' ioctl()'s. Apart from that, it didn't work, because each
time /dev/ttyv0 got revoked, moused also lost its descriptor to deliver
input, which meant you had to plug out/in your mouse to make it work
again. This version just leaves the consolectl device the way it is. It
can still be used to write output to ttyv0, but it can no longer receive
any input.

In my opinion this patch is not a complete solution, but it's already a
step in the good direction. It would allow us to turn consolectl into a
special (non-TTY) device node in the far future. It shaves off 15 KB of
wasted TTY buffer space.

Discussed with: philip

16 years agoPut the relocked variable from the r182111 into the #ifdef QUOTA braces
kib [Sun, 24 Aug 2008 19:06:19 +0000 (19:06 +0000)]
Put the relocked variable from  the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.

Reported by: ed
MFC after: 1 week

16 years agoMake the kernel compile with SCTP and SCTP_DEBUG but
bz [Sun, 24 Aug 2008 18:29:22 +0000 (18:29 +0000)]
Make the kernel compile with SCTP and SCTP_DEBUG but
no INET6 defined.

16 years agoMake lmc(4) compile without INET6 defined[1]. While here make it
bz [Sun, 24 Aug 2008 18:27:19 +0000 (18:27 +0000)]
Make lmc(4) compile without INET6 defined[1]. While here make it
compile if there is no INET defined.

Obtained from: zec (via p4 vimage branch)[1]
MFC after: 3 months

16 years agoRevert the r167541: "Remove unneeded getinoquota() call in the
kib [Sun, 24 Aug 2008 17:24:22 +0000 (17:24 +0000)]
Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.

Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().

Reported by: simon at optinet com
In collaboration with: pho
MFC after: 1 week

16 years agoAnnounce the speed of the PCI bus for informational purpose.
marius [Sun, 24 Aug 2008 16:22:04 +0000 (16:22 +0000)]
Announce the speed of the PCI bus for informational purpose.

MFC after: 3 days

16 years agoMake sysmouse(4) use its own locks, instead of using Giant.
ed [Sun, 24 Aug 2008 15:20:44 +0000 (15:20 +0000)]
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.

16 years agoThe PCI specifications don't explain the details on how to calculate
marius [Sun, 24 Aug 2008 15:05:46 +0000 (15:05 +0000)]
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

16 years agoExplicitly tell that one needs to start a context address with a
yar [Sun, 24 Aug 2008 13:47:53 +0000 (13:47 +0000)]
Explicitly tell that one needs to start a context address with a
backslash if he/she wants to use a non-traditional delimiter, i.e.,
anything other than a slash.  That is, /abc/ works as is, but xabcx
needs to be spelled as \xabcx.

Add appropriate markup.

Bump Dd.

Checked with: IEEE Std 1003.1, 2004 Edition
MFC after: 3 days

16 years agoMake the checks for ptp interfaces in ifa_ifwithdstaddr() and
bz [Sun, 24 Aug 2008 11:03:43 +0000 (11:03 +0000)]
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

16 years agoRemove the now unneeded pt_chown utility.
ed [Sun, 24 Aug 2008 10:01:22 +0000 (10:01 +0000)]
Remove the now unneeded pt_chown utility.

Before we had a posix_openpt() that allocated PTY's with proper
permissions in place, we used this set-uid utility to change the
ownership of PTY slave devices to the real user ID of the process. This
utility was used to implement grantpt().

In my first designs of the MPSAFE TTY layer, I replaced this by adding
an ioctl() called TIOCGRANTPT, which was used to change the ownership.
I left the pt_chown utility, because older C libraries needed it to work
properly.

After some discussions back in June I changed the PTY code to set
permissions properly upon creation. Fortunately the previous grantpt()
implementation changed permissions by hand when pt_chown is not
installed, which always succeeds. This means grantpt() still works
properly, even though the set-uid utility is missing.

I've done tests with FreeBSD 5.2.1, FreeBSD 6.3 and FreeBSD 7.0 jails.
All of them still work if I remove pt_chown.

Reviewed by: philip (ex-mentor)

16 years agoRestore 256 pty(4) entries.
ed [Sun, 24 Aug 2008 08:41:29 +0000 (08:41 +0000)]
Restore 256 pty(4) entries.

As discussed with Robert Watson on the src-committers list, it is safer
to keep at least some pty(4) entries in /etc/ttys, for applications that
roll their own PTY allocation routine and only search for BSD-style
PTY's.

This means we've now just toggled the amount of entries for pts(4) and
pty(4).

Requested by: rwatson

16 years agoMFp4 (my newcard tree):
imp [Sun, 24 Aug 2008 07:40:14 +0000 (07:40 +0000)]
MFp4 (my newcard tree):

ISACFGATTR_MULTI is unused.  Retire it, and a function that has no
side effects used to compute it.

16 years agoUpdate the total archive byte counters when writing entries to disk using
kientzle [Sun, 24 Aug 2008 06:21:00 +0000 (06:21 +0000)]
Update the total archive byte counters when writing entries to disk using
archive_write_disk.
Update cpio to use this to emit block counts in -p mode.
Update cpio tests to verify these block counts.

16 years agoRemove the stillborn attempt to cleanup tests as well as the build dir.
kientzle [Sun, 24 Aug 2008 05:54:28 +0000 (05:54 +0000)]
Remove the stillborn attempt to cleanup tests as well as the build dir.

16 years agostraighten out the "clean" target
kientzle [Sun, 24 Aug 2008 05:49:36 +0000 (05:49 +0000)]
straighten out the "clean" target

16 years agoFail copying path/.. only if SECURE_NODOTDOT was specified.
kientzle [Sun, 24 Aug 2008 05:42:22 +0000 (05:42 +0000)]
Fail copying path/.. only if SECURE_NODOTDOT was specified.
Since we already warn for any '..' elements in that case,
the extra "lastdotdot" tracking turns out to be unnecessary.

PR: bin/124924

16 years agocpio -v emits a line for every item copied.
kientzle [Sun, 24 Aug 2008 05:40:42 +0000 (05:40 +0000)]
cpio -v emits a line for every item copied.

16 years agoUpdate the passthrough_dotdot test to reproduce a
kientzle [Sun, 24 Aug 2008 05:24:52 +0000 (05:24 +0000)]
Update the passthrough_dotdot test to reproduce a
problem reported by Kris Kennaway.

PR: bin/124924

16 years agoTest for proper handling of "cpio -p .."
kientzle [Sun, 24 Aug 2008 05:14:03 +0000 (05:14 +0000)]
Test for proper handling of "cpio -p .."

PR: bin/124924

16 years agoFix the cpio bug tested for by r182092 of usr.bin/cpio/test.
kientzle [Sun, 24 Aug 2008 05:01:01 +0000 (05:01 +0000)]
Fix the cpio bug tested for by r182092 of usr.bin/cpio/test.
Since various 'find' incantations can emit container directories
in various orders, we cannot refuse to update a dir because it's
apparently the same age.

MFC after: 3 days

16 years agoTest for a bug reported by Bernd Walter: In passthrough mode,
kientzle [Sun, 24 Aug 2008 04:58:22 +0000 (04:58 +0000)]
Test for a bug reported by Bernd Walter:  In passthrough mode,
copying "dir/file" and then copying "dir" results in
"File on disk is not older; skipping" for the "dir" because
it was implicitly created by "dir/file."  Among other sins,
this means that "dir" ends up with the wrong permissions
and ownership.

This is actually a libarchive bug; fix is forthcoming.

16 years agoEvidently the block device starts at 767.
kmacy [Sun, 24 Aug 2008 04:42:41 +0000 (04:42 +0000)]
Evidently the block device starts at 767.

MFC after: 1 month

16 years agoUse sbuf_putc instead of sbuf_cat. This makes more sense, since we are
csjp [Sun, 24 Aug 2008 03:12:17 +0000 (03:12 +0000)]
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

16 years agoDon't calculate checksum if it has already been validated
kmacy [Sun, 24 Aug 2008 02:31:09 +0000 (02:31 +0000)]
Don't calculate checksum if it has already been validated

Obtained from: Chelsio Inc.
MFC after: 3 days

16 years agoSome PC Card variants of the 82365 don't seem to like setting the IRQ
imp [Sun, 24 Aug 2008 00:22:42 +0000 (00:22 +0000)]
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.

16 years agoWhite space nit.
imp [Sat, 23 Aug 2008 23:44:45 +0000 (23:44 +0000)]
White space nit.

16 years agoWhitespace nit.
imp [Sat, 23 Aug 2008 23:35:08 +0000 (23:35 +0000)]
Whitespace nit.

16 years agoFix style nit: s/^ }/}/ in two places.
imp [Sat, 23 Aug 2008 23:30:54 +0000 (23:30 +0000)]
Fix style nit: s/^ }/}/ in two places.

16 years agoStyle nit: s/^ }/}/
imp [Sat, 23 Aug 2008 23:28:33 +0000 (23:28 +0000)]
Style nit: s/^ }/}/

16 years agomake block devices start at 0
kmacy [Sat, 23 Aug 2008 21:30:08 +0000 (21:30 +0000)]
make block devices start at 0

16 years agoAdd a very simple dpms(4) driver that uses the VESA BIOS DPMS calls to
jhb [Sat, 23 Aug 2008 21:00:40 +0000 (21:00 +0000)]
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

16 years agoUpdate drm kernel drivers.
rnoland [Sat, 23 Aug 2008 20:59:12 +0000 (20:59 +0000)]
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

16 years ago- Use m_collapse(9) instead of m_defrag(9) if possible. This results
marius [Sat, 23 Aug 2008 20:57:48 +0000 (20:57 +0000)]
- 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

16 years agoUpdate the comment regarding the workaround for the BlackBird
marius [Sat, 23 Aug 2008 20:53:27 +0000 (20:53 +0000)]
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

16 years agoMake sure that we handle errors in device_get_children correctly.
imp [Sat, 23 Aug 2008 18:27:10 +0000 (18:27 +0000)]
Make sure that we handle errors in device_get_children correctly.

16 years agoHandle the error case properly for device_get_children.
imp [Sat, 23 Aug 2008 18:22:49 +0000 (18:22 +0000)]
Handle the error case properly for device_get_children.

16 years agoHandle errors from device_get_children.
imp [Sat, 23 Aug 2008 16:38:20 +0000 (16:38 +0000)]
Handle errors from device_get_children.

16 years ago- Provide and consume module dependency information.
marius [Sat, 23 Aug 2008 16:07:20 +0000 (16:07 +0000)]
- Provide and consume module dependency information.
- Fix whitespace bugs.

MFC after: 3 days

16 years agoAllow the user to suppress the rate-limited pty(4) warning.
ed [Sat, 23 Aug 2008 16:03:00 +0000 (16:03 +0000)]
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

16 years agoWhen device_get_children returns an error, ignore that bus' children.
imp [Sat, 23 Aug 2008 15:57:43 +0000 (15:57 +0000)]
When device_get_children returns an error, ignore that bus' children.

16 years agoMove the code that looks for the companion phy to a subroutine to make
imp [Sat, 23 Aug 2008 15:50:18 +0000 (15:50 +0000)]
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.

16 years ago- Removed unused sc_node.
marius [Sat, 23 Aug 2008 15:44:13 +0000 (15:44 +0000)]
- 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

16 years agoThere actually were bugs in the original handling that I missed last
imp [Sat, 23 Aug 2008 15:34:31 +0000 (15:34 +0000)]
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.

16 years agoIt turns out that my analysis of the error handling here was wrong.
imp [Sat, 23 Aug 2008 15:29:28 +0000 (15:29 +0000)]
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.

16 years agoIntroduce two related changes to the TrustedBSD MAC Framework:
rwatson [Sat, 23 Aug 2008 15:26:36 +0000 (15:26 +0000)]
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.

16 years agoProvide and consume module dependency information.
marius [Sat, 23 Aug 2008 15:20:33 +0000 (15:20 +0000)]
Provide and consume module dependency information.

MFC after: 3 days

16 years agoFix a race condition with concurrent LOOKUP namecache operations for a vnode
jhb [Sat, 23 Aug 2008 15:13:39 +0000 (15:13 +0000)]
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

16 years ago- Restore the behavior of enabling the MII buffer for an internal
marius [Sat, 23 Aug 2008 15:03:26 +0000 (15:03 +0000)]
- 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

16 years agoWhen getaudit(2) is unable to fit the terminal IPv6 address into the
rwatson [Sat, 23 Aug 2008 14:39:01 +0000 (14:39 +0000)]
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

16 years agoRemove old BSD-style entries from /etc/ttys and increase pts(4) to 512.
ed [Sat, 23 Aug 2008 14:36:39 +0000 (14:36 +0000)]
Remove old BSD-style entries from /etc/ttys and increase pts(4) to 512.

Because we now use pts(4)-style PTY's exclusively, there is no use for
these entries in /etc/ttys. Right now the pts(4) entries only go from 0
to 255. Because we're going to touch these files anyway, increase the
number to 511.

Discussed with: philip (ex-mentor)

16 years agoRemove clkbrd(4) as a separate device and compile it solely based
marius [Sat, 23 Aug 2008 14:28:44 +0000 (14:28 +0000)]
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.

16 years agoCache the cred locally in _syncache_add() while holding the locks, so
bz [Sat, 23 Aug 2008 14:22:12 +0000 (14:22 +0000)]
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

16 years ago- Add kbdmux(4); since sunkbd(4) was tought to emulate atkbd(4) like
marius [Sat, 23 Aug 2008 14:17:00 +0000 (14:17 +0000)]
- 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

16 years agoRemove unused tty_gone() checks inside ttyoutq_read_uio().
ed [Sat, 23 Aug 2008 13:32:21 +0000 (13:32 +0000)]
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.

16 years agoMake stty(1) use tab0 and tab3 to handle tab completion.
ed [Sat, 23 Aug 2008 13:28:55 +0000 (13:28 +0000)]
Make stty(1) use tab0 and tab3 to handle tab completion.

After the MPSAFE TTY import, we have support for the TAB0 and TAB3 flags
to handle tab expansion, while we only used to support OXTABS. Switch
stty(1) to use tab0 and tab3 to print whether tab expansion is turned on
or off. Implement the oxtabs and tabs switches by setting the
appropriate TABx value.

Even though POSIX only lists this as being XSI, we'd better follow it.

16 years agoIf we are unable to obtain a frequency list from either ACPI or the static
jhb [Sat, 23 Aug 2008 12:53:42 +0000 (12:53 +0000)]
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

16 years agoRemove unused variable nosleepwithlocks.
antoine [Sat, 23 Aug 2008 12:40:07 +0000 (12:40 +0000)]
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

16 years agoAdjust the handling the various timer frequencies when using the lapic
jhb [Sat, 23 Aug 2008 12:35:43 +0000 (12:35 +0000)]
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

16 years agoAdd an explicit comment why we NULLify the two variables.
bz [Sat, 23 Aug 2008 12:27:18 +0000 (12:27 +0000)]
Add an explicit comment why we NULLify the two variables.

Reviewed by: rwatson
MFC after: 3 days

16 years agoDocument that devlistp and devcountp are only updated when there's no
imp [Sat, 23 Aug 2008 07:50:20 +0000 (07:50 +0000)]
Document that devlistp and devcountp are only updated when there's no
error.
Bump date.

16 years agoRevert bogusly committed file.
imp [Sat, 23 Aug 2008 07:46:58 +0000 (07:46 +0000)]
Revert bogusly committed file.

16 years agoSet devs to 0 in case device_get_children return an error. The right thing
imp [Sat, 23 Aug 2008 07:46:20 +0000 (07:46 +0000)]
Set devs to 0 in case device_get_children return an error.  The right thing
to do here is nothing in that case...

16 years agoActually revert last... Upon closer inspection the code works in the
imp [Sat, 23 Aug 2008 07:43:03 +0000 (07:43 +0000)]
Actually revert last...  Upon closer inspection the code works in the
face of errors already...  A bit unorthodox, but none-the-less valid.

16 years agoHandle errors in device_get_children gracefully.
imp [Sat, 23 Aug 2008 07:41:21 +0000 (07:41 +0000)]
Handle errors in device_get_children gracefully.

16 years agoHandle errors from device_get_chidlren.
imp [Sat, 23 Aug 2008 07:38:00 +0000 (07:38 +0000)]
Handle errors from device_get_chidlren.
Free child list when there's more children than we expected.

16 years agoCope with errors from device_get_children(). These errors can happen
imp [Sat, 23 Aug 2008 07:23:52 +0000 (07:23 +0000)]
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

16 years agoCosmetic nit.
imp [Sat, 23 Aug 2008 07:18:30 +0000 (07:18 +0000)]
Cosmetic nit.

16 years agoAdd MIPS support.
imp [Sat, 23 Aug 2008 04:58:11 +0000 (04:58 +0000)]
Add MIPS support.

Reviewed by: jb@

16 years agoAllow the MD UMA allocator to use VM routines like kmem_*(). Existing code requires...
nwhitehorn [Sat, 23 Aug 2008 01:35:36 +0000 (01:35 +0000)]
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)

16 years agoInstead of passing MNT_UPDATE, MNT_SNAPSHOT, MNT_RELOAD from
rodrigc [Sat, 23 Aug 2008 01:21:10 +0000 (01:21 +0000)]
Instead of passing MNT_UPDATE, MNT_SNAPSHOT, MNT_RELOAD from
userspace to kernel via nmount(), pass in the strings
"update", "snapshot", "reload".

We want to move away from passing MNT_ flags from userspace -> kernel
via nmount(), and instead favor passing the string options.

16 years agoMinor style nits.
imp [Sat, 23 Aug 2008 01:20:36 +0000 (01:20 +0000)]
Minor style nits.

16 years agoIn nmount(), when we see the "force" option,
rodrigc [Sat, 23 Aug 2008 01:16:09 +0000 (01:16 +0000)]
In nmount(), when we see the "force" option,
set the MNT_FORCE flag, but do not persist "force"
in the options list, since it is a command, not a persistent property
of a mount.

Similarly, when we see "reload", set MNT_RELOAD,
but delete "reload" from the options list.

MFC after: 1 week

16 years agoSubmit a band-aid for interrupt set up race.
kmacy [Fri, 22 Aug 2008 23:24:53 +0000 (23:24 +0000)]
Submit a band-aid for interrupt set up race.

MFC after: 1 month

16 years agoFix two small bugs in tcsetattr().
ed [Fri, 22 Aug 2008 21:27:37 +0000 (21:27 +0000)]
Fix two small bugs in tcsetattr().

- According to POSIX, tcsetattr() must not fail when any of the bits in
  the structure are unsupported, but it must leave the unsupported flags
  alone.

- The CIGNORE flag (set by TCSASOFT, extension) was not cleared from
  c_cflag, which means using it would cause it to be applied during its
  entire lifespan. Eventually make sure we clear the flag.

I don't really like CIGNORE, but I think we must keep it alive right
now. With our new TTY layer, we don't actually need this mechanism,
because if you leave c_cflag, c_ispeed and c_ospeed alone, we won't make
a call into the device driver anyway.

Reported by: naddy
Tested by: naddy

16 years agoHook back ntp to the build now that I fixed it.
roberto [Fri, 22 Aug 2008 21:20:23 +0000 (21:20 +0000)]
Hook back ntp to the build now that I fixed it.

Pointy hat to: me

16 years agoDon't try enumerating APICs when running on top of xen
kmacy [Fri, 22 Aug 2008 20:38:25 +0000 (20:38 +0000)]
Don't try enumerating APICs when running on top of xen
(fixes boot on 64-bit dom0s)

MFC after: 1 month

16 years agocosmetic changes and style fixes
marius [Fri, 22 Aug 2008 20:28:19 +0000 (20:28 +0000)]
cosmetic changes and style fixes

16 years agoAdd forgotten libopts subdir.
roberto [Fri, 22 Aug 2008 20:04:35 +0000 (20:04 +0000)]
Add forgotten libopts subdir.

MFC after: 2 weeks

16 years agoAvoid misaligned access of struct frame.
marius [Fri, 22 Aug 2008 19:05:47 +0000 (19:05 +0000)]
Avoid misaligned access of struct frame.

MFC after: 3 days

16 years agoAdd a label for myself.
jhb [Fri, 22 Aug 2008 18:52:27 +0000 (18:52 +0000)]
Add a label for myself.

16 years agoUse bus_foo() rather than bus_space_foo() and remove bus handle and tag
jhb [Fri, 22 Aug 2008 18:43:19 +0000 (18:43 +0000)]
Use bus_foo() rather than bus_space_foo() and remove bus handle and tag
from softc.