]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoUpdate less to v436. This is considered as a bugfix release from vendor.
delphij [Wed, 29 Jul 2009 09:20:32 +0000 (09:20 +0000)]
Update less to v436.  This is considered as a bugfix release from vendor.

Major changes from v429:
 * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-".
 * Allow a fraction as the argument to the -# (--shift) option.
 * Fix highlight bug when underlined/overstruck text matches at end of line.
 * Fix non-regex searches with ctrl-R.

Approved by: re (kensmith, kib)

14 years agoAs was done in r195820 for amd64, use clflush for flushing cache lines
kib [Wed, 29 Jul 2009 08:49:58 +0000 (08:49 +0000)]
As was done in r195820 for amd64, use clflush for flushing cache lines
when memory page caching attributes changed, and CPU does not support
self-snoop, but implemented clflush, for i386.

Take care of possible mappings of the page by sf buffer by utilizing
the mapping for clflush, otherwise map the page transiently. Amd64
used direct map.

Proposed and reviewed by:  alc
Approved by:   re (kensmith)

14 years agoEliminate ARG_UPATH[12] arguments to AUDIT_ARG_UPATH() and instead
rwatson [Wed, 29 Jul 2009 07:44:43 +0000 (07:44 +0000)]
Eliminate ARG_UPATH[12] arguments to AUDIT_ARG_UPATH() and instead
provide specific macros, AUDIT_ARG_UPATH1() and AUDIT_ARG_UPATH2()
to capture path information for audit records.  This allows us to
move the definitions of ARG_* out of the public audit header file,
as they are an implementation detail of our current kernel-internal
audit record, which may change.

Approved by: re (kensmith)
Obtained from: TrustedBSD Project
MFC after: 1 month

14 years agoCurrently there is a problem with fscking UFS file systems created on
pjd [Wed, 29 Jul 2009 05:23:52 +0000 (05:23 +0000)]
Currently there is a problem with fscking UFS file systems created on
top of ZVOLs. The problem is that rc.d/fsck runs before rc.d/zfs. The
latter makes ZVOLs to appear in /dev/. In such case rc.d/fsck cannot
find devfs entry and aborts. We cannot simply move rc.d/zfs before
rc.d/fsck, because we first want kern.hostid to be configured (by
rc.d/hostid). If we won't wait (hostid will be 0) we can reuse disks
which are in use by different systems (eg. in SAN/NAS environment).
We also cannot move rc.d/hostid before rc.d/fsck, because rc.d/hostid on
first system start stores generated kern.hostuuid in /etc/hostid file,
so it needs root file system to be mounted read-write.

The fix is to split rc.d/hostid so that rc.d/hostid (which will now run
before rc.d/fsck) only generates hostid and sets up sysctls, but doesn't
touch root file system and rc.d/hostid_save (which is run after
rc.d/root) and only creates /etc/hostid file.

With that in place, we can move ZVOL initialization to dedicated
rc.d/zvol script which runs before rc.d/fsck.

PR: conf/120194
Reported by: James Snow <snow@teardrop.org>
Reviewed by: brooks
Approved by: re (kib)
MFC after: 2 weeks

14 years agoUpdate to version 9.6.1-P1 which addresses a remote DoS vulnerability:
dougb [Wed, 29 Jul 2009 00:15:39 +0000 (00:15 +0000)]
Update to version 9.6.1-P1 which addresses a remote DoS vulnerability:

Receipt of a specially-crafted dynamic update message may
cause BIND 9 servers to exit. This vulnerability affects all
servers -- it is not limited to those that are configured to
allow dynamic updates. Access controls will not provide an
effective workaround.

More details can be found here: https://www.isc.org/node/474

All BIND users are encouraged to update to a patched version ASAP.

Approved by: re (re -> SO -> dougb)

14 years agoRevise header comments for vnet.h as we now implement VNET_SYSINIT, not
rwatson [Tue, 28 Jul 2009 22:17:34 +0000 (22:17 +0000)]
Revise header comments for vnet.h as we now implement VNET_SYSINIT, not
just VNET_DEFINE in vnet.h.

Approved by: re (vimage blanket)

14 years agoRework vnode argument auditing to follow the same structure, in order
rwatson [Tue, 28 Jul 2009 21:52:24 +0000 (21:52 +0000)]
Rework vnode argument auditing to follow the same structure, in order
to avoid exposing ARG_ macros/flag values outside of the audit code in
order to name which one of two possible vnodes will be audited for a
system call.

Approved by: re (kib)
Obtained from: TrustedBSD Project
MFC after: 1 month

14 years agoAudit file descriptors passed to fooat(2) system calls, which are used
rwatson [Tue, 28 Jul 2009 21:39:58 +0000 (21:39 +0000)]
Audit file descriptors passed to fooat(2) system calls, which are used
instead of the root/current working directory as the starting point for
lookups.  Up to two such descriptors can be audited.  Add audit record
BSM encoding for fooat(2).

Note: due to an error in the OpenBSM 1.1p1 configuration file, a
further change is required to that file in order to fix openat(2)
auditing.

Approved by: re (kib)
Reviewed by: rdivacky (fooat(2) portions)
Obtained from: TrustedBSD Project
MFC after: 1 month

14 years agoStartup the vnet part of initialization a bit after the global part.
julian [Tue, 28 Jul 2009 19:58:07 +0000 (19:58 +0000)]
Startup the vnet part of initialization a bit after the global part.
Fixes crash on boot if ipfw compiled in.

Submitted by: tegge@
Reviewed by: tegge@
Approved by: re (kib)

14 years agoSomewhere along the line accept sockets stopped honoring the
julian [Tue, 28 Jul 2009 19:43:27 +0000 (19:43 +0000)]
Somewhere along the line accept sockets stopped honoring the
FIB selected for them. Fix this.

Reviewed by: ambrisko
Approved by: re (kib)
MFC after: 3 days

