]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoUse critical sections instead of disabling local interrupts to ensure
kib [Tue, 15 Jun 2010 09:19:33 +0000 (09:19 +0000)]
Use critical sections instead of disabling local interrupts to ensure
the consistency between PCPU fpcurthread and the state of the FPU.

Explicitely assert that the calling conventions for fpudrop() are
adhered too. In cpu_thread_exit(), add missed critical section entrance.

Reviewed by: bde
Tested by: pho
MFC after: 1 month

14 years agoAdd assert to check that the (current) thread is in critical section.
kib [Tue, 15 Jun 2010 09:18:27 +0000 (09:18 +0000)]
Add assert to check that the (current) thread is in critical section.

MFC after: 1 month

14 years agoSet the comment at the right place for PMC uncore classes.
fabient [Tue, 15 Jun 2010 09:12:31 +0000 (09:12 +0000)]
Set the comment at the right place for PMC uncore classes.

Submitted by: rstone
MFC after: 1 month

14 years agoAdd a periodic zfs scrub script.
netchild [Tue, 15 Jun 2010 08:58:16 +0000 (08:58 +0000)]
Add a periodic zfs scrub script.

Features:
 - configurable amount of days between scrubs (default value or per pool)
 - do not scrub directly after pool creation (respects the configured
   number of days between scrubs)
 - do not scrub if a scrub is in progress
 - tells how to see the status of the scrub
 - tells how many days since the last scrub if it skips the scrubbing
 - warns if a non-existent pool is specified explicitely
   (default: no pools specified -> all currently imported pools are
   handled)
 - runs late in the periodic run to not slow down the other periodic daily
   scripts

Discussed on: fs@

14 years ago* Include sys/systm.h for KASSERT()
ae [Tue, 15 Jun 2010 08:53:13 +0000 (08:53 +0000)]
* Include sys/systm.h for KASSERT()
* Remove unneeded includes and comment
* Replace home made OFFSETOF() macro with standard offsetof()

Pointed out by: bde
Approved by: kib (mentor)

14 years agosound/pcm: use non-const string as a value with SYSCTL_STRING
avg [Tue, 15 Jun 2010 07:06:54 +0000 (07:06 +0000)]
sound/pcm: use non-const string as a value with SYSCTL_STRING

Although the sysctls are marked with CTLFLAG_RD and the values will stay
immutable, current sysctl implementation stores value pointer in
void* type, which means that const qualifier is discarded anyway
and some newer compilers complaint about that.
We can't use de-const trick in sysctl implementation, because in that
case we could miss an opposite situation where a const value is used
with CTLFLAG_RW sysctl.

Complaint from: gcc 4.4, clang
MFC after: 2 weeks

14 years agoerr() takes a printf format.
ed [Tue, 15 Jun 2010 04:47:16 +0000 (04:47 +0000)]
err() takes a printf format.

Submitted by: Pawel Worach
Spotted by: clang

14 years agoAdd MODULE_DEPEND() macros to the experimental NFS client and
rmacklem [Tue, 15 Jun 2010 00:25:04 +0000 (00:25 +0000)]
Add MODULE_DEPEND() macros to the experimental NFS client and
server so that the modules will load when kernels are built with
none of the NFS* configuration options specified. I believe this
resolves the problems reported by PR kern/144458 and the email on
freebsd-stable@ posted by Dmitry Pryanishnikov on June 13.

Tested by: kib
PR: kern/144458
Reviewed by: kib
MFC after: 1 week

14 years agoUse literal format strings. Found by clang.
emaste [Mon, 14 Jun 2010 23:51:35 +0000 (23:51 +0000)]
Use literal format strings.  Found by clang.

14 years agoFix typos that broke duration calculations on protection frames. A similar
jkim [Mon, 14 Jun 2010 23:01:50 +0000 (23:01 +0000)]
Fix typos that broke duration calculations on protection frames.  A similar
fix was done for ral(4) long ago and it must be copy-and-paste bugs.

Found by: clang

14 years agoFor the target port groups structures, don't allocate the initial element.
ken [Mon, 14 Jun 2010 22:02:18 +0000 (22:02 +0000)]
For the target port groups structures, don't allocate the initial element.
This makes things easier for target implementations to calculate how many
elements they need to allocate.

Discussed with: mjacob, gibbs
MFC after: 1 week

14 years ago'unit' can be negative, so use signed type for it.
pjd [Mon, 14 Jun 2010 21:58:55 +0000 (21:58 +0000)]
'unit' can be negative, so use signed type for it.

Found by: Coverity Prevent
CID: 3731
MFC after: 3 days

