]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge ^/head r311460 through r311545.
Dimitry Andric [Fri, 6 Jan 2017 20:33:48 +0000 (20:33 +0000)]
Merge ^/head r311460 through r311545.

7 years agoUpdate clang and lld Version.inc files.
Dimitry Andric [Fri, 6 Jan 2017 20:25:08 +0000 (20:25 +0000)]
Update clang and lld Version.inc files.

7 years agoMerge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.
Dimitry Andric [Fri, 6 Jan 2017 20:24:06 +0000 (20:24 +0000)]
Merge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.

7 years agoVendor import of llvm trunk r291274:
Dimitry Andric [Fri, 6 Jan 2017 20:13:21 +0000 (20:13 +0000)]
Vendor import of llvm trunk r291274:
https://llvm.org/svn/llvm-project/llvm/trunk@291274

7 years agotmpfs: perform a lockless check in tmpfs_itimes
Mateusz Guzik [Fri, 6 Jan 2017 19:58:20 +0000 (19:58 +0000)]
tmpfs: perform a lockless check in tmpfs_itimes

Most of the time the status is 0 as the function is repeatedly
called from tmpfs_getattr.

7 years agoFix clang 4.0.0 warnings about taking the address of a packed member of
Dimitry Andric [Fri, 6 Jan 2017 18:41:28 +0000 (18:41 +0000)]
Fix clang 4.0.0 warnings about taking the address of a packed member of
struct ip in ping(8):

sbin/ping/ping.c:1684:53: error: taking address of packed member
'ip_src' of class or structure 'ip' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
        (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr));
                                                           ^~~~~~~~~~~~~~~~~
sbin/ping/ping.c:1685:53: error: taking address of packed member
'ip_dst' of class or structure 'ip' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
        (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr));
                                                           ^~~~~~~~~~~~~~~~~

MFC after: 3 days

7 years agoRemove '-vd' option to make iasl(8) reproducible.
Jung-uk Kim [Fri, 6 Jan 2017 18:08:53 +0000 (18:08 +0000)]
Remove '-vd' option to make iasl(8) reproducible.

PR: 215421

7 years agoShow that the crunchgen configuration file name is not optional.
Warren Block [Fri, 6 Jan 2017 18:04:34 +0000 (18:04 +0000)]
Show that the crunchgen configuration file name is not optional.

PR: 215087
Submitted by: Iblis Lin <iblis@hs.ntnu.edu.tw>
MFC after: 1 week
Sponsored by: iXsystems

7 years agotmpfs: enabled MNTK_EXTENDED_SHARED
Mateusz Guzik [Fri, 6 Jan 2017 18:01:46 +0000 (18:01 +0000)]
tmpfs: enabled MNTK_EXTENDED_SHARED

Discussed with: kib

7 years agoLock tmpfs node tn_status updates done under the shared vnode lock.
Konstantin Belousov [Fri, 6 Jan 2017 17:43:36 +0000 (17:43 +0000)]
Lock tmpfs node tn_status updates done under the shared vnode lock.

If tmpfs vnode is only shared locked, tn_status field still needs
updates to note the access time modification.  Use the same locking
scheme as for UFS, protect tn_status with the node interlock + shared
vnode lock.

Fix nearby style.

Noted and reviewed by: mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse vnode lock assertion expression, and upgrade it to assert the
Konstantin Belousov [Fri, 6 Jan 2017 17:32:44 +0000 (17:32 +0000)]
Use vnode lock assertion expression, and upgrade it to assert the
required exclusive state of the vnode lock in tmpfs chflags, chmod,
chown, chsize, chtimes operations.

Fix nearby style.

Reviewed by: mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove dead code.
Konstantin Belousov [Fri, 6 Jan 2017 17:03:08 +0000 (17:03 +0000)]
Remove dead code.

Fifos overwrite file ops vector, and fifo VOP_KQFILTER is VOP_PANIC().

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse type-independent formats for printing nlink_t and ino_t.
Konstantin Belousov [Fri, 6 Jan 2017 16:59:33 +0000 (16:59 +0000)]
Use type-independent formats for printing nlink_t and ino_t.

