]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoMerge ext2_readwrite.c into ext2_vnops.c as done in UFS in r101729.
pfg [Wed, 14 Dec 2011 22:04:14 +0000 (22:04 +0000)]
Merge ext2_readwrite.c into ext2_vnops.c as done in UFS in r101729.

This removes the obfuscations mentioned in ext2_readwrite and
places the clustering funtion in a location similar to other
UFS-based implementations.

No performance or functional changeses are expected from
this move.

PR: kern/159232
Suggested by: bde
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoAdd SEE ALSO.
joel [Wed, 14 Dec 2011 19:48:21 +0000 (19:48 +0000)]
Add SEE ALSO.

12 years agoMake *intr{cnt,names} on ARM reside in data section, similar to other arches.
raj [Wed, 14 Dec 2011 17:12:59 +0000 (17:12 +0000)]
Make *intr{cnt,names} on ARM reside in data section, similar to other arches.

sintrnames and sintrcnt are initialized with non-zero values, which were
discarded by the .bss directive, so consumers like "vmstat -i" were not
getting correct data.

Submitted by: Lukasz Plachno
Obtained from: Semihalf
MFC after: 1 month

12 years ago_rtld_bind() read-locks the bind lock, and possible plt resolution
kib [Wed, 14 Dec 2011 16:47:53 +0000 (16:47 +0000)]
_rtld_bind() read-locks the bind lock, and possible plt resolution
from the dispatcher would also acquire bind lock in read mode, which
is the supported operation. plt is explicitely designed to allow safe
multithreaded updates, so the shared lock do not cause problems.

The error in r228435 is that it allows read lock acquisition after the
write lock for the bind block.  If we dlopened the shared object that
contains IRELATIVE or jump slot which target is STT_GNU_IFUNC, then
possible recursive plt resolve from the dispatcher would cause it.

Postpone the resolution for irelative/ifunc right before initializers
are called, and drop bind lock around calls to dispatcher.  Use
initlist to iterate over the objects instead of the ->next, due to
drop of the bind lock in iteration.

For i386/reloc.c:reloc_iresolve(), fix calculation of the dispatch
function address for dso, by taking into account possible non-zero
relocbase.

MFC after: 3 weeks

12 years agoRework the attachement to probe directly on isab(4).
fabient [Wed, 14 Dec 2011 15:39:51 +0000 (15:39 +0000)]
Rework the attachement to probe directly on isab(4).
Depend on r228496.

Requested by: jhb
MFC after: 1 month

12 years agoAfter several suggestions from people, move eventtimers page from 7 to 4.
mav [Wed, 14 Dec 2011 15:19:40 +0000 (15:19 +0000)]
After several suggestions from people, move eventtimers page from 7 to 4.

12 years agoMore MLINKS for rtalloc.9
glebius [Wed, 14 Dec 2011 14:55:19 +0000 (14:55 +0000)]
More MLINKS for rtalloc.9

12 years agoUpdate this page to describe modern interfaces.
glebius [Wed, 14 Dec 2011 14:52:50 +0000 (14:52 +0000)]
Update this page to describe modern interfaces.

12 years ago- The previous commit (r228449) accidentally moved the vm.stats.vm.* sysctls
eadler [Wed, 14 Dec 2011 13:25:00 +0000 (13:25 +0000)]
- The previous commit (r228449) accidentally moved the vm.stats.vm.* sysctls
  to vm.stats.sys.  Move them back.

Noticed by: pho
Reviewed by: bde (earlier version)
Approved by: bz
MFC after: 1 week
Pointy hat to: me

12 years agoAdd PCI IDs for the Intel ICH9M SATA controllers.
mav [Wed, 14 Dec 2011 13:12:55 +0000 (13:12 +0000)]
Add PCI IDs for the Intel ICH9M SATA controllers.

MFC after: 2 weeks

12 years agoImplement BUS_ADD_CHILD() for the isab(4) driver. It already calls
jhb [Wed, 14 Dec 2011 12:34:02 +0000 (12:34 +0000)]
Implement BUS_ADD_CHILD() for the isab(4) driver.  It already calls
bus_generic_probe() and bus_generic_attach() to handle drivers that add
new children via identify methods.

MFC after: 1 week

12 years agoSlightly alter the C1X definitions in in cdefs.h:
ed [Wed, 14 Dec 2011 09:09:37 +0000 (09:09 +0000)]
Slightly alter the C1X definitions in in cdefs.h:

- Add _Alignas(). Unfortunately this macro is only partially functional.
  The C1X standard will allow both an integer and a type name to be
  passed to this macro, while this macro only allows an integer. To be
  portable, one must use _Alignas(_Alignof(double)) to use type names.

