]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoMove create_file() to misc.sh, as it is going to be used in more places.
pjd [Wed, 11 Aug 2010 16:34:26 +0000 (16:34 +0000)]
Move create_file() to misc.sh, as it is going to be used in more places.

13 years agoMake use of recently added dirgen_max() and namegen_max() to implement
pjd [Wed, 11 Aug 2010 16:33:17 +0000 (16:33 +0000)]
Make use of recently added dirgen_max() and namegen_max() to implement
ENAMETOOLONG checks.

13 years agoInstead of hardcoding {NAME_MAX} as 255 and {PATH_MAX} as 1024 obtain those from
pjd [Wed, 11 Aug 2010 16:29:12 +0000 (16:29 +0000)]
Instead of hardcoding {NAME_MAX} as 255 and {PATH_MAX} as 1024 obtain those from
pathconf(2) and properly generate too long file names.
This should fix ENAMETOOLONG checks on Linux.

13 years agoIPI handlers may run generally with interrupts disabled because they
attilio [Wed, 11 Aug 2010 10:51:27 +0000 (10:51 +0000)]
IPI handlers may run generally with interrupts disabled because they
are served via an interrupt gate.

However, that doesn't explicitly prevent preemption and thread
migration thus scheduler pinning may be necessary in some handlers.
Fix that.

Tested by: gianni
MFC after: 1 month

13 years agoStyle: tabs after #define
kevlo [Wed, 11 Aug 2010 09:29:33 +0000 (09:29 +0000)]
Style: tabs after #define

13 years agoFix some typos: flush vs. flash, and some others.
olli [Wed, 11 Aug 2010 08:26:15 +0000 (08:26 +0000)]
Fix some typos: flush vs. flash, and some others.

Approved by: des (mentor, implicit)
MFC after: 1 week

13 years agoFix compilation when DDB disabled. Adds 'ifdef DDB' around
jchandra [Wed, 11 Aug 2010 06:43:14 +0000 (06:43 +0000)]
Fix compilation when DDB disabled. Adds 'ifdef DDB' around
DB_SHOW_COMMAND definitions.

13 years agoAdd parentheses around the argument 'x' used in the __bswapXX(x) macros. Revert
neel [Wed, 11 Aug 2010 02:28:39 +0000 (02:28 +0000)]
Add parentheses around the argument 'x' used in the __bswapXX(x) macros. Revert
r211130 in favor of this more general fix.

This fixes a compilation error for mips 64-bit little endian build.
libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >= width of type

Suggested by: stefanf, jchandra, bde

13 years agoStart using the 'init_static_kenv()' API provided by r198561 to initialize
neel [Wed, 11 Aug 2010 02:13:50 +0000 (02:13 +0000)]
Start using the 'init_static_kenv()' API provided by r198561 to initialize
CFE environment variables.

13 years agoAllow carp(4) to be loaded as a kernel module. Follow precedent set by
will [Wed, 11 Aug 2010 00:51:50 +0000 (00:51 +0000)]
Allow carp(4) to be loaded as a kernel module.  Follow precedent set by
bridge(4), lagg(4) etc. and make use of function pointers and
pf_proto_register() to hook carp into the network stack.

Currently, because of the uncertainty about whether the unload path is free
of race condition panics, unloads are disallowed by default.  Compiling with
CARPMOD_CAN_UNLOAD in CFLAGS removes this anti foot shooting measure.

This commit requires IP6PROTOSPACER, introduced in r211115.

Reviewed by: bz, simon
Approved by: ken (mentor)
MFC after: 2 weeks

13 years agoMore tests, mostly related to devices and sockets.
pjd [Tue, 10 Aug 2010 22:57:43 +0000 (22:57 +0000)]
More tests, mostly related to devices and sockets.

13 years agosh: Fix heap-based buffer overflow in pathname generation.
jilles [Tue, 10 Aug 2010 22:45:59 +0000 (22:45 +0000)]
sh: Fix heap-based buffer overflow in pathname generation.

The buffer for generated pathnames could be too small in some cases. It
happened to be always at least PATH_MAX long, so there was never an overflow
if the resulting pathnames would be usable.

This bug may be abused if a script subjects input from an untrusted source
to pathname generation, which a bad idea anyhow. Most shell scripts do not
work on untrusted data. secteam@ says no advisory is necessary.

PR: bin/148733
Reported by: Changming Sun snnn119 at gmail com
MFC after: 10 days

13 years agoNow that the uplcom(4) driver can autodetect the chipset type, sync the
gavin [Tue, 10 Aug 2010 19:13:11 +0000 (19:13 +0000)]
Now that the uplcom(4) driver can autodetect the chipset type, sync the
list of devices supported by uplcom(4) with the following sources:

NetBSD  src/sys/dev/usb/uplcom.c 1.70
OpenBSD src/sys/dev/usb/uplcom.c 1.52
Linux   drivers/usb/serial/pl2303.h from kernel 2.6.35
BeOS    usb_serial/driver.c 1.32

Give several devices better descriptions, and rename
PROLIFIC2 -> NETINDEX while here to match everybody else.

MFC after: 6 weeks (after r211111)

13 years agoFix a typo due to a stale version of the patch.
attilio [Tue, 10 Aug 2010 18:29:39 +0000 (18:29 +0000)]
Fix a typo due to a stale version of the patch.

Reported by: gianni, rdivacky
MFC after: 1 month
X-MFC: 211149

13 years agoFix some places that may use cpumask_t while they still use 'int' types.
attilio [Tue, 10 Aug 2010 16:14:10 +0000 (16:14 +0000)]
Fix some places that may use cpumask_t while they still use 'int' types.
While there, also fix some places assuming cpu type is 'int' while
u_int is really meant.

Note: this will also fix some possible races in per-cpu data accessings
to be addressed in further commits.

In collabouration with: Yahoo! Incorporated (via sbruno and peter)
Tested by: gianni
MFC after: 1 month

13 years agoPlace spinlock_enter() and spinlock_exit() just around X86EMU calls.
jkim [Tue, 10 Aug 2010 15:22:48 +0000 (15:22 +0000)]
Place spinlock_enter() and spinlock_exit() just around X86EMU calls.

13 years agocrunchgen now works for mips - so restore building /rescue for it.
adrian [Tue, 10 Aug 2010 14:36:20 +0000 (14:36 +0000)]
crunchgen now works for mips - so restore building /rescue for it.

13 years agoConnect the new script 490.status-pkg-changes (see r210863)
olli [Tue, 10 Aug 2010 12:58:44 +0000 (12:58 +0000)]
Connect the new script 490.status-pkg-changes (see r210863)
to the build, so it gets actually installed.

Approved by: des (mentor)
MFC after: 17 days

13 years ago- Fixes to the chkportsum script to handle better some special cases,
gabor [Tue, 10 Aug 2010 11:15:17 +0000 (11:15 +0000)]
- Fixes to the chkportsum script to handle better some special cases,
  like spaces in filename

Submitted by: Alex Kozlov <spam@rm-rf.kiev.ua>
Approved by: delphij (mentor)

13 years agoPort over changes to the crunch symbol hiding method from NetBSD.
adrian [Tue, 10 Aug 2010 09:24:19 +0000 (09:24 +0000)]
Port over changes to the crunch symbol hiding method from NetBSD.

The older symbol hiding method breaks for MIPS. This implements
symbol hiding through renaming to a symbol name which is highly
unlikely to clash.

The NetBSD code didn't use byte-swapping macros for endian-awareness;
so it didn't work when cross-compiling a MIPS world on i386/amd64.
This patch includes those (as best as I could figure what they
should be) and has been tested to generate valid MIPS crunch
binaries both cross- and native- compiled.

13 years agoDon't delay updating the longcal timer - instead, update the longcal
adrian [Tue, 10 Aug 2010 07:56:56 +0000 (07:56 +0000)]
Don't delay updating the longcal timer - instead, update the longcal
flag immediately so it's only set once per longcal interval.

Without this, the current AR5416 code will continuously spam NF
calibrations during a periodic calibration if the longcal flag
is set. The longcal flag wouldn't be cleared until the calibration
method indicates that calibrations are "complete".

This drops the rate of NF calibration updates down from "once every
shortcal" (ie, every 100ms) during a periodic calibration, to only
once per "longcal" interval. Spamming NF calibrations every 100ms
caused some potentially horrific issues in noisy environments as
NF calibrations can take longer than 100ms and this spamming can
cause invalid NF calibration results to be read back - leading to
missed beacons, and thus leading to a stuck beacon situation.

Stuck beacons cause interface resets, which restart calibrations.
This means that the longcal calibration runs every 100ms (shortcal)
until all initial calibrations are completed. This spamming can then
cause the above issues which leads to stuck beacons, leading to
interface resets, etc, etc. Quite annoying.

13 years agoBring over ar5416 inivals from Linux-2.6.34.
adrian [Tue, 10 Aug 2010 07:48:13 +0000 (07:48 +0000)]
Bring over ar5416 inivals from Linux-2.6.34.

Reviewed by: rpaulo@
Obtained from: Linux

13 years agoRe-format the ar5416 inivals to be consistent with what
adrian [Tue, 10 Aug 2010 07:47:43 +0000 (07:47 +0000)]
Re-format the ar5416 inivals to be consistent with what
Linux ath9k uses.

13 years agoUse NULL instead of 0 when setting up pointer.
kevlo [Tue, 10 Aug 2010 06:58:12 +0000 (06:58 +0000)]
Use NULL instead of 0 when setting up pointer.