14 years agoThe new flow table caches both the routing table entry as well as the
qingli [Tue, 28 Jul 2009 17:16:54 +0000 (17:16 +0000)]
The new flow table caches both the routing table entry as well as the
L2 information. For an indirect route the cached L2 entry contains the
MAC address of the gateway. Typically the default route is used to
transmit multicast packets when explicit multicast routes are not
available. The ether_output() function bypasses L2 resolution function
if it verifies the L2 cache is valid, because the cached L2 address
(a unicast MAC address) is copied into the packets as the destination
MAC address. This validation, however, does not apply to broadcast and
multicast packets because the destination MAC address is mapped
according to a standard method instead.

Submitted by: Xin Li
Reviewed by: bz
Approved by: re

14 years agoFix a bug where wrong initialization value
tuexen [Tue, 28 Jul 2009 15:07:41 +0000 (15:07 +0000)]
Fix a bug where wrong initialization value
in used for an SCTP specific sysctl variable.

Approved by: re, rrs(mentor).
MFC after: 2 weeks.

14 years agoTurns out that when a receiver forwards through its TNS's the
rrs [Tue, 28 Jul 2009 14:09:06 +0000 (14:09 +0000)]
Turns out that when a receiver forwards through its TNS's the
processing code holds the read lock (when processing a
FWD-TSN for pr-sctp). If it finds stranded data that
can be given to the application, it calls sctp_add_to_readq().
The readq function also grabs this lock. So if INVAR is on
we get a double recurse on a non-recursive lock and panic.

This fix will change it so that readq() function gets a
flag to tell if the lock is held, if so then it does not
get the lock.

Approved by: re@freebsd.org (Kostik Belousov)
MFC after: 1 week

14 years agoAdd INDEX-8 to the default portsnap configuration file, and remove INDEX-5.
cperciva [Mon, 27 Jul 2009 20:24:00 +0000 (20:24 +0000)]
Add INDEX-8 to the default portsnap configuration file, and remove INDEX-5.
The Portsnap buildbox now generates teh bits needed for portsnap to produce
INDEX-8; and it hasn't built INDEX-5 for a long time, although the bits are
still distributed for an INDEX-5 from when FreeBSD 5.x reached its EoL.

Approved by: re (kib)
MFC after: 3 days (INDEX-8 addition only)

14 years agoadds DLINK2 DWA120 device.
weongyo [Mon, 27 Jul 2009 20:17:20 +0000 (20:17 +0000)]
adds DLINK2 DWA120 device.

PR: usb/136950
Reported by: Alexander Kuznetsov <skritku at gmail.com>
Approved by: re (kib)

14 years agourtw(4) supports RTL8187B chipset now.
weongyo [Mon, 27 Jul 2009 18:07:44 +0000 (18:07 +0000)]
urtw(4) supports RTL8187B chipset now.

Approved by: re (kib)

14 years agoThis patch does the following:
qingli [Mon, 27 Jul 2009 17:08:06 +0000 (17:08 +0000)]
This patch does the following:

    - Allow loopback route to be installed for address assigned to
      interface of IFF_POINTOPOINT type.
    - Install loopback route for an IPv4 interface addreess when the
      "useloopback" sysctl variable is enabled. Similarly, install
      loopback route for an IPv6 interface address when the sysctl variable
      "nd6_useloopback" is enabled. Deleting loopback routes for interface
      addresses is unconditional in case these sysctl variables were
      disabled after an interface address has been assigned.

Reviewed by: bz
Approved by: re

14 years agoFix the freebsd32 versions of semsys(), shmsys(), and msgsys() to use the
jhb [Mon, 27 Jul 2009 16:03:04 +0000 (16:03 +0000)]
Fix the freebsd32 versions of semsys(), shmsys(), and msgsys() to use the
old ABI versions of the relevant control system call (e.g.
freebsd7_freebsd32_msgctl() instead of freebsd32_msgctl() for msgsys()).

Approved by: re (kib)

14 years agoWe don't support ephemeral IDs in FreeBSD and without this fix ZFS can
pjd [Mon, 27 Jul 2009 14:52:34 +0000 (14:52 +0000)]
We don't support ephemeral IDs in FreeBSD and without this fix ZFS can
panic when in zfs_fuid_create_cred() when userid is negative. It is
converted to unsigned value which makes IS_EPHEMERAL() macro to
incorrectly report that this is ephemeral ID. The most reasonable
solution for now is to always report that the given ID is not ephemeral.

PR: kern/132337
Submitted by: Matthew West <freebsd@r.zeeb.org>
Tested by: Thomas Backman <serenity@exscape.org>, Michael Reifenberger <mike@reifenberger.com>
Approved by: re (kib)
MFC after: 2 weeks

14 years agoMesh fixes, namely:
rpaulo [Mon, 27 Jul 2009 14:22:09 +0000 (14:22 +0000)]
Mesh fixes, namely:
* don't clobber proxy entries
* HWMP seq number processing, including discard of old frames
* flush routing table entries based on nexthop
* print route flags in ifconfig
* more debugging messages and comments

Proxy changes submitted by sam.

Approved by: re (kib)

14 years agoRefine the MacBook hack to only match early models that have Intel ICH.
rpaulo [Mon, 27 Jul 2009 13:51:55 +0000 (13:51 +0000)]
Refine the MacBook hack to only match early models that have Intel ICH.

Discussed with: kjim
Approved by: re (kib)

14 years agoFix the handling of unordered messages when using
tuexen [Mon, 27 Jul 2009 13:41:45 +0000 (13:41 +0000)]
Fix the handling of unordered messages when using
PR-SCTP.

Approved by: re, rrs (mentor)
MFC after: 3 weeks.

14 years ago* Document the dev.asmc.N.light.control sysctl. [1]
rpaulo [Mon, 27 Jul 2009 13:36:35 +0000 (13:36 +0000)]
* Document the dev.asmc.N.light.control sysctl. [1]
* Add more models that have the SMC.