14 years agoBIO_DELETE contains range we want to delete and doesn't provide any useful
pjd [Mon, 14 Jun 2010 21:56:24 +0000 (21:56 +0000)]
BIO_DELETE contains range we want to delete and doesn't provide any useful
data, so there is no need to copy it to userland.

MFC after: 3 days

14 years agoCorrect various log messages.
pjd [Mon, 14 Jun 2010 21:46:48 +0000 (21:46 +0000)]
Correct various log messages.

Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days

14 years agoFix typos.
pjd [Mon, 14 Jun 2010 21:44:58 +0000 (21:44 +0000)]
Fix typos.

MFC after: 3 days

14 years agoInitialize gctl_seq for synchronization requests.
pjd [Mon, 14 Jun 2010 21:44:20 +0000 (21:44 +0000)]
Initialize gctl_seq for synchronization requests.

Reported by: hiroshi@soupacific.com
Analysed by: Mikolaj Golub <to.my.trociny@gmail.com>
Tested by: hiroshi@soupacific.com, Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days

14 years agoPlug memory leak.
pjd [Mon, 14 Jun 2010 21:41:22 +0000 (21:41 +0000)]
Plug memory leak.

Found by: Coverity Prevent
CID: 7057
MFC after: 3 days

14 years agoPlug memory leak.
pjd [Mon, 14 Jun 2010 21:37:25 +0000 (21:37 +0000)]
Plug memory leak.

Found by: Coverity Prevent
CID: 7056
MFC after: 3 days

14 years agoPlug memory leak.
pjd [Mon, 14 Jun 2010 21:33:18 +0000 (21:33 +0000)]
Plug memory leak.

Found by: Coverity Prevent
CID: 7051
MFC after: 3 days

14 years agoPlug memory leaks.
pjd [Mon, 14 Jun 2010 21:25:20 +0000 (21:25 +0000)]
Plug memory leaks.

Found by: Coverity Prevent
CID: 7052, 7053, 7054, 7055
MFC after: 3 days

14 years ago* Fix a bug where the length of the ASCONF-ACK was calculated wrong due
tuexen [Mon, 14 Jun 2010 21:25:07 +0000 (21:25 +0000)]
* Fix a bug where the length of the ASCONF-ACK was calculated wrong due
  to using an uninitialized variable.
* Fix a bug where a NULL pointer was dereferenced when interfaces
  come and go at a high rate.
* Fix a bug where inps where not deregistered from iterators.
* Fix a race condition in freeing an association.
* Fix a refcount problem related to the iterator.
Each of the above bug results in a panic. It shows up when
interfaces come and go at a high rate.

Obtained from: rrs (partly)
MFC after: 3 days

14 years agoRemove macros that are not really needed. The idea was to have them in case
pjd [Mon, 14 Jun 2010 21:18:58 +0000 (21:18 +0000)]
Remove macros that are not really needed. The idea was to have them in case
we grow more descriptors, but I'll reconsider readding them once we get there.

Passing (a = b) expression to FD_ISSET() is bad idea, as FD_ISSET() evaluates
its argument twice.

Found by: Coverity Prevent
CID: 5243
MFC after: 3 days

14 years agoEliminate dead code.
pjd [Mon, 14 Jun 2010 21:01:13 +0000 (21:01 +0000)]
Eliminate dead code.

Found by: Coverity Prevent
CID: 5158
MFC after: 3 days

14 years agoFix ACPI suspend/resume on amd64, which was broken since r208833.
jkim [Mon, 14 Jun 2010 20:08:26 +0000 (20:08 +0000)]
Fix ACPI suspend/resume on amd64, which was broken since r208833.
We need actual storage for FPU state to save and restore.

14 years agoEliminate checks for a page having a NULL object in vm_pageout_scan()
alc [Mon, 14 Jun 2010 19:54:19 +0000 (19:54 +0000)]
Eliminate checks for a page having a NULL object in vm_pageout_scan()
and vm_pageout_page_stats().  These checks were recently introduced by
the first page locking commit, r207410, but they are not needed.  At
the same time, eliminate some redundant accesses to the page's object
field.  (These accesses should have neen eliminated by r207410.)

Make the assertion in vm_page_flag_set() stricter.  Specifically, only
managed pages should have PG_WRITEABLE set.

Add a comment documenting an assertion to vm_page_flag_clear().

It has long been the case that fictitious pages have their wire count
permanently set to one.  Add comments to vm_page_wire() and
vm_page_unwire() documenting this.  Add assertions to these functions
as well.

Update the comment describing vm_page_unwire().  Much of the old
comment had little to do with vm_page_unwire(), but a lot to do with
_vm_page_deactivate().  Move relevant parts of the old comment to
_vm_page_deactivate().