13 years agoTidy up locking and memory allocation for the real mode emulator wrapper.
jkim [Tue, 10 Aug 2010 06:25:08 +0000 (06:25 +0000)]
Tidy up locking and memory allocation for the real mode emulator wrapper.
Now we use a regular mutex instead of a spin mutex.  When we enter and exit
the emulator, spinlock_enter() and spinlock_exit() are additionally used.
Move some page table related stuff from x86bios_init() and x86bios_uninit()
to x86bios_map_mem() and x86bios_unmap_mem().

13 years agoFix compilation error for 64-bit little endian build:
neel [Tue, 10 Aug 2010 05:15:35 +0000 (05:15 +0000)]
Fix compilation error for 64-bit little endian build:
libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >= width of type

When the expression '(r_info) >> 32' was passed to bswap32() it was promptly
changed to '(uint32_t)(r_info) >> 32' which is not what we intended.

13 years agoFix (hopefully) the spelling of "queuing."
ivoras [Mon, 9 Aug 2010 23:32:37 +0000 (23:32 +0000)]
Fix (hopefully) the spelling of "queuing."

Submitted by: bf1783 at gmail com

13 years agoBumping the read-ahead count once more, to value equivalent to 512 KiB on
ivoras [Mon, 9 Aug 2010 22:56:10 +0000 (22:56 +0000)]
Bumping the read-ahead count once more, to value equivalent to 512 KiB on
most system, based on benchmark results on a low-end fibre channel SAN
under VMWare:

vfs.read_max read performance
8  (historical default) 83 MB/s
16 (recent bump) 131 MB/s
32 (this version) 152 MB/s
64 157 MB/s

(results are +/- 3 MB/s)

As read-ahead is heuristic, based on past IO requests, it shouldn't be
problematic. The new default is still smaller then in other OSes.

13 years agoElaborate on how hirunningspace was chosen.
ivoras [Mon, 9 Aug 2010 22:22:46 +0000 (22:22 +0000)]
Elaborate on how hirunningspace was chosen.

13 years agoTidy up printf() calls for debugging.
jkim [Mon, 9 Aug 2010 22:06:08 +0000 (22:06 +0000)]
Tidy up printf() calls for debugging.

13 years agoSimplify the logic for handling ipi_selected() and ipi_cpu() in the
attilio [Mon, 9 Aug 2010 20:25:06 +0000 (20:25 +0000)]
Simplify the logic for handling ipi_selected() and ipi_cpu() in the
amd64/i386 case.

Reviewed by: jhb
Tested by: gianni
MFC after: 1 month
X-MFC: 210939

13 years agoLinux has no strlcpy().
pjd [Mon, 9 Aug 2010 20:16:52 +0000 (20:16 +0000)]
Linux has no strlcpy().

13 years agoMFp4 CH180235:
bz [Mon, 9 Aug 2010 19:53:24 +0000 (19:53 +0000)]
MFp4 CH180235:

Add proto spacers to inet6sw like we have for legacy IP. This allows us
to dynamically pf_proto_register() for INET6 from modules, needed by
upcoming CARP changes and SeND.
MC and SCTP could make use of it as well in theory in the future after
upcoming VIMAGE vnet teardown work.

Discussed with: will, anchie
MFC after: 10 days

13 years agoInitialize a variable just before its use.
jkim [Mon, 9 Aug 2010 18:10:32 +0000 (18:10 +0000)]
Initialize a variable just before its use.

13 years agoMake ^L with cons25 and origin mode bit more sane.
ed [Mon, 9 Aug 2010 18:07:15 +0000 (18:07 +0000)]
Make ^L with cons25 and origin mode bit more sane.

Even though cons25 normally doesn't support origin regions, this
emulator does allow you to do it. It makes more sense to blank only the
origin region when emitting ^L instead of blanking the entire screen.
Apart from that, we should always place the cursor inside the origin
region, which doesn't happen right now.

13 years agoReduce diffs between VM86 and X86EMU wrappers for x86bios_alloc() and
jkim [Mon, 9 Aug 2010 17:54:26 +0000 (17:54 +0000)]
Reduce diffs between VM86 and X86EMU wrappers for x86bios_alloc() and
x86bios_free().  Add strict sanity checks for VM86 wrapper and add strict
page table locking for X86EMU wrapper.

13 years agoAttempt to autodetect the cype of chipset, rather than storing this
gavin [Mon, 9 Aug 2010 17:42:05 +0000 (17:42 +0000)]
Attempt to autodetect the cype of chipset, rather than storing this
within the device table.  This code uses the same algorithm as used in the
Linux, NetBSD and DragonflyBSD driver.

While investigating this, it became apparent that the Linux driver always
initialises the device, and not just in the PL2303HX case.  Change
uplcom(4) to do the same.

