]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agobhnd(4): minor style(9) fixes
landonf [Mon, 19 Dec 2016 20:07:58 +0000 (20:07 +0000)]
bhnd(4): minor style(9) fixes

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D8755

7 years agoFix whitespace issues in pl011 uart driver
jchandra [Mon, 19 Dec 2016 19:40:11 +0000 (19:40 +0000)]
Fix whitespace issues in pl011 uart driver

Fix up trailing whitespace introduced by r310190. While there,
fix a couple of earlier whitespace errors as well.

7 years agoRemove a bogus KASSERT from nd6_prefix_unlink().
markj [Mon, 19 Dec 2016 19:21:28 +0000 (19:21 +0000)]
Remove a bogus KASSERT from nd6_prefix_unlink().

The caller may unlink a prefix before purging referencing addresses. An
identical assertion in nd6_prefix_del() verifies that the addresses are
purged before the prefix is freed.

PR: 215372
X-MFC With: r306829

7 years agoWhen reporting "Logical block address out of range" error, report the LBA
mav [Mon, 19 Dec 2016 19:00:03 +0000 (19:00 +0000)]
When reporting "Logical block address out of range" error, report the LBA
in sense data INFORMATION field.

MFC after: 2 weeks

7 years agoWhen writing fixed format sense data, set VALID bit only if provided value
mav [Mon, 19 Dec 2016 18:55:10 +0000 (18:55 +0000)]
When writing fixed format sense data, set VALID bit only if provided value
for INFORMATION field fit into available 4 bytes (has no non-zero bytes
except last 4), as explicitly required by SPC-5 specification.

MFC after: 2 weeks

7 years agonewvers.sh: consider as modified SVN mixed revision and other cases
emaste [Mon, 19 Dec 2016 17:31:34 +0000 (17:31 +0000)]
newvers.sh: consider as modified SVN mixed revision and other cases

The newvers -R option is intended to include build metadata (e.g. user,
host, time) if the build is from an unmodified VCS tree. For subversion
it considered a trailing 'M' as an indication of a modified tree, and
any other version string as modified.

Also include mixed revision checkouts (e.g. 123:126), switched (123S)
and partial (123P) working copies as modified: the revision number is
insufficient to uniquely determine which source was used for the build.

Reported by: gjb
Reviewed by: gjb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8853

7 years agoAdd a missing STAILQ_INSERT_TAIL() for allowaddr rule.
hrs [Mon, 19 Dec 2016 17:10:30 +0000 (17:10 +0000)]
Add a missing STAILQ_INSERT_TAIL() for allowaddr rule.

7 years agoFix typo in function name.
mav [Mon, 19 Dec 2016 15:49:59 +0000 (15:49 +0000)]
Fix typo in function name.

7 years agoAdd ld.debug to ObsoleteFiles.inc
emaste [Mon, 19 Dec 2016 15:23:24 +0000 (15:23 +0000)]
Add ld.debug to ObsoleteFiles.inc

After r293285 GNU ld is installed as /usr/bin/ld.bfd, and linked as
/usr/bin/ld.  The debug file is /usr/lib/debug/usr/bin/ld.bfd.debug.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agonewvers.sh: add -R option to include metadata only for unmodified src tree
emaste [Mon, 19 Dec 2016 15:19:44 +0000 (15:19 +0000)]
newvers.sh: add -R option to include metadata only for unmodified src tree

Sponsored by: The FreeBSD Foundation

7 years agoAdd new bits into Extended Inquiry VPD page.
mav [Mon, 19 Dec 2016 15:18:31 +0000 (15:18 +0000)]
Add new bits into Extended Inquiry VPD page.

MFC after: 2 weeks

7 years agoComment the RCSID.
gjb [Mon, 19 Dec 2016 15:09:30 +0000 (15:09 +0000)]
Comment the RCSID.

Sponsored by: The FreeBSD Foundation

7 years agoRestore missing comment in src.conf.5
emaste [Mon, 19 Dec 2016 15:05:46 +0000 (15:05 +0000)]
Restore missing comment in src.conf.5

I'm not sure how I managed to generate src.conf.5 without the comment;
add it manually while looking into that.

Reported by: gjb

7 years agosrc.conf.5: regen after r310268 (WITH_REPRODUCIBLE_BUILD)
emaste [Mon, 19 Dec 2016 14:54:06 +0000 (14:54 +0000)]
src.conf.5: regen after r310268 (WITH_REPRODUCIBLE_BUILD)

7 years agoBuild loaders reproducibly when WITH_REPRODUCIBLE_BUILD
emaste [Mon, 19 Dec 2016 14:45:59 +0000 (14:45 +0000)]
Build loaders reproducibly when WITH_REPRODUCIBLE_BUILD

When WITH_REPRODUCIBLE_BUILD=yes is set in src.conf(5), eliminate the
time, user, and host from the loader's version information.  This allows
builds to produce bit-for-bit identical output.

Reviewed by: bapt
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8842

7 years agoDeduplicate loader vers.c Makefile rules
emaste [Mon, 19 Dec 2016 14:40:59 +0000 (14:40 +0000)]
Deduplicate loader vers.c Makefile rules

The Makefile rule to create vers.c for loader version info was
previously duplicated in each of the various loader Makefiles.
Instead, share a common rule in Makefile.inc.

Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8841

7 years agoAdd support for NUAR bit in Control mode page.
mav [Mon, 19 Dec 2016 14:19:52 +0000 (14:19 +0000)]
Add support for NUAR bit in Control mode page.

MFC after: 2 weeks

7 years agoAdd set of macros to simplify code access to mode pages fields.
mav [Mon, 19 Dec 2016 13:25:53 +0000 (13:25 +0000)]
Add set of macros to simplify code access to mode pages fields.

MFC after: 2 weeks

7 years agoFollowing SPC-5, make REQUEST SENSE report "Logical unit not supported"
mav [Mon, 19 Dec 2016 11:44:41 +0000 (11:44 +0000)]
Following SPC-5, make REQUEST SENSE report "Logical unit not supported"
in returned parameter data for not accessible LUNs.

MFC after: 2 weeks

7 years agoip[6]_tryforward does inbound and outbound packet firewall processing.
ae [Mon, 19 Dec 2016 11:02:49 +0000 (11:02 +0000)]
ip[6]_tryforward does inbound and outbound packet firewall processing.
This can lead to change of mbuf pointer (packet filter could do m_pullup(),
NAT, etc). Also in case of change of destination address, tryforward can
decide that packet should be handled by local system. In this case modified
mbuf can be returned to the ip[6]_input(). To handle this correctly, check
M_FASTFWD_OURS flag after return from ip[6]_tryforward. And if it is present,
update variables that depend from mbuf pointer and skip another inbound
firewall processing.

No objection from: #network
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D8764

7 years agoImprove support for informational exceptions.
mav [Mon, 19 Dec 2016 10:25:47 +0000 (10:25 +0000)]
Improve support for informational exceptions.

While CTL still has no real events to report in this way (like SMART),
it is possible to trigger false event by manually setting TEST bit in
Informational Exceptions Control mode page, that can be useful for
initiator testing.  This code supports all flavours of IE reporting:
UNIT ATTENTION, RECOVERED ERROR and NO SENSE sense keys, REQUEST SENSE
command and Informational Exceptions log page.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoDefer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
hselasky [Mon, 19 Dec 2016 09:28:12 +0000 (09:28 +0000)]
Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
The panics happen due to using kernel facilities like callouts too early.

Tested by: jhb @
MFC after: 1 week

7 years agohyperv: Implement userspace gettimeofday(2) with Hyper-V reference TSC
sephe [Mon, 19 Dec 2016 07:40:45 +0000 (07:40 +0000)]
hyperv: Implement userspace gettimeofday(2) with Hyper-V reference TSC

This 6 times gettimeofday performance, as measured by
tools/tools/syscall_timing

Reviewed by: kib
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8789

7 years agoRenumber license clauses to avoid skipping #3
emaste [Sun, 18 Dec 2016 22:24:04 +0000 (22:24 +0000)]
Renumber license clauses to avoid skipping #3

7 years agoImprove vm_object_scan_all_shadowed() to also check swap backing objects.
kib [Sun, 18 Dec 2016 20:56:14 +0000 (20:56 +0000)]
Improve vm_object_scan_all_shadowed() to also check swap backing objects.

As noted in the removed comment, it is possible and not prohibitively
costly to look up the swap blocks for the given page index.  Implement
a swap_pager_find_least() function to do that, and use it to iterate
simultaneously over both backing object page queue and swap
allocations when looking for shadowed pages.

Testing shows that number of new succesful scans, enabled by this
addition, is small but non-zero.  When worked out, the change both
further reduces the depth of the shadow object chain, and frees unused
but allocated swap and memory.

Suggested and reviewed by: alc
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAfter r310171, the kernel version of sscanf() has format string checking
dim [Sun, 18 Dec 2016 15:21:38 +0000 (15:21 +0000)]
After r310171, the kernel version of sscanf() has format string checking
enabled.  This results in a -Werror warning in mlx4ib:

    sys/dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c:90:22: error: format specifies type 'unsigned long long *' but the argument has type 'u64 *' (aka 'unsigned long *') [-Werror,-Wformat]
            sscanf(buf, "%llx", &sysadmin_ag_val);
                         ~~~~   ^~~~~~~~~~~~~~~~

