]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoAt great personal risk, change the default for LIB32 from yes to no. As
peter [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.
gjb [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.
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
pluknet [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.
glebius [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.
delphij [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
kib [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 [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
kib [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
kib [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".
trasz [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.
mdf [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.
pluknet [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:
pfg [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.
pfg [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.
pfg [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
avg [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
avg [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.
hselasky [Tue, 26 Nov 2013 11:11:24 +0000 (11:11 +0000)]
Style changes.

10 years agofix debug.zfs_flags sysctl description in r258638
avg [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.
hselasky [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
avg [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.
glebius [Tue, 26 Nov 2013 10:34:34 +0000 (10:34 +0000)]
Fix build.

10 years agoMFV r258376: 3964 L2ARC should always compress metadata buffers
avg [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...
avg [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
avg [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
avg [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
avg [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.
truckman [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
avg [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 [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 [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
avg [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
avg [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 [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:
dim [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.
pluknet [Tue, 26 Nov 2013 08:07:24 +0000 (08:07 +0000)]
DragonFly 3.6.0 released.

10 years agoMention axge(4)
lwhsu [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
lwhsu [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,
andreast [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
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 [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 [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.
pluknet [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 [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.
pluknet [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 [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 [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 agoWhen append-only, immutable or read-only flag is set don't allow for
pjd [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().
pjd [Mon, 25 Nov 2013 20:45:30 +0000 (20:45 +0000)]
Fix double free().

Reported by: Coverity
Coverity CID: 1130048

10 years agoSort messages.
dteske [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().
rodrigc [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.
dteske [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
dteske [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);".
rodrigc [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 [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.
eadler [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.
hrs [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
hrs [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,
hrs [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 [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,
hrs [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.
rodrigc [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.
pfg [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>
rstone [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 agoChange sysinstall.8 references to bsdinstall.8.
rodrigc [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 [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 agoReplace Sun RPC license with a 3-clause BSD license, with the explicit
hrs [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
dumbbell [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.
jmmv [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.
jmmv [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
bapt [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
dumbbell [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 [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 [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@

10 years agoAdd watchdog driver for rk3188.
ganbold [Mon, 25 Nov 2013 11:01:19 +0000 (11:01 +0000)]
Add watchdog driver for rk3188.

Approved by: ray@

10 years agoComply to the XHCI specification. Certain input context fields should
hselasky [Mon, 25 Nov 2013 10:58:02 +0000 (10:58 +0000)]
Comply to the XHCI specification. Certain input context fields should
always be zero.

MFC after: 1 week

10 years ago- For kernel compiled only with KDTRACE_HOOKS and not any lock debugging
attilio [Mon, 25 Nov 2013 07:38:45 +0000 (07:38 +0000)]
- For kernel compiled only with KDTRACE_HOOKS and not any lock debugging
  option, unbreak the lock tracing release semantic by embedding
  calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined
  version of the releasing functions for mutex, rwlock and sxlock.
  Failing to do so skips the lockstat_probe_func invokation for
  unlocking.
- As part of the LOCKSTAT support is inlined in mutex operation, for
  kernel compiled without lock debugging options, potentially every
  consumer must be compiled including opt_kdtrace.h.
  Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the
  dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES
  is linked there and it is only used as a compile-time stub [0].

[0] immediately shows some new bug as DTRACE-derived support for debug
in sfxge is broken and it was never really tested.  As it was not
including correctly opt_kdtrace.h before it was never enabled so it
was kept broken for a while.  Fix this by using a protection stub,
leaving sfxge driver authors the responsibility for fixing it
appropriately [1].

Sponsored by: EMC / Isilon storage division
Discussed with: rstone
[0] Reported by: rstone
[1] Discussed with: philip

10 years agoAdd ICONV_{GET,SET}_ILSEQ_INVALID iconvctl. GNU iconv returns EILSEQ
hrs [Mon, 25 Nov 2013 01:26:06 +0000 (01:26 +0000)]
Add ICONV_{GET,SET}_ILSEQ_INVALID iconvctl.  GNU iconv returns EILSEQ
when there is an invalid character in the output codeset while it is
valid in the input.  However, POSIX requires iconv() to perform an
implementation-defined conversion on the character.  So, Citrus iconv converts
such a character to a special character which means it is invalid in the
output codeset.

This is not a problem in most cases but some software like libxml2 depends
on GNU's behavior to determine if a character is output as-is or another form
such as a character entity (&#NNN;).

10 years agosh: Make <&0 disable the </dev/null implicit in a background command.
jilles [Sun, 24 Nov 2013 23:12:13 +0000 (23:12 +0000)]
sh: Make <&0 disable the </dev/null implicit in a background command.

Although <&0 does nothing, it is a redirection affecting standard input and
should therefore disable the </dev/null redirection implicit in a background
command.

10 years agoFix typo in comment.
gavin [Sun, 24 Nov 2013 22:53:49 +0000 (22:53 +0000)]
Fix typo in comment.

10 years agosh: Add more tests for the </dev/null implicit in a background command.
jilles [Sun, 24 Nov 2013 22:45:49 +0000 (22:45 +0000)]
sh: Add more tests for the </dev/null implicit in a background command.

10 years agoplatform_devmap_init() was renamed initarm_devmap_init() in r257669, update
gavin [Sun, 24 Nov 2013 22:01:15 +0000 (22:01 +0000)]
platform_devmap_init() was renamed initarm_devmap_init() in r257669, update
comments to match.

10 years agolibcpp: Keep a record of changes from upstream GCC (pre-43).
pfg [Sun, 24 Nov 2013 20:54:52 +0000 (20:54 +0000)]
libcpp: Keep a record of changes from upstream GCC (pre-43).

This makes it easier to track the changes in the rare event of the code
being distributed without access to version control.

MFC after: 3 weeks

10 years agoRecent versions of U-Boot require us to also backup and restore r9 for API
andrew [Sun, 24 Nov 2013 20:33:38 +0000 (20:33 +0000)]
Recent versions of U-Boot require us to also backup and restore r9 for API
calls to work.

10 years agogcc: Missing makefile changes for r258501.
pfg [Sun, 24 Nov 2013 04:08:47 +0000 (04:08 +0000)]
gcc: Missing makefile changes for r258501.

pointyhat: me

10 years agoSave and restore the trap vectors when doing OF calls on pSeries machines.
andreast [Sat, 23 Nov 2013 18:58:17 +0000 (18:58 +0000)]
Save and restore the trap vectors when doing OF calls on pSeries machines.

It turned out that on pSeries machines the call into OF modified the trap
vectors and this made further behaviour unpredictable.

With this commit I'm now able to boot multi user on a network booted
environment on my IntelliStation 285. This is a POWER5+ machine.

Discussed with: nwhitehorn
MFC after: 1 week

10 years agoLimit the large page size to 16MB for now.
andreast [Sat, 23 Nov 2013 18:52:14 +0000 (18:52 +0000)]
Limit the large page size to 16MB for now.

MFC after: 1 week

10 years agoGet rid of the CONCAT macro.
andreast [Sat, 23 Nov 2013 18:50:43 +0000 (18:50 +0000)]
Get rid of the CONCAT macro.

10 years agogcc: Bring updates from Google's enhanced gcc-4.2.1.
pfg [Sat, 23 Nov 2013 18:32:53 +0000 (18:32 +0000)]
gcc: Bring updates from Google's enhanced gcc-4.2.1.

Google released and enhanced version of gcc-4.2.1 plus their local
patches for Android[1].

The patches are owned by Google and the license hasn't been changed
from  the original GPLv2. We are only bringing a subset of the
available patches that may be helpful in FreeBSD. Changes specific
to android are not included.

From the README.google file[1].

Patches applied to google_vendor_src_branch/gcc/gcc-4.2.1:

gcc/Makefile.in
gcc/c-common.c
gcc/c-common.h
gcc/c-opts.c
gcc/c-typeck.c
gcc/cp/typeck.c
gcc/doc/invoke.texi
gcc/flags.h
gcc/opts.c
gcc/tree-flow.h
gcc/tree-ssa-alias-warnings.c
gcc/tree-ssa-alias.c

 Backport of -Wstrict-aliasing from mainline.
  Silvius Rus <rus@google.com>

gcc/coverage.c:
  Patch coverage_checksum_string for PR 25351.
  Seongbae Park <spark@google.com>
  Not yet submitted to FSF.

gcc/c-opts.c
gcc/c-ppoutput.c
gcc/c.opt
gcc/doc/cppopts.texi
libcpp/Makefile.in
libcpp/directives-only.c
libcpp/directives.c
libcpp/files.c
libcpp/include/cpplib.h
libcpp/init.c
libcpp/internal.h
libcpp/macro.c
  Support for -fdirectives-only.
  Ollie Wild <aaw@google.com>.
  Submitted to FSF but not yet approved.

libstdc++-v3/include/ext/hashtable.h
  http://b/742065
  http://b/629994
  Reduce min size of hashtable for hash_map, hash_set from 53 to 5

libstdc++-v3/include/ext/hashtable.h
  http://b/629994
  Do not iterate over buckets if hashtable is empty.

gcc/common.opt
gcc/doc/invoke.texi
gcc/flags.h
gcc/gimplify.c
gcc/opts.c
  Add Saito's patch for -finstrument-functions-exclude-* options.

gcc/common.opt
gcc/doc/invoke.texi
gcc/final.c
gcc/flags.h
gcc/opts.c
gcc/testsuite/gcc.dg/Wframe-larger-than.c
  Add a new flag -Wframe-larger-than- which enables a new warning
  when a frame size of a function is larger than specified.
  This patch hasn't been integrated into gcc mainline yet.

gcc/tree-vrp.c
  Add a hack to avoid using ivopts information for pointers starting
  at constant values.

Reference:

[1]
https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.2.1/

Obtained from: Google Inc.
MFC after: 3 weeks

10 years agoIf check_deferred_signal() execution needs binding of PLT symbol,
kib [Sat, 23 Nov 2013 15:48:17 +0000 (15:48 +0000)]
If check_deferred_signal() execution needs binding of PLT symbol,
unlocking the rtld bind lock results in the processing of ast and
recursing into the check_deferred_signal().  Nested execution of
check_deferred_signal() delivers the signal to user code and clears
si_signo.  On return, top-level check_deferred_signal() frame
continues delivering the same signal one more time, but now with zero
si_signo.

Fix this by adding a flag to indicate that deferred delivery is
running, so check_deferred_signal() should avoid doing anything. Since
user signal handler is allowed to modify the passed machine context to
make return from the signal handler to cause arbitrary jump, or do
longjmp(). For this case, also clear the flag in thr_sighandler(),
since kernel signal delivery means that nested delivery code should
not run right now.

Reported by: Vitaly Magerya <vmagerya@gmail.com>
Reviewed by: davidxu, jilles
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoWhen purging per-CPU UMA caches do not return empty buckets into the global
mav [Sat, 23 Nov 2013 13:42:56 +0000 (13:42 +0000)]
When purging per-CPU UMA caches do not return empty buckets into the global
full bucket cache to not trigger assertion if allocation happen before that
global cache get purged.

10 years agoMFreleng/8.4 r251256 (by hrs):
mav [Sat, 23 Nov 2013 11:46:13 +0000 (11:46 +0000)]
MFreleng/8.4 r251256 (by hrs):
Update description of logical CPU handling in the latest releases and
remove obsolete sysctl variable machdep.hlt_logical_cpus.

MFC after: 3 days

10 years agoAdd an ioctl to assert and deassert an ioapic pin atomically. This will be used
neel [Sat, 23 Nov 2013 03:56:03 +0000 (03:56 +0000)]
Add an ioctl to assert and deassert an ioapic pin atomically. This will be used
to inject edge triggered legacy interrupts into the guest.

Start using the new API in device models that use edge triggered interrupts:
viz. the 8254 timer and the LPC/uart device emulation.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)

10 years agofix broken style(9) in r258399
jmg [Sat, 23 Nov 2013 00:28:18 +0000 (00:28 +0000)]
fix broken style(9) in r258399

Pointed out by: brd

10 years agosh: Add tests for the </dev/null implicit in a background command.
jilles [Fri, 22 Nov 2013 21:50:13 +0000 (21:50 +0000)]
sh: Add tests for the </dev/null implicit in a background command.

10 years agoRemove __FreeBSD__ ifdefs.
glebius [Fri, 22 Nov 2013 20:13:32 +0000 (20:13 +0000)]
Remove __FreeBSD__ ifdefs.

10 years agoRewrite usage() so that its source code resembles what is printed.
glebius [Fri, 22 Nov 2013 20:11:17 +0000 (20:11 +0000)]
Rewrite usage() so that its source code resembles what is printed.

10 years agoThe DIOCKILLSRCNODES operation was implemented with O(m*n) complexity,
glebius [Fri, 22 Nov 2013 19:22:26 +0000 (19:22 +0000)]
The DIOCKILLSRCNODES operation was implemented with O(m*n) complexity,
where "m" is number of source nodes and "n" is number of states. Thus,
on heavy loaded router its processing consumed a lot of CPU time.

Reimplement it with O(m+n) complexity. We first scan through source
nodes and disconnect matching ones, putting them on the freelist and
marking with a cookie value in their expire field. Then we scan through
the states, detecting references to source nodes with a cookie, and
disconnect them as well. Then the freelist is passed to pf_free_src_nodes().

In collaboration with: Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>
PR: kern/176763
Sponsored by: InnoGames GmbH
Sponsored by: Nginx, Inc.

10 years agoTo support upcoming changes change internal API for source node handling:
glebius [Fri, 22 Nov 2013 19:16:34 +0000 (19:16 +0000)]
To support upcoming changes change internal API for source node handling:
- Removed pf_remove_src_node().
- Introduce pf_unlink_src_node() and pf_unlink_src_node_locked().
  These function do not proceed with freeing of a node, just disconnect
  it from storage.
- New function pf_free_src_nodes() works on a list of previously
  disconnected nodes and frees them.
- Utilize new API in pf_purge_expired_src_nodes().

In collaboration with: Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>

Sponsored by: InnoGames GmbH
Sponsored by: Nginx, Inc.