This change allows us to synchronize our device ID list with Linux and
NetBSD, without requiring knowledge of the chipset in use.

Reviewed by: hselasky
MFC after: 6 weeks

13 years agoFix bind(2) and connect(2) support on Solaris.
pjd [Mon, 9 Aug 2010 17:42:04 +0000 (17:42 +0000)]
Fix bind(2) and connect(2) support on Solaris.

13 years agoFix file system type detection on Solaris.
pjd [Mon, 9 Aug 2010 17:40:59 +0000 (17:40 +0000)]
Fix file system type detection on Solaris.

13 years agoSmall tweaks.
pjd [Mon, 9 Aug 2010 17:37:29 +0000 (17:37 +0000)]
Small tweaks.

13 years agoNo need to use grep to check if path start with /.
pjd [Mon, 9 Aug 2010 17:34:57 +0000 (17:34 +0000)]
No need to use grep to check if path start with /.

Suggested by: ed

13 years agoDocument newly added controller AR8151 and AR8152.
yongari [Mon, 9 Aug 2010 17:33:03 +0000 (17:33 +0000)]
Document newly added controller AR8151 and AR8152.

13 years agoAdd support for Atheros AR8151/AR8152 PCIe gigabit/fast ethernet
yongari [Mon, 9 Aug 2010 17:28:08 +0000 (17:28 +0000)]
Add support for Atheros AR8151/AR8152 PCIe gigabit/fast ethernet
controller. These controllers are known as L1D(AR8151) and
L2CB/B2(AR8152). This change adds supports for the following
controllers.
 o AR8151 v1.0(L1D) gigabit ethernet controller
 o AR8151 v2.0(L1D) gigabit ethernet controller
 o AR8152 v1.1(L2CB) fast ethernet controller
 o AR8152 v2.0(L2CB2) fast ethernet controller
These controllers have the same feature of AR8131/AR8132 and
support improved power saving control. The user visible change at
this moment is reduced jumbo frame size from 9KB to 6KB. Many
thanks to Atheros for continuing to support FreeBSD.

HW donated by: Atheros Communications, Inc.

13 years agoAdd entries for some devices I have locally.
gavin [Mon, 9 Aug 2010 17:27:27 +0000 (17:27 +0000)]
Add entries for some devices I have locally.

13 years agoAdd F1 PHY found on Atheros AR8151 v2.0 PCIe gigabit ethernet
yongari [Mon, 9 Aug 2010 17:22:14 +0000 (17:22 +0000)]
Add F1 PHY found on Atheros AR8151 v2.0 PCIe gigabit ethernet
controller.

13 years agoAdd descriptions to a handful of sysctl nodes.
gavin [Mon, 9 Aug 2010 14:48:31 +0000 (14:48 +0000)]
Add descriptions to a handful of sysctl nodes.

PR: kern/148580
Submitted by: Galimov Albert <wtfcrap mail.ru>
MFC after: 1 week

13 years ago- Add full support for header / data digests.
des [Mon, 9 Aug 2010 12:36:36 +0000 (12:36 +0000)]
- Add full support for header / data digests.
- Increase target limit from 4 to 64; this limit will be removed entirely
  at a later time.
- Improve recovery from lost network connections.
- Fix some potential deadlocks and a serious memory leak.
- Fix incorrect use of MH_ALIGN (instead of M_ALIGN), which makes no
  practical difference, but triggers a KASSERT with INVARIANTS.
- Fix some warnings in iscontrol(8) and improve the man page somewhat.

Submitted by: Daniel Braniss <danny@cs.huji.ac.il>
Sponsored by: Dansk Scanning A/S, Data Robotics Inc.

13 years ago"whereis netscape" gives empty output for quite a long time already.
fjoe [Mon, 9 Aug 2010 09:26:17 +0000 (09:26 +0000)]
"whereis netscape" gives empty output for quite a long time already.
Suggest to use "whereis firefox" instead.

13 years agoReturn EIO if vdev->v_phys_read is NULL.
mm [Mon, 9 Aug 2010 06:36:11 +0000 (06:36 +0000)]
Return EIO if vdev->v_phys_read is NULL.

This fixes booting from a ZFS mirror with a unavailable primary device.

PR: kern/148655
Reviewed by: avg
Approved by: delphij (mentor)
MFC after: 3 days

13 years agoIt seems some old Sundace(now IC Plus Corp.) controllers do not
yongari [Mon, 9 Aug 2010 01:47:09 +0000 (01:47 +0000)]
It seems some old Sundace(now IC Plus Corp.) controllers do not
like memory mapped register access. Typical problem from the issue
was MII access returned unreliable values. I'm not sure this comes
from lack of register flushing in MII access after accessing
STE_PHYCTL register though.
To address the issue, read hints data that controls which type of
memory mapping should be used in driver. ste(4) still prefers
memory mapping to io mapping but honor hints entered by user except
for controllers that have problems with memory mapping.
The hint to use iomapping could be given by adding the following
line to /boot/device.hints file.