Extracted from: ino64 work by gleb, mckusick
Discussed with: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoExplicitely add "opt_compat.h" to kern_exec.c: fix powerpc LINT builds.
Konstantin Belousov [Fri, 6 Jan 2017 16:56:24 +0000 (16:56 +0000)]
Explicitely add "opt_compat.h" to kern_exec.c: fix powerpc LINT builds.

sys/ptrace.h includes sys/signal.h, which includes sys/_sigset.h.
Note that sys/_sigset.h only defines osigset_t if COMPAT_43 was defined.

Two lines later, sys/ptrace.h includes machine/reg.h, which in case of
powerpc, includes opt_compat.h.

After the include headers reordering in r311345, we have sys/ptrace.h
included before sys/sysproto.h.

If COMPAT_43 was requested in the kernel config, the result is that
sys/_sigset.h does not define osigset_t, but sys/sysproto.h sees
COMPAT_43 and uses osigset_t.

Fix this by explicitely including opt_compat.h to cover the whole
kern/kern_exec.c scope.

Sponsored by: The FreeBSD Foundation

7 years agoFix src.conf(5) description of WITHOUT_USB_GADGET_EXAMPLES.
Warren Block [Fri, 6 Jan 2017 16:43:45 +0000 (16:43 +0000)]
Fix src.conf(5) description of WITHOUT_USB_GADGET_EXAMPLES.

PR: 215831
Submitted by: p5B2E9A8F@t-online.de
MFC after: 1 week
Sponsored by: iXsystems

7 years agoAdd new USB device ID.
Kevin Lo [Fri, 6 Jan 2017 14:05:31 +0000 (14:05 +0000)]
Add new USB device ID.

7 years agoAdd some more mode page fields.
Alexander Motin [Fri, 6 Jan 2017 13:12:56 +0000 (13:12 +0000)]
Add some more mode page fields.

MFC after: 2 weeks

7 years agoAdd integration makefile for contrib/bsnmp/gensnmpdef
Enji Cooper [Fri, 6 Jan 2017 10:15:17 +0000 (10:15 +0000)]
Add integration makefile for contrib/bsnmp/gensnmpdef

It's a whole lot less error prone than generating the file completely
by hand.

MFC after: 1 week

7 years agoRemove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..)
Enji Cooper [Fri, 6 Jan 2017 07:57:45 +0000 (07:57 +0000)]
Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..)

MFC after: 3 days

7 years agoMFV r311477: xz 5.2.3.
Xin LI [Fri, 6 Jan 2017 07:54:53 +0000 (07:54 +0000)]
MFV r311477: xz 5.2.3.

MFC after: 2 weeks

7 years agoVendor import of xz-5.2.3 (trimmed).
Xin LI [Fri, 6 Jan 2017 06:35:21 +0000 (06:35 +0000)]
Vendor import of xz-5.2.3 (trimmed).

7 years agoif: Defer the if_up until the ifnet.if_ioctl is called.
Sepherosa Ziehau [Fri, 6 Jan 2017 05:10:49 +0000 (05:10 +0000)]
if: Defer the if_up until the ifnet.if_ioctl is called.

This ensures the interface is initialized by the interface driver
before it can be used by the rest of the system.

Reviewed by: jhb, karels, gnn
MFC after: 3 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8905

7 years agoUse getsock_cap() instead of fgetsock().
Gleb Smirnoff [Fri, 6 Jan 2017 04:38:38 +0000 (04:38 +0000)]
Use getsock_cap() instead of fgetsock().

Reviewed by: dchagin

7 years agoConditionalize all code that uses tcpd.h behind `LIBWRAP` guard
Enji Cooper [Fri, 6 Jan 2017 04:27:07 +0000 (04:27 +0000)]
Conditionalize all code that uses tcpd.h behind `LIBWRAP` guard

This will allow the code to stand by itself without libwrap

MFC after: 2 weeks

7 years agoConditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
Enji Cooper [Fri, 6 Jan 2017 04:22:25 +0000 (04:22 +0000)]
Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into amd(8).

MFC after: 2 weeks

7 years agoConditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
Enji Cooper [Fri, 6 Jan 2017 04:16:03 +0000 (04:16 +0000)]
Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into sendmail.

MFC after: 2 weeks