PR: 137168 [1]
Submitted by: Patrick Lamaiziere <patfbsd at davenulle.org>
Approved by: re (kib)

14 years agoGet rid of unused field. This will also be deleted
tuexen [Mon, 27 Jul 2009 12:09:32 +0000 (12:09 +0000)]
Get rid of unused field. This will also be deleted
in the official speciication of the SCTP socket API.

Approved by:re, rrs (mentor)

14 years agoVendor import of less v436.
delphij [Mon, 27 Jul 2009 07:05:08 +0000 (07:05 +0000)]
Vendor import of less v436.

14 years agoNote that COMPAT_43 requires COMPAT_FREEBSD7 too.
kib [Sun, 26 Jul 2009 20:12:06 +0000 (20:12 +0000)]
Note that COMPAT_43 requires COMPAT_FREEBSD7 too.

Submitted by: Steve Kargl
Approved by: re (kensmith)

14 years agoThe parser for Rockridge symlinks tended to insert
kientzle [Sun, 26 Jul 2009 18:11:44 +0000 (18:11 +0000)]
The parser for Rockridge symlinks tended to insert
extra slashes at the beginning of absolute targets.

Thanks to Jung-uk Kim for pointing this out to me.

Approved by: re (kib)

14 years agoAdd a missing unlock for the inp lock when
tuexen [Sun, 26 Jul 2009 15:06:59 +0000 (15:06 +0000)]
Add a missing unlock for the inp lock when
returning early from sctp_add_to_readq().

Approved by: re, rrs (mentor)
MFC after: 2 weeks.

14 years agoRestore PATA device probe order, broken by PMP support implementation,
mav [Sun, 26 Jul 2009 14:04:48 +0000 (14:04 +0000)]
Restore PATA device probe order, broken by PMP support implementation,
requesting IDENTIFY from slave device first. This order is important
for proper cable type detection by master device.

PR: kern/136438
Approved by: re (kib)

14 years agoUpdate epair(4) to the new netisr implementation and polish
bz [Sun, 26 Jul 2009 12:20:07 +0000 (12:20 +0000)]
Update epair(4) to the new netisr implementation and polish
things a bit:
- use dpcpu data to track the ifps with packets queued up,
- per-cpu locking and driver flags
- along with .nh_drainedcpu and NETISR_POLICY_CPU.
- Put the mbufs in flight reference count, preventing interfaces
  from going away, under INVARIANTS as this is a general problem
  of the stack and should be solved in if.c/netisr but still good
  to verify the internal queuing logic.
- Permit changing the MTU to virtually everythinkg like we do for loopback.

Hook epair(4) up to the build.

Approved by: re (kib)

14 years agoMake the in-kernel logic for the SIOCSIFVNET, SIOCSIFRVNET ioctls
bz [Sun, 26 Jul 2009 11:29:26 +0000 (11:29 +0000)]
Make the in-kernel logic for the SIOCSIFVNET, SIOCSIFRVNET ioctls
(ifconfig ifN (-)vnet <jname|jid>) work correctly.

Move vi_if_move to if.c and split it up into two functions(*),
one for each ioctl.

In the reclaim case, correctly set the vnet before calling if_vmove.

Instead of silently allowing a move of an interface from the current
vnet to the current vnet, return an error. (*)

There is some duplicate interface name checking before actually moving
the interface between network stacks without locking and thus race
prone. Ideally if_vmove will correctly and automagically handle these
in the future.

Suggested by: rwatson (*)
Approved by: re (kib)

14 years agoMake ifconfig ifN -vnet <jname|jid> actually work:
bz [Sun, 26 Jul 2009 11:25:57 +0000 (11:25 +0000)]
Make ifconfig ifN -vnet <jname|jid> actually work:

- fix ifconfig to ignore the non-existent interface in the current
  network stack in case of '-vnet'.
- in ifconfig: actually use the local variables defined for the
  vnet functions rather than modifying the global.

Reviewed by: rwatson
Approved by: re (kib)

14 years agoEliminate a stale paragraph from the BUGS section. This "bug" was
alc [Sun, 26 Jul 2009 06:38:56 +0000 (06:38 +0000)]
Eliminate a stale paragraph from the BUGS section.  This "bug" was
eliminated in r195693.

Approved by: re (kensmith)

14 years agoFix syntax error, makefile comments start with #.
kib [Sat, 25 Jul 2009 21:07:56 +0000 (21:07 +0000)]
Fix syntax error, makefile comments start with #.

Submitted by: bde
Approved by: re (kensmith)

14 years agoAdd note, that ahci(4) and siis(4) supersede ata(4) drivers.
mav [Sat, 25 Jul 2009 18:45:09 +0000 (18:45 +0000)]
Add note, that ahci(4) and siis(4) supersede ata(4) drivers.

Approved by: re (implicitly)

14 years agoPMP provides 16 targets (15 drives + itself).
mav [Sat, 25 Jul 2009 18:19:31 +0000 (18:19 +0000)]
PMP provides 16 targets (15 drives + itself).

Approved by: re (implicitly)

14 years agoLibarchive recognizes hardlinked files on ISO images,
kientzle [Sat, 25 Jul 2009 18:11:55 +0000 (18:11 +0000)]
Libarchive recognizes hardlinked files on ISO images,
but returned them incorrectly, causing tar to actually
erase the resulting file while trying to restore the
link.  This one-line fix corrects the hardlink descriptions
to avoid this problem.

Thanks to Jung-uk Kim for pointing this out.

Approved by: re (kib)

14 years agoAdd ahci and siis drivers to NOTES.
mav [Sat, 25 Jul 2009 17:40:49 +0000 (17:40 +0000)]
Add ahci and siis drivers to NOTES.