hint.ste.0.prefer_iomap="1"

PR: kern/149285
MFC after: 5 days

13 years agoAdd a multipath oriented test.
mjacob [Mon, 9 Aug 2010 00:36:22 +0000 (00:36 +0000)]
Add a multipath oriented test.

13 years agoThe r208165 fixed a bug related to unsigned integer overflowing for the
attilio [Mon, 9 Aug 2010 00:23:57 +0000 (00:23 +0000)]
The r208165 fixed a bug related to unsigned integer overflowing for the
number of CPUs detection.
However, that was not mention at all, the problem was not reported, the
patch has not been MFCed and the fix is mostly improper.

Fix the original overflow (caused when 32 CPUs must be detected) by
just using a different mathematical computation (it also makes more
explicit the size of operands involved, which is good in the moment
waiting for a more complete support for a large number of CPUs).

PR: kern/148698
Submitted by: Joe Landers <jlanders at vmware dot com>
Tested by: gianni
MFC after: 10 days

13 years agoBack out r210975, which changed documentation to match the now backed-out
jamie [Sun, 8 Aug 2010 23:24:23 +0000 (23:24 +0000)]
Back out r210975, which changed documentation to match the now backed-out
r210974.

13 years agoBack out r210974. Any convenience of not typing "persist" is outweighed
jamie [Sun, 8 Aug 2010 23:22:55 +0000 (23:22 +0000)]
Back out r210974.  Any convenience of not typing "persist" is outweighed
by the possibility of unintended partially-formed jails.

13 years agoRemove unnecessary duplicate letters in mksyntax.c,
jilles [Sun, 8 Aug 2010 21:04:27 +0000 (21:04 +0000)]
Remove unnecessary duplicate letters in mksyntax.c,
the table elements would just be overwritten twice.

13 years agoThe PL2302X can support any baud rate <= 6Mbps, allow any rate to be set.
gavin [Sun, 8 Aug 2010 20:53:00 +0000 (20:53 +0000)]
The PL2302X can support any baud rate <= 6Mbps, allow any rate to be set.

PR: usb/128324
Submitted by: Mike Durian <durian shadetreesoftware.com> (original patch)
MFC after: 2 weeks

13 years agoDon't pass sizeof(u_int) to an argument of SYSCLT_PROC that ends up not
dwmalone [Sun, 8 Aug 2010 20:34:53 +0000 (20:34 +0000)]
Don't pass sizeof(u_int) to an argument of SYSCLT_PROC that ends up not
being used.

13 years agosh: Add more testcases for ${var:-word}.
jilles [Sun, 8 Aug 2010 17:03:23 +0000 (17:03 +0000)]
sh: Add more testcases for ${var:-word}.

Whether POSIX requires these is unclear.

They pass with 8-stable sh as well.

13 years agoMerge r114010 of head/usr.bin/login/login.c into PicoBSD's login.c:
gavin [Sun, 8 Aug 2010 16:55:27 +0000 (16:55 +0000)]
Merge r114010 of head/usr.bin/login/login.c into PicoBSD's login.c:

Correct the login.conf variable name used for obtaining the login prompt.

PR: conf/44717 (indirectly)
Spotted by: gcooper
MFC after: 1 week

13 years agoCorrect two error messages to match the failure they are reporting.
gavin [Sun, 8 Aug 2010 16:20:32 +0000 (16:20 +0000)]
Correct two error messages to match the failure they are reporting.

MFC after: 1 week

13 years agoWrap some sun4u-only symbols.
marius [Sun, 8 Aug 2010 14:37:16 +0000 (14:37 +0000)]
Wrap some sun4u-only symbols.

13 years ago- As it is not possible for sched_bind(9) to context switch with
marius [Sun, 8 Aug 2010 14:00:21 +0000 (14:00 +0000)]
- As it is not possible for sched_bind(9) to context switch with
  td_critnest > 1 when not already running on the desired CPU read the
  TICK counter of the BSP via a direct cross trap request in that case
  instead.
- Treat the STICK based timecounter the same way as the TICK based one
  regarding its quality and obtaining the counter value from the BSP.
  Like the TICK timers the STICK ones also are only synchronized during
  their startup (which might not result in good synchronicity in the
  first place) but not afterwards and might drift over time, causing
  problems when the time is read from different CPUs (see r135972).

13 years agoloadandclear() for PTEs are not needed on MIPS. The PTEs are software
jchandra [Sun, 8 Aug 2010 12:23:02 +0000 (12:23 +0000)]
loadandclear() for PTEs are not needed on MIPS. The PTEs are software
managed and we already take pmap lock for PTE operations(see r210922)