7 years agoConditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
Enji Cooper [Fri, 6 Jan 2017 04:13:08 +0000 (04:13 +0000)]
Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into rpcbind.

MFC after: 2 weeks

7 years agoConditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
Enji Cooper [Fri, 6 Jan 2017 04:10:33 +0000 (04:10 +0000)]
Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into ypserv.

MFC after: 2 weeks

7 years agoAdd uintmax_t casts to silence printf format warnings.
John Baldwin [Fri, 6 Jan 2017 00:41:30 +0000 (00:41 +0000)]
Add uintmax_t casts to silence printf format warnings.

The format strings weren't checked when stacksave_subr() used a function
pointer for printf instead of directly using db_printf().

Reported by: kib
Sponsored by: DARPA / AFRL

7 years agoRemove redundant cache initialization in JZ4780 SMP startup code
Alexander Kabaev [Fri, 6 Jan 2017 00:07:36 +0000 (00:07 +0000)]
Remove redundant cache initialization in JZ4780 SMP startup code

This was done out of pure paranoia when hunting for bugs in cache
and is not really required.

7 years agoMerge ACPICA 20161222.
Jung-uk Kim [Thu, 5 Jan 2017 21:28:25 +0000 (21:28 +0000)]
Merge ACPICA 20161222.

7 years agoAlso remove unnecessary extern keywords from tcpd.h.
Dimitry Andric [Thu, 5 Jan 2017 21:17:10 +0000 (21:17 +0000)]
Also remove unnecessary extern keywords from tcpd.h.

Noticed by: kib
X-MFC-With: r311459

7 years agoMerge ^/head r311314 through r311459.
Dimitry Andric [Thu, 5 Jan 2017 20:50:44 +0000 (20:50 +0000)]
Merge ^/head r311314 through r311459.

7 years agoPut proper prototypes in tcpd.h
Dimitry Andric [Thu, 5 Jan 2017 20:44:45 +0000 (20:44 +0000)]
Put proper prototypes in tcpd.h

Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:

    /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int hosts_access();              /* access control */
                           ^

To fix this, turn these declarations into real prototypes.  While here,
garbage collect the incompatible rfc931() function from scaffold.c, as
it is never used.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9052

7 years agoUse compiler driver to link BERI boot loaders
Alexander Kabaev [Thu, 5 Jan 2017 19:17:14 +0000 (19:17 +0000)]
Use compiler driver to link BERI boot loaders

Do not hardcode elf64-tradbigmips as output format in BERI linker scrips.
Unfortunately, in-tree toolchain and external newer versions of binutils
mean two different things under that. When creating elf binaries using
external toolchain, gcc uses elf64-tradbigmips-freebsd and so linker
script file has to match in order for ld to be able to create the final loader
binary.

Rather than trying to guess, remove hardcoded output format directive from
the linker directive files and use CC to invoke the linker instead.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D9050

7 years agoDisable the new -Waddress-of-packed-member warning for WARNS <= 1.
Dimitry Andric [Thu, 5 Jan 2017 18:32:53 +0000 (18:32 +0000)]
Disable the new -Waddress-of-packed-member warning for WARNS <= 1.

7 years agoAdjust version numbers for the clang library directory.
Dimitry Andric [Thu, 5 Jan 2017 18:32:18 +0000 (18:32 +0000)]
Adjust version numbers for the clang library directory.

7 years agoAdd DTS file for Armada 385 DB-AP board
Zbigniew Bodek [Thu, 5 Jan 2017 17:27:50 +0000 (17:27 +0000)]
Add DTS file for Armada 385 DB-AP board

Armada38x is already supported in the tree.
This commit adds support for DB-AP board.
File was taken from Linux v4.8 and accustomed to FreeBSD
in minimal possible way.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D7327

7 years agoAdd DTS file for Solidrun ClearFog board
Zbigniew Bodek [Thu, 5 Jan 2017 17:25:16 +0000 (17:25 +0000)]
Add DTS file for Solidrun ClearFog board

ClearFog is equipped with Marvell Armada 388 SoC, which is already
supported in FreeBSD.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D7326