Only pages that belong to an object can be paged out.  Therefore, it
is pointless for vm_page_unwire() to acquire the page queues lock and
enqueue such pages in one of the paging queues.  Generally speaking,
such pages are immediately freed after the call to vm_page_unwire().
Previously, it was the call to vm_page_free() that reacquired the page
queues lock and removed these pages from the paging queues.  Now, we
will never acquire the page queues lock for this case.  (It is also
worth noting that since both vm_page_unwire() and vm_page_free()
occurred with the page locked, the page daemon never saw the page with
its object field set to NULL.)

Change the panic with vm_page_unwire() to provide a more precise message.

Reviewed by: kib@

14 years agoFurther unbreak powerpc & sparc64.
marcel [Mon, 14 Jun 2010 19:39:20 +0000 (19:39 +0000)]
Further unbreak powerpc & sparc64.

14 years agoAdd Clang to OptionalObsoleteFiles.inc.
ed [Mon, 14 Jun 2010 19:10:30 +0000 (19:10 +0000)]
Add Clang to OptionalObsoleteFiles.inc.

This means you can now deinstall Clang by running make delete-old with
WITHOUT_CLANG set.

14 years agoFix TX retry rate handling. tx->linkq is an index to a rate table
bschmidt [Mon, 14 Jun 2010 18:26:10 +0000 (18:26 +0000)]
Fix TX retry rate handling. tx->linkq is an index to a rate table
beginning with the highest available rate. Currently we always use
54m for the first retry no matter what AMRR has choosen. Fix this
by setting the index to the next lower rate.

Approved by: rpaulo (mentor)
Tested by: Brandon Gooch <jamesbrandongooch at gmail.com>
MFC after: 2 weeks

14 years agoUpdate vfs_busy(9) and vfs_unbusy(9) manual pages to better match the
jh [Mon, 14 Jun 2010 17:31:46 +0000 (17:31 +0000)]
Update vfs_busy(9) and vfs_unbusy(9) manual pages to better match the
current behaviour of the functions.

Discussed with: attilio

14 years agoPass the -N flag to linked via -Wl.
rdivacky [Mon, 14 Jun 2010 17:02:19 +0000 (17:02 +0000)]
Pass the -N flag to linked via -Wl.

Approved by: ed (mentor)

14 years agoTemporarily bring back the ARM bootinfo (and make tinderbox happy).
raj [Mon, 14 Jun 2010 16:05:21 +0000 (16:05 +0000)]
Temporarily bring back the ARM bootinfo (and make tinderbox happy).

BI will be eliminated for good when powerpc transition to FDT is complete.

14 years agoRemove unused files.
rpaulo [Mon, 14 Jun 2010 15:52:50 +0000 (15:52 +0000)]
Remove unused files.

14 years agoUpdate for hostapd & wpa_supplicant 0.6.10.
rpaulo [Mon, 14 Jun 2010 15:38:30 +0000 (15:38 +0000)]
Update for hostapd & wpa_supplicant 0.6.10.

14 years agoMFV hostapd & wpa_supplicant 0.6.10.
rpaulo [Mon, 14 Jun 2010 15:37:48 +0000 (15:37 +0000)]
MFV hostapd & wpa_supplicant 0.6.10.

14 years agorandom(6): avoid dead assignments
uqs [Mon, 14 Jun 2010 13:03:25 +0000 (13:03 +0000)]
random(6): avoid dead assignments

Found by: clang static analyzer

14 years agosc_lastrs is also used in case the sending station is not known, for
bschmidt [Mon, 14 Jun 2010 08:24:00 +0000 (08:24 +0000)]
sc_lastrs is also used in case the sending station is not known, for
example in a split IBSS scenario. Therefore always assign sc_lastrs.
This removes a hack I committed in r206457.

Approved by: rpaulo (mentor)

14 years agoFix bug introduced in SVN rev 194985. When calling pic_assign_cpu()
mav [Mon, 14 Jun 2010 07:38:53 +0000 (07:38 +0000)]
Fix bug introduced in SVN rev 194985. When calling pic_assign_cpu()
for pre-bound IRQs during boot, submit there LAPIC ID, same as in other
places, not CPU ID.

14 years agoVirtualize pci_remap_msi_irq() call from general MSI code. It allows MSI
mav [Mon, 14 Jun 2010 07:10:37 +0000 (07:10 +0000)]
Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSI
(FSB interrupts) to be used by non-PCI devices, such as HPET.

