]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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.

10 years agoAdd missing 'extern'.
glebius [Fri, 22 Nov 2013 19:02:22 +0000 (19:02 +0000)]
Add missing 'extern'.

10 years agoFix off by ones when scanning source nodes hash.
glebius [Fri, 22 Nov 2013 18:57:27 +0000 (18:57 +0000)]
Fix off by ones when scanning source nodes hash.

Sponsored by: Nginx, Inc.

10 years agoEliminate redundant information about the host cpu in bhyve's KTR trace points.
neel [Fri, 22 Nov 2013 18:57:22 +0000 (18:57 +0000)]
Eliminate redundant information about the host cpu in bhyve's KTR trace points.
This is always tracked by ktr(4) and can be displayed using the "-c" option
of ktrdump(8).

Discussed with: grehan

10 years agoStyle: don't compare unsigned <= 0.
glebius [Fri, 22 Nov 2013 18:54:06 +0000 (18:54 +0000)]
Style: don't compare unsigned <= 0.

Sponsored by: Nginx, Inc.

10 years agoTeach acpidump(8) to display the 'Flags' field in the HPET Description Table.
neel [Fri, 22 Nov 2013 18:53:54 +0000 (18:53 +0000)]
Teach acpidump(8) to display the 'Flags' field in the HPET Description Table.

Reviewed by: jhb@

10 years agoRefactor i386 startup SMAP parsing
emaste [Fri, 22 Nov 2013 18:31:07 +0000 (18:31 +0000)]
Refactor i386 startup SMAP parsing

This is a port from amd64 of r258436, and is intended to make diffs
(against amd64 and for future UEFI work) easier to review.

Reviewed by: jhb@
Sponsored by: The FreeBSD Foundation

10 years agoRevert r258455 for now, as it apparently causes miscompilation in some
dim [Fri, 22 Nov 2013 17:54:53 +0000 (17:54 +0000)]
Revert r258455 for now, as it apparently causes miscompilation in some
situations.  Until this is fully resolved, the X.org workaround in ports
still needs to take place.

10 years agoDon't abort SMAP processing after an entry of length 0
emaste [Fri, 22 Nov 2013 14:56:10 +0000 (14:56 +0000)]
Don't abort SMAP processing after an entry of length 0

Length 0 is not special and should just be skipped.  This is the same
behaviour as i386.

Discussed with: jhb@
Sponsored by: The FreeBSD Foundation

10 years ago- Purge one more reference to ad(4)[1].
pluknet [Fri, 22 Nov 2013 12:09:15 +0000 (12:09 +0000)]
- Purge one more reference to ad(4)[1].
- NSWAPDEV limit has gone.

Noticed by: Sergey V. Dyatko [1]
MFC after: 1 week

10 years agoadd a counter on the struct mq (a queue of mbufs),
luigi [Fri, 22 Nov 2013 05:02:37 +0000 (05:02 +0000)]
add a counter on the struct mq (a queue of mbufs),
and add a block for userspace compiling.

10 years agodisable some ipfw match options when compiling in userspace
luigi [Fri, 22 Nov 2013 05:01:38 +0000 (05:01 +0000)]
disable some ipfw match options when compiling in userspace

10 years agomake this code compile in userspace on OSX
luigi [Fri, 22 Nov 2013 05:00:18 +0000 (05:00 +0000)]
make this code compile in userspace on OSX

10 years agomore support for userspace compiling of this code:
luigi [Fri, 22 Nov 2013 04:59:17 +0000 (04:59 +0000)]
more support for userspace compiling of this code:
emulate the uma_zone for dynamic rules.

10 years agomake ipfw_check_packet() and ipfw_check_frame() public,
luigi [Fri, 22 Nov 2013 04:57:50 +0000 (04:57 +0000)]
make ipfw_check_packet() and ipfw_check_frame() public,
so they can be used in the userspace version of ipfw/dummynet
(normally using netmap for the I/O path).

This is the first of a few commits to ease compiling the
ipfw kernel code in userspace.

10 years agoImprove network device scanning in the netdev module. First, make it use the
dteske [Fri, 22 Nov 2013 00:32:32 +0000 (00:32 +0000)]
Improve network device scanning in the netdev module. First, make it use the
`device.subr' framework (improving performane and reducing sub-shells). Next
improve the `device.subr' framework itself. Make use of the `flags' device
struct member for network interfaces to indicate if an interface is Active,
Wired Ethernet, or 802.11 Wireless. Functions have been added to make checks
against the `flags' bit-field quick and efficient. Last, add function for
rescanning the network to update the device registers. Remove an unnecessary
local (ifn) while we're here (use already provided local `if').

10 years agoFix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is
brooks [Fri, 22 Nov 2013 00:06:11 +0000 (00:06 +0000)]
Fix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is
nmtree.

The mtree output used by mergemaster in this case was clearly not meant for
computer consumption and an approach based on -f <file1> -f <file2> would
probalby be a better idea, but this is a minimal change.

MFC after: 3 days
X-MFC-with: r258437

10 years agoPull in r195318 from upstream llvm trunk:
dim [Thu, 21 Nov 2013 23:09:07 +0000 (23:09 +0000)]
Pull in r195318 from upstream llvm trunk:

  The basic problem is that some mainstream programs cannot deal with the way
  clang optimizes tail calls, as in this example:

  int foo(void);
  int bar(void) {
  return foo();
  }

  where the call is transformed to:

   calll .L0$pb
  .L0$pb:
   popl  %eax
  .Ltmp0:
   addl  $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
   movl  foo@GOT(%eax), %eax
   popl  %ebp
   jmpl  *%eax                   # TAILCALL

  However, the GOT references must all be resolved at dlopen() time, and so this
  approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which
  usually populates the PLT with stubs that perform the actual resolving.

  This patch changes X86TargetLowering::LowerCall() to skip tail call
  optimization, if the called function is a global or external symbol.

This fixes problems with loading X.org driver modules, which could occur
when X.org was compiled on i386 with tailcall optimization on, for which
ports r312583 was committed as a workaround.  After this change, the
workaround can be removed.

MFC after: 3 days

10 years agoReplace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and
andreast [Thu, 21 Nov 2013 22:31:18 +0000 (22:31 +0000)]
Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and
get rid of the __CONCAT and CNAME macros.

Reviewed by: bde, kib

10 years agoHave the GPT probe return a lower priority when the MBR is not a PMBR
marcel [Thu, 21 Nov 2013 22:02:59 +0000 (22:02 +0000)]
Have the GPT probe return a lower priority when the MBR is not a PMBR
The purpose of the PMBR is to have the disk appear in use to GPT
unaware utilities (like fdisk).  However, if the PMBR has been changed
by a GPT unaware utlity then we must assume that this was deliberate
(as it involved removal of the special slice) and we should not treat
the unmodified GPT-specific sectors as being valid.  By lowering the
probe priority in that case, the MBR scheme will take precedence and
the kernel will end up using the MBR and not the GPT. We will still
use the GPT if the kernel does not support the MBR scheme.

10 years agoIntroduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
andreast [Thu, 21 Nov 2013 21:25:58 +0000 (21:25 +0000)]
Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
CONCAT macros in SYS.h.

Reviewed by: bde, kib

10 years agoAdd static where appropriate.
eadler [Thu, 21 Nov 2013 21:19:01 +0000 (21:19 +0000)]
Add static where appropriate.
Sync with some of DragonflyBSD's latest cleanups

Reviewed by: mjg

10 years agoFix cross compilation after r258428.
andreast [Thu, 21 Nov 2013 21:05:11 +0000 (21:05 +0000)]
Fix cross compilation after r258428.

Reviewed by: pfg

10 years agoCatch up with OpenPAM Nummularia.
pluknet [Thu, 21 Nov 2013 20:43:43 +0000 (20:43 +0000)]
Catch up with OpenPAM Nummularia.

This fixes libpam for build32 target to dlopen() pam libraries in /usr/lib32.

Reviewed by: des (a while ago)
MFC after: 1 week

10 years agoKill ARM_VFP_SUPPORT, it's been removed some time ago.
cognet [Thu, 21 Nov 2013 20:39:53 +0000 (20:39 +0000)]
Kill ARM_VFP_SUPPORT, it's been removed some time ago.

10 years agocxgbe(4): update the internal list of device features.
np [Thu, 21 Nov 2013 20:07:58 +0000 (20:07 +0000)]
cxgbe(4): update the internal list of device features.

MFC after: 3 days

10 years agomdoc: remove EOL whitespace.
joel [Thu, 21 Nov 2013 19:44:48 +0000 (19:44 +0000)]
mdoc: remove EOL whitespace.

10 years agof_die() (see `bsdconfig includes -dF die') uses a dialog box (and has been
dteske [Thu, 21 Nov 2013 19:43:45 +0000 (19:43 +0000)]
f_die() (see `bsdconfig includes -dF die') uses a dialog box (and has been
documented as such; I just forgot). These utilities are command-line only
and as such should stick to either using f_die without arguments or printf)

10 years agoFix reference to ioctl(2).
pluknet [Thu, 21 Nov 2013 19:31:57 +0000 (19:31 +0000)]
Fix reference to ioctl(2).

10 years agoSync with NetBSD. The funtional change is to make the output when
brooks [Thu, 21 Nov 2013 19:29:41 +0000 (19:29 +0000)]
Sync with NetBSD.  The funtional change is to make the output when
comparing a directory to an mtree file more compatible with fmtree when
FreeBSD 9 compatiblity mode is on.  This output is clearly intended for
humans not computers, but some tools such as mergemaster's -U option rely
on it.

MFC after: 3 days

10 years agoRefactor amd64 startup SMAP parsing
emaste [Thu, 21 Nov 2013 19:20:08 +0000 (19:20 +0000)]
Refactor amd64 startup SMAP parsing

Extracted from the projects/uefi branch, this change is a reasonable
cleanup and will reduce the diffs to review when bringing in the
UEFI work.

Reviewed by: kib@
Sponsored by: The FreeBSD Foundation

10 years agoUpdate text related to Intel CPU support and Apple hardware support.
rodrigc [Thu, 21 Nov 2013 19:04:59 +0000 (19:04 +0000)]
Update text related to Intel CPU support and Apple hardware support.

Submitted by: skreuzer

10 years agoUpdate copyrights
rodrigc [Thu, 21 Nov 2013 19:00:21 +0000 (19:00 +0000)]
Update copyrights

Submitted by: skreuzer

10 years agoDisable amd64 boot time memory test by default
emaste [Thu, 21 Nov 2013 18:37:11 +0000 (18:37 +0000)]
Disable amd64 boot time memory test by default

The page presence memory test takes a long time on large memory systems
and has little value on contemporary amd64 hardware.

Sponsored by: The FreeBSD Foundation

10 years agoRemove unused line -- cruft left over from SVN r258360.
dteske [Thu, 21 Nov 2013 17:49:56 +0000 (17:49 +0000)]
Remove unused line -- cruft left over from SVN r258360.

10 years agolibstdc++: merge non-abi changes from Apple's developer tools
pfg [Thu, 21 Nov 2013 16:44:36 +0000 (16:44 +0000)]
libstdc++: merge non-abi changes from Apple's developer tools

Take some changes from Apple's Developer Tools 4.0 [1]:

block.patch
emergency-buffer-reduction.patch
test_cleanup.patch

vector_copy_no_alloc.patch
problem/6473222 copy-constructing a std::vector from an
empty std::vector calls malloc

2008-10-27  Howard Hinnant
stl_tree_system_header.patch
Added #pragma GCC system_header to stl_tree.h.
copy_doc.patch
Corrected documentation concerning copy in stl_algobase.h.
string_compare.patch
Fixed basic_string.h, basic_string.tcc, incorrect 64bit to
32bit narrowing.

Reference:

[1] http://opensource.apple.com/source/libstdcxx/libstdcxx-39/patches-4.2.1/

Obtained from: Apple
MFC after: 1 month

10 years agogcc: another round of merges from the gcc pre-43 branch.
pfg [Thu, 21 Nov 2013 16:38:57 +0000 (16:38 +0000)]
gcc: another round of merges from the gcc pre-43 branch.

Bring The following revisions from the gcc43 branch[1]:

118360, 118361, 118363, 118576, 119820,
123906, 125246, and 125721.

They all have in common that the were merged long ago
into Apple's gcc and should help improve the general
quality of the compiler and make it easier to bring
new features from Apple's gcc42.

For details please review the additions to the files:
gcc/ChangeLog.gcc43
gcc/cp/ChangeLog.gcc43 (new, adds previous revisions)

Reference:
[1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700

Obtained from: gcc pre4.3 (GPLv2) branch
MFC after: 3 weeks

10 years agoFor PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the
nwhitehorn [Thu, 21 Nov 2013 15:41:52 +0000 (15:41 +0000)]
For PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the
ibm,dma-window properties. This is especially a concern when
#ibm,dma-address-cells is not specified and we have to use the regular
#address-cells property.

MFC after: 1 week

10 years agolibexecinfo: Include terminating null in byte count
emaste [Thu, 21 Nov 2013 14:12:36 +0000 (14:12 +0000)]
libexecinfo: Include terminating null in byte count

Otherwise, a formatted string with a strlen equal to the remaining
buffer space would have the last character omitted (because vsnprintf
always null-terminates), and later the assert in backtrace_symbols_fmt
would fail.

MFC after: 3 days
Sponsored by: DARPA, AFRL

10 years agoUnbreak compilation with GCC.
gber [Thu, 21 Nov 2013 09:19:14 +0000 (09:19 +0000)]
Unbreak compilation with GCC.

10 years agoRemove stale comment. The PID provider is handled elsewhere already.
jhibbits [Thu, 21 Nov 2013 06:54:28 +0000 (06:54 +0000)]
Remove stale comment.  The PID provider is handled elsewhere already.

10 years agoQuote the interface name for good measure.
dteske [Thu, 21 Nov 2013 03:22:13 +0000 (03:22 +0000)]
Quote the interface name for good measure.

10 years agoCall cpu_setup() from the initarm() routine on platforms that don't use
ian [Thu, 21 Nov 2013 01:08:10 +0000 (01:08 +0000)]
Call cpu_setup() from the initarm() routine on platforms that don't use
the common FDT-aware initarm() in arm/machdep.c.

Pointed out by:      cognet
Pointy hat to:      ian

10 years agoRevert SVN r257830 -- that feature was annoying and was removed long ago.
dteske [Thu, 21 Nov 2013 00:54:26 +0000 (00:54 +0000)]
Revert SVN r257830 -- that feature was annoying and was removed long ago.
Was a momentary memory lapse induced by old code that was lying in my ~/bin

10 years agoIn pmap_unmapdev(), remember the size, and use that as an argument to
cognet [Wed, 20 Nov 2013 23:06:54 +0000 (23:06 +0000)]
In pmap_unmapdev(), remember the size, and use that as an argument to
kva_free(), or we'd end up always passing it a size of 0, and for some
strange reason it doesn't seem to like it.

10 years agoUpdate function description for API tool:
dteske [Wed, 20 Nov 2013 22:12:21 +0000 (22:12 +0000)]
Update function description for API tool:
bsdconfig includes -dF f_validate_hostname

10 years agoMake `-d' implicitly enable `-f' for simplification.
dteske [Wed, 20 Nov 2013 22:11:42 +0000 (22:11 +0000)]
Make `-d' implicitly enable `-f' for simplification.

10 years agofix white space...
jmg [Wed, 20 Nov 2013 21:21:29 +0000 (21:21 +0000)]
fix white space...

MFC after: 1 week

10 years agofix a use after free, jsegdep_merge will free wk, avoid the next check...
jmg [Wed, 20 Nov 2013 21:16:53 +0000 (21:16 +0000)]
fix a use after free, jsegdep_merge will free wk, avoid the next check...

CID: 1006098
Sponsored by: Imaginary Forces
Reviewed by: mckusick
MFC after: 1 week