7 years agosysctl net.inet.tcp.hostcache.list in a jail can see connections from other
Hiren Panchasara [Thu, 5 Jan 2017 17:22:09 +0000 (17:22 +0000)]
sysctl net.inet.tcp.hostcache.list in a jail can see connections from other
jails and the host. This commit fixes it.

PR: 200361
Submitted by: bz (original version), hiren (minor corrections)
Reported by: Marcus Reid <marcus at blazingdot dot com>
Reviewed by: bz, gnn
Tested by: Lohith Bellad <lohithbsd at gmail dot com>
MFC after: 1 week
Sponsored by: Limelight Networks (minor corrections)

7 years agoDo not allocate struct statfs on kernel stack.
Konstantin Belousov [Thu, 5 Jan 2017 17:19:26 +0000 (17:19 +0000)]
Do not allocate struct statfs on kernel stack.

Right now size of the structure is 472 bytes on amd64, which is
already large and stack allocations are indesirable.  With the ino64
work, MNAMELEN is increased to 1024, which will make it impossible to have
struct statfs on the stack.

Extracted from: ino64 work by gleb
Discussed with: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoCorrect CESA node in armada-38x.dtsi
Zbigniew Bodek [Thu, 5 Jan 2017 17:14:56 +0000 (17:14 +0000)]
Correct CESA node in armada-38x.dtsi

CESA resources were invalid, what caused driver to fail
during attach call.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D8180

7 years agoAdd buffer management entries to armada-38x.dtsi
Zbigniew Bodek [Thu, 5 Jan 2017 17:12:53 +0000 (17:12 +0000)]
Add buffer management entries to armada-38x.dtsi

Hardware buffer management entries are not used yet by FreeBSD.
They were added for compliance with Linux Armada 38x device tree
representation and will be used in future network support.

Submitted by:  Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Stormshield
Differential revision: https://reviews.freebsd.org/D8179

7 years agoInclude e6000sw driver in ARMADA38X configuration
Zbigniew Bodek [Thu, 5 Jan 2017 17:10:52 +0000 (17:10 +0000)]
Include e6000sw driver in ARMADA38X configuration

e6000sw Marvell switch driver was added to files
and Armada38x kernel configuration file.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D8178

7 years agoImprove ports handling in e6000sw driver
Zbigniew Bodek [Thu, 5 Jan 2017 17:08:10 +0000 (17:08 +0000)]
Improve ports handling in e6000sw driver

- recognize ports and vlangroups based on DTS file
- support multi-chip addresing mode (required in upcoming
  Armada-388-Clearfog support)
- refactor attachment function

Each port in 'dsa' node should have 'vlangroup' property. Otherwise,
e6000sw will fail to attach.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Konrad Adamczyk <ka@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D7328

7 years agoSome style fixes for getfstat(2)-related code.
Konstantin Belousov [Thu, 5 Jan 2017 17:03:35 +0000 (17:03 +0000)]
Some style fixes for getfstat(2)-related code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix bootverbose affecting code logic in r294558.
Alexander Motin [Thu, 5 Jan 2017 16:30:13 +0000 (16:30 +0000)]
Fix bootverbose affecting code logic in r294558.

Reported by: Jilles Tjoelker <jilles@stack.nl>

7 years agoFix typo from r311349
Alan Somers [Thu, 5 Jan 2017 15:07:04 +0000 (15:07 +0000)]
Fix typo from r311349

Reported by: lwhsu
Pointy-hat-to: asomers
MFC after: 4 weeks
X-MFC-with: 311349

7 years agoWhen displaying netstat details with libxo in JSON
Hajimu UMEMOTO [Thu, 5 Jan 2017 11:44:27 +0000 (11:44 +0000)]
When displaying netstat details with libxo in JSON
or XML modes, the value conversion for tcp6 and udp6
port numbers drops last digit.

PR: 215682
MFC after: 3 days

7 years agoop_usm_users: don't deref uusers if it's NULL when SETting the value
Enji Cooper [Thu, 5 Jan 2017 09:46:36 +0000 (09:46 +0000)]
op_usm_users: don't deref uusers if it's NULL when SETting the value

Add an XXX comment to note that the conditional seems suspect given
how it's handled elsewhere in the SNMP_OP_SET case.

MFC after: 2 weeks
Reported by: Coverity
CID: 1008573