Reviewed by: alc

13 years agoAdd a termcap entry for rxvt-256color.
gavin [Sun, 8 Aug 2010 09:40:09 +0000 (09:40 +0000)]
Add a termcap entry for rxvt-256color.

PR: conf/147726
Submitted by: Sterling (Chip) Camden <sterling camdensoftware.com>
MFC after: 2 weeks

13 years agoLicense ACK is not required for the wpifw module nor when building
bschmidt [Sun, 8 Aug 2010 08:43:01 +0000 (08:43 +0000)]
License ACK is not required for the wpifw module nor when building
it into the kernel.

PR: conf/148758
Submitted by: Joe Talbott <josepht at dragonflybsd.org>
MFC after: 3 days

13 years agoRemove unneeded struct timezone passed to gettimeofday().
ed [Sun, 8 Aug 2010 08:22:53 +0000 (08:22 +0000)]
Remove unneeded struct timezone passed to gettimeofday().

13 years agoSmall style(9) fix: use tabs instead of spaces.
ed [Sun, 8 Aug 2010 08:19:23 +0000 (08:19 +0000)]
Small style(9) fix: use tabs instead of spaces.

13 years agoAddress an edge condition that we found at work, where the carp(4)
delphij [Sun, 8 Aug 2010 07:04:27 +0000 (07:04 +0000)]
Address an edge condition that we found at work, where the carp(4)
interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at
cold boot.  This behavior is not observed when carp(4) interface
is created slightly later, when the underlying interface is fully
up.