Approved by: re (implicitly)

14 years agoSome jail parameters (in particular, "ip4" and "ip6" for IP address
jamie [Sat, 25 Jul 2009 14:48:57 +0000 (14:48 +0000)]
Some jail parameters (in particular, "ip4" and "ip6" for IP address
restrictions) were found to be inadequately described by a boolean.
Define a new parameter type with three values (disable, new, inherit)
to handle these and future cases.

Approved by: re (kib), bz (mentor)
Discussed with: rwatson

14 years agoChange the name displayed in sysinstall(8) from 'Wizard Mode'
trasz [Sat, 25 Jul 2009 08:36:28 +0000 (08:36 +0000)]
Change the name displayed in sysinstall(8) from 'Wizard Mode'
to 'Expert Mode', to make it less confusing to new users, to whom
a 'wizard' is a set of simple dialogs with the 'next >>>' button.

Approved by: re (kensmith)

14 years agoCatch ipfw up to the rest of the vimage code.
julian [Sat, 25 Jul 2009 06:42:42 +0000 (06:42 +0000)]
Catch ipfw up to the rest of the vimage code.
It got left behind when it moved to its new location.

Approved by: re (kensmith)

14 years agoImprovement on the last change, this gives a precise
jfv [Fri, 24 Jul 2009 21:35:52 +0000 (21:35 +0000)]
Improvement on the last change, this gives a precise
way to tell the one and only interface that a vlan
event is for. Thanks to John Baldwin for the patch.

Approved by: re

14 years agoIntroduce a new sysctl process mib, kern.proc.groups which adds the
brooks [Fri, 24 Jul 2009 19:12:19 +0000 (19:12 +0000)]
Introduce a new sysctl process mib, kern.proc.groups which adds the
ability to retrieve the group list of each process.

Modify procstat's -s option to query this mib when the kinfo_proc
reports that the field has been truncated.  If the mib does not exist,
fall back to the truncated list.

Reviewed by: rwatson
Approved by: re (kib)
MFC after: 2 weeks

14 years agoBump __FreeBSD_version for the introduction of OBJT_SG.
jhb [Fri, 24 Jul 2009 18:31:04 +0000 (18:31 +0000)]
Bump __FreeBSD_version for the introduction of OBJT_SG.

Approved by: re (kensmith)

14 years agoThis delta fixes two bugs:
jfv [Fri, 24 Jul 2009 16:57:49 +0000 (16:57 +0000)]
This delta fixes two bugs:
  - When a vlan event occurs a check was not made that
    the event was actually for the interface, thus resulting
    in a panic. All three drivers have this vulnerability. Add
    a check for this condition.
  - Secondly, there was a duplicate buf_ring free in the em
    driver resulting in a panic on unload. Remove.

Approved by:  re

14 years agoA small number of systems in the ICH9/10 family have a flash
jfv [Fri, 24 Jul 2009 16:54:22 +0000 (16:54 +0000)]
A small number of systems in the ICH9/10 family have a flash
part that is made up of 8K banks rather than 4K, if these
systems are using bank 1 then the last change in this code
breaks the bank read, resulting in an invalid checksum of
the eeprom during driver load. This change fixes this.

Approved by:  re

14 years agorevert OACTIVE part of r195845; instead fix the comment so it does not refer
sam [Fri, 24 Jul 2009 15:37:02 +0000 (15:37 +0000)]
revert OACTIVE part of r195845; instead fix the comment so it does not refer
to the old hack removed in r193312

Approved by: re (implicit)

14 years agoUpdate for vaps:
sam [Fri, 24 Jul 2009 15:31:22 +0000 (15:31 +0000)]
Update for vaps:
o do not force monitor mode; the wlanX ifnet must be an ahdemo mode vap
o move channel change work before marking ifnet up to avoid churning
  the state machine
o change default ifnet name to "wlan0"

Approved by: re (kensmith)

14 years agocorrect handling of IFF_PROMISC; this should not be pushed to the parent
sam [Fri, 24 Jul 2009 15:28:29 +0000 (15:28 +0000)]
correct handling of IFF_PROMISC; this should not be pushed to the parent
device except for monitor and ahdemo mode vaps

Reviewed by: rpaulo
Approved by: re (kensmith)

14 years agomonitor mode vaps are meant to be read-only so they can operate on any
sam [Fri, 24 Jul 2009 15:27:02 +0000 (15:27 +0000)]
monitor mode vaps are meant to be read-only so they can operate on any
frequency w/o regulatory issues, do this by hooking if_transmit and
if_output with routines that discard all transmits

Reviewed by: thompsa, cbzimmer (intent)
Approved by: re (kensmith)

14 years agoo kill old code no longer needed after r193312
sam [Fri, 24 Jul 2009 15:22:12 +0000 (15:22 +0000)]
o kill old code no longer needed after r193312
o count output packets+errors for frames sent through ieee80211_output

Approved by: re (kensmith)

14 years agoRemove debugging that crept in with previous commit.
jhb [Fri, 24 Jul 2009 15:06:49 +0000 (15:06 +0000)]
Remove debugging that crept in with previous commit.

Reported by: nwhitehorn
Approved by: re (kib)

14 years agoRevert the changes to struct kinfo_proc in r194498. Instead, fill
brooks [Fri, 24 Jul 2009 15:03:10 +0000 (15:03 +0000)]
Revert the changes to struct kinfo_proc in r194498.  Instead, fill
in up to 16 (KI_NGROUPS) values and steal a bit from ki_cr_flags
(all bits currently unused) to indicate overflow with the new flag
KI_CRF_GRP_OVERFLOW.

This fixes procstat -s.

Approved by: re (kib)

14 years agoAdd a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to
jhb [Fri, 24 Jul 2009 13:50:29 +0000 (13:50 +0000)]
Add a new type of VM object: OBJT_SG.  An OBJT_SG object is very similar to
a device pager (OBJT_DEVICE) object in that it uses fictitious pages to
provide aliases to other memory addresses.  The primary difference is that
it uses an sglist(9) to determine the physical addresses for a given offset
into the object instead of invoking the d_mmap() method in a device driver.

Reviewed by: alc
Approved by: re (kensmith)
MFC after: 2 weeks

14 years agoMove the check to ensure the locate database has the minimum required size
jhb [Fri, 24 Jul 2009 13:40:25 +0000 (13:40 +0000)]
Move the check to ensure the locate database has the minimum required size
when using mmap() before invoking mmap().  This avoids a confusing error
message when locate is invoked against a zero-size database after the
recent change to make mmap() fail requests to map 0 bytes.

Submitted by: Jaakko Heinonen  jh of saunalahti dot fi
Approved by: re (kensmith)
MFC after: 1 week

14 years agoMake libkvm work on live systems and crashdumps with and
bz [Thu, 23 Jul 2009 21:12:21 +0000 (21:12 +0000)]
Make libkvm work on live systems and crashdumps with and
without VIMAGE virtualization in the kernel.

If we cannot resolve a symbol try to see if we can find it with
prefix of the virtualized subsystem, currently only "vnet_entry"
by identifying either the vnet of the current process for a
live system or the vnet of proc0 (or of dumptid if compiled
in a non-default way).

The way this is done currently allows us to only touch libkvm
but no single application. Once we are going to virtualize more
subsystems we will have to review this decision for better scaling.

Submitted by: rwatson (initial version of kvm_vnet.c, lots of ideas)
Reviewed by: rwatson
Approved by: re (kib)

14 years agoIntroduce and use a sysinit-based initialization scheme for virtual
rwatson [Thu, 23 Jul 2009 20:46:49 +0000 (20:46 +0000)]
Introduce and use a sysinit-based initialization scheme for virtual
network stacks, VNET_SYSINIT:

- Add VNET_SYSINIT and VNET_SYSUNINIT macros to declare events that will
  occur each time a network stack is instantiated and destroyed.  In the
  !VIMAGE case, these are simply mapped into regular SYSINIT/SYSUNINIT.
  For the VIMAGE case, we instead use SYSINIT's to track their order and
  properties on registration, using them for each vnet when created/
  destroyed, or immediately on module load for already-started vnets.
- Remove vnet_modinfo mechanism that existed to serve this purpose
  previously, as well as its dependency scheme: we now just use the
  SYSINIT ordering scheme.
- Implement VNET_DOMAIN_SET() to allow protocol domains to declare that
  they want init functions to be called for each virtual network stack
  rather than just once at boot, compiling down to DOMAIN_SET() in the
  non-VIMAGE case.
- Walk all virtualized kernel subsystems and make use of these instead
  of modinfo or DOMAIN_SET() for init/uninit events.  In some cases,
  convert modular components from using modevent to using sysinit (where
  appropriate).  In some cases, do minor rejuggling of SYSINIT ordering
  to make room for or better manage events.

Portions submitted by: jhb (VNET_SYSINIT), bz (cleanup)
Discussed with: jhb, bz, julian, zec
Reviewed by: bz
Approved by: re (VIMAGE blanket)

14 years agoEliminate unnecessary cache and TLB flushes by pmap_change_attr(). (This
alc [Thu, 23 Jul 2009 19:43:23 +0000 (19:43 +0000)]
Eliminate unnecessary cache and TLB flushes by pmap_change_attr().  (This
optimization was implemented in the amd64 version roughly 1 year ago.)

Approved by: re (kensmith)

14 years agoFix serial console on Apple Xserve G5 by falling back to input-device-1
nwhitehorn [Thu, 23 Jul 2009 12:51:27 +0000 (12:51 +0000)]
Fix serial console on Apple Xserve G5 by falling back to input-device-1
if input-device is unavailable. The Xserve G5 defaults to using
screen/keyboard for output-device/input-device even if these are not
installed, and then falls back to serial ports at boot time.

Reviewed by: marcel
Hardware from: grehan
Approved by: re (kib)

14 years agoAdd the -d switch to the usage message.
brian [Thu, 23 Jul 2009 10:20:12 +0000 (10:20 +0000)]
Add the -d switch to the usage message.

Submitted by: Emil Mikulic - emil at dmr dot ath dot cx
Approved by: re (kib)
MFC after: 1 week

14 years agoIt is believed the last of the base system that could have an issue with
kensmith [Wed, 22 Jul 2009 22:13:42 +0000 (22:13 +0000)]
It is believed the last of the base system that could have an issue with
IDs larger than 16-bits has been updated so adjust sysinstall to allow
IDs up to the current system-wide size of 32-bits.

Approved by: re (kib)

14 years agoIt is believed the last subsystem that limited ID sizes to something
kensmith [Wed, 22 Jul 2009 20:46:17 +0000 (20:46 +0000)]
It is believed the last subsystem that limited ID sizes to something
other than the current system-wide size (32-bits) has been updated so
for now just cautiously turn the check off.  While here fix the check
for IDs being too large which doesn't work due to type mis-matches.

Reviewed by:    jhb (previous version)
Approved by: re (kib)
MFC after: 1 month (type mis-match fixes only)

14 years agoWhen vfs.newnfs.callback_addr is set to an IPv4 address, the
rmacklem [Wed, 22 Jul 2009 18:10:44 +0000 (18:10 +0000)]
When vfs.newnfs.callback_addr is set to an IPv4 address, the
experimental NFSv4 client might try and use it as an IPv6 address,
breaking callbacks. The fix simply initializes the isinet6 variable
for this case.

Approved by: re (kensmith), kib (mentor)

14 years agoFix extattr_list_file(2) on ZFS in case the attribute directory
trasz [Wed, 22 Jul 2009 15:15:58 +0000 (15:15 +0000)]
Fix extattr_list_file(2) on ZFS in case the attribute directory
doesn't exist and user doesn't have write access to the file.
Without this fix, it returns bogus value instead of 0.  For some
reason this didn't manifest on my kernel compiled with -O0.

PR: kern/136601
Submitted by: Jaakko Heinonen <jh at saunalahti dot fi>
Approved by: re (kib)

14 years agoAdd changes to the experimental nfs client to use the PBDRY flag for
rmacklem [Wed, 22 Jul 2009 14:37:53 +0000 (14:37 +0000)]
Add changes to the experimental nfs client to use the PBDRY flag for
msleep(9) when a vnode lock or similar may be held. The changes are
just a clone of the changes applied to the regular nfs client by
r195703.

Approved by: re (kensmith), kib (mentor)

14 years agoWhen the page caching attributes are changed, after new mapping is
kib [Wed, 22 Jul 2009 14:32:38 +0000 (14:32 +0000)]
When the page caching attributes are changed, after new mapping is
established, OS shall flush the caches on all processors that may have
used the mapping previously. This operation is not needed if processors
support self-snooping. If not, but clflush instruction is implemented
on the CPU, series of the clflush can be used on the mapping region.
Otherwise, we have to flush the whole cache. The later operation is very
expensive, and AMD-made CPUs do not have self-snooping.

Implement cache flush for remapped region by using clflush for amd64,
when supported by CPU.

Proposed and reviewed by: alc
Approved by: re (kensmith)

14 years agoWhen using an NFSv4 mount in the experimental nfs client with delegations
rmacklem [Wed, 22 Jul 2009 14:32:28 +0000 (14:32 +0000)]
When using an NFSv4 mount in the experimental nfs client with delegations
being issued from the server, there was a case where an Open issued locally
based on the delegation would be released before the associated vnode
became inactive. If the delegation was recalled after the open was released,
an Open against the server would not have been acquired and subsequent I/O
operations would need to use the special stateid of all zeros. This patch
fixes that case.

Approved by: re (kensmith), kib (mentor)

14 years agomxge's tunable hw.mxge.rss_hash_type cannot be set from the
gallatin [Wed, 22 Jul 2009 11:57:34 +0000 (11:57 +0000)]
mxge's tunable hw.mxge.rss_hash_type cannot be set from the
loader, because it uses a reserved suffix (_type).  Fix
this by removing the "_" and renaming the tunable to
hw.mxge.rss_hashtype.  The old (rss_hash_type) tunable is
still fetched, in case people load the driver via scripts.
When both are present in the kernel environment,
the new value (hw.mxge.rss_hashtype) overrides the old
value.

Approved by: re (kib)

14 years agoRemove the "dedicated disk mode" partitioning option from sysinstall, in
cperciva [Wed, 22 Jul 2009 03:50:54 +0000 (03:50 +0000)]
Remove the "dedicated disk mode" partitioning option from sysinstall, in
both the disk partitioning screen (the 'F' key) and via install.cfg (the
VAR_DEDICATED_DISK option).  This functionality is currently broken in 8.x
due to libdisk and geom generating different partition names; this commit
merely acts to help steer users away from the breakage.

Submitted by: randi
Approved by: re (kensmith)

14 years agoOutput DWARF debug information for global 'using' declarations, instead
bms [Wed, 22 Jul 2009 01:07:11 +0000 (01:07 +0000)]
Output DWARF debug information for global 'using' declarations, instead
of just blowing up. A very similar change to this exists which is
GPLv3 licensed, this is my own change.

This problem was triggered by running the Boost regression tests.

See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31899
Reviewed by: luigi
Approved by: re (kib)

14 years agosysctl_msec_to_ticks is used with both virtualized and
bz [Tue, 21 Jul 2009 21:58:55 +0000 (21:58 +0000)]
sysctl_msec_to_ticks is used with both virtualized and
non-vrtiualized sysctls so we cannot used one common function.

Add a macro to convert the arg1 in the virtualized case to
vnet.h to not expose the maths to all over the code.

Add a wrapper for the single virtualized call, properly handling
arg1 and call the default implementation from there.

Convert the two over places to use the new macro.

Reviewed by: rwatson
Approved by: re (kib)

14 years agostore mesh timers as ticks and sysctls for changing the defaults
sam [Tue, 21 Jul 2009 19:38:22 +0000 (19:38 +0000)]
store mesh timers as ticks and sysctls for changing the defaults

Reviewed by: rpaulo
Approved by: re (kib)

14 years agoCorrect handling of keys that already have a hardware/device key index:
sam [Tue, 21 Jul 2009 19:36:32 +0000 (19:36 +0000)]
Correct handling of keys that already have a hardware/device key index:
this was broken in r183248 when the check of wk_keyix was replaced by
a check of IEEE80211_KEY_DEVKEY (because the flag was clobbered).  Define
IEEE80211_KEY_DEVICE to specify flags that are owned by net80211/driver
and use this to preserve IEEE80211_KEY_DEVKEY so we don't ask the driver
for another key index when we already have one.

Testing by: Daniel Thiele, Wes Morgan
Reviewed by: rpaulo
Approved by: re (kib)

14 years agoupdate for recent mesh additions
sam [Tue, 21 Jul 2009 19:25:25 +0000 (19:25 +0000)]
update for recent mesh additions

Approved by: re (kib)

14 years agocorrect setup of opt_ddb.h
sam [Tue, 21 Jul 2009 19:24:53 +0000 (19:24 +0000)]
correct setup of opt_ddb.h

Submitted by: jkim
Approved by: re (kib)

14 years agoFix handling of AR_RX_FILTER_BSSID: write the shadow value for AR_MISC_MODE
sam [Tue, 21 Jul 2009 19:23:34 +0000 (19:23 +0000)]
Fix handling of AR_RX_FILTER_BSSID: write the shadow value for AR_MISC_MODE
so other register writes preserve the setting of AR_MISC_MODE_BSSID_MATCH_FORCE.

Reviewed by: rpaulo
Approved by: re (kib)

14 years agoAdd a MD __PCI_BAR_ZERO_VALID which denotes that BARs containing 0
marius [Tue, 21 Jul 2009 19:06:39 +0000 (19:06 +0000)]
Add a MD __PCI_BAR_ZERO_VALID which denotes that BARs containing 0
actually specify valid bases that should be treated just as normal.
The PCI specifications have no indication that 0 would be a magic value
indicating a disabled BAR as commonly used on at least amd64 and i386
but not sparc64. It's unclear what to do in pci_delete_resource()
instead of writing 0 to a BAR though as there's no (other) way do
disable individual BARs so its decoding is left enabled in case of
__PCI_BAR_ZERO_VALID for now.

Approved by: re (kib), jhb
MFC after: 1 week

14 years agotrack whether any mesh vaps are present to correctly setup the rx filter
sam [Tue, 21 Jul 2009 19:01:04 +0000 (19:01 +0000)]
track whether any mesh vaps are present to correctly setup the rx filter
when, for example, an ap vap is created first

Reviewed by: rpaulo
Approved by: re (kib)

14 years agoCatch up with r195249, "Improve the handling of cpuset with interrupts."
alc [Tue, 21 Jul 2009 16:54:11 +0000 (16:54 +0000)]
Catch up with r195249, "Improve the handling of cpuset with interrupts."
Specifically, update the return type of xenpic_assign_cpu() so that this
file compiles again.

Approved by: re (kib)

14 years agoFix the logic to count the number of "live interfaces". With this change
sam [Tue, 21 Jul 2009 15:06:10 +0000 (15:06 +0000)]
Fix the logic to count the number of "live interfaces".  With this change
dhclient now terminates when the underlying ifnet is destroyed (e.g.
on card eject).

Reviewed by: brooks
Approved by: re (kib)

14 years agoEnable mesh support.
rpaulo [Tue, 21 Jul 2009 14:23:05 +0000 (14:23 +0000)]
Enable mesh support.

Submitted by: jkim
Approved by: re (kib)

14 years agoImprove the printf message when a module failed to load. This gives the
rpaulo [Tue, 21 Jul 2009 14:18:25 +0000 (14:18 +0000)]
Improve the printf message when a module failed to load. This gives the
user some clue about the possibility of a __FreeBSD_version mismatch.

Discussed with: rwatson, jhb
Approved by: re (kib)

14 years agoAdd `siis` CAM driver for SiliconImage SiI3124/3132/3531 SATA2 controllers.
mav [Tue, 21 Jul 2009 12:32:46 +0000 (12:32 +0000)]
Add `siis` CAM driver for SiliconImage SiI3124/3132/3531 SATA2 controllers.

Driver supports Serial ATA and ATAPI devices, Port Multipliers
(including FIS-based switching), hardware command queues (31 command
per port) and Native Command Queuing. This is probably the second on
popularity, after AHCI, type of SATA2 controllers, that benefits from
using CAM, because of hardware command queuing support.

Approved by:    re (kib)

14 years ago- Add my birthday
yzlin [Tue, 21 Jul 2009 09:54:04 +0000 (09:54 +0000)]
- Add my birthday
- Add myself to ports committers and to lwhsu's mentee list

Approved by: re (kib), lwhsu (mentor)

14 years agoDo not use OCP85XX_LBC_OFF twice when accessing LBC registers on MPC85XX.
raj [Tue, 21 Jul 2009 08:38:45 +0000 (08:38 +0000)]
Do not use OCP85XX_LBC_OFF twice when accessing LBC registers on MPC85XX.

It turns LBC control registers were not programmed correctly on MPC85XX. We
were accessing bogus addresses as the base offset (OCP85XX_LBC_OFF) was
erroneously added during offset calculations.  Effectively the state of LBC
control registers was not altered by the kernel initialization code, but
everything worked as long as we coincided to use the same settings (LBC decode
windows) as firmware has initialized.

Submitted by: Lukasz Wojcik
Reviewed by: marcel
Approved by: re (kensmith)
Obtained from: Semihalf

14 years agoMake dcache_inv_range() point to the proper routines on ARM9 and ARM9E/ARM10.
raj [Tue, 21 Jul 2009 08:29:19 +0000 (08:29 +0000)]
Make dcache_inv_range() point to the proper routines on ARM9 and ARM9E/ARM10.

On some ARM variations CPU func dispatcher has the D-cache invalidate method
point to write-back invalidate, which is wrong, and can lead to a crash/panic
on affected platforms.

Spotted by: HPS
Reviewed by: cognet
Approved by: re (kib)

14 years agoFix regression in last set of commits. Submitted via e-mail and then
cokane [Mon, 20 Jul 2009 23:21:19 +0000 (23:21 +0000)]
Fix regression in last set of commits. Submitted via e-mail and then
nagged again via PR. Thank Paul for his persistence and contributions.

PR: 136895
Submitted by: Paul B. Mahol <onemda@gmail.com>
Reviewed by: sam (timeout, 10 days), weongyo (timeout, 10 days), me
Approved by: re (Kostik Belousov <kostikbel@gmail.com>)

14 years agoUpdate ObsoleteFiles.inc
antoine [Mon, 20 Jul 2009 19:51:47 +0000 (19:51 +0000)]
Update ObsoleteFiles.inc
- Remove some USB headers that were resurrected recently
- Add new obsolete files (2 man pages and libvgl.so.5)

Approved by: re (kib)

14 years agoBack out the moving in r195782 of V_ip_id's initialization from the top
rwatson [Mon, 20 Jul 2009 19:40:09 +0000 (19:40 +0000)]
Back out the moving in r195782 of V_ip_id's initialization from the top
back to the bottom of ip_init() as found in 7.x.  I missed the fact that
the bottom half of the init routine only runs in the !VNET case.

Submitted by: zec
Approved by: re (vimage blanket)

14 years agoFix permission handling for extended attributes in ZFS. Without
trasz [Mon, 20 Jul 2009 19:16:42 +0000 (19:16 +0000)]
Fix permission handling for extended attributes in ZFS.  Without
this change, ZFS uses SunOS Alternate Data Streams semantics - each
EA has its own permissions, which are set at EA creation time
and - unlike SunOS - invisible to the user and impossible to change.
From the user point of view, it's just broken: sometimes access
is granted when it shouldn't be, sometimes it's denied when
it shouldn't be.

This patch makes it behave just like UFS, i.e. depend on current
file permissions.  Also, it fixes returned error codes (ENOATTR
instead of ENOENT) and makes listextattr(2) return 0 instead
of EPERM where there is no EA directory (i.e. the file never had
any EA).

Reviewed by: pjd (idea, not actual code)
Approved by: re (kib)

14 years agoMore mesh bits, namely:
rpaulo [Mon, 20 Jul 2009 19:12:08 +0000 (19:12 +0000)]
More mesh bits, namely:
* bridge support (sam)
* handling of errors (sam)
* deletion of inactive routing entries
* more debug msgs (sam)
* fixed some inconsistencies with the spec.
* decap is now specific to mesh (sam)
* print mesh seq. no. on ifconfig list mesh
* small perf. improvements

Reviewed by: sam
Approved by: re (kib)

14 years agoGarbage collect vnet module registrations that have neither constructors
rwatson [Mon, 20 Jul 2009 13:55:33 +0000 (13:55 +0000)]
Garbage collect vnet module registrations that have neither constructors
nor destructors, as there's no actual work to do.

In most cases, the constructors weren't needed because of the existing
protocol initialization functions run by net_init_domain() as part of
VNET_MOD_NET, or they were eliminated when support for static
initialization of virtualized globals was added.

Garbage collect dependency references to modules without constructors or
destructors, notably VNET_MOD_INET and VNET_MOD_INET6.

Reviewed by: bz
Approved by: re (vimage blanket)

14 years agoARM pmap fixes.
raj [Mon, 20 Jul 2009 07:53:07 +0000 (07:53 +0000)]
ARM pmap fixes.

a)  nocache-remap problem

   When a page is remapped into a non-cacheable virtual memory region there
   was no associated write-back invalidate operation performed. We remove
   writeback of the original buffer size from bus_dmamem_alloc() and add
   appropriate L1/L2 flush operation.

b) missing write-back invalidate operation

   In pmap_kremove a page is removed so we must do a write-back
   invalidate operation aligned to the page virtual address.