7 years agoOS_getSystemUptime: use nitems for calculating the number of elements
Enji Cooper [Thu, 5 Jan 2017 09:28:38 +0000 (09:28 +0000)]
OS_getSystemUptime: use nitems for calculating the number of elements
in a sysctl mib instead of hardcoding the number 2

MFC after: 3 days

7 years agoUse strlcpy and snprintf in netstat(1).
Xin LI [Thu, 5 Jan 2017 09:23:54 +0000 (09:23 +0000)]
Use strlcpy and snprintf in netstat(1).

Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf
in various places.

Reported by: Anton Yuzhaninov <citrin citrin ru>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8916

7 years agosnmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails
Enji Cooper [Thu, 5 Jan 2017 08:49:06 +0000 (08:49 +0000)]
snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails

MFC after: 1 week
Reported by: Coverity
CID: 1017276

7 years agoop_usm_users: fix indentation in SNMP_OP_SET block
Enji Cooper [Thu, 5 Jan 2017 08:27:23 +0000 (08:27 +0000)]
op_usm_users: fix indentation in SNMP_OP_SET block

MFC after: 3 days

7 years agoUse calloc instead of malloc + memset(.., 0, ..)
Enji Cooper [Thu, 5 Jan 2017 08:17:17 +0000 (08:17 +0000)]
Use calloc instead of malloc + memset(.., 0, ..)

MFC after: 3 days

7 years agolsock_init_port: address issues with initializing sockaddr_un object
Enji Cooper [Thu, 5 Jan 2017 08:14:20 +0000 (08:14 +0000)]
lsock_init_port: address issues with initializing sockaddr_un object

- Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*].
- Use SUN_LEN(..) instead of spelling out calculation longhand (inspired
  by comment by jmallett).

Tested with: dgram and stream support with both bsnmpwalk and snmpwalk

MFC after: 1 week
Reported by: Coverity
CID: 1006825

7 years agolm_load: fix string copying issues
Enji Cooper [Thu, 5 Jan 2017 07:55:17 +0000 (07:55 +0000)]
lm_load: fix string copying issues

- Ensure `section` doesn't overrun section by using strlcpy instead of
  strcpy [*].
- Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity,
  but is an opportunistic change).

MFC after: 1 week
Reported by: Coverity
CID: 1006826 [*]

7 years agoRedo fix for CID 979581
Enji Cooper [Thu, 5 Jan 2017 07:46:57 +0000 (07:46 +0000)]
Redo fix for CID 979581

The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].

SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.

Reported by: jilles, jmallett
MFC after: 2 days
X-MFC with: r311233

7 years ago[net80211] correct VHT ieee80211com state bits.
Adrian Chadd [Thu, 5 Jan 2017 05:03:11 +0000 (05:03 +0000)]
[net80211] correct VHT ieee80211com state bits.

* rename the ieee80211com field for vht mcsinfo to be ic_, not iv;
* add a vht config field, stealing from the spares I left there.

This doesn't change the ABI.

7 years ago[ath_hal] mad, mad hacks to get some semblence of correct HT/40 channels populated.
Adrian Chadd [Thu, 5 Jan 2017 04:56:04 +0000 (04:56 +0000)]
[ath_hal] mad, mad hacks to get some semblence of correct HT/40 channels populated.

The HT40 channel population logic was "just" doing pairs of channels starting with
the band entry frequency.  Trouble is, a lot of the rules start way off at 5120MHz,
which isn't a valid 5GHz channel.  Then, eg for HT40U, it would populate:

* (5120,5140)
* (5160,5180)
* (5200,5220)
* (5240,5260)

.. as the HT40U pairs, with the first being the primary channel.  Channel 36
is 5180MHz, and since it's not a primary channel here, it wouldn't populate it.
Then, the next HT40U would be 5200/5220, which is highly wrong.

HT40D had the same problem.

So, this just forces that 5GHz HT40 channels start at channel 36 (5180),
no matter what the band edge says.  This includes eg doing 4.9GHz channels.

This erm, meant that the HT40 channels for the low band was always wrong.

Oops!

Tested:

* AR9380, STA mode
* AR9344 SoC, AP mode

MFC after: 1 week

