]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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)

14 years agoBump the version of all non-symbol-versioned shared libraries in
kensmith [Sun, 19 Jul 2009 17:25:24 +0000 (17:25 +0000)]
Bump the version of all non-symbol-versioned shared libraries in
preparation for 8.0-RELEASE.  Add the previous version of those
libraries to ObsoleteFiles.inc and bump __FreeBSD_Version.

Reviewed by:    kib
Approved by:    re (rwatson)

14 years agoadd urtw
sam [Sun, 19 Jul 2009 16:54:24 +0000 (16:54 +0000)]
add urtw

Approved by: re (kib)

14 years agoCorrect AT_SYMLINK_FOLLOW flag name in linkat(2) man page.
jilles [Sun, 19 Jul 2009 16:48:25 +0000 (16:48 +0000)]
Correct AT_SYMLINK_FOLLOW flag name in linkat(2) man page.

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

14 years agoFix two bugs in the experimental nfs client:
rmacklem [Sun, 19 Jul 2009 16:44:26 +0000 (16:44 +0000)]
Fix two bugs in the experimental nfs client:
- When the root vnode was acquired during mounting, mnt_stat.f_iosize was
  still set to 0, so getnewvnode() would set bo_bsize == 0. This would
  confuse getblk(), so that it always returned the first block causing
  the problem when the root directory of the mount point was greater
  than one block in size. It was fixed by setting mnt_stat.f_iosize to
  NFS_DIRBLKSIZ before calling ncl_nget() to acquire the root vnode.
- NFSMNT_INT was being set temporarily while the initial connect to a
  server was being done. This erroneously configured the krpc for
  interruptible RPCs, which caused problems because signals weren't
  being masked off as they would have been for interruptible mounts.
  This code was deleted to fix the problem. Since mount_nfs does an
  NFS null RPC before the mount system call, connections to the server
  should work ok.

Tested by: swell dot k at gmail dot com
Approved by: re (kensmith), kib (mentor)

14 years agoExpose the definitions of 'struct vnet' and 'VNET_MAGIC_N' to userspace
rwatson [Sun, 19 Jul 2009 15:21:42 +0000 (15:21 +0000)]
Expose the definitions of 'struct vnet' and 'VNET_MAGIC_N' to userspace
if _WANT_VNET is defined.  This is required so that libkvm can locate
virtual network stack instances in order to reach their global variables
for monitoring and crashdump analysis.

Reviewed by: bz
Approved by: re (kib)

14 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)

14 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)

14 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)

14 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)

14 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

14 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)

14 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)

14 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)

14 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)

14 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)

14 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

14 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)

14 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)

14 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)

14 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

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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

14 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)

14 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

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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

14 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)

14 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)

14 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)

14 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)

14 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

14 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.

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)