]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoIn kdump's mkioctls script, use '${CPP}' instead of hardcodedly using
dim [Mon, 9 Apr 2012 14:47:18 +0000 (14:47 +0000)]
In kdump's mkioctls script, use '${CPP}' instead of hardcodedly using
'gcc -E'.  This fixes building when WITH_CLANG_IS_CC is in effect.

Report by: Niclas Zeising <zeising@daemonic.se>
MFC after: 1 week

12 years agosem_open: Make sure to fail an O_CREAT|O_EXCL open, even if that semaphore
jilles [Mon, 9 Apr 2012 14:17:22 +0000 (14:17 +0000)]
sem_open: Make sure to fail an O_CREAT|O_EXCL open, even if that semaphore
is already open in this process.

If the named semaphore is already open, sem_open() only increments a
reference count and did not take the flags into account (which otherwise
happens by passing them to open()). Add an extra check for O_CREAT|O_EXCL.

PR: kern/166706
Reviewed by: davidxu
MFC after: 10 days

12 years agoFix a couple of style issues. Tweak grammar and markup while here.
bjk [Mon, 9 Apr 2012 01:20:50 +0000 (01:20 +0000)]
Fix a couple of style issues. Tweak grammar and markup while here.

Approved by: hrs (mentor)

12 years agointpm: return only SMB bus error codes from SMB methods
avg [Sun, 8 Apr 2012 20:48:39 +0000 (20:48 +0000)]
intpm: return only SMB bus error codes from SMB methods

PR: kern/25733
MFC after: 5 days

12 years agointpm: reflect the fact that SB800 and later AMD chipsets are not supported
avg [Sun, 8 Apr 2012 19:58:38 +0000 (19:58 +0000)]
intpm: reflect the fact that SB800 and later AMD chipsets are not supported

They do not have compatible configuration registers in PCI configuration
space.  Instead their configuration resides in AMD "PM I/O" space
(accessed via a pair of I/O space registers).

MFC after: 5 days

12 years agoFix mincore(2) so that it reports PG_CACHED pages as resident.
alc [Sun, 8 Apr 2012 18:25:12 +0000 (18:25 +0000)]
Fix mincore(2) so that it reports PG_CACHED pages as resident.

MFC after: 2 weeks

12 years agoIf a page belonging a reservation is cached, then mark the reservation so
alc [Sun, 8 Apr 2012 17:00:46 +0000 (17:00 +0000)]
If a page belonging a reservation is cached, then mark the reservation so
that it will be freed to the cache pool rather than the default pool.
Otherwise, the cached pages within the reservation may be recycled sooner
than necessary.

Reported by: Andrey Zonov

12 years agoFix panic in ffs_reload(), which may happen when read-only filesystem
trasz [Sun, 8 Apr 2012 13:44:55 +0000 (13:44 +0000)]
Fix panic in ffs_reload(), which may happen when read-only filesystem
gets resized and then reloaded.

Reviewed by: kib, mckusick (earlier version)
Sponsored by: The FreeBSD Foundation

12 years agoMerge a local fix to OpenBSM's libauditd to avoid a directory descriptor
rwatson [Sun, 8 Apr 2012 11:05:22 +0000 (11:05 +0000)]
Merge a local fix to OpenBSM's libauditd to avoid a directory descriptor
leak when iterating over possible audit trail directories.  This fix will
be merged upstream in an identical form, but hasn't yet appeared in an
OpenBSM release.

Submitted by: guido
Obtained from: TrustedBSD Project
MFC after: 3 days

12 years agoWhen allocation of labels on files is implicitly disabled due to MAC
rwatson [Sun, 8 Apr 2012 11:01:49 +0000 (11:01 +0000)]
When allocation of labels on files is implicitly disabled due to MAC
policy configuration, avoid leaking resources following failed calls
to get and set MAC labels by file descriptor.

Reported by: Mateusz Guzik <mjguzik at gmail.com> + clang scan-build
MFC after: 3 days

12 years ago- Update FreeBSD's Heimdal distribution to 1.5.2. This is a bugfix
stas [Sun, 8 Apr 2012 08:19:17 +0000 (08:19 +0000)]
- Update FreeBSD's Heimdal distribution to 1.5.2.  This is a bugfix
  release, which fixes a DoS issue in libkrb5.

12 years agoExpand locking around identification of filesystem mount point when
mckusick [Sun, 8 Apr 2012 06:20:21 +0000 (06:20 +0000)]
Expand locking around identification of filesystem mount point when
accounting for I/O counts at completion of I/O operation. Also switch
from using global devmtx to vnode mutex to reduce contention.

Suggested and reviewed by: kib

12 years agoAdd I/O accounting to msdos filesystem.
mckusick [Sun, 8 Apr 2012 06:18:18 +0000 (06:18 +0000)]
Add I/O accounting to msdos filesystem.

Suggested and reviewed by: kib

12 years agoDrop an unnecessary setting of si_mountpt when updating a UFS mount point.
mckusick [Sun, 8 Apr 2012 06:14:49 +0000 (06:14 +0000)]
Drop an unnecessary setting of si_mountpt when updating a UFS mount point.
Clearly it must have been set when the mount was done.

Reviewed by: kib

12 years agoTeach wlanstats about the new BAR TX statistics.
adrian [Sun, 8 Apr 2012 04:51:43 +0000 (04:51 +0000)]
Teach wlanstats about the new BAR TX statistics.

