]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC: 325765 (imp) Add notes about overlapping copies.
rgrimes [Tue, 22 Jan 2019 21:52:07 +0000 (21:52 +0000)]
MFC: 325765 (imp) Add notes about overlapping copies.

Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Approved by: phk (mentor)

5 years agoMFC r342977 (by cem): amdtemp(4): Add support for Family 15h, Model >=60h
mav [Tue, 22 Jan 2019 21:35:25 +0000 (21:35 +0000)]
MFC r342977 (by cem): amdtemp(4): Add support for Family 15h, Model >=60h

Family 15h is a bit of an oddball.  Early models used the same temperature
register and spec (mostly[1]) as earlier CPU families.

Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service
Management Network, communicating with it in a similar fashion.  To support
them, add support for their version of SMU indirection to amdsmn(4) and use
it in amdtemp(4) on these models.

While here, clarify some of the deviceid macros in amdtemp(4) that were
added with arbitrary, incorrect family numbers, and remove ones that were
not used.  Additionally, clarify intent and condition of heterogenous
multi-socket system detection.

[1]: 15h adds the "adjust range by -49°C if a certain condition is met,"
which previous families did not have.

Reported by:    D. C. <tjoard AT gmail.com>
PR:             234657
Tested by:      D. C. <tjoard AT gmail.com>

5 years agoMFC r340426 (by cem): amdtemp(4): Fix temperature reporting on AMD 2990WX
mav [Tue, 22 Jan 2019 21:34:25 +0000 (21:34 +0000)]
MFC r340426 (by cem): amdtemp(4): Fix temperature reporting on AMD 2990WX

Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255
OSRR, section 4.2.1.

For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
range -49..206; i.e., subtract 49°C.

Submitted by:   gallatin@
Reported by:    bcran@

5 years agoMFC r340425 (by cem): amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges
mav [Tue, 22 Jan 2019 21:33:14 +0000 (21:33 +0000)]
MFC r340425 (by cem): amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges

As reported, tested, and patch supplied by Johannes.

There may be future work to do to support multiple sensors, but for now, any
sensor at all is a strict improvement for Ryzen 2 systems.

PR:             228480
Submitted by:   Johannes Lundberg <johalun0 AT gmail.com> (earlier version)
Reported by:    deischen@, Johannes, and numerous others

5 years agoMFC r342856: Added support for the SIOCGI2C ioctl.
delphij [Tue, 22 Jan 2019 04:20:52 +0000 (04:20 +0000)]
MFC r342856: Added support for the SIOCGI2C ioctl.

Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com>
Obtained from: Broadcom

5 years agoMFC r342864:
markj [Tue, 22 Jan 2019 02:04:37 +0000 (02:04 +0000)]
MFC r342864:
Specify the correct option level when emulating SO_PEERCRED.

PR: 234722

5 years agoMFC r343041
kp [Tue, 22 Jan 2019 01:07:20 +0000 (01:07 +0000)]
MFC r343041

pf: silence a runtime warning

Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'.
This warning does not clarify anything for users, so silence it, just as
OpenBSD has.

PR: 234874

5 years agoMFC r343162:
brooks [Mon, 21 Jan 2019 19:33:05 +0000 (19:33 +0000)]
MFC r343162:

Make SIFTR work again after r342125 (D18443).

Correct a logic error.

Only disable when already enabled or enable when disabled.

Submitted by: Richard Scheffenegger
Reviewed by: Cheng Cui
Obtained from: Cheng Cui
Differential Revision: https://reviews.freebsd.org/D18885

5 years agoMFC r343153: freebsd-update.8: mandoc -Tlint fixes
emaste [Mon, 21 Jan 2019 18:35:39 +0000 (18:35 +0000)]
MFC r343153:     freebsd-update.8: mandoc -Tlint fixes

PR: 185389

5 years agoMFC r343023:
pfg [Mon, 21 Jan 2019 14:54:01 +0000 (14:54 +0000)]
MFC r343023:
msun: reduce diff between src/e_j0.c and src/e_j0f.c

PR: 229501

5 years agoMFC r342845,342846: Port NetBSD improvements:
delphij [Mon, 21 Jan 2019 06:52:35 +0000 (06:52 +0000)]
MFC r342845,342846: Port NetBSD improvements:

 - Add -l support for xz files
 - Add lzip support to gzip based on the example lzip decoder.

Obtained from: NetBSD
Relnotes: yes

5 years agoMFC r343130
kp [Mon, 21 Jan 2019 00:32:03 +0000 (00:32 +0000)]
MFC r343130

pf: fix pfsync breaking carp

Fix missing initialisation of sc_flags into a valid sync state on clone which
breaks carp in pfsync.

This regression was introduce by r342051.

PR: 235005
Submitted by: smh@FreeBSD.org
Pointy hat to: kp

5 years agoMFC r342989
kp [Sun, 20 Jan 2019 22:01:41 +0000 (22:01 +0000)]
MFC r342989

pfctl: Fix 'set skip' handling for groups

When we skip on a group the kernel will automatically skip on the member
interfaces. We still need to update our own cache though, or we risk
overruling the kernel afterwards.

This manifested as 'set skip' working initially, then not working when
the rules were reloaded.

PR: 229241

5 years agoMFC r342791: fix a typo in chio(4) (which propagates into chio(1))
joerg [Sun, 20 Jan 2019 21:38:24 +0000 (21:38 +0000)]
MFC r342791: fix a typo in chio(4) (which propagates into chio(1))

5 years agoMFC r343108:
kib [Sun, 20 Jan 2019 13:16:36 +0000 (13:16 +0000)]
MFC r343108:
Trim whitespace at EoL, use tabs instead of spaces for indent.

PR: 235004

5 years agoMFC r340926:
wulf [Fri, 18 Jan 2019 21:25:46 +0000 (21:25 +0000)]
MFC r340926:

evdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.

5 years agoMFC r340912,r340913:
wulf [Fri, 18 Jan 2019 21:12:00 +0000 (21:12 +0000)]
MFC r340912,r340913:

psm(4): Revert r328640 and add minimal support for active AUX port
        multiplexers

Active PS/2 multiplexing is a method for attaching up to four PS/2
pointing devices to a computer. Enabling of multiplexed mode allows
commands to be directed to individual devices using routing prefixes.
Multiplexed mode reports input with each byte tagged to identify
its source. This method differs from one currently supported by psm(4)
where so called guest device (trackpoint) is attached to special
interface located on the host device (touchpad) and latter performs
guest protocol conversion to special encapsulation packet format.

At present time active PS/2 multiplexing is used in some models of
HP laptops e.g. EliteBook 8560w, 9470m. Enabling of absolute operation
mode on such touchpads is connected with following problems:
1. Touchpad's port priority is lower than trackpoint's. That blocks
   information queries thus prevents touchpad detection and configuration.
2. Touchpad and trackpoint have different protocol packet sizes and
   sync bytes.

As PS/2 usage is on decline only minimal possible set of changes to
support Synaptics touchpad and generic mouses is implemented.
Active multiplexing mode is enabled only at probe stage to scan through
attached PS/2 devices to query and configure Synaptics touchpad.
After touchpad has been configured, mux is switched back to legacy
(hidden multiplexing) mode to perform normal interrupt-driven input
data processing. Overflow bit values rather than tags are used to
separate packets produced by different devices. Switching back to
legacy mode allows to avoid psm(4) and atkbd(4) rework to support
4 instances of mouse driver.

Note: While in hidden multiplexing mode KBC does some editing of the
packet stream. It remembers the button bits from the last packet
received from each device, and replaces the button bits of every
packet with the logical OR of all devices’ most recent button bits.
This sort of button crosstalk results in spurious button events
which are inhibitted with various tricks. E.g. trackpoint middle
button events are suppressed while trackpad surface is touched and
touchpad left and right button events are suppressed if corresponding
trackpoint buttons are pressed.

PR: 231058
Reported by: Michael Figiel <mifigiel at gmail.com>
Tested by: Michael Figiel <mifigiel at gmail.com>

5 years agoMFC r342822:
dab [Fri, 18 Jan 2019 16:04:36 +0000 (16:04 +0000)]
MFC r342822:

asmc: Add support for Mac mini 4,1 (Mid-2010)

5 years agoMFC r342770:
dab [Fri, 18 Jan 2019 15:59:49 +0000 (15:59 +0000)]
MFC r342770:

asmc: Patch to add MacBook Pro 9,2 support

PR:           211513
Submitted by:  William Theesfeld Jr <wtheesfeld@mailbox.org>
Reported by:   William Theesfeld Jr <wtheesfeld@mailbox.org>

5 years agoMFC 342925:
ae [Fri, 18 Jan 2019 09:57:03 +0000 (09:57 +0000)]
MFC 342925:
  Relax requirement to packet size of CARP protocol and remove version check.

  CARP shares protocol number 112 with VRRP (RFC 5798). And the size of
  VRRP packet may be smaller than CARP. ipfw_chk() does m_pullup() to at
  least sizeof(struct carp_header) and can fail when packet is VRRP. This
  leads to packet drop and message about failed pullup attempt.
  Also, RFC 5798 defines version 3 of VRRP protocol, this version number
  also unsupported by CARP and such check leads to packet drop.

  carp_input() does its own checks for protocol version and packet size,
  so we can remove these checks to be able pass VRRP packets.

  PR: 234207

5 years agoMFC r342884:
hselasky [Fri, 18 Jan 2019 08:57:23 +0000 (08:57 +0000)]
MFC r342884:
Fix loopback traffic when using non-lo0 link local IPv6 addresses.

The loopback interface can only receive packets with a single scope ID,
namely the scope ID of the loopback interface itself. To mitigate this
packets which use the scope ID are appearing as received by the real
network interface, see "origifp" in the patch. The current code would
drop packets which are designated for loopback which use a link-local
scope ID in the destination address or source address, because they
won't match the lo0's scope ID. To fix this restore the network
interface pointer from the scope ID in the destination address for
the problematic cases. See comments added in patch for a more detailed
description.

This issue was introduced with route caching by karels@ .

Reviewed by: bz (network)
Differential Revision: https://reviews.freebsd.org/D18769
Sponsored by: Mellanox Technologies

5 years agoMFC r342778:
hselasky [Fri, 18 Jan 2019 08:48:30 +0000 (08:48 +0000)]
MFC r342778:
Reduce timeout for reading the USB HUB port status to 1000ms and try to filter
out dead USB HUB devices by implementing an error counter, so that the USB
enumeration thread does not spend all its time reading from non-responding
devices, blocking user-space access in the end.

Tested by: Matthias Apitz <guru@unixarea.de>
Sponsored by: Mellanox Technologies

5 years agoMFC r342730:
hselasky [Fri, 18 Jan 2019 08:44:50 +0000 (08:44 +0000)]
MFC r342730:
Improve USB generic debug messages. Print process ID and name when opening
and closing usb/ugenX.Y character device nodes.

Sponsored by: Mellanox Technologies

5 years agoPull in r337861 from upstream llvm trunk (by Hideki Saito):
dim [Wed, 16 Jan 2019 20:38:17 +0000 (20:38 +0000)]
Pull in r337861 from upstream llvm trunk (by Hideki Saito):

  [LV] Fix for PR38110, LV encountered llvm_unreachable()

  Summary: truncateToMinimalBitWidths() doesn't handle all Instructions
  and the worst case is compiler crash via llvm_unreachable(). Fix is
  to add a case to handle PHINode and changed the worst case to NO-OP
  (from compiler crash).

  Reviewers: sbaranga, mssimpso, hsaito

  Reviewed By: hsaito

  Subscribers: llvm-commits

  Differential Revision: https://reviews.llvm.org/D49461

This should fix "Unhandled instruction type!" (if assertions are
enabled) or segmentation faults (if assertions are disabled) when
compiling certain versions of the net-p2p/gtk-gnutella port.

Direct commit to stable/11 and stable/12, since head already has this
fix.

Reported by: Jamie Landeg-Jones <jamie@catflap.org>
PR: 234987

5 years agoMFC r342855:
shurd [Wed, 16 Jan 2019 19:20:14 +0000 (19:20 +0000)]
MFC r342855:

Use iflib_if_init_locked() during resume instead of iflib_init_locked().

iflib_init_locked() assumes that iflib_stop() has been called, however,
it is not called for suspend.  iflib_if_init_locked() calls stop then init,
so fixes the problem.

This was causing errors after a resume from suspend.

PR: 224059
Reported by: zeising
Sponsored by: Limelight Networks

5 years agoMFC r343043: scp: disallow empty or current directory
emaste [Wed, 16 Jan 2019 15:15:04 +0000 (15:15 +0000)]
MFC r343043: scp: disallow empty or current directory

Obtained from: OpenBSD scp.c 1.198
Security: CVE-2018-20685
Sponsored by: The FreeBSD Foundation

5 years agoMFC r340933:
bapt [Wed, 16 Jan 2019 12:04:29 +0000 (12:04 +0000)]
MFC r340933:

libedit: improve multibyte support

Until this commit libedit only supported UTF-8 for multibyte charset
Improve it to support other multibyte charsets

Tested with eucJP and SJIS charsets.
Note that this change as been review and committed in upstream libedit
as well via christos@NetBSD

Submitted by: naito.yuichiro _at_ gmail.com
Reviewed by: bapt, pfg, yuripv, 0mp
Differential Revision: https://reviews.freebsd.org/D17903

5 years agoMFC r342591,342599:
kp [Wed, 16 Jan 2019 05:17:27 +0000 (05:17 +0000)]
MFC r342591,342599:

Make kernel print jail ID when logging a process exit

Kernel now includes jail ID when logging a process exit. jid is 0 for unjailed
processes.

Submitted by: Marie Helene Kvello-Aune <freebsd@mhka.no>
Relnotes: yes
Sponsored by: Modirum MDPay

5 years agoMFC r335675:
gonzo [Wed, 16 Jan 2019 04:01:30 +0000 (04:01 +0000)]
MFC r335675:

Fix file(1) dumpdate reporting for dump(8) files

Magic file for dump(8) had this dump and previous dump dates reversed.
Fix order for all three flavours of the dump(8) format.
This fix was committed to upstream repo as magic/Magdir/dump,v 1.17
and will be merged during next vendor import.

PR: 223155

5 years agoMFC r342887:
markj [Wed, 16 Jan 2019 03:07:32 +0000 (03:07 +0000)]
MFC r342887:
Stop setting if_linkmib in vlan(4) ifnets.

PR: 219472

5 years agoMFC 340206: Treat the memory lengths for CHELSIO_T4_GET_MEM as unsigned.
jhb [Tue, 15 Jan 2019 21:07:40 +0000 (21:07 +0000)]
MFC 340206: Treat the memory lengths for CHELSIO_T4_GET_MEM as unsigned.

Previously attempts to read the MC region were failing since the
length was greater than 2^31.

5 years agoMFC r342792, r342805: Provide rc_service variable for rc service scripts
kevans [Tue, 15 Jan 2019 16:12:47 +0000 (16:12 +0000)]
MFC r342792, r342805: Provide rc_service variable for rc service scripts

r342792: rc.subr: Provide rc_service variable for service scripts

Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for
'application profiles' that usually require the rc script to be invoked
again for each active profile. Because there's no consistent way to
determine the path because it differs between manual/service(8) invocations
and /etc/rc invocations, this leads to patterns like these:

- www/uwsgi hardcodes the script path
- security/openvpn guesses either $_file or $0 based on $0 = /etc/rc

Instead of forcing rc scripts to guess, provide an rc_service variable to
the scripts that gets set appropriately both for direct execution or when a
script is being executed via run_rc_script (e.g. /etc/rc).

This is our analog of an OpenRC variable with the same name, different case
(RC_SERVICE).

r342805: rc.subr: Fix typo

Originally intended as 'in case in needs to be re-invoked', but it was later
decided (by myself) that 're-invoke itself' makes it more clear that the
script is expected to use this in a way.

PR: 234614

5 years agoMFC r305074-r305075, r327275, r327570: newfs_msdos updates
kevans [Tue, 15 Jan 2019 15:47:01 +0000 (15:47 +0000)]
MFC r305074-r305075, r327275, r327570: newfs_msdos updates

r305074:
Remove CHS alignment. It's not needed and causes problems for the BBB
boot partition. NetBSD removed it in 1.10 in their repo some time ago.

r305075:
The code only converts from bpbHugeSectors to bpbSectors if the sum of
the hidden and huge sectors is less than or equal MAXU16. When
formatting in Windows bpbSectors is still used for 63488 sectors and
2048 hidden (sum > MAXU16). The hidden sectors count is the number of
sectors before the FAT16 Boot Record so it shouldn't affect the sector
count. Attached patch (huge_sec_conversion.patch) to only check for
bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors.

r327275:
Close fd and fd1 before returning now that we're done with them.

r327570:
Only call close if fd and fd1 are not -1.

PR: 183234

5 years agoMFC r342640: Ensure buffer is nul-terminated.
delphij [Tue, 15 Jan 2019 06:52:34 +0000 (06:52 +0000)]
MFC r342640: Ensure buffer is nul-terminated.

5 years agoMFC r342966:
avos [Tue, 15 Jan 2019 02:16:23 +0000 (02:16 +0000)]
MFC r342966:
net80211: fix possible panic for some drivers after r342464

Check if rate control structures were allocated before trying to
access them in various places; this was possible before on
allocation failure (unlikely), but was revealed after r342211
where allocation was deferred.

In case if driver uses wlan_amrr(4) and it is loaded it
is possible to reproduce the panic via

sysctl net.wlan.<number>.rate_stats

(for wlan0 the number will be 0).

The patch was adjusted a bit since file contents are different enough
since r306591.

5 years agoMFC r340617,341006: unbreak ng_source(4) for 64-bit platforms
eugen [Mon, 14 Jan 2019 09:57:36 +0000 (09:57 +0000)]
MFC r340617,341006: unbreak ng_source(4) for 64-bit platforms

5 years agoMFC r342883:
avos [Mon, 14 Jan 2019 07:54:11 +0000 (07:54 +0000)]
MFC r342883:
net80211: fix panic when device is removed during initialization

if_dead() is called during device detach - check if interface is
still exists before trying to refresh vap MAC address
(IF_LLADDR will trigger page fault otherwise).

5 years agoMFC r342853:
kib [Mon, 14 Jan 2019 07:25:44 +0000 (07:25 +0000)]
MFC r342853:
Add a tunable which changes mincore(2) algorithm to only report data
from the local mapping.

5 years agoMFC r342826:
kib [Mon, 14 Jan 2019 07:22:58 +0000 (07:22 +0000)]
MFC r342826:
Fix use of busdma(9) KPI in ahci(4).

5 years agoMFC r342817: getconf(1): Minor mdoc fix
jilles [Sun, 13 Jan 2019 18:48:13 +0000 (18:48 +0000)]
MFC r342817: getconf(1): Minor mdoc fix

5 years agoMFC r342816: thr_wake(2): Minor mdoc fixes
jilles [Sun, 13 Jan 2019 18:47:37 +0000 (18:47 +0000)]
MFC r342816: thr_wake(2): Minor mdoc fixes

5 years agoMFC r342933:
fsu [Sun, 13 Jan 2019 12:13:08 +0000 (12:13 +0000)]
MFC r342933:
Fix errno values returned from DUMMY_XATTR linuxulator calls

Reported by: weiss@uni-mainz.de
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D18812

5 years agoMFC r342614, r342633
delphij [Sun, 13 Jan 2019 08:49:55 +0000 (08:49 +0000)]
MFC r342614, r342633

r342614:
Properly set svn:mimetype for zh_CN.UTF-8.src.

r342633:
Fix various issues with Chinese locales:

 - Change short weekday names to use only one Chinese character.
   (note: this is a somewhat misunfortunate compromise due to the fact
   that some applications are using short buffer for weekday names,
   and in ~1905 when 星期 system was created to replace the traditional
   七曜 system, which can use 日月火水木金土 to represent Sunday through
   Saturday with just one character without any confusion).
 - for zh_CN locales: use Arabic numerals for month names, matching the
   practice of all other CJK locales
 - Regenerate zh_CN.{GB2312,GBK} locales from zh_CN.UTF-8.

Reported by: ygy
Reviewed by: kevlo
Differential Revision: https://reviews.freebsd.org/D18689

5 years agoMFC r342823:
kib [Sun, 13 Jan 2019 02:38:14 +0000 (02:38 +0000)]
MFC r342823:
Clamp tuklib_physmem() return value to SIZE_T_MAX.

5 years agoMFC r342810:
avos [Sun, 13 Jan 2019 02:23:18 +0000 (02:23 +0000)]
MFC r342810:
powerd(8): allow to force a method of battery state query

This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

PR: 125707
Submitted by: Konstantin Stepanov <milezv@yandex.ru>
Reviewed by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D18742

5 years agoMFC r342787:
markj [Sat, 12 Jan 2019 17:00:54 +0000 (17:00 +0000)]
MFC r342787:
Add a bounds check to the tws(4) passthrough ioctl handler.

admbug: 825

5 years agoMFC r342888:
markj [Sat, 12 Jan 2019 16:58:32 +0000 (16:58 +0000)]
MFC r342888:
Complete the removal of obsolete ioctl handlers.

PR: 234706

5 years agoMFC r342886
vmaffione [Sat, 12 Jan 2019 08:30:13 +0000 (08:30 +0000)]
MFC r342886

netmap: fix bridge example in netmap(4)

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194872
Reported by:    adrian

5 years agoMFC r342885
vmaffione [Sat, 12 Jan 2019 08:29:27 +0000 (08:29 +0000)]
MFC r342885

netmap: fix sysctl variable in vale(4)

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212333

5 years agoMFC r342784:
kp [Sat, 12 Jan 2019 05:44:10 +0000 (05:44 +0000)]
MFC r342784:

pf: Remove references to pflow from the pf.conf man page

pflow no longer exists. It was removed as part of a pf update back in 2012
(r240233).

PR: 223957

5 years agoMFC r342575, r342580: ar: detect and error out on 32-bit symbol table overflow
emaste [Fri, 11 Jan 2019 19:53:45 +0000 (19:53 +0000)]
MFC r342575, r342580: ar: detect and error out on 32-bit symbol table overflow

BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
previously truncated to 32-bits, silently producing corrupted archives
larger than 4GB.

PR: 234454

5 years agoMFC r342525: MFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core
avg [Fri, 11 Jan 2019 12:18:11 +0000 (12:18 +0000)]
MFC r342525: MFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core

Relnotes: maybe

5 years agoMFC r342541: MFV r342532: 5882 Temporary pool names
avg [Fri, 11 Jan 2019 11:46:33 +0000 (11:46 +0000)]
MFC r342541: MFV r342532: 5882 Temporary pool names

Note that this commit brings only formatting changes that were done
during the final review of the illumos change, because FreeBSD got the
main changes before illumos.

5 years agoMFC r342169: add a knob that disables detection of write protected disks
avg [Fri, 11 Jan 2019 11:43:36 +0000 (11:43 +0000)]
MFC r342169: add a knob that disables detection of write protected disks

PR: 225794

5 years agoMFC r342769, r342775:
kib [Fri, 11 Jan 2019 02:09:48 +0000 (02:09 +0000)]
MFC r342769, r342775:
i386: Use atomic 64bit load to read PDE value from PAE pagetables in
pmap_kextract().

5 years agoMFC r342737
vmaffione [Thu, 10 Jan 2019 08:54:33 +0000 (08:54 +0000)]
MFC r342737

netmap: unit tests: fix issues found by coverity scan

Reported by:    asomers
MFC after:      1 week
Sponsored by:   Sunny Valley Networks

5 years agoDocument EN-19:03-05.
gjb [Wed, 9 Jan 2019 20:19:34 +0000 (20:19 +0000)]
Document EN-19:03-05.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r342686:
markj [Wed, 9 Jan 2019 17:41:49 +0000 (17:41 +0000)]
MFC r342686:
Avoid setting PG_U unconditionally in pmap_enter_quick_locked().

5 years agoMFC r342650
vmaffione [Tue, 8 Jan 2019 10:29:02 +0000 (10:29 +0000)]
MFC r342650

Errata for 342860, which did not really merge r342650.

5 years agoMFC r342649, r342650
vmaffione [Tue, 8 Jan 2019 09:44:00 +0000 (09:44 +0000)]
MFC r342649, r342650

netmap: add suite of unit tests

Import the unit tests from upstream (https://github.com/luigirizzo/netmap
ba02539859d46d33), and make them ready for use with Kyua.
There are currently 38 regression tests, which test the kernel control ABI
exposed by netmap to userspace applications:

  1: test for port info get
  2-5: tests for basic port registration
  6-9: tests for VALE
  10-11: tests for getting netmap allocator info
  12-15: tests for netmap pipes
  16: test on polling mode
  17-18: tests on options
  19-27: tests for sync-kloop subsystem
  28-39: tests for null ports
  31-38: tests for the legacy NIOCREGIF registers

Reviewed by:    ngie
Sponsored by:   Sunny Valley Networks
Differential Revision:  https://reviews.freebsd.org/D18490

5 years agoMFC r342767:
kib [Mon, 7 Jan 2019 00:32:19 +0000 (00:32 +0000)]
MFC r342767:
x86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output.

5 years agoMFC of 342135 and 342290
mckusick [Sun, 6 Jan 2019 22:50:16 +0000 (22:50 +0000)]
MFC of 342135 and 342290

Properly respond to error from VFS_ROOT() during mount.

Sponsored by: Netflix

5 years agoMFC of 342548
mckusick [Sun, 6 Jan 2019 22:34:47 +0000 (22:34 +0000)]
MFC of 342548

When loading an inode from disk, verify that its mode is valid.

Sponsored by: Netflix

5 years agoMFC r342362-r342363: config(8) duplicate option handling
kevans [Sun, 6 Jan 2019 02:17:18 +0000 (02:17 +0000)]
MFC r342362-r342363: config(8) duplicate option handling

r342362:
config(8): Allow duplicate options to be specified

config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by: mmacy

r342363:
config(8): Remove all instances of an option when opting out

Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

5 years agoRevert r342807, mistakenly including libbe(3)/bectl(8) MFC
kevans [Sun, 6 Jan 2019 02:15:09 +0000 (02:15 +0000)]
Revert r342807, mistakenly including libbe(3)/bectl(8) MFC

5 years agoMFC r342362-r342363: config(8) duplicate option handling
kevans [Sun, 6 Jan 2019 02:13:16 +0000 (02:13 +0000)]
MFC r342362-r342363: config(8) duplicate option handling

r342362:
config(8): Allow duplicate options to be specified

config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by: mmacy

r342363:
config(8): Remove all instances of an option when opting out

Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

5 years agoMFC r342628, r342670 (by cem):
kib [Sun, 6 Jan 2019 00:59:55 +0000 (00:59 +0000)]
MFC r342628, r342670 (by cem):
Fix linux_destroy_dev() behaviour when there are still files open from
the destroying cdev.

Also bump __FreeBSD_version since struct linux_cdev size on i386 increased
(this is unmergeable r342629 on HEAD).

5 years agoMFC r342627:
kib [Sun, 6 Jan 2019 00:55:23 +0000 (00:55 +0000)]
MFC r342627:
Implement zap_vma_ptes() for managed device objects.

5 years agoMFC r342625, r342631:
kib [Sun, 6 Jan 2019 00:54:08 +0000 (00:54 +0000)]
MFC r342625, r342631:
Use IDX_TO_OFF().

5 years agoMFC r342630:
kib [Sun, 6 Jan 2019 00:38:28 +0000 (00:38 +0000)]
MFC r342630:
Add 'v' modifier to the ddb 'show pginfo' command to display vm_page
backing the provided kernel virtual address.

5 years agoMFC r342605:
cy [Sun, 6 Jan 2019 00:32:14 +0000 (00:32 +0000)]
MFC r342605:

TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.

5 years agoMFC: r336610 (partial), r339207, r339267
marius [Sat, 5 Jan 2019 19:32:48 +0000 (19:32 +0000)]
MFC: r336610 (partial), r339207, r339267

- Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR
  remain intact as intended in igb_init_dmac(). [1]

- Fix igb corrupting checksums with BPF and VLAN
  In stable/11, this merely syncs the code with head as the problem was
  introduced with r311849 in the latter and then fixed by r339207 with
  a different approach than the code used pre-r311849 and in stable/11.

- Use mbuf defines to construct csum offload masks rather than literals

Reported by: Coverity
CID: 1304929 [1]

5 years agoMFC r342595:
kib [Sat, 5 Jan 2019 00:42:30 +0000 (00:42 +0000)]
MFC r342595:
For hw.{physmem,realmem,usermem} MIBs, clamp instead of truncating.

5 years agoMFC r342218:
dab [Fri, 4 Jan 2019 02:50:18 +0000 (02:50 +0000)]
MFC r342218:

asmc: Add support for MacPro1,1

PR: 203431
Submitted by: jjr@alisa.org & holindho@saunalahti.fi
Reported by: jjr@alisa.org

5 years agoMFC r342171:
dab [Fri, 4 Jan 2019 02:20:34 +0000 (02:20 +0000)]
MFC r342171:

asmc: Add support for mid-2011 Macmini 5,2

PR: 225911
Submitted by: trev <fbsdbugs4@sentry.org>
Reported by: trev <fbsdbugs4@sentry.org>

5 years agoMFC 340022: Add support for port unit wiring to cxgbe(4).
jhb [Fri, 4 Jan 2019 01:19:23 +0000 (01:19 +0000)]
MFC 340022: 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.

5 years agoMFC 340021: Assert that reclaim_tx_descs() is always making forward progress.
jhb [Fri, 4 Jan 2019 00:06:30 +0000 (00:06 +0000)]
MFC 340021: Assert that reclaim_tx_descs() is always making forward progress.

5 years agoMFC r342549:
hselasky [Thu, 3 Jan 2019 09:27:35 +0000 (09:27 +0000)]
MFC r342549:
Add USB quirk for SPL Crimson Rev 1.

PR: 234380
Sponsored by: Mellanox Technologies

5 years agoMFC r342456:
hselasky [Thu, 3 Jan 2019 09:24:37 +0000 (09:24 +0000)]
MFC r342456:
Fix reading of USB sample rate descriptor for SPL Crimson Rev 1.

Read first one entry, then try to read the full rate descriptor table.

PR: 234380
Sponsored by: Mellanox Technologies

5 years agoMFC r342537-r342540
kadesai [Thu, 3 Jan 2019 08:04:14 +0000 (08:04 +0000)]
MFC r342537-r342540

r342537

This patch will add support for latest generation MegaRAID adapters- Aero(39xx).
Driver will throw a warning message when a Configurable secure type controller is
encountered.

r342538

This patch will add support for 32 bit atomic request descriptor for Aero adapters.

For Aero adapters-
1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs.
2. Driver will use 64 bit request descriptor to fire IOC INIT.
3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it
otherwise driver will use 64 bit request descriptor.

For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request
descriptors only.

r342539

Problem statement:
Due to hardware errata in Aero controllers, reads to certain
fusion registers could intermittently return all zeroes.
This behavior is transient in nature and subsequent reads will return
valid value.

Fix:
For Aero controllers, any read will retry the read operations
from certain registers for maximum three times, if read returns zero.

r342540

Driver version upgrade.

5 years agoMFC r342079
kadesai [Thu, 3 Jan 2019 07:59:51 +0000 (07:59 +0000)]
MFC r342079
Compilation failure on ppc and mips due to Revision 342066.
Adding extra memset on chain frame.

5 years agoMFC r342059-r342069
kadesai [Thu, 3 Jan 2019 07:45:52 +0000 (07:45 +0000)]
MFC r342059-r342069

r342059
This patch will add support for next generation(SAS3.5) of Tri mode(SAS, SATA, NVMe)
MegaRAID adapters.

r342060
This patch will add support for new Dynamic RaidMap to have different sizes
for different number of supported VDs for SAS3.5 MegaRAID adapters.

r342061
This patch will add support for divert bitmap in RAID map. Divert bitmap is supported for
SAS3.5 adapters only.

r342062
This patch will add new interface to support more than 256 JBODs.

r342063
Detect sequential Write IOs and pass the hint that it is part of sequential
stream to help HBA Firmware do the Full Stripe Writes. For read IOs on
certain RAID volumes like Read Ahead volumes,this will help driver to
send it to Firmware even if the IOs can potentially be sent to
hardware directly (called fast path) bypassing firmware.

Design: 8 streams are maintained per RAID volume as per the combined
firmware/driver design. When there is no stream detected the LRU stream
is used for next potential stream and LRU/MRU map is updated to make this
as MRU stream. Every time a stream is detected the MRU map
is updated to make the current stream as MRU stream.

r342064
To improve RAID 1/10 Write performance, OS drivers need to issue the
required Write IOs as Fast Path IOs (after the appropriate checks
allowing Fast Path to be used) to the appropriate physical drives
(translated from the OS logical IO) and wait for all Write IOs to complete.

Design: A write IO on RAID volume will be examined if it can be sent in
Fast Path based on IO size and starting LBA and ending LBA falling on to
a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10,
driver issues two fast path write IOs one for each corresponding physical
drive after computing the corresponding start LBA for each physical drive.
Both write IOs will have the same payload and are posted to HW such that
replies land in the same reply queue.

If there are no resources available for sending two IOs, driver will send
the original IO from upper layer to RAID volume through the Firmware.

When both IOs are completed by HW, the resources will be released
and SCSI IO completion handler will be called.

r342065
This patch will add support for new DCMD to get PD information and a single data structure
to specify LD and JBOD.

r342066
This patch will add support for NVME PRPs creation by driver for fastpath
capable IOs. NVME specification supports specific type of scatter gather list
called as PRP (Physical Region Page) for IO data buffers. Since NVME drive is
connected behind SAS3.5 tri-mode adapter, MegaRAID driver/firmware has to convert
OS SGLs in native NVMe PRP format. For IOs sent to firmware, MegaRAID firmware
does this job of OS SGLs to PRP translation and send PRPs to backend NVME device.
For fastpath IOs, driver will do this OS SGLs to PRP translation.

r342067
Change IOC INIT wait time to 180 secs to keep it inline with timeout
used by internal DCMDs.

r342068
This patch will increase debug level as current logging level has
very minimal prints and even few important messages will not get logged.

r342069
Driver version upgrade 07.708.02.00-fbsd

5 years agoMFC 339899: Make battery emptying rate available as sysctl variable.
jhb [Thu, 3 Jan 2019 01:39:22 +0000 (01:39 +0000)]
MFC 339899: Make battery emptying rate available as sysctl variable.

Curiously, the in-kernel routines always use the design voltage to
convert from mA to mW, but acpiconf in userland uses the current
voltage.  As a result, this can report a different mW rate than
acpiconf.

5 years agoMFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector.
jhb [Wed, 2 Jan 2019 23:57:37 +0000 (23:57 +0000)]
MFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector.

5 years agoMFC 341802: Validate the string size parameter passed to -s.
jhb [Wed, 2 Jan 2019 20:49:41 +0000 (20:49 +0000)]
MFC 341802: Validate the string size parameter passed to -s.

Use strtonum() to reject negative sizes instead of core dumping.

PR: 232206

5 years agoMFC 339620: Add a "live" mode to ktrdump.
jhb [Wed, 2 Jan 2019 19:48:17 +0000 (19:48 +0000)]
MFC 339620: Add a "live" mode to ktrdump.

Support a "live" mode in ktrdump enabled via the -l flag.  In this
mode, ktrdump polls the kernel's trace buffer periodically (currently
hardcoded as a 50 millisecond interval) and dumps any newly added
entries.  Fancier logic for the timeout (e.g. a command line option or
some kind of backoff based on the time since the last entry) can be
added later as the need arises.

Note that this does not include the capsicum fixes from the original
commit since ktrdump in stable/11 is not capsicum-ized.

5 years agoMFC 341800: Don't report stale signal information in ptrace_lwpinfo.
jhb [Wed, 2 Jan 2019 19:11:49 +0000 (19:11 +0000)]
MFC 341800: Don't report stale signal information in ptrace_lwpinfo.

Once a signal's siginfo was copied to 'td_si' as part of the signal
exchange in issignal(), it was never cleared.  This caused future
thread events that are reported as SIGTRAP events without signal
information to report the stale siginfo in 'td_si'.  For example, if a
debugger created a new process and used SIGSTOP to stop it after
PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI
with the SIGSTOP siginfo in pl_siginfo.  This broke 'catch syscall' in
current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP
indicates a breakpoint or single step trap.

5 years agoMFC r342182:
markj [Wed, 2 Jan 2019 16:28:56 +0000 (16:28 +0000)]
MFC r342182:
Remove UMS support code from radeonkms.

5 years agoMFC r342596:
cy [Wed, 2 Jan 2019 15:13:08 +0000 (15:13 +0000)]
MFC r342596:

Remove duplicate include of sys/mbuf.h.

Reported by: Trond Endrest <Trond.Endrestol@ximalas.info>

5 years agoMFC r342613: Import tzdata 2018h
philip [Tue, 1 Jan 2019 10:05:12 +0000 (10:05 +0000)]
MFC r342613: Import tzdata 2018h
MFC r342644: Import tzdata 2018i

5 years agoMFC r342661: Happy New Year 2019!
delphij [Tue, 1 Jan 2019 00:48:25 +0000 (00:48 +0000)]
MFC r342661: Happy New Year 2019!

5 years agoMFC r333391 (imp): Remove 'All Rights Reserved' from the collection copyright
delphij [Tue, 1 Jan 2019 00:42:51 +0000 (00:42 +0000)]
MFC r333391 (imp): Remove 'All Rights Reserved' from the collection copyright
and templates.

5 years agoMFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable.
jhb [Mon, 31 Dec 2018 22:09:08 +0000 (22:09 +0000)]
MFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable.

The number of MSI IRQs still defaults to 512, but it can now be
changed at boot time via the machdep.num_msi_irqs tunable.

Relnotes: yes

5 years agoMFC r342368, r342369
vmaffione [Mon, 31 Dec 2018 11:10:02 +0000 (11:10 +0000)]
MFC r342368, r342369

netmap: fix bug in netmap_poll() optimization

The bug was introduced by r339639, although it is present in the upstream
netmap code since 2015. It is due to resetting the want_rx variable to
POLLIN, rather than resetting it to POLLIN|POLLRDNORM.
It only affects select(), which uses POLLRDNORM. poll() is not affected,
because it uses POLLIN.
Also, it only affects FreeBSD, because Linux skips the optimization
implemented by the piece of code where the bug occurs.
To check if txsync can be skipped, it is necessary to look for
unseen TX space. However, this means comparing ring->cur
against ring->tail, rather than ring->head against ring->tail
(like nm_ring_empty() does).

Sponsored by:   Sunny Valley Networks

5 years agoMerge forgotten r318577 to close PR.
mr [Mon, 31 Dec 2018 11:05:38 +0000 (11:05 +0000)]
Merge forgotten r318577 to close PR.

PR: 217622

5 years agoMFC r342385:
cy [Mon, 31 Dec 2018 03:53:33 +0000 (03:53 +0000)]
MFC r342385:

Remove an empty #if block.

The interesting thing is that looking through Darren's commit logs,
the line containing an extern ppsratecheck() definition was removed
from the v5-1-RELEASE branch but not from HEAD (I have taken his
CVS tree and converted it to GIT). There is a commit adding an
additional #if defined to the empty block. I can only assume that
this was intentional for something later. Looking through HEAD the
extern ppsratecheck() is there. However if we put it back it would
conflict with a static ppsratecheck() definition in fil.c when
building ipftest.

Therefore we remove this empty block.

ppsratecheck() is a function in the FreeBSD kernel. However ipftest
cannot call the ppsratecheck() in the kernel. Therefore one exists in
fil.c for use when building the userland ipftest utility which
approximates the packet filter in userland for testing of ipfilter
rules against packets captured with tcpdump.

5 years agoMFC r342381:
kib [Sun, 30 Dec 2018 15:21:25 +0000 (15:21 +0000)]
MFC r342381:
Allocate v_object for the new snapshot vnode.

5 years agoMFC r342380:
kib [Sun, 30 Dec 2018 15:20:35 +0000 (15:20 +0000)]
MFC r342380:
Properly test for vmio buffer in bnoreuselist().

5 years agoMFC r342547:
cy [Sun, 30 Dec 2018 04:42:01 +0000 (04:42 +0000)]
MFC r342547:

Remove another empty #ifdef block. This empty block also exists in
the upstream HEAD.

5 years agoMFC r342377:
cy [Sun, 30 Dec 2018 04:37:49 +0000 (04:37 +0000)]
MFC r342377:

Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
and according to svn log was first committed to HEAD in 2000, therefore
it is safe to say the check is no longer needed in FreeBSD.

pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
Therefore it is safe to say that it is supported by every NetBSD system
today. The framework also exists in illumos.

As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
at some point in the future illumos too, and as all three platforms have
pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.