14 years agoUnbreak Clang on PowerPC.
ed [Mon, 14 Jun 2010 06:23:47 +0000 (06:23 +0000)]
Unbreak Clang on PowerPC.

It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to crash
when building even simple Hello World applications. Switch back to -O1
for this architecture.

Submitted by: nwhitehorn

14 years agoIf the compressed data is larger than the uncompressed,
kientzle [Mon, 14 Jun 2010 02:56:45 +0000 (02:56 +0000)]
If the compressed data is larger than the uncompressed,
report the compression ratio as 0% instead of displaying
nonsense triggered by numeric overflow.  This is common
when dealing with uncompressed files when the I/O blocking
causes there to be small transient differences in the
accounting.

Thanks to:  Boris Samorodov

14 years agoSeparate _posix1e_acl_id_to_name() into a separate file, to
kientzle [Mon, 14 Jun 2010 02:26:13 +0000 (02:26 +0000)]
Separate _posix1e_acl_id_to_name() into a separate file, to
break an unnecessary dependency on getpwuid() and getgrgid().

MFC after: 1 month

14 years ago- Because hostapd calls iv_key_set() before if_init(), make sure key_set
thompsa [Mon, 14 Jun 2010 00:40:23 +0000 (00:40 +0000)]
- Because hostapd calls iv_key_set() before if_init(), make sure key_set
  callback function will be executed, and that the key won't be deleted during
  the init process.
- txmic and rxmic are written into the chip the same place regardless of
  opmode.
- Make the hardware generate 802.11 sequence numbers.

Submitted by: Akinori Furukoshi
Obtained from: git://gitorious.org/run/run.git

14 years agoFix build breakages on ia64 introduced some commits ago.
marcel [Sun, 13 Jun 2010 23:37:16 +0000 (23:37 +0000)]
Fix build breakages on ia64 introduced some commits ago.

14 years agoImport wpa_supplicant & hostapd 0.6.9.
rpaulo [Sun, 13 Jun 2010 20:32:04 +0000 (20:32 +0000)]
Import wpa_supplicant & hostapd 0.6.9.

14 years agoUpdate a branch missed in r207537.
marius [Sun, 13 Jun 2010 20:29:55 +0000 (20:29 +0000)]
Update a branch missed in r207537.

MFC after: 3 days

14 years agolibedit: Add basic filename completion code from NetBSD.
jilles [Sun, 13 Jun 2010 17:04:42 +0000 (17:04 +0000)]
libedit: Add basic filename completion code from NetBSD.

This will be used to provide filename completion in sh(1).

Changes from the NetBSD code:
* wide character support disabled, as in the rest of libedit
* config.h and related portability stuff reduced/disabled, as in the rest
  of libedit

Submitted by: Guy Yur
Obtained from: NetBSD

14 years agostyle(9) fixes:
imp [Sun, 13 Jun 2010 16:54:11 +0000 (16:54 +0000)]
style(9) fixes:

o make cmd scoped to the whole do_rules function, since it really is
  scoped to the whole fucnion.  Making it static was the wrong way to
  fix referencing it outside of the block in which it was declared
  (and conforms to the style of the rest of the file).
o remove a couple of meaningless blank lines
o properly wrap one line.

14 years agoMerge from tbemd, with minor tweaks:
imp [Sun, 13 Jun 2010 16:35:20 +0000 (16:35 +0000)]
Merge from tbemd, with minor tweaks:

Search from most specific ($MACHINE) to least specific
($MACHINE_CPUARCH) when looking for the tty file to use.  Also add an
.error case if none exist.

14 years agoEnable ofwdump(8) on ARM as this is a useful tool to inspect a flattened
raj [Sun, 13 Jun 2010 13:30:26 +0000 (13:30 +0000)]
Enable ofwdump(8) on ARM as this is a useful tool to inspect a flattened
device tree.

14 years agoConvert Marvell ARM platforms to FDT convention.
raj [Sun, 13 Jun 2010 13:28:53 +0000 (13:28 +0000)]
Convert Marvell ARM platforms to FDT convention.

The following systems are involved:

  - DB-88F5182
  - DB-88F5281
  - DB-88F6281
  - DB-78100
  - SheevaPlug

This overhaul covers the following major changes:

  - All integrated peripherals drivers for Marvell ARM SoC, which are
    currently in the FreeBSD source tree are reworked and adjusted so they
    derive config data out of the device tree blob (instead of hard coded /
    tabelarized values).

  - Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say
    good by to obio / mbus drivers and numerous hard-coded config data.

Note that world needs to be built WITH_FDT for the affected platforms.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation.

