]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years ago- Remove debugging from GENERIC* kernel configurations
gjb [Fri, 8 Jul 2016 00:22:14 +0000 (00:22 +0000)]
- Remove debugging from GENERIC* kernel configurations
- Enable MALLOC_PRODUCTION
- Default dumpdev=NO
- Remove UPDATING entry regarding debugging features

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoCopy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
gjb [Fri, 8 Jul 2016 00:04:57 +0000 (00:04 +0000)]
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoDo not use -fformat-extensions with non-base versions of gcc
ngie [Thu, 7 Jul 2016 22:44:23 +0000 (22:44 +0000)]
Do not use -fformat-extensions with non-base versions of gcc

Ports versions of gcc do not have -fformat-extensions support.

This unbreaks compiling the kernel/modules with non-base gcc (4.8,
5.0, etc) if MK_FORMAT_EXTENSIONS=yes (the default).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7150
Reviewed by: bdrewery
Sponsored by: EMC / Isilon Storage Division

7 years agoFix ahci(4) driver attach to controller with 32 ports.
mav [Thu, 7 Jul 2016 22:10:10 +0000 (22:10 +0000)]
Fix ahci(4) driver attach to controller with 32 ports.

Incorrect sign expansion in variables that supposed to be a bit fields
caused infinite loop.  Fixing this allows system properly detect maximal
possible 32 devices configured on AHCI HBA of BHyVe.  That case did not
happen in a wild before due to lack of hardware AHCI HBAs with 32 ports.

Approved by: re (gjb@)
MFC after: 1 week

7 years agofcntl(2): Document interrupt/restart for file locks.
jilles [Thu, 7 Jul 2016 21:44:59 +0000 (21:44 +0000)]
fcntl(2): Document interrupt/restart for file locks.

Since r302216, thread suspension causes advisory file locks to restart
(instead of continuing to wait) and for a long time SA_RESTART has
affected advisory file locks. These are both not compliant to POSIX.1.

To clarify that restarting means something, add a paragraph about fair
queuing. Note that the network lock manager does not implement fair
queuing.

Reviewed by: kib (previous version)
Approved by: re (gjb)

7 years agoWITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.
bdrewery [Thu, 7 Jul 2016 21:03:50 +0000 (21:03 +0000)]
WITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.

Otherwise they get no compiler.

Reported by: swills
Tested by: swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agoChange the type of the map entry's next_read field from a vm_pindex_t to a
alc [Thu, 7 Jul 2016 20:58:16 +0000 (20:58 +0000)]
Change the type of the map entry's next_read field from a vm_pindex_t to a
vm_offset_t.  (This field is used to detect sequential access to the virtual
address range represented by the map entry.)  There are three reasons to
make this change.  First, a vm_offset_t is smaller on 32-bit architectures.
Consequently, a struct vm_map_entry is now smaller on 32-bit architectures.
Second, a vm_offset_t can be written atomically, whereas it may not be
possible to write a vm_pindex_t atomically on a 32-bit architecture.  Third,
using a vm_pindex_t makes the next_read field dependent on which object in
the shadow chain is being read from.

Replace an "XXX" comment.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agolorder: produce locale-independent symbol ordering
emaste [Thu, 7 Jul 2016 20:50:59 +0000 (20:50 +0000)]
lorder: produce locale-independent symbol ordering

Found by the Debian reproducible builds effort -- Debian bug 830259.

Reported by: Reiner Herrmann <reiner@reiner-h.de>
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

7 years agoTidy up loose ends from Netflix I/O sched rename to dynamic I/O sched.
imp [Thu, 7 Jul 2016 20:31:35 +0000 (20:31 +0000)]
Tidy up loose ends from Netflix I/O sched rename to dynamic I/O sched.
Rename kern.cam.do_netflix_iosched sysctl to
kern.cam.do_dynamic_iosched.

Approved by: re (kib@)

7 years agoFix a lockup in tx path for cspw.
loos [Thu, 7 Jul 2016 20:01:03 +0000 (20:01 +0000)]
Fix a lockup in tx path for cspw.

Sometimes the software loses the race when appending more descriptors to
the tx ring and the tx queue stops.

This commit detects this condition and restart the tx queue whenever it stall.

Tested by: sobomax@, Keith White <kwhite@site.uottawa.ca>,
Paul Mather <paul@gromit.dlib.vt.edu>
Sponsored by: Rubicon Communications (Netgate)
Approved by: re (kib)

7 years agoAutotune the number of pages set aside for UMA startup based on the number
cperciva [Thu, 7 Jul 2016 18:37:12 +0000 (18:37 +0000)]
Autotune the number of pages set aside for UMA startup based on the number
of CPUs present.  On amd64 this unbreaks the boot for systems with 92 or
more CPUs; the limit will vary on other systems depending on the size of
their uma_zone and uma_cache structures.

The major consumer of pages during UMA startup is the 19 zone structures
which are set up before UMA has bootstrapped itself sufficiently to use
the rest of the available memory:  UMA Slabs, UMA Hash, 4 / 6 / 8 / 12 /
16 / 32 / 64 / 128 / 256 Bucket, vmem btag, VM OBJECT, RADIX NODE, MAP,
KMAP ENTRY, MAP ENTRY, VMSPACE, and fakepg.  If the zone structures occupy
more than one page, they will not share pages and the number of pages
currently needed for startup is 19 * pages_per_zone + N, where N is the
number of pages used for allocating other structures; on amd64 N = 3 at
present (2 pages are allocated for UMA Kegs, and one page for UMA Hash).

This patch adds a new definition UMA_BOOT_PAGES_ZONES, currently set to 32,
and if a zone structure does not fit into a single page sets boot_pages to
UMA_BOOT_PAGES_ZONES * pages_per_zone instead of UMA_BOOT_PAGES (which
remains at 64).  Consequently this patch has no effect on systems where the
zone structure fits into 2 or fewer pages (on amd64, 59 or fewer CPUs), but
increases boot_pages sufficiently on systems where the large number of CPUs
makes this structure larger.  It seems safe to assume that systems with 60+
CPUs can afford to set aside an additional 128kB of memory per 32 CPUs.