- Don't do _Static_assert() when __COUNTER__ is not supported. We'd
  better keep this implementation robust and allow it to be used in
  header files, without mysteriously breaking older compilers.

12 years agoFix for random USB transfer time out.
hselasky [Wed, 14 Dec 2011 08:52:27 +0000 (08:52 +0000)]
Fix for random USB transfer time out.

Submitted by: PseudoCylon
MFC after: 3 days

12 years agoFix definition of XHCI port power bit.
hselasky [Wed, 14 Dec 2011 08:44:16 +0000 (08:44 +0000)]
Fix definition of XHCI port power bit.

Reported by: Kohji Okuno
MFC after: 3 days

12 years agoClean up includes; the prototype for getosreldate() has moved to
ru [Wed, 14 Dec 2011 08:35:08 +0000 (08:35 +0000)]
Clean up includes; the prototype for getosreldate() has moved to
<unistd.h> in r183390.

12 years agoDo not clobber the ingress queue's congestion setting.
np [Wed, 14 Dec 2011 05:34:23 +0000 (05:34 +0000)]
Do not clobber the ingress queue's congestion setting.

MFC after: 1 month

12 years agoMatch other formatting.
obrien [Wed, 14 Dec 2011 02:31:32 +0000 (02:31 +0000)]
Match other formatting.

12 years agoUse usbd_transfer_unsetup() instead of usbd_transfer_stop() so that
hselasky [Wed, 14 Dec 2011 01:03:07 +0000 (01:03 +0000)]
Use usbd_transfer_unsetup() instead of usbd_transfer_stop() so that
we don't have to worry about locking.

MFC after: 1 weeks

12 years agoStop USB audio transfers early so that any audio applications
hselasky [Wed, 14 Dec 2011 00:48:20 +0000 (00:48 +0000)]
Stop USB audio transfers early so that any audio applications
will time out and close opened /dev/dspX.Y device(s), if
any. This is a workaround because we cannot unregister PCM
devices while the audio character device is in use.

Add a missing inclusion guard.

MFC after: 1 weeks

12 years agoImplement better support for USB controller suspend and resume.
hselasky [Wed, 14 Dec 2011 00:28:54 +0000 (00:28 +0000)]
Implement better support for USB controller suspend and resume.

This patch should remove the need for kldunload of USB
controller drivers at suspend and kldload of USB controller
drivers at resume.

This patch also fixes some build issues in avr32dci.c

MFC after: 2 weeks

12 years agoChange targ(4) to use cdevpriv, instead of multiple character devices.
ed [Tue, 13 Dec 2011 21:26:33 +0000 (21:26 +0000)]
Change targ(4) to use cdevpriv, instead of multiple character devices.

Also update the manpage and the scsi_target example program accordingly.

Discussed on: scsi@
Tested by: Chuck Tuffli <chuck tuffli net>

12 years agoDestroy DMA tag for jumbo RX buffer in device detach.
yongari [Tue, 13 Dec 2011 20:31:57 +0000 (20:31 +0000)]
Destroy DMA tag for jumbo RX buffer in device detach.

12 years agoBCM5720 performance tweak from Broadcom.
yongari [Tue, 13 Dec 2011 20:26:46 +0000 (20:26 +0000)]
BCM5720 performance tweak from Broadcom.
 o Allow multiple outstanding read requests from non-LSO read DMA engine.
 o Allow 4KB burst length reads for non-LSO frames.
 o Enable 512B burst length reads for buffer descriptors.

Submitted by: Geans Pin < geanspin <> broadcom dot com >

12 years agoReimplement CTASSERT() using _Static_assert().
ed [Tue, 13 Dec 2011 19:39:24 +0000 (19:39 +0000)]
Reimplement CTASSERT() using _Static_assert().

12 years agoMake support for C1X keywords more complete.
ed [Tue, 13 Dec 2011 19:37:27 +0000 (19:37 +0000)]
Make support for C1X keywords more complete.

- _Alignof(), which returns the aligment of a certain type.
- _Static_assert(), which can be used to check compile-time assertions.
- _Thread_local, which uses TLS on a variable.

MFC after: 3 months
Reviewed by: mdf

12 years agoRework link state tracking and remove superfluous link UP/DOWN
yongari [Tue, 13 Dec 2011 18:11:25 +0000 (18:11 +0000)]
Rework link state tracking and remove superfluous link UP/DOWN
messages.
 o Add check for actually resolved speed in miibus_statchg callback
   instead of blindly reprogramming BCE_EMAC_MODE register.  The
   callback may be called multiple times(e.g. link UP, link
   transition, auto-negotiate complete etc) while auto-negotiation
   is in progress.  All unresolved link state changes are ignored
   now and setting BCE_EMAC_MODE after link establishment is done
   once.
 o bce(4) is careful enough not to drive MII_TICK if driver got a
   valid link.  To detect lost link, bce(4) relied on link state
   change interrupt and if driver see the interrupt, it forced to
   drive MII_TICK by calling bce_tick() in interrupt handler.
   Because bce(4) generates multiple link state change interrupts
   while auto-negotiation is in progress, bce_tick() would be
   called multiple times and this resulted in generating multiple
   link UP/DOWN messages.
   With this change, bce_tick() is not called in interrupt handler
   anymore such that miibus_statchg callback handles link state
   changes with consistent manner.