Change sysadmin_ag_val to unsigned long long to avoid the warning.

Reviewed by: hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8831

7 years agoDon't treat informational exceptions (warnings and impending failures)
mav [Sun, 18 Dec 2016 15:02:50 +0000 (15:02 +0000)]
Don't treat informational exceptions (warnings and impending failures)
a.k.a. SCSI SMART events as errors.  Log them to console and continue.

MFC after: 2 weeks

7 years agoofw_spi: Parse property for the SPI mode and CS polarity.
manu [Sun, 18 Dec 2016 14:54:20 +0000 (14:54 +0000)]
ofw_spi: Parse property for the SPI mode and CS polarity.
As cs is stored in a uint32_t, use the last bit to store the
active high flag as it's unlikely that we will have that much CS.

Reviewed by: loos
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8614

7 years agoDocument the fact that cldr tools are not working by default and should be
bapt [Sun, 18 Dec 2016 14:10:24 +0000 (14:10 +0000)]
Document the fact that cldr tools are not working by default and should be
rebuilt

7 years agoDisable timedef generation, cldr data are too far from freebsd extensions
bapt [Sun, 18 Dec 2016 14:04:17 +0000 (14:04 +0000)]
Disable timedef generation, cldr data are too far from freebsd extensions

7 years agoReduce boot loader version string duplication
emaste [Sun, 18 Dec 2016 13:57:23 +0000 (13:57 +0000)]
Reduce boot loader version string duplication

Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just
create the full version string in vers.c

Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8823

7 years agoAdd virtio_pci to GENERIC arm64 conf
jchandra [Sun, 18 Dec 2016 11:15:31 +0000 (11:15 +0000)]
Add virtio_pci to GENERIC arm64 conf

virtio_pci was missing from the GENERIC arm64 configuration, while
other virtio devices are present. Adding it will allow us to boot
the GENERIC kernel on QEMU with virtio storage and networking.

7 years agoFix typo. Remove spurious blank line.
kib [Sun, 18 Dec 2016 09:32:23 +0000 (09:32 +0000)]
Fix typo.  Remove spurious blank line.

MFC after: 3 days

7 years agoInitialize GIC[DR]_IGROUPRn registers for GICv3
jchandra [Sun, 18 Dec 2016 08:31:01 +0000 (08:31 +0000)]
Initialize GIC[DR]_IGROUPRn registers for GICv3

In case where GICD_CTLR.DS is 1, the IGROUPR registers are RW in
non-secure state and has to be initialized to 1 for the
corresponding interrupts to be delivered as Group 1 interrupts.

Update gic_v3_dist_init() and gic_v3_redist_init() to initialize
GICD_IGROUPRn and GICR_IGROUPRn respectively to address this. The
registers can be set unconditionally since the writes are ignored
in non-secure state when GICD_CTLR.DS is 0.

This fixes the hang on boot seen when running qemu-system-aarch64
with machine virt,gic-version=3

7 years agoClean up parse_ip(..)
ngie [Sun, 18 Dec 2016 05:36:04 +0000 (05:36 +0000)]
Clean up parse_ip(..)

- Clean up trailing whitespace
- Fix variable alignment

MFC after: 1 week

7 years agoClean up trailing and leading whitespace
ngie [Sun, 18 Dec 2016 05:31:54 +0000 (05:31 +0000)]
Clean up trailing and leading whitespace

Fix variable type alignment in snmp_dialog(..)

MFC after: 1 week

7 years agoUpdate locales cldr to v30.0.3 and unicode to 9.0.0
bapt [Sun, 18 Dec 2016 04:17:13 +0000 (04:17 +0000)]
Update locales cldr to v30.0.3 and unicode to 9.0.0

MFC after: 1 month
Relnotes: yes

7 years agoIn order to prepare cldr v30.0.3 and unicode 9.0.0,
bapt [Sun, 18 Dec 2016 04:12:45 +0000 (04:12 +0000)]
In order to prepare cldr v30.0.3 and unicode 9.0.0,
more locales are removed from automatic mapping from unicode as their
encoding does not supports new characters available in unicode

7 years agoBetter handle posix names for locales
bapt [Sun, 18 Dec 2016 04:11:13 +0000 (04:11 +0000)]
Better handle posix names for locales

7 years agoSimplify extraction of static collation definition
bapt [Sun, 18 Dec 2016 02:02:33 +0000 (02:02 +0000)]
Simplify extraction of static collation definition

7 years agoPrepare import of CLDR v30.3 and unicode 9.0.0
bapt [Sun, 18 Dec 2016 01:52:16 +0000 (01:52 +0000)]
Prepare import of CLDR v30.3 and unicode 9.0.0