The vm.boot_pages tunable continues to override this computation, but is
unlikely to be necessary in the future.

Tested on: EC2 x1.32xlarge
Relnotes: FreeBSD can now boot on 92+ CPU systems without requiring
vm.boot_pages to be manually adjusted.
Reviewed by: jeff, alc, adrian
Approved by: re (kib)

7 years ago[ath] obey the short-GI vap config flag when transmitting.
adrian [Thu, 7 Jul 2016 17:22:13 +0000 (17:22 +0000)]
[ath] obey the short-GI vap config flag when transmitting.

This makes 'ifconfig wlanX -shortgi' work correctly.

Tested:

* AR9380, STA mode

Approved by: re (gjb)

7 years agoStop deleting ofwdump.8.gz on arm and arm64 when running make delete-old,
andrew [Thu, 7 Jul 2016 15:25:14 +0000 (15:25 +0000)]
Stop deleting ofwdump.8.gz on arm and arm64 when running make delete-old,
it is installed on these architectures.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd

7 years agoDocument 299786, Support for X-Powers AXP813 and AXP818 PMIC
skreuzer [Thu, 7 Jul 2016 14:29:23 +0000 (14:29 +0000)]
Document 299786, Support for X-Powers AXP813 and AXP818 PMIC

Approved by: re (gjb, implicit, relnotes)

7 years agoAdd new unmount(2) flag, MNT_NONBUSY, to check whether there are
trasz [Thu, 7 Jul 2016 09:03:57 +0000 (09:03 +0000)]
Add new unmount(2) flag, MNT_NONBUSY, to check whether there are
any open vnodes before proceeding. Make autounmound(8) use this flag.
Without it, even an unsuccessfull unmount causes filesystem flush,
which interferes with normal operation.

Reviewed by: kib@
Approved by: re (gjb@)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7047

7 years agoARM64: move to GPT scheme in sysinstall
wma [Thu, 7 Jul 2016 05:47:42 +0000 (05:47 +0000)]
ARM64: move to GPT scheme in sysinstall

     It's time to abandon MBR installations on
     ARM64 platforms.

     Obtained from:         Semihalf
     Submitted by:          Dominik Ermel <der@semihalf.com>
     Sponsored by:          Cavium
     Reviewed by:           gjb, emaste, marcel
     Approved by:           re (gjb)
     Differential Revision: https://reviews.freebsd.org/D6798

7 years agoDo not initialize the adapter on MTU change when adapter status is down.
sbruno [Thu, 7 Jul 2016 03:39:18 +0000 (03:39 +0000)]
Do not initialize the adapter on MTU change when adapter status is down.
This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Submitted by: arnaud.ysmal@stormshield.eu
Reviewed by: erj@freebsd.org
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7030

7 years agoFix ZFS ARC min / max tunable
smh [Wed, 6 Jul 2016 23:49:19 +0000 (23:49 +0000)]
Fix ZFS ARC min / max tunable

Due to ARC initial configuration not being done and kmem information
not being available we need to blindly set zfs_arc_max and zfs_arc_min
when configured via the tunable.

This fixes vfs.zfs.arc_(min|max) configuration via loader.conf broken by
r302265.

Approved by: re(gjb)
MFC after: 1 week

7 years agoHandle IOC_VOID special case of passing an integer IOCTL argument through CUSE.
hselasky [Wed, 6 Jul 2016 22:21:22 +0000 (22:21 +0000)]
Handle IOC_VOID special case of passing an integer IOCTL argument through CUSE.

Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
Approved by: re (gjb)

7 years agoisci: fix ATA PASSTHROUGH fixed sense data format
jimharris [Wed, 6 Jul 2016 20:48:42 +0000 (20:48 +0000)]
isci: fix ATA PASSTHROUGH fixed sense data format

PR: kern/191717
Submitted by: martin@lispworks.com
Approved by: re (gjb)
MFC after: 3 days

7 years agoCorrect locking annotation for p_comm.
jhb [Wed, 6 Jul 2016 18:55:46 +0000 (18:55 +0000)]
Correct locking annotation for p_comm.

p_comm is changed during exec, it is not read-only after fork.

Pointed out by: rwatson
Approved by: re (gjb, kib)
MFC after: 1 week

7 years agoAdd variable declaration missing in r302372.
nwhitehorn [Wed, 6 Jul 2016 17:46:49 +0000 (17:46 +0000)]
Add variable declaration missing in r302372.

Submitted by: andrew
Approved by: re (gjb, kib)

7 years agoRemove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
andrew [Wed, 6 Jul 2016 16:20:10 +0000 (16:20 +0000)]
Remove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
to INTRNG in r301565 with the old code no longer being built by default with
no reports of issues on any supported hardware.

Approved by: re (gjb)
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoThe TCPPCAP debugging feature caches recently-used mbufs for use in
jtl [Wed, 6 Jul 2016 16:17:13 +0000 (16:17 +0000)]
The TCPPCAP debugging feature caches recently-used mbufs for use in
debugging TCP connections. This commit provides a mechanism to free those
mbufs when the system is under memory pressure.

Because this will result in lost debugging information, the behavior is
controllable by a sysctl. The default setting is to free the mbufs.

Reviewed by: gnn
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6931
Input from: novice_techie.com

7 years agoFix CTASSERT issue in a more clean way
ngie [Wed, 6 Jul 2016 16:02:15 +0000 (16:02 +0000)]
Fix CTASSERT issue in a more clean way

- Replace all CTASSERT macro instances with static_assert's.
- Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation.
- Localize all static_assert's to the structures being tested.
- Sort some headers per-style(9).

Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D7130
MFC after: 1 week
X-MFC with: r302364
Reviewed by: ed, grehan (maintainer)
Submitted by: ed
Sponsored by: EMC / Isilon Storage Division