Reviewed by: davidch

12 years agoDisallow various debug.kdb sysctl's when securelevel is raised.
obrien [Tue, 13 Dec 2011 17:59:16 +0000 (17:59 +0000)]
Disallow various debug.kdb sysctl's when securelevel is raised.

PR: 161350

12 years agoAdd support for __COUNTER__.
ed [Tue, 13 Dec 2011 17:34:47 +0000 (17:34 +0000)]
Add support for __COUNTER__.

__COUNTER__ allows one to obtain incrementing (read: unique) numbers
from the C preprocesor. This is useful when implementing things like a
robust implementation of CTASSERT(), which currently fails when using
it more than once on a single line of code. Probably not likely to cause
any breakage, but still.

__COUNTER__ was also added to GCC 4.3, but since that implementation is
GPLv3 licensed, I took the liberty of implementing it without looking at
any upstream sources. Therefore, this version is licensed under the same
license as the rest of the code; GPLv2.

12 years agoDon't use __P().
ed [Tue, 13 Dec 2011 14:53:26 +0000 (14:53 +0000)]
Don't use __P().

The rest of the file doesn't use it either and according to style(9), it
should not be used.

12 years agoAdd compatibility support for specifing IPv4 aliases in
glebius [Tue, 13 Dec 2011 14:36:04 +0000 (14:36 +0000)]
Add compatibility support for specifing IPv4 aliases in
rc.conf without the "inet" keyword.

Obtained from: hrs

12 years agoReplace `inline static' by `static inline'.
ed [Tue, 13 Dec 2011 14:06:01 +0000 (14:06 +0000)]
Replace `inline static' by `static inline'.

If I interpret the C standard correctly, the storage specifier should be
placed before the inline keyword. While at it, replace __inline by
inline in the files affected.

12 years ago- Add a sysctl to allow non-root users the ability to set idle
eadler [Tue, 13 Dec 2011 14:00:27 +0000 (14:00 +0000)]
- Add a sysctl to allow non-root users the ability to set idle
priorities.

- While here fix up some style nits.

Discussed with: cperciva (breifly)
Reviewed by: pjd (earlier version)
Reviewed by: bde
Approved by: jhb
MFC after: 1 month

12 years agoReplace __signed by signed.
ed [Tue, 13 Dec 2011 13:38:03 +0000 (13:38 +0000)]
Replace __signed by signed.

The signed keyword is an integral part of the C syntax. There's no need
to use __signed.

12 years agoReplace __const by const in all non-contributed source code.
ed [Tue, 13 Dec 2011 13:32:56 +0000 (13:32 +0000)]
Replace __const by const in all non-contributed source code.