12 years agoAdd some statistics to track BAR TX.
adrian [Sun, 8 Apr 2012 04:51:25 +0000 (04:51 +0000)]
Add some statistics to track BAR TX.

12 years agoAdd AR_ISR_S5 and AR_ISR_S5_S.
adrian [Sun, 8 Apr 2012 04:42:53 +0000 (04:42 +0000)]
Add AR_ISR_S5 and AR_ISR_S5_S.

12 years agoUnlike other functions __aeabi_read_tp function must preserve r1-r3. The
andrew [Sun, 8 Apr 2012 04:36:27 +0000 (04:36 +0000)]
Unlike other functions __aeabi_read_tp function must preserve r1-r3. The
currently generated code clobbers r3. Fix this by loading ARM_TP_ADDRESS
using inline assembly.

Approved by: imp (mentor)

12 years ago- Add a "real" symbol version map to libasn1. The upstream version
stas [Sun, 8 Apr 2012 04:22:09 +0000 (04:22 +0000)]
- Add a "real" symbol version map to libasn1.  The upstream version
  of the version map just exported all the symbols, which caused a
  binutils bug being triggered when ld fails to link two objects, one
  of which exports a versioned version of the symbol, and another --
  unversioned. [1]
- Also add version map for libkafs5.

Submitted by: jchandra@ (based on)

12 years ago- Use __NO_TLS preprocessor value to make assumptions about TLS support
stas [Sun, 8 Apr 2012 03:55:25 +0000 (03:55 +0000)]
- Use __NO_TLS preprocessor value to make assumptions about TLS support
  on a platform.

12 years agoAfter reviewing the mcast/sleep station code a little, undo some brain
adrian [Sun, 8 Apr 2012 00:40:16 +0000 (00:40 +0000)]
After reviewing the mcast/sleep station code a little, undo some brain
damage which I committed when I had less clue about such things.

Don't ever put normal data frames on the mcast software queue.
Just put mcast frames there if needed.

Pass the txq decision into ath_tx_normal_setup(), as we've already made
the decision.  Don't re-do it.

Whilst i'm here, add another random debugging statement.

12 years ago- Revert part of r234005, which I did not intend to commit.
stas [Sat, 7 Apr 2012 23:51:16 +0000 (23:51 +0000)]
- Revert part of r234005, which I did not intend to commit.
  Sorry! :(

12 years ago- Add kernel config file for QEMU-emulated gumstix board.
stas [Sat, 7 Apr 2012 23:48:51 +0000 (23:48 +0000)]
- Add kernel config file for QEMU-emulated gumstix board.

12 years ago- Add new ARM kernel option QEMU_WORKAROUNDS which can be
stas [Sat, 7 Apr 2012 23:47:08 +0000 (23:47 +0000)]
- Add new ARM kernel option QEMU_WORKAROUNDS which can be
  used in the code which needs to implement some specific
  behaviour when being run under QEMU.
- Make PXA UART probe code to work under QEMU gumstix, which
  doesn't emulate all the ports properly.

12 years agoProperly resolve the _ctx_start function descriptor (the symbol _ctx_start
nwhitehorn [Sat, 7 Apr 2012 22:28:50 +0000 (22:28 +0000)]
Properly resolve the _ctx_start function descriptor (the symbol _ctx_start
is a descriptor, not a code address), which prevents crashes when starting
a context. This fixes QEMU on powerpc64.

MFC after: 3 days

12 years agotmpfs supports only INT_MAX nodes due to limitations of unit number
gleb [Sat, 7 Apr 2012 15:30:46 +0000 (15:30 +0000)]
tmpfs supports only INT_MAX nodes due to limitations of unit number
allocator.

Replace UINT32_MAX checks with INT_MAX. Keeping more than 2^31 nodes in
memory is not likely to become possible in foreseeable feature and would
require new unit number allocator.

Discussed with: delphij
MFC after: 2 weeks

12 years agoAdd vfs_getopt_size. Support human readable file system options in tmpfs.
gleb [Sat, 7 Apr 2012 15:27:34 +0000 (15:27 +0000)]
Add vfs_getopt_size. Support human readable file system options in tmpfs.

Increase maximum tmpfs file system size to 4GB*PAGE_SIZE on 32 bit archs.

Discussed with: delphij
MFC after: 2 weeks

12 years agoAdd reserved memory limit sysctl to tmpfs.
gleb [Sat, 7 Apr 2012 15:23:51 +0000 (15:23 +0000)]
Add reserved memory limit sysctl to tmpfs.

Cleanup availble and used memory functions.
Check if free pages available before allocating new node.

Discussed with: delphij

12 years agomdoc: fix function type.
joel [Sat, 7 Apr 2012 09:26:21 +0000 (09:26 +0000)]
mdoc: fix function type.

12 years agoRemove end of line whitespace introduced in previous commit.
joel [Sat, 7 Apr 2012 09:11:07 +0000 (09:11 +0000)]
Remove end of line whitespace introduced in previous commit.

12 years agomdoc: fix column names, indentation, column separation within each row, and
joel [Sat, 7 Apr 2012 09:05:30 +0000 (09:05 +0000)]
mdoc: fix column names, indentation, column separation within each row, and
quotation. Also make sure we have the same amount of columns in each row as
the number of columns we specify in the head arguments.

Reviewed by: brueffer

12 years ago- Do not reinitialize the card if it is already running.
stas [Sat, 7 Apr 2012 06:56:38 +0000 (06:56 +0000)]
- Do not reinitialize the card if it is already running.
  This fixes bootp on if_smc, as bootp code perform SIOCSIFADDR
  ioctl call immediately after sending the request (which causes
  if_init being called) which causes the adapter to drop all the
  packets received in the meantime.

12 years agoDo a dma sync before the descriptors are chained together.
adrian [Sat, 7 Apr 2012 05:51:43 +0000 (05:51 +0000)]
Do a dma sync before the descriptors are chained together.

I need to find a better place to do this..

12 years agoBreak out the legacy duration and protection code into routines,
adrian [Sat, 7 Apr 2012 05:48:26 +0000 (05:48 +0000)]
Break out the legacy duration and protection code into routines,
call these after rate control selection is done.

The duration/protection code wasn't working - it expected the rix to
be valid.  Unfortunately after I moved the rate control selection into
late in the process, the rix value isn't valid and thus the protection/
duration code would get things wrong.

HT frames are now correctly protected with an RTS and for the AR5416,
this involves having the aggregate frames be limited to 8K.

TODO:

* Fix up the DMA sync to occur just before the frame is queued to the
  hardware.  I'm adjusting the duration here but not doing the DMA
  flush.

* Doubly/triply ensure that the aggregate frames are being limited to
  the correct size, or the AR5416 will get unhappy when TXing RTS-protected
  aggregates.

12 years agoAs I thought, this is a bad idea. When forming aggregates, the RTS/CTS
adrian [Sat, 7 Apr 2012 05:46:00 +0000 (05:46 +0000)]
As I thought, this is a bad idea. When forming aggregates, the RTS/CTS
stuff and rate control lookup is only done on the first frame.

12 years agoAdd some tests from PR 166463. Also make sure that all of the tests,
das [Sat, 7 Apr 2012 04:00:30 +0000 (04:00 +0000)]
Add some tests from PR 166463.  Also make sure that all of the tests,
old and new, check the sign bits of both the remainder and the
quotient.

12 years agoFix a bug in remquo{,f,l}, in which the quotient didn't always have the
das [Sat, 7 Apr 2012 03:59:12 +0000 (03:59 +0000)]
Fix a bug in remquo{,f,l}, in which the quotient didn't always have the
correct sign when the remainder was 0.

Fix a separate bug in remquo alone, in which the remainder and
quotient were both off by a bit in certain cases involving subnormal
remainders.

The bugs affected all platforms except amd64 and i386, on which the
routines are implemented in assembly.

PR: 166463
Submitted by: Ilya Burylov
MFC after: 2 weeks

12 years agoEnforce the RTS aggregation limit if RTS/CTS protection is enabled;
adrian [Sat, 7 Apr 2012 03:22:11 +0000 (03:22 +0000)]
Enforce the RTS aggregation limit if RTS/CTS protection is enabled;
if any subframes in an aggregate have different protection from the
first frame in the formed aggregate, don't add that frame to the
aggregate.

This is likely a suboptimal method (I think we'll mostly be OK marking
frames that have seqno's with the same protection as normal data frames)
but I'll just be cautious for now.

12 years agoStore away the RTS aggregate limit from the HAL.
adrian [Sat, 7 Apr 2012 02:51:53 +0000 (02:51 +0000)]
Store away the RTS aggregate limit from the HAL.

This will be used by some upcoming code to ensure that aggregates
are enforced to be a certain size.  The AR5416 has a limitation on
RTS protected aggregates (8KiB).

12 years agoRemove duplicate txflags field from ath_buf.
adrian [Sat, 7 Apr 2012 02:01:26 +0000 (02:01 +0000)]
Remove duplicate txflags field from ath_buf.

rename bf_state.bfs_flags to bf_state.bfs_txflags, as that is what
it effectively is.

12 years agoExecute an initial ptesync if and only if the PTE is actually being
nwhitehorn [Fri, 6 Apr 2012 22:33:13 +0000 (22:33 +0000)]
Execute an initial ptesync if and only if the PTE is actually being
invalidated, as opposed to a ref/changed bit update.

12 years agoChange the SCSI INQUIRY peripheral qualifier that CTL reports for LUNs
ken [Fri, 6 Apr 2012 22:23:13 +0000 (22:23 +0000)]
Change the SCSI INQUIRY peripheral qualifier that CTL reports for LUNs
that don't exist.

Anecdotal evidence indicates that it is better to return 011b (bad LUN)
than 001b (LUN offline).  However, this change also gives the user a
sysctl/tunable, kern.cam.ctl.inquiry_pq_no_lun, to override the change
and return to the previous behavior.  (The previous behavior was to
return 001b, or LUN offline.)

ctl.c: Change the default inquiry peripheral qualifier to 011b,
and add a sysctl and tunable to allow the user to change
it back to 001b if needed.

Don't insert a Copan copyright statement in the inquiry
data.  The copyright statements on the files are
sufficient.

ctl_private.h: Add sysctl variable context to the CTL softc.

ctl_cmd_table.c,
ctl_frontend_internal.c,
ctl_frontend.c,
ctl_backend.c,
ctl_error.c: Include sys/sysctl.h.

MFC after: 3 days

12 years agoFix interrupt load balancing regression, introduced in revision
gibbs [Fri, 6 Apr 2012 21:19:28 +0000 (21:19 +0000)]
Fix interrupt load balancing regression, introduced in revision
222813, that left all un-pinned interrupts assigned to CPU 0.

sys/x86/x86/intr_machdep.c:
In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized
the "intr_cpus" cpuset to only contain CPU0.

This initialization is too late and nullifies the results of calls
the intr_add_cpu() that occur much earlier in the boot process.
Since "intr_cpus" is statically initialized to the empty set, and
all processors, including the BSP, already add themselves to
"intr_cpus" no special initialization for the BSP is necessary.

MFC after: 3 days

12 years agoStaticize vm_page_cache_remove().
attilio [Fri, 6 Apr 2012 20:34:00 +0000 (20:34 +0000)]
Staticize vm_page_cache_remove().

Reviewed by: alc

12 years agoSubstantially reduce the scope of the locks held in pmap_enter(), which
nwhitehorn [Fri, 6 Apr 2012 18:18:48 +0000 (18:18 +0000)]
Substantially reduce the scope of the locks held in pmap_enter(), which
improves concurrency slightly.

12 years agoMicro-optimize free_pv_entry() for the expected case.
alc [Fri, 6 Apr 2012 16:41:19 +0000 (16:41 +0000)]
Micro-optimize free_pv_entry() for the expected case.

12 years agoReduce the frequency that the PowerPC/AIM pmaps invalidate instruction
nwhitehorn [Fri, 6 Apr 2012 16:03:38 +0000 (16:03 +0000)]
Reduce the frequency that the PowerPC/AIM pmaps invalidate instruction
caches, by invalidating kernel icaches only when needed and not flushing
user caches for shared pages.

Suggested by: kib
MFC after: 2 weeks

12 years agoGive the kernel pmap lock a different name than user pmap locks. It has
nwhitehorn [Fri, 6 Apr 2012 16:00:37 +0000 (16:00 +0000)]
Give the kernel pmap lock a different name than user pmap locks. It has
(slightly) different semantics and renaming it prevents a (harmless)
WITNESS warning during bootup for 32-bit kernels on 64-bit CPUs.

MFC after: 5 days

12 years agowe need to specify a NETMAP_API version or the ioctl() will fail.
luigi [Fri, 6 Apr 2012 14:26:05 +0000 (14:26 +0000)]
we need to specify a NETMAP_API version or the ioctl() will fail.

12 years agoFix build broken by r233938.
melifaro [Fri, 6 Apr 2012 13:34:19 +0000 (13:34 +0000)]
Fix build broken by r233938.

Pointed by:     David Wolfskill <david@catwhisker.org>
Approved by:    kib (mentor)
Pointy hat to:  melifaro

12 years agoProperly clear the O_NONBLOCK flag after opening the TTY.
ed [Fri, 6 Apr 2012 13:06:01 +0000 (13:06 +0000)]
Properly clear the O_NONBLOCK flag after opening the TTY.

Though we should open the TTY with O_NONBLOCK to prevent rc(8) execution
from potentially stalling, we must not forget to clear the flag later
on, to prevent read(2) calls from failing later on.

This prevented the shell pathname prompt from working properly.

Reported by: kib

12 years agoretrofit Safe Mode loader menu item actions
avg [Fri, 6 Apr 2012 09:36:22 +0000 (09:36 +0000)]
retrofit Safe Mode loader menu item actions

The menu item is now made completely independent with the ACPI item - most
modern systems seem to require ACPI and become even more "unsafe"
without it.
Safe Mode no longer disables APIC for the same reason.
kbdmux is not disabled as this feature has proven itself stable.

New actions:
- SMP is disabled in the Safe Mode now
- eventtimers are forced to periodic mode (some real and virtual systems
  seem to have problems otherwise)
- geom extra vigorous integrity checking is disabled, this is to
  facilitate migration from previous versions

Possible short term to do:
- make SMP switch a separate menu item
- restore APIC switch as a separate menu item

Longer term to do:
- turn various tweaks into separate menu items in a Safe Mode sub-menu

Please consider adding a safety tweak to Safe Mode when introducing
new major features or changes that may cause instabilities.

Discussed with: jhb, scottl, Devin Teske
MFC after: 3 weeks (stable/9 only)

12 years agoRemove duplicate condition in if statement.
tuexen [Fri, 6 Apr 2012 09:03:02 +0000 (09:03 +0000)]
Remove duplicate condition in if statement.

Obtained from: brucec@
MFC after: 3 days

12 years agoFree ballooned pages with the corresponding malloc type.
pluknet [Fri, 6 Apr 2012 08:13:29 +0000 (08:13 +0000)]
Free ballooned pages with the corresponding malloc type.

MFC after: 1 week

12 years ago- Improve performace for writer-only BPF users.
melifaro [Fri, 6 Apr 2012 06:55:21 +0000 (06:55 +0000)]
- Improve performace for writer-only BPF users.

Linux and Solaris (at least OpenSolaris) has PF_PACKET socket families to send
raw ethernet frames. The only FreeBSD interface that can be used to send raw frames
is BPF. As a result, many programs like cdpd, lldpd, various dhcp stuff uses
BPF only to send data. This leads us to the situation when software like cdpd,
being run on high-traffic-volume interface significantly reduces overall performance
since we have to acquire additional locks for every packet.

Here we add sysctl that changes BPF behavior in the following way:
If program came and opens BPF socket without explicitly specifyin read filter we
assume it to be write-only and add it to special writer-only per-interface list.
This makes bpf_peers_present() return 0, so no additional overhead is introduced.
After filter is supplied, descriptor is added to original per-interface list permitting
packets to be captured.

Unfortunately, pcap_open_live() sets catch-all filter itself for the purpose of
setting snap length.

Fortunately, most programs explicitly sets (event catch-all) filter after that.
tcpdump(1) is a good example.

So a bit hackis approach is taken: we upgrade description only after second
BIOCSETF is received.

Sysctl is named net.bpf.optimize_writers and is turned off by default.

- While here, document all sysctl variables in bpf.4

Sponsored by Yandex LLC

Reviewed by:    glebius (previous version)
Reviewed by:    silence on -net@
Approved by:    (mentor)

MFC after:      4 weeks

12 years ago- Improve BPF locking model.
melifaro [Fri, 6 Apr 2012 06:53:58 +0000 (06:53 +0000)]
- Improve BPF locking model.

Interface locks and descriptor locks are converted from mutex(9) to rwlock(9).
This greately improves performance: in most common case we need to acquire 1
reader lock instead of 2 mutexes.

- Remove filter(descriptor) (reader) lock in bpf_mtap[2]
This was suggested by glebius@. We protect filter by requesting interface
writer lock on filter change.

- Cover struct bpf_if under BPF_INTERNAL define. This permits including bpf.h
without including rwlock stuff. However, this is is temporary solution,
struct bpf_if should be made opaque for any external caller.

Found by:       Dmitrij Tejblum <tejblum@yandex-team.ru>
Sponsored by:   Yandex LLC

Reviewed by:    glebius (previous version)
Reviewed by:    silence on -net@
Approved by:    (mentor)

MFC after:      3 weeks

12 years ago- Do not use deprecated krb5 error message reporting functions in libtelnet.
stas [Fri, 6 Apr 2012 00:03:45 +0000 (00:03 +0000)]
- Do not use deprecated krb5 error message reporting functions in libtelnet.

12 years agoProperly handle absent AT_CANARY aux entry.
kib [Thu, 5 Apr 2012 18:47:54 +0000 (18:47 +0000)]
Properly handle absent AT_CANARY aux entry.

Submitted by: Andrey Zonov <andrey zonov org>
MFC after: 3 days

12 years agoAdd new ktrace records for the start and end of VM faults. This gives
jhb [Thu, 5 Apr 2012 17:13:14 +0000 (17:13 +0000)]
Add new ktrace records for the start and end of VM faults.  This gives
a pair of records similar to syscall entry and return that a user can
use to determine how long page faults take.  The new ktrace records are
enabled via the 'p' trace type, and are enabled in the default set of
trace points.

Reviewed by: kib
MFC after: 2 weeks

12 years agoFix a typo in GCC affecting calculations with -ffast-math.
pfg [Thu, 5 Apr 2012 15:16:51 +0000 (15:16 +0000)]
Fix a typo in GCC affecting calculations with -ffast-math.

The fix is similar to the one applied in GCC-4.3 in
GCCSVN-r117929 under the GPLv2.

Submitted by: Andrey Simonenko
Reviewed by: mm
Approved by: jhb (mentor)
MFC after: 3 days

12 years agozfs_ioctl: no need for ddi_copyin/out here because sys_ioctl handles that
avg [Thu, 5 Apr 2012 07:59:59 +0000 (07:59 +0000)]
zfs_ioctl: no need for ddi_copyin/out here because sys_ioctl handles that

On FreeBSD the direct ioctl argument is automatically copied in/out
as necesary by the kernel ioctl entry point.

PR: kern/164445
Submitted by: Luis Garces-Erice <lge@ieee.org>
Tested by: Attila Nagy <bra@fsn.hu>
MFC after: 5 days

12 years agoFix VIMAGE build.
ae [Thu, 5 Apr 2012 04:41:06 +0000 (04:41 +0000)]
Fix VIMAGE build.

12 years agoUpdate to version 9.8.2, the latest from ISC, which contains numerous bug fixes.
dougb [Thu, 5 Apr 2012 04:29:35 +0000 (04:29 +0000)]
Update to version 9.8.2, the latest from ISC, which contains numerous bug fixes.

12 years agoIn sem_post, the field _has_waiters is no longer used, because some
davidxu [Thu, 5 Apr 2012 03:05:02 +0000 (03:05 +0000)]
In sem_post, the field _has_waiters is no longer used, because some
application destroys semaphore after sem_wait returns. Just enter
kernel to wake up sleeping threads, only update _has_waiters if
it is safe. While here, check if the value exceed SEM_VALUE_MAX and
return EOVERFLOW if this is true.

12 years agoumtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
davidxu [Thu, 5 Apr 2012 02:24:08 +0000 (02:24 +0000)]
umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
a mutex after a thread has unlocked it, it event writes data to the mutex
memory to clear contention bit, there is a race that other threads
can lock it and unlock it, then destroy it, so it should not write
data to the mutex memory if there isn't any waiter.
The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It
requires thread library to clear the lock word entirely, then
call the WAKE2 operation to check if there is any waiter in kernel,
and try to wake up a thread, if necessary, the contention bit is set again
by the operation. This also mitgates the chance that other threads find
the contention bit and try to enter kernel to compete with each other
to wake up sleeping thread, this is unnecessary. With this change, the
mutex owner is no longer holding the mutex until it reaches a point
where kernel umtx queue is locked, it releases the mutex as soon as
possible.
Performance is improved when the mutex is contensted heavily.  On Intel
i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds
to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is
deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c

12 years agoAdd Bv9ARM.pdf to the list of docs to install.
dougb [Wed, 4 Apr 2012 23:58:41 +0000 (23:58 +0000)]
Add Bv9ARM.pdf to the list of docs to install.

12 years agoImplement BAR TX.
adrian [Wed, 4 Apr 2012 23:45:15 +0000 (23:45 +0000)]
Implement BAR TX.

A BAR frame must be transmitted when an frame in an A-MPDU session fails
to transmit - it's retried too often, or it can't be cloned for
re-transmission.  The BAR frame tells the remote side to advance the
left edge of the block-ack window (BAW) to a new value.

In order to do this:

* TX for that particular node/TID must be paused;
* The existing frames in the hardware queue needs to be completed, whether
  they're TXed successfully or otherwise;
* The new left edge of the BAW is then communicated to the remote side
  via a BAR frame;
* Once the BAR frame has been sucessfully TXed, aggregation can resume;
* If the BAR frame can't be successfully TXed, the aggregation session
  is torn down.

This is a first pass that implements the above.  What needs to be done/
tested:

* What happens during say, a channel reset / stuck beacon _and_ BAR
  TX.  It _should_ be correctly buffered and retried once the
  reset has completed.  But if a bgscan occurs (and they shouldn't,
  grr) the BAR frame will be forcibly failed and the aggregation session
  will be torn down.

  Yes, another reason to disable bgscan until I've figured this out.

* There's way too much locking going on here.  I'm going to do a couple
  of further passes of sanitising and refactoring so the (re) locking
  isn't so heavy.  Right now I'm going for correctness, not speed.

* The BAR TX can fail if the hardware TX queue is full.  Since there's
  no "free" space kept for management frames, a full TX queue (from eg
  an iperf test) can race with your ability to allocate ath_buf/mbufs
  and cause issues.  I'll knock this on the head with a subsequent
  commit.

* I need to do some _much_ more thorough testing in hostap mode to ensure
  that many concurrent traffic streams to different end nodes are correctly
  handled.  I'll find and squish whichever bugs show up here.

But, this is an important step to being able to flip on 802.11n by default.
The last issue (besides bug fixes, of course) is HT frame protection and
I'll address that in a subsequent commit.

12 years agoFix typo.
nwhitehorn [Wed, 4 Apr 2012 23:14:01 +0000 (23:14 +0000)]
Fix typo.

Submitted by: pawel dot worach at gmail dot com
MFC after: 3 days

12 years agoTrack and optionally log the actual sync interrupt cause.
adrian [Wed, 4 Apr 2012 22:51:50 +0000 (22:51 +0000)]
Track and optionally log the actual sync interrupt cause.

These are involved in tracking host interface issues (ie, PCI/PCIe/AHB
interface.)

12 years agoDisable the HWQ contents upon a TX queue reset, rather than a TX queue flush.
adrian [Wed, 4 Apr 2012 22:24:11 +0000 (22:24 +0000)]
Disable the HWQ contents upon a TX queue reset, rather than a TX queue flush.

This is designed to assist in figuring out what the hardware state is
when something like a queue hang has occured.

12 years agoNow that I've fixed the BAW TX hangs, disable this verbose debugging
adrian [Wed, 4 Apr 2012 22:22:50 +0000 (22:22 +0000)]
Now that I've fixed the BAW TX hangs, disable this verbose debugging
again.

12 years agoSave and restore VGA display memory between suspend and resume.
jkim [Wed, 4 Apr 2012 22:02:54 +0000 (22:02 +0000)]
Save and restore VGA display memory between suspend and resume.

12 years agoCorrectly handle AR_MoreAggr when assembling multi-descriptor final frames.
adrian [Wed, 4 Apr 2012 21:49:49 +0000 (21:49 +0000)]
Correctly handle AR_MoreAggr when assembling multi-descriptor final frames.

Linux ath9k doesn't have this issue as it doesn't try queuing multi-
descriptor frames to the hardware.

Before, I was only setting the first and last descriptor in the final
frame correctly - and that was done by accident. The first descriptor in
the last sub-frame was being correctly updated by ath_tx_setds_11n();
the last descriptor in the last sub-frame was being correctly updated
by ath_buf_set_rate(). But both of those are "incorrect".

The correct behaviour is:

* AR_IsAggr is set for all descriptors for all subframes in an aggregate.
* AR_MoreAggr is set for all descriptors for all non-final sub-frames
  in an aggregate.

Ie, all descriptors in the last sub-frame of an aggregate must have this
field set to 0.

I still need to do a couple of extra passes to ensure the pad delimiter
field is being correctly handled in all descriptors in the last sub-frame.

12 years agoDo not copy VESA state buffer if the VBE call has failed for any reason.
jkim [Wed, 4 Apr 2012 21:38:26 +0000 (21:38 +0000)]
Do not copy VESA state buffer if the VBE call has failed for any reason.
Do not unnecessarily clear the state buffer before calling the function.

12 years agoDisable INET6 support in modules when building the LINT-NOINET6 kernel.
jhb [Wed, 4 Apr 2012 21:31:20 +0000 (21:31 +0000)]
Disable INET6 support in modules when building the LINT-NOINET6 kernel.

Reviewed by: bz
MFC after: 1 week

12 years agoRemove a useless warning. The mode information is unused for very long time
jkim [Wed, 4 Apr 2012 21:19:55 +0000 (21:19 +0000)]
Remove a useless warning.  The mode information is unused for very long time
and this function may be used with VESA mode since r232069.

12 years ago- Const'ify the device lookup-table.
marius [Wed, 4 Apr 2012 21:09:02 +0000 (21:09 +0000)]
- Const'ify the device lookup-table.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Enable support for flow control.
  Tested by: yongari

MFC after: 1 week

12 years agoAdd a threadid to the ah_decode API.
adrian [Wed, 4 Apr 2012 20:46:20 +0000 (20:46 +0000)]
Add a threadid to the ah_decode API.

This adds the current thread ID to each logged register and mark entry,
allowing for easier debugging of concurrent/overlapping NIC operations.

12 years agoRefine r233827; as it turns out, controllers with a device ID of 0x0059
marius [Wed, 4 Apr 2012 20:42:45 +0000 (20:42 +0000)]
Refine r233827; as it turns out, controllers with a device ID of 0x0059
can be upgraded to MegaRAID mode, in which case mfi(4) should attach to
these based on the sub-vendor and -device ID instead (not currently done).
Therefore, let mpt_pci_probe() return BUS_PROBE_LOW_PRIORITY.
While it, let mpt_pci_probe() return BUS_PROBE_DEFAULT instead of 0 in
the default case.

MFC after: 3 days

12 years agoDisable a specific Merlin hardware workaround which may cause hangs on some
adrian [Wed, 4 Apr 2012 20:42:32 +0000 (20:42 +0000)]
Disable a specific Merlin hardware workaround which may cause hangs on some
PCIe controllers.

Obtained from: Atheros / Linux

12 years ago- Do not include machine/atomic.h. It is no longer necessary since r233768.
jkim [Wed, 4 Apr 2012 16:15:40 +0000 (16:15 +0000)]
- Do not include machine/atomic.h.  It is no longer necessary since r233768.
- Remove bogus "atomic" macros and a read-only variable from softc.

Reviewed by: ambrisko

12 years agoAdd a check for unsupported file flags to ufs_setattr().
jh [Wed, 4 Apr 2012 14:50:21 +0000 (14:50 +0000)]
Add a check for unsupported file flags to ufs_setattr().

Discussed with: bde
MFC after: 2 weeks

12 years agoMerge from OpenBSD:
glebius [Wed, 4 Apr 2012 14:47:59 +0000 (14:47 +0000)]
Merge from OpenBSD:
  revision 1.173
  date: 2011/11/09 12:36:03;  author: camield;  state: Exp;  lines: +11 -12
  State expire time is a baseline time ("last active") for expiry
  calculations, and does _not_ denote the time when to expire.  So
  it should never be added to (set into the future).

  Try to reconstruct it with an educated guess on state import and
  just set it to the current time on state updates.

  This fixes a problem on pfsync listeners where the expiry time
  could be double the expected value and cause a lot more states
  to linger.

12 years agoAdd descriptions after the 'device' line for several NICs to match the
jhb [Wed, 4 Apr 2012 13:49:22 +0000 (13:49 +0000)]
Add descriptions after the 'device' line for several NICs to match the
existing style.

12 years agoFix build on i386.
jhb [Wed, 4 Apr 2012 11:55:20 +0000 (11:55 +0000)]
Fix build on i386.

12 years agoWith pf 4.5 import the name of pfsync stats sysctl has changed, thus
glebius [Wed, 4 Apr 2012 08:30:32 +0000 (08:30 +0000)]
With pf 4.5 import the name of pfsync stats sysctl has changed, thus
'netstat -sp pfsync' got broken. Fix this.

12 years ago- Remove redundant call to pr_ctloutput from code that handles SO_SETFIB.
np [Tue, 3 Apr 2012 18:38:00 +0000 (18:38 +0000)]
- Remove redundant call to pr_ctloutput from code that handles SO_SETFIB.
- Add a check for errors during copyin while here.

Reviewed by: julian, bz
MFC after: 2 weeks

12 years agoDocument syncdev, syncpeer and defer keywords for
glebius [Tue, 3 Apr 2012 18:11:30 +0000 (18:11 +0000)]
Document syncdev, syncpeer and defer keywords for
pfsync(4) interfaces.

12 years agoMake it possible to switch pfsync(4) deferral mechanism on/off.
glebius [Tue, 3 Apr 2012 18:10:48 +0000 (18:10 +0000)]
Make it possible to switch pfsync(4) deferral mechanism on/off.

Obtained from: OpenBSD

12 years agoSince pf 4.5 import pf(4) has a mechanism to defer
glebius [Tue, 3 Apr 2012 18:09:20 +0000 (18:09 +0000)]
Since pf 4.5 import pf(4) has a mechanism to defer
forwarding a packet, that creates state, until
pfsync(4) peer acks state addition (or 10 msec
timeout passes).

This is needed for active-active CARP configurations,
which are poorly supported in FreeBSD and arguably
a good idea at all.

Unfortunately by the time of import this feature in
OpenBSD was turned on, and did not have a switch to
turn it off. This leaked to FreeBSD.

This change make it possible to turn this feature
off via ioctl() and turns it off by default.

Obtained from: OpenBSD

12 years agoAdd basic HT channel setup to ieee80211_init_channels(), this will be
bschmidt [Tue, 3 Apr 2012 17:48:42 +0000 (17:48 +0000)]
Add basic HT channel setup to ieee80211_init_channels(), this will be
used by at least ral(4).

Reviewed by: ray

12 years agoFix probing of SAS1068E with a device ID of 0x0059 after r232411.
marius [Tue, 3 Apr 2012 08:28:43 +0000 (08:28 +0000)]
Fix probing of SAS1068E with a device ID of 0x0059 after r232411.
Reported by: infofarmer

MFC after: 3 days

12 years agoA file cannot be deallocated until its last name has been removed
mckusick [Mon, 2 Apr 2012 21:58:37 +0000 (21:58 +0000)]
A file cannot be deallocated until its last name has been removed
and it is no longer referenced by a user process. The inode for a
file whose name has been removed, but is still referenced at the
time of a crash will still be allocated in the filesystem, but will
have no references (e.g., they will have no names referencing them
from any directory).

With traditional soft updates these unreferenced inodes will be
found and reclaimed when the background fsck is run. When using
journaled soft updates, the kernel must keep track of these inodes
so that it can find and reclaim them during the cleanup process.
Their existence cannot be stored in the journal as the journal only
handles short-term events, and they may persist for days. So, they
are tracked by keeping them in a linked list whose head pointer is
stored in the superblock. The journal tracks them only until their
linked list pointers have been commited to disk. Part of the cleanup
process involves traversing the list of unreferenced inodes and
reclaiming them.

This bug was triggered when confusion arose in the commit steps
of keeping the unreferenced-inode linked list coherent on disk.
Notably, a race between the link() system call adding a link-count
to a file and the unlink() system call removing a link-count to
the file. Here if the unlink() ran after link() had looked up
the file but before link() had incremented the link-count of the
file, the file's link-count would drop to zero before the link()
incremented it back up to one. If the file was referenced by a
user process, the first transition through zero made it appear
that it should be added to the unreferenced-inode list when in
fact it should not have been added. If the new name created by
link() was deleted within a few seconds (with the file still
referenced by a user process) it would legitimately be a candidate
for addition to the unreferenced-inode list. The result was that
there were two attempts to add the same inode to the unreferenced-inode
list which scrambled the unreferenced-inode list's pointers leading
to a panic. The fix is to detect and avoid the false attempt at
adding it to the unreferenced-inode list by having the link()
system call check to see if the link count is zero before it
increments it. If it is, the link() fails with ENOENT (showing that
it has failed the link()/unlink() race).

While tracking down this bug, we have added additional assertions
to detect the problem sooner and also simplified some of the code.

Reported by:      Kirk Russell
Fix submitted by: Jeff Roberson
Tested by:        Peter Holm
PR:               kern/159971
MFC (to 9 only):  2 weeks

12 years agoWhen process exists, not only the children shall be reparented to
kib [Mon, 2 Apr 2012 19:35:36 +0000 (19:35 +0000)]
When process exists, not only the children shall be reparented to
init, but also the orphans shall be removed from the orphan list,
because the list header is destroyed.

Reported and tested by: pho
MFC after: 3 days

12 years agoAdd helper function to remove the process from the orphans list and
kib [Mon, 2 Apr 2012 19:34:56 +0000 (19:34 +0000)]
Add helper function to remove the process from the orphans list and
use it instead of inlined code.

Tested by: pho
MFC after: 3 days

12 years agoMove struct megasas_sge from mfi_ioctl.h to mfivar.h so we can
ambrisko [Mon, 2 Apr 2012 19:13:02 +0000 (19:13 +0000)]
Move struct megasas_sge from mfi_ioctl.h to mfivar.h so we can
remove including machine/bus.h.  Add some more mfi_ prefixes to
avoid name space pollution.

This should address the last tinderbox issues.

12 years agoFurther tweak the changes made in r233709. The kernel doesn't permit
jhb [Mon, 2 Apr 2012 17:26:21 +0000 (17:26 +0000)]
Further tweak the changes made in r233709.  The kernel doesn't permit
sleeping from a swi handler (even though in this case it would be ok), so
switch the refill and scanning SWI handlers to being tasks on a fast
taskqueue.  Also, only schedule the refill task for a CMCI as an MC# can
fire at any time, so it should do the minimal amount of work needed and
avoid opportunities to deadlock before it panics (such as scheduling a
task it won't ever need in practice).  To handle the case of an MC# only
finding recoverable errors (which should never happen), always try to
refill the event free list when the periodic scan executes.

MFC after: 2 weeks

12 years agosh: Fix build with -DDEBUG=2.
jilles [Mon, 2 Apr 2012 17:16:24 +0000 (17:16 +0000)]
sh: Fix build with -DDEBUG=2.

Reported by: Kristof Provost
MFC after: 1 week

12 years ago- Use more natural ip->i_flags instead of vap->va_flags in the final
jh [Mon, 2 Apr 2012 16:33:21 +0000 (16:33 +0000)]
- Use more natural ip->i_flags instead of vap->va_flags in the final
  flags check.
- Add a comment for the immutable/append check done after handling of
  the flags.
- Style improvements.

No functional change intended.

Submitted by: bde
MFC after: 2 weeks

12 years ago- Write the ISO9660 descriptor after the apm partition entries.
andreast [Mon, 2 Apr 2012 16:26:32 +0000 (16:26 +0000)]
- Write the ISO9660 descriptor after the apm partition entries.
- Fill the needed pmPartStatus flags. At least the OpenBIOS
  implementation relies on these flags.

This commit fixes the panic seen on OS-X when inserting a FreeBSD/ppc disc.
Additionally OpenBIOS recognizes the partition where the boot code is located.
This lets us load a FreeBSD/ppc PowerMac kernel inside qemu.

PR: powerpc/162091
MFC after: 1 week