7 years ago[net80211] add VHT media types in the media layer.
Adrian Chadd [Thu, 5 Jan 2017 04:49:23 +0000 (04:49 +0000)]
[net80211] add VHT media types in the media layer.

7 years agoFix build when WITHOUT_INET6 is defined.
Hiroki Sato [Thu, 5 Jan 2017 03:25:16 +0000 (03:25 +0000)]
Fix build when WITHOUT_INET6 is defined.

7 years agoRemove a redundant use of min().
Mark Johnston [Thu, 5 Jan 2017 03:13:45 +0000 (03:13 +0000)]
Remove a redundant use of min().

Reported by: rpokala
X-MFC With: r311346

7 years agoIn the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ in
Ravi Pokala [Thu, 5 Jan 2017 03:08:57 +0000 (03:08 +0000)]
In the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ in
several more drivers.

Sponsored by: Panasas

7 years agoFix whitespace in handling of XPT_PATH_INQ in adw(4).
Ravi Pokala [Thu, 5 Jan 2017 02:54:03 +0000 (02:54 +0000)]
Fix whitespace in handling of XPT_PATH_INQ in adw(4).

Came across this while doing some other minor CAM cleanup. Whitespace-only
change, so not bothering w/ a review.

Sponsored by: Panasas

7 years agotabs -> spaces in etc/mtree
Alan Somers [Thu, 5 Jan 2017 02:47:56 +0000 (02:47 +0000)]
tabs -> spaces in etc/mtree

MFC after: 4 weeks

7 years agoAdd a reasonable bound on the symbol table index size.
Mark Johnston [Thu, 5 Jan 2017 02:33:10 +0000 (02:33 +0000)]
Add a reasonable bound on the symbol table index size.

7 years agoIn rtl8188eu, read R92C_HSSI_PARAM2(0)) register to detect whether it needs
Kevin Lo [Thu, 5 Jan 2017 02:04:53 +0000 (02:04 +0000)]
In rtl8188eu, read R92C_HSSI_PARAM2(0)) register to detect whether it needs
to enable CCK high power feature or not.

Reviewed by: avos

7 years agoAdd a small allocator for exec_map entries.
Mark Johnston [Thu, 5 Jan 2017 01:44:12 +0000 (01:44 +0000)]
Add a small allocator for exec_map entries.

Upon each execve, we allocate a KVA range for use in copying data to the
new image. Pages must be faulted into the range, and when the range is
freed, the backing pages are freed and their mappings are destroyed. This
is a lot of needless overhead, and the exec_map management becomes a
bottleneck when many CPUs are executing execve concurrently. Moreover, the
number of available ranges is fixed at 16, which is insufficient on large
systems and potentially excessive on 32-bit systems.

The new allocator reduces overhead by making exec_map allocations
persistent. When a range is freed, pages backing the range are marked clean
and made easy to reclaim. With this change, the exec_map is sized based on
the number of CPUs.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8921

7 years agoSort includes in kern_exec.c.
Mark Johnston [Thu, 5 Jan 2017 01:28:08 +0000 (01:28 +0000)]
Sort includes in kern_exec.c.

MFC after: 1 week

7 years agoUse db_printsym() to display function names in stack traces.
John Baldwin [Thu, 5 Jan 2017 00:59:53 +0000 (00:59 +0000)]
Use db_printsym() to display function names in stack traces.

Previously, the stack unwinder tried to locate the start of the function
in each frame by walking backwards until it found an instruction that
modified the stack pointer and then assumed that was the first instruction
in a function.  The unwinder would only print a function name if the
starting instruction's address was an exact match for a symbol name.
However, not all functions generated by modern compilers start off functions
with that instruction.  For those functions, the unwinder would fail to
find a matching function name.  As a result, most frames in a stack
trace would be printed as raw hex PC's instead of a function name.

Stop depending on this incorrect assumption and just use db_printsym()
like other platforms to display the function name and offset for each
frame.  This generates a far more useful stack trace.

While here, don't print out curproc's pid at the end of the trace.  The
pid was always from curproc even if tracing some other process.

In addition, remove some rotted comments about hardcoded constants that
are no longer hardcoded.

Sponsored by: DARPA / AFRL