As C1X is close to being released, there is no need to wrap around a
feature that is already part of C90. Most of these files already use
`const' in different placed as well.

12 years agodhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
glebius [Tue, 13 Dec 2011 11:54:51 +0000 (11:54 +0000)]
dhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
that changed 0.0.0.0/0.0.0.0 prefix to 0.0.0.0/255.0.0.0.

In the r228313 this behavior was fixed, and since dhclient-script
got broken.

I'm not sure this fix is a perfect one, it just changes
dhclient-script to set 0.0.0.0/255.0.0.0 explicitly.

PR: kern/163206

12 years ago - Fix different variable types use in different files after r121184,
mav [Tue, 13 Dec 2011 11:13:28 +0000 (11:13 +0000)]
 - Fix different variable types use in different files after r121184,
causing problems on amd64.
 - s/%lud/%lu/.

MFC after: 1 month

12 years agoFix few bugs in isp(4) target mode support:
mav [Tue, 13 Dec 2011 09:58:05 +0000 (09:58 +0000)]
Fix few bugs in isp(4) target mode support:
 - in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
 - fix hold count leak inside rls_lun_statep() that also fired above assert;
 - in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
 - make isp_disable_lun() to set status in CCB;
 - make isp_target_mark_aborted() set status into the proper CCB.

Reviewed by: mjacob
Sponsored by: iXsystems, inc.
MFC after: 1 month

12 years agoStaticify dumpfs.
ed [Tue, 13 Dec 2011 09:01:44 +0000 (09:01 +0000)]
Staticify dumpfs.

This tool only consists of a single C file, so we can simply mark
everything except main() static. This seems to shave off about 8% of the
binary size.

12 years agoThe "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
ru [Tue, 13 Dec 2011 08:23:03 +0000 (08:23 +0000)]
The "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
IPv4 aliases to work since network.subr@197139.

MFC after: 3 days

12 years agoSome cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
glebius [Tue, 13 Dec 2011 07:02:48 +0000 (07:02 +0000)]
Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
usage, but end up with more changes.

- Use SIOCAIFADDR instead of old rusty SIOCSIFADDR, SIOCSIFBRDADDR
  and SIOCSIFNETMASK.
- Use queue(9) instead of hand made stailq.
- Use one socket for all ifioctl() and send/receive operations.
- Use __func__ instead of cut-n-paste in logging and panics.
- Axe some dead or strange code.

Tested by: gonzo, Stefan Bethke <stb lassitu.de>

12 years agoBelatedly catch up with r151555. in_scrubprefix() also needs this fix. We
glebius [Tue, 13 Dec 2011 06:56:43 +0000 (06:56 +0000)]
Belatedly catch up with r151555. in_scrubprefix() also needs this fix. We
should compare not only addresses, but their masks, too, when searching
for matching prefix.

12 years agoStyle(9) changes.
adrian [Tue, 13 Dec 2011 05:13:51 +0000 (05:13 +0000)]
Style(9) changes.

12 years agoDocument a large number of currently undocumented sysctls. While here
eadler [Tue, 13 Dec 2011 00:38:50 +0000 (00:38 +0000)]
Document a large number of currently undocumented sysctls. While here
fix some style(9) issues and reduce redundancy.

PR: kern/155491
PR: kern/155490
PR: kern/155489
Submitted by: Galimov Albert <wtfcrap@mail.ru>
Approved by: bde
Reviewed by: jhb
MFC after: 1 week

12 years agoRevert the approach for skipping lockstat_probe_func call when doing
attilio [Mon, 12 Dec 2011 23:29:32 +0000 (23:29 +0000)]
Revert the approach for skipping lockstat_probe_func call when doing
lock_success/lock_failure, introduced in r228424, by directly skipping
in dtrace_probe.

This mainly helps in avoiding namespace pollution and thus lockstat.h
dependency by systm.h.

As an added bonus, this also helps in MFC case.
Reviewed by: avg
MFC after: 3 months (or never)
X-MFC: r228424

12 years agoMake 64-bit procstat output ELF auxiliary vectors for 32-bit processes.
trociny [Mon, 12 Dec 2011 22:01:33 +0000 (22:01 +0000)]
Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes.

Reviewed by: kib
MFC after: 1 week

12 years agoMake procstat -l output similar to the output of limits(1).
trociny [Mon, 12 Dec 2011 21:41:05 +0000 (21:41 +0000)]
Make procstat -l output similar to the output of limits(1).

Suggested by: jhb
MFC after: 1 week

12 years ago- Add support for ASCII art splash screens in TheDraw format
eadler [Mon, 12 Dec 2011 21:12:07 +0000 (21:12 +0000)]
- Add support for ASCII art splash screens in TheDraw format

PR: kern/143370
Submitted by: Antony Mawer <antony@mawer.org>
Reviewed by: gjb (doc)
Reviewed by: des (style)
Approved by: ed
MFC after: 1 month

12 years ago - Define true and false in sys/types.h for _KERNEL consumers, and
mdf [Mon, 12 Dec 2011 18:44:17 +0000 (18:44 +0000)]
 - Define true and false in sys/types.h for _KERNEL consumers, and
   typedef bool.  Due to macro expansion it seemed better to use a
   typedef for kernel consumers (specifically ofed won't compile
   without more changes if a define is used).
 - <stdbool.h> should also not re-define bool/true/false if they are
   defined by <sys/types.h>.  It would probably be a programming error
   to define _KERNEL for user-space code, but downstream consumers
   like Isilon have already been including <stdbool.h> in kernel
   sources, and this protects that usage.
 - sizeof(_Bool) is not necessarily the same as sizeof(int), so kernel
   modules should be rebuild with this change.  Bump __FreeBSD_version.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoDo not define bool/true/false if the symbols already exist.
mdf [Mon, 12 Dec 2011 18:43:24 +0000 (18:43 +0000)]
Do not define bool/true/false if the symbols already exist.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoDo not use the sometimes-reserved work 'bool' for a variable name.
mdf [Mon, 12 Dec 2011 18:43:18 +0000 (18:43 +0000)]
Do not use the sometimes-reserved work 'bool' for a variable name.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoConsistently use types in e1000 driver code:
mdf [Mon, 12 Dec 2011 18:27:34 +0000 (18:27 +0000)]
Consistently use types in e1000 driver code:

 - Two struct members eee_disable are used in a function that expects
   an int *, so declare them int, not bool.
 - igb_tx_ctx_setup() returns a boolean value, so declare it bool, not int.
 - igb_header_split is passed to TUNABLE_INT, so delcare it int, not bool.
 - igb_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool/true/false if the symbols already exist.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoConsistently use types in ixgbe driver code:
mdf [Mon, 12 Dec 2011 18:27:28 +0000 (18:27 +0000)]
Consistently use types in ixgbe driver code:

 - {ixgbe,ixv}_header_split is passed to TUNABLE_INT, so delcare it
   int, not bool.
 - {ixgbe,ixv}_tx_ctx_setup() returns a boolean value, so declare it
   bool, not int.
 - {ixgbe,ixv}_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - {ixgbe,ixv}_txeof() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool if the symbol already exists.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoThere's a small set of events on Nehalem, that are not supported in
fabient [Mon, 12 Dec 2011 13:12:55 +0000 (13:12 +0000)]
There's a small set of events on Nehalem, that are not supported in
processors with CPUID signature 06_1AH, 06_1EH, and 06_1FH.

Refuse to allocate them on unsupported model.

Submitted by: Davide Italiano <davide.italiano@gmail.com>
MFC after: 1 month

12 years agoAdd missing static and const keywords to kbdcontrol.
ed [Mon, 12 Dec 2011 12:33:38 +0000 (12:33 +0000)]
Add missing static and const keywords to kbdcontrol.

None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.

12 years agoAdd VIA microde update support to cpuctl(4) and cpucontrol(8).
fabient [Mon, 12 Dec 2011 12:30:44 +0000 (12:30 +0000)]
Add VIA microde update support to cpuctl(4) and cpucontrol(8).

Support have been tested with X2 CPU and QuadCore CPU.

MFC after: 1 month

12 years agoAdd support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
kib [Mon, 12 Dec 2011 11:03:14 +0000 (11:03 +0000)]
Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
rtld on 386 and amd64. This adds runtime bits neccessary for the use
of the dispatch functions from the dynamically-linked executables and
shared libraries.

To allow use of external references from the dispatch function, resolution
of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries
for PLT are prepared, and normal resolution of the GOT entries is finished.
Similar to how it is done by GNU, IRELATIVE relocations are resolved in
advance, instead of normal lazy handling for PLT.

Move the init_pltgot() call before the relocations for the object are
processed.

MFC after: 3 weeks

12 years agoAdd definitions for GNU-specific STT_GNU_IFUNC symbol type,
kib [Mon, 12 Dec 2011 10:10:49 +0000 (10:10 +0000)]
Add definitions for GNU-specific STT_GNU_IFUNC symbol type,
and R_{386,X86_64}_IRELATIVE relocations.

MFC after: 3 weeks

12 years agoput sys/systm.h at its proper place or add it if missing
avg [Mon, 12 Dec 2011 10:05:13 +0000 (10:05 +0000)]
put sys/systm.h at its proper place or add it if missing

Reported by: lstewart, tinderbox
Pointyhat to: avg, attilio
MFC after: 1 week
MFC with: r228430

12 years agoFix printf.
kib [Mon, 12 Dec 2011 10:04:04 +0000 (10:04 +0000)]
Fix printf.

Submitted by: az
MFC after: 1 week

12 years agoAdd watchdog support for VIA south bridge chipset.
fabient [Mon, 12 Dec 2011 09:50:33 +0000 (09:50 +0000)]
Add watchdog support for VIA south bridge chipset.
Tested on VT8251, VX900 but CX700, VX800, VX855 should works.

MFC after: 1 month
Sponsored by: NETASQ

12 years agokern_racct: move sys/systm.h inclusion to its proper place
avg [Mon, 12 Dec 2011 07:46:10 +0000 (07:46 +0000)]
kern_racct: move sys/systm.h inclusion to its proper place

This should fix the build failure introduced with r228424.
Also remove duplicate inclusion of sys/param.h.

Pointyhat to: avg
MFC after: 1 week

12 years agosyscons: make sc_puts static as it is used only privately
avg [Sun, 11 Dec 2011 21:10:11 +0000 (21:10 +0000)]
syscons: make sc_puts static as it is used only privately

Perhaps sc_puts should also be renamed to scputs to follow the implied
naming conventions in the file...

MFC after: 2 weeks

12 years agoAdd static keywords to vidcontrol(1).
ed [Sun, 11 Dec 2011 21:02:33 +0000 (21:02 +0000)]
Add static keywords to vidcontrol(1).

While there, remove the false optimisation of the colors array. It seems
that changing it to an array of pointers instead of a 16x16 array does
not cause any increase in binary size at all.

12 years agopanic: add a switch and infrastructure for stopping other CPUs in SMP case
avg [Sun, 11 Dec 2011 21:02:01 +0000 (21:02 +0000)]
panic: add a switch and infrastructure for stopping other CPUs in SMP case

Historical behavior of letting other CPUs merily go on is a default for
time being.  The new behavior can be switched on via
kern.stop_scheduler_on_panic tunable and sysctl.

Stopping of the CPUs has (at least) the following benefits:
- more of the system state at panic time is preserved intact
- threads and interrupts do not interfere with dumping of the system
  state

Only one thread runs uninterrupted after panic if stop_scheduler_on_panic
is set.  That thread might call code that is also used in normal context
and that code might use locks to prevent concurrent execution of certain
parts.  Those locks might be held by the stopped threads and would never
be released.  To work around this issue, it was decided that instead of
explicit checks for panic context, we would rather put those checks
inside the locking primitives.

This change has substantial portions written and re-written by attilio
and kib at various times.  Other changes are heavily based on the ideas
and patches submitted by jhb and mdf.  bde has provided many insights
into the details and history of the current code.

The new behavior may cause problems for systems that use a USB keyboard
for interfacing with system console.  This is because of some unusual
locking patterns in the ukbd code which have to be used because on one
hand ukbd is below syscons, but on the other hand it has to interface
with other usb code that uses regular mutexes/Giant for its concurrency
protection.  Dumping to USB-connected disks may also be affected.

PR: amd64/139614 (at least)
In cooperation with: attilio, jhb, kib, mdf
Discussed with: arch@, bde
Tested by: Eugene Grosbein <eugen@grosbein.net>,
gnn,
Steven Hartland <killing@multiplay.co.uk>,
glebius,
Andrew Boyer <aboyer@averesystems.com>
(various versions of the patch)
MFC after: 3 months (or never)

12 years agoAdd static keywords to chio(1).
ed [Sun, 11 Dec 2011 20:53:12 +0000 (20:53 +0000)]
Add static keywords to chio(1).

All other global variables are already marked static, so for consistency
sake, add them to these three arrays as well.

12 years agoAdd more static keywords to rcorder(8).
ed [Sun, 11 Dec 2011 20:48:40 +0000 (20:48 +0000)]
Add more static keywords to rcorder(8).

The global variables and functions provided by rcorder.c are not used in
the other C files, as the other C files only provide memory allocation
and hash functions. This reduces the binary size by 10%.

12 years agoMinor whitespace cleanup to make.conf(5).
gjb [Sun, 11 Dec 2011 20:01:37 +0000 (20:01 +0000)]
Minor whitespace cleanup to make.conf(5).

MFC after: 1 week
X-MFC-With: 228418

12 years agoDocument the SVN variable needs to be set in make.conf(5) when SVN_UPDATE
gjb [Sun, 11 Dec 2011 19:53:11 +0000 (19:53 +0000)]
Document the SVN variable needs to be set in make.conf(5) when SVN_UPDATE
is set.

PR: 163162
Submitted by: Oliver Hartmann <ohartman!zedat.fu-berlin.de>
Patch by: Benjamin Kaduk <kaduk!mit.edu> (original)
MFC after: 1 week

12 years agoAdd missing static keyword.
ed [Sun, 11 Dec 2011 19:28:04 +0000 (19:28 +0000)]
Add missing static keyword.

All global variables and functions are marked static. Simply because
this is an enum, doesn't mean we can't do so as well.

12 years agoAdd missing static keyword.
ed [Sun, 11 Dec 2011 19:22:42 +0000 (19:22 +0000)]
Add missing static keyword.

All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.

12 years agoLast change still had an issue, one more time...
jfv [Sun, 11 Dec 2011 18:46:14 +0000 (18:46 +0000)]
Last change still had an issue, one more time...

12 years agoIncrease the available virtual address space for user programs on PowerPC
nwhitehorn [Sun, 11 Dec 2011 17:23:03 +0000 (17:23 +0000)]
Increase the available virtual address space for user programs on PowerPC
AIM systems to 4 GB on 32-bit systems and 2^64 bytes on 64-bit systems.
VM_MAXUSER_ADDRESS remains at 2 GB on pending Book-E, pending review of
an increase to 3 GB by those more familiar with Book-E.

12 years agoKeep track of PVO entries in each pmap, which allows much faster
nwhitehorn [Sun, 11 Dec 2011 17:19:48 +0000 (17:19 +0000)]
Keep track of PVO entries in each pmap, which allows much faster
pmap_remove() for large sparse requests. This can prevent pmap_remove()
operations on 64-bit process destruction or swapout that would take
several hundred times the lifetime of the universe to complete. This
behavior is largely indistinguishable from a hang.

12 years agoInclude sys/queue.h: snmpmod.h uses TAILQ.
trociny [Sun, 11 Dec 2011 17:10:33 +0000 (17:10 +0000)]
Include sys/queue.h: snmpmod.h uses TAILQ.

PR: bin/153153
MFC after: 2 weeks

12 years agoAdd more files to cleanup with 'make delete-old' when WITHOUT_CLANG is
dim [Sun, 11 Dec 2011 14:01:11 +0000 (14:01 +0000)]
Add more files to cleanup with 'make delete-old' when WITHOUT_CLANG is
in effect.

MFC after: 1 week

12 years agoLet reboot(8) use getprogname() to compare the program name.
ed [Sun, 11 Dec 2011 11:42:44 +0000 (11:42 +0000)]
Let reboot(8) use getprogname() to compare the program name.

While there, mark the global variable dohalt static, as reboot(8) only
consists of a single C file.

12 years agoAdd missing static keywords to global variables in camcontrol.
ed [Sun, 11 Dec 2011 11:38:50 +0000 (11:38 +0000)]
Add missing static keywords to global variables in camcontrol.

While there, make the vendor list const and add appropriate keywords to
functions that use this list.

12 years agoMove 3.5 KB from the data segment to the text segment.
ed [Sun, 11 Dec 2011 09:56:48 +0000 (09:56 +0000)]
Move 3.5 KB from the data segment to the text segment.

The `struct modes' are only used by the getter-functions in the same
file, so we can safely mark them static and const.