7 years agoReplace a number of conflations of mp_ncpus and mp_maxid with either
nwhitehorn [Wed, 6 Jul 2016 14:09:49 +0000 (14:09 +0000)]
Replace a number of conflations of mp_ncpus and mp_maxid with either
mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of places in
the kernel that assumed CPU IDs are dense in [0, mp_ncpus) and would try,
for example, to run tasks on CPUs that did not exist or to allocate too
few buffers on systems with sparse CPU IDs in which there are holes in the
range and mp_maxid > mp_ncpus. Such circumstances generally occur on
systems with SMT, but on which SMT is disabled. This patch restores system
operation at least on POWER8 systems configured in this way.

There are a number of other places in the kernel with potential problems
in these situations, but where sparse CPU IDs are not currently known
to occur, mostly in the ARM machine-dependent code. These will be fixed
in a follow-up commit after the stable/11 branch.

PR: kern/210106
Reviewed by: jhb
Approved by: re (glebius)

7 years agoFix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
hselasky [Wed, 6 Jul 2016 10:57:04 +0000 (10:57 +0000)]
Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
"struct xhci_dev_ctx_addr" fits into a single 4K page until further.

Approved by: re (hrs)
MFC after: 1 week

7 years agoOnly set the ipfilter running state to 'not running' if we are
bz [Wed, 6 Jul 2016 10:29:29 +0000 (10:29 +0000)]
Only set the ipfilter running state to 'not running' if we are
doing the teardown.  ipf_destroy_all() may free ipfmain in case
of ipf_dynamic_softc being true, thus we are avoiding a possible
memory modified after free as well.

Reported by: Coverity
Coverity CID: 1357320
Approved by: re (hrs)
MFC after: 10 days

7 years agoFix gcc warning
ngie [Wed, 6 Jul 2016 05:17:56 +0000 (05:17 +0000)]
Fix gcc warning

Remove -Wunused-but-set-variable (`mopt`).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc build errors with SSE 4.2 detection and gcc warnings
ngie [Wed, 6 Jul 2016 05:17:07 +0000 (05:17 +0000)]
Fix gcc build errors with SSE 4.2 detection and gcc warnings

- Remove -Wunused-but-set-variable's (`len`, etc).
- Replace clang-specific tests in sse42_supported(..) with generic,
  FreeBSD-supported CPU feature tests, using macros and functions
  from machine/cpufunc.h and machine/specialreg.h . The previous method
  for determining SSE4.2 availability was only compatible with clang.
- Sort #includes per style(9).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc warnings
ngie [Wed, 6 Jul 2016 05:11:39 +0000 (05:11 +0000)]
Fix gcc warnings

Remove unused function (`fifo_available`)

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc warnings
ngie [Wed, 6 Jul 2016 05:09:13 +0000 (05:09 +0000)]
Fix gcc warnings

- Put parentheses around bitwise OR'ed values in the `FIELD_COPY(..)` and
  `FIELD_REPLACE(..)` macros to mute warning from gcc 4.2.1.
- Remove -Wunused-but-set-variable's (`setup_addr`, `status_addr`).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc warnings
ngie [Wed, 6 Jul 2016 05:05:03 +0000 (05:05 +0000)]
Fix gcc warnings

Remove -Wunused-but-set-variable (`error`). Cast calls with
`(void)` to note that the return value is explicitly ignored.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc warnings
ngie [Wed, 6 Jul 2016 05:02:59 +0000 (05:02 +0000)]
Fix gcc warnings

Add `WRAPPED_CTASSERT` macro by annotating CTASSERTs with __unused
to deal with -Wunused-local-typedefs warnings from gcc 4.8+.
All other compilers (clang, etc) use CTASSERT as-is. A more generic
solution for this issue will be proposed after ^/stable/11 is forked.

Consolidate all CTASSERTs under one block instead of inlining them in
functions.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc warnings
ngie [Wed, 6 Jul 2016 04:58:42 +0000 (04:58 +0000)]
Fix gcc warnings

Put cfl/prdt under AHCI_DEBUG #defines as they are only used in
those cases.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix gcc warnings
ngie [Wed, 6 Jul 2016 04:56:45 +0000 (04:56 +0000)]
Fix gcc warnings

- Remove -Wunused-but-set-variable (newcpu)
- Always return VMEXIT_CONTINUE as the code always set retval to that value.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd myself to the src committers graph.
badger [Wed, 6 Jul 2016 03:23:07 +0000 (03:23 +0000)]
Add myself to the src committers graph.

Approved by: re (gjb), kib (mentor)

7 years agoCorrect a manual page reference.
gjb [Tue, 5 Jul 2016 23:03:57 +0000 (23:03 +0000)]
Correct a manual page reference.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoRemove incorrect attributes from posix_memalign(3) declaration.
pfg [Tue, 5 Jul 2016 22:30:29 +0000 (22:30 +0000)]
Remove incorrect attributes from posix_memalign(3) declaration.

Both __alloc_align and __alloc_size can't be used when the function
returns a pointer to memory. This fixes breakage when building with
clang 3.4:

In file included from /usr/src/svn/usr.sbin/bhyve/atkbdc.c:40:
/usr/include/stdlib.h:176:6: error: '__alloc_size__' attribute only
applies to functions that return a pointer [-Werror,-Wignored-attributes]

Pointed out by: ngie, cem
Approved by: re (gjb)

7 years agoDocument r302221, file has been updated to version 5.28
skreuzer [Tue, 5 Jul 2016 22:07:41 +0000 (22:07 +0000)]
Document r302221, file has been updated to version 5.28

Approved by: re (gjb, implicit, relnotes)

7 years agoRemove reference to casperd
skreuzer [Tue, 5 Jul 2016 21:57:25 +0000 (21:57 +0000)]
Remove reference to casperd

Reported by: bapt
Approved by: re (gjb, implicit, relnotes)

7 years agoDocument 300207, Support for Shingled Magnetic Recording (SMR) drives.
skreuzer [Tue, 5 Jul 2016 20:56:52 +0000 (20:56 +0000)]
Document 300207, Support for Shingled Magnetic Recording (SMR) drives.

Approved by: re (gjb, implicit, relnotes)

7 years agoioat(4): Block asynchronous work during HW reset
cem [Tue, 5 Jul 2016 20:53:32 +0000 (20:53 +0000)]
ioat(4): Block asynchronous work during HW reset

