]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoGarbage collect NWFS and NCP bits which are now completely disconnected
Attilio Rao [Sat, 9 Mar 2013 12:45:36 +0000 (12:45 +0000)]
Garbage collect NWFS and NCP bits which are now completely disconnected
from the tree since few months.

This patch is not targeted for MFC.

11 years agoCorrect the lock class for the vm object lock.
Konstantin Belousov [Sat, 9 Mar 2013 10:16:08 +0000 (10:16 +0000)]
Correct the lock class for the vm object lock.

Reported and tested by: joel

11 years agoRework overflow checks of r247898 to not let too "intelligent" compiler to
Alexander Motin [Sat, 9 Mar 2013 09:07:13 +0000 (09:07 +0000)]
Rework overflow checks of r247898 to not let too "intelligent" compiler to
optimize it out.

Submitted by: bde

11 years agoDisable the hw TID != buffer TID check.
Adrian Chadd [Sat, 9 Mar 2013 08:50:17 +0000 (08:50 +0000)]
Disable the hw TID != buffer TID check.

I can 100% reliably trigger this on TID 1 traffic by using iperf -S 32
<client fields> to create traffic that maps to TID 1.

The reference driver doesn't do this check.

11 years agoPrint out the queue flags during a TX DMA shutdown.
Adrian Chadd [Sat, 9 Mar 2013 06:11:58 +0000 (06:11 +0000)]
Print out the queue flags during a TX DMA shutdown.

11 years agoFix non-invariant compilation.
Adrian Chadd [Sat, 9 Mar 2013 05:20:33 +0000 (05:20 +0000)]
Fix non-invariant compilation.

11 years agoSwitch the vm_object mutex to be a rwlock. This will enable in the
Attilio Rao [Sat, 9 Mar 2013 02:32:23 +0000 (02:32 +0000)]
Switch the vm_object mutex to be a rwlock.  This will enable in the
future further optimizations where the vm_object lock will be held
in read mode most of the time the page cache resident pool of pages
are accessed for reading purposes.

The change is mostly mechanical but few notes are reported:
* The KPI changes as follow:
  - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK()
  - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK()
  - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK()
  - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED()
    (in order to avoid visibility of implementation details)
  - The read-mode operations are added:
    VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(),
    VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED()
* The vm/vm_pager.h namespace pollution avoidance (forcing requiring
  sys/mutex.h in consumers directly to cater its inlining functions
  using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h
  consumers now must include also sys/rwlock.h.
* zfs requires a quite convoluted fix to include FreeBSD rwlocks into
  the compat layer because the name clash between FreeBSD and solaris
  versions must be avoided.
  At this purpose zfs redefines the vm_object locking functions
  directly, isolating the FreeBSD components in specific compat stubs.

The KPI results heavilly broken by this commit.  Thirdy part ports must
be updated accordingly (I can think off-hand of VirtualBox, for example).

Sponsored by: EMC / Isilon storage division
Reviewed by: jeff
Reviewed by: pjd (ZFS specific review)
Discussed with: alc
Tested by: pho

11 years agoMerge from vmc-playground:
Attilio Rao [Sat, 9 Mar 2013 02:05:29 +0000 (02:05 +0000)]
Merge from vmc-playground:
Introduce a new KPI that verifies if the page cache is empty for a
specified vm_object.  This KPI does not make assumptions about the
locking in order to be used also for building assertions at init and
destroy time.
It is mostly used to hide implementation details of the page cache.

Sponsored by: EMC / Isilon storage division
Reviewed by: jeff
Reviewed by: alc (vm_radix based version)
Tested by: flo, pho, jhb, davide

11 years agoPlaceholder for the upcoming AR9300 HAL code.
Adrian Chadd [Sat, 9 Mar 2013 01:05:36 +0000 (01:05 +0000)]
Placeholder for the upcoming AR9300 HAL code.

11 years agoFix long-standing issue with interface routes being unprotected:
Alexander V. Chernikov [Fri, 8 Mar 2013 20:33:50 +0000 (20:33 +0000)]
Fix long-standing issue with interface routes being unprotected:
Use RTM_PINNED flag to mark route as immutable.
Forbid deleting immutable routes without special rtrequest1_fib() flag.
Adding interface address with prefix already in route table is handled
by atomically deleting old prefix and adding interface one.

Discussed with: andre, eri
MFC after: 3 weeks

11 years agoBring over my initial work from the net80211 TX locking branch.
Adrian Chadd [Fri, 8 Mar 2013 20:23:55 +0000 (20:23 +0000)]
Bring over my initial work from the net80211 TX locking branch.

This patchset implements a new TX lock, covering both the per-VAP (and
thus per-node) TX locking and the serialisation through to the underlying
physical device.

This implements the hard requirement that frames to the underlying physical
device are scheduled to the underlying device in the same order that they
are processed at the VAP layer.  This includes adding extra encapsulation
state (such as sequence numbers and CCMP IV numbers.)  Any order mismatch
here will result in dropped packets at the receiver.

There are multiple transmit contexts from the upper protocol layers as well
as the "raw" interface via the management and BPF transmit paths.
All of these need to be correctly serialised or bad behaviour will result
under load.

The specifics:

* add a new TX IC lock - it will eventually just be used for serialisation
  to the underlying physical device but for now it's used for both the
  VAP encapsulation/serialisation and the physical device dispatch.

  This lock is specifically non-recursive.

* Methodize the parent transmit, vap transmit and ic_raw_xmit function
  pointers; use lock assertions in the parent/vap transmit routines.

* Add a lock assertion in ieee80211_encap() - the TX lock must be held
  here to guarantee sensible behaviour.

* Refactor out the packet sending code from ieee80211_start() - now
  ieee80211_start() is just a loop over the ifnet queue and it dispatches
  each VAP packet send through ieee80211_start_pkt().

  Yes, I will likely rename ieee80211_start_pkt() to something that
  better reflects its status as a VAP packet transmit path.  More on
  that later.

* Add locking around the management and BAR TX sending - to ensure that
  encapsulation and TX are done hand-in-hand.

* Add locking in the mesh code - again, to ensure that encapsulation
  and mesh transmit are done hand-in-hand.

* Add locking around the power save queue and ageq handling, when
  dispatching to the parent interface.

* Add locking around the WDS handoff.

* Add a note in the mesh dispatch code that the TX path needs to be
  re-thought-out - right now it's doing a direct parent device transmit
  rather than going via the vap layer.  It may "work", but it's likely
  incorrect (as it bypasses any possible per-node power save and
  aggregation handling.)

Why not a per-VAP or per-node lock?

Because in order to ensure per-VAP ordering, we'd have to hold the
VAP lock across parent->if_transmit().  There are a few problems
with this:

* There's some state being setup during each driver transmit - specifically,
  the encryption encap / CCMP IV setup.  That should eventually be dragged
  back into the encapsulation phase but for now it lives in the driver TX path.
  This should be locked.

* Two drivers (ath, iwn) re-use the node->ni_txseqs array in order to
  allocate sequence numbers when doing transmit aggregation.  This should
  also be locked.

* Drivers may have multiple frames queued already - so when one calls
  if_transmit(), it may end up dispatching multiple frames for different
  VAPs/nodes, each needing a different lock when handling that particular
  end destination.

So to be "correct" locking-wise, we'd end up needing to grab a VAP or
node lock inside the driver TX path when setting up crypto / AMPDU sequence
numbers, and we may already _have_ a TX lock held - mostly for the same
destination vap/node, but sometimes it'll be for others.  That could lead
to LORs and thus deadlocks.

So for now, I'm sticking with an IC TX lock.  It has the advantage of
papering over the above and it also has the added advantage that I can
assert that it's being held when doing a parent device transmit.
I'll look at splitting the locks out a bit more later on.

General outstanding net80211 TX path issues / TODO:

* Look into separating out the VAP serialisation and the IC handoff.
  It's going to be tricky as parent->if_transmit() doesn't give me the
  opportunity to split queuing from driver dispatch.  See above.

* Work with monthadar to fix up the mesh transmit path so it doesn't go via
  the parent interface when retransmitting frames.

* Push the encryption handling back into the driver, if it's at all
  architectually sane to do so.  I know it's possible - it's what mac80211
  in Linux does.

* Make ieee80211_raw_xmit() queue a frame into VAP or parent queue rather
  than doing a short-cut direct into the driver.  There are QoS issues
  here - you do want your management frames to be encapsulated and pushed
  onto the stack sooner than the (large, bursty) amount of data frames
  that are queued.  But there has to be a saner way to do this.

* Fragments are still broken - drivers need to be upgraded to an if_transmit()
  implementation and then fragmentation handling needs to be properly fixed.

Tested:

* STA - AR5416, AR9280, Intel 5300 abgn wifi
* Hostap - AR5416, AR9160, AR9280
* Mesh - some testing by monthadar@, more to come.

11 years agoAdd legacy support to geom raid to create a /dev/arX device for support
Sean Bruno [Fri, 8 Mar 2013 20:07:32 +0000 (20:07 +0000)]
Add legacy support to geom raid to create a /dev/arX device for support
of upgrading older machines using ataraid(4) to newer releases.

This optional parameter is controlled via kern.geom.raid.legacy_aliases
and will create a /dev/ar0 device that will point at /dev/raid/r0 for
example.

Tested on Dell SC 1425 DDF-1 format software raid controllers installing from
stable/7 and upgrading to stable/9 without having to adjust /etc/fstab

Reviewed by: mav
Obtained from: Yahoo!
MFC after: 2 Weeks

11 years agoImport Linux commit a1b7736dac5f2d5876e68c47a0fce3f423840070
Jean-Sébastien Pédron [Fri, 8 Mar 2013 18:15:07 +0000 (18:15 +0000)]
Import Linux commit a1b7736dac5f2d5876e68c47a0fce3f423840070
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Wed Feb 1 11:38:22 2012 +0100

    drm drm_fb_helper: destroy modes

    drm_setup_crtcs allocated modes using drm_mode_duplicate. Free
    them in drm_fb_helper_crtc_free.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Discussed with: Konstantin Belousov (kib@)

11 years agodrm: Fix a call to free(9) with an incorrect malloc type
Jean-Sébastien Pédron [Fri, 8 Mar 2013 18:11:02 +0000 (18:11 +0000)]
drm: Fix a call to free(9) with an incorrect malloc type

While here, the call to free(9) is moved to drm_global.c, near the
initial malloc(9).

Reviewed by: Konstantin Belousov (kib@)

11 years agoEliminate excessive $FreeBSD$ headers.
Xin LI [Fri, 8 Mar 2013 18:08:12 +0000 (18:08 +0000)]
Eliminate excessive $FreeBSD$ headers.

Noticed by: jmallett

11 years agog_label_ntfs_taste: Abort taste is recsize == 0
Jean-Sébastien Pédron [Fri, 8 Mar 2013 18:07:43 +0000 (18:07 +0000)]
g_label_ntfs_taste: Abort taste is recsize == 0

This will avoid a 0-byte read (in g_read_data()) leading to a panic, if
previously read data are erroneous.

Suggested by: John-Mark Gurney <jmg@funkthat.com>

11 years agoMerge r247814 from x86 modulo whitespace bug:
Marius Strobl [Fri, 8 Mar 2013 13:11:45 +0000 (13:11 +0000)]
Merge r247814 from x86 modulo whitespace bug:

Turn on the CTL disable tunable by default.

This will allow GENERIC configurations to boot on small memory boxes, but
not require end users who want to use CTL to recompile their kernel.  They
can simply set kern.cam.ctl.disable=0 in loader.conf.

11 years agoFix bootstrapping pkgng by not appending "/latest/" to PACKAGESITE.
Baptiste Daroussin [Fri, 8 Mar 2013 10:43:03 +0000 (10:43 +0000)]
Fix bootstrapping pkgng by not appending "/latest/" to PACKAGESITE.

Reporter by : Alexander Yerenkow (via irc)

11 years agoMove the callout subsystem initialization to its own SYSINIT()
Andre Oppermann [Fri, 8 Mar 2013 10:37:17 +0000 (10:37 +0000)]
Move the callout subsystem initialization to its own SYSINIT()
from being indirectly called via cpu_startup()+vm_ksubmap_init().
The boot order position remains the same at SI_SUB_CPU.

Allocation of the callout array is changed to stardard kernel malloc
from a slightly obscure direct kernel_map allocation.

kern_timeout_callwheel_alloc() is renamed to callout_callwheel_init()
to better describe its purpose.
kern_timeout_callwheel_init() is removed simplifying the per-cpu
initialization.

Reviewed by: davide

11 years agoMove the auto-sizing of the callout array from init_param2() to
Andre Oppermann [Fri, 8 Mar 2013 10:14:58 +0000 (10:14 +0000)]
Move the auto-sizing of the callout array from init_param2() to
kern_timeout_callwheel_alloc() where it is actually used.

This is a mechanical move and no tuning parameters are changed.

The pre-allocated callout array is only used for legacy timeout(9)
calls and is only allocated and active on cpu0.  Eventually all
remaining users of timeout(9) should switch to the callout_* API.

Reviewed by: davide

11 years agoThis file is specific to arm11x6 processors, so tell the
Tim Kientzle [Fri, 8 Mar 2013 03:29:05 +0000 (03:29 +0000)]
This file is specific to arm11x6 processors, so tell the
assembler it's okay to use arm11x6 instructions.

11 years agoAdd arm bits to truss.
Olivier Houchard [Thu, 7 Mar 2013 23:44:35 +0000 (23:44 +0000)]
Add arm bits to truss.

11 years agoFix GCC build:
David E. O'Brien [Thu, 7 Mar 2013 22:54:28 +0000 (22:54 +0000)]
Fix GCC build:
/usr/src/sys/modules/nvme/../../dev/nvme/nvme.c:211: warning: format '%qx' expects type 'long unsigned int', but argument 9 has type 'long long unsigned int' [-Wformat]

11 years agoFix error in r247960: actually assign the basename to match.iim_file.
Dimitry Andric [Thu, 7 Mar 2013 22:43:50 +0000 (22:43 +0000)]
Fix error in r247960: actually assign the basename to match.iim_file.

Pointed out by: avg
Pointy hat to: dim
MFC after: 1 week
X-MFC-With: r247960

11 years agoSupport the FAT16 partition type in gpart(8)
Gavin Atkinson [Thu, 7 Mar 2013 22:32:41 +0000 (22:32 +0000)]
Support the FAT16 partition type in gpart(8)

PR: kern/174714
Submitted by: 4721 at hushmail dot com
MFC after: 1 week

11 years agoMake ctfconvert work correctly on clang-compiled object files. Clang
Dimitry Andric [Thu, 7 Mar 2013 22:16:35 +0000 (22:16 +0000)]
Make ctfconvert work correctly on clang-compiled object files.  Clang
puts the full original source filename in the STT_FILE entry of the ELF
symbol table, while gcc saves only the basename.

Since the DWARF DW_AT_name attribute contains the full source filename,
both for clang and gcc, ctfconvert takes just the basename of it, for
matching with the STT_FILE entry.  So when attempting to match with such
an entry, use its basename, if necessary.

Reported by: avg
MFC after: 1 week

11 years agoMake c99(1) invoke /usr/bin/cc with argv[0] set to "/usr/bin/cc" instead
Dimitry Andric [Thu, 7 Mar 2013 21:37:23 +0000 (21:37 +0000)]
Make c99(1) invoke /usr/bin/cc with argv[0] set to "/usr/bin/cc" instead
of just "cc", since there is no reason to cause additional path searches
in this case.

MFC after: 3 days

11 years agoMake c89(1) invoke /usr/bin/cc with argv[0] also set to /usr/bin/cc,
Dimitry Andric [Thu, 7 Mar 2013 21:34:16 +0000 (21:34 +0000)]
Make c89(1) invoke /usr/bin/cc with argv[0] also set to /usr/bin/cc,
similar to what c99(1) does, to prevent "c89: illegal option -- 1"
messages, when clang is /usr/bin/cc.

Reported by: tijl
MFC after: 3 days

11 years agoNow that stable/7 is EOL, stop building INDEX-7.
Colin Percival [Thu, 7 Mar 2013 20:48:36 +0000 (20:48 +0000)]
Now that stable/7 is EOL, stop building INDEX-7.

MFC after: 1 week

11 years agoCleanup gr_add() so it does not leak mem
Diane Bruce [Thu, 7 Mar 2013 19:00:00 +0000 (19:00 +0000)]
Cleanup gr_add() so it does not leak mem
This is part of ongoing work on sbin/pw

M    libutil.h
M    gr_util.c

Approved by: theraven

11 years agoFix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq
Alexander Motin [Thu, 7 Mar 2013 18:55:37 +0000 (18:55 +0000)]
Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq
is not set (255).

Reported by: sbruno
MFC after: 1 week

11 years agoFix off-by-one error in nanoseconds validation.
Alexander Motin [Thu, 7 Mar 2013 16:50:07 +0000 (16:50 +0000)]
Fix off-by-one error in nanoseconds validation.

Submitted by: bde

11 years agoPartially revert r247892 and r247904 since our strnvis() does not
Dag-Erling Smørgrav [Thu, 7 Mar 2013 14:38:43 +0000 (14:38 +0000)]
Partially revert r247892 and r247904 since our strnvis() does not
behave the way OpenSSH expects.

11 years agoThe ZyXEL ZyAIR G-202 is also supported by zyd(4)
Gavin Atkinson [Thu, 7 Mar 2013 13:26:54 +0000 (13:26 +0000)]
The ZyXEL ZyAIR G-202 is also supported by zyd(4)

MFC after: 1 week

11 years agoCorrect two spelling mistakes in a comment.
Gavin Atkinson [Thu, 7 Mar 2013 13:24:49 +0000 (13:24 +0000)]
Correct two spelling mistakes in a comment.

11 years agoSuggest using the https: protocol not the svn: protocol to retrieve the
Gavin Atkinson [Thu, 7 Mar 2013 13:24:16 +0000 (13:24 +0000)]
Suggest using the https: protocol not the svn: protocol to retrieve the
various repositories.

11 years agoAdd __clzsi2 and ctzsi2. They are required on ARMv4 and ARMv5 to implement
Andrew Turner [Thu, 7 Mar 2013 09:18:52 +0000 (09:18 +0000)]
Add __clzsi2 and ctzsi2. They are required on ARMv4 and ARMv5 to implement
a number of builtin functions.

11 years agoAdd quirks to enable headphones redirection on number of Lenovo
Gleb Smirnoff [Thu, 7 Mar 2013 08:00:04 +0000 (08:00 +0000)]
Add quirks to enable headphones redirection on number of Lenovo
laptops, namely X1, X1 Carbon, T420, T520.

PR: misc/176656
Submitted by: Hiren Panchasar <hiren.panchasara gmail.com>
Tested by: glebius, X1 Carbon
Tested by: osa, X1
Tested by: Hiren Panchasar, T420
Tested by: sbruno, T520
Reviewed by: mav
Sponsored by: Nginx, Inc.

11 years agoPlug a memory leak.
Gleb Smirnoff [Thu, 7 Mar 2013 07:54:50 +0000 (07:54 +0000)]
Plug a memory leak.

Reviewed by: mav
Sponsored by: Nginx, Inc.

11 years agoThe hashmask returned by hashinit() is a valid index in the returned hash array.
Lawrence Stewart [Thu, 7 Mar 2013 04:42:20 +0000 (04:42 +0000)]
The hashmask returned by hashinit() is a valid index in the returned hash array.
Fix a siftr(4) potential memory leak and INVARIANTS triggered kernel panic in
hashdestroy() by ensuring the last array index in the flow counter hash table is
flushed of entries.

MFC after: 3 days

11 years agoCall sched_prio() to immediately change the priority of the thread in
Ian Lepore [Thu, 7 Mar 2013 02:53:29 +0000 (02:53 +0000)]
Call sched_prio() to immediately change the priority of the thread in
response to an rtprio_thread() call, when the priority is different
than the old priority, and either the old or the new priority class is
not RTP_PRIO_NORMAL (timeshare).

The reasoning for the second half of the test is that if it's a change in
timeshare priority, then the scheduler is going to adjust that priority
in a way that completely wipes out the requested change anyway, so
what's the point?  (If that's not true, then allowing a thread to change
its own timeshare priority would subvert the scheduler's adjustments and
let a cpu-bound thread monopolize the cpu; if allowed at all, that
should require priveleges.)

On the other hand, if either the old or new priority class is not
timeshare, then the scheduler doesn't make automatic adjustments, so we
should honor the request and make the priority change right away.  The
reason the old class gets caught up in this is the very reason for this
change:  when thread A changes the priority of its child thread B from
idle back to timeshare, thread B never actually gets moved to a
timeshare-range run queue unless there are some idle cycles available
to allow it to first get scheduled again as an idle thread.

Reviewed by: jhb@

11 years agoRemove strnvis(), strvis(), strvisx().
Dag-Erling Smørgrav [Wed, 6 Mar 2013 23:22:40 +0000 (23:22 +0000)]
Remove strnvis(), strvis(), strvisx().

11 years agoReduce minimal time intervals of setitimer(2) from 1/HZ to 1/(16*HZ) by
Alexander Motin [Wed, 6 Mar 2013 22:40:47 +0000 (22:40 +0000)]
Reduce minimal time intervals of setitimer(2) from 1/HZ to 1/(16*HZ) by
using callout_reset_sbt() instead of callout_reset().  We can't remove
lower limit completely in this case because of significant processing
overhead, caused by unability to use direct callout execution due to using
process mutex in callout handler for sending SEGALRM signal.  With support
of periodic events that would allow unprivileged user to abuse the system.

Reviewed by: davide

11 years agoCreate a symlink from strchrnul.3 to strchr.3.
Niclas Zeising [Wed, 6 Mar 2013 19:59:42 +0000 (19:59 +0000)]
Create a symlink from strchrnul.3 to strchr.3.
This was forgotten in the initial commit of strchrnul()

Approved by: theraven

11 years agoFix time math overflows and improve zero intervals handling in poll(),
Alexander Motin [Wed, 6 Mar 2013 19:37:38 +0000 (19:37 +0000)]
Fix time math overflows and improve zero intervals handling in poll(),
select(), nanosleep() and kevent() functions after calloutng changes.

Reported by: bde

11 years agoForced commit to note that this file had not been regenerated since 5.8
Dag-Erling Smørgrav [Wed, 6 Mar 2013 13:48:49 +0000 (13:48 +0000)]
Forced commit to note that this file had not been regenerated since 5.8
due to issues with the configure script incorrectly detecting utmp and
lastlog despite the fact that FreeBSD 10 does not have them any more.

11 years agoExplicitly disable lastlog, utmp and wtmp.
Dag-Erling Smørgrav [Wed, 6 Mar 2013 13:46:20 +0000 (13:46 +0000)]
Explicitly disable lastlog, utmp and wtmp.

11 years agoFix 'make depend'
Ulrich Spörlein [Wed, 6 Mar 2013 11:44:19 +0000 (11:44 +0000)]
Fix 'make depend'

11 years agoUpdate driver to version 4.6.95.0.
Xin LI [Wed, 6 Mar 2013 09:53:38 +0000 (09:53 +0000)]
Update driver to version 4.6.95.0.

Submitted by: "Duvvuru,Venkat Kumar" <VenkatKumar.Duvvuru Emulex.Com>
MFC after: 3 days

11 years agoSimplify virtio ring num-available calculation.
Peter Grehan [Wed, 6 Mar 2013 07:28:20 +0000 (07:28 +0000)]
Simplify virtio ring num-available calculation.

Submitted by: Chris Torek, torek at torek dot net

11 years agoRemove the virtio dependency entry for the VirtIO device drivers. This
Bryan Venteicher [Wed, 6 Mar 2013 07:17:53 +0000 (07:17 +0000)]
Remove the virtio dependency entry for the VirtIO device drivers. This
will prevent the kernel from linking if the device driver are included
without the virtio module. Remove pci and scbus for the same reason.

Also explain the relationship and necessity of the virtio and virtio_pci
modules. Currently in FreeBSD, we only support VirtIO PCI, but it could
be replaced with a different interface (like MMIO) and the device
(network, block, etc) will still function.

Requested by: luigi
Approved by: grehan (mentor)
MFC after: 3 days

11 years agoReorder code to avoid the stat buffer being used uninitialized.
Peter Grehan [Wed, 6 Mar 2013 06:24:09 +0000 (06:24 +0000)]
Reorder code to avoid the stat buffer being used uninitialized.

Obtained from: NetApp

11 years agoFix stack alignment in the kernel to be on an 8 byte boundary as required
Andrew Turner [Wed, 6 Mar 2013 06:19:56 +0000 (06:19 +0000)]
Fix stack alignment in the kernel to be on an 8 byte boundary as required
by AAPCS.

11 years agoFix SIGSEGV when set_short_delay() is called when ifi->ifi_ra_timer is NULL.
Hiroki Sato [Wed, 6 Mar 2013 04:58:48 +0000 (04:58 +0000)]
Fix SIGSEGV when set_short_delay() is called when ifi->ifi_ra_timer is NULL.
This can happen in a short period when a prefix is changed by a rtmsg and a
new interface arrives.

11 years agoUse build_iovec() to make it less cryptic. This also fixes warnings.
Jung-uk Kim [Wed, 6 Mar 2013 00:36:33 +0000 (00:36 +0000)]
Use build_iovec() to make it less cryptic.  This also fixes warnings.

11 years agoGC unused mount_* directories. mount_reiserfs was disconnected from build
Jung-uk Kim [Tue, 5 Mar 2013 23:53:37 +0000 (23:53 +0000)]
GC unused mount_* directories.  mount_reiserfs was disconnected from build
with r158666.  mount_ext2fs and mount_std were disconnected with r164527.

11 years agoUpdate the manual page to reflect reality. With r138509 and r152355,
Jung-uk Kim [Tue, 5 Mar 2013 23:05:43 +0000 (23:05 +0000)]
Update the manual page to reflect reality.  With r138509 and r152355,
"nostrictjoliet" option for mount_cd9660(8) was completely replaced with
"brokenjoliet" somehow.

MFC after: 3 days

11 years agoGC unused variables. Prefer NULL over 0 for pointers.
Jung-uk Kim [Tue, 5 Mar 2013 22:41:35 +0000 (22:41 +0000)]
GC unused variables.  Prefer NULL over 0 for pointers.

11 years ago- Reset DMA channel if error occured
Oleksandr Tymoshenko [Tue, 5 Mar 2013 20:00:11 +0000 (20:00 +0000)]
- Reset DMA channel if error occured
- Initialize info field in bcm_dma_reset

Submitted by: Daisuke Aoyama <aoyama@peach.ne.jp>

11 years agoFix compile warning by including ctype.h for isdigit().
Navdeep Parhar [Tue, 5 Mar 2013 19:37:29 +0000 (19:37 +0000)]
Fix compile warning by including ctype.h for isdigit().

MFC after: 1 day

11 years agoMFV r247845:
Martin Matuska [Tue, 5 Mar 2013 18:54:41 +0000 (18:54 +0000)]
MFV r247845:
Import ZFS bpobj bugfix from vendor.

Illumos ZFS issues:
  3603 panic from bpobj_enqueue_subobj()
  3604 zdb should print bpobjs more verbosely

References:
  https://www.illumos.org/issues/3603
  https://www.illumos.org/issues/3604

MFC after: 1 week

11 years agoFix build with gcc, do not use unnamed union.
Konstantin Belousov [Tue, 5 Mar 2013 16:15:34 +0000 (16:15 +0000)]
Fix build with gcc, do not use unnamed union.

Reported and tested by: gjb
MFC after: 1 month

11 years agoFix build with gcc, remove redundand declarations.
Konstantin Belousov [Tue, 5 Mar 2013 16:14:55 +0000 (16:14 +0000)]
Fix build with gcc, remove redundand declarations.

Reported and tested by: gjb
MFC after: 1 month

11 years agoUpdate vendor/illumos/dist and vendor-sys/illumos/dist
Martin Matuska [Tue, 5 Mar 2013 15:35:57 +0000 (15:35 +0000)]
Update vendor/illumos/dist and vendor-sys/illumos/dist
to illumos-gate 13977:af7f2603d4d7

Illumos ZFS issues:
  3603 panic from bpobj_enqueue_subobj()
  3604 zdb should print bpobjs more verbosely

11 years agoUpdate vendor/illumos/dist and vendor-sys/illumos/dist
Martin Matuska [Tue, 5 Mar 2013 15:33:28 +0000 (15:33 +0000)]
Update vendor/illumos/dist and vendor-sys/illumos/dist
to illumos-gate 13975:ef6409bc370f

Illumos ZFS issues:
  3582 zfs_delay() should support a variable resolution
  3584 DTrace sdt probes for ZFS txg states

11 years agochoose in priority the allocated ABI if any to do the ${ABI} substitution in PACKAGESITE
Baptiste Daroussin [Tue, 5 Mar 2013 14:08:36 +0000 (14:08 +0000)]
choose in priority the allocated ABI if any to do the ${ABI} substitution in PACKAGESITE

Reviewed by: bdrewery

11 years agoWrite lock is not required for find&compare operation.
Alexander V. Chernikov [Tue, 5 Mar 2013 13:38:45 +0000 (13:38 +0000)]
Write lock is not required for find&compare operation.

MFC after: 2 weeks

11 years agoAdd the ability to correctly read pkg.conf is exists.
Baptiste Daroussin [Tue, 5 Mar 2013 13:31:06 +0000 (13:31 +0000)]
Add the ability to correctly read pkg.conf is exists.

Only look for boostrap useful options:
 - PACKAGESITE
 - ABI
 - MIRROR_TYPE
 - ASSUME_ALWAYS_YES

While here makes PACKAGESITE expand the ${ABI} variable.
Allow to deactivate any SRV record look up (MIRROR_TYPE=none)
Use the same mechanism as for pkgng itself: first get configuration out of
environment variable and fallback on pkg.conf if exists.

Reviewed by: bdrewery

11 years agoAdd a stub manpage modeled over the libexpat one to explain to users not to use
Baptiste Daroussin [Tue, 5 Mar 2013 13:06:40 +0000 (13:06 +0000)]
Add a stub manpage modeled over the libexpat one to explain to users not to use
this library outside of base.

Requested by: simon

11 years agodrm_global.c: Destroy sx in drm_global_release()
Jean-Sébastien Pédron [Tue, 5 Mar 2013 11:18:57 +0000 (11:18 +0000)]
drm_global.c: Destroy sx in drm_global_release()

This fixes a build error at the same time (unused variable "item"), if
the kernel is compiled without INVARIANTS.

Reported by: Hartmann, O. <ohartman@zedat.fu-berlin.de> (build error)
Reviewed by: Konstantin Belousov (kib@)

11 years agoCorrect the r247832.
Konstantin Belousov [Tue, 5 Mar 2013 11:02:38 +0000 (11:02 +0000)]
Correct the r247832.

Noted by: marius, rdivacky
MFC after: 1 month

11 years agog_label_ntfs.c: Mark structures as __packed
Jean-Sébastien Pédron [Tue, 5 Mar 2013 11:02:05 +0000 (11:02 +0000)]
g_label_ntfs.c: Mark structures as __packed

Without this, read data is mis-interpreted. This could trigger a panic,
as was the case on one computer where computed "recsize" was zero,
leading to a call to g_read_page() asking for 0 bytes.

11 years agoAdd a generic way to call per event allocate / release function.
Fabien Thomas [Tue, 5 Mar 2013 10:18:48 +0000 (10:18 +0000)]
Add a generic way to call per event allocate / release function.

Reviewed by: mav
MFC after: 1 month

11 years agoImport the preliminary port of the TTM.
Konstantin Belousov [Tue, 5 Mar 2013 09:49:34 +0000 (09:49 +0000)]
Import the preliminary port of the TTM.

The early commit is done to facilitate the off-tree work on the
porting of the Radeon driver.

Sponsored by: The FreeBSD Foundation
Debugged and tested by:     dumbbell
MFC after: 1 month

11 years agoImport the drm_global references helpers.
Konstantin Belousov [Tue, 5 Mar 2013 09:27:21 +0000 (09:27 +0000)]
Import the drm_global references helpers.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

11 years agoImport the drm_mm_debug_table() function.
Konstantin Belousov [Tue, 5 Mar 2013 09:07:58 +0000 (09:07 +0000)]
Import the drm_mm_debug_table() function.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

11 years agoImport the likely() compat macro.
Konstantin Belousov [Tue, 5 Mar 2013 09:07:01 +0000 (09:07 +0000)]
Import the likely() compat macro.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

11 years agoSimplify TAILQ usage and avoid additional memory allocations.
Gleb Smirnoff [Tue, 5 Mar 2013 08:08:16 +0000 (08:08 +0000)]
Simplify TAILQ usage and avoid additional memory allocations.

Tested by: Eugene M. Zheganin <emz norma.perm.ru>
Sponsored by: Nginx, Inc

11 years agoOnly set the barrier flag if the feature was negotiated
Bryan Venteicher [Tue, 5 Mar 2013 07:00:05 +0000 (07:00 +0000)]
Only set the barrier flag if the feature was negotiated

When the VirtIO barrier feature is not negotiated, the driver
must enforce the proper ordering for BIO_ORDERED BIOs. All the
in-flight BIOs must complete before starting the BIO, and the
ordered BIO must complete before subsequent BIOs can start.

Also fix a few whitespace nits.

Reported by: neel
Approved by: grehan (mentor)
MFC after: 3 days

11 years agoFix a small, but important bug, a task drain was mistakenly
Jack F Vogel [Mon, 4 Mar 2013 23:15:07 +0000 (23:15 +0000)]
Fix a small, but important bug, a task drain was mistakenly
being compiled only when setting LEGACY_TX, this means you would
not get the drain when needed on detach!!

Thanks to Bryan Venteicher (bryanv@freebsd.org) for catching this
little gremlin!! :)

11 years agoFirst, sync to internal shared code, and then
Jack F Vogel [Mon, 4 Mar 2013 23:07:40 +0000 (23:07 +0000)]
First, sync to internal shared code, and then

Fixes:
- flow control - don't override user value on re-init
- fix to make 1G optics work correctly
- change to interrupt enabling - some bits were incorrect
  for certain hardware.
- certain stats fixes, remove a duplicate increment of
  ierror, thanks to Scott Long for pointing these out.
- shared code link interface changed, requiring some
  core code changes to accomodate this.
- add an m_adj() to ETHER_ALIGN on the recieve side, this
  was requested by Mike Karels, thanks Mike.
- Multicast code corrections also thanks to Mike Karels.

11 years ago- Bump __FreeBSD_version after recent callout(9) changes.
Davide Italiano [Mon, 4 Mar 2013 22:41:49 +0000 (22:41 +0000)]
- Bump __FreeBSD_version after recent callout(9) changes.
- Add an entry in UPDATING to notice users about breakages.

11 years agoFix assertion failure when using userland DTrace probes from
Justin T. Gibbs [Mon, 4 Mar 2013 22:07:36 +0000 (22:07 +0000)]
Fix assertion failure when using userland DTrace probes from
the pid provider on a kernel compiled with INVARIANTS.

sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c:
In fasttrap_probe_pid(), attempts to write to the
address space of the thread that fired the probe
must be performed with the process of the thread
held.  Use _PHOLD() to ensure this is the case.

In fasttrap_probe_pid(), use proc_write_regs() instead
of calling set_regs() directly.  proc_write_regs()
performs invariant checks to verify the calling
environment of set_regs().  PROC_LOCK()/UNLOCK() around
the call to proc_write_regs() so that it's invariants
are satisfied.

Sponsored by: Spectra Logic Corporation
Reviewed by: gnn, rpaulo
MFC after: 1 week

11 years agoComplete r247813:
Davide Italiano [Mon, 4 Mar 2013 21:52:12 +0000 (21:52 +0000)]
Complete r247813:
Use true/false instead of TRUE/FALSE.

Reported by: attilio
Requested by: jhb

11 years agoAdd quirk to enable headphones redirection on Lenovo X220.
Alexander Motin [Mon, 4 Mar 2013 21:20:13 +0000 (21:20 +0000)]
Add quirk to enable headphones redirection on Lenovo X220.

PR: kern/174876
MFC after: 1 week

11 years agoRe-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disable
Kenneth D. Merry [Mon, 4 Mar 2013 21:18:45 +0000 (21:18 +0000)]
Re-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disable
tunable by default.

This will allow GENERIC configurations to boot on small memory boxes, but
not require end users who want to use CTL to recompile their kernel.  They
can simply set kern.cam.ctl.disable=0 in loader.conf.

The eventual solution to the memory usage problem is to change the way
CTL allocates memory to be more configurable, but this should fix things
for small memory situations in the mean time.

UPDATING: Explain the change in the CTL configuration, and
how users can enable CTL if they would like to use
it.

sys/conf/options: Add a new option, CTL_DISABLE, that prevents CTL
from initializing.

ctl.c: If CTL_DISABLE is turned on, don't initialize.

i386/conf/GENERIC,
amd64/conf/GENERIC: Re-enable device ctl, and add the CTL_DISABLE
option.

11 years agoUse C99 'bool' rather than Machish 'boolean_t'.
Davide Italiano [Mon, 4 Mar 2013 21:09:22 +0000 (21:09 +0000)]
Use C99 'bool' rather than Machish 'boolean_t'.

Requested by: jhb

11 years agoMFcalloutng:
Davide Italiano [Mon, 4 Mar 2013 19:10:39 +0000 (19:10 +0000)]
MFcalloutng:
Dcoument the new functions added to condvar(9), sleep(9), sleepqueue(9)
KPIs. Also document recent changes in timeout(9) and eventtimers(4).

11 years agoDo not suddenly fail on some rulesets if -n (syntax check only) is specified
Alexander V. Chernikov [Mon, 4 Mar 2013 19:01:38 +0000 (19:01 +0000)]
Do not suddenly fail on some rulesets if -n (syntax check only) is specified
and ipfw(4) module is not loaded.

MFC after: 2 weeks

11 years agoMerge upstream r634:646: correctly parse mixed quoted / unquoted text.
Dag-Erling Smørgrav [Mon, 4 Mar 2013 18:51:53 +0000 (18:51 +0000)]
Merge upstream r634:646: correctly parse mixed quoted / unquoted text.

11 years agoMerge upstream r634:646: correctly parse mixed quoted / unquoted text.
Dag-Erling Smørgrav [Mon, 4 Mar 2013 18:46:55 +0000 (18:46 +0000)]
Merge upstream r634:646: correctly parse mixed quoted / unquoted text.
See http://www.openpam.org/wiki/Errata#Configurationparsing for details.

11 years agoMFcalloutng:
Davide Italiano [Mon, 4 Mar 2013 16:55:16 +0000 (16:55 +0000)]
MFcalloutng:
- Rewrite kevent() timeout implementation to allow sub-tick precision.
- Make the interval timings for EVFILT_TIMER more accurate. This also
removes an hack introduced in r238424.

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoMFcalloutng:
Davide Italiano [Mon, 4 Mar 2013 16:41:27 +0000 (16:41 +0000)]
MFcalloutng:
Fix kern_select() and sys_poll() so that they can handle sub-tick
precision for timeouts (in the same fashion it was done for nanosleep()
in r247797).

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoMFcalloutng (r244251 with minor changes):
Davide Italiano [Mon, 4 Mar 2013 16:25:12 +0000 (16:25 +0000)]
MFcalloutng (r244251 with minor changes):
Specify that precision of 0.5s is enough for resource limitation.

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoMFcalloutng (r236314 by mav):
Davide Italiano [Mon, 4 Mar 2013 16:16:23 +0000 (16:16 +0000)]
MFcalloutng (r236314 by mav):
Specify that wakeup rate of 7.5-10Hz is enough for yarrow harvesting
thread.

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoMFcalloutng (r244255 by mav, with minor changes):
Davide Italiano [Mon, 4 Mar 2013 16:07:55 +0000 (16:07 +0000)]
MFcalloutng (r244255 by mav, with minor changes):
Specify that syslog doesn't need exactly 5 wakeups per second.

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoMFcalloutng:
Davide Italiano [Mon, 4 Mar 2013 15:57:41 +0000 (15:57 +0000)]
MFcalloutng:
kern_nanosleep() is now converted to use tsleep_sbt(). With this change
nanosleep() and usleep() can handle sub-tick precision for timeouts.
Also, try to help coalesce of events passing as argument to tsleep_bt()
a precision value calculated as a percentage of the sleep time.
This percentage is default 5%, but it can tuned according to users
need via the sysctl interface.

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoFix build with DIAGNOSTIC/CALLOUT_PROFILING options turned on.
Davide Italiano [Mon, 4 Mar 2013 15:03:52 +0000 (15:03 +0000)]
Fix build with DIAGNOSTIC/CALLOUT_PROFILING options turned on.

Reported by: kib, David Wolfskill <david at catwhisker dot org>
Pointy-hat to: davide

11 years agoMFcalloutng (r244249, r244306 by mav):
Davide Italiano [Mon, 4 Mar 2013 14:00:58 +0000 (14:00 +0000)]
MFcalloutng (r244249, r244306 by mav):
- Switch syscons from timeout() to callout_reset_flags() and specify that
precision is not important there -- anything from 20 to 30Hz will be fine.
- Reduce syscons "refresh" rate to 1-2Hz when console is in graphics mode
and there is nothing to do except some polling for keyboard.  Text mode
refresh would also be nice to have adaptive, but this change at least
should help laptop users who running X.

Sponsored by: Google Summer of Code 2012, iXsystems inc.
Tested by: flo, marius, ian, markj, Fabian Keil

11 years agoModernize some portions of the ports man page.
Eitan Adler [Mon, 4 Mar 2013 13:57:46 +0000 (13:57 +0000)]
Modernize some portions of the ports man page.
Stop documenting other operating systems's default patha

Approved by: bcr (mentor)