14 years agoInitial FDT infrastructure elements for ARM.
raj [Sun, 13 Jun 2010 13:12:52 +0000 (13:12 +0000)]
Initial FDT infrastructure elements for ARM.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoImprove style.
raj [Sun, 13 Jun 2010 13:08:23 +0000 (13:08 +0000)]
Improve style.

14 years agoConnect FDT infrastructure to the build system.
raj [Sun, 13 Jun 2010 13:02:43 +0000 (13:02 +0000)]
Connect FDT infrastructure to the build system.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoProvide identify method for the fdtbus(4).
raj [Sun, 13 Jun 2010 12:58:31 +0000 (12:58 +0000)]
Provide identify method for the fdtbus(4).

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoDo not set WITH_FDT by default based on arch, as this does not work for
raj [Sun, 13 Jun 2010 12:53:44 +0000 (12:53 +0000)]
Do not set WITH_FDT by default based on arch, as this does not work for
a bootstrap stage tool.

FDT-enabled platforms will have to specify WITH_FDT explicitly at buildworld
time for now until TBEMD is complete, which is going to provide means for such
arch based selection of build components.

Discussed with: imp

14 years agoFix conditional FDT support in loader(8).
raj [Sun, 13 Jun 2010 12:46:32 +0000 (12:46 +0000)]
Fix conditional FDT support in loader(8).

14 years agoDisable usage of posix_spawn() inside LLVM.
ed [Sun, 13 Jun 2010 12:39:22 +0000 (12:39 +0000)]
Disable usage of posix_spawn() inside LLVM.

Even though it's nice to use posix_spawn() instead of manually using
fork()/exec(), it's better to disable this. FreeBSD 7 doesn't support
this interface. When enabled, we can't build tblgen, which prevents us
from building FreeBSD 9 on 7.

Tested by: raj

14 years agoUnbreak the build on less common architectures.
ed [Sun, 13 Jun 2010 11:27:44 +0000 (11:27 +0000)]
Unbreak the build on less common architectures.

Submitted by: Andreas Tobler <andreast list fgznet ch>

14 years ago* Improve compatibility with existing application code by permitting the
kaiw [Sun, 13 Jun 2010 10:58:50 +0000 (10:58 +0000)]
* Improve compatibility with existing application code by permitting the
  use of `elf_getbase()` on non-archive members. This change is needed
  for gcc LTO (-flto) to work properly.
* Style fix: paranthesize returned values.
* Document the current behaviour of `elf_getbase()`.

Tested by: gerald, Steve Kargl (original patch)
Obtained from: elftoolchain
MFC after: 3 days

14 years agoIn NFS clients, instead of inconsistently using #ifdef
kib [Sun, 13 Jun 2010 05:24:27 +0000 (05:24 +0000)]
In NFS clients, instead of inconsistently using #ifdef
DIAGNOSTIC and #ifndef DIAGNOSTIC for debug assertions, prefer
KASSERT(). Also change one #ifdef DIAGNOSTIC in the new nfs server.

Submitted by: Mikolaj Golub <to.my.trociny gmail com>
MFC after: 2 weeks

14 years agoAdd a utility macro to simplify calculating an aggregate sum from a DPCPU
lstewart [Sun, 13 Jun 2010 02:39:55 +0000 (02:39 +0000)]
Add a utility macro to simplify calculating an aggregate sum from a DPCPU
counter variable.

Sponsored by: FreeBSD Foundation
Reviewed by: jhb, rpaulo, rwatson (previous version of patch)
MFC after: 1 week

14 years agoMerge from tbemd:
imp [Sun, 13 Jun 2010 01:27:29 +0000 (01:27 +0000)]
Merge from tbemd:

Convert from using MACHINE_ARCH to MACHINE_CPUARCH.  Hoist path statement
up into the top Makefile rather than repeating it on every arch Makefile.

14 years agoIn threaded processes, destroy the mutex atexit_mutex when we've
cperciva [Sun, 13 Jun 2010 01:13:36 +0000 (01:13 +0000)]
In threaded processes, destroy the mutex atexit_mutex when we've
finished using it.  This allows the mutex's allocated memory to be
freed.

This is one sense a rather silly change, since at this point we're
less than a microsecond away from calling _exit; but fixing this
memory leak is likely to make life easier for anyone trying to
track down other memory leaks.

14 years agocxgb(4): add knob to get packet timestamps from the hardware.
np [Sat, 12 Jun 2010 22:33:04 +0000 (22:33 +0000)]
cxgb(4): add knob to get packet timestamps from the hardware.

The T3 ASIC can provide an incoming packet's timestamp instead of its RSS hash.
The timestamp is just a counter running off the card's clock.  With a 175MHz
clock an increment represents ~5.7ns and the 32 bit value wraps around in ~25s.