Upstream kk_Cyrl_KZ has been renamed kk_KZ
Upstream mn_Cyrl_MN has been renamed mn_MN

For ru_RU: the default currency for unicode is now ₽ which is not mapped to
other encoding, add charmaps entries to be able to generate them

7 years agoFix some minor typos with begemotBridgeTpLearnedEntryDiscards and
ngie [Sun, 18 Dec 2016 00:44:43 +0000 (00:44 +0000)]
Fix some minor typos with begemotBridgeTpLearnedEntryDiscards and
begemotBridgeTpMaxAddresses

Bump LAST-UPDATED for the MIB, per the change

MFC after: 1 week

7 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Sat, 17 Dec 2016 22:34:19 +0000 (22:34 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
3.9.1 release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

Release notes for llvm, clang and lld will be available here:
<http://releases.llvm.org/3.9.1/docs/ReleaseNotes.html>
<http://releases.llvm.org/3.9.1/tools/clang/docs/ReleaseNotes.html>
<http://releases.llvm.org/3.9.1/tools/lld/docs/ReleaseNotes.html>

Relnotes: yes
MFC after: 2 weeks
X-MFC-with: r309124

7 years agoFix the handling of buffered messages in stream reset deferred handling.
tuexen [Sat, 17 Dec 2016 22:31:30 +0000 (22:31 +0000)]
Fix the handling of buffered messages in stream reset deferred handling.

Thanks to Eugen-Andrei Gavriloaie for reporting the issue and providing
substantial help in nailing down the issue.

MFC after: 1 week

7 years agoPut a tentative import date in ObsoleteFiles.inc and UPDATING.
dim [Sat, 17 Dec 2016 18:35:17 +0000 (18:35 +0000)]
Put a tentative import date in ObsoleteFiles.inc and UPDATING.

7 years agoMerge ^/head r310169 through r310190.
dim [Sat, 17 Dec 2016 18:33:41 +0000 (18:33 +0000)]
Merge ^/head r310169 through r310190.

7 years agoSimplify interrupt mask programming in pl011 uart
jchandra [Sat, 17 Dec 2016 18:04:59 +0000 (18:04 +0000)]
Simplify interrupt mask programming in pl011 uart

Remove unused fields from uart_pl011_softc. Add an interrupt mask
field to the softc and use it to set the interrupt mask register.

There should be no functional change introduced here except in the
grab and ungrab functions. In these functions, we now disable and
enable all interrupts rather than just the receive interrupt.

7 years agoFix sscanf() format string to match an argument. This also fixes kernel
skra [Sat, 17 Dec 2016 18:03:03 +0000 (18:03 +0000)]
Fix sscanf() format string to match an argument. This also fixes kernel
build after r310171.

MFC after: 1 weeks

7 years agoRemove lib/libelf's manpages if MK_TOOLCHAIN == no
ngie [Sat, 17 Dec 2016 03:41:16 +0000 (03:41 +0000)]
Remove lib/libelf's manpages if MK_TOOLCHAIN == no

Add a comment to help figure out which set is lib/libelf's and which set
is lib/libelftc's

MFC after: 1 week

7 years agoInstall the lib/libelftc manpages
ngie [Sat, 17 Dec 2016 03:34:51 +0000 (03:34 +0000)]
Install the lib/libelftc manpages

Some other manpages, e.g. c++filt reference these

MFC after: 1 week

7 years agoMFV r310115,310184:
mm [Sat, 17 Dec 2016 02:07:08 +0000 (02:07 +0000)]
MFV r310115,310184:

Sync libarchive with vendor.

Vendor bugfixes (relevant to FreeBSD):
PR 830, 831, 833: Spelling fixes
OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free()
OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives

MFC after: 1 week

7 years agoAdd vendor/libarchive/dist files missing in r310115
mm [Sat, 17 Dec 2016 02:01:05 +0000 (02:01 +0000)]
Add vendor/libarchive/dist files missing in r310115

7 years agoIn swp_pager_meta_free_all(), fix type of the index variable. Style.
kib [Fri, 16 Dec 2016 23:33:37 +0000 (23:33 +0000)]
In swp_pager_meta_free_all(), fix type of the index variable.  Style.

Noted and reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRevert r309339, thus re-instating r309314
matthew [Fri, 16 Dec 2016 23:05:47 +0000 (23:05 +0000)]
Revert r309339, thus re-instating r309314

The original problem with conflicting definitions of ${PKG_CMD} was
solved by r427523 in ports (see https://reviews.freebsd.org/D8677), so
this should be safe now.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

7 years agoFix panic during lagg destruction with simultaneous status check
asomers [Fri, 16 Dec 2016 22:39:30 +0000 (22:39 +0000)]
Fix panic during lagg destruction with simultaneous status check

If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a
page fault may result. The first process will destroy ifp->if_lagg in
lagg_clone_destroy (called by if_clone_destroy). Then the second process
will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and
goto fallback: where it will promptly dereference ifp->if_lagg anyway.

The solution is to repeat the NULL check for ifp->if_lagg

MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8512

7 years agoAvoid division by zero in the rare case that portsnap needs to fetch
cperciva [Fri, 16 Dec 2016 22:37:16 +0000 (22:37 +0000)]
Avoid division by zero in the rare case that portsnap needs to fetch
zero patches.  (This avoids two "dc: divide by zero" warnings.)

MFC after: 3 days

7 years agoHonor the CLK_SET_DRYRUN for the *set_freq function for allwinner clocks.
manu [Fri, 16 Dec 2016 21:58:48 +0000 (21:58 +0000)]
Honor the CLK_SET_DRYRUN for the *set_freq function for allwinner clocks.

Reviewed by: jmcneill
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8821

7 years agoEnable EARLY_AP_STARTUP on amd64 and i386 kernels by default.
jhb [Fri, 16 Dec 2016 21:10:37 +0000 (21:10 +0000)]
Enable EARLY_AP_STARTUP on amd64 and i386 kernels by default.

PR: 199321, 203682
MFC after: 2 months
Sponsored by: Netflix

7 years agoRemove extra DOF_SEC_XLIMPORT from the DOF_SEC_ISLOADABLE macro
gnn [Fri, 16 Dec 2016 20:44:14 +0000 (20:44 +0000)]
Remove extra DOF_SEC_XLIMPORT from the DOF_SEC_ISLOADABLE macro

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoAdd support for Ingenic JZ4780 SMBus controller.
jmcneill [Fri, 16 Dec 2016 20:04:56 +0000 (20:04 +0000)]
Add support for Ingenic JZ4780 SMBus controller.

Reviewed by: kan
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8793

7 years agoAdd __scanflike attributes to the kernel's sscanf() and vsscanf()
dim [Fri, 16 Dec 2016 19:49:22 +0000 (19:49 +0000)]
Add __scanflike attributes to the kernel's sscanf() and vsscanf()
declarations.  This should help to catch future mismatches between
format strings and arguments.

MFC after: 1 week

7 years ago[spigen] Make "data" part of spigen_transfer optional
gonzo [Fri, 16 Dec 2016 19:09:57 +0000 (19:09 +0000)]
[spigen] Make "data" part of spigen_transfer optional

Make st_data part of spigen_transfer optional by letting pass zero length
and NULL pointer. SPI controller drivers handle this case fine.

MFC after: 1 week

7 years agoMerge ^/head r309817 through r310168.
dim [Fri, 16 Dec 2016 18:38:31 +0000 (18:38 +0000)]
Merge ^/head r309817 through r310168.

7 years agoMerge llvm, clang, lld, lldb, compiler-rt and libc++ 3.9.1 release
dim [Fri, 16 Dec 2016 18:30:53 +0000 (18:30 +0000)]
Merge llvm, clang, lld, lldb, compiler-rt and libc++ 3.9.1 release
r289601.

7 years agoretain cc.4.gz man page for Chelsio T6 NICs
lifanov [Fri, 16 Dec 2016 17:44:56 +0000 (17:44 +0000)]
retain cc.4.gz man page for Chelsio T6 NICs

This man page was removed in r225583 when cc.4 was renamed to mod_cc.4
With reintroduction of cc.4 "make installworld; make delete-old" was
no longer convergent.

Reported by: Trond Endrestøl
Reviewed by: np, matthew
Approved by: np, matthew (mentor)
Differential Revision: https://reviews.freebsd.org/D8816

7 years agoSwitch from stdatomic.h to atomic.h for kernel.
kib [Fri, 16 Dec 2016 17:41:20 +0000 (17:41 +0000)]
Switch from stdatomic.h to atomic.h for kernel.

Apparently stdatomic.h implementation for gcc 4.2 on sparc64 does not
work properly.  This effectively reverts r251803.

Reported and tested by: lidl
Discussed with: ed
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix typo.
kib [Fri, 16 Dec 2016 14:23:08 +0000 (14:23 +0000)]
Fix typo.

MFC after: 3 days

7 years agoAdd support to read the _CLS entry if it's present. It is used by
andrew [Fri, 16 Dec 2016 10:40:00 +0000 (10:40 +0000)]
Add support to read the _CLS entry if it's present. It is used by
memory-mapped devices that are normally PCIe drives. Devices can then use
the existing pci_get_class, etc. accessors to query this data.

The ivar values are different enough from the existing ACPI and ISA values
to not conflict.

Reviewed by: jhb
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8721

7 years agoAll armv6 platforms have the same implementation of platform_lastaddr.
andrew [Fri, 16 Dec 2016 10:31:13 +0000 (10:31 +0000)]
All armv6 platforms have the same implementation of platform_lastaddr.
Replace them with a default handler that returns devmap_lastaddr.

Reviewed by: mmel
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D8806

7 years agocxgbe(4): Fix typo in an unused macro.
np [Fri, 16 Dec 2016 06:30:07 +0000 (06:30 +0000)]
cxgbe(4): Fix typo in an unused macro.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agocxgbe(4): Changes to the default T6 firmware configuration file.
np [Fri, 16 Dec 2016 06:25:51 +0000 (06:25 +0000)]
cxgbe(4): Changes to the default T6 firmware configuration file.

- Disable features that are not supported or not used on FreeBSD.
- Increase the RSS table slice per interface.
- Increase the share of the TCAM reserved for filtering.

MFH: 2 weeks
Sponsored by: Chelsio Communications

7 years agoFix disassembly by adding back some deleted lines.
jhibbits [Fri, 16 Dec 2016 04:47:29 +0000 (04:47 +0000)]
Fix disassembly by adding back some deleted lines.

When importing for r309309, as part of conflict resolution, too much extra was
removed, resulting in bad disassembly for branches.  Correct this.

Also re-apply the 0->NULL change from r298052.

X-MFC-With: r309309

7 years agoBump FreeBSD_version .
adrian [Fri, 16 Dec 2016 04:44:46 +0000 (04:44 +0000)]
Bump FreeBSD_version .

7 years ago[net80211] sigh, course I would miss a commit from the 11ac prep commit.
adrian [Fri, 16 Dec 2016 04:44:14 +0000 (04:44 +0000)]
[net80211] sigh, course I would miss a commit from the 11ac prep commit.

7 years ago[net80211] start laying down the foundation for 11ac support.
adrian [Fri, 16 Dec 2016 04:43:31 +0000 (04:43 +0000)]
[net80211] start laying down the foundation for 11ac support.

This is a work in progress and some of this stuff may change;
but hopefully I'm laying down enough stuff and space in fields
to allow it to grow without another major recompile.

We'll see!

* Add a net80211 PHY type for VHT 2G and VHT 5G.

  Note - yes, VHT is supposed to be for 5GHZ, however some vendors
  (*cough* most of them) support some subset of VHT rate support
  in 2GHz.  No - not 80MHz wide channels, but at least some MCS8-9
  support, maybe some beamforming, and maybe some longer A-MPDU
  aggregates.  I don't want to even think about MU-MIMO on 2GHz.

* Add an ifmedia placeholder type for VHT rates.

* Add channel flags for VHT, VHT20/40U/40D/80/80+80/160
* Add channel macros for the above
* Add ieee80211_channel fields for the VHT information and flags,
  along with some padding (so this struct definitely grows.)
* Add a phy type flag for VHT - 'v'

* Bump the number of channels to a much higher amount - until we get
  something like the linux mac80211 chanctx abstraction (where the
  stack provides a current channel configuration via callbacks,
  versus the driver ever checking ic->ic_curchan or similar) we'll
  have to populate VHT+HT combinations.

Eg, there'll likely be a full set of duplicate VHT20/40 channels to match
HT channels.  There will also be a full set of duplicate VHT80 channels -
note that for VHT80, its assumed you're doing VHT40 as a base, so we
don't need a duplicate of VHT80 + 20MHz only primary channels, only
a duplicate of all the VHT40 combinations.

I don't want to think about VHT80+80 or VHT160 for now - and I won't,
as the current device I'm doing 11ac bringup on (QCA9880) only does
VHT80.

I'll likely revisit the channel configuration and scanning related
stuff after I get VHT20/40 up.

* Add vht flags and the basic MCS rate setup to ieee80211com, ieee80211vap
  and ieee80211_node in preparation for 11ac configuration.
  There is zero code that uses this right now.
* Whilst here, add some more placeholders in case I need to extend
  out things by some uint32_t flag sized fields.  Hopefully I won't!

What I haven't yet done:

* any of the code that uses this
* any of the beamforming related fields
* any of the MU-MIMO fields required for STA/AP operation
* any of the IE fields in beacon frame / probe request/response handling
  and the calculations required for shifting beacon contents around
  when the TIM grows/shrinks

This will require a full rebuild of net80211 related programs -
ifconfig, hostapd, wpa_supplicant.

7 years agoUse the right bitwise OR operation for clearing single-step at trap time.
jhibbits [Fri, 16 Dec 2016 04:38:53 +0000 (04:38 +0000)]
Use the right bitwise OR operation for clearing single-step at trap time.

DBCR0_IDM || DBCRO_IC yields 1, which in this register is DBCR0_FT, not what we
want.
Reported by: Mark Millard
MFC after: 2 weeks

7 years agoident(1): Capsicumify
cem [Fri, 16 Dec 2016 02:09:48 +0000 (02:09 +0000)]
ident(1): Capsicumify

Preopen input file list before entering Capsicum capability mode.

Feedback by: allanjude@, bapt@, emaste@ (earlier versions)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7918

7 years agoiconv(1): Capsicumify
cem [Fri, 16 Dec 2016 02:06:34 +0000 (02:06 +0000)]
iconv(1): Capsicumify

This takes the usual shortcut of only sandboxing the last input file.
It's a first cut and this program will be easy to adapt to sandbox all
files in the future.

iconv(1) has been changed to only open the conversion descriptor once,
since the input and output encodings are fixed over all inputs.
Instead, the descriptor is simply reset after each use (documented in
iconv(3) API).

Reviewed by: no one, unfortunately
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7917

7 years agohexdump(1): First cut capsicumification
cem [Fri, 16 Dec 2016 02:03:40 +0000 (02:03 +0000)]
hexdump(1): First cut capsicumification

For now, only enter the sandbox for the last file processed (including
stdin for zero-argument mode).

Sandboxing all inputs will require a little restructuring of the
program.

Feedback by: emaste@ (earlier versions)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7915

7 years agoktrdump(8): Capsicumify
cem [Fri, 16 Dec 2016 01:59:28 +0000 (01:59 +0000)]
ktrdump(8): Capsicumify

We restrict the (optional) input file and output files. It would be
nice to restrict the KVM files, but that's up to libkvm.

We wait until after kvm_nlist() is invoked to cap_enter() because
kldsym() isn't supported in the Capsicum sandbox.

Feedback from: emaste@ (earlier versions)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7921

7 years agoministat(1): Capsicumify
cem [Fri, 16 Dec 2016 01:51:12 +0000 (01:51 +0000)]
ministat(1): Capsicumify

Separate dataset opening from reading/parsing. The number of input
files is already capped to a small number, so just open all input files
before sandboxing.

Feedback from: allanjude@ (earlier version), emaste@ (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7925

7 years agodma-mbox-create: Restrict with Capsicum
cem [Fri, 16 Dec 2016 01:48:55 +0000 (01:48 +0000)]
dma-mbox-create: Restrict with Capsicum

The restriction here is pretty late and pretty minimal. We need a lot
of authority to open password databases, and don't do much after that
point.

Feedback from: lifanov at mail.lifanov.com (earlier version), emaste (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7988

7 years agoCapsicumify last(1)
cem [Fri, 16 Dec 2016 01:47:08 +0000 (01:47 +0000)]
Capsicumify last(1)

Reviewed by: ed (earlier version), emaste (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8001

7 years agovfprintf(3): Add support for kernel %b format
cem [Fri, 16 Dec 2016 01:44:50 +0000 (01:44 +0000)]
vfprintf(3): Add support for kernel %b format

This is a direct port of the kernel %b format.

I'm unclear on if (more) non-portable printf extensions will be a
problem. I think it's desirable to have userspace formats include all
kernel formats, but there may be competing goals I'm not aware of.

Reviewed by: no one, unfortunately
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8426

7 years agogelf_getphdr: Allow extended indices
cem [Fri, 16 Dec 2016 01:42:51 +0000 (01:42 +0000)]
gelf_getphdr: Allow extended indices

Needed for 'readelf -l' of extended phnum files.  (Parity with GNU
binutils.)

Reviewed by: no one, unfortunately
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8703

7 years agolibelf: Fix extended numbering detection
cem [Fri, 16 Dec 2016 01:39:06 +0000 (01:39 +0000)]
libelf: Fix extended numbering detection

Extended numbering is used for any of these fields overflowing.

Reviewed by: emaste@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8701

7 years agocapsicum_helpers: Add LOOKUP flag
cem [Fri, 16 Dec 2016 01:37:44 +0000 (01:37 +0000)]
capsicum_helpers: Add LOOKUP flag

Add a helper routine for opening a directory that is restricted to being
used for opening relative files as stdio streams.

I think this will really help basic adaptation of multi-file programs to
Capsicum. Rather than having each program initialize a rights object and
ioctl/fcntl arrays for their root fd for relative opens, consolidate in the
logical place.

Reviewed by: oshogbo@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8743

7 years agolibbfd: make sure variables are initialized before using them.
pfg [Fri, 16 Dec 2016 00:35:59 +0000 (00:35 +0000)]
libbfd: make sure variables are initialized before using them.

Initialize l_sec_contents to make sure that free(l_sec_contents) is called
on valid pointers.

Obtained from: OpenBSD (partial CVS rev 1.18)
MFC after: 5 days

7 years agolibbfd: drop unnecessary variable increment.
pfg [Fri, 16 Dec 2016 00:23:59 +0000 (00:23 +0000)]
libbfd: drop unnecessary variable increment.

Do not increment `s' before it is initialized. At the time
of the increment, `s' is otherwise unused anyway.

Obtained from: OpenBSD (CVS rev 1.11)

7 years ago[ar933x] don't waste memory/flash; drop the UMTX_CHAINS count down to 16.
adrian [Fri, 16 Dec 2016 00:04:32 +0000 (00:04 +0000)]
[ar933x] don't waste memory/flash; drop the UMTX_CHAINS count down to 16.

7 years agoAdd WITH_REPRODUCIBLE_BUILD src.conf(5) knob to disable kernel metadata
emaste [Thu, 15 Dec 2016 21:26:58 +0000 (21:26 +0000)]
Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob to disable kernel metadata

The kernel builds reproducibly, except for the time, date, user, and
hostname baked into the kernel (reported at startup and via the
kern.version sysctl for uname).  Add a build knob to disable the
inclusion of this metadata.

Reviewed by: jhb
MFC after: 1 month
Relnotes: Yes
Sponsored by: Reproducible Builds World Summit 2, Berlin
Differential Revision: https://reviews.freebsd.org/D8809

7 years agoAdd -fPIC to the ubldr build. Without this the self relocation code will
andrew [Thu, 15 Dec 2016 17:36:54 +0000 (17:36 +0000)]
Add -fPIC to the ubldr build. Without this the self relocation code will
try to use an absolute address in a switch statement, jumping to an invalid
memory location.

Sponsored by: ABT Systems Ltd

7 years agoFix building arm64 kernel after r310117
manu [Thu, 15 Dec 2016 17:26:16 +0000 (17:26 +0000)]
Fix building arm64 kernel after r310117

Pointy hat: me

MFC after: 3 days

7 years agoFix ls_tests:o_flag with ZFS TMPDIR
asomers [Thu, 15 Dec 2016 16:13:52 +0000 (16:13 +0000)]
Fix ls_tests:o_flag with ZFS TMPDIR

Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is
updated. The test must explicitly clear uarch to be portable across
filesystems. Also, it doesn't need to run as root.

PR: 215179
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8741

7 years agoAdd information about interrupts in the Allwinner padconf files and
manu [Thu, 15 Dec 2016 15:52:13 +0000 (15:52 +0000)]
Add information about interrupts in the Allwinner padconf files and
correct some pin numbering.

While here switch to my freebsd mail address in the copyright.

MFC after: 3 days

7 years agoDocument the existence of the {0, 6, ...} sysctl.
ed [Thu, 15 Dec 2016 15:45:11 +0000 (15:45 +0000)]
Document the existence of the {0, 6, ...} sysctl.

7 years agoUpdate vendor/libarchive to git to 30528ed7a9f479f1c363ee8cfa1c5eb4c7d9be10
mm [Thu, 15 Dec 2016 15:35:53 +0000 (15:35 +0000)]
Update vendor/libarchive to git to 30528ed7a9f479f1c363ee8cfa1c5eb4c7d9be10

Vendor bugfixes:

PR 826: OpenSSL 1.1 support
PR 830, 831, 833: Spelling fixes
OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free()
OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives

7 years agonewvers.sh: correct typo in comment
emaste [Thu, 15 Dec 2016 15:14:02 +0000 (15:14 +0000)]
newvers.sh: correct typo in comment

Submitted by: lidl

7 years agoDirectly include openfirm.h rather than through fdt_common.h as none of the
andrew [Thu, 15 Dec 2016 13:31:44 +0000 (13:31 +0000)]
Directly include openfirm.h rather than through fdt_common.h as none of the
latter file is needed.

Sponsored by: ABT Systems Ltd

7 years agonewvers.sh: add option to eliminate kernel build metadata
emaste [Thu, 15 Dec 2016 12:57:03 +0000 (12:57 +0000)]
newvers.sh: add option to eliminate kernel build metadata

Build metadata (username, hostname, etc.) prevents the FreeBSD kernel
from building reproducibly. Add an option to disable inclusion of that
metadata but retain the release information and SVN/git VCS details.
See https://reproducible-builds.org/ for additional background.

Reviewed by: bapt
Obtained from: NetBSD
MFC after: 1 month
Sponsored by: Reproducible Builds World Summit 2, Berlin
Differential Revision: https://reviews.freebsd.org/D4347