]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
12 years agoMFC: r223984
marius [Mon, 25 Jul 2011 19:11:29 +0000 (19:11 +0000)]
MFC: r223984

PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI
bridge is blacklisted. In that case just return from pci_alloc_msix_method(),
otherwise we continue without a single MSI-X resource, causing subsequent
attempts to use the seemingly available resource to fail or when booting
verbose to NULL-dereference rle->start when trying to print the IRQ in
pci_alloc_msix_method().

Reviewed by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/8@224394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223981
marius [Mon, 25 Jul 2011 19:06:30 +0000 (19:06 +0000)]
MFC: r223981

Remove extra empty lines.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223962
marius [Mon, 25 Jul 2011 19:04:57 +0000 (19:04 +0000)]
MFC: r223962

Remove NULL assignments which are redundant for static timecounters.

Submitted by: jkim

git-svn-id: svn://svn.freebsd.org/base/stable/8@224390 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223961
marius [Mon, 25 Jul 2011 19:03:45 +0000 (19:03 +0000)]
MFC: r223961

- Remove redundant timecounter masking from counter_get_timecount().
- Zero the timecounter when allocation so we don't need to initialize unused
  members and remove a now redundant NULL assignment.

Submitted by: jkim

git-svn-id: svn://svn.freebsd.org/base/stable/8@224388 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223960
marius [Mon, 25 Jul 2011 19:01:36 +0000 (19:01 +0000)]
MFC: r223960

- Current testing shows that (ab)using the JBC performance counter in bus
  cycle mode as timecounter just works fine. My best guess is that a firmware
  update has fixed this, so check at run-time whether it advances and use a
  positive quality if it does. The latter will cause this timecounter to be
  used instead of the tick counter based one, which just sucks for SMP.
- Remove a redundant NULL assignment from the timecounter initialization.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223959
marius [Mon, 25 Jul 2011 18:59:45 +0000 (18:59 +0000)]
MFC: r223959

- Add a missing shift in schizo_get_timecount(). This happened to be non-fatal
  as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the
  second counter in the upper 32 bits this would be required though as the MI
  timecounter code doesn't support 64-bit counters/counter registers.
- Remove a redundant NULL assignment from the timecounter initialization.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223944
marius [Mon, 25 Jul 2011 18:57:49 +0000 (18:57 +0000)]
MFC: r223944

According to the OpenSolaris source the PCI latency and the cache line size
should be set for Sun ERI.
Tested by: yongari

git-svn-id: svn://svn.freebsd.org/base/stable/8@224382 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223801
marius [Mon, 25 Jul 2011 18:54:28 +0000 (18:54 +0000)]
MFC: r223801

It can be useful to know which page still has mappings.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224380 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223800
marius [Mon, 25 Jul 2011 18:52:49 +0000 (18:52 +0000)]
MFC: r223800

- pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c
  so static'ize them.
- Correct a typo.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224378 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223795
marius [Mon, 25 Jul 2011 18:46:54 +0000 (18:46 +0000)]
MFC: r223795

Call pmap_qremove() before freeing or unwiring the pages, otherwise
there's a window during which a page can be re-used before its previous
mapping is removed.

Reviewed by: alc

git-svn-id: svn://svn.freebsd.org/base/stable/8@224376 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223721
marius [Mon, 25 Jul 2011 18:44:46 +0000 (18:44 +0000)]
MFC: r223721

UltraSPARC-IV CPUs seem to be affected by a not publicly documented
erratum causing them to trigger stray vector interrupts accompanied by a
state in which they even fault on locked TLB entries. Just retrying the
instruction in that case gets the CPU back on track though. OpenSolaris
also just ignores a certain number of stray vector interrupts.
While at it, implement the stray vector interrupt handling for SPARC64-VI
which use these for indicating uncorrectable errors in interrupt packets.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223720
marius [Mon, 25 Jul 2011 18:43:25 +0000 (18:43 +0000)]
MFC: r223720

Don't waste a delay slot.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224373 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223719
marius [Mon, 25 Jul 2011 18:41:52 +0000 (18:41 +0000)]
MFC: r223719