# sysctl -d dev.cxgbc.0.pkt_timestamp
dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of connection hash

# sysctl -d dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: core clock frequency (in KHz)
# sysctl dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: 175000

14 years agomake format string a string literal.
np [Sat, 12 Jun 2010 22:24:39 +0000 (22:24 +0000)]
make format string a string literal.

Reported by: clang

14 years agoMake SMP work on MPC7400-based Apple desktops like the PowerMac3,3.
nwhitehorn [Sat, 12 Jun 2010 21:14:22 +0000 (21:14 +0000)]
Make SMP work on MPC7400-based Apple desktops like the PowerMac3,3.

14 years agoThese files are no longer required since r207607
gavin [Sat, 12 Jun 2010 19:32:52 +0000 (19:32 +0000)]
These files are no longer required since r207607

14 years agoIntroduce __isnanf() as an alias for isnanf(), and make the isnan()
das [Sat, 12 Jun 2010 17:32:05 +0000 (17:32 +0000)]
Introduce __isnanf() as an alias for isnanf(), and make the isnan()
macro expand to __isnanf() instead of isnanf() for float arguments.
This change is needed because isnanf() isn't declared in strict POSIX
or C99 mode.

Compatibility note: Apps using isnan(float) that are compiled after
this change won't link against an older libm.

Reported by: Florian Forster <octo@verplant.org>

14 years agoInstall tblgen so partial / progressive builds are still possible.
des [Sat, 12 Jun 2010 16:04:29 +0000 (16:04 +0000)]
Install tblgen so partial / progressive builds are still possible.

14 years agoDo the branding right this time.
ed [Sat, 12 Jun 2010 15:13:36 +0000 (15:13 +0000)]
Do the branding right this time.

I've looked at other places in the source tree where CLANG_VENDOR is
used and I suspect it might not be safe to use newlines here.
CLANG_VENDOR should just be defined to "FreeBSD ", just like the latest
Clang preview in OS X uses "Apple ". Properly use SVN_REVISION to define
it to the imported revision of Clang. I do want to have a date in there,
so slightly modify the code to support CLANG_VENDOR_SUFFIX.

14 years agoAdd another variation of make_dev(9), make_dev_p(9), that is allowed
kib [Sat, 12 Jun 2010 13:22:39 +0000 (13:22 +0000)]
Add another variation of make_dev(9), make_dev_p(9), that is allowed
to fail and can return useful error code.

Requested by: jh
Reviewed by: imp, jh
MFC after: 3 weeks

14 years agoWhen make_dev_credf(MAKEDEV_WAITOK) is called, use
kib [Sat, 12 Jun 2010 13:21:25 +0000 (13:21 +0000)]
When make_dev_credf(MAKEDEV_WAITOK) is called, use
devctl_notify_f(M_WAITOK) for devfs notifications.

Suggested by: jh
Reviewed by: imp, jh
MFC after: 3 weeks

14 years agoAdd modifications of devctl_notify(9) functions that take flags. Use
kib [Sat, 12 Jun 2010 13:20:38 +0000 (13:20 +0000)]
Add modifications of devctl_notify(9) functions that take flags. Use
flags to specify M_WAITOK/M_NOWAIT. M_WAITOK allows devctl to sleep for
the memory allocation.

As Warner noted, allowing the functions to sleep might cause
reordering of the queued notifications.

Reviewed by: imp, jh
MFC after: 3 weeks

14 years agoCheck general TSC presence before doing more specific checks and printfs.
mav [Sat, 12 Jun 2010 13:10:03 +0000 (13:10 +0000)]
Check general TSC presence before doing more specific checks and printfs.

14 years agoANSIfy prototypes in subr_usbd.c.
ed [Sat, 12 Jun 2010 12:19:08 +0000 (12:19 +0000)]
ANSIfy prototypes in subr_usbd.c.

Clang generates the following warnings when building subr_usbd.c:

| subr_usbd.c:598:13: warning: promoted type 'int' of K&R function
|   parameter is not compatible with the parameter type 'uint8_t' (aka
|   'unsigned char') declared in a previous prototype
| subr_usbd.c:627:13: warning: promoted type 'int' of K&R function
|   parameter is not compatible with the parameter type 'uint8_t' (aka
|   'unsigned char') declared in a previous prototype
| subr_usbd.c:649:13: warning: promoted type 'int' of K&R function
|   parameter is not compatible with the parameter type 'uint8_t' (aka
|   'unsigned char') declared in a previous prototype

Instead of just ANSIfying these three prototypes, do it for the entire
file.