Submitted by: Michal Hajduk
Reviewed by: Mark Tinguely, rpaulo, stas
Approved by: re (kib)
Obtained from: Semihalf

14 years agoAdd macros VNET_SETNAME and VNET_SYMPREFIX, and expose to userspace if
rwatson [Mon, 20 Jul 2009 07:50:50 +0000 (07:50 +0000)]
Add macros VNET_SETNAME and VNET_SYMPREFIX, and expose to userspace if
_WANT_VNET is defined.  This way we don't need separate definitions in
libkvm.

Reviewed by: bz
Approved by: re (vimage blanket)

14 years agoFix an apparently harmless typo.
scottl [Mon, 20 Jul 2009 03:59:00 +0000 (03:59 +0000)]
Fix an apparently harmless typo.

Approved by: re

14 years agoChange the handling of fictitious pages by pmap_page_set_memattr() on
alc [Sun, 19 Jul 2009 21:40:19 +0000 (21:40 +0000)]
Change the handling of fictitious pages by pmap_page_set_memattr() on
amd64 and i386.  Essentially, fictitious pages provide a mechanism for
creating aliases for either normal or device-backed pages.  Therefore,
pmap_page_set_memattr() on a fictitious page needn't update the direct
map or flush the cache.  Such actions are the responsibility of the
"primary" instance of the page or the device driver that "owns" the
physical address.  For example, these actions are already performed by
pmap_mapdev().