12 years agoCorrect LINT build issues in the ioctl code.
jfv [Sun, 11 Dec 2011 09:37:25 +0000 (09:37 +0000)]
Correct LINT build issues in the ioctl code.

12 years ago- fix typo
eadler [Sat, 10 Dec 2011 21:05:06 +0000 (21:05 +0000)]
- fix typo

Approved by: kib@

12 years agoAvoid the possibility of integer overflow in the calculation of
alc [Sat, 10 Dec 2011 18:42:00 +0000 (18:42 +0000)]
Avoid the possibility of integer overflow in the calculation of
VM_KMEM_SIZE_MAX.  Specifically, if the user/kernel address space split
was changed such that the kernel address space was greater than or equal
to 2 GB, then overflow would occur.

PR: 161721
MFC after: 3 weeks

12 years agoMake comsat(8) approximately 15% smaller.
ed [Sat, 10 Dec 2011 18:35:26 +0000 (18:35 +0000)]
Make comsat(8) approximately 15% smaller.

This program only consists of a single C file, so simply mark everything
except main() static.

12 years agoAdd more static keywords to truss(1) source code.
ed [Sat, 10 Dec 2011 18:27:55 +0000 (18:27 +0000)]
Add more static keywords to truss(1) source code.

There are some tables in the source code that are only used by the
individual source files themselves. Therefore there is no need to export
them.

12 years agoAdd missing "static const" to long options table.
ed [Sat, 10 Dec 2011 18:21:03 +0000 (18:21 +0000)]
Add missing "static const" to long options table.

This table is only used in this C file and passed to getopt_long(), so
we can safely add static and const to it.

12 years agoReplace char copyright[] by static const char copyright[].
ed [Sat, 10 Dec 2011 18:11:06 +0000 (18:11 +0000)]
Replace char copyright[] by static const char copyright[].

It seems the latter is used throughout the tree.

12 years agoFix NETMAP code problem in the build.
jfv [Sat, 10 Dec 2011 18:00:53 +0000 (18:00 +0000)]
Fix NETMAP code problem in the build.

12 years agoMove ru_inblock increment into arc_read_nolock() so we don't account for
pjd [Sat, 10 Dec 2011 13:02:52 +0000 (13:02 +0000)]
Move ru_inblock increment into arc_read_nolock() so we don't account for
cached reads.

Discussed with: gibbs
No objections from: avg
Tested by: Marcus Reid <marcus@blazingdot.com>
MFC after: 1 week

12 years agoFix a bug reported by Irene Ruengeler which resulted in not sending
tuexen [Sat, 10 Dec 2011 10:52:54 +0000 (10:52 +0000)]
Fix a bug reported by Irene Ruengeler which resulted in not sending
out HEARTBEATs when requested by the user. The HEARTBEATs were only
queued, but not actually sent out.