Spotted by: clang

14 years agoFix arc_read_done may try to byteswap undefined data (sparc related)
mm [Sat, 12 Jun 2010 11:28:46 +0000 (11:28 +0000)]
Fix arc_read_done may try to byteswap undefined data (sparc related)

OpenSolaris onnv-revision: 10839:cf83b553a2ab

Obtained from: OpenSolaris (Bug ID 6836714)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix panic in zfs_getsecattr
mm [Sat, 12 Jun 2010 11:27:10 +0000 (11:27 +0000)]
Fix panic in zfs_getsecattr

OpenSolaris onnv-revision: 10295:f7a18a1e9610

Obtained from: OpenSolaris (Bug ID 6870564)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix possible zfs panic on zpool import
mm [Sat, 12 Jun 2010 11:25:57 +0000 (11:25 +0000)]
Fix possible zfs panic on zpool import

OpenSolaris onnv-revision: 10040:38b25aeeaf7a

Obtained from: OpenSolaris (Bug ID 6857012)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock
mm [Sat, 12 Jun 2010 11:24:10 +0000 (11:24 +0000)]
Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock

OpenSolaris onnv-revision: 9997:174d75a29a1c

Obtained from: OpenSolaris (Bug ID 6843235)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix ZFS panic deadlock: cycle in blocking chain via zfs_zget
mm [Sat, 12 Jun 2010 11:22:45 +0000 (11:22 +0000)]
Fix ZFS panic deadlock: cycle in blocking chain via zfs_zget

OpenSolaris onnv-revision: 9774:0bb234ab2287

Obtained from: OpenSolaris (Bug ID 6788152)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix vdev_probe() starvation brings txg train to a screeching halt
mm [Sat, 12 Jun 2010 11:21:37 +0000 (11:21 +0000)]
Fix vdev_probe() starvation brings txg train to a screeching halt

OpenSolaris onnv-revision: 9722:e3866bad4e96

Obtained from: OpenSolaris (Bug ID 6844069)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix incomplete resilvering after disk replacement (raidz)
mm [Sat, 12 Jun 2010 11:20:50 +0000 (11:20 +0000)]
Fix incomplete resilvering after disk replacement (raidz)

OpenSolaris onnv-revision: 9434:3bebded7c76a

Obtained from: OpenSolaris (Bug ID 6794570)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix zfs destroy fails to free object in open context, stops up txg train
mm [Sat, 12 Jun 2010 11:19:51 +0000 (11:19 +0000)]
Fix zfs destroy fails to free object in open context, stops up txg train

OpenSolaris onnv-revision: 9409:9dc3f17354ed

Obtained from: OpenSolaris (Bug ID 6809683)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoFix unable to remove a file over NFS after hitting refquota limit
mm [Sat, 12 Jun 2010 11:18:29 +0000 (11:18 +0000)]
Fix unable to remove a file over NFS after hitting refquota limit

OpenSolaris onnv-revision: 8890:8c2bd5f17bf2

Obtained from: OpenSolaris (Bug ID 6798878)
Approved by: pjd, delphij (mentor)
MFC after: 3 days

14 years agoRemove GNU-style struct initialization.
ed [Sat, 12 Jun 2010 07:02:43 +0000 (07:02 +0000)]
Remove GNU-style struct initialization.

Spotted by: clang
Approved by: rpaulo

14 years agoThe ptc.g operation for the Mckinley and Madison processors has the
marcel [Sat, 12 Jun 2010 01:45:29 +0000 (01:45 +0000)]
The ptc.g operation for the Mckinley and Madison processors has the
side-effect of purging more than the requested translation. While
this is not a problem in general, it invalidates the assumption made
during constructing the trapframe on entry into the kernel in SMP
configurations. The assumption is that only the first store to the
stack will possibly cause a TLB miss. Since the ptc.g purges the
translation caches of all CPUs in the coherency domain, a ptc.g
executed on one CPU can cause a purge on another CPU that is
currently running the critical code that saves the state to the
trapframe. This can cause an unexpected TLB miss and with interrupt
collection disabled this means an unexpected data nested TLB fault.

A data nested TLB fault will not save any context, nor provide a
way for software to determine what caused the TLB miss nor where
it occured. Careful construction of the kernel entry and exit code
allows us to handle a TLB miss in precisely orchastrated points
and thereby avoiding the need to wire the kernel stack, but the
unexpected TLB miss caused by the ptc.g instructution resulted in
an unrecoverable condition and resulting in machine checks.