7 years agoOnly call stacktrace_subr() from DDB.
John Baldwin [Thu, 5 Jan 2017 00:08:04 +0000 (00:08 +0000)]
Only call stacktrace_subr() from DDB.

There was a single call to stacktrace() under an #ifdef DEBUG to obtain
a stack trace during a fault that resulted in a function pointer to a
printf function being passed to stacktrace_subr() in db_trace.c.  The
kernel now has existing interfaces for obtaining a stack trace outside
of DDB (kdb_backtrace(), or the stack_*() API) that should be used instead.
Rather than fix the one call however, remove it since the kernel will
dump a trace anyway once it panics.

Make stacktrace_subr() static, remove the function pointer and change it
to use db_printf() explicitly.

Discussed with: kan
Sponsored by: DARPA / AFRL

7 years agoMisc Coverity fixes for tail(1)
Alan Somers [Wed, 4 Jan 2017 23:22:34 +0000 (23:22 +0000)]
Misc Coverity fixes for tail(1)

CID 1006402: Initialize stack variable
CID 271580: Don't leak memory when ENOMEM.

Reported by: Coverity
CID: 271580 1006402
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoUpdate clang and lld Version.inc files.
Dimitry Andric [Wed, 4 Jan 2017 22:32:17 +0000 (22:32 +0000)]
Update clang and lld Version.inc files.

7 years agoFix assertion that checks that pages are consecutive to properly
Gleb Smirnoff [Wed, 4 Jan 2017 22:31:09 +0000 (22:31 +0000)]
Fix assertion that checks that pages are consecutive to properly
handle bogus_page insertion(s).

7 years agoMerge llvm, clang, lld and lldb trunk r291015, and resolve conflicts.
Dimitry Andric [Wed, 4 Jan 2017 22:29:00 +0000 (22:29 +0000)]
Merge llvm, clang, lld and lldb trunk r291015, and resolve conflicts.

7 years agoMove bogus_page declaration to vm_page.h and initialization to vm_page.c.
Gleb Smirnoff [Wed, 4 Jan 2017 22:27:19 +0000 (22:27 +0000)]
Move bogus_page declaration to vm_page.h and initialization to vm_page.c.

Reviewed by: kib

7 years agoVendor import of clang trunk r291015:
Dimitry Andric [Wed, 4 Jan 2017 22:25:26 +0000 (22:25 +0000)]
Vendor import of clang trunk r291015:
https://llvm.org/svn/llvm-project/cfe/trunk@291015

7 years agoVendor import of llvm trunk r291015:
Dimitry Andric [Wed, 4 Jan 2017 22:25:16 +0000 (22:25 +0000)]
Vendor import of llvm trunk r291015:
https://llvm.org/svn/llvm-project/llvm/trunk@291015

7 years agoMerge llvm, clang, lld and lldb trunk r291012, and resolve conflicts.
Dimitry Andric [Wed, 4 Jan 2017 22:19:42 +0000 (22:19 +0000)]
Merge llvm, clang, lld and lldb trunk r291012, and resolve conflicts.

7 years agoVendor import of lldb trunk r291012:
Dimitry Andric [Wed, 4 Jan 2017 22:11:59 +0000 (22:11 +0000)]
Vendor import of lldb trunk r291012:
https://llvm.org/svn/llvm-project/lldb/trunk@291012

7 years agoVendor import of lld trunk r291012:
Dimitry Andric [Wed, 4 Jan 2017 22:11:50 +0000 (22:11 +0000)]
Vendor import of lld trunk r291012:
https://llvm.org/svn/llvm-project/lld/trunk@291012

7 years agoVendor import of clang trunk r291012:
Dimitry Andric [Wed, 4 Jan 2017 22:11:23 +0000 (22:11 +0000)]
Vendor import of clang trunk r291012:
https://llvm.org/svn/llvm-project/cfe/trunk@291012

7 years agoVendor import of llvm trunk r291012:
Dimitry Andric [Wed, 4 Jan 2017 22:11:11 +0000 (22:11 +0000)]
Vendor import of llvm trunk r291012:
https://llvm.org/svn/llvm-project/llvm/trunk@291012

7 years agoMerge ^/head r311306 through r311313.
Dimitry Andric [Wed, 4 Jan 2017 22:06:14 +0000 (22:06 +0000)]
Merge ^/head r311306 through r311313.