- For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
  the TLBs in order to get rid of the user mappings but instead traverse
  them an flush only the latter like we also do for the Spitfire-class.
  Also flushing the unlocked kernel entries can cause instant faults which
  when called from within cpu_switch() are handled with the scheduler lock
  held which in turn can cause timeouts on the acquisition of the lock by
  other CPUs. This was easily seen with a 16-core V890 but occasionally
  also happened with 2-way machines.
  While at it, move the SPARC64-V support code entirely to zeus.c. This
  causes a little bit of duplication but is less confusing than partially
  using Cheetah-class bits for these.
- For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
  entry, 2-way set associative TLB.
- In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
  that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.

Tested by:      Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)

git-svn-id: svn://svn.freebsd.org/base/stable/8@224370 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223718
marius [Mon, 25 Jul 2011 18:34:42 +0000 (18:34 +0000)]
MFC: r223718

Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to
merge the two.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224369 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223648, r223949
marius [Mon, 25 Jul 2011 18:32:56 +0000 (18:32 +0000)]
MFC: r223648, r223949

- In gem_reset_rx() also reset the RX MAC which is necessary in order to
  get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW.
- In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX
  filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it
  consistently use the newly introduced sc_mac_rxcfg throughout the driver
  instead of reading the its old content.
- Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation
  failure.
- According to the GEM datasheet the RX MAC should also be disabled in
  gem_setladrf() before changing its configuration.
- Add error messages to gem_disable_{r,t}x() and take advantage of these
  throughout the driver instead of duplicating their functionality all over
  the place.

In joint forces with: yongari

git-svn-id: svn://svn.freebsd.org/base/stable/8@224367 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223379
marius [Mon, 25 Jul 2011 18:29:35 +0000 (18:29 +0000)]
MFC: r223379

Fix whitespace

git-svn-id: svn://svn.freebsd.org/base/stable/8@224365 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223378
marius [Mon, 25 Jul 2011 18:28:12 +0000 (18:28 +0000)]
MFC: r223378

On machines where we don't need to lock the kernel TSB into the dTLB and
thus may basically use the entire 64-bit kernel address space reduce
VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224363 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223377
marius [Mon, 25 Jul 2011 18:26:54 +0000 (18:26 +0000)]
MFC: r223377

On machines where we don't need to lock the kernel TSB into the dTLB and
thus may basically use the entire 64-bit kernel address space increase
the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224362 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223347
marius [Mon, 25 Jul 2011 18:25:30 +0000 (18:25 +0000)]
MFC: r223347

As astopgap minimize the sched_lock coverage in pmap_activate() in order
to reduce lock contention.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223235
marius [Mon, 25 Jul 2011 18:23:24 +0000 (18:23 +0000)]
MFC: r223235

- As with stray vector interrupts limit the reporting of stray level
  interrupts. Bringup on additional machine models repeatedly reveals
  firmware that enables interrupts behind our back, causing the console
  to be flooded otherwise.
- As with the regular interrupt counters using uint16_t instead of
  u_long for counting the stray vector interrupts should be more than
  sufficient.
- Cache the interrupt vector in intr_stray_vector().

git-svn-id: svn://svn.freebsd.org/base/stable/8@224358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223126 (partial)
marius [Mon, 25 Jul 2011 18:17:11 +0000 (18:17 +0000)]
MFC: r223126 (partial)

Don't include curcpu in the mask which is used as the IPI cookie as we
have to ignore it when sending the IPI anyway. Actually I can't think of
a good reason why this ever was done that way in the first place as it's
not even usefull for debugging.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222840
marius [Mon, 25 Jul 2011 17:56:06 +0000 (17:56 +0000)]
MFC: r222840

- For the case when tl1_align(_trap) is used to call rsf_fatal via
  RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just
  like tl1_data_excptn(_trap) does. This is more or less cosmetic because
  in case RSF_FATAL is called we're already heading south.
- Correct an END().
- Read the window state from the correct register for a CATR().

git-svn-id: svn://svn.freebsd.org/base/stable/8@224354 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222828 (partial)
marius [Mon, 25 Jul 2011 17:54:04 +0000 (17:54 +0000)]
MFC: r222828 (partial)

- Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C
  version does.
- Initialize global registers early in the MP startup code so PCPU can be
  used.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221960