The solution to this problem is to synchronize the kernel entry
on all CPUs with the use of the ptc.g instruction on a single CPU
by implementing a bare-bones readers-writer lock that allows N
readers (= N CPUs entering the kernel) and 1 writer (= execution
of the ptc.g instruction on some CPU). This solution wins over
a rendez-vous approach by not interrupting CPUs with an IPI.

This problem has not been observed on the Montecito.

PR: ia64/147772
MFC after: 6 days

14 years agoApply band-aid around function-like macro fdrop() without turning it into
jkim [Fri, 11 Jun 2010 23:38:25 +0000 (23:38 +0000)]
Apply band-aid around function-like macro fdrop() without turning it into
a real (inline) function or applying void casting for all its consumers.
In most of places, the "return value" is not checked nor assigned, which
causes too many warnings for some smart compilers, i.e., clang.

Found by: clang

14 years agoDetect bit endianness through machine/endian.h. This fixes xz on big-endian
delphij [Fri, 11 Jun 2010 22:29:49 +0000 (22:29 +0000)]
Detect bit endianness through machine/endian.h.  This fixes xz on big-endian
systems.

Tested on: sparc64 (kindly provided by linimon), amd64

14 years agoClean up code by removing pre-C99 struct hack preprocessor magic.
cperciva [Fri, 11 Jun 2010 21:46:45 +0000 (21:46 +0000)]
Clean up code by removing pre-C99 struct hack preprocessor magic.

Approved by: randi (maintainer)

14 years agoPut back the lost bus_describe_intr() calls.
jfv [Fri, 11 Jun 2010 21:35:19 +0000 (21:35 +0000)]
Put back the lost bus_describe_intr() calls.

14 years agoChange the mbuf memory calls back to NOWAIT as a
jfv [Fri, 11 Jun 2010 20:59:29 +0000 (20:59 +0000)]
Change the mbuf memory calls back to NOWAIT as a
problem has been seen in one case with doing the
M_WAITOK

14 years agoMake sysinstall WARNS=2 clean.
randi [Fri, 11 Jun 2010 20:56:40 +0000 (20:56 +0000)]
Make sysinstall WARNS=2 clean.

Approved by: cperciva (mentor)
MFC after: 1 month

14 years agoAdd a couple fixes from Michael Tuexen.
jfv [Fri, 11 Jun 2010 20:54:27 +0000 (20:54 +0000)]
Add a couple fixes from Michael Tuexen.
Remove unneeded rxtx handler, make que handler generic.
Do not allocate header mbufs in rx ring if not doing hdr split.
Release the lock in rxeof call to stack.

MFC for 8.1 asap

14 years agoFix one more case where a string is passed via format argument instead.
jkim [Fri, 11 Jun 2010 20:08:20 +0000 (20:08 +0000)]
Fix one more case where a string is passed via format argument instead.

Found by: clang

14 years agoSimplify a function for getting brightness levels.
jkim [Fri, 11 Jun 2010 19:58:41 +0000 (19:58 +0000)]
Simplify a function for getting brightness levels.

14 years agoRemove unused assignment.
jkim [Fri, 11 Jun 2010 19:53:42 +0000 (19:53 +0000)]
Remove unused assignment.

Found by: clang static analyzer
Found by: Coverity Prevent[tm] (CID 4537, 4538, 4539)

14 years agoCache the last result from if_indextoname for printing. This speeds up
mlaier [Fri, 11 Jun 2010 19:35:05 +0000 (19:35 +0000)]
Cache the last result from if_indextoname for printing.  This speeds up
"arp -an" when using a lot of aliases (on a single interface).

A better fix would include a better interface for if_indextoname than
getting the whole address list from the kernel just to find the one
index->name mapping.

Reported & analyzed by: Nick Rogers
MFC after: 3 days

14 years agofix a few cases where a string is passed via format argument instead of
avg [Fri, 11 Jun 2010 19:27:21 +0000 (19:27 +0000)]
fix a few cases where a string is passed via format argument instead of
via %s

Most of the cases looked harmless, but this is done for the sake of
correctness.  In one case it even allowed to drop an intermediate buffer.

Found by: clang
MFC after: 2 week

14 years agoRemove a disable_queue from the beginning of the
jfv [Fri, 11 Jun 2010 19:03:59 +0000 (19:03 +0000)]
Remove a disable_queue from the beginning of the
interrupt handler, automask handles it.
Also, add in msix vector descriptions.

MFC for 8.1 asap

14 years agoUpdate several places that iterate over CPUs to use CPU_FOREACH().
jhb [Fri, 11 Jun 2010 18:46:34 +0000 (18:46 +0000)]
Update several places that iterate over CPUs to use CPU_FOREACH().