]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoReimplement and/or implement vnet list locking by replacing a mostly
rwatson [Sun, 19 Jul 2009 14:20:53 +0000 (14:20 +0000)]
Reimplement and/or implement vnet list locking by replacing a mostly
unused custom mutex/condvar-based sleep locks with two locks: an
rwlock (for non-sleeping use) and sxlock (for sleeping use).  Either
acquired for read is sufficient to stabilize the vnet list, but both
must be acquired for write to modify the list.

Replace previous no-op read locking macros, used in various places
in the stack, with actual locking to prevent race conditions.  Callers
must declare when they may perform unbounded sleeps or not when
selecting how to lock.

Refactor vnet sysinits so that the vnet list and locks are initialized
before kernel modules are linked, as the kernel linker will use them
for modules loaded by the boot loader.

Update various consumers of these KPIs based on whether they may sleep
or not.

Reviewed by: bz
Approved by: re (kib)

15 years agoMove code that does payload realigment to a new routine, ieee80211_realign,
sam [Sat, 18 Jul 2009 20:19:53 +0000 (20:19 +0000)]
Move code that does payload realigment to a new routine, ieee80211_realign,
so it can be reused.  While here rewrite the logic to always use a single mbuf.

Reviewed by: rpaulo
Approved by: re (kib)

15 years agoFix a problem, whereby misbehaving IPv6 applications, which don't include
bms [Sat, 18 Jul 2009 17:38:18 +0000 (17:38 +0000)]
Fix a problem, whereby misbehaving IPv6 applications, which don't include
a valid zone ID or interface identifier in a v6 multicast leave, would
trigger a fairly paranoid KASSERT().

Observed with Boost++ regression tests on ref8.freebsd.org.

Approved by: re (kib)

15 years agoAdd an entry for etc/pam.d/gdm as this file is no longer required.
marcus [Sat, 18 Jul 2009 16:33:27 +0000 (16:33 +0000)]
Add an entry for etc/pam.d/gdm as this file is no longer required.

Approved by: re (kib)

15 years agoRemove gdm as it is no longer needed.
marcus [Sat, 18 Jul 2009 16:29:40 +0000 (16:29 +0000)]
Remove gdm as it is no longer needed.

Approved by: re (kib)
Reminded by: nork

15 years ago- Fix the issue with read access count modification on RAID-5 plexes properly.
lulf [Sat, 18 Jul 2009 11:12:48 +0000 (11:12 +0000)]
- Fix the issue with read access count modification on RAID-5 plexes properly.
  If the access counts were not increased and decreased in equal numbers by
  gvinum consumers, the read access count would be inconsistent with the write
  access count. Instead, modify the read access count with the write access
  count directly to prevent any inconsistencies.

Approved by: re (kib)

15 years agoRemove no longer needed #include after removing the legacy
bz [Sat, 18 Jul 2009 10:36:18 +0000 (10:36 +0000)]
Remove no longer needed #include after removing the legacy
vimage API in r195741.

Reviewed by: rwatson
Approved by: re (kib)

15 years agoRemove this file. It is no longer needed as x11/gdm provides its own
marcus [Sat, 18 Jul 2009 06:08:21 +0000 (06:08 +0000)]
Remove this file.  It is no longer needed as x11/gdm provides its own
version under /usr/local/etc/pam.d.

Approved by: re (kib)

15 years agoAn addendum to r195649, "Add support to the virtual memory system for
alc [Sat, 18 Jul 2009 01:50:05 +0000 (01:50 +0000)]
An addendum to r195649, "Add support to the virtual memory system for
configuring machine-dependent memory attributes...":

Don't set the memory attribute for a "real" page that is allocated to
a device object in vm_page_alloc().  It is a pointless act, because
the device pager replaces this "real" page with a "fake" page and sets
the memory attribute on that "fake" page.

Eliminate pointless code from pmap_cache_bits() on amd64.

Employ the "Self Snoop" feature supported by some x86 processors to
avoid cache flushes in the pmap.

Approved by: re (kib)

15 years agoFix copy-paste bug. Use regular non-polled mode for executing FLUSHCACHE
mav [Fri, 17 Jul 2009 21:48:08 +0000 (21:48 +0000)]
Fix copy-paste bug. Use regular non-polled mode for executing FLUSHCACHE
command on disk close.

Approved by: re (implicitly)

15 years agoStore accurate offset information in CTF data. A large number of
np [Fri, 17 Jul 2009 21:15:09 +0000 (21:15 +0000)]
Store accurate offset information in CTF data.  A large number of
structs had incorrect member offsets, limiting dtrace's usefulness
when working with them.  An example of incorrect info (struct
rtentry) from before this fix:

<1738> STRUCT rtentry (200 bytes)
      rt_nodes type=1731 off=0
      rt_gateway type=849 off=65280 <== WRONG, should be 8 * 96
      rt_flags type=3 off=65344     <== wrong again, and so on..
...

Approved by: re (kib), gnn (mentor)
MFC after: 2 weeks

15 years agoadd mesh support
sam [Fri, 17 Jul 2009 21:11:08 +0000 (21:11 +0000)]
add mesh support

Submitted by: rpaulo
Approved by: re (kib)

15 years agoImplement RTLD_NOLOAD flag for dlopen(3).
kib [Fri, 17 Jul 2009 19:45:42 +0000 (19:45 +0000)]
Implement RTLD_NOLOAD flag for dlopen(3).

Requested and tested by: jkim
Reviewed by: kan
Approved by: re (kensmith)

15 years agoPatch the regular nfs client in a manner analagous to
rmacklem [Fri, 17 Jul 2009 19:38:07 +0000 (19:38 +0000)]
Patch the regular nfs client in a manner analagous to
r195704 for the experimental client. The patch avoids calling vn_lock()
for the case where nfs_nget() has acquired the same vnode as dvp,
since nfs_nget() has already locked the vnode.

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