marius [Mon, 25 Jul 2011 17:37:53 +0000 (17:37 +0000)]
MFC: r221960

Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221958
marius [Mon, 25 Jul 2011 17:32:22 +0000 (17:32 +0000)]
MFC: r221958

Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221957
marius [Mon, 25 Jul 2011 17:31:09 +0000 (17:31 +0000)]
MFC: r221957

Add support for MK48T37.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224346 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221955
marius [Mon, 25 Jul 2011 17:20:36 +0000 (17:20 +0000)]
MFC: r221955

- Add 10baseT as an alias for 10baseT/UTP.
- Add shorthand aliases for common media+option combinations as announced
  by miibus(4) so that one can actually supply the media strings found in
  the dmesg output to ifconfig(8).

Obtained from: NetBSD (in principle)

git-svn-id: svn://svn.freebsd.org/base/stable/8@224345 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221954
marius [Mon, 25 Jul 2011 17:18:46 +0000 (17:18 +0000)]
MFC: r221954

When setting media always and not just in case of switching to IFM_AUTO
clear the options of the current media, i.e. only inherit the instance,
which matches what NetBSD does. Without this it's really non-intuitive
that the following sequence:
ifconfig bge0 media 1000baseT mediaopt full-duplex
ifconfig bge0 media 100baseTX
results in 100baseTX full-duplex to be set or that:
ifconfig bge0 media autoselect mediaopt flowcontrol
ifconfig bge0 media 1000baseT mediaopt full-duplex
tries to set 1000baseT full-duplex with flowcontrol, which isn't suported
und thus fails while the following:
ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex
ifconfig re0 media autoselect
just switches to autoselection without flowcontrol.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224342 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221344
marius [Mon, 25 Jul 2011 17:14:49 +0000 (17:14 +0000)]
MFC: r221344

Correct spelling in comments.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220951
marius [Mon, 25 Jul 2011 17:12:52 +0000 (17:12 +0000)]
MFC: r220951

Correct spelling in comments.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220945
marius [Mon, 25 Jul 2011 17:01:13 +0000 (17:01 +0000)]
MFC: r220945

Correct spelling.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224336 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r210943
marius [Mon, 25 Jul 2011 16:20:00 +0000 (16:20 +0000)]
MFC: r210943

Figure which is the IO and MEM bars- do not assume that they are in
a fixed order.

PR: 149220
Obtained from: John Baldwin

git-svn-id: svn://svn.freebsd.org/base/stable/8@224329 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoFlush output buffers before closing TCP session. Fixes the case where
bz [Mon, 25 Jul 2011 15:14:03 +0000 (15:14 +0000)]
Flush output buffers before closing TCP session.  Fixes the case where
the proxy would eat the 221 response coming from the server towards the
client.

This is a commit as HEAD got the change with the entire pf45 import.

PR: bin/154469
Obtained from: OpenBSD r1.18
MFC after: 2 weeks

git-svn-id: svn://svn.freebsd.org/base/stable/8@224326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220944, r220950
marius [Mon, 25 Jul 2011 15:10:52 +0000 (15:10 +0000)]
MFC: r220944, r220950

- Correct spelling. [1]
- Remove variables which are unused besides initialization. [2]

Submitted by: brucec, N.J. Mann [1], Christoph Mallon [2]

git-svn-id: svn://svn.freebsd.org/base/stable/8@224324 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220943
marius [Mon, 25 Jul 2011 15:05:37 +0000 (15:05 +0000)]
MFC: r220943

Correct spelling in a comment.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224323 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220941
marius [Mon, 25 Jul 2011 15:01:37 +0000 (15:01 +0000)]
MFC: r220941

Correct spelling in comments.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220940
marius [Mon, 25 Jul 2011 14:46:24 +0000 (14:46 +0000)]
MFC: r220940

Correct spelling in comments.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220939
marius [Mon, 25 Jul 2011 14:45:17 +0000 (14:45 +0000)]
MFC: r220939

Correct spelling in comments.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220938
marius [Mon, 25 Jul 2011 14:43:51 +0000 (14:43 +0000)]
MFC: r220938

Correct spelling in comments.

Submitted by: brucec

git-svn-id: svn://svn.freebsd.org/base/stable/8@224314 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r221750
marius [Mon, 25 Jul 2011 14:42:34 +0000 (14:42 +0000)]
MFC: r221750