7 years agoAdd preliminary ObsoleteFiles and UPDATING entries.
Dimitry Andric [Wed, 4 Jan 2017 21:58:33 +0000 (21:58 +0000)]
Add preliminary ObsoleteFiles and UPDATING entries.

7 years agoCleanup commented entries in libllvm Makefile.
Dimitry Andric [Wed, 4 Jan 2017 21:57:56 +0000 (21:57 +0000)]
Cleanup commented entries in libllvm Makefile.

7 years agoRemove llvm-objdump when Clang is disabled. It was missed in r310889.
Jung-uk Kim [Wed, 4 Jan 2017 21:55:52 +0000 (21:55 +0000)]
Remove llvm-objdump when Clang is disabled.  It was missed in r310889.

Submitted by: dim

7 years agoAdd new llvm-{cxxfilt,lto2,modextract,xray} tools.
Dimitry Andric [Wed, 4 Jan 2017 21:47:39 +0000 (21:47 +0000)]
Add new llvm-{cxxfilt,lto2,modextract,xray} tools.

7 years agoFurther refine MIPS stack traces across trapframes.
John Baldwin [Wed, 4 Jan 2017 21:13:21 +0000 (21:13 +0000)]
Further refine MIPS stack traces across trapframes.

Use the trapframe unwinder recently added for kernel stack overflow
panics for frames crossing MipsKernGenException and MipsKernIntr.
This provides more reliably unwinding across nested interrupts and
exceptions in the kernel.

While here, dump the value of the CAUSE and BADVADDR registers when
crossing a trapframe.

Submitted by: rwatson (original version)
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL

7 years agoFix double-dollar typo in lld Makefile.
Dimitry Andric [Wed, 4 Jan 2017 20:56:03 +0000 (20:56 +0000)]
Fix double-dollar typo in lld Makefile.

7 years agoBump FREEBSD_CC_VERSION to force bootstrap compiler build.
Dimitry Andric [Wed, 4 Jan 2017 20:42:37 +0000 (20:42 +0000)]
Bump FREEBSD_CC_VERSION to force bootstrap compiler build.

7 years agoMerge ^/head r311132 through r311305.
Dimitry Andric [Wed, 4 Jan 2017 20:41:43 +0000 (20:41 +0000)]
Merge ^/head r311132 through r311305.

7 years agoAlways null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
Alan Somers [Wed, 4 Jan 2017 20:26:42 +0000 (20:26 +0000)]
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039
Reviewed by: imp, sephe, slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9037
Differential Revision: https://reviews.freebsd.org/D9038

7 years agoUpdate lldb Makefile, and disable some functionality for Windows and
Dimitry Andric [Wed, 4 Jan 2017 19:53:04 +0000 (19:53 +0000)]
Update lldb Makefile, and disable some functionality for Windows and
Darwin.

7 years agoUpdate lld Version.inc and libllvm/Makefile to match.
Dimitry Andric [Wed, 4 Jan 2017 18:54:20 +0000 (18:54 +0000)]
Update lld Version.inc and libllvm/Makefile to match.

7 years agoUpdate lld Makefile.
Dimitry Andric [Wed, 4 Jan 2017 18:53:35 +0000 (18:53 +0000)]
Update lld Makefile.

7 years agoUpdate llvm-cov and llvm-pdbdump Makefiles.
Dimitry Andric [Wed, 4 Jan 2017 18:53:25 +0000 (18:53 +0000)]
Update llvm-cov and llvm-pdbdump Makefiles.

7 years agoRemove duplicate iic and iicbus devices from JZ4780 kernel
Alexander Kabaev [Wed, 4 Jan 2017 18:36:30 +0000 (18:36 +0000)]
Remove duplicate iic and iicbus devices from JZ4780 kernel

7 years agoRemove dead code in dhclient(8)
Alan Somers [Wed, 4 Jan 2017 18:13:05 +0000 (18:13 +0000)]
Remove dead code in dhclient(8)

The offending code has been dead ever since the import from OpenBSD in
r195805.  OpenBSD later deleted that entire function.

Reported by: Coverity
CID: 500059
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp