]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoSimplify NLS alias handling by using native make(1) multi variable for loops
bapt [Sun, 4 Nov 2018 10:14:08 +0000 (10:14 +0000)]
Simplify NLS alias handling by using native make(1) multi variable for loops

5 years agoFix bad copy/paste
bapt [Sun, 4 Nov 2018 06:59:13 +0000 (06:59 +0000)]
Fix bad copy/paste

5 years agoSimplify a bit distrib-dirs target
bapt [Sun, 4 Nov 2018 06:47:21 +0000 (06:47 +0000)]
Simplify a bit distrib-dirs target

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D3915

5 years agonfsd: Factorize code
bapt [Sun, 4 Nov 2018 06:39:01 +0000 (06:39 +0000)]
nfsd: Factorize code

Factorize code by using struct sockaddr_storage to handle both ipv6 and ipv4

Discussed with: rmacklem
Reviewed by: manu
MFC after: 1 month
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D13223

5 years agoipfw(8): clarify layer2 processing abilities
eugen [Sun, 4 Nov 2018 06:35:48 +0000 (06:35 +0000)]
ipfw(8): clarify layer2 processing abilities

Make it clear that ipfw action set for layer2 frames it a bit limited.

PR: 59835
Reviewed by: yuripv
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17719

5 years agoAdd aditional counter descriptions to AMD 0x17
mmacy [Sun, 4 Nov 2018 06:24:27 +0000 (06:24 +0000)]
Add aditional counter descriptions to AMD 0x17

Submitted by: Somalapuram Amaranath
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17401

5 years agoRemove Obj_Entry textsize member.
kib [Sun, 4 Nov 2018 00:32:28 +0000 (00:32 +0000)]
Remove Obj_Entry textsize member.

It is unused after r340102, and more important, I do not see how to
define textsize in both practically useful and correct way, for binaries
with more that one executable segments.

Sponsored by: The FreeBSD Foundation

5 years agostrptime: make %k and %l specifiers match their description in
yuripv [Sat, 3 Nov 2018 23:37:13 +0000 (23:37 +0000)]
strptime: make %k and %l specifiers match their description in
strftime(3), and allow them to process space-padded input.

PR: 230720
Submitted by: rlittle@inetco.com (original version)
Approved by: kib (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17761

5 years agoUpdate to CLDR 34 and UNICODE 11.
yuripv [Sat, 3 Nov 2018 22:02:10 +0000 (22:02 +0000)]
Update to CLDR 34 and UNICODE 11.

Discussed with: bapt
Approved by: kib (mentor)
MFC after: 1 month

5 years agoFlush data cache for executable loadable segments explicitly.
kib [Sat, 3 Nov 2018 20:39:16 +0000 (20:39 +0000)]
Flush data cache for executable loadable segments explicitly.

Do not use textsize and do not flush everything between map base and
base + textsize, because unmapped areas cannot be flushed.

This makes Obj_Entry textsize only use go away, and I will remove it
later.

Reported by: tuexen
Tested by: Mark Millard <marklmi26-fbsd@yahoo.com>
Sponsored by: The FreeBSD Foundation

5 years agoDo not use bzero() for the O_ICMP6TYPE opcode.
ae [Sat, 3 Nov 2018 20:05:50 +0000 (20:05 +0000)]
Do not use bzero() for the O_ICMP6TYPE opcode.

The buffer is already zeroed in compile_rule() function, and also it
may contain configured F_NOT flag in o.len field. This fixes the filling
for "not icmp6types" opcode.

PR: 232939
MFC after: 3 days

5 years agolibcompat: disable retpoline when building build tools
emaste [Sat, 3 Nov 2018 19:31:11 +0000 (19:31 +0000)]
libcompat: disable retpoline when building build tools

These are built with the host toolchain which may not support retpoline.
While here, move the MK_ overrides to a separate line and sort them
alphabetically to support future changes.

MFC with: r339511
Sponsored by: The FreeBSD Foundation

5 years agoUpdate the "flag" for draft-ietf-6man-ipv6only-flag.
bz [Sat, 3 Nov 2018 18:03:24 +0000 (18:03 +0000)]
Update the "flag" for draft-ietf-6man-ipv6only-flag.

Having the flag named "6" can possibly be a problem for configurations
where parsing strings and numbers can produce ambivalent results.
Rename the "6" flag to the "S"ix (or Silence-IPv4) flag.

5 years agoConvert epoch to read / write records per cpu
mmacy [Sat, 3 Nov 2018 03:43:32 +0000 (03:43 +0000)]
Convert epoch to read / write records per cpu

In discussing D17503 "Run epoch calls sooner and more reliably" with
sbahra@ we came to the conclusion that epoch is currently misusing the
ck_epoch API. It isn't safe to do a "write side" operation (ck_epoch_call
or ck_epoch_poll) in the middle of a "read side" section. Since, by definition,
it's possible to be preempted during the middle of an EPOCH_PREEMPT
epoch the GC task might call ck_epoch_poll or another thread might call
ck_epoch_call on the same section. The right solution is ultimately to change
the way that ck_epoch works for this use case. However, as a stopgap for
12 we agreed to simply have separate records for each use case.

Tested by: pho@

MFC after: 3 days

5 years ago9952 Block size change during zfs receive drops spill block
mav [Sat, 3 Nov 2018 03:10:06 +0000 (03:10 +0000)]
9952 Block size change during zfs receive drops spill block

Replication code in receive_object() falsely assumes that if received
object block size is different from local, then it must be a new object
and calls dmu_object_reclaim() to wipe it out. In most cases it is not a
problem, since all dnode, bonus buffer and data block(s) are immediately
rewritten any way, but the problem is that spill block (if used) is not.
This means loss of ACLs, extended attributes, etc.

This issue can be triggered in very simple way:
1. create 4KB file with 10+ ACL entries;
2. take snapshot and send it to different dataset;
3. append another 4KB to the file;
4. take another snapshot and send incrementally;
5. witness ACL loss on receive side.

PR: 198457
Discussed with: mahrens
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

5 years agoRemove apparently unused 0-byte files that cause grief on Windows
emaste [Sat, 3 Nov 2018 01:53:26 +0000 (01:53 +0000)]
Remove apparently unused 0-byte files that cause grief on Windows

r235274 added a sort regression test (it operates by comparing output
against GNU sort).  The commit included a number of 0-byte files, one
of which ends in a trailing . which reportedly breaks svn/git checkouts
on Windows.

It appears these were added accidentally, so just remove them.

PR: 232479
MFC after: 1 month

5 years agoAdd missing .El
imp [Sat, 3 Nov 2018 01:44:37 +0000 (01:44 +0000)]
Add missing .El

5 years agoDocument disbale_phy in ahcich sysctls.
imp [Sat, 3 Nov 2018 00:47:02 +0000 (00:47 +0000)]
Document disbale_phy in ahcich sysctls.

5 years agoImplement ability to turn on/off PHYs for AHCI devices.
imp [Sat, 3 Nov 2018 00:37:51 +0000 (00:37 +0000)]
Implement ability to turn on/off PHYs for AHCI devices.

As part of Chuck's work on fixing kernel crashes caused by disk I/O
errors, it is useful to be able to trigger various kinds of
errors. This patch allows causing an AHCI-attached disk to disappear,
by having the driver keep the PHY disabled when the driver would
otherwise enable the PHY. It also allows making the disk reappear by
having the driver go back to setting the PHY enable/disable state as
it normal would and simulating the hardware event that causes a bus
rescan.

Submitted by: Chuck Silvers
Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D16043

5 years agoUpdate awk(1) manual to state an exception to egrep(1)-like RE syntax
dteske [Fri, 2 Nov 2018 23:03:40 +0000 (23:03 +0000)]
Update awk(1) manual to state an exception to egrep(1)-like RE syntax

Reviewed by: imp, jmg
MFC after: 3 days
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D17739

5 years agoMFV: r339981
jkim [Fri, 2 Nov 2018 22:50:13 +0000 (22:50 +0000)]
MFV: r339981

Merge ACPICA 20181031.

5 years agoUse correct type for IOCTL request argument.
hselasky [Fri, 2 Nov 2018 22:23:25 +0000 (22:23 +0000)]
Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

MFC after: 1 week
Submitted by: Marcin Cieslak <saper@saper.info>
Sponsored by: Mellanox Technologies

5 years agoFurther research shows usbdump(8) is what we should point people at
imp [Fri, 2 Nov 2018 22:18:02 +0000 (22:18 +0000)]
Further research shows usbdump(8) is what we should point people at
rather than tcpdump for usb traffic capture.

5 years agoCatch up with the SCSI device removal. We should likely review why we
imp [Fri, 2 Nov 2018 22:15:47 +0000 (22:15 +0000)]
Catch up with the SCSI device removal. We should likely review why we
even have this.

5 years agoDocument r226775: tell why we omit usbus[0-9]+
imp [Fri, 2 Nov 2018 22:15:30 +0000 (22:15 +0000)]
Document r226775: tell why we omit usbus[0-9]+

tcpdump can capture packet traces from the usb bus. usbus[0-9] are
registered as ifnet devices so this can work. When these devices come
up, devd was trying to run pccard_ether on those interfaces, which
didn't exist and generated an error.

5 years agonewvers.sh: fix git false positive -dirty tag
emaste [Fri, 2 Nov 2018 21:20:46 +0000 (21:20 +0000)]
newvers.sh: fix git false positive -dirty tag

Assuming that any output from `git diff-index --name-only` implies
changes in the working tree results in false positives: files with
metadata, but not content, changes are also listed.

Check that content differences exist before adding the -dirty tag to
the git hash.

PR: 229230
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15968

5 years agoembed_mfs.sh: replace some compound statements with conventional ifs
emaste [Fri, 2 Nov 2018 21:07:06 +0000 (21:07 +0000)]
embed_mfs.sh: replace some compound statements with conventional ifs

Use the more readable form - there's no need to try being clever.

5 years agoRegen after r340080: Add const to input-only char * arguments.
brooks [Fri, 2 Nov 2018 20:56:19 +0000 (20:56 +0000)]
Regen after r340080: Add const to input-only char * arguments.

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17812

5 years agoAdd const to input-only char * arguments.
brooks [Fri, 2 Nov 2018 20:50:22 +0000 (20:50 +0000)]
Add const to input-only char * arguments.

These arguments are mostly paths handled by NAMEI*() macros which already
take const char * arguments.

This change improves the match between syscalls.master and the public
declerations of system calls.

Reviewed by: kib (prior version)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17812

5 years agosys/types.h: avoid using terse macro _M
emaste [Fri, 2 Nov 2018 20:48:29 +0000 (20:48 +0000)]
sys/types.h: avoid using terse macro _M

Although _M is reserved for use by the implemenation it is rather non-
descriptive and conflicted with a libc++ test.  Just rename to _Major
and _Minor to avoid conflicts.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16734

5 years agopf: Fix build if INVARIANTS is not set
kp [Fri, 2 Nov 2018 19:23:50 +0000 (19:23 +0000)]
pf: Fix build if INVARIANTS is not set

r340061 included a number of assertions pf_frent_remove(), but these assertions
were the only use of the 'prev' variable. As a result builds without
INVARIANTS had an unused variable, and failed.

Reported by: vangyzen@

5 years agom_pulldown() may reallocate n. Update the oip pointer after the
jtl [Fri, 2 Nov 2018 19:14:15 +0000 (19:14 +0000)]
m_pulldown() may reallocate n. Update the oip pointer after the
m_pulldown() call.

MFC after: 2 weeks
Sponsored by: Netflix

5 years agoDefine NT_FREEBSD_FEATURE_CTL ELF note type
emaste [Fri, 2 Nov 2018 19:02:03 +0000 (19:02 +0000)]
Define NT_FREEBSD_FEATURE_CTL ELF note type

This ELF note will be used to allow binaries to opt out of, or in to,
upcoming vulnerability mitigation and other features.

Committing the definition and readelf change separately to allow
independent MFC.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoreadelf: decode R_MIPS_HIGHER and R_MIPS_HIGHEST relocation types
emaste [Fri, 2 Nov 2018 18:40:01 +0000 (18:40 +0000)]
readelf: decode R_MIPS_HIGHER and R_MIPS_HIGHEST relocation types

Sponsored by: The FreeBSD Foundation

5 years agoAdd sysctl_usec_to_sbintime and sysctl_msec_to_sbintime.
imp [Fri, 2 Nov 2018 17:50:57 +0000 (17:50 +0000)]
Add sysctl_usec_to_sbintime and sysctl_msec_to_sbintime.

These functions are used to present a sbintime_t as either a number of
microseconds or a number of milliseconds respectively.

Sponsored by: Netflix

5 years agopf: Keep a reference to struct ifnets we're using
kp [Fri, 2 Nov 2018 17:05:40 +0000 (17:05 +0000)]
pf: Keep a reference to struct ifnets we're using

Ensure that the struct ifnet we use can't go away until we're done with
it.

5 years agopfsync: Add missing unlock
kp [Fri, 2 Nov 2018 17:03:53 +0000 (17:03 +0000)]
pfsync: Add missing unlock

If we fail to set up the multicast entry for pfsync and return an error
we must release the pfsync lock first.

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17506

5 years agoAdjust SiS 966/968 HDA controller naming.
mav [Fri, 2 Nov 2018 17:02:10 +0000 (17:02 +0000)]
Adjust SiS 966/968 HDA controller naming.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

5 years agopfsync: Allow module to be unloaded
kp [Fri, 2 Nov 2018 17:01:18 +0000 (17:01 +0000)]
pfsync: Allow module to be unloaded

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17505

5 years agopf tests: Basic pfsync test
kp [Fri, 2 Nov 2018 16:59:55 +0000 (16:59 +0000)]
pf tests: Basic pfsync test

Set up two jails, configure pfsync between them and create state in one
of them, verify that this state is copied to the other jail.

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17504

5 years agopfsync: Handle syncdev going away
kp [Fri, 2 Nov 2018 16:57:23 +0000 (16:57 +0000)]
pfsync: Handle syncdev going away

If the syncdev is removed we no longer need to clean up the multicast
entry we've got set up for that device.

Pass the ifnet detach event through pf to pfsync, and remove our
multicast handle, and mark us as no longer having a syncdev.

Note that this callback is always installed, even if the pfsync
interface is disabled (and thus it's not a per-vnet callback pointer).

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17502

5 years agopfsync: Ensure uninit is done before pf
kp [Fri, 2 Nov 2018 16:53:15 +0000 (16:53 +0000)]
pfsync: Ensure uninit is done before pf

pfsync touches pf memory (for pf_state and the pfsync callback
pointers), not the other way around. We need to ensure that pfsync is
torn down before pf.

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17501

5 years agoNotify that the ifnet will go away, even on vnet shutdown
kp [Fri, 2 Nov 2018 16:50:17 +0000 (16:50 +0000)]
Notify that the ifnet will go away, even on vnet shutdown

pf subscribes to ifnet_departure_event events, so it can clean up the
ifg_pf_kif and if_pf_kif pointers in the ifnet.
During vnet shutdown interfaces could go away without sending the event,
so pf ends up cleaning these up as part of its shutdown sequence, which
happens after the ifnet has already been freed.

Send the ifnet_departure_event during vnet shutdown, allowing pf to
clean up correctly.

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17500

5 years agopfsync: Make pfsync callbacks per-vnet
kp [Fri, 2 Nov 2018 16:47:07 +0000 (16:47 +0000)]
pfsync: Make pfsync callbacks per-vnet

The callbacks are installed and removed depending on the state of the
pfsync device, which is per-vnet. The callbacks must also be per-vnet.

MFC after: 2 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D17499

5 years agoInitialize the eflags field of vm_map headers.
markj [Fri, 2 Nov 2018 16:26:44 +0000 (16:26 +0000)]
Initialize the eflags field of vm_map headers.

Initializing the eflags field of the map->header entry to a value with a
unique new bit set makes a few comparisons to &map->header unnecessary.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: alc, kib
Tested by: pho
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14005

5 years agocxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..."
np [Fri, 2 Nov 2018 16:21:44 +0000 (16:21 +0000)]
cxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..."
messages.

Submitted by: Krishnamraju Eraparaju @ Chelsio
MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agopf: Limit the fragment entry queue length to 64 per bucket.
kp [Fri, 2 Nov 2018 15:32:04 +0000 (15:32 +0000)]
pf: Limit the fragment entry queue length to 64 per bucket.

So we have a global limit of 1024 fragments, but it is fine grained to
the region of the packet.  Smaller packets may have less fragments.
This costs another 16 bytes of memory per reassembly and devides the
worst case for searching by 8.

Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D17734

5 years agopf: Split the fragment reassembly queue into smaller parts
kp [Fri, 2 Nov 2018 15:26:51 +0000 (15:26 +0000)]
pf: Split the fragment reassembly queue into smaller parts

Remember 16 entry points based on the fragment offset.  Instead of
a worst case of 8196 list traversals we now check a maximum of 512
list entries or 16 array elements.

Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D17733

5 years agopf: Count holes rather than fragments for reassembly
kp [Fri, 2 Nov 2018 15:23:57 +0000 (15:23 +0000)]
pf: Count holes rather than fragments for reassembly

Avoid traversing the list of fragment entris to check whether the
pf(4) reassembly is complete.  Instead count the holes that are
created when inserting a fragment.  If there are no holes left, the
fragments are continuous.

Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D17732

5 years agoAdd new USB v2.0 PCI ID.
hselasky [Fri, 2 Nov 2018 15:03:52 +0000 (15:03 +0000)]
Add new USB v2.0 PCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoRevert "pf: Limit the maximum number of fragments per packet"
kp [Fri, 2 Nov 2018 15:01:59 +0000 (15:01 +0000)]
Revert "pf: Limit the maximum number of fragments per packet"

This reverts commit r337969.
We'll handle this the OpenBSD way, in upcoming commits.

5 years agoMake vop_symlink take a const target path.
brooks [Fri, 2 Nov 2018 14:42:36 +0000 (14:42 +0000)]
Make vop_symlink take a const target path.

This will enable callers to take const paths as part of syscall
decleration improvements.

Where doing so is easy and non-distruptive carry the const through
implementations. In UFS the value is passed to an interface that must
take non-const values. In ZFS, const poisoning would touch code shared
with upstream and it's not worth adding diffs.

Bump __FreeBSD_version for external API consumers.

Reviewed by: kib (prior version)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17805

5 years agoRemove printf for debug purpose forgotten on r340046.
araujo [Fri, 2 Nov 2018 13:48:06 +0000 (13:48 +0000)]
Remove printf for debug purpose forgotten on r340046.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

5 years agoloader: biosdisk should check if the media is present
tsoome [Fri, 2 Nov 2018 11:41:58 +0000 (11:41 +0000)]
loader: biosdisk should check if the media is present

The bd_print/bd_open/bd_strategy need to make sure the device does have
media, before getting into performing IO operations. Some systems can
hung if the device without a media is accessed.

Reported by: yuripv

5 years agonsmb.conf(5): Document the order of configuration loading
0mp [Fri, 2 Nov 2018 10:18:56 +0000 (10:18 +0000)]
nsmb.conf(5): Document the order of configuration loading

Based on the comments in /etc/nsmb.conf.

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17810

5 years agoloader: do not probe floppy devices for zfs
tsoome [Fri, 2 Nov 2018 09:47:18 +0000 (09:47 +0000)]
loader: do not probe floppy devices for zfs

The subject is telling it all.

5 years agoAdd support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
araujo [Fri, 2 Nov 2018 08:28:14 +0000 (08:28 +0000)]
Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
keys.

PR: 213835
Submitted by: Vasily Postnicov <ivan.zhmudo@gmail.com>
MFC after: 4 weeks
Relnotes: Yes
Sponsored by: iXsystems Inc.

5 years agoFix resource leak when using strdup(3).
araujo [Fri, 2 Nov 2018 08:03:19 +0000 (08:03 +0000)]
Fix resource leak when using strdup(3).

Reported by: Coverity
CID: 1357337
Sponsored by: iXsystems Inc.

5 years agoFix resource leak when using strdup(3).
araujo [Fri, 2 Nov 2018 08:01:42 +0000 (08:01 +0000)]
Fix resource leak when using strdup(3).

Reported by: Coverity
CID: 1357336
Sponsored by: iXsystems Inc.

5 years agoFix resource leak, variable fd going out of scope.
araujo [Fri, 2 Nov 2018 07:59:28 +0000 (07:59 +0000)]
Fix resource leak, variable fd going out of scope.

Reported by: Coverity
CID: 1204383
Sponsored by: iXsystems Inc.

5 years agoFix resource leak, variables cp, xopts and nopt going out of scope.
araujo [Fri, 2 Nov 2018 07:57:28 +0000 (07:57 +0000)]
Fix resource leak, variables cp, xopts and nopt going out of scope.

Reported by: Coverity
CID: 1305412
Sponsored by: iXsystems Inc.

5 years ago- Add quirk for Samsung on Mac Mini 7,1
miwi [Fri, 2 Nov 2018 07:48:23 +0000 (07:48 +0000)]
- Add quirk for Samsung on Mac Mini 7,1

PR: 201676
Submitted by: Ruben Kerkhof
Approved by: araujo (mentor)
Obtained from: TrueOS
Sponsored by: iXsystems Inc.
Differential Revision: https://review.freebsd.org/D17815

5 years agolualoader: Implement boot-conf
kevans [Fri, 2 Nov 2018 03:25:23 +0000 (03:25 +0000)]
lualoader: Implement boot-conf

MFC after: 3 days

5 years agokern_poll: Restore explanatory comment removed in r177374
cem [Thu, 1 Nov 2018 23:46:23 +0000 (23:46 +0000)]
kern_poll: Restore explanatory comment removed in r177374

The comment isn't stale.  The check is bogus in the sense that poll(2)
does not require pollfd entries to be unique in fd space, so there is no
reason there cannot be more pollfd entries than open or even allowed
fds.  The check is mostly a seatbelt against accidental misuse or
abuse.  FD_SETSIZE, while usually unrelated to poll, is used as an
arbitrary floor for systems with very low kern.maxfilesperproc.

Additionally, document this possible EINVAL condition in the poll.2
manual.

No functional change.

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17671

5 years agoMerge upstream r4932: turn so-reuseport option off by default.
des [Thu, 1 Nov 2018 23:42:35 +0000 (23:42 +0000)]
Merge upstream r4932: turn so-reuseport option off by default.

MFC after: 3 days

5 years agoRetire CLANG_NO_IAS34
emaste [Thu, 1 Nov 2018 23:11:47 +0000 (23:11 +0000)]
Retire CLANG_NO_IAS34

CLANG_NO_IAS34 was introduced in r276696 to allow then-HEAD kernels to
be built with clang 3.4 in FreeBSD 10.  As FreeBSD 11 and later includes
a version of Clang with a sufficiently capable integrated assembler we
do not need the workaround any longer.

Sponsored by: The FreeBSD Foundation

5 years agoRegent after r340034: Use mode_t when the documented signature does.
brooks [Thu, 1 Nov 2018 23:10:53 +0000 (23:10 +0000)]
Regent after r340034: Use mode_t when the documented signature does.

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17784

5 years agoUse mode_t when the documented signature does.
brooks [Thu, 1 Nov 2018 23:06:50 +0000 (23:06 +0000)]
Use mode_t when the documented signature does.

This is more clear and produces better results when generating function
stubs from syscalls.master.

Reviewed by: kib, emaste
Obtained from: CheribSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17784

5 years agostyle: remove "All rights reserved" from comment
emaste [Thu, 1 Nov 2018 23:01:24 +0000 (23:01 +0000)]
style: remove "All rights reserved" from comment

imp removed it from the template in r333391, so remove it from the
example license header in style.9 as well.

Sponsored by: The FreeBSD Foundation

5 years agosmbutil(1): Reference nsmb.conf(5) and mount_smbfs(8)
0mp [Thu, 1 Nov 2018 22:54:52 +0000 (22:54 +0000)]
smbutil(1): Reference nsmb.conf(5) and mount_smbfs(8)

Reviewed by: bcr
Approved by:    krion (mentor, implicit), mat (mentor, implicit)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17809

5 years agomount_smbfs(8): Mention /etc/nsmb.conf, smbutil(1) and nsmb.conf(5)
0mp [Thu, 1 Nov 2018 22:50:50 +0000 (22:50 +0000)]
mount_smbfs(8): Mention /etc/nsmb.conf, smbutil(1) and nsmb.conf(5)

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17808

5 years agoRestrict setting PTE execute permissions on RISC-V.
jhb [Thu, 1 Nov 2018 22:23:15 +0000 (22:23 +0000)]
Restrict setting PTE execute permissions on RISC-V.

Previously, RISC-V was enabling execute permissions in PTEs for any
readable page.  Now, execute permissions are only enabled if they were
explicitly specified (e.g. via PROT_EXEC to mmap).  The one exception
is that the initial kernel mapping in locore still maps all of the
kernel RWX.

While here, change the fault type passed to vm_fault and
pmap_fault_fixup to only include a single VM_PROT_* value representing
the faulting access to match other architectures rather than passing a
bitmask.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17783

5 years agoSet PTE_A and PTE_D for user mappings in pmap_enter().
jhb [Thu, 1 Nov 2018 22:17:51 +0000 (22:17 +0000)]
Set PTE_A and PTE_D for user mappings in pmap_enter().

This assumes that an access according to the prot in 'flags' triggered
a fault and is going to be retried after the fault returns, so the two
flags are set preemptively to avoid refaulting on the retry.

While here, only bother setting PTE_D for kernel mappings in pmap_enter
for writable mappings.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17782

5 years agoSBI calls expect a pointer to a u_long rather than a pointer.
jhb [Thu, 1 Nov 2018 22:15:25 +0000 (22:15 +0000)]
SBI calls expect a pointer to a u_long rather than a pointer.

This is just cosmetic.

A weirder issue is that the SBI doc claims the hart mask pointer should
be a physical address, not a virtual address.  However, the implementation
in bbl seems to just dereference the address directly.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17781

5 years agoDon't allow debuggers to modify SSTATUS, only to read it.
jhb [Thu, 1 Nov 2018 22:13:22 +0000 (22:13 +0000)]
Don't allow debuggers to modify SSTATUS, only to read it.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17771

5 years agolibsa: cstyle cleanup tftp.c
tsoome [Thu, 1 Nov 2018 22:13:18 +0000 (22:13 +0000)]
libsa: cstyle cleanup tftp.c

No functinal changes intended.

5 years agoImplement ptrace_set_pc() and fail PT_*STEP requests explicitly.
jhb [Thu, 1 Nov 2018 22:11:26 +0000 (22:11 +0000)]
Implement ptrace_set_pc() and fail PT_*STEP requests explicitly.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17769

5 years agoAdd comments explaining what hold/unhold do
imp [Thu, 1 Nov 2018 21:51:41 +0000 (21:51 +0000)]
Add comments explaining what hold/unhold do

They act as a simple one-deep semaphore to keep open/close/probe from
running at the same time to avoid races that creates.

5 years agoCheck cannot_use_txpkts() rather than needs_tso() in add_to_txpkts().
jhb [Thu, 1 Nov 2018 21:49:49 +0000 (21:49 +0000)]
Check cannot_use_txpkts() rather than needs_tso() in add_to_txpkts().

Currently this is a no-op, but will matter in the future when
cannot_use_txpkts() starts checking other conditions than just
needs_tso().

Sponsored by: Chelsio Communications

5 years agoAdd support for port unit wiring to cxgbe(4).
jhb [Thu, 1 Nov 2018 21:46:37 +0000 (21:46 +0000)]
Add support for port unit wiring to cxgbe(4).

- Add a bus_child_location_str method to the nexus drivers that prints
  out 'port=N' as the location string exported via devinfo and the
  '%location' sysctl node.

- We can't use a bus_hint_device_unit to wire the unit numbers of
  devices with a fixed devclass as the device gets assigned a unit in
  make_device() before the device creator can set softc, etc.
  Instead, when adding a child device, use a helper function much like
  a bus_hint_device_unit method to look for wiring hints or to return
  -1 to let the system choose a unit number.  This function requires
  an "at" hint for the port pointing to the nexus device and a "port"
  hint listing the port number.  For example:

hint.cxl.4.at="t5nex0"
hint.cxl.4.port="0"

  wires cxl4 to the first port on the t5nex0 adapter.

Requested by: gallatin
MFC after: 2 months

5 years agoAssert that reclaim_tx_descs() is always making forward progress.
jhb [Thu, 1 Nov 2018 21:39:33 +0000 (21:39 +0000)]
Assert that reclaim_tx_descs() is always making forward progress.

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoDon't enter DDB for fatal traps before panic by default.
jhb [Thu, 1 Nov 2018 21:34:17 +0000 (21:34 +0000)]
Don't enter DDB for fatal traps before panic by default.

Add a new 'debugger_on_trap' knob separate from 'debugger_on_panic'
and make the calls to kdb_trap() in MD fatal trap handlers prior to
calling panic() conditional on this new knob instead of
'debugger_on_panic'.  Disable the new knob by default.  Developers who
wish to recover from a fatal fault by adjusting saved register state
and retrying the faulting instruction can still do so by enabling the
new knob.  However, for the more common case this makes the user
experience for panics due to a fatal fault match the user experience
for other panics, e.g. 'c' in DDB will generate a crash dump and
reboot the system rather than being stuck in an infinite loop of fatal
fault messages and DDB prompts.

Reviewed by: kib, avg
MFC after: 2 months
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D17768

5 years agoCompile cryptocheck with in-tree openssl again.
jhb [Thu, 1 Nov 2018 21:25:26 +0000 (21:25 +0000)]
Compile cryptocheck with in-tree openssl again.

Reviewed by: cem
MFC after: 2 months
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D17767

5 years agoUnbreak nscd(8). Without this change the CMSG gets truncated.
trasz [Thu, 1 Nov 2018 18:19:10 +0000 (18:19 +0000)]
Unbreak nscd(8).  Without this change the CMSG gets truncated.

Reviewed by: des
MFC after: 2 weeks
Sponsored by: Chalmers University of Technology
Differential Revision: https://reviews.freebsd.org/D17452

5 years agoAvoid copying a struct stat for acl_from_stat() calls.
markj [Thu, 1 Nov 2018 17:45:29 +0000 (17:45 +0000)]
Avoid copying a struct stat for acl_from_stat() calls.

CID: 1375584
MFC after: 2 weeks

5 years agoAdd the ARMv8.3 SCTLR_EL1 fields.
andrew [Thu, 1 Nov 2018 17:43:28 +0000 (17:43 +0000)]
Add the ARMv8.3 SCTLR_EL1 fields.

While here tag which architecture release fields were added and remove a
field that only existed in very early releases of the ARMv8 spec.

Sponsored by: DARPA, AFRL

5 years agoixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues"
erj [Thu, 1 Nov 2018 17:29:14 +0000 (17:29 +0000)]
ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues"

This should fix a build issue when "options RSS" is set.

Reported by: bz@
Sponsored by: Intel Corporation

5 years agocarpstats are the last virtualised variable in the file and end up at the
bz [Thu, 1 Nov 2018 17:26:18 +0000 (17:26 +0000)]
carpstats are the last virtualised variable in the file and end up at the
end of the vnet_set.  The generated code uses an absolute relocation at
one byte beyond the end of the carpstats array.  This means the relocation
for the vnet does not happen for carpstats initialisation and as a result
the kernel panics on module load.

This problem has only been observed with carp and only on i386.
We considered various possible solutions including using linker scripts
to add padding to all kernel modules for pcpu and vnet sections.

While the symbols (by chance) stay in the order of appearance in the file
adding an unused non-file-local variable at the end of the file will extend
the size of set_vnet and hence make the absolute relocation for carpstats
work (think of this as a single-module set_vnet padding).

This is a (tmporary) hack.  It is the least intrusive one as we need a
timely solution for the upcoming release.  We will revisit the problem in
HEAD.  For a lot more information and the possible alternate solutions
please see the PR and the references therein.

PR: 230857
MFC after: 3 days

5 years agoAdd the ARMv8.3 HCR_EL2 register fields.
andrew [Thu, 1 Nov 2018 17:05:10 +0000 (17:05 +0000)]
Add the ARMv8.3 HCR_EL2 register fields.

MFC after: 1 month
Sponsored by: DARPA, AFRL

5 years agoRemove redundant checks for a NULL lbgroup table.
markj [Thu, 1 Nov 2018 15:52:49 +0000 (15:52 +0000)]
Remove redundant checks for a NULL lbgroup table.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17108

5 years agoImprove style in in_pcbinslbgrouphash() and related subroutines.
markj [Thu, 1 Nov 2018 15:51:49 +0000 (15:51 +0000)]
Improve style in in_pcbinslbgrouphash() and related subroutines.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17107

5 years agoCMSG_DATA(3): Use consistent variable names
0mp [Thu, 1 Nov 2018 15:40:57 +0000 (15:40 +0000)]
CMSG_DATA(3): Use consistent variable names

The description of CMSG_FIRSTHDR used two variables (mhdr and msg) to
reference the same thing. Use msghdr consistency across the manual page
instead.

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D17804

5 years agolinuxkpi: Add GFP flags needed for ttm drivers
bwidawsk [Thu, 1 Nov 2018 15:30:01 +0000 (15:30 +0000)]
linuxkpi: Add GFP flags needed for ttm drivers

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Requested by: bwidawsk
MFC after: 3 days
Approved by: emaste (mentor)

5 years agoFix NFS client vnode locking to avoid a crash during forced dismount.
rmacklem [Thu, 1 Nov 2018 15:27:22 +0000 (15:27 +0000)]
Fix NFS client vnode locking to avoid a crash during forced dismount.

A crash was reported where the crash occurred in nfs_advlock() when the
NFS_ISV4(vp) macro was being executed. This was caused by the vnode
being VI_DOOMED due to a forced dismount in progress.
This patch fixes the problem by locking the vnode before executing the
NFS_ISV4() macro.

Tested by: rlibby
PR: 232673
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17757

5 years agoRun unbound-anchor when root.key is empty, not just when it is absent.
des [Thu, 1 Nov 2018 14:24:12 +0000 (14:24 +0000)]
Run unbound-anchor when root.key is empty, not just when it is absent.

PR: 232555
Submitted by: Ari Suutari <ari@stonepile.fi>
MFC after: 3 days

5 years agolibbe(3): Don't promote non-cloned BEs
kevans [Thu, 1 Nov 2018 14:00:56 +0000 (14:00 +0000)]
libbe(3): Don't promote non-cloned BEs

Most easily reproducible by attempting to activate the currently activated
BE, one would get a "not a cloned filesystem" error instead of success or a
sane message.

PR: 232488
MFC after: 3 days

5 years agolibsa: tftp should use calloc
tsoome [Thu, 1 Nov 2018 13:29:55 +0000 (13:29 +0000)]
libsa: tftp should use calloc

instead of malloc() memset(), use calloc().

5 years agolibsa: tftp should not read past file end
tsoome [Thu, 1 Nov 2018 13:12:05 +0000 (13:12 +0000)]
libsa: tftp should not read past file end

When we have the file size via tsize option, use it to make sure we
will not attempt to read past file end.

5 years agoRemove debug code which slipped in accidently.
tuexen [Thu, 1 Nov 2018 11:41:40 +0000 (11:41 +0000)]
Remove debug code which slipped in accidently.

MFC after: 4 weeks
X-MFC with: r339989
Sponsored by: Netflix, Inc.

5 years agomount_smbfs(8): Add the STANDARDS and HISTORY sections
0mp [Thu, 1 Nov 2018 11:37:19 +0000 (11:37 +0000)]
mount_smbfs(8): Add the STANDARDS and HISTORY sections

- Document that mount_smbfs(8) only supports SMB1 and that SMB2 and SMB3
  are not supported at the moment. Suggest users to browse ports for
  software compatible with newer versions of the protocol.
- Copy supported servers list from README.
- Add a SEE ALSO section and reference the chapter about Samba in the
  FreeBSD Handbook.
- Add a HISTORY section.
- Style changes:
  - Use Dq instead of Em in the EXAMPLES section.
  - Mark command modifiers with Cm.

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after: 1 week
Sponsored by:   Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17798