Add an ATOMIC_CLEAR_LONG.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224313 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r220931
marius [Mon, 25 Jul 2011 14:39:22 +0000 (14:39 +0000)]
MFC: r220931

- Use the streaming cache unless BUS_DMA_COHERENT is specified. Since
  r220375 (MFC'ed to stable/8 in r221191) all drivers enabled in the
  sparc64 GENERIC should be either correctly using bus_dmamap_sync(9)
  calls or supply BUS_DMA_COHERENT when appropriate or as a workaround
  for missing bus_dmamap_sync(9) calls (sound(4) drivers and partially
  sym(4)). In at least some configurations taking advantage of the
  streaming cache results in a modest performance improvement.
- Remove the memory barrier for BUS_DMASYNC_PREREAD which as the
  comment already suggested is bogus.
- Add my copyright for having implemented several things like support
  for the Fire and Oberon IOMMUs, taking over PROM IOMMU mappings etc.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224312 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r216016
marius [Mon, 25 Jul 2011 14:30:44 +0000 (14:30 +0000)]
MFC: r216016

Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with
DEBUG_MEMGUARD panics early in kmeminit() with the message
"kmem_suballoc: bad status return of 1" because of zero "size" argument
passed to kmem_suballoc() due to "vm_kmem_size_max" being zero.

The problem also exists on ia64.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224309 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223935:
mm [Mon, 25 Jul 2011 13:50:54 +0000 (13:50 +0000)]
MFC r223935:
Update xz to git snapshot of v5.0 branch as of 20110711 (post-5.0.3)

For architectures with __NO_STRICT_ALIGNMENT
define TUKLIB_FAST_UNALIGNED_ACCESS

git-svn-id: svn://svn.freebsd.org/base/stable/8@224308 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: Add new modifier - "R", path to executable to run after
sobomax [Mon, 25 Jul 2011 07:45:22 +0000 (07:45 +0000)]
MFC: Add new modifier - "R", path to executable to run after
rotatiion instead of sending signal.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224306 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: re-work dump progress indicator to work better with more than few gigs
sobomax [Mon, 25 Jul 2011 01:42:51 +0000 (01:42 +0000)]
MFC: re-work dump progress indicator to work better with more than few gigs
of RAM.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: Strip any leading slashes before feeding the label to the geom_label
sobomax [Mon, 25 Jul 2011 00:17:20 +0000 (00:17 +0000)]
MFC: Strip any leading slashes before feeding the label to the geom_label
  code. Some linux distros put mount point into the ext2fs labels, such as
  '/', or '/boot', which confuses the devfs code and can cause userland
  programs to fail reading /dev/ext2fs directory with weird error code.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r197728:
dougb [Sun, 24 Jul 2011 23:43:40 +0000 (23:43 +0000)]
MFC r197728:

Add OpenVPN IANA assigned port number.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r207735: Update xrefs from 4.3BSD to modern signal functions in various
jilles [Sun, 24 Jul 2011 20:09:42 +0000 (20:09 +0000)]
MFC r207735: Update xrefs from 4.3BSD to modern signal functions in various
man pages.

sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and
sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2).

Some legacy man pages still refer to them, that is OK.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r216696 and r216737:
ed [Sun, 24 Jul 2011 19:19:50 +0000 (19:19 +0000)]
MFC r216696 and r216737:

  Slightly improve output of lock(1).

  - Remove the /dev/ portion of the TTY name.
  - In case we use lock -p, print the username that was used to obtain the
    password hash.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223744:
ed [Sun, 24 Jul 2011 19:13:54 +0000 (19:13 +0000)]
MFC r223744:

  Improve portability of config(8).

  - Use strlen(dp->d_name) instead of the unportable dp->d_namlen. Rename
    i to len to make it slightly more descriptive and prevent negative
    indexing of the array.
  - Replace index() by strchr().

  This supposedly fixes compilation on GNU systems.

Submitted by: Robert Millan <rmh debian org> (original patch)

git-svn-id: svn://svn.freebsd.org/base/stable/8@224295 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: 220736, 220806, 220808
sobomax [Sun, 24 Jul 2011 18:03:02 +0000 (18:03 +0000)]
MFC: 220736, 220806, 220808

  If we can retrieve interface address sleep for one second and try again.
  This can happen during start-up, when natd starts before dhclient has a
  chance to receive IP address from the upstream provider. Do this only in
  background, dynamic mode.