15 years agoOnly perform .bss mapping and cleaning operations when segment file size
kib [Fri, 17 Jul 2009 19:32:04 +0000 (19:32 +0000)]
Only perform .bss mapping and cleaning operations when segment file size
is not equal to its memory size.

This eliminates unneeded clearing of the text segment that often
happens due to text end not being page-aligned.

For instance,
$ readelf -l /lib/libedit.so.6
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x139e1 0x139e1 R E 0x1000
  LOAD           0x014000 0x00014000 0x00014000 0x00f04 0x00f14 RW  0x1000
  DYNAMIC        0x014cc4 0x00014cc4 0x00014cc4 0x000d0 0x000d0 RW  0x4
$ procstat -v $$ (for /bin/sh)
68585 0x28097000 0x280aa000 r-x    6    0  21  14 CN vn /lib/libedit.so.6
68585 0x280aa000 0x280ab000 r-x    1    0   1   0 CN vn /lib/libedit.so.6 <==
68585 0x280ab000 0x280ac000 rwx    1    0   1   0 CN vn /lib/libedit.so.6
Note the splitted map entry marked by '<=='.

Reviewed by: kan
Approved by: re (kensmith)
MFC after: 1 month

15 years agoAdd IEEE80211_SUPPORT_MESH, following similar change to nanobsd and
rpaulo [Fri, 17 Jul 2009 18:35:45 +0000 (18:35 +0000)]
Add IEEE80211_SUPPORT_MESH, following similar change to nanobsd and
other GENERIC kernels.

Approved by: re (kib)

15 years agoRemove the interim vimage containers, struct vimage and struct procg,
jamie [Fri, 17 Jul 2009 14:48:21 +0000 (14:48 +0000)]
Remove the interim vimage containers, struct vimage and struct procg,
and the ioctl-based interface that supported them.

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

15 years agoImport OpenBSM 1.1p1 from vendor branch to 8-CURRENT, populating
rwatson [Fri, 17 Jul 2009 14:02:20 +0000 (14:02 +0000)]
Import OpenBSM 1.1p1 from vendor branch to 8-CURRENT, populating
contrib/openbsm and a subset also imported into sys/security/audit.
This patch release addresses several minor issues:

- Fixes to AUT_SOCKUNIX token parsing.
- IPv6 support for au_to_me(3).
- Improved robustness in the parsing of audit_control, especially long
  flags/naflags strings and whitespace in all fields.
- Add missing conversion of a number of FreeBSD/Mac OS X errnos to/from BSM
  error number space.

MFC after: 3 weeks
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
Approved by: re (kib)

15 years agoRemove unused VNET_SET() and related macros; only VNET_GET() is
rwatson [Thu, 16 Jul 2009 21:13:04 +0000 (21:13 +0000)]
Remove unused VNET_SET() and related macros; only VNET_GET() is
ever actually used.  Rename VNET_GET() to VNET() to shorten
variable references.

Discussed with: bz, julian
Reviewed by: bz
Approved by: re (kensmith, kib)

15 years agoFix several instances of spaces before commas, and one of a space
dougb [Thu, 16 Jul 2009 20:29:36 +0000 (20:29 +0000)]
Fix several instances of spaces before commas, and one of a space
before a ).

PR: docs/136723
Submitted by: Ulrich Sporlein <uqs@spoerlein.net>
Approved by: re (kib)

15 years agoCorrect the name of the Mongolian Documentation package.
kensmith [Thu, 16 Jul 2009 20:19:36 +0000 (20:19 +0000)]
Correct the name of the Mongolian Documentation package.

Approved by: re (kib)

15 years agoLimit IOCATAREQUEST ioctl data size to controller's maximum I/O size.
mav [Thu, 16 Jul 2009 19:48:39 +0000 (19:48 +0000)]
Limit IOCATAREQUEST ioctl data size to controller's maximum I/O size.
It fixes kernel panic when requested size is too large (0xffffffff),

PR:             kern/136726
Approved by:    re (kib)
MFC after:      2 weeks

15 years agoPrepare for the 8.0-BETA2 builds.
kensmith [Wed, 15 Jul 2009 17:29:05 +0000 (17:29 +0000)]
Prepare for the 8.0-BETA2 builds.

Approved by: re (implicit)

15 years agodtrace_gethrtime: improve scaling of TSC ticks to nanoseconds
avg [Wed, 15 Jul 2009 17:07:39 +0000 (17:07 +0000)]
dtrace_gethrtime: improve scaling of TSC ticks to nanoseconds

Currently dtrace_gethrtime uses formula similar to the following for
converting TSC ticks to nanoseconds:
rdtsc() * 10^9 / tsc_freq
The dividend overflows 64-bit type and wraps-around every 2^64/10^9 =
18446744073 ticks which is just a few seconds on modern machines.

Now we instead use precalculated scaling factor of
10^9*2^N/tsc_freq < 2^32 and perform TSC value multiplication separately
for each 32-bit half.  This allows to avoid overflow of the dividend
described above.
The idea is taken from OpenSolaris.
This has an added feature of always scaling TSC with invariant value
regardless of TSC frequency changes. Thus the timestamps will not be
accurate if TSC actually changes, but they are always proportional to
TSC ticks and thus monotonic. This should be much better than current
formula which produces wildly different non-monotonic results on when
tsc_freq changes.

Also drop write-only 'cp' variable from amd64 dtrace_gethrtime_init()
to make it identical to the i386 twin.

PR: kern/127441
Tested by: Thomas Backman <serenity@exscape.org>
Reviewed by: jhb
Discussed with: current@, bde, gnn
Silence from: jb
Approved by: re (gnn)
MFC after: 1 week

15 years agocorrect IEEE80211_RADIOTAP_XCHANNEL to match system
sam [Wed, 15 Jul 2009 13:50:06 +0000 (13:50 +0000)]
correct IEEE80211_RADIOTAP_XCHANNEL to match system

Submitted by: Guy Harris
Approved by: re (kib)