The device pager needn't restore the memory attributes on a fictitious
page before releasing it.  It's now pointless.

Add pmap_page_set_memattr() to the Xen pmap.

Approved by: re (kib)

14 years agoWhen buffer write is failed, it is wrong for brelse() to invalidate
kib [Sun, 19 Jul 2009 20:25:59 +0000 (20:25 +0000)]
When buffer write is failed, it is wrong for brelse() to invalidate
portion of the page that was written. Among other problems, this
page might be picked up by pagedaemon, with failed assertion in
vm_pageout_flush() about validity of the page.

Reported and tested by: pho
Approved by: re (kensmith)
MFC after: 3 weeks

14 years agoDon't get stuck in an infinite loop comparing (short++ <= maxshort)
brian [Sun, 19 Jul 2009 19:01:30 +0000 (19:01 +0000)]
Don't get stuck in an infinite loop comparing (short++ <= maxshort)

PR: 136893
Submitted by: Aragon Gouveia - aragon at phat dot za dot net (mostly)
Approved by: re (kib)
MFC after: 3 weeks

14 years agoNormalize field naming for struct vnet, fix two debugging printfs that
rwatson [Sun, 19 Jul 2009 17:40:45 +0000 (17:40 +0000)]
Normalize field naming for struct vnet, fix two debugging printfs that
print them.

Reviewed by: bz
Approved by: re (kensmith, kib)

14 years agoAllow creating hard links to symlinks using ln(1).
jilles [Sun, 19 Jul 2009 17:35:23 +0000 (17:35 +0000)]
Allow creating hard links to symlinks using ln(1).

This implements the POSIX.1-2008 -L and -P flags.

The default remains to create hard links to the target of symlinks.

Approved by: re (kib), ed (mentor)