Reminded by: brian

git-svn-id: svn://svn.freebsd.org/base/stable/8@224292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221013: printf(1): Mention effect of '#' modifier on other conversions.
jilles [Sun, 24 Jul 2011 17:52:35 +0000 (17:52 +0000)]
MFC r221013: printf(1): Mention effect of '#' modifier on other conversions.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r212374,r221026: printf(1): Document need for "--" before format strings
jilles [Sun, 24 Jul 2011 17:24:26 +0000 (17:24 +0000)]
MFC r212374,r221026: printf(1): Document need for "--" before format strings
starting with "-".

Also move the remark that hexadecimal escapes are not provided to the new
CAVEATS section.

PR: 158846

git-svn-id: svn://svn.freebsd.org/base/stable/8@224289 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoFix svn:mergeinfo for merge of r216057
sanpei [Sun, 24 Jul 2011 11:56:39 +0000 (11:56 +0000)]
Fix svn:mergeinfo for merge of r216057

Approved by:    imp(menter)

git-svn-id: svn://svn.freebsd.org/base/stable/8@224288 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224239:
hselasky [Sun, 24 Jul 2011 09:43:44 +0000 (09:43 +0000)]
MFC r224239:
Add new USB ID to u3g driver.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r218397: Add "iface name" and "iface description" commands.
brian [Sun, 24 Jul 2011 01:36:01 +0000 (01:36 +0000)]
MFC r218397: Add "iface name" and "iface description" commands.

PR: 151400
Submitted by: Aragon Gouveia - aragon at phat dot za dot net

git-svn-id: svn://svn.freebsd.org/base/stable/8@224285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r218627
deischen [Sat, 23 Jul 2011 12:55:01 +0000 (12:55 +0000)]
MFC r218627

Allow SO_SETFIB to select/set the default routing table.

Requested by: Andrew Boyer aboyer at averesystems dot com.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224281 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224095:
hselasky [Sat, 23 Jul 2011 08:55:05 +0000 (08:55 +0000)]
MFC r224095:
Fix for VirtualBox 4.x and other virtual machines that fail
to generate a port reset change event.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224280 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224125:
dougb [Fri, 22 Jul 2011 21:45:12 +0000 (21:45 +0000)]
MFC r224125:

Commemorate the release of RFC 6303 by updating the comments regarding
our default empty zones.  No functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224278 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224124:
dougb [Fri, 22 Jul 2011 21:43:16 +0000 (21:43 +0000)]
MFC r224124:

Pick up the 2011-06-08 update to this file, the addition of an IPv6
address for D.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224276 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224122:
dougb [Fri, 22 Jul 2011 21:40:55 +0000 (21:40 +0000)]
MFC r224122:

Fix the location of the default pid file in named.8

git-svn-id: svn://svn.freebsd.org/base/stable/8@224274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 216823, 223991, 223992:
gjb [Fri, 22 Jul 2011 00:57:37 +0000 (00:57 +0000)]
MFC 216823, 223991, 223992:

216823 (by pjd):
- For compatibility with Linux and Solaris add poweroff(8).
  It is implemented as a hard link to shutdown(8) and it is equivalent
  of:

        # shutdown -p now

  While I'm here put one line of usage into one line of C code so it
  is easier to grep(1) and separate unrelated code with empty line.

223991:
- Improvements to the shutdown(8) manual.

223992:
- Remove trailing whitespace in the shutdown(8) manual.

Approved by: delphij

git-svn-id: svn://svn.freebsd.org/base/stable/8@224259 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224180:
hselasky [Thu, 21 Jul 2011 07:08:39 +0000 (07:08 +0000)]
MFC r224180:
Only the USB root HUB thread is allowed to attach and detach drivers
to and from USB devices. Remove related DEVMETHOD() lines from USB
drivers.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224024:
hselasky [Thu, 21 Jul 2011 07:04:51 +0000 (07:04 +0000)]
MFC r224024:
Restore USB MIDI transmit buffer size to 1Kbyte.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224240 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224196:
delphij [Thu, 21 Jul 2011 00:37:32 +0000 (00:37 +0000)]
MFC r224196:

Disable gvmat64.S, the assembler version of longest_match for now.

PR: kern/154073

git-svn-id: svn://svn.freebsd.org/base/stable/8@224238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223958:
gallatin [Wed, 20 Jul 2011 21:17:55 +0000 (21:17 +0000)]
MFC r223958:
  Update mxge(4) firmware to the latest version available from
  Myricom (1.4.53a).

git-svn-id: svn://svn.freebsd.org/base/stable/8@224235 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223957: Fix media reporting for dual port CX4 myri10ge NICs
gallatin [Wed, 20 Jul 2011 20:24:30 +0000 (20:24 +0000)]
MFC r223957: Fix media reporting for dual port CX4 myri10ge NICs

git-svn-id: svn://svn.freebsd.org/base/stable/8@224233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223989:
hselasky [Wed, 20 Jul 2011 04:57:40 +0000 (04:57 +0000)]
MFC r223989:
Fix for dump after shutdown with USB keyboard plugged in.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224107:
zec [Tue, 19 Jul 2011 11:04:58 +0000 (11:04 +0000)]
MFC r224107:
  Clear pending ifnet events, in an attempt at preventing
  ng_ether_link_state() from being dispatched after we have
  cleared our IFP2NG(ifp).

git-svn-id: svn://svn.freebsd.org/base/stable/8@224215 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoBump __FreeBSD_version for RFTSIGZMB flag for rfork(2).
kib [Tue, 19 Jul 2011 10:53:47 +0000 (10:53 +0000)]
Bump __FreeBSD_version for RFTSIGZMB flag for rfork(2).

git-svn-id: svn://svn.freebsd.org/base/stable/8@224214 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r224085:
hselasky [Tue, 19 Jul 2011 10:48:39 +0000 (10:48 +0000)]
MFC r224085:
- Add missing APIs.
- Add some rangechecks.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224213 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223967:
kib [Tue, 19 Jul 2011 10:45:31 +0000 (10:45 +0000)]
MFC r223967:
Document RFTSIGZMB.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224212 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223966:
kib [Tue, 19 Jul 2011 10:41:26 +0000 (10:41 +0000)]
MFC r223966:
Implement an RFTSIGZMB flag to rfork(2) to specify a signal that is
delivered to parent when the child exists.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224211 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223774
rmacklem [Mon, 18 Jul 2011 21:04:35 +0000 (21:04 +0000)]
MFC: r223774
The algorithm used by nfscl_getopen() could have resulted in
multiple instances of the same lock_owner when a process both
inherited an open file descriptor plus opened the same file itself.
Since some NFSv4 servers cannot handle multiple instances of
the same lock_owner string, this patch changes the algorithm
used by nfscl_getopen() in the new NFSv4 client to keep that
from happening. The new algorithm is simpler, since there is
no longer any need to ascend the process's parentage tree because
all NFSv4 Closes for a file are done at VOP_INACTIVE()/VOP_RECLAIM(),
making the Opens indistinct w.r.t. use with Lock Ops.
This problem was discovered at the recent NFSv4 interoperability
Bakeathon.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224203 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223952:
jhb [Mon, 18 Jul 2011 18:29:39 +0000 (18:29 +0000)]
MFC 223952:
Properly align the end of a candidate back region based on the window's
granularity when growing a PCI-PCI window up.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223874: Add device ID for the Davicom 56PDV PCI Modem.
jhb [Mon, 18 Jul 2011 18:25:25 +0000 (18:25 +0000)]
MFC 223874: Add device ID for the Davicom 56PDV PCI Modem.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224192 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223875, r223876:
mdf [Mon, 18 Jul 2011 18:06:39 +0000 (18:06 +0000)]
MFC r223875, r223876:

style(9) and cleanup fixes.

Add an option to have a fail point term only execute when run by a
specified pid.  This is helpful for automated testing involving a global
knob that would otherwise be executed by many other threads.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223755:
hselasky [Mon, 18 Jul 2011 08:38:08 +0000 (08:38 +0000)]
MFC r223755:
 - Make the USB keyboard driver more HID compliant.
 - Try to auto-detect keyboards which should use the BOOT protocol.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224178 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223035: Using statfs.f_fstypename rather than statfs.f_type whilst
avatar [Mon, 18 Jul 2011 04:54:12 +0000 (04:54 +0000)]
MFC r223035: Using statfs.f_fstypename rather than statfs.f_type whilst
performing fstype comparsion as nullfs will copy f_type from underlayer FS.

PR: bin/156258
Submitted by: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/8@224173 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223747
rmacklem [Sun, 17 Jul 2011 20:49:38 +0000 (20:49 +0000)]
MFC: r223747
Modify the new NFSv4 client so that it appends a file handle
to the lock_owner4 string that goes on the wire. Also, add
code to do a ReleaseLockOwner Op on the lock_owner4 string
before a Close. Apparently not all NFSv4 servers handle multiple
instances of the same lock_owner4 string, at least not in a
compatible way. This patch avoids having multiple instances,
except for one unusual case, which will be fixed by a future commit.
Found at the recent NFSv4 interoperability Bakeathon.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224149 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoFix svn:mergeinfo for merge of r216057.
hrs [Sun, 17 Jul 2011 20:02:29 +0000 (20:02 +0000)]
Fix svn:mergeinfo for merge of r216057.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223914:
kib [Sun, 17 Jul 2011 10:13:33 +0000 (10:13 +0000)]
MFC r223914:
Extract the code to translate VM error into errno, into an exported
function vm_mmap_to_errno().

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/8@224127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223886:
kib [Sat, 16 Jul 2011 20:03:23 +0000 (20:03 +0000)]
MFC r223886:
Implement a helper functions to locally set thread-private flag, and
restore it to the previous state. Note that only setting a flag locally
is supported.

MFC r223887:
Use helper functions instead of manually managing TDP_INBDFLUSH.

MFC r223888:
Use 'curthread_pflags' instead of 'thread_pflags' to signify that only
curthread can be operated upon.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/8@224113 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223885:
kib [Sat, 16 Jul 2011 19:38:08 +0000 (19:38 +0000)]
MFC r223885:
Implement pci_find_class(9), the function to find a pci device by its class.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/8@224111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223884:
kib [Sat, 16 Jul 2011 19:28:43 +0000 (19:28 +0000)]
MFC r223884:
Implement bitcount16.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/8@224109 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC of 197332:
mjacob [Fri, 15 Jul 2011 21:30:50 +0000 (21:30 +0000)]
MFC of 197332:

Remember to unlock the peripheral prior to notifying the user. Make some
allocations M_NOWAIT so that we don't try and sleep with a nested non-sleepable
lock.

This makes the userland scsi_target begin to function again.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223115:
delphij [Fri, 15 Jul 2011 18:10:59 +0000 (18:10 +0000)]
MFC r223115:

Don't attempt to create the base directory when -d is specified.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224065 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223870,223937:
jhb [Thu, 14 Jul 2011 19:25:30 +0000 (19:25 +0000)]
MFC 223870,223937:
- Note that -a, -C, -H, -j, and -z are also toggles.
- Add a leading space to the status messages output after toggling the
  'C' and 'H' flags at runtime.  This matches messages output for other
  toggles which leave the first column in the message blank to hold the
  cursor.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223841:
jhb [Thu, 14 Jul 2011 19:09:48 +0000 (19:09 +0000)]
MFC 223841:
Always skip the kernel idle process if requested, it is not specific to
the 'CPU' mode.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224035 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223510:
jhb [Thu, 14 Jul 2011 19:05:48 +0000 (19:05 +0000)]
MFC 223510:
Don't die if either of INET or INET6 aren't in the running kernel.
Instead, report "protocol not supported" errors at runtime if a user
attempts to use a protocol that the kernel doesn't support.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223477,223597,223611:
jhb [Thu, 14 Jul 2011 18:58:18 +0000 (18:58 +0000)]
MFC 223477,223597,223611:
- The recent change to increase the zfsboot size to 64k made a few BIOSes
  unhappy (probably they don't handle crossing the 64k boundary, etc.).
  Fix this by changing zfsldr to use a loop reading from the disk one
  sector at a time.  To avoid trashing the saved copy of the MBR which is
  used for disk I/O, read zfsboot2 at address 0x9000.  This has the
  advantage that BTX no longer needs to be relocated as it is read into
  the correct location.  However, the loop to relocate zfsboot2.bin can
  now cross a 64k boundary, so change it to use relative segments instead.
  (This will need further work if zfsboot2.bin ever exceeds 64k.)

  While here, stop storing a relocated copy of zfsldr at 0x700.  This was
  only used by the xread hack which has recently been removed (and even
  that use was dubious).  Also, include the BIOS error code as hex when
  reporting read errors to aid in debugging.

- Remove the fake BPB from zfsldr.  zfsldr doesn't support booting from
  floppies, so it will not be used as the start of an emulated floppy
  image on a bootable CD which is what the fake BPB was used for.
- Only check that EDD packet mode is available once at the start of
  zfsldr rather than for each disk sector now that we read data in one
  sector at a time.  As a result, collapse the remaining bits of read
  up into nread and rename nread to read.

git-svn-id: svn://svn.freebsd.org/base/stable/8@224033 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 223091:
jhb [Thu, 14 Jul 2011 18:49:23 +0000 (18:49 +0000)]
MFC 223091:
Add location and pnpinfo strings for puc device ports.  The location is
announced during boot and contains the port number.  The pnpinfo string
lists the port type (PUC_TYPE_* constants).

git-svn-id: svn://svn.freebsd.org/base/stable/8@224032 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoBackport SSSE3 instruction set support to base binutils
mm [Thu, 14 Jul 2011 14:23:48 +0000 (14:23 +0000)]
Backport SSSE3 instruction set support to base binutils
and update VIA PadLock instruction set support.

This has turned out to be necessary for some cases to catch up
with gcc update in r221274 (MFC of r219639).

This is direct commit to stable/8

Obtained from: GNU binutils CVS (GPLv2)

git-svn-id: svn://svn.freebsd.org/base/stable/8@224017 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223840:
ae [Thu, 14 Jul 2011 04:21:27 +0000 (04:21 +0000)]
MFC r223840:
  Add again the checking for log_arp_permanent_modify that was by accident
  removed in the r186119.

  PR: kern/154831

git-svn-id: svn://svn.freebsd.org/base/stable/8@223995 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223913:
kib [Wed, 13 Jul 2011 12:53:52 +0000 (12:53 +0000)]
MFC r223913:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223979 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223911:
kib [Wed, 13 Jul 2011 12:50:23 +0000 (12:50 +0000)]
MFC r223911:
Update locking annotations for the struct vnode.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223978 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222216:
jh [Wed, 13 Jul 2011 06:20:00 +0000 (06:20 +0000)]
MFC r222216:

In init_dynamic_kenv(), ignore environment strings exceeding the
KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer
overflow in getenv(). Currenly loader(8) doesn't limit the length of
environment strings.

PR: kern/132104

git-svn-id: svn://svn.freebsd.org/base/stable/8@223977 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223654, r223655, r223780, 223974:
trociny [Wed, 13 Jul 2011 05:42:04 +0000 (05:42 +0000)]
MFC r223654, r223655, r223780, 223974:

r223654:

Make activemap_write_start/complete check the keepdirty list, when
stating if we need to update activemap on disk. This makes keepdirty
serve its purpose -- to reduce number of metadata updates.

Discussed with: pjd

r223655, 223974:

Check the returned value of activemap_write_complete() and update matadata on
disk if needed. This should fix a potential case when extents are cleared in
activemap but metadata is not updated on disk.

Suggested by: pjd

r223780:

Remove useless initialization.

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@223975 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r223661:
ae [Wed, 13 Jul 2011 04:27:47 +0000 (04:27 +0000)]
MFC r223661:
  Improve error reporting. Use corresponding error message when file to be
  preprocessed is missing. Also suggest to use absolute pathname if -p
  option is specified.

  PR:             bin/156653

git-svn-id: svn://svn.freebsd.org/base/stable/8@223972 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r223940: If one's message is longer than the buffer size, then we reset
obrien [Tue, 12 Jul 2011 23:39:56 +0000 (23:39 +0000)]
MFC: r223940: If one's message is longer than the buffer size, then we reset
'cnt' at the wrong point and the actual column # get out of sync across the
buffer size.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223969 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f