15 years agor195699 introduced an assertion regarding when progbits data in kernel
rwatson [Wed, 15 Jul 2009 09:19:01 +0000 (09:19 +0000)]
r195699 introduced an assertion regarding when progbits data in kernel
modules was present, which turns out to be false in some situations.
Back out the assertion.

Reported by: Luiz Otavio O Souza <lists.br at gmail.com>,
Florian Smeets <flo at kasimir.com>
Approved by: re (kensmith) (implicit)

15 years agoAdd missing license line for vnet.h, correct white space nit.
rwatson [Wed, 15 Jul 2009 00:56:15 +0000 (00:56 +0000)]
Add missing license line for vnet.h, correct white space nit.

Approved by: re (kensmith) (implicit)

15 years agoFix the experimental nfs client so that it does not cause a
rmacklem [Tue, 14 Jul 2009 23:10:23 +0000 (23:10 +0000)]
Fix the experimental nfs client so that it does not cause a
"share->excl" panic when doing a lookup of dotdot at the root
of a server's file system. The patch avoids calling vn_lock()
for that case, since nfscl_nget() has already acquired a lock
for the vnode.

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

15 years agoUse PBDRY flag for msleep(9) in NFS and NLM when sleeping thread owns
kib [Tue, 14 Jul 2009 22:54:29 +0000 (22:54 +0000)]
Use PBDRY flag for msleep(9) in NFS and NLM when sleeping thread owns
kernel resources that block other threads, like vnode locks. The SIGSTOP
sent to such thread (process, rather) shall not stop it until thread
releases the resources.

Tested by: pho
Reviewed by: jhb
Approved by: re (kensmith)

15 years agoAdd new msleep(9) flag PBDY that shall be specified together with
kib [Tue, 14 Jul 2009 22:52:46 +0000 (22:52 +0000)]
Add new msleep(9) flag PBDY that shall be specified together with
PCATCH, to indicate that thread shall not be stopped upon receipt of
SIGSTOP until it reaches the kernel->usermode boundary.

Also change thread_single(SINGLE_NO_EXIT) to only stop threads at
the user boundary unconditionally.

Tested by: pho
Reviewed by: jhb
Approved by: re (kensmith)

15 years agoMove the repeated code to calculate the number of the threads in the
kib [Tue, 14 Jul 2009 22:51:31 +0000 (22:51 +0000)]
Move the repeated code to calculate the number of the threads in the
process that still need to be suspended or exited from thread_single
into the new function calc_remaining().

Tested by: pho
Reviewed by: jhb
Approved by: re (kensmith)

15 years agoWhen wakeup(9) is going to notify swapper, assert that wait channel is not
kib [Tue, 14 Jul 2009 22:50:41 +0000 (22:50 +0000)]
When wakeup(9) is going to notify swapper, assert that wait channel is not
equal to &proc0. It shall be not, since proc0 stack is not swappable, and
kick_proc0() is wakeup(&proc0).

Reviewed by: jhb
Approved by: re (kensmith)

15 years agoBuild on Jeff Roberson's linker-set based dynamic per-CPU allocator
rwatson [Tue, 14 Jul 2009 22:48:30 +0000 (22:48 +0000)]
Build on Jeff Roberson's linker-set based dynamic per-CPU allocator
(DPCPU), as suggested by Peter Wemm, and implement a new per-virtual
network stack memory allocator.  Modify vnet to use the allocator
instead of monolithic global container structures (vinet, ...).  This
change solves many binary compatibility problems associated with
VIMAGE, and restores ELF symbols for virtualized global variables.

Each virtualized global variable exists as a "reference copy", and also
once per virtual network stack.  Virtualized global variables are
tagged at compile-time, placing the in a special linker set, which is
loaded into a contiguous region of kernel memory.  Virtualized global
variables in the base kernel are linked as normal, but those in modules
are copied and relocated to a reserved portion of the kernel's vnet
region with the help of a the kernel linker.

Virtualized global variables exist in per-vnet memory set up when the
network stack instance is created, and are initialized statically from
the reference copy.  Run-time access occurs via an accessor macro, which
converts from the current vnet and requested symbol to a per-vnet
address.  When "options VIMAGE" is not compiled into the kernel, normal
global ELF symbols will be used instead and indirection is avoided.

This change restores static initialization for network stack global
variables, restores support for non-global symbols and types, eliminates
the need for many subsystem constructors, eliminates large per-subsystem
structures that caused many binary compatibility issues both for
monitoring applications (netstat) and kernel modules, removes the
per-function INIT_VNET_*() macros throughout the stack, eliminates the
need for vnet_symmap ksym(2) munging, and eliminates duplicate
definitions of virtualized globals under VIMAGE_GLOBALS.

Bump __FreeBSD_version and update UPDATING.

Portions submitted by:  bz
Reviewed by:            bz, zec
Discussed with:         gnn, jamie, jeff, jhb, julian, sam
Suggested by:           peter
Approved by:            re (kensmith)

15 years agoSecond attempt at eliminating .text relocations in shared libraries
kan [Tue, 14 Jul 2009 21:19:13 +0000 (21:19 +0000)]
Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by:        kib
Approved by:        re (kib)

15 years ago- Change mmap() to fail requests with EINVAL that pass a length of 0. This
jhb [Tue, 14 Jul 2009 19:45:36 +0000 (19:45 +0000)]
- Change mmap() to fail requests with EINVAL that pass a length of 0.  This
  behavior is mandated by POSIX.
- Do not fail requests that pass a length greater than SSIZE_MAX
  (such as > 2GB on 32-bit platforms).  The 'len' parameter is actually
  an unsigned 'size_t' so negative values don't really make sense.

Submitted by: Alexander Best  alexbestms at math.uni-muenster.de
Reviewed by: alc
Approved by: re (kib)
MFC after: 1 week

15 years agoAdd missing MLINKS for acl_{get,set}_link_fd(3).
trasz [Tue, 14 Jul 2009 19:37:53 +0000 (19:37 +0000)]
Add missing MLINKS for acl_{get,set}_link_fd(3).

Approved by: re (kib)

15 years agoRe-add opt_inet.h, as we did in r193862 and lost yet again.
bz [Tue, 14 Jul 2009 19:32:36 +0000 (19:32 +0000)]
Re-add opt_inet.h, as we did in r193862 and lost yet again.

Approved by: re (kib)

15 years agoDisable MSI by default for nVidia MCP55 chipset.
mav [Tue, 14 Jul 2009 19:18:31 +0000 (19:18 +0000)]
Disable MSI by default for nVidia MCP55 chipset.
It is reported to be broken in the same way as MCP51.

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

15 years ago- Do aggresive saturation on various polynomial interpolators.
ariff [Tue, 14 Jul 2009 18:53:34 +0000 (18:53 +0000)]
- Do aggresive saturation on various polynomial interpolators.
  This dramatically pushing 99.9% interpolations and quantizations
  error _below_ -180dB on 32bit dynamic range, resulting extremely
  high quality conversion.
- Use BSPLINE interpolator for filter oversampling factor greater or
  equal than 64 (log2 6).

Approved by: re (kib)

15 years agoChange xpt_scan_bus to scsi_scan_bus and xpt_scan_lun to scsi_scan_lun
emaste [Tue, 14 Jul 2009 18:44:17 +0000 (18:44 +0000)]
Change xpt_scan_bus to scsi_scan_bus and xpt_scan_lun to scsi_scan_lun
in comments and printfs to match new function names after refacoring.

Approved by: re

15 years agoFix leaks in probestart, probedone, and scsi_scan_bus. Also free
emaste [Tue, 14 Jul 2009 17:26:37 +0000 (17:26 +0000)]
Fix leaks in probestart, probedone, and scsi_scan_bus.  Also free
page_list using the matching malloc type for the allocation.

Approved by: re
Reviewed by: scottl [1]
MFC after: 1 week

[1] Original patch was against xpt_cam.c, prior to the cam refactoring.

15 years agoUpdates, mostly to add 802.11s support:
sam [Tue, 14 Jul 2009 17:11:06 +0000 (17:11 +0000)]
Updates, mostly to add 802.11s support:
o add missing Status and Reason codes
o parse/display Action frames
o parse/display Mesh data frames
o parse/display BA frames

Reviewed by: rpaulo
Approved by: re (kib)

15 years agoFix a buglet that slipped into r195654. My buildworld/buildkernel sanity
lstewart [Tue, 14 Jul 2009 11:53:21 +0000 (11:53 +0000)]
Fix a buglet that slipped into r195654. My buildworld/buildkernel sanity
check missed this because cxgb's TOM is currently commented out of the build
system.

Submitted by: Navdeep Parhar <np at FreeBSD dot org>
Approved by: re (kensmith), kensmith (mentor temporarily unavailable)

15 years agoMake mklocale work again, now that fwrite()'s return codes are different.
ed [Tue, 14 Jul 2009 09:19:33 +0000 (09:19 +0000)]
Make mklocale work again, now that fwrite()'s return codes are different.

Submitted by: Navdeep Parhar <nparhar gmail com>
Approved by: re (kib)

15 years agoAdding hardware ID for RTL810x PCIe found on HP Pavilion DV2-1022AX.
avatar [Tue, 14 Jul 2009 04:35:13 +0000 (04:35 +0000)]
Adding hardware ID for RTL810x PCIe found on HP Pavilion DV2-1022AX.

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

15 years agoMatch PCI Express root bridge _HID directly instead of
jkim [Mon, 13 Jul 2009 21:36:31 +0000 (21:36 +0000)]
Match PCI Express root bridge _HID directly instead of
relying on _CID.

Reviewed by: jhb
Approved by: re (kib)

15 years agoFix copy-paste bug, enabling SIM PMP support, when it was not really found.
mav [Mon, 13 Jul 2009 21:21:30 +0000 (21:21 +0000)]
Fix copy-paste bug, enabling SIM PMP support, when it was not really found.

Approved by: re (implicitly)

15 years agoRevert the CISS driver to 64K i/o, the previous change was in error and
scottl [Mon, 13 Jul 2009 20:19:29 +0000 (20:19 +0000)]
Revert the CISS driver to 64K i/o, the previous change was in error and
missing a lot of needed infrastructure.

Approved by: re

15 years agoFix a few language nits.
joel [Mon, 13 Jul 2009 18:55:46 +0000 (18:55 +0000)]
Fix a few language nits.

Submitted by: Ben Kaduk <minimarmot@gmail.com>
Approved by: re (blanket)

15 years agoFix inline function declaration and prototype.
rpaulo [Mon, 13 Jul 2009 18:23:58 +0000 (18:23 +0000)]
Fix inline function declaration and prototype.

Approved by: re (kensmith)

15 years agoCorrect an error of omission in r195649 ("Add support to the virtual memory
alc [Mon, 13 Jul 2009 18:11:59 +0000 (18:11 +0000)]
Correct an error of omission in r195649 ("Add support to the virtual memory
system for configuring machine-dependent memory attributes: ...").  In
r195649, the "vm_cache_mode_t/vm_memattr_t" parameter was removed from
vm_phys_alloc_contig().

Approved by: re (kensmith)

15 years agoFix Marvel SATA controllers operation, broken by rev. 188765,
mav [Mon, 13 Jul 2009 18:01:49 +0000 (18:01 +0000)]
Fix Marvel SATA controllers operation, broken by rev. 188765,
by using uninitialized variable.

Tested by: Chris Hedley
Approved by: re (kensmith)

15 years agoMove msg{snd,recv,get,ctl} manual pages from section 3 to 2.
trasz [Mon, 13 Jul 2009 12:53:43 +0000 (12:53 +0000)]
Move msg{snd,recv,get,ctl} manual pages from section 3 to 2.

Approved by: re (kib)

15 years agoFix a race in the manipulation of the V_tcp_sack_globalholes global variable,
lstewart [Mon, 13 Jul 2009 11:59:38 +0000 (11:59 +0000)]
Fix a race in the manipulation of the V_tcp_sack_globalholes global variable,
which is currently not protected by any type of lock. When triggered, the bug
would sometimes cause a panic when the TCP activity to an affected machine
eventually slowed during a lull. The panic only occurs if INVARIANTS is compiled
into the kernel, and has laid dormant for some time as a result of INVARIANTS
being off by default except in FreeBSD-CURRENT.

Switch to atomic operations in the locations where the variable is changed.
Reads have not been updated to be protected by atomics, so there is a
possibility of accounting errors in any given calculation where the variable is
read. This is considered unlikely to occur in the wild, and will not cause
serious harm on rare occasions where it does.

Thanks to Robert Watson for debugging help.

Reported by: Kamigishi Rei <spambox at haruhiism dot net>
Tested by: Kamigishi Rei <spambox at haruhiism dot net>
Reviewed by: silby
Approved by: re (rwatson), kensmith (mentor temporarily unavailable)

15 years agoReplace struct tcpopt with a proxy toeopt struct in the TOE driver interface to
lstewart [Mon, 13 Jul 2009 11:51:02 +0000 (11:51 +0000)]
Replace struct tcpopt with a proxy toeopt struct in the TOE driver interface to
the TCP syncache. This returns struct tcpopt to being private within the TCP
implementation, thus allowing it to be modified without ABI concerns.

The patch breaks the ABI. Bump __FreeBSD_version to 800103 accordingly. The cxgb
driver is the only TOE consumer affected by this change, and needs to be
recompiled along with the kernel.

Suggested by: rwatson
Reviewed by: rwatson, kmacy
Approved by: re (kensmith), kensmith (mentor temporarily unavailable)

15 years agoRename ATA probe driver to "aprobe" to resolve name conflict with SCSI
mav [Mon, 13 Jul 2009 06:12:21 +0000 (06:12 +0000)]
Rename ATA probe driver to "aprobe" to resolve name conflict with SCSI
and fix loading cam as module.

Approved by: re (implicitly)

15 years ago1) Use our vendor domain at the pool.
dwmalone [Mon, 13 Jul 2009 05:51:33 +0000 (05:51 +0000)]
1) Use our vendor domain at the pool.
2) Point people at the pool website and encourage
   people to provide a server in the pool (as a
   courtesy to the pool guys).
3) Fix a spelling.
4) Comment out the local clock and include a link
   to documentation for use of the local clock on
   the ntp.org site.

Approved by: re (kib)

15 years agoAdd support to the virtual memory system for configuring machine-
alc [Sun, 12 Jul 2009 23:31:20 +0000 (23:31 +0000)]
Add support to the virtual memory system for configuring machine-
dependent memory attributes:

Rename vm_cache_mode_t to vm_memattr_t.  The new name reflects the
fact that there are machine-dependent memory attributes that have
nothing to do with controlling the cache's behavior.

Introduce vm_object_set_memattr() for setting the default memory
attributes that will be given to an object's pages.

Introduce and use pmap_page_{get,set}_memattr() for getting and
setting a page's machine-dependent memory attributes.  Add full
support for these functions on amd64 and i386 and stubs for them on
the other architectures.  The function pmap_page_set_memattr() is also
responsible for any other machine-dependent aspects of changing a
page's memory attributes, such as flushing the cache or updating the
direct map.  The uses include kmem_alloc_contig(), vm_page_alloc(),
and the device pager:

  kmem_alloc_contig() can now be used to allocate kernel memory with
  non-default memory attributes on amd64 and i386.

  vm_page_alloc() and the device pager will set the memory attributes
  for the real or fictitious page according to the object's default
  memory attributes.

Update the various pmap functions on amd64 and i386 that map pages to
incorporate each page's memory attributes in the mapping.

Notes: (1) Inherent to this design are safety features that prevent
the specification of inconsistent memory attributes by different
mappings on amd64 and i386.  In addition, the device pager provides a
warning when a device driver creates a fictitious page with memory
attributes that are inconsistent with the real page that the
fictitious page is an alias for. (2) Storing the machine-dependent
memory attributes for amd64 and i386 as a dedicated "int" in "struct
md_page" represents a compromise between space efficiency and the ease
of MFCing these changes to RELENG_7.

In collaboration with: jhb

Approved by: re (kib)

15 years agoadd IEEE80211_SCAN_REQ
sam [Sun, 12 Jul 2009 20:17:31 +0000 (20:17 +0000)]
add IEEE80211_SCAN_REQ

Approved by: re (blanket)

15 years agofix Jouni's email address
sam [Sun, 12 Jul 2009 19:58:52 +0000 (19:58 +0000)]
fix Jouni's email address

Approved by: re (blanket)

15 years agoThis patch adds a host route to an interface address (that is assigned
qingli [Sun, 12 Jul 2009 19:20:55 +0000 (19:20 +0000)]
This patch adds a host route to an interface address (that is assigned
to a non loopback/ppp link type) through the loopback interface. Prior
to the new L2/L3 rewrite, this host route was explicitly created when
processing the IPv6 address assignment. This loopback host route is
deleted when that IPv6 address is removed from the interface.

Reviewed by: bz, gnn
Approved by: re

15 years agoAdd calls to the experimental nfs client for the case of an "intr" mount,
rmacklem [Sun, 12 Jul 2009 17:07:35 +0000 (17:07 +0000)]
Add calls to the experimental nfs client for the case of an "intr" mount,
so that signals that aren't supposed to terminate RPCs in progress are
masked off during the RPC.

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

15 years agoFix the handling of dotdot in lookup for the experimental nfs client
rmacklem [Sun, 12 Jul 2009 17:02:17 +0000 (17:02 +0000)]
Fix the handling of dotdot in lookup for the experimental nfs client
in a manner analagous to the change in r195294 for the regular nfs client.

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

15 years agoIsochronous transfers only have 1 frame buffer, but multiple
marcel [Sun, 12 Jul 2009 16:50:32 +0000 (16:50 +0000)]
Isochronous transfers only have 1 frame buffer, but multiple
frame lengths. The frame buffer is at index 0.

Approved by: re (kensmith)
Obtained from: HPS

15 years agoMFp4:
marcel [Sun, 12 Jul 2009 16:46:43 +0000 (16:46 +0000)]
MFp4:
      USB CORE: busdma improvement

      For single segment allocations the boundary field
      of the BUSDMA tag should be zero. Currently all
      single segment allocations are less than or equal
      to 4096 bytes, so the limit does not kick in. If
      any single segment USB allocations would be greater
      than 4K, then it would be a problem.

Approved by: re (kensmith)
Obtained from: HPS

15 years agoFix fwrite() to return 0 when size or nmemb are zero.
ed [Sun, 12 Jul 2009 13:09:43 +0000 (13:09 +0000)]
Fix fwrite() to return 0 when size or nmemb are zero.

Right now nmemb is returned when size is 0. In newer versions of the
standards, it is explicitly required that fwrite() should return 0.

Submitted by: Christoph Mallon
Approved by: re (kib)

15 years agoTest suite for the poll(2)/select(2) on fifos, pipes and sockets,
kib [Sun, 12 Jul 2009 12:50:43 +0000 (12:50 +0000)]
Test suite for the poll(2)/select(2) on fifos, pipes and sockets,
and recorded results for several operating systems.

Submitted by: bde
Approved by: re (kensmith)

15 years agoWhen VM_MAP_WIRE_HOLESOK is not specified and vm_map_wire(9) encounters
kib [Sun, 12 Jul 2009 12:37:38 +0000 (12:37 +0000)]
When VM_MAP_WIRE_HOLESOK is not specified and vm_map_wire(9) encounters
non-readable and non-executable map entry, the entry is skipped from
wiring and loop is aborted. But, since MAP_ENTRY_WIRE_SKIPPED was not
set for the map entry, its wired_count is later erronously decremented.
vm_map_delete(9) for such map entry stuck in "vmmaps".

Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop.

Reported by: John Marshall <john.marshall riverwillow com au>
Approved by: re (kensmith)

15 years agoPad the following TCP related structs to allow MFCs of upcoming features/fixes
lstewart [Sun, 12 Jul 2009 09:14:28 +0000 (09:14 +0000)]
Pad the following TCP related structs to allow MFCs of upcoming features/fixes
back to the 8 branch:

tcp_var.h
- struct sackhint
- struct tcpcb
- struct tcpstat

The patch breaks the ABI. Bump __FreeBSD_version to 800102 accordingly. User
space tools that rely on the size of any of these structs (e.g. sockstat) need
to be recompiled.

Reviewed by: rpaulo, sam, andre, rwatson
Approved by: re & mentor (gnn)

15 years agoRename option USBVERBOSE to USB_VERBOSE for 2 reasons:
marcel [Sun, 12 Jul 2009 04:48:47 +0000 (04:48 +0000)]
Rename option USBVERBOSE to USB_VERBOSE for 2 reasons:
1.  USB_VERBOSE is more consistent with USB_DEBUG,
2.  sys/dev/usb/usb_device.c uses option USB_VERBOSE and
    not USBVERBOSE.

POLA with the USBVERBOSE option as it's found in 7-STABLE
has been considered but found insignificant in the face
of the USB stack overhaul.

Approved by: re (kensmith)

15 years agoIncrease the size of the page table on 64-bit PowerPC machines as a
nwhitehorn [Sun, 12 Jul 2009 04:07:52 +0000 (04:07 +0000)]
Increase the size of the page table on 64-bit PowerPC machines as a
bandaid to prevent exhaustion of the primary and secondary hash groups
in the event of extreme stress on the PMAP layer (e.g. a forkbomb). This
wastes memory, and should be revised to properly handle PTEG spills instead.

Suggested by: grehan
Approved by: re (kensmith)

15 years agoRevert rev 192323 (nfs_common.c only):
marcel [Sun, 12 Jul 2009 03:53:52 +0000 (03:53 +0000)]
Revert rev 192323 (nfs_common.c only):
The D-cache flushing added here was to deal with I-cache
incoherency observed on ia64. However, the problem was
in the implementation of pmap_enter_object() for ia64:
it was missing I-cache coherency logic for prefaulted
pages. After this got added in rev 195625, testing showed
that no D-cache flushing was required.

The SIGILL that was observed on Book-E (see commit log
for rev 192323) ended up not being related to I-cache
incoherency, but was found to be caused by bad memory.
This discovery further undermined the need for D-cache
flushing in the NFS I/O code, triggering the reversal.

Approved by: re (kensmith)

15 years agofirst cut at documenting ioctl api's for net80211
sam [Sun, 12 Jul 2009 03:19:25 +0000 (03:19 +0000)]
first cut at documenting ioctl api's for net80211
(replaces mostly incorrect information)

Approved by: re (blanket)

15 years agoIn nvpair_native_embedded_array(), meaningless pointers are zeroed.
marcel [Sat, 11 Jul 2009 22:43:20 +0000 (22:43 +0000)]
In nvpair_native_embedded_array(), meaningless pointers are zeroed.
The programmer was aware that alignment was not guaranteed in the
packed structure and used bzero() to NULL out the pointers.
However, on ia64, the compiler is quite agressive in finding ILP
and calls to bzero() are often replaced by simple assignments (i.e.
stores). Especially when the width or size in question corresponds
with a store instruction (i.e. st1, st2, st4 or st8).

The problem here is not a compiler bug. The address of the memory
to zero-out was given by '&packed->nvl_priv' and given the type of
the 'packed' pointer the compiler could assume proper alignment for
the replacement of bzero() with an 8-byte wide store to be valid.
The problem is with the programmer. The programmer knew that the
address did not have the alignment guarantees needed for a regular
assignment, but failed to inform the compiler of that fact. In
fact, the programmer told the compiler the opposite: alignment is
guaranteed.

The fix is to avoid using a pointer of type "nvlist_t *" and
instead use a "char *" pointer as the basis for calculating the
address. This tells the compiler that only 1-byte alignment can
be assumed and the compiler will either keep the bzero() call
or instead replace it with a sequence of byte-wise stores. Both
are valid.

Approved by: re (kib)

15 years agoRemove build timestamps from the following files:
cperciva [Sat, 11 Jul 2009 22:30:37 +0000 (22:30 +0000)]
Remove build timestamps from the following files:
/boot/kernel/hptrr.ko
/etc/mail/*.cf
/lib/libcrypto.so.5
/usr/bin/ntpq
/usr/sbin/amd
/usr/sbin/iasl
/usr/sbin/ntpd
/usr/sbin/ntpdate
/usr/sbin/ntpdc

There does not appear to be any purpose to having these timestamps, and
they have the irritating consequence that the aforementioned files will
be different every time they are rebuilt.

After this commit, the only remaining build timestamps are in the kernel,
the boot loaders, /usr/include/osreldate.h (the year in the copyright
notice), and lib*.a (the timestamps on all of the included .o files).

Reviewed by: scottl (hptrr), gshapiro (sendmail), simon (openssl),
roberto (ntp), jkim (acpica)
Approved by: re (kib)

15 years agoOn exec(2), when loading the ELF image, pmap_enter_object() is
marcel [Sat, 11 Jul 2009 22:27:20 +0000 (22:27 +0000)]
On exec(2), when loading the ELF image, pmap_enter_object() is
called to prefault pages. This is an obvious place for making
sure the I-cache is coherent. It was missing though. As such,
execution over NFS and ZFS file systems was failing. NFS was
fixed the wrong way (by flushing the D-cache as part of the
NFS code) in a previous commit. ZFS problems were encountered
after that and indicated that something else was wrong...

Approved by: re (kib)

15 years agoRe-factoring for adding weighted routes introduced a
kmacy [Sat, 11 Jul 2009 21:56:23 +0000 (21:56 +0000)]
Re-factoring for adding weighted routes introduced a
fairly irritating bug where the system will panic
when RADIX_MPATH is enabled. This change fixes this.

Approved by: re@

15 years agoFix typo: kproc_resume,.9 -> kproc_resume.9.
cperciva [Sat, 11 Jul 2009 17:36:59 +0000 (17:36 +0000)]
Fix typo: kproc_resume,.9 -> kproc_resume.9.

Approved by: re (kib)

15 years agoFix .Dd value -- our mdoc macros don't know how to parse the $Mdocdate$
cperciva [Sat, 11 Jul 2009 17:35:55 +0000 (17:35 +0000)]
Fix .Dd value -- our mdoc macros don't know how to parse the $Mdocdate$
tag, so the file was being treated as having no date (i.e., the current
date was being inserted).

Approved by: re (kib)

15 years agoFix something bogus deletion that got it during mesh commit.
rpaulo [Sat, 11 Jul 2009 16:02:06 +0000 (16:02 +0000)]
Fix something bogus deletion that got it during mesh commit.

Approved by: re (implicit)

15 years agoDocument the new multichannel support.
joel [Sat, 11 Jul 2009 15:25:13 +0000 (15:25 +0000)]
Document the new multichannel support.

Reviewed by: ariff
Approved by: re (blanket)

15 years agoImplementation of the upcoming Wireless Mesh standard, 802.11s, on the
rpaulo [Sat, 11 Jul 2009 15:02:45 +0000 (15:02 +0000)]
Implementation of the upcoming Wireless Mesh standard, 802.11s, on the
net80211 wireless stack. This work is based on the March 2009 D3.0 draft
standard. This standard is expected to become final next year.
This includes two main net80211 modules, ieee80211_mesh.c
which deals with peer link management, link metric calculation,
routing table control and mesh configuration and ieee80211_hwmp.c
which deals with the actually routing process on the mesh network.
HWMP is the mandatory routing protocol on by the mesh standard, but
others, such as RA-OLSR, can be implemented.

Authentication and encryption are not implemented.

There are several scripts under tools/tools/net80211/scripts that can be
used to test different mesh network topologies and they also teach you
how to setup a mesh vap (for the impatient: ifconfig wlan0 create
wlandev ... wlanmode mesh).

A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled
by default on GENERIC kernels for i386, amd64, sparc64 and pc98.

Drivers that support mesh networks right now are: ath, ral and mwl.

More information at: http://wiki.freebsd.org/WifiMesh

Please note that this work is experimental. Also, please note that
bridging a mesh vap with another network interface is not yet supported.

Many thanks to the FreeBSD Foundation for sponsoring this project and to
Sam Leffler for his support.
Also, I would like to thank Gateworks Corporation for sending me a
Cambria board which was used during the development of this project.

Reviewed by: sam
Approved by: re (kensmith)
Obtained from: projects/mesh11s

15 years agoGet correct maxio from the controller and drop the tunable.
jkim [Sat, 11 Jul 2009 08:10:18 +0000 (08:10 +0000)]
Get correct maxio from the controller and drop the tunable.
The default (64K) is too pessimistic for "new comm" hardware.
Also, this is bad because multiple controllers get limited by
the global tunable.

Reviewed by: scottl
Approved by: re (kensmith)

15 years agoUpdate to tcsh 6.17.00.
mp [Sat, 11 Jul 2009 05:35:08 +0000 (05:35 +0000)]
Update to tcsh 6.17.00.

Approved by: re (kensmith)

15 years agoImport of tcsh-6.17.00
mp [Fri, 10 Jul 2009 21:47:20 +0000 (21:47 +0000)]
Import of tcsh-6.17.00

15 years agoFlatten vendor/tcsh/dist.
mp [Fri, 10 Jul 2009 21:00:38 +0000 (21:00 +0000)]
Flatten vendor/tcsh/dist.

15 years agoFix alignment issue with ATA IDENTIFY structure.
scottl [Fri, 10 Jul 2009 17:42:53 +0000 (17:42 +0000)]
Fix alignment issue with ATA IDENTIFY structure.

Approved by: re

15 years agoFor ic_opmode switch cases, provide a default label with a printf saying
rpaulo [Fri, 10 Jul 2009 15:28:33 +0000 (15:28 +0000)]
For ic_opmode switch cases, provide a default label with a printf saying
this opmode is not supported.

Approved by: re (kib)

15 years agomark struct ieee80211req_maclist packed so sizeof works as intended on arm;
sam [Fri, 10 Jul 2009 15:26:33 +0000 (15:26 +0000)]
mark struct ieee80211req_maclist packed so sizeof works as intended on arm;
fixes "list mac"

Approved by: re (kensmith)

15 years agoSync the libusb 1.0 exported api to the latest GSoC code.
thompsa [Fri, 10 Jul 2009 14:15:53 +0000 (14:15 +0000)]
Sync the libusb 1.0 exported api to the latest GSoC code.

 - Fix possible uninitialised variables and null derefs
 - Support big transfers
 - Various bug fixes and style changes

Submitted by: Sylvestre Gallon
Sponsored by: Google Summer of Code 2009
Approved by: re (kib)

15 years agoWhen amd64 CPU cannot load segment descriptor during trap return to
kib [Fri, 10 Jul 2009 10:29:16 +0000 (10:29 +0000)]
When amd64 CPU cannot load segment descriptor during trap return to
usermode, it generates GPF, that is mirrored to user mode as SIGSEGV.
The offending register in mcontext should contain the value loading of
which generated the GPF, and it is so on i386. On amd64, we currently
report segment descriptor in tf_err, while segment register contains the
corrected value loaded by trap handler.

Fix the issue by behaving like i386, reloading segment register in trap
frame after signal frame is pushed onto user stack.

Noted and tested by: pho
Approved by: re (kensmith)

15 years agoSeparate the parallel scsi knowledge out of the core of the XPT, and
scottl [Fri, 10 Jul 2009 08:18:08 +0000 (08:18 +0000)]
Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability.  Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel.  The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives.  It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes.  ATAPI drives are
accessed via 'cd' device nodes.  They can all be enumerated and manipulated
via camcontrol, just like SCSI drives.  SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol.  See the camcontrol manpage for further
details.  Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment.  The userland ABI/API has
changed, so applications will need to be recompiled.  It may change
further in the near future.  The 'ada' device name may also change as
more infrastructure is completed in this project.  The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed.  In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols.  It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware.  While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged.  Help with new transports is also encouraged.

Submitted by: scottl, mav
Approved by: re

15 years agocorrectly set the tailq ptr when removing the last item in the q
sam [Fri, 10 Jul 2009 02:19:57 +0000 (02:19 +0000)]
correctly set the tailq ptr when removing the last item in the q

Approved by: re (kensmith)

15 years agoRearrange shift operation to increase interpolation accuracy,
ariff [Thu, 9 Jul 2009 22:21:18 +0000 (22:21 +0000)]
Rearrange shift operation to increase interpolation accuracy,
further reducing conversion artifacts and better worst case SNR.

Approved by: re (kib)

15 years agoThe mutex_owned() macro should operate on kmutex_t and not on mutex_t.
pjd [Thu, 9 Jul 2009 20:22:05 +0000 (20:22 +0000)]
The mutex_owned() macro should operate on kmutex_t and not on mutex_t.
This fixes 'zdb <poolname>' crash.

Reported by: avg
Approved by: re (kib)

15 years agoFix cxgb(4) panic with jumbo frames.
np [Thu, 9 Jul 2009 19:27:58 +0000 (19:27 +0000)]
Fix cxgb(4) panic with jumbo frames.

Reviewed by: kmacy
Approved by: re (kib), gnn (mentor)

15 years agoSince the nfscl_getclose() function both decremented open counts and,
rmacklem [Thu, 9 Jul 2009 19:00:29 +0000 (19:00 +0000)]
Since the nfscl_getclose() function both decremented open counts and,
optionally, created a separate list of NFSv4 opens to be closed, it
was possible for the associated OpenOwner to be free'd before the Open
was closed. The problem was that the Open was taken off the OpenOwner
list before the Close RPC was done and OpenOwners can be free'd once the
list is empty. This patch separates out the case of doing the Close RPC
into a separate function called nfscl_doclose() and simplifies nfsrpc_doclose()
so that it closes a single open instead of a list of them. This avoids
removing the Open from the OpenOwner list before doing the Close RPC.

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

15 years agoThe control terminal revocation at the session leader exit does not
kib [Thu, 9 Jul 2009 18:54:38 +0000 (18:54 +0000)]
The control terminal revocation at the session leader exit does not
correctly checks for reclaimed vnode, possibly calling VOP_REVOKE for
such vnode. If the terminal is already revoked, or devfs mount was
forcibly unmounted, the revocation of doomed ctty vnode causes panic.

Reported and tested by: lstewart
Approved by: re (kensmith)
MFC after: 2 weeks

15 years agoExtend the cn_flags field of the struct componentname to 64 bits to have
kib [Thu, 9 Jul 2009 18:49:26 +0000 (18:49 +0000)]
Extend the cn_flags field of the struct componentname to 64 bits to have
more space for the flags, that is too close to be exhausted. While changing
the KBI for name(9), use unsigned int for symlinks count.

Suggested by: rwatson
Approved by: re (kensmith)

15 years agoAdjust the description of hw.snd.feeder_rate_polyphase_max and
joel [Thu, 9 Jul 2009 16:59:29 +0000 (16:59 +0000)]
Adjust the description of hw.snd.feeder_rate_polyphase_max and
hw.snd.compat_linux_mmap a bit.

Submitted by: ariff
Approved by: re (blanket)