Before this change what happen at boot is roughly:

 - ifconfig creates em0 interface;
 - ifconfig clones a carp device using em0;
   (em0's link state is DOWN at this point)
 - carp state: INIT -> BACKUP [*]
 - carp state: BACKUP -> MASTER
 - [Some negotiate between em0 and switch]
 - em0 kicks up link state change event
   (em0's link state is now up DOWN at this point)
 - do_link_state_change() -> carp_carpdev_state()
 - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+]
 - carp state: INIT -> BACKUP
 - carp state: BACKUP -> MASTER

At the [*] stage, em0 did not received any broadcast message from other
node, and assume our node is the master, thus carp(4) sets the link
state to "UP" after becoming a master.  At [+], the master status
is forcely set to "INIT", then an election is casted, after which our
node would actually become a master.

We believe that at the [*] stage, the master status should remain as
"INIT" since the underlying parent interface's link state is not up.

Obtained from: iXsystems, Inc.
Reported by: jpaetzel
MFC after: 2 months

13 years agoDo not build real mode emulator for i386. We use VM86 again since r210877.
jkim [Sun, 8 Aug 2010 06:18:05 +0000 (06:18 +0000)]
Do not build real mode emulator for i386.  We use VM86 again since r210877.

13 years agoDon't use struct timezone.
ed [Sun, 8 Aug 2010 02:51:32 +0000 (02:51 +0000)]
Don't use struct timezone.

The timezone structure acquired by gettimeofday() is not used at all.
Just remove it.

13 years agoRemove unneeded use of struct timezone.
ed [Sun, 8 Aug 2010 02:45:48 +0000 (02:45 +0000)]
Remove unneeded use of struct timezone.

We can safely call gettimeofday() without passing a struct timezone.
We're not using it at all.

13 years agoThis isn't WARNS=6 safe. It fails to build on mips. Retore old
imp [Sun, 8 Aug 2010 02:45:14 +0000 (02:45 +0000)]
This isn't WARNS=6 safe.  It fails to build on mips.  Retore old
WARNS?=3 until that's resolved.

13 years agoFix -R when used with -p. Previously, the
kientzle [Sun, 8 Aug 2010 01:25:33 +0000 (01:25 +0000)]
Fix -R when used with -p.  Previously, the
uname and gname weren't overwritten, so the
disk restore would use those to lookup the
original uid/gid again.  Clearing the uname
and gname prevents this.

Reported by: swell.k
MFC after: 7 days

13 years agoCache PCIY_PMG and PCIY_EXPRESS capability pointer to softc and use
yongari [Sun, 8 Aug 2010 00:43:41 +0000 (00:43 +0000)]
Cache PCIY_PMG and PCIY_EXPRESS capability pointer to softc and use
it instead of calling pci_find_extcap().

13 years agoRemove unnecessary assignment.
yongari [Sun, 8 Aug 2010 00:23:36 +0000 (00:23 +0000)]
Remove unnecessary assignment.

13 years agoAlways disable ASPM L0s and enable L1 before entering into WOL
yongari [Sun, 8 Aug 2010 00:12:31 +0000 (00:12 +0000)]
Always disable ASPM L0s and enable L1 before entering into WOL
suspend state.  Also disable master clock after PHY power down,
this is supposed to save more power. The master clock should be
enabled if WOL is active.

13 years ago- Introduce a cpu_ipi_single() function pointer in order to send IPIs
marius [Sun, 8 Aug 2010 00:09:22 +0000 (00:09 +0000)]
- Introduce a cpu_ipi_single() function pointer in order to send IPIs
  to single CPUs more efficiently with Cheetah(-class) and Jalapeno CPUs.
  Besides being used to implement the ipi_cpu() introduced in r210939,
  cpu_ipi_single() will also be used internally by the sparc64 MD code.
- Factor out the Jalapeno support from the Cheetah IPI send functions
  in order to be able to more easily and efficiently implement support
  for more than 32 target CPUs as well as a workaround for Cheetah+
  erratum 25 for the latter.

13 years agoFor CPUs which ignore TD_CV and support hardware unaliasing don't
marius [Sun, 8 Aug 2010 00:01:08 +0000 (00:01 +0000)]
For CPUs which ignore TD_CV and support hardware unaliasing don't
bother doing page coloring. This results in a small but measurable
performance improvement in buildworld times.

13 years agoDo not touch CMB TX threshold register when CMB is not used.
yongari [Sat, 7 Aug 2010 23:41:46 +0000 (23:41 +0000)]
Do not touch CMB TX threshold register when CMB is not used.
Note, alc(4) does not use CMB at all due to silicon bug.

13 years agoController does not seem to support more than 1024 bytes DMA burst.
yongari [Sat, 7 Aug 2010 23:33:06 +0000 (23:33 +0000)]
Controller does not seem to support more than 1024 bytes DMA burst.
Limit DMA burst size to be less than or equal to 1024 bytes.

13 years agoMarvell model number 0x06 is 88E1101 PHY.
yongari [Sat, 7 Aug 2010 23:16:21 +0000 (23:16 +0000)]
Marvell model number 0x06 is 88E1101 PHY.

13 years agojh pointed out that src/usr.sbin already has a global
olli [Sat, 7 Aug 2010 20:46:30 +0000 (20:46 +0000)]
jh pointed out that src/usr.sbin already has a global
WARNS=6 setting in HEAD (unlike stable/8), so it's best
to remove the line entirely.

Pointed out by: jh
Approved by: des (mentor)

13 years agoTo help with sequential read UFS performance on modern systems, increase
ivoras [Sat, 7 Aug 2010 18:30:10 +0000 (18:30 +0000)]
To help with sequential read UFS performance on modern systems, increase
the vfs.read_max default. For most systems this means going from 128 KiB
to 256 KiB, which is still very conservative and lower than what most
other operating systems use, but as a sane default should not
interfere much with existing systems.

For systems with RAID volumes and/or virtualization envirnments, where
read performance is very important, increasing this sysctl tunable to 32
or even more will demonstratively yield additional performance benefits.

If MAXPHYS ever gets bumped up, it will probably be a good idea to slave
read_max to it.

13 years agoFix a bug where MSG_TRUNC was not returned in all necessary cases for
tuexen [Sat, 7 Aug 2010 17:57:58 +0000 (17:57 +0000)]
Fix a bug where MSG_TRUNC was not returned in all necessary cases for
SOCK_DGRAM socket. MSG_TRUNC was only returned when some mbufs could
not be copied to the application. If some data was left in the last
mbuf, it was correctly discarded, but MSG_TRUNC was not set.

Reviewed by: bz
MFC after: 3 weeks

13 years agoAdd a keymap for the Swiss-German Macbook keyboard.
gavin [Sat, 7 Aug 2010 17:02:36 +0000 (17:02 +0000)]
Add a keymap for the Swiss-German Macbook keyboard.

PR: conf/139997
Submitted by: Andreas Tobler <andreast fgznet.ch>
MFC after: 2 weeks
Committed from: Bugathon #7

13 years agosyslogd(8) already supports *sending* log messages to non-
olli [Sat, 7 Aug 2010 16:20:12 +0000 (16:20 +0000)]
syslogd(8) already supports *sending* log messages to non-
standard ports, but it can't *receive* them (port 514 is
hardcoded).  This commit adds that missing feature.

(NB:  I actually needed this feature for a server farm where
multiple jails run with shared IP addresses, and every jail
should have its own syslogd process.)

As a side effect, syslogd now compiles with WARNS=6.

Approved by: des (mentor)
MFC after: 3 weeks

13 years agoSync the list of devices supported by uslcom(4) with NetBSD, Linux, OpenBSD
gavin [Sat, 7 Aug 2010 16:14:40 +0000 (16:14 +0000)]
Sync the list of devices supported by uslcom(4) with NetBSD, Linux, OpenBSD
and BeOS.  The devices supported by uslcom(4) are now in sync with:

NetBSD  src/sys/dev/usb/uslsa.c 1.11
OpenBSD src/sys/dev/usb/uslcom.c 1.20
Linux   source/drivers/usb/serial/cp210x.c from kernel 2.6.35
BeOS    usb_serial/driver.c 1.32

Two vendor/product IDs from Linux have not been added to uslcom(4):
  SILABS SAEL - This device has special code in u3g to support it
  SILABS GSM2228 - I suspect this should also be covered by u3g(4).

MFC after: 1 week

13 years agoSort this file a little better: the vendors are supposed to be sorted by
gavin [Sat, 7 Aug 2010 16:08:37 +0000 (16:08 +0000)]
Sort this file a little better: the vendors are supposed to be sorted by
vendor ID in the vendor section, and by symbolic name in the product
section.  Products are sorted by product ID.  While here, get rid of a
duplicate Microsoft Mouse entry, revealed by sorting.

MFC after: 1 week

13 years agoDocument the MEXTADD macro.
des [Sat, 7 Aug 2010 13:26:08 +0000 (13:26 +0000)]
Document the MEXTADD macro.

MFC after: 2 weeks

13 years agoPrefer struct sysentvec sv_psstrings to hardcoding FREEBSD32_PS_STRINGS
kib [Sat, 7 Aug 2010 11:57:13 +0000 (11:57 +0000)]
Prefer struct sysentvec sv_psstrings to hardcoding FREEBSD32_PS_STRINGS
in the compat32 code. Use sv_usrstack instead of FREEBSD32_USRSTACK as well.

MFC after: 1 week

13 years agoAdd compat32 definition for (old) struct ostat.
kib [Sat, 7 Aug 2010 11:53:38 +0000 (11:53 +0000)]
Add compat32 definition for (old) struct ostat.

MFC after: 1 week

13 years agoClean up the style and markup of the paragraph on fractional wait intervals.
yar [Sat, 7 Aug 2010 11:48:31 +0000 (11:48 +0000)]
Clean up the style and markup of the paragraph on fractional wait intervals.

MFC after: 3 days

13 years agoProperly spell and mark up the name of kern.hz.
yar [Sat, 7 Aug 2010 11:32:17 +0000 (11:32 +0000)]
Properly spell and mark up the name of kern.hz.

MFC after: 3 days

13 years agoMove the sentences telling the defaults for -c and -w
yar [Sat, 7 Aug 2010 11:13:50 +0000 (11:13 +0000)]
Move the sentences telling the defaults for -c and -w
to where they belong.  Previously they were misplaced,
i.e., swapped.

MFC after: 3 days

13 years agoIn FreeBSD we use 'jailed' property.
pjd [Sat, 7 Aug 2010 10:23:54 +0000 (10:23 +0000)]
In FreeBSD we use 'jailed' property.

MFC after: 2 weeks

13 years agoFix typo in comment.
joel [Sat, 7 Aug 2010 08:31:32 +0000 (08:31 +0000)]
Fix typo in comment.

13 years agoProperly bounds check ioctl/pioctl data arguments for Coda:
rwatson [Sat, 7 Aug 2010 08:08:14 +0000 (08:08 +0000)]
Properly bounds check ioctl/pioctl data arguments for Coda:

1. Use unsigned rather than signed lengths
2. Bound messages to/from Venus to VC_MAXMSGSIZE
3. Bound messages to/from general user processes to VC_MAXDATASIZE
4. Update comment regarding data limits for pioctl

Without (1) and (3), it may be possible for unprivileged user processes to
read sensitive portions of kernel memory.  This issue is only present if
the Coda kernel module is loaded and venus (the userspace Coda daemon) is
running and has /coda mounted.

As Coda is considered experimental and production use is warned against in
the coda(4) man page, and because Coda must be explicitly configured for a
configuration to be vulnerable, we won't be issuing a security advisory.
However, if you are using Coda, then you are advised to apply these fixes.

Reported by: Dan J. Rosenberg <drosenberg at vsecurity.com>
Obtained from: NetBSD (Christos Zoulas)
Security: Kernel memory disclosure; no advisory as feature experimental
MFC after: 3 days

13 years agoProtect shared palette and state buffer with a mutex. Remove defunct
jkim [Sat, 7 Aug 2010 05:46:04 +0000 (05:46 +0000)]
Protect shared palette and state buffer with a mutex.  Remove defunct
spltty() calls while I am here.

13 years agoDo not block any I/O port on amd64.
jkim [Sat, 7 Aug 2010 04:05:58 +0000 (04:05 +0000)]
Do not block any I/O port on amd64.

13 years agoOptimize interrupt vector lookup. There is no need to check the page table.
jkim [Sat, 7 Aug 2010 03:45:45 +0000 (03:45 +0000)]
Optimize interrupt vector lookup.  There is no need to check the page table.