]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoAdd support for level triggered interrupt pins on the vioapic. Prior to this
Neel Natu [Wed, 27 Nov 2013 22:18:08 +0000 (22:18 +0000)]
Add support for level triggered interrupt pins on the vioapic. Prior to this
commit level triggered interrupts would work as long as the pin was not shared
among multiple interrupt sources.

The vlapic now keeps track of level triggered interrupts in the trigger mode
register and will forward the EOI for a level triggered interrupt to the
vioapic. The vioapic in turn uses the EOI to sample the level on the pin and
re-inject the vector if the pin is still asserted.

The vhpet is the first consumer of level triggered interrupts and advertises
that it can generate interrupts on pins 20 through 23 of the vioapic.

Discussed with: grehan@

10 years agocxgbetool: "modinfo" command to display SFP+ module information.
Navdeep Parhar [Wed, 27 Nov 2013 22:17:00 +0000 (22:17 +0000)]
cxgbetool: "modinfo" command to display SFP+ module information.

trantor:~# cxgbetool t5nex0 modinfo 1
ID: SFP
Vendor FINISAR CORP.
SN AJ10JQR
PN FTLX8571D3BCL
Rev A
Temp: +35C
Vcc 3.225600V
TX Bias 2.176000uA
TX Power 0.588800mW
RX Power 0.486400mW

Submitted by: gnn

10 years agoThis driver doesn't need the /options node, so don't check for it.
Nathan Whitehorn [Wed, 27 Nov 2013 22:02:55 +0000 (22:02 +0000)]
This driver doesn't need the /options node, so don't check for it.

10 years agobadaddr() is used only in the grackle PCI driver, so move its definition
Nathan Whitehorn [Wed, 27 Nov 2013 22:01:09 +0000 (22:01 +0000)]
badaddr() is used only in the grackle PCI driver, so move its definition
there. Clean up a spurious setfault() declaration as well.

10 years agoProvide a helpful diagnostic when the minimum size rounded to the block size
Juli Mallett [Wed, 27 Nov 2013 21:55:43 +0000 (21:55 +0000)]
Provide a helpful diagnostic when the minimum size rounded to the block size
would exceed the maximum size.  This can be a difficult problem to diagnose
if one is, for instance, using -s with a fixed size in a script and the bsize
calculated for a filesystem image changes, necessitating a re-rounding of the
image size or a hand-setting of the bsize.  Previously one would get a
cryptic message about how the size exceeded the maximum size, which normally
only happens if the contents of the image are larger than specified.

10 years agoMake RTAS calls, which call setfault() to recover from machine checks,
Nathan Whitehorn [Wed, 27 Nov 2013 21:51:34 +0000 (21:51 +0000)]
Make RTAS calls, which call setfault() to recover from machine checks,
preserve any existing fault buffer. RTAS calls are meant to be safe from
interrupt context (and are indeed used there to implement the xics PIC
drvier). Without this, calling into RTAS in interrupt context would have
the effect of clearing any existing onfault state of the interrupted
thread, potentially leading to a panic.

10 years agoMake UMA to not blindly force offpage slab header allocation for large
Alexander Motin [Wed, 27 Nov 2013 20:56:10 +0000 (20:56 +0000)]
Make UMA to not blindly force offpage slab header allocation for large
(> PAGE_SIZE) zones.  If zone is not multiple to PAGE_SIZE, there may
be enough space for the header at the last page, so we may avoid extra
header memory allocation and hash table update/lookup.

ZFS creates bunch of odd-sized UMA zones (5120, 6144, 7168, 10240, 14336).
This change gives good use to at least some of otherwise lost memory there.

Reviewed by: avg

10 years agoAdd constants for use in interrogating various fiber and copper connectors
George V. Neville-Neil [Wed, 27 Nov 2013 20:20:02 +0000 (20:20 +0000)]
Add constants for use in interrogating various fiber and copper connectors
most often used with network interfaces.

The SFF-8472 standard defines the information that can be retrieved
from an optic or a copper cable plugged into a NIC, most often
referred to as SFP+.  Examples of values that can be read
include the cable vendor's name, part number, date of manufacture
as well as running data such as temperature, voltage and tx
and rx power.

Copious comments on how to use these values with an I2C interface
are given in the header file itself.

MFC after: 2 weeks

10 years agoDon't count bucket allocation failures for UMA zones as their own failures.
Alexander Motin [Wed, 27 Nov 2013 20:16:18 +0000 (20:16 +0000)]
Don't count bucket allocation failures for UMA zones as their own failures.
There are good reasons for this to happen, such as recursion prevention, etc.
and they are not fatal since buckets are just an optimization mechanism.
Real bucket allocation failures are any way counted by the bucket zones
themselves, and we don't need double accounting there.

10 years agoFix bug introduced at r252226, when udata argument passed to bucket_alloc()
Alexander Motin [Wed, 27 Nov 2013 19:55:42 +0000 (19:55 +0000)]
Fix bug introduced at r252226, when udata argument passed to bucket_alloc()
was used without making sure first that it was really passed for us.

On some of my systems this bug made user argument passed by ZFS code to
uma_zalloc_arg() unexpectedly block UMA per-CPU caches for those zones.

10 years agoDisable an assertion that relies on some code[1] that isn't in HEAD yet.
Navdeep Parhar [Wed, 27 Nov 2013 19:54:19 +0000 (19:54 +0000)]
Disable an assertion that relies on some code[1] that isn't in HEAD yet.

[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-August/036573.html

10 years agoRevert r258672. We clearly don't compile libraries enough times.
Peter Wemm [Wed, 27 Nov 2013 19:51:50 +0000 (19:51 +0000)]
Revert r258672. We clearly don't compile libraries enough times.

10 years ago- add myself to the committers list (it's about time,
Stefan Eßer [Wed, 27 Nov 2013 19:12:29 +0000 (19:12 +0000)]
- add myself to the committers list (it's about time,
  having been a committer for more than 19 years ...)

10 years agoFix fdisk(8) to create 2TB partitions on disks larger than 2TB, rather than
Juli Mallett [Wed, 27 Nov 2013 17:59:13 +0000 (17:59 +0000)]
Fix fdisk(8) to create 2TB partitions on disks larger than 2TB, rather than
only being able to create 1TB partitions:
o) Use an unsigned 32-bit quantity to store the number of disk sectors.
o) Detect overflow of said 32-bit quantity and clamp to 2^32.
o) Rather than returning the disk sector count from get_params, return 0 on
   success, since its return value is only ever compared to -1 to detect
   failure.  This would cause returning 2^32 sectors to be interpreted as an
   error.

Reviewed by: bde ("good for a quick fix")

10 years agoAdd myself to the committers-src list.
Roger Pau Monné [Wed, 27 Nov 2013 15:58:07 +0000 (15:58 +0000)]
Add myself to the committers-src list.

Approved by: gibbs (mentor)

10 years agoEscape special XML chars, returned by some devices, confusing XML parsers.
Alexander Motin [Wed, 27 Nov 2013 14:25:06 +0000 (14:25 +0000)]
Escape special XML chars, returned by some devices, confusing XML parsers.

MFC after: 1 month

10 years agoConnect the two recently added man pages to the system's install process.
Luiz Otavio O Souza [Wed, 27 Nov 2013 12:17:05 +0000 (12:17 +0000)]
Connect the two recently added man pages to the system's install process.

Approved by: adrian (mentor)

10 years agoFix the led 'gpios' definition to match the description on
Luiz Otavio O Souza [Wed, 27 Nov 2013 12:12:37 +0000 (12:12 +0000)]
Fix the led 'gpios' definition to match the description on
sys/boot/fdt/dts/bindings-gpio.txt.  Make the led pin an output, add the
missing flag field.  No functional change (gpioled(4) isn’t supported on
FDT systems yet).

Approved by: adrian (mentor)

10 years agoFix key lookup in ipfw(8) broken since r232865.
Alexander V. Chernikov [Wed, 27 Nov 2013 10:10:25 +0000 (10:10 +0000)]
Fix key lookup in ipfw(8) broken since r232865.
Print warning for IPv4 address strings which are valid in
inet_aton() but not valid in inet_pton(). (1)

Found by: Özkan KIRIK <ozkan.kirik@gmail.com>
Submitted by: Ian Smith <smithi@nimnet.asn.au> (1)
MFC after: 2 weeks
Sponsored by: Yandex LLC

10 years agoBandaid for compiling with gcc.
Sergey Kandaurov [Wed, 27 Nov 2013 08:39:48 +0000 (08:39 +0000)]
Bandaid for compiling with gcc.

10 years agoFix build.
Gleb Smirnoff [Wed, 27 Nov 2013 07:21:25 +0000 (07:21 +0000)]
Fix build.

10 years agoDon't create an initial value for the host filesystem of "/".
Peter Grehan [Wed, 27 Nov 2013 06:07:03 +0000 (06:07 +0000)]
Don't create an initial value for the host filesystem of "/".
This has the unintended effect of booting the host kernel if
a disk image open fails.

Discussed with: neel

10 years agoAt great personal risk, change the default for LIB32 from yes to no. As
Peter Wemm [Wed, 27 Nov 2013 04:54:23 +0000 (04:54 +0000)]
At great personal risk, change the default for LIB32 from yes to no.  As
mentioned in UPDATING, you can even do it as an as-needed operation after
doing a buildworld/installworld.  You can set WITH_LIB32=yes in make.conf
or src.conf.

10 years agoDocument the dvdrom target and NODVD variable, forgotten with r258310.
Glen Barber [Wed, 27 Nov 2013 03:05:24 +0000 (03:05 +0000)]
Document the dvdrom target and NODVD variable, forgotten with r258310.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

10 years agoAllow bhyve and bhyveload to attach to tty devices.
Peter Grehan [Wed, 27 Nov 2013 00:21:37 +0000 (00:21 +0000)]
Allow bhyve and bhyveload to attach to tty devices.

bhyveload: introduce the -c <device> parameter
 to select a tty for output (or "stdio")

bhyve: allow the puc and lpc-com backends to
 accept a tty in addition to "stdio"

When used in conjunction with the null-modem device,
nmdm(4), this allows attach/detach to the guest console
and multiple concurrent serial ports. kgdb on a serial
port is now functional.

Reviewed by: neel
Requested by: Almost everyone that has used bhyve
MFC after: 10.0

10 years ago- Nuke a second copy of nfscl_attrcache extern declarations from under
Sergey Kandaurov [Tue, 26 Nov 2013 22:41:40 +0000 (22:41 +0000)]
- Nuke a second copy of nfscl_attrcache extern declarations from under
ifdef KDTRACE_HOOKS.  This fixes kernel build with options KDTRACE_HOOKS.
- Fix style inconsistencies.

10 years agoFix build, attempt two.
Gleb Smirnoff [Tue, 26 Nov 2013 20:27:57 +0000 (20:27 +0000)]
Fix build, attempt two.

10 years agoCreate /var/cache with mode 0755 instead of 0750.
Xin LI [Tue, 26 Nov 2013 20:03:25 +0000 (20:03 +0000)]
Create /var/cache with mode 0755 instead of 0750.

This directory is used by many third party applications and having
permission 0750 makes it impossible to drop group privileges.

MFC after: 3 days

10 years agoUse sysctl KERN_PROC_SIGTRAMP to retrieve the signal trampoline
Konstantin Belousov [Tue, 26 Nov 2013 19:54:12 +0000 (19:54 +0000)]
Use sysctl KERN_PROC_SIGTRAMP to retrieve the signal trampoline
location for the native amd64 ABI.  This fixes unwinding over the
signal frame after trampoline was moved to the shared page.

The code would be more correct if using sysctl for the target process
instead of inspecting gdb' own trampoline, but the current change is
least intrusive and currently, we always initialize the native ABI
sysvec first, which means that trampoline location for FreeBSD/amd64
ABI is relatively stable.

Similar change will benefit libunwind.

Analyzed by: avg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agomdoc: sort sections.
Joel Dahl [Tue, 26 Nov 2013 19:51:53 +0000 (19:51 +0000)]
mdoc: sort sections.

10 years agoAdd an kinfo sysctl to retrieve signal trampoline location for the
Konstantin Belousov [Tue, 26 Nov 2013 19:47:09 +0000 (19:47 +0000)]
Add an kinfo sysctl to retrieve signal trampoline location for the
given process.

Note that the correctness of the trampoline length returned for ABIs
which do not use shared page depends on the correctness of the struct
sysvec sv_szsigcodebase member, which will be fixed on as-need basis.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoHide struct pcb definition by #ifdef __amd64__ braces. If cc -m32
Konstantin Belousov [Tue, 26 Nov 2013 19:38:42 +0000 (19:38 +0000)]
Hide struct pcb definition by #ifdef __amd64__ braces.  If cc -m32
compilation results in inclusion of the header, a confict arises due
to savefpu being union for i386, but used as struct in the pcb
definition.  The 32bit code should not need amd64 variant of the
struct pcb anyway.

For struct region_descriptor, use __uint64_t instead of unsigned long,
as the base type for bit-fields.  Unsigned long cannot have width 64
for -m32.

The changes allowed to use sys/sysctl.h for cc -m32.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoFix warnings to not append "No error: 0".
Edward Tomasz Napierala [Tue, 26 Nov 2013 19:14:18 +0000 (19:14 +0000)]
Fix warnings to not append "No error: 0".

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

10 years agoFix a segfault / internal compiler error.
Matthew D Fleming [Tue, 26 Nov 2013 17:11:43 +0000 (17:11 +0000)]
Fix a segfault / internal compiler error.

Among other causes, when gcc throws a warning before parsing any tokens,
the cur_token pointer is at the beginning of malloc'd memory.
Dereferencing cur_token[-1] can cause a segfault.

Code taken from OpenBSD
http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/gcc/libcpp/errors.c
which was a more complete fix than the one I originally coded.

MFC after: 1 week

10 years agoFix macro name in comment.
Sergey Kandaurov [Tue, 26 Nov 2013 15:23:56 +0000 (15:23 +0000)]
Fix macro name in comment.

10 years agoForced commit to note that r258652 is actually:
Pedro F. Giffuni [Tue, 26 Nov 2013 15:18:40 +0000 (15:18 +0000)]
Forced commit to note that r258652 is actually:

gcc: Move conditions before an assert.

It is a bit cleaner to check the conditions before calling the assertion.
It also preserves the style from the rest of the code.
This is just a cosmetical change to match better what both Apple's gcc42
and Android's gcc-4.2.1 do.

10 years agogcc: Altivec register adjustments from Apple.
Pedro F. Giffuni [Tue, 26 Nov 2013 14:58:37 +0000 (14:58 +0000)]
gcc: Altivec register adjustments from Apple.

Obtained from: gcc pre-4.3 (rev. 124763; GPLv2)
MFC after: 3 weeks

10 years agogcc: Altivec register adjustments from Apple.
Pedro F. Giffuni [Tue, 26 Nov 2013 14:52:29 +0000 (14:52 +0000)]
gcc: Altivec register adjustments from Apple.

Obtained from: gcc pre-4.3 (rev. 124763; GPLv2)
MFC after: 3 weeks

10 years agouse saner calculations in should_yield
Andriy Gapon [Tue, 26 Nov 2013 14:00:50 +0000 (14:00 +0000)]
use saner calculations in should_yield

This is based on feedback from bde.

MFC after: 6 days

10 years agozfsboottest: properly specify a library dependency
Andriy Gapon [Tue, 26 Nov 2013 13:46:49 +0000 (13:46 +0000)]
zfsboottest: properly specify a library dependency

MFC after: 4 days

10 years agoStyle changes.
Hans Petter Selasky [Tue, 26 Nov 2013 11:11:24 +0000 (11:11 +0000)]
Style changes.

10 years agofix debug.zfs_flags sysctl description in r258638
Andriy Gapon [Tue, 26 Nov 2013 10:57:09 +0000 (10:57 +0000)]
fix debug.zfs_flags sysctl description in r258638

Pointyhat to: avg
MFC after: 3 days

10 years agoAdd missing static keyword.
Hans Petter Selasky [Tue, 26 Nov 2013 10:53:12 +0000 (10:53 +0000)]
Add missing static keyword.

MFC after: 2 weeks

10 years agoexpose zfs_flags as debug.zfs_flags r/w tunable and sysctl
Andriy Gapon [Tue, 26 Nov 2013 10:46:43 +0000 (10:46 +0000)]
expose zfs_flags as debug.zfs_flags r/w tunable and sysctl

This knob is purposefully hidden under debug.

MFC after: 5 days
Sponsored by: HybridCluster

10 years agoFix build.
Gleb Smirnoff [Tue, 26 Nov 2013 10:34:34 +0000 (10:34 +0000)]
Fix build.

10 years agoMFV r258376: 3964 L2ARC should always compress metadata buffers
Andriy Gapon [Tue, 26 Nov 2013 10:14:23 +0000 (10:14 +0000)]
MFV r258376: 3964 L2ARC should always compress metadata buffers

illumos/illumos-gate@e4be62a2b74a8f09bb669217a1a39eee069b13a1

MFC after: 10 days
Sponsored by: HybridCluster [merge]

10 years agoMFV r255256: 3954 metaslabs continue to load even after hitting zfs_mg_alloc_failure...
Andriy Gapon [Tue, 26 Nov 2013 10:02:02 +0000 (10:02 +0000)]
MFV r255256: 3954 metaslabs continue to load even after hitting zfs_mg_alloc_failure limit

4080 zpool clear fails to clear pool
4081 need zfs_mg_noalloc_threshold

illumos/illumos-gate@22e30981d82a0b6dc89253596ededafae8655e00

MFC after: 10 days
Sponsored by: HybridCluster [merge]

10 years agoMFV r255255: 4045 zfs write throttle & i/o scheduler performance work
Andriy Gapon [Tue, 26 Nov 2013 09:57:14 +0000 (09:57 +0000)]
MFV r255255: 4045 zfs write throttle & i/o scheduler performance work

illumos/illumos-gate@69962b5647e4a8b9b14998733b765925381b727e

Please note the following changes:
- zio_ioctl has lost its priority parameter and now TRIM is executed
  with 'now' priority
- some knobs are gone and some new knobs are added; not all of them are
  exposed as tunables / sysctls yet

MFC after: 10 days
Sponsored by: HybridCluster [merge]

10 years agoMFV r247578: 3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
Andriy Gapon [Tue, 26 Nov 2013 09:45:48 +0000 (09:45 +0000)]
MFV r247578: 3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot

illumos/illumos-gate@ec94d32216ed5705f5176582355cc311cf848e73

MFC after: 9 days
Sponsored by: HybridCluster [merge]

10 years ago734 taskq_dispatch_prealloc() desired
Andriy Gapon [Tue, 26 Nov 2013 09:26:18 +0000 (09:26 +0000)]
734 taskq_dispatch_prealloc() desired

943 zio_interrupt ends up calling taskq_dispatch with TQ_SLEEP
illumos/illumos-gate@5aeb94743e3be0c51e86f73096334611ae3a058e

Essentially FreeBSD taskqueues already operate in a mode that
was added to Illumos with taskq_dispatch_ent change.
We even exposed the superior FreeBSD interface as taskq_dispatch_safe.
Now we just rename taskq_dispatch_safe to taskq_dispatch_ent and
struct struct ostask to taskq_ent_t, so that code differences will be
minimal.

After this change sys/cddl/compat/opensolaris/sys/taskq.h header is no
longer needed.

Note that this commit is not an MFV because the upstream change was not
individually committed to the vendor area.

MFC after: 8 days

10 years agoMention that devd will kldload the driver when the device is connected.
Don Lewis [Tue, 26 Nov 2013 09:14:39 +0000 (09:14 +0000)]
Mention that devd will kldload the driver when the device is connected.

Mention that the automatic mode switch from umass to u3g needed by some
devices does not work unless the driver is loaded before the device is
connected.

MFC after: 1 month

10 years agoopensolaris taskq: some cosmetic changes
Andriy Gapon [Tue, 26 Nov 2013 09:10:01 +0000 (09:10 +0000)]
opensolaris taskq: some cosmetic changes

- drop trailing whitespace
- remove redundant "extern" from function declarations
- remove unused macro

MFC after: 1 week

10 years agoAdd definitions for the microcode TLV flags entry (type 18.)
Adrian Chadd [Tue, 26 Nov 2013 08:58:08 +0000 (08:58 +0000)]
Add definitions for the microcode TLV flags entry (type 18.)

This isn't used anywhere just yet!

Obtained from: Linux iwlwifi

10 years agoAdd a new debug section.
Adrian Chadd [Tue, 26 Nov 2013 08:57:25 +0000 (08:57 +0000)]
Add a new debug section.

10 years agosdt: add support for solaris/illumos style DTRACE_PROBE macros
Andriy Gapon [Tue, 26 Nov 2013 08:49:53 +0000 (08:49 +0000)]
sdt: add support for solaris/illumos style DTRACE_PROBE macros

The new macros are implemented in terms of SDT_PROBE_DEFINE and SDT_PROBE.
Probes defined in this way will appear under SDT provider named "sdt".
Parameter types are exposed via SDT_PROBE_ARGTYPE.
This is something that illumos does not have by default.

This kind of SDT probes is already present in ZFS code, so those probes
will now be available if KDTRACE_HOOKS options is enabled.

A potential future illumos compatibility enhancement is to encode a provider
name as a prefix in a probe name.

Reviewed by: markj
MFC after: 3 weeks
X-MFC after: r258622

10 years agodtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE
Andriy Gapon [Tue, 26 Nov 2013 08:46:27 +0000 (08:46 +0000)]
dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE

In its stead use the Solaris / illumos approach of emulating '-' (dash)
in probe names with '__' (two consecutive underscores).

Reviewed by: markj
MFC after: 3 weeks

10 years agoFix the compat32 sendfile() to be in line with my recent changes.
Adrian Chadd [Tue, 26 Nov 2013 08:32:37 +0000 (08:32 +0000)]
Fix the compat32 sendfile() to be in line with my recent changes.

Reminded by: kib

10 years agoPull in r195558 from upstream clang trunk:
Dimitry Andric [Tue, 26 Nov 2013 08:07:45 +0000 (08:07 +0000)]
Pull in r195558 from upstream clang trunk:

  Fix a SSE2 intrinsics typo

  Full discourse at:

   http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131104/092514.html
   http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-November/068124.html

  Patch by Dimitry Andric and Alexey Dokuchaev!

Reported by: danfe
MFC after: 3 days

10 years agoDragonFly 3.6.0 released.
Sergey Kandaurov [Tue, 26 Nov 2013 08:07:24 +0000 (08:07 +0000)]
DragonFly 3.6.0 released.

10 years agoMention axge(4)
Li-Wen Hsu [Tue, 26 Nov 2013 07:52:40 +0000 (07:52 +0000)]
Mention axge(4)

Approved by: kevlo

10 years agoAlso note to add xhci(4) to kernel configuration to utilize USB 3.0
Li-Wen Hsu [Tue, 26 Nov 2013 07:51:38 +0000 (07:51 +0000)]
Also note to add xhci(4) to kernel configuration to utilize USB 3.0

Approved by: markj

10 years agoTake care to handle the full 16 byte buffer in the get/put routines. Also,
Andreas Tobler [Tue, 26 Nov 2013 05:26:10 +0000 (05:26 +0000)]
Take care to handle the full 16 byte buffer in the get/put routines. Also,
skip the VTERM header once when receiving data from the hypervisor call when
we have a HVTERMPROT connection.

MFC after: 1 week

10 years agoThe Data Byte Count (DBC) field of a Physical Region Descriptor
Peter Grehan [Tue, 26 Nov 2013 03:00:54 +0000 (03:00 +0000)]
The Data Byte Count (DBC) field of a Physical Region Descriptor
Table is 22 bits, with the bit 31 being the interrupt-on-completion
bit.

OpenBSD and UEFI set this bit, resulting in large block i/o lengths
being sent to bhyve and coredumping the process. Fix by masking off
the relevant 22 bits when using the DBC field as a length.

Reviewed by: Zhixiang Yu
Discussed with: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
MFC after: 10.0

10 years agoRefactor out the sendfile copyout in order to make vn_sendfile()
Adrian Chadd [Tue, 26 Nov 2013 02:02:05 +0000 (02:02 +0000)]
Refactor out the sendfile copyout in order to make vn_sendfile()
callable from the kernel.

Right now vn_sendfile() can't be called from anything other than
a syscall handler _and_ return the number of bytes queued.
This simply moves the copyout() to do_sendfile() so that any kernel
code can initiate vn_sendfile() outside of a syscall context.

Tested:

* tiny little sendfile program spitting things out a tcp socket

Sponsored by: Netflix, Inc.

10 years agoThe bssid can change from underneath us, so take a reference before
Adrian Chadd [Tue, 26 Nov 2013 01:30:10 +0000 (01:30 +0000)]
The bssid can change from underneath us, so take a reference before
we fiddle with it.

10 years agoAdjust introduction history.
Sergey Kandaurov [Mon, 25 Nov 2013 23:45:50 +0000 (23:45 +0000)]
Adjust introduction history.
Dump .Dd for this and previous changes.

Discussed with: trasz
MFC after: 3 days

10 years agoFix discrepancy between the IOAPIC ID advertised by firmware tables and the
Neel Natu [Mon, 25 Nov 2013 23:31:00 +0000 (23:31 +0000)]
Fix discrepancy between the IOAPIC ID advertised by firmware tables and the
actual value read by the guest from the device. The IOAPIC ID is now set to
zero in both MPtable/ACPI tables as well as in the ioapic device emulation.

Pointed out by: grehan@

10 years agoiostat: fix extracting TTY statistics from core.
Sergey Kandaurov [Mon, 25 Nov 2013 22:55:47 +0000 (22:55 +0000)]
iostat: fix extracting TTY statistics from core.

MFC after: 1 week

10 years agoConvert over the TCP probes to use mtod() rather than directly
Adrian Chadd [Mon, 25 Nov 2013 22:55:06 +0000 (22:55 +0000)]
Convert over the TCP probes to use mtod() rather than directly
dereferencing m->m_data.

Sponsored by: Netflix, Inc.

10 years agoImport apr-util-1.5.3 from vendor branch (rr258600)
Peter Wemm [Mon, 25 Nov 2013 22:20:34 +0000 (22:20 +0000)]
Import apr-util-1.5.3 from vendor branch (rr258600)
This is a minor bug fix release.

10 years agoImport apr-util 1.5.3
Peter Wemm [Mon, 25 Nov 2013 22:15:47 +0000 (22:15 +0000)]
Import apr-util 1.5.3

10 years agoWhen append-only, immutable or read-only flag is set don't allow for
Pawel Jakub Dawidek [Mon, 25 Nov 2013 21:17:14 +0000 (21:17 +0000)]
When append-only, immutable or read-only flag is set don't allow for
hard links creation. This matches UFS behaviour.

Reported by: Oleg Ginzburg <olevole@olevole.ru>
MFC after: 1 month

10 years agoFix double free().
Pawel Jakub Dawidek [Mon, 25 Nov 2013 20:45:30 +0000 (20:45 +0000)]
Fix double free().

Reported by: Coverity
Coverity CID: 1130048

10 years agoSort messages.
Devin Teske [Mon, 25 Nov 2013 20:37:53 +0000 (20:37 +0000)]
Sort messages.

10 years agoIn vnet_route_uninit(), free some memory that is allocated in vnet_route_init().
Craig Rodrigues [Mon, 25 Nov 2013 20:33:33 +0000 (20:33 +0000)]
In vnet_route_uninit(), free some memory that is allocated in vnet_route_init().

To reproduce the problem:
  (1)  Take a GENERIC kernel config, and add options for: VIMAGE, WITNESS,
       INVARIANTS.
  (2)  Run this command in a loop:
       jail -l -u root -c path=/ name=foo persist vnet && jexec foo ifconfig lo0 127.0.0.1/8 && jail -r foo

       see: http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021280.html
            http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021291.html

This doesn't eliminate all the "Freed UMA keg was not empty" warning messages
on the console, but it helps.

10 years agoAdd missing newline to printf format string.
Devin Teske [Mon, 25 Nov 2013 20:29:26 +0000 (20:29 +0000)]
Add missing newline to printf format string.

10 years agoAdd missing `$' before variable name `pgm'. Unnoticed unless running
Devin Teske [Mon, 25 Nov 2013 20:28:39 +0000 (20:28 +0000)]
Add missing `$' before variable name `pgm'. Unnoticed unless running
parallel concurrent copies of `bsdconfig syscons_ttys'.

10 years agoIn sys/netpfil/ipfw/ip_fw_nat.c:vnet_ipfw_nat_uninit() we call "IPFW_WLOCK(chain);".
Craig Rodrigues [Mon, 25 Nov 2013 20:20:34 +0000 (20:20 +0000)]
In sys/netpfil/ipfw/ip_fw_nat.c:vnet_ipfw_nat_uninit() we call "IPFW_WLOCK(chain);".
This lock gets deleted in sys/netpfil/ipfw/ip_fw2.c:vnet_ipfw_uninit().

Therefore, vnet_ipfw_nat_uninit() *must* be called before vnet_ipfw_uninit(),
but this doesn't always happen, because the VNET_SYSINIT order is the same for both functions.
In sys/net/netpfil/ipfw/ip_fw2.c and sys/net/netpfil/ipfw/ip_fw_nat.c,
IPFW_SI_SUB_FIREWALL == IPFW_NAT_SI_SUB_FIREWALL == SI_SUB_PROTO_IFATTACHDOMAIN
and
IPFW_MODULE_ORDER == IPFW_NAT_MODULE_ORDER

Consequently, if VIMAGE is enabled, and jails are created and destroyed,
the system sometimes crashes, because we are trying to use a deleted lock.

To reproduce the problem:
  (1)  Take a GENERIC kernel config, and add options for: VIMAGE, WITNESS,
       INVARIANTS.
  (2)  Run this command in a loop:
       jail -l -u root -c path=/ name=foo persist vnet && jexec foo ifconfig lo0 127.0.0.1/8 && jail -r foo

       (see http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021280.html )

Fix the problem by increasing the value of IPFW_NAT_SI_SUB_FIREWALL,
so that vnet_ipfw_nat_uninit() runs after vnet_ipfw_uninit().

10 years agoMove the iconv wrapper source from libc_nonshared to libc/iconv so that
Peter Wemm [Mon, 25 Nov 2013 20:17:55 +0000 (20:17 +0000)]
Move the iconv wrapper source from libc_nonshared to libc/iconv so that
it is all in the one place again.  Rename libc/iconv/iconv.c to
bsd_iconv.c. Compile the wrappers into libc.a so that WITHOUT_DYNAMICROOT
works again.

Discussed with: kib (and partly stolen from his patch)

10 years agoAdd missing cards now supported by iwn.
Eitan Adler [Mon, 25 Nov 2013 20:03:57 +0000 (20:03 +0000)]
Add missing cards now supported by iwn.

10 years agoThere is no file under SISSL after license replacement in r258581.
Hiroki Sato [Mon, 25 Nov 2013 19:24:15 +0000 (19:24 +0000)]
There is no file under SISSL after license replacement in r258581.

10 years agoReplace Sun Industry Standards Source License for Sun RPC code with a
Hiroki Sato [Mon, 25 Nov 2013 19:08:38 +0000 (19:08 +0000)]
Replace Sun Industry Standards Source License for Sun RPC code with a
3-clause BSD license as specified by Oracle America, Inc. in 2010.
This license change was approved by Wim Coekaerts, Senior Vice
President, Linux and Virtualization at Oracle Corporation.

10 years agoReplace Sun RPC license in TI-RPC library with a 3-clause BSD license,
Hiroki Sato [Mon, 25 Nov 2013 19:07:44 +0000 (19:07 +0000)]
Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.

10 years agoAdd HPET device emulation to bhyve.
Neel Natu [Mon, 25 Nov 2013 19:04:51 +0000 (19:04 +0000)]
Add HPET device emulation to bhyve.

bhyve supports a single timer block with 8 timers. The timers are all 32-bit
and capable of being operated in periodic mode. All timers support interrupt
delivery using MSI. Timers 0 and 1 also support legacy interrupt routing.

At the moment the timers are not connected to any ioapic pins but that will
be addressed in a subsequent commit.

This change is based on a patch from Tycho Nightingale (tycho.nightingale@pluribusnetworks.com).

10 years agoReplace Sun RPC license in TI-RPC library with a 3-clause BSD license,
Hiroki Sato [Mon, 25 Nov 2013 19:04:36 +0000 (19:04 +0000)]
Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.

10 years agoOnly initialize some mutexes for the default VNET.
Craig Rodrigues [Mon, 25 Nov 2013 18:49:37 +0000 (18:49 +0000)]
Only initialize some mutexes for the default VNET.

In r208160, sctp_it_ctl was made a global variable, across all VNETs.
However, sctp_init() is called for every VNET that is created.  This results
in the same global mutexes which are part of sctp_it_ctl being initialized.  This can result
in crashes if many jails are created.

To reproduce the problem:
  (1)  Take a GENERIC kernel config, and add options for: VIMAGE, WITNESS,
       INVARIANTS.
  (2)  Run this command in a loop:
       jail -l -u root -c path=/ name=foo persist vnet && jexec foo ifconfig lo0 127.0.0.1/8 && jail -r foo

       (see http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021280.html )

Witness will warn about the same mutex being initialized.

Fix the problem by only initializing these mutexes in the default VNET.

10 years agoMFV: removes strict-aliasing warnings from GCC in tcpdump.
Pedro F. Giffuni [Mon, 25 Nov 2013 18:46:08 +0000 (18:46 +0000)]
MFV: removes strict-aliasing warnings from GCC in tcpdump.

Reported by: tinderbox (gjb)
Submitted by: glebius
MFC after: 2 weeks

10 years agopmc(3) does not document a dependency on <sys/types.h> but <pmc.h>
Ryan Stone [Mon, 25 Nov 2013 18:31:13 +0000 (18:31 +0000)]
pmc(3) does not document a dependency on <sys/types.h> but <pmc.h>
requires it, so include it explicitly from <pmc.h>.

MFC after: 1 month

10 years agotcpdump Bring change from upstream.
Pedro F. Giffuni [Mon, 25 Nov 2013 18:28:34 +0000 (18:28 +0000)]
tcpdump Bring change from upstream.

commit 772d6fbcf592209aa1ab1b61714e8ae72a5b1698
Author: Dmitrij Tejblum <tejblum@yandex-team.ru>
Date:   Sun Jun 2 13:48:44 2013 +0400

    Convert some versions of EXTRACT_{16,32,64}BITS() to inline functions.

    It removes the vast majority of strict-aliasing warnings from GCC.

10 years agoChange sysinstall.8 references to bsdinstall.8.
Craig Rodrigues [Mon, 25 Nov 2013 18:11:55 +0000 (18:11 +0000)]
Change sysinstall.8 references to bsdinstall.8.

Submitted by: skreuzer

10 years agoImport svn-1.8.5. This contains a user-visible fix for svn:externals
Peter Wemm [Mon, 25 Nov 2013 17:52:16 +0000 (17:52 +0000)]
Import svn-1.8.5.  This contains a user-visible fix for svn:externals
handling (there are no svn:externals in freebsd repo), and two security
fixes for modules that we don't build for the apache http server stack.

10 years agoImport subversion-1.8.5
Peter Wemm [Mon, 25 Nov 2013 17:44:04 +0000 (17:44 +0000)]
Import subversion-1.8.5

10 years agoReplace Sun RPC license with a 3-clause BSD license, with the explicit
Hiroki Sato [Mon, 25 Nov 2013 16:44:02 +0000 (16:44 +0000)]
Replace Sun RPC license with a 3-clause BSD license, with the explicit
permission of Sun Microsystems in 2009.

10 years agodrm: Fix build with gcc, broken with r258549
Jean-Sébastien Pédron [Mon, 25 Nov 2013 15:01:59 +0000 (15:01 +0000)]
drm: Fix build with gcc, broken with r258549

The code was easier to read without __DECONST and clang didn't report
any error. I thought the cast was enough...

MFC after: 3 days
X-MFC-With: r258549

10 years agoGenerate plain sh test programs from a source file.
Julio Merino [Mon, 25 Nov 2013 13:30:06 +0000 (13:30 +0000)]
Generate plain sh test programs from a source file.

Instead of assuming that plain sh test programs exist in the source
tree in their final form and are marked as executable, generate them
from a list of sources.

By default, just assume that the source file for a program P is P.sh
but allow the caller to customize the inputs.  Similarly, also allow
the caller to apply sed(1) replacements on the output.  These will
both be useful in hooking existing test code from tools/regression/
into the test suite.

Approved by: rpaulo (mentor)

10 years agoInstall plain.test.mk.
Julio Merino [Mon, 25 Nov 2013 13:28:40 +0000 (13:28 +0000)]
Install plain.test.mk.

This was missed when this file was first imported.  Its atf.test.mk
counterpart is already being installed and these are necessary if we
want "make" within the source tree (not via "buildworld") to work.

Approved by: rpaulo (mentor)

10 years agoDo not create pkg.conf, as it is not necessary anymore and packagesite is deprecated
Baptiste Daroussin [Mon, 25 Nov 2013 11:31:42 +0000 (11:31 +0000)]
Do not create pkg.conf, as it is not necessary anymore and packagesite is deprecated

Reported by: glebius
MFC after: 3 days

10 years agodrm: Dereference pointers given to qsort_r()'s cmp callback
Jean-Sébastien Pédron [Mon, 25 Nov 2013 11:15:51 +0000 (11:15 +0000)]
drm: Dereference pointers given to qsort_r()'s cmp callback

drm_le_cmp() (qsort_r()'s callback) receives pointers to elements in the
array passed to qsort_r(), not the elements themselves.

Before this fix, the use of qsort_r() shuffled the array, not sorted it,
because the compare callback accessed random memory locations, not the
expected elements.

This bug triggered an infinite loop in KDE/xserver:

    1. KDE has a kded module called "randrmonitor" which queries xserver
       for current monitors at startup and then listens to RandR
       notifications from xserver.

    2. xserver handles the query from "randrmonitor" by polling the
       video device using the "drm_mode_getconnector()" ioctl. This
       ioctl returns a list of connectors and, for those with a
       connected monitor, the available modes. Each modes list is sorted
       by the kernel before returning. When xserver gets the connectors
       list, it sorts the modes lists again.

       In the case of this bug, when two modes are equal (in xserver's
       compare function PoV), their order is kept stable (ie. the
       kernel order is kept for those two modes). And because the list
       was shuffled by the kernel, the order of two equal modes was
       frequently changed in the final modes list in xserver.

    3. xserver compares the returned connectors list with the list
       obtained earlier. In particular, it compares the sorted
       modes lists for each connector. If a property of a connector
       changes (eg. modes), xserver sends a "RRNotify_OutputChange"
       notification.

       Because of the change of order between equal modes, xserver sent
       a notification after each polling of the connectors.

    4. "randrmonitor" receives a notification, triggered by its query. The
       notification doesn't contain the new connectors list, therefore, it
       asks for the new list using the same function: go back to step #2.

MFC after: 3 days

10 years agoEnable reset mechanism for rk3188.
Ganbold Tsagaankhuu [Mon, 25 Nov 2013 11:02:58 +0000 (11:02 +0000)]
Enable reset mechanism for rk3188.

Approved by: ray@

10 years agoAdd clock frequency for rk3188 watchdog.
Ganbold Tsagaankhuu [Mon, 25 Nov 2013 11:02:11 +0000 (11:02 +0000)]
Add clock frequency for rk3188 watchdog.
Whilst here, replace "clocks" to "clock-frequency".

Approved by: ray@