Fix the race between ioat_reset_hw and ioat_process_events.

HW reset isn't protected by a lock because it can sleep for a long time
(40.1 ms).  This resulted in a race where we would process bogus parts
of the descriptor ring as if it had completed.  This looked like
duplicate completions on old events, if your ring had looped at least
once.

Block callout and interrupt work while reset runs so the completion end
of things does not observe indeterminate state and process invalid parts
of the ring.

Start the channel with a manually implemented ioat_null() to keep other
submitters quiesced while we wait for the channel to start (100 us).

r295605 may have made the race between ioat_reset_hw and
ioat_process_events wider, but I believe it already existed before that
revision.  ioat_process_events can be invoked by two asynchronous
sources: callout (softclock) and device interrupt.  Those could race
each other, to the same effect.

Reviewed by: markj
Approved by: re
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7097

7 years agoioat(4): Serialize ioat_reset_hw invocations
cem [Tue, 5 Jul 2016 20:52:35 +0000 (20:52 +0000)]
ioat(4): Serialize ioat_reset_hw invocations

Reviewed by: markj
Approved by: re
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7097

7 years agoioat(4): Split timer into poll and shrink functions
cem [Tue, 5 Jul 2016 20:51:52 +0000 (20:51 +0000)]
ioat(4): Split timer into poll and shrink functions

Poll should happen quickly, while shrink should happen infrequently.

Protect is_completion_pending with submit_lock.

Reviewed by: markj
Approved by: re
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7097

7 years agoDocument 302332, Native graphics support has been added to bhyve
skreuzer [Tue, 5 Jul 2016 20:48:59 +0000 (20:48 +0000)]
Document 302332, Native graphics support has been added to bhyve

Approved by: re (gjb, implicit, relnotes)

7 years agoThe paradigm of a callout is that it has three consequent states:
glebius [Tue, 5 Jul 2016 18:47:17 +0000 (18:47 +0000)]
The paradigm of a callout is that it has three consequent states:
not scheduled -> scheduled -> running -> not scheduled. The API and the
manual page assume that, some comments in the code assume that, and looks
like some contributors to the code also did. The problem is that this
paradigm isn't true. A callout can be scheduled and running at the same
time, which makes API description ambigouous. In such case callout_stop()
family of functions/macros should return 1 and 0 at the same time, since it
successfully unscheduled future callout but the current one is running.
Before this change we returned 1 in such a case, with an exception that
if running callout was migrating we returned 0, unless CS_MIGRBLOCK was
specified.

With this change, we now return 0 in case if future callout was unscheduled,
but another one is still in action, indicating to API users that resources
are not yet safe to be freed.

However, the sleepqueue code relies on getting 1 return code in that case,
and there already was CS_MIGRBLOCK flag, that covered one of the edge cases.
In the new return path we will also use this flag, to keep sleepqueue safe.

Since the flag CS_MIGRBLOCK doesn't block migration and now isn't limited to
migration edge case, rename it to CS_EXECUTING.

This change fixes panics on a high loaded TCP server.

Reviewed by: jch, hselasky, rrs, kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7042

7 years agoCompile in the kassert_panic() function with INVARIANT_SUPPORT
glebius [Tue, 5 Jul 2016 18:34:34 +0000 (18:34 +0000)]
Compile in the kassert_panic() function with INVARIANT_SUPPORT
option, not INVARIANTS.  The function is required if we want
to load in a module that is compiled with INVARIANTS.

Reviewed by: jhb
Approved by: re (gjb)

7 years agoEnsure that spinlock sections are balanced even after a panic.
markj [Tue, 5 Jul 2016 17:59:04 +0000 (17:59 +0000)]
Ensure that spinlock sections are balanced even after a panic.

vpanic() uses spinlock_enter() to disable interrupts before dumping core.
However, when the scheduler is stopped and INVARIANTS is not configured,
thread_lock() does not acquire a spinlock section, while thread_unlock()
releases one. This can result in interrupts staying enabled while the
kernel dumps core, complicating post-mortem analysis of the crash.

Approved by: re (gjb)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoCall audit hooks to capture vnode attributes for three file-descriptor
rwatson [Tue, 5 Jul 2016 16:37:01 +0000 (16:37 +0000)]
Call audit hooks to capture vnode attributes for three file-descriptor
method implementations: fstat(2), close(2), and poll(2).  This change
synchronises auditing here with similar auditing for VFS-specific system
calls such as stat(2) that audit more complete vnode information.

Sponsored by: DARPA, AFRL
Approved by: re (kib)
MFC after: 1 week

7 years agoadd description for debug.elf{32,64}_legacy_coredump sysctl
emaste [Tue, 5 Jul 2016 14:46:06 +0000 (14:46 +0000)]
add description for debug.elf{32,64}_legacy_coredump sysctl

Approved by: re (kib)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoClarify the vnode_destroy_vobject() logic handling for already terminated
kib [Tue, 5 Jul 2016 11:21:02 +0000 (11:21 +0000)]
Clarify the vnode_destroy_vobject() logic handling for already terminated
objects.

Assert that there is no new waiters for the already terminated objects.
Old waiters should have been notified by the termination calling
vnode_pager_dealloc() (old/new are with regard of the lock acquisition
interval).

Only clear the vp->v_object for the case of already terminated object,
since other branches call vnode_pager_dealloc(), which should clear
the pointer.  Assert this.

Tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

7 years agoFix a regression introduced on revision r271909, when using argument -g
araujo [Tue, 5 Jul 2016 07:01:42 +0000 (07:01 +0000)]
Fix a regression introduced on revision r271909, when using argument -g
or several hops we have segmentation fault because we overwrite the same
structure to store information for host and gateway.

Submitted by: Maryse Levavasseur <maryse.levavasseur@stormshield.eu>
Reworked by: hrs
Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D6980

7 years agoRemove SoC-specific integrations from dTSEC, to make it SoC agnostic.
jhibbits [Tue, 5 Jul 2016 06:16:42 +0000 (06:16 +0000)]
Remove SoC-specific integrations from dTSEC, to make it SoC agnostic.

This will allow a single kernel to run on all SoCs supported by the dTSEC driver.

Approved by: re@(gjb)

7 years agoUnbreak the LBC driver, broken with the large RMan and 36-bit physical address changes.
jhibbits [Tue, 5 Jul 2016 06:14:23 +0000 (06:14 +0000)]
Unbreak the LBC driver, broken with the large RMan and 36-bit physical address changes.

Remove the use of fdt_data_to_res(), and instead construct the resources
manually.  Additionally, avoid the 32-bit size limitation of fdt_data_get(), by
building physical addresses manually from the lbc ranges property.

Approved by: re@(gjb)

7 years agocxgbe(4): Changes to the CPL-handler registration mechanism and code
np [Tue, 5 Jul 2016 01:29:24 +0000 (01:29 +0000)]
cxgbe(4): Changes to the CPL-handler registration mechanism and code
related to "shared" CPLs.

a) Combine t4_set_tcb_field and t4_set_tcb_field_rpl into a single
function.  Allow callers to direct the response to any iq.  Tidy up
set_ulp_mode_iscsi while there to use names from t4_tcb.h instead of
magic constants.

b) Remove all CPL handler tables from struct adapter.  This reduces its
size by around 2KB.  All handlers are now registered at MOD_LOAD instead
of attach or some kind of initialization/activation.  The registration
functions do not need an adapter parameter any more.

c) Add per-iq handlers to deal with CPLs whose destination cannot be
determined solely from the opcode.  There are 2 such CPLs in use right
now: SET_TCB_RPL and L2T_WRITE_RPL.  The base driver continues to send
filter and L2T_WRITEs over the mgmtq and solicits the reply on fwq.
t4_tom (including the DDP code) now uses the port's ctrlq to send
L2T_WRITEs and SET_TCB_FIELDs and solicits the reply on an ofld_rxq.
fwq and ofld_rxq have different handlers that know what kind of tid to
expect in the reply.  Update t4_write_l2e and callers to to support any
wrq/iq combination.

Approved by: re@ (kib@)
Sponsored by: Chelsio Communications

7 years agoFix a race condition between the main thread in aqm_pie_cleanup() and the
truckman [Tue, 5 Jul 2016 00:53:01 +0000 (00:53 +0000)]
Fix a race condition between the main thread in aqm_pie_cleanup() and the
callout thread that can cause a kernel panic.  Always do the final cleanup
in the callout thread by passing a separate callout function for that task
to callout_reset_sbt().

Protect the ref_count decrement in the callout with DN_BH_WLOCK().  All
other ref_count manipulation is protected with this lock.

There is still a tiny window between ref_count reaching zero and the end
of the callout function where it is unsafe to unload the module.  Fixing
this would require the use of callout_drain(), but this can't be done
because dummynet holds a mutex and callout_drain() might sleep.

Remove the callout_pending(), callout_active(), and callout_deactivate()
calls from calculate_drop_prob().  They are not needed because this callout
uses callout_init_mtx().

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
Approved by: re (gjb)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D6928

7 years agoFix build of ppp when WITHOUT_PAM is set
bapt [Mon, 4 Jul 2016 21:18:57 +0000 (21:18 +0000)]
Fix build of ppp when WITHOUT_PAM is set

PR: 210658
Reported by: madpilot
Tested by: madpilot
Approved by: re@ (kib)

7 years agoFix interrupt loop when switching from USB device to USB host mode by
hselasky [Mon, 4 Jul 2016 17:12:22 +0000 (17:12 +0000)]
Fix interrupt loop when switching from USB device to USB host mode by
clearing all endpoint interrupt bits.

PR: 210736
Approved by: re (glebius)
MFC after: 1 week

7 years agoboot1.efi: fix assignment / comparison expression
emaste [Mon, 4 Jul 2016 16:50:21 +0000 (16:50 +0000)]
boot1.efi: fix assignment / comparison expression

PR: 210706
Submitted by: David Binderman <dcb314@hotmail.com>
Approved by: re (kib)
MFC after: 1 week

7 years agoImport bhyve_graphics into CURRENT. Thanks to all who tested
grehan [Mon, 4 Jul 2016 03:19:06 +0000 (03:19 +0000)]
Import bhyve_graphics into CURRENT. Thanks to all who tested
this on the branch.

Original commit message:
  Initial bhyve native graphics support.

  This adds emulations for a raw framebuffer device, PS2 keyboard/mouse,
  XHCI USB controller and a USB tablet.

  A simple VNC server is provided for keyboard/mouse input, and graphics
  output.

  A VGA emulation is included, but is currently disconnected until an
  additional bhyve change to block out VGA memory is committed.

  Credits:
   - raw framebuffer, VNC server, XHCI controller, USB bus/device emulation
      and UEFI f/w support by Leon Dang
   - VGA, console/g, initial VNC server  by tychon@
   - PS2 keyboard/mouse jointly done by tychon@ and Leon Dang
   - hypervisor framebuffer mem support by neel@

  Tested by: Michael Dexter, in a number of revisions of this code.

  With the appropriate UEFI image, FreeBSD, Windows and Linux guests can
  installed and run in graphics mode using the UEFI/GOP framebuffer.

Approved by: re (gjb)

7 years agoAdd the forgotten "svn mv" from r302329
bapt [Sun, 3 Jul 2016 19:31:21 +0000 (19:31 +0000)]
Add the forgotten "svn mv" from r302329

Reported by: Ivan Klymenko <fidaj@ukr.net>
Approved by: re (implicit)

7 years agoRemove ftp(1) related files when MK_FTP == no
ngie [Sun, 3 Jul 2016 18:27:00 +0000 (18:27 +0000)]
Remove ftp(1) related files when MK_FTP == no

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6969
MFC after: 1 week
Reviewed by: ngie
Submitted by: rakuco
Sponsored by: EMC / Isilon Storage Division

7 years agoPosixify the locales name for variants
bapt [Sun, 3 Jul 2016 18:21:11 +0000 (18:21 +0000)]
Posixify the locales name for variants

For all locales with variants:
- if no ambiguity on the locale (only one variant) just use the regular name
- if ambiguity, pick one as default and append @<variant> to the others
  respecting POSIX

As a result:
- All the 3 components locales added recently are renamed to the usual 2
  components version for all but sr_RS.UTF-8
- Set sr_RS.UTF-8 to the cyrillic variant
- Add sr_RS.UTF-8@latin
- Remove the symlinks aliases they were created to represent the 2 components
  version as aliasas and are now useless
- Update the OptionalObsoleteFiles.inc and ObsoleteFiles.inc to reflect those
  changes

Discussed with: ache@
Approved by: re@ (gjb)

7 years agoProvide helper macros to detect 'non-silent SBDRY' state and to
kib [Sun, 3 Jul 2016 18:19:48 +0000 (18:19 +0000)]
Provide helper macros to detect 'non-silent SBDRY' state and to
calculate appropriate return value for stops.  Simplify the code by
using them.

Fix typo in sig_suspend_threads().  The thread which sleep must be
aborted is td2. (*)

In issignal(), when handling stopping signal for thread in
TD_SBDRY_INTR state, do not stop, this is wrong and fires assert.
This is yet another place where execution should be forced out of
SBDRY-protected region.  For such case, return -1 from issignal() and
translate it to corresponding error code in sleepq_catch_signals().
Assert that other consumers of cursig() are not affected by the new
return value. (*)

Micro-optimize, mostly VFS and VOP methods, by avoiding calling the
functions when SIGDEFERSTOP_NOP non-change is requested. (**)

Reported and tested by: pho (*)
Requested by: bde (**)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

7 years agoFix .../usr.bin/lastcomm/legacy_test:main on i386
ngie [Sun, 3 Jul 2016 17:52:21 +0000 (17:52 +0000)]
Fix .../usr.bin/lastcomm/legacy_test:main on i386

The time in the output files was ahead by 3 hours on i386. Fix the incorrect
offset.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
PR: 210329
Reported by: asomers
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

7 years agoOutput the diffs to standard error when comparing the expected vs the
ngie [Sun, 3 Jul 2016 17:51:24 +0000 (17:51 +0000)]
Output the diffs to standard error when comparing the expected vs the
obtained output from lastcomm instead of just printing out a summary, e.g.
"they differed".

This will make failures with results more apparent when running kyua debug,
kyua report-html, etc.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

7 years agoFix race for incrementally rebuilding VERSION_MAP.
bdrewery [Sun, 3 Jul 2016 17:28:39 +0000 (17:28 +0000)]
Fix race for incrementally rebuilding VERSION_MAP.

The dependency is needed in PROG_FULL since only the build of PROG_FULL
is using the LDFLAGS and depending on VERSION_MAP.  This was not a problem
with MK_DEBUG_FILES==no since it only builds PROG.

This should probably be using bsd.lib.mk instead [1]

Reported by: swills, gjb
Reviewed by: emaste
Noted by: rgrimes [1]
Sponsored by: EMC / Isilon Storage Division
Approved by: re (kib)

7 years agoFix a bad test resulting in a segfault with ISO-8859-5 locales
bapt [Sun, 3 Jul 2016 15:00:12 +0000 (15:00 +0000)]
Fix a bad test resulting in a segfault with ISO-8859-5 locales

Reported by: Lauri Tirkkonen from Illumos
Approved by: re@ (gjb)

7 years agoRemove racy assert. The thread which changes vnode usecount from 0 to 1
kib [Sun, 3 Jul 2016 01:56:48 +0000 (01:56 +0000)]
Remove racy assert. The thread which changes vnode usecount from 0 to 1
does it under the vnode interlock, but the interlock is not owned by the
asserting thread.  As result, we might read increased use counter but also
still see VI_OWEINACT.

In collaboration with: nwhitehorn
Hardware donated by: IBM LTC
Sponsored by: The FreeBSD Foundation (kib)
Approved by: re (gjb)

7 years agoUpdate libxo to 0.6.3
ngie [Sun, 3 Jul 2016 01:35:27 +0000 (01:35 +0000)]
Update libxo to 0.6.3

This fixes the 02 testcases on i386 (at least), and may fix the testcases
in general on 32-bit platforms

Differential Revision: https://reviews.freebsd.org/D7052
Approved by: phil (maintainer)
Approved by: re (gjb)
Reported by: asomers
Reviewed by: phil
Submitted by: phil
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd more machines to the bsdinstall workaround blacklist
allanjude [Sun, 3 Jul 2016 01:23:38 +0000 (01:23 +0000)]
Add more machines to the bsdinstall workaround blacklist

Apply the LenovoFix (fake partition in pMBR is 2nd rather than 1st)
and GPT Active fix (mark the fake pMBR partition active) to respective
hardware that is confirmed to require such to boot correct.

Submitted by: Sam Fourman Jr. <sfourman@gmail.com> (ThinkPad W520)
Submitted by: Matthias Apitz <guru@unixarea.de> (Latitude E6330)
Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

7 years agoFix an error in bsdinstall when ZFS installation uses a bootpool
allanjude [Sun, 3 Jul 2016 01:22:59 +0000 (01:22 +0000)]
Fix an error in bsdinstall when ZFS installation uses a bootpool

A separate bootpool is used when the selected partition type is MBR
or when the disk is GELI encrypted and a UEFI loader is selected.

BIOS avoids the bootpool by using bootcode and loader that support GELI.

bsdinstall did not remount the bootpool after creating the main pool,
which caused an error when mkdir tried to create /boot/zfs

PR: 210717
Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

7 years agoChange type of the 'dead' variable to boolean.
kib [Sun, 3 Jul 2016 00:08:17 +0000 (00:08 +0000)]
Change type of the 'dead' variable to boolean.

Requested by: alc
MFC after: 1 week
Approved by: re (gjb)

7 years agoHide warning about non-existent lookup tables and informational messages
ae [Sat, 2 Jul 2016 11:54:20 +0000 (11:54 +0000)]
Hide warning about non-existent lookup tables and informational messages
about modified table entry when quied mode enabled.

Approved by: re (hrs)
Obtained from: Yandex LLC

7 years agocxgbe(4): Avoid a NULL dereference while dumping the L2 table. Entries
np [Fri, 1 Jul 2016 23:18:49 +0000 (23:18 +0000)]
cxgbe(4): Avoid a NULL dereference while dumping the L2 table.  Entries
used by switching filters that rewrite L2 information do not have any
associated ifnet.

Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications

7 years agoClean up some FDT-related code in the PowerPC bootloader, improving error
nwhitehorn [Fri, 1 Jul 2016 21:09:30 +0000 (21:09 +0000)]
Clean up some FDT-related code in the PowerPC bootloader, improving error
checking and robustness. Prevents errors and crashes in FDT commands on
PowerMac G5 systems.

Approved by: re (gjb)

7 years agoDocument 300777, Add support for GPIO, Sensors and interrupts on AXP209 PMIC
skreuzer [Fri, 1 Jul 2016 20:25:59 +0000 (20:25 +0000)]
Document 300777, Add support for GPIO, Sensors and interrupts on AXP209 PMIC

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r299688, Add support for H3 SoC
skreuzer [Fri, 1 Jul 2016 20:19:02 +0000 (20:19 +0000)]
Document r299688, Add support for H3 SoC

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r263698, Add code for enabling second CPU core for A20 SoC.
skreuzer [Fri, 1 Jul 2016 20:16:35 +0000 (20:16 +0000)]
Document r263698, Add code for enabling second CPU core for A20 SoC.

Approved by: re (gjb, implicit, relnotes)

7 years agoWhen a process knote was attached to the process which is already exiting,
kib [Fri, 1 Jul 2016 20:11:28 +0000 (20:11 +0000)]
When a process knote was attached to the process which is already exiting,
the knote is activated immediately.  If the exit1() later activates
knotes, such knote is attempted to be activated second time.  Detect
the condition by zeroed kn_ptr.p_proc pointer, and avoid excessive
activation.

Before r302235, such knotes were removed from the knlist immediately
upon activation.

Reported by: truckman
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

7 years ago[net80211] teach AMRR to log the initial MCS rate as "MCS X"
adrian [Fri, 1 Jul 2016 19:58:13 +0000 (19:58 +0000)]
[net80211] teach AMRR to log the initial MCS rate as "MCS X"

Otheriwse it logs it as the rate value, which is 0x80 (MCS flag) + MCS,
which isn't that helpful.

Approved by: re (gjb)

7 years agoFix detection of USB device disconnects in USB host mode when the USB
hselasky [Fri, 1 Jul 2016 07:27:33 +0000 (07:27 +0000)]
Fix detection of USB device disconnects in USB host mode when the USB
device is connected directly to the USB port of the DWC OTG, in this
case a RPI-zero.

PR: 210695
Approved by: re (gjb)
MFC after: 1 week

7 years agoMFV r302260: expat 2.2.0
delphij [Fri, 1 Jul 2016 05:48:45 +0000 (05:48 +0000)]
MFV r302260: expat 2.2.0

Approved by: re (kib)

7 years agoUpdate 11.0 to ALPHA6.
gjb [Fri, 1 Jul 2016 00:00:35 +0000 (00:00 +0000)]
Update 11.0 to ALPHA6.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoIn case of the global eventhandler make sure the current VNET
bz [Thu, 30 Jun 2016 19:32:45 +0000 (19:32 +0000)]
In case of the global eventhandler make sure the current VNET
is still operational before doing any work;  otherwise we might
run into, e.g., destroyed locks.

PR: 210724
Reported by: olevole olevole.ru
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Obtained from: projects/vnet
Approved by: re (gjb)

7 years agoVirtualise ipfilter.
bz [Thu, 30 Jun 2016 15:01:07 +0000 (15:01 +0000)]
Virtualise ipfilter.
Split initializzation an teardown into module (global state) and VNET
(per virtual network stack) parts.  Virtualise global state, which is
not "const".

Cleanup eventhandlers, so that we can make use of the passed in argument
to get the vnet state from the ifp;  disable the "cloner" event as it is
too early, has no state, and can fire before initialisation (see comment
in the source).

Handle the dynamic sysctls specially.  The problem is that "ipmain"
is the virtualized struct, but the fields used for the sysctls are
hanging off memory allocated and attached to the virtualized "ipmain"
thus standard VNET macros and sysctl handling do not work.
We still say it is VNET sysctls to get the proper protection checks
in the VIMAGE case;  to solve the problem of accessing the right bit
of memory hanging of each per-VNET ipmain, we use a dedicated handler
function wrapping around sysctl_ipf_int() undoing the base calculation
from kern_sysctl.c and then adding the passed-in offset into the right
struct depending on handler.  A bit of a mess exposing VNET-internals
this way but the only way to keep the code without having to massively
restructure ipf internals.

Approved by: re (hrs)
Sponsored by: The FreeBSD Foundation
Obtained from: projects/vnet
MFC after: 2 weeks
Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D7000

7 years agoRevert r299454 and r299448.
mav [Thu, 30 Jun 2016 14:55:49 +0000 (14:55 +0000)]
Revert r299454 and r299448.

Those changes were found confusing FreeBSD libc ACL code, that doesn't
differentiate ACL for directories and files, and report ACLs for all
directories created after those patches as non-trivial.  On the other
side these changes were considered wrong from POSIX and NFSv4 points of
view.  Until further investigation done upstream, revert those changes
locally in preparation for FreeBSD 11.0 release.

Approved by: re (hrs)

7 years agoRemove dead code.
cy [Thu, 30 Jun 2016 14:53:46 +0000 (14:53 +0000)]
Remove dead code.

Approved by: re@ (hrs@)
MFC after: 1 week

7 years agoMFV r302264:
mm [Thu, 30 Jun 2016 08:51:50 +0000 (08:51 +0000)]
MFV r302264:

Sync libarchive with vendor, bugfixes for tests:
- fix tests on filesystems without birthtime support, e.g. UFS1 (1)
- vendor issue #729: avoid use of C99 for-scope declarations in
  test_write_format_gnutar_filenames.c

MFC after: 1 week
PR: 204157 (1)
Approved by: re (hrs)

7 years agoThis patch fixes two bugs related to the setting of the I-Bit
tuexen [Thu, 30 Jun 2016 06:06:35 +0000 (06:06 +0000)]
This patch fixes two bugs related to the setting of the I-Bit
for SCTP DATA and I-DATA chunks.
* For fragmented user messages, set the I-Bit only on the last
  fragment.
* When using explicit EOR mode, set the I-Bit on the last
  fragment, whenever SCTP_SACK_IMMEDIATELY was set in snd_flags
  for any of the send() calls.

Approved by: re (hrs)
MFC after: 1 week

7 years agoARM, ARM64: Workaround for buf_ring reordering
wma [Thu, 30 Jun 2016 05:18:37 +0000 (05:18 +0000)]
ARM, ARM64: Workaround for buf_ring reordering

    This patch offers a workaround to buf_ring reordering
    visible on armv7 and armv8. This is supposed to be
    removed once new buf_ring implementation is integrated
    into the tree.

    Obtained from:         Semihalf
    Reviewed by:           alc,emaste
    Differential Revision: https://reviews.freebsd.org/D6986
    Approved by:           re (gjb)

7 years agoARM64: fix DMAP calculation
wma [Thu, 30 Jun 2016 04:58:19 +0000 (04:58 +0000)]
ARM64: fix DMAP calculation

    Use arithmetic operators instead of logical. This fixes
    DMAP ranges calculation for ThunderX Dual Socket.

    Obtained from:         Semihalf
    Sponsored by:          Cavium
    Reviewed by:           zbb
    Differential Revision: https://reviews.freebsd.org/D7023
    Approved by:           re (gjb)

7 years agoMove the ipfw_log_bpf() calls from global module initialisation to
bz [Thu, 30 Jun 2016 01:33:14 +0000 (01:33 +0000)]
Move the ipfw_log_bpf() calls from global module initialisation to
per-VNET initialisation and virtualise the interface cloning to
allow a dedicated ipfw log interface per VNET.

Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

7 years agoRemove unused global variables as well as unused memory
bz [Thu, 30 Jun 2016 01:32:12 +0000 (01:32 +0000)]
Remove unused global variables as well as unused memory
allocations from ipfilter in preparation for VNET support.

Suggested by: cy (see D7000)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (gjb)

7 years agoEnable indirect segment I/Os by default in the Xen blkfront driver when
cperciva [Wed, 29 Jun 2016 23:56:24 +0000 (23:56 +0000)]
Enable indirect segment I/Os by default in the Xen blkfront driver when
running on EC2.  Due to improvements in EC2, the performance penalty which
was present on some EC2 instances no longer exists, and enabling this
feature now consistently yields ~20% higher throughput with equal or lower
latency.

Reverts: r286063
Approved by: re (gjb)
MFC after: 2 weeks
Relnotes: Improved disk throughput on EC2

7 years agoFixed FreeBSD/mips MALTA support for QEMU
gonzo [Wed, 29 Jun 2016 23:33:44 +0000 (23:33 +0000)]
Fixed FreeBSD/mips MALTA support for QEMU

Recource management functions in GT PCI controller driver
treated memory/IO resources as KSEG1 addresses, later during
activation these values would be increased by KSEG1 base again
rendering the address invalid and causing "bus error" trap.

Actual logic was converted to use real physical addresses,
so mapping takes place only during activation.

Submitted by: Aleksandr Rybalko <ray@FreeBSD.org>
Approved by: re (gjb)

7 years agoFlush every line when using meta mode and no -j or with -B.
bdrewery [Wed, 29 Jun 2016 22:54:01 +0000 (22:54 +0000)]
Flush every line when using meta mode and no -j or with -B.

Otherwise the output is buffered and it appears that make is stuck on something
long-running.  This problem is not present with -j as it uses different
code that was already flushing.

Discussed with: sjg
Approved by: re (blanket, META_MODE)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Avoid false-positive error due to missing .meta with build commands.
bdrewery [Wed, 29 Jun 2016 22:39:22 +0000 (22:39 +0000)]
WITH_META_MODE: Avoid false-positive error due to missing .meta with build commands.

Sponsored by: EMC / Isilon Storage Division
Approved by: re (blanket, META_MODE)

7 years ago1.Improve handling around last compressed block of the file, which is
sobomax [Wed, 29 Jun 2016 18:19:05 +0000 (18:19 +0000)]
1.Improve handling around last compressed block of the file, which is
  necessary because CLOOP format lacks explicit EOF or length, so that
  in the presence of padding or when the CLOOP is put onto a larger
  partition upper level provider size may be larger. Bound amount
  of extra data that we might touch to the max length of the compressed
  block and detect zero-padding in the last cluster, which when
  sector is all-zero might cause us to emit bogus I/O error after
  decompression of that fails. To not make code any more complicated
  that it needs to be deal with it in lazy-manner, i.e. when we
  first access that specific cluster.

  This change also fixes stupid mistake in the LZMA code, inherited
  from geom_lzma, which does not share length of the output buffer
  buffer with the decompression routine, so that in the presence
  of corrupted or purposedly tailored data may easily cause heap
  overflow and kernel memory corruption.

  Beef up validation of the CLOOP TOC by checking that lengths of
  all but the last compressed clusters match upper limit set by
  the decompressor and improve some error diagnostic output while
  I am here.

2.Add kern.geom.uzip.attach_to tunable to artifically limit
  attaching uzip to certain devices in the dev tree only.

    For example the following only makes us attaching to the
    GPT labels:

    kern.geom.uzip.attach_to="gpt/*"

3.Add kern.geom.uzip.noattach_to, which does opposite to the (2)
  above, i.e. prevents geom_uzip from tasting / attaching to
  providers matching some pattern. By default we don't attach
  to our own kind, i.e. kern.geom.uzip.noattach_to="*.uzip".
  It saves us quite some CPU cycles, esp on low-end embedded
  systems.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7013