MFC after: 2 months.

12 years agoPart 2 of 2 New deltas for the 1G drivers.
jfv [Sat, 10 Dec 2011 07:08:52 +0000 (07:08 +0000)]
Part 2 of 2  New deltas for the 1G drivers.

There have still been intermittent problems with apparent TX
hangs for some customers. These have been problematic to reproduce
but I believe these changes will address them. Testing on a number
of fronts have been positive.

EM: there is an important 'chicken bit' fix for 82574 in the shared
code this is supported in the core here.
    - The TX path has been tightened up to improve performance. In
      particular UDP with jumbo frames was having problems, and the
      changes here have improved that.
    - OACTIVE has been used more carefully on the theory that some
      hangs may be due to a problem in this interaction
    - Problems with the RX init code, the "lazy" allocation and
      ring initialization has been found to cause problems in some
      newer client systems, and as it really is not that big a win
      (its not in a hot path) it seems best to remove it.
    - HWTSO was broken when VLAN HWTAGGING or HWFILTER is used, I
      found this was due to an error in setting up the descriptors
      in em_xmit.

IGB:
    - TX is also improved here. With multiqueue I realized its very
      important to handle OACTIVE only under the CORE lock so there
      are no races between the queues.
    - Flow Control handling was broken in a couple ways, I have changed
      and I hope improved that in this delta.
    - UDP also had a problem in the TX path here, it was change to
      improve that.
    - On some hardware, with the driver static, a weird stray interrupt
      seems to sometimes fire and cause a panic in the RX mbuf refresh
      code. This is addressed by setting interrupts late in the init
      path, and also to set all interrupts bits off at the start of that.

12 years agoPart 1 of two parts, this is the shared code changes in
jfv [Sat, 10 Dec 2011 06:55:02 +0000 (06:55 +0000)]
Part 1 of two parts, this is the shared code changes in
support of new deltas for both em and igb drivers.

Note that I am not able to track all the bugs fixed in
this code, I am a consumer of it as a component of my
core drivers. It is important to keep the FreeBSD drivers
up to date with it however.

One important note is there is a key fix for 82574 in this
update. Also, there are lots of white space changes, I am
not happy about them but have no control over it :)

12 years agoAdd minimal validation of the service name to fend off at least one
des [Sat, 10 Dec 2011 01:44:24 +0000 (01:44 +0000)]
Add minimal validation of the service name to fend off at least one
attack vector against applications that allow the applicant to specify
which policy to apply.

Submitted by: Matthias Drochner <drochner@netbsd.org>
MFC after: 1 week

12 years agoUse the correct upstream revision number for llvm/clang 3.0 release.
dim [Sat, 10 Dec 2011 01:01:44 +0000 (01:01 +0000)]
Use the correct upstream revision number for llvm/clang 3.0 release.

The r145546 revision is from branches/release_30, the r145349 revision
is from tags/RELEASE_30/final.

MFC after: 1 week

12 years agoFreeBSD driver does not require arpcom structure in softc.
yongari [Fri, 9 Dec 2011 23:37:55 +0000 (23:37 +0000)]
FreeBSD driver does not require arpcom structure in softc.

12 years agoRemove the unused if_free_type() function.
brooks [Fri, 9 Dec 2011 23:26:28 +0000 (23:26 +0000)]
Remove the unused if_free_type() function.

X-MFC after: never

12 years agoUpgrade our copy of llvm/clang to 3.0 release. Release notes can be
dim [Fri, 9 Dec 2011 22:23:45 +0000 (22:23 +0000)]
Upgrade our copy of llvm/clang to 3.0 release.  Release notes can be
found at: http://llvm.org/releases/3.0/docs/ReleaseNotes.html

MFC after: 1 week

12 years agoTypo.
kib [Fri, 9 Dec 2011 20:41:54 +0000 (20:41 +0000)]
Typo.

MFC after: 3 days

12 years agoTypo.
kib [Fri, 9 Dec 2011 20:40:24 +0000 (20:40 +0000)]
Typo.

MFC after: 3 days

12 years agoAdded jimharris.
jimharris [Fri, 9 Dec 2011 20:23:58 +0000 (20:23 +0000)]
Added jimharris.

12 years ago- Add a test for PR 151758.
jhb [Fri, 9 Dec 2011 19:24:17 +0000 (19:24 +0000)]
- Add a test for PR 151758.
- While here, make this compile and work on non-i386:
  - Use CMSG_SPACE(), CMSG_LEN(), and CMSG_FIRSTHDR() instead of ignoring
    padding between 'struct cmsghdr' and control message payloads.
  - Don't initialize the control message before calling recvmsg().
    Instead, check that we get a valid control message on return from
    recvmsg().
- Use errx() instead of err() for some errors that don't report failures
  that set errno.

Requested by: kib (1)

12 years agoAfter r228293, et(4) supports altq(4).
yongari [Fri, 9 Dec 2011 19:17:51 +0000 (19:17 +0000)]
After r228293, et(4) supports altq(4).