]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r352016:
Konstantin Belousov [Sat, 14 Sep 2019 13:32:13 +0000 (13:32 +0000)]
MFC r352016:
In do_execve(), clear imgp->textset when restarting for interpreter.

4 years agoMFC r352015:
Konstantin Belousov [Sat, 14 Sep 2019 13:30:53 +0000 (13:30 +0000)]
MFC r352015:
When loading ELF interpreter, initialize whole nested image_params with zero.

4 years agoMFC r351847:
Hans Petter Selasky [Sat, 14 Sep 2019 13:30:22 +0000 (13:30 +0000)]
MFC r351847:
Decrease the default audio playback latency to a maximum of 21.3ms.
This significantly improves the audio playback response time.

Discussed with: mav@
Sponsored by: Mellanox Technologies

4 years agoMFC r352014:
Konstantin Belousov [Sat, 14 Sep 2019 13:29:41 +0000 (13:29 +0000)]
MFC r352014:
vm_object_deallocate(): Remove no longer needed code.

4 years agoMFC r352013:
Konstantin Belousov [Sat, 14 Sep 2019 13:27:07 +0000 (13:27 +0000)]
MFC r352013:
vm_object_coalesce(): avoid extending any nosplit objects, not only
that which back tmpfs nodes.

4 years agoMFC r352012:
Konstantin Belousov [Sat, 14 Sep 2019 13:25:54 +0000 (13:25 +0000)]
MFC r352012:
Properly check for writers when fetching quotas for writeable vnodes
in UFS quotaon().

4 years agoMFC r351218:
Emmanuel Vadot [Fri, 13 Sep 2019 21:28:08 +0000 (21:28 +0000)]
MFC r351218:

ti: sdhci: Correct voltage caps

ti,dual-volt property say that the eMMC support 1.8V and 3.3V not 3.0V
Use the correct caps for the mmc stack.
Note that the MMCHS_SD_CAPA register can only be written once after bootup
so if one is using a u-boot compiled with eMMC support (this is the default)
this code is a no-op but just in case someone have u-boot compiled without
eMMC support this make eMMC works when the kernel is booted.

4 years agoMFC r351184, r351189, r351217
Emmanuel Vadot [Fri, 13 Sep 2019 21:20:24 +0000 (21:20 +0000)]
MFC r351184, r351189, r351217

r351184:
Add method for getting of syscon handle from parent device.

If simple multifuction device also provides syscon interface, its
childern should be able to consume it. Due to this:
- declare coresponding method in syscon interface
- implement it in simple multifunction device driver

r351189:
Fix bug introduced by r351184.
We should check the returned handle, not the pointer to it.

Noticed by: ian
X-MFC with: r351184

r351217:
arm64: a37x0_gpio: Use syscon instead of MMIO region

The fdt node for this driver is a simple-mfd and syscon compatible one
meaning that simplemfd will be the driver attached for it. The gpio driver
is attached to the 'gpio' subnode so use syscon_get_handle_default to
obtain the handle of the syscon from the parent device and use this
to read/write to the memory region.

4 years agoMFC r352201: Fix assumptions of only one device per SES slot.
Alexander Motin [Fri, 13 Sep 2019 15:48:11 +0000 (15:48 +0000)]
MFC r352201: Fix assumptions of only one device per SES slot.

It is typical to have one, but no longer true for multi-actuator HDDs
with separate LUN for each actuator.

4 years agoMFC r352257: Report Trusted Computing feature set support.
Alexander Motin [Fri, 13 Sep 2019 15:21:18 +0000 (15:21 +0000)]
MFC r352257: Report Trusted Computing feature set support.

It practically means the device is SED.

4 years agoMFC r352200: Remove struct ata_res_pass16, unneeded after r352082.
Alexander Motin [Fri, 13 Sep 2019 15:19:50 +0000 (15:19 +0000)]
MFC r352200: Remove struct ata_res_pass16, unneeded after r352082.

4 years agoMFC r352111: Initialize page/subpage in case of `modepage -d`.
Alexander Motin [Fri, 13 Sep 2019 15:18:28 +0000 (15:18 +0000)]
MFC r352111: Initialize page/subpage in case of `modepage -d`.

Previously without -m parameter it worked mostly by concodence.

While there, make page/subpage values validation more strict.

4 years agoMFC r352082, r352103: Fix number of problems found while testing on SAT devices.
Alexander Motin [Fri, 13 Sep 2019 15:15:58 +0000 (15:15 +0000)]
MFC r352082, r352103: Fix number of problems found while testing on SAT devices.

 - Remove incomplete and dangerous ata_res decoding from ata_do_cmd().
Instead switch all functions that need the result to use get_ata_status(),
doing the same, but more careful, also reducing code duplication.
 - Made get_ata_status() to also decode fixed format sense.  In many cases
it is still not enough to make it useful, since it can only report results
of 28-bit command, but it is slightly better then nothing.
 - Organize error reporting in ata_do_cmd(), so that if caller specified
AP_FLAG_CHK_COND, it is responsible for command errors (non-ioctl ones).
 - Make HPA/AMA errors not fatal for `identify` subcommand.
 - Fix reprobe() not being called on HPA/AMA when in quiet mode.
 - Remove not very useful messages from `format` and `sanitize` commands
with -y flag.  Once they started, they often can't be stopped any way.

4 years agoMFC r352018: Unify cam_send_ccb() error reporting.
Alexander Motin [Fri, 13 Sep 2019 14:43:44 +0000 (14:43 +0000)]
MFC r352018: Unify cam_send_ccb() error reporting.

Error there mean that command was not even executed, and all information
we have about it is errno, and cam_error_print() call is not very useful.
Plus it is most likely a programmatic error, that shoud not happen.

4 years agoMFC r352011: Supply SAT layer with valid transfer sizes.
Alexander Motin [Fri, 13 Sep 2019 14:42:37 +0000 (14:42 +0000)]
MFC r352011: Supply SAT layer with valid transfer sizes.

This is a rework of r344701, that noticed that number of bytes passes to
8 bit sector count field gets truncated.  First decision was to not pass
anything, since ATA specs define the field as N/A.  But it appeared to be a
problem for some SAT devices, that require information about data transfer
to operate properly.  Some additional investigation shown that it is quite
a common practice to set unused fields of ATA commands (fortunately ATA
specs formally allow it) to supply the information to SAT layer.  I have
found SAS-SATA interposer that does not allow pass-through without it.

As side effect, reduce code duplication by removing ata_do_28bit_cmd()
function, replacing it with more universal ata_do_cmd().

4 years agoMFC r352072:
Michael Tuexen [Fri, 13 Sep 2019 08:14:46 +0000 (08:14 +0000)]
MFC r352072:

Only update SACK/DSACK lists when a non-empty segment was received.
This fixes hitting a KASSERT with a valid packet exchange.

PR: 240471
Reviewed by: rrs@, Richard Scheffenegger
Sponsored by: Neflix, Inc.
Differential Revision: https://reviews.freebsd.org/D21567

4 years agoMFC r352127:
Baptiste Daroussin [Fri, 13 Sep 2019 07:18:32 +0000 (07:18 +0000)]
MFC r352127:

In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1)
tools to generate the locales data. state it in the libc manpages.

4 years agoMFC r352126:
Baptiste Daroussin [Fri, 13 Sep 2019 07:15:48 +0000 (07:15 +0000)]
MFC r352126:

Remove reference to mklocale regarding the nls directory

mklocale never had anything to do with the content of this directory

4 years agoMFC r352065-r352070
Baptiste Daroussin [Fri, 13 Sep 2019 07:10:50 +0000 (07:10 +0000)]
MFC r352065-r352070

Sync with OpenBSD, in particular this adds support for -E flags
(GNU compatibility)

4 years agoMFC r352119-r352124, r352130
Baptiste Daroussin [Fri, 13 Sep 2019 07:08:43 +0000 (07:08 +0000)]
MFC r352119-r352124, r352130

Stop linking to libl by specifying we do not need yywrap

4 years agoUse file destdir for stage_as sets
Simon J. Gerraty [Fri, 13 Sep 2019 05:54:09 +0000 (05:54 +0000)]
Use file destdir for stage_as sets

We cannot use file (without :T) to name targets
but we can use the destination directory (with / replaced by _)
This has the benefit of minimizing the targets created.

MFC r351954

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

4 years agoMFC r351445:
Navdeep Parhar [Fri, 13 Sep 2019 01:14:58 +0000 (01:14 +0000)]
MFC r351445:

whitespace nit.

4 years agoMFC r351540, r351590
Navdeep Parhar [Fri, 13 Sep 2019 01:12:17 +0000 (01:12 +0000)]
MFC r351540, r351590

r351540:
cxgbe/t4_tom: Initialize all TOE connection parameters in one place.
Remove now-redundant items from toepcb and synq_entry and the code to
support them.

Let the driver calculate tx_align, rx_coalesce, and sndbuf by default.

Reviewed by: jhb@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21387

r351590:
cxgbe/t4_tom: Use the correct value of sndbuf in AIO Tx.

This should have been part of r351540.

Sponsored by: Chelsio Communications

4 years agoMFC r351524:
Navdeep Parhar [Fri, 13 Sep 2019 00:58:33 +0000 (00:58 +0000)]
MFC r351524:

cxgbe/t4_tom: Limit work requests with immediate payload to a single
descriptor.  The per-tid tx credits are in demand during active Tx and
it's best not to use too many just for payload.

Sponsored by: Chelsio Communications

4 years agoMFC r351446:
Navdeep Parhar [Fri, 13 Sep 2019 00:53:09 +0000 (00:53 +0000)]
MFC r351446:

cxgbe/t4_tom: Any invalid scaling factor in the hardware's wsf field
implies that window scaling is not in use.

Sponsored by: Chelsio Communications

4 years agoMFC r345103:
Johannes Lundberg [Thu, 12 Sep 2019 21:12:39 +0000 (21:12 +0000)]
MFC r345103:
Implement more PCI speed related functions and macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

4 years agoMFC r345100:
Johannes Lundberg [Thu, 12 Sep 2019 20:15:04 +0000 (20:15 +0000)]
MFC r345100:
Implement task_euid() and get_task_state() function macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

4 years agoMFC r351172:
Alan Somers [Thu, 12 Sep 2019 16:23:22 +0000 (16:23 +0000)]
MFC r351172:

ping6: Raise WARNS level to 6

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21260

4 years agoMFC r351865, r351837:
Toomas Soome [Thu, 12 Sep 2019 06:26:22 +0000 (06:26 +0000)]
MFC r351865, r351837:
ficl: add xemit word
ficl: add uIsGreater word (needed for xemit)

We need xemit to support userboot.so loading images from CURRENT.

4 years agoMFC r348268 (by sef), r348293 (by cem):
Alexander Motin [Wed, 11 Sep 2019 23:45:58 +0000 (23:45 +0000)]
MFC r348268 (by sef), r348293 (by cem):
Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication
code.  The primary client of this is probably going to be ZFS encryption.

4 years agoMFC r342024 (by mmacy): Generalize AES iov optimization
Alexander Motin [Wed, 11 Sep 2019 23:41:09 +0000 (23:41 +0000)]
MFC r342024 (by mmacy): Generalize AES iov optimization

Right now, aesni_cipher_alloc does a bit of special-casing
for CRYPTO_F_IOV, to not do any allocation if the first uio
is large enough for the requested size. While working on ZFS
crypto port, I ran into horrible performance because the code
uses scatter-gather, and many of the times the data to encrypt
was in the second entry. This code looks through the list, and
tries to see if there is a single uio that can contain the
requested data, and, if so, uses that.

This has a slight impact on the current consumers, in that the
check is a little more complicated for the ones that use
CRYPTO_F_IOV -- but none of them meet the criteria for testing
more than one.

4 years agoMFC r350993, r350997, r351079-r351080, r351082, r351090, r351101-r351102
Alan Somers [Wed, 11 Sep 2019 20:13:38 +0000 (20:13 +0000)]
MFC r350993, r350997, r351079-r351080, r351082, r351090, r351101-r351102

r350993:
Consistently use the byteorder functions in the correct direction

Though ntohs and htons are functionally identical, they have different meanings.Using the correct one helps to document the code.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21219

r350997:
ping6: use the monotonic clock to measure durations

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21226

r351079:
ping6: quiet warning about unused copyright variable

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21270

r351080:
ping6: quiet an undefined variable warning

GCC 4.2 isn't smart enough to know that this variable is already defined by
the time it's used.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21269

r351082:
ping6: fix uninitialized variable warning for intvl

GCC isn't smart enough to realize that this variable was always initialized.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21271

r351090:
ping6: Fix data type of the buffer for ancillary data of a received message

The old code worked, but wasted some stack space.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21275

r351101:
ping6: fix uninitialized variable warnings when MK_CASPER=no

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21273

r351102:
ping6: Fix alignment errors

This fixes -Wcast-align errors when compiled with WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21217

4 years agoFix miss merge in r352179.
Mariusz Zaborski [Wed, 11 Sep 2019 16:06:05 +0000 (16:06 +0000)]
Fix miss merge in r352179.

4 years agoMFC r351830:
Konstantin Belousov [Wed, 11 Sep 2019 04:55:10 +0000 (04:55 +0000)]
MFC r351830:
madvise(MADV_FREE): Quick fix to time rewind.

PR: 240061

4 years agoMFC: r352197
Jung-uk Kim [Tue, 10 Sep 2019 22:26:31 +0000 (22:26 +0000)]
MFC: r352197

Remove unnecessary entries from the previous commit.

4 years agoMFC: r352191
Jung-uk Kim [Tue, 10 Sep 2019 21:13:37 +0000 (21:13 +0000)]
MFC: r352191

Merge OpenSSL 1.1.1d.

4 years agoMFCr350429:
Mariusz Zaborski [Tue, 10 Sep 2019 20:55:47 +0000 (20:55 +0000)]
MFCr350429:
  proc: make clear_orphan an public API

  This will be useful for other patches with process descriptors.
  Change its name as well.

  Reviewed by:  markj, kib

4 years agoMFCr340638:
Mariusz Zaborski [Tue, 10 Sep 2019 20:49:47 +0000 (20:49 +0000)]
MFCr340638:
 libcasper: provide compatibility with the old version of service

  Some external tools like tcpdump(1) have upstream the changes with old limits
  name. Because of that provide compatibility with the old names.

  Reported by:  emaste

4 years agoMFCr340363:
Mariusz Zaborski [Tue, 10 Sep 2019 20:45:51 +0000 (20:45 +0000)]
MFCr340363:
  libcasper: Change the name of limits in cap_dns so the intentions are obvious.

  Reported by:  pjd

4 years agoMFCr340141:
Mariusz Zaborski [Tue, 10 Sep 2019 20:41:42 +0000 (20:41 +0000)]
MFCr340141:
  libcasper: fix limitations in dns service

  The getaddrinfo(3) and gethostbyname(3) are used to return the address for a
  given hostname. The getnameinfo(3) and gethostbyaddr(3) are used to return
  hostname for a given address. Right now in casper, we have two limitations:
  - NAME which allows resolving DNS names.
  - ADDR which allows to do revert DNS lookups.

  Before this change the rights was mixed up:
  NAME - getnameinfo(3) and gethostbyname(3)
  ADDR - gethostbyaddr(3) and getaddrinfo(3)

  Which no matters on limitation allowed us to resolve DNS names and do DNS
  lookups basically by using a different set of functions.

  Now the NAME type allows getaddrinfo(3) and gethostbyname (3)functions,
  and the ADDR names allow to use gethostbyaddr(3) and getnameinfo(3) functions.

  Reviewed by:  pjd, bcr
  Discussed with:       hrs
  Differential Revision:        https://reviews.freebsd.org/D16930

4 years agoMFCr350617:
Mariusz Zaborski [Tue, 10 Sep 2019 20:21:47 +0000 (20:21 +0000)]
MFCr350617:
  procdesc: fix the function name

  I changed name of the function r350429 and forgot to update
  the r350612 patch.

  Reported by:  jenkins

4 years agoMFCr350616:
Mariusz Zaborski [Tue, 10 Sep 2019 20:20:45 +0000 (20:20 +0000)]
MFCr350616:
  process: style

  We don't need to check if the parent is already set.
  This is done already in the proc_reparent.

  No functional behaviour changes intended.

  MFC after:    1 month

4 years agoMFCr350614:
Mariusz Zaborski [Tue, 10 Sep 2019 20:19:02 +0000 (20:19 +0000)]
MFCr350614:
  exit1: fix style nits

4 years agoMFCr350612
Mariusz Zaborski [Tue, 10 Sep 2019 20:18:06 +0000 (20:18 +0000)]
MFCr350612
  procdesc: fix reparenting when the debugger is attached

  The process is reparented to the debugger while it is attached.
    B          B
   /   ---->   |
  A          A D

  Every time when the process is reparented, it is added to the orphan list
  of the previous parent:

  A->orphan = B
  D->orphan = NULL

  When the A process will close the process descriptor to the B process,
  the B process will be reparented to the init process.
    B            B - init
    |   ---->
  A D          A   D

  A->orphan = B
  D->orphan = B

  In this scenario, the B process is in the orphan list of A and D.

  When the last process descriptor is closed instead of reparenting
  it to the reaper let it stay with the debugger process and set
  our previews parent to the reaper.

  Add test case for this situation.
  Notice that without this patch the kernel will crash with this test case:
  panic: orphan 0xfffff8000e990530 of 0xfffff8000e990000 has unexpected oppid 1

  Reviewed by:  markj, kib
  Differential Revision:        https://reviews.freebsd.org/D20361

4 years agoMFCr350611:
Mariusz Zaborski [Tue, 10 Sep 2019 20:15:52 +0000 (20:15 +0000)]
MFCr350611:
  proc: introduce the proc_add_orphan function

  This API allows adding the process to its parent orphan list.

  Reviewed by:  kib, markj

4 years agoMFCr350610:
Mariusz Zaborski [Tue, 10 Sep 2019 20:14:52 +0000 (20:14 +0000)]
MFCr350610:
  exit1: postpone clearing P_TRACED flag until the proctree lock is acquired

  In case of the process being debugged. The P_TRACED is cleared very early,
  which would make procdesc_close() not calling proc_clear_orphan().
  That would result in the debugged process can not be able to collect
  status of the process with process descriptor.

  Reviewed by:  markj, kib
  Tested by:    pho

4 years agoMFC r351774:
Konstantin Belousov [Tue, 10 Sep 2019 06:47:40 +0000 (06:47 +0000)]
MFC r351774:
Add stackgap control mode to proccontrol(1).

PR: 239894

4 years agoMFC r351773:
Konstantin Belousov [Tue, 10 Sep 2019 06:45:44 +0000 (06:45 +0000)]
MFC r351773:
Add procctl(PROC_STACKGAP_CTL).

PR: 239894

4 years agoMFC r351937:
Johannes Lundberg [Tue, 10 Sep 2019 02:21:17 +0000 (02:21 +0000)]
MFC r351937:
LinuxKPI: Improve sysfs support.

- Add functions for creating and merging sysfs groups.
- Add sysfs_streq function to compare strings ignoring newline from the
  sysctl userland call.
- Add a call to sysfs_create_groups in device_add.
- Remove duplicate header include.
- Bump __FreeBSD_version.

Reviewed by: hselasky
Approved by: imp (mentor), hselasky

4 years agoMFC 351897: nvdimm(4): Add description of NVDIMM Namespace support
D Scott Phillips [Mon, 9 Sep 2019 21:03:08 +0000 (21:03 +0000)]
MFC 351897: nvdimm(4): Add description of NVDIMM Namespace support

Approved by: scottl (mentor)
Sponsored by: Intel Corporation

4 years agoMFC 348757,351225: acpi and nvdimm location_str updates
D Scott Phillips [Mon, 9 Sep 2019 20:49:37 +0000 (20:49 +0000)]
MFC 348757,351225: acpi and nvdimm location_str updates

348757:
nvdimm: Provide nvdimm location information

Provide the acpi handle path as the location string for the nvdimm
children of the nvdimm_root device.

351225:
Don't set the string "unknown" as a device's location_str

Return an empty string when the location is unknown instead of the
string "unknown". This ensures that all location entries are of
the form key=val.

Approved by: scottl (mentor)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D20644

4 years agoMFC r351663: ar: use more correct size_t type for loop index
Ed Maste [Mon, 9 Sep 2019 20:04:45 +0000 (20:04 +0000)]
MFC r351663: ar: use more correct size_t type for loop index

Submitted by: cem

4 years agoMFC r351197, r351199:
Vladimir Kondratyev [Mon, 9 Sep 2019 18:57:17 +0000 (18:57 +0000)]
MFC r351197, r351199:

iwmbtfw: Firmware loader for Intel Wireless 8260 based Bluetooth USB devices

Currently supported models are: 8260, 8265, 9560, 9260 and 22161.
Firmware files can be installed with comms/iwmbt-firmware port.

PR: 237083
Reviewed by: hps, emax
Differential Revision: https://reviews.freebsd.org/D21071

4 years agoMFC r351196, r351324, r351326:
Vladimir Kondratyev [Mon, 9 Sep 2019 18:50:38 +0000 (18:50 +0000)]
MFC r351196, r351324, r351326:

ng_ubt(4): do not attach Intel Wireless 8260/8265 in bootloader mode.

Add helper function for synchronous execution of HCI commands at probe
stage and use this function to check firmware state of Intel Wireless
8260/8265 bluetooth devices found in many post 2016 year laptops.

Attempt to initialize FreeBSD bluetooth stack while such a device is in
bootloader mode locks the adapter hardly so it requires power on/off
cycle to restore.

This change blocks ng_ubt attachment unless operational firmware is
loaded thus preventing the lock up.

PR: 237083
Reviewed by: hps, emax
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21071

4 years agoMFC: r351429,351430,351485,351497,351498
Warner Losh [Mon, 9 Sep 2019 18:27:52 +0000 (18:27 +0000)]
MFC: r351429,351430,351485,351497,351498

Merge changes to turn off -Werror for gcc 4.2.1 by default as part of
the plan to deorbit gcc 4.2.1 from -head before 13.0.

Relnotes: Yes

4 years agoBack out r352087 for now
Kyle Evans [Mon, 9 Sep 2019 18:20:55 +0000 (18:20 +0000)]
Back out r352087 for now

The ancient-gcc -Wno-error series hasn't been MFC'd yet to this branch and
some GCC builds seem to have raised a false-positive that wasn't caught due
to -Wno-error on head. Back it out for now, will reapply when r352092
becomes eligible for MFC...

4 years agobectl(8): fix mis-merge
Kyle Evans [Mon, 9 Sep 2019 18:01:07 +0000 (18:01 +0000)]
bectl(8): fix mis-merge

r348296 ("add description for create subcommand") apparently failed to merge
in the SYNOPSIS addition somehow... correct this mistake now.  This is a
direct commit to stable/12 for a misfire on previous MFC.

4 years agoMFC r351938:
Dimitry Andric [Mon, 9 Sep 2019 17:58:26 +0000 (17:58 +0000)]
MFC r351938:

Pull in r371111 from upstream llvm trunk (by Eli Friedman):

  [IfConversion] Fix diamond conversion with unanalyzable branches.

  The code was incorrectly counting the number of identical
  instructions, and therefore tried to predicate an instruction which
  should not have been predicated.  This could have various effects: a
  compiler crash, an assembler failure, a miscompile, or just
  generating an extra, unnecessary instruction.

  Instead of depending on TargetInstrInfo::removeBranch, which only
  works on analyzable branches, just remove all branch instructions.

  Fixes https://bugs.llvm.org/show_bug.cgi?id=43121 and
  https://bugs.llvm.org/show_bug.cgi?id=41121 .

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

This should fix "Unable to predicate BX killed renamable $r0" errors
when building the lang/spidermonkey170 and lang/spidermonkey38 ports for
armv7 and armv6.

PR: 236567

4 years agoMFC r351813: bectl(8): implement sorting for 'bectl list' output
Kyle Evans [Mon, 9 Sep 2019 17:56:14 +0000 (17:56 +0000)]
MFC r351813: bectl(8): implement sorting for 'bectl list' output

Allow 'bectl list' to sort output by a given property name. The property
name is passed in using a command-line flag, '-c' for ascending order and
'-C' for descending order. The properties allowed to sort by are:

- name (the default output, even if '-c' or '-C' are not used)
- creation
- origin
- used
- usedds
- usedsnap
- usedrefreserv

The default output for 'bectl list' is now ascending alphabetical order of
BE name.

To sort by creation time from earliest to latest, the command would be
'bectl list -c creation'

4 years agoMFC r345845-r345846: bectl(8) manpage clarity
Kyle Evans [Mon, 9 Sep 2019 17:53:15 +0000 (17:53 +0000)]
MFC r345845-r345846: bectl(8) manpage clarity

r345845:
bectl.8: Clean up & clarify the create subcommand

- Improve formatting
- Use consistent variable names
- Improve the description of the create subcommand (1)

PR: 235850

r345846:
bectl.8: Bump date after r345845

4 years agoMFC r344555 (sobomax): makefs: Improve error handling
Ed Maste [Mon, 9 Sep 2019 17:44:14 +0000 (17:44 +0000)]
MFC r344555 (sobomax): makefs: Improve error handling

Bail out if one of the files scheduled to go to the FS image we are
making cannot be read (e.g. EPERM).  Previous behaviour of issuing a
warning but still proceeeding and returning success was definitely not
correct: masking out error condition as well as making a slighly
inconsistent FS where attempt to access the file in question ends up in
EBADF.  (More details in review D18584.)

4 years agoMFC r351797: (Optional) Allow more nesting of GEOM partitioning schemes
Kyle Evans [Mon, 9 Sep 2019 17:43:44 +0000 (17:43 +0000)]
MFC r351797: (Optional) Allow more nesting of GEOM partitioning schemes

GEOM is supposed to be topology-agnostic, but the GPT and BSD partition code
has arbitrary restrictions on nesting that are annoying in cases such as
running VMs on raw partitions (since the VM's partitioning scheme is not
visible to the host).

This patch adds sysctls to disable the restrictions except in the case of
BSD label (and similar) partitions with offset 0 (where we need to avoid
recursively recognizing the label).

4 years agoMFC r351681: mips: fix some mcount nits
Kyle Evans [Mon, 9 Sep 2019 17:37:52 +0000 (17:37 +0000)]
MFC r351681: mips: fix some mcount nits

The symbol version for _mcount was removed 12 years ago in r169525 from
gmon/Symbol.map, to be added to the per-arch Symbol.map. mips was overlooked
in this, so _mcount has no symver. Add it back to where it should have been,
rather than where it would go if it were added today, since we're correcting
a historical mistake.

Additionally, _mcount is getting thrown into .mdebug.abi32 in the llvm80/90
world as it's not getting explicitly thrown into .text, so do this now. This
fixes the libc build that was previously failing due to relocations in
.mdebug.abi32. This is specifically due to the way clang's integrated AS
works and that they emit the .mdebug.abiNN section early in the process. An
LLVM bug has been submitted (and since committed) and an agreement has been
made that the mips backend should switch to .text following .mdebug.abiNN
for compatibility.

4 years agoMFC r351396: makefs: diff reduction to sys/fs/msdosfs
Ed Maste [Mon, 9 Sep 2019 17:34:18 +0000 (17:34 +0000)]
MFC r351396: makefs: diff reduction to sys/fs/msdosfs

No functional change.

4 years agoMFC r351347: makefs: Verify that the BPB media descriptor and FAT ID match
Ed Maste [Mon, 9 Sep 2019 17:33:31 +0000 (17:33 +0000)]
MFC r351347: makefs: Verify that the BPB media descriptor and FAT ID match

From r322982 in sys/fs/msdosfs.

4 years agomakefs: add msdosfs (FAT) support
Ed Maste [Mon, 9 Sep 2019 17:32:40 +0000 (17:32 +0000)]
makefs: add msdosfs (FAT) support

MFC r351232: makefs.8: expand description of image size

Submitted by: ryan_freqlabs.com, Siva Mahadevan

MFC r351273: makefs: add msdosfs (FAT) support

Add FAT support to makefs by copying some files from sys/fs/msdosfs/ and
updating others with changes from NetBSD.

The six files copied from sys/fs/msdosfs at r348251 and modified are:
denode.h direntry.h fat.h msdosfs_fat.c msdosfs_lookup.c msdosfsmount.h

I would prefer to avoid the duplication, but reluctance to doing so was
expressed in a previous review (D11197); for now copy the files and
revisit in the future.

Submitted by: Siva Mahadevan

MFC r351275: makefs: avoid "dereferencing 'void *' pointer" warnings

On GCC 4.2.1 archs

MFC r351302: makefs.8: update history

- ported to FreeBSD and first appeared in 8.0
- Christos Zoulas added the FAT support that I imported

MFC r351319: makefs: use `char *` not `void *` for buf b_data, drop casts in msdos

(The kernel uses caddr_t.)

Suggested by: cem

MFC r351415 (delphij): Properly update FSInfo block after generation.

After populating the filesystem, write a FSInfo block with
proper information.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r351230: makefs.8: style updates from igor
Ed Maste [Mon, 9 Sep 2019 17:24:24 +0000 (17:24 +0000)]
MFC r351230: makefs.8: style updates from igor

Sponsored by: The FreeBSD Foundation

4 years agoMFC r345281: makefs: Fix "time" mtree attribute handling
Ed Maste [Mon, 9 Sep 2019 17:22:11 +0000 (17:22 +0000)]
MFC r345281: makefs: Fix "time" mtree attribute handling

When processing mtree(5) MANIFEST files, makefs(8) previously threw an
error if it encountered an entry whose "time" attribute contained a
non-zero subsecond component (e.g. time=1551620152.987220000).

Update the handling logic to properly assign the subsecond component if
built with nanosecond support, or silently discard it otherwise.

Also, re-enable the time attribute for the kyua tests.

PR: 194703
Submitted by: mhorne

4 years agoMFC r351701:
Johannes Lundberg [Mon, 9 Sep 2019 16:37:38 +0000 (16:37 +0000)]
MFC r351701:
LinuxKPI: Add sysfs create/remove functions that handles multiple files in one call.

Reviewed by: hps
Approved by: imp (mentor), hps

4 years agoMFC r351935:
Fabien Thomas [Mon, 9 Sep 2019 14:41:39 +0000 (14:41 +0000)]
MFC r351935:
Fix broken window replay check that will allow old packet to be accepted.
This was introduced in r309144.

Submitted by: Jean-Francois HREN <jean-francois.hren@stormshield.eu>
Approved by: ae@

4 years agoMFC r350077
Chuck Tuffli [Mon, 9 Sep 2019 14:16:57 +0000 (14:16 +0000)]
MFC r350077

bhyve: update the NVMe CQ based on the status

Approved by: imp (mentor)

4 years agoMFC r351361, r351363:
Mark Johnston [Sun, 8 Sep 2019 20:53:29 +0000 (20:53 +0000)]
MFC r351361, r351363:
Add lockmgr(9) probes to the lockstat DTrace provider.

4 years agoMFC r351671:
Mark Johnston [Sun, 8 Sep 2019 20:42:55 +0000 (20:42 +0000)]
MFC r351671:
Fix an off-by-one bug in the CPU and domain ID parser.

4 years agoMFC r351624:
Mark Johnston [Sun, 8 Sep 2019 20:42:28 +0000 (20:42 +0000)]
MFC r351624:
Properly check for an interrupted cv_wait_sig().

4 years agoMFC r351573:
Mark Johnston [Sun, 8 Sep 2019 20:41:00 +0000 (20:41 +0000)]
MFC r351573:
Document fetchReqHTTP().

4 years agoMFC r351672:
Mark Johnston [Sun, 8 Sep 2019 20:39:55 +0000 (20:39 +0000)]
MFC r351672:
Restrict the input domain set in cpuset_setdomain(2) to all_domains.

4 years agoMFC r351332:
Mark Johnston [Sun, 8 Sep 2019 20:38:58 +0000 (20:38 +0000)]
MFC r351332:
Unconditionally enable debug.vm_lowmem.

4 years agoMFC r350431:
Mark Johnston [Sun, 8 Sep 2019 20:37:42 +0000 (20:37 +0000)]
MFC r350431:
Centralize the logic in vfs_vmio_unwire() and sendfile_free_page().

4 years agoMFC r351547, r351549:
Mark Johnston [Sun, 8 Sep 2019 20:28:06 +0000 (20:28 +0000)]
MFC r351547, r351549:
Fix several logic issues in domainset_empty_vm().

4 years agoMFC r351614
Jason Helfman [Sun, 8 Sep 2019 16:24:34 +0000 (16:24 +0000)]
MFC r351614

- address missing whitespace for indent

PR: 239727
Submitted by: gbergling@gmail.com
Reviewed by: 0mp@

4 years agoMFC r351889:
Cy Schubert [Sun, 8 Sep 2019 01:58:02 +0000 (01:58 +0000)]
MFC r351889:

Bounds check again after advancing cp, otherwise we have a possible
heap buffer overflow. This was discovered by a Google fuzzer test.
This can lead to remote denial of service. User interaction and
execution privileges are not a prerequisite for exploitation.

Reported by: enh at Google, to FreeBSD by maya@NetBSD.org
Obtained from: enh at Google
See also: NetBSD ns_name.c r1.12
Reviewed by: delphij, ume
MFC after: 3 days
https://android-review.googlesource.com/c/platform/bionic/+/1093130
Differential Revision: https://reviews.freebsd.org/D21523

4 years agoImprove DSACK support:
Michael Tuexen [Sat, 7 Sep 2019 19:58:06 +0000 (19:58 +0000)]
Improve DSACK support:

MFC This is the second in a number of patches needed to
get BBRv1 into the tree. This fixes the DSACK bug but
is also needed by BBR. We have yet to go two more
one will be for the pacing code (tcp_ratelimit.c) and
the second will be for the new updated LRO code that
allows a transport to know the arrival times of packets
and (tcp_lro.c). After that we should finally be able
Improve DSACK support.

MFC r349987 from rrs@:

This is the second in a number of patches needed to
get BBRv1 into the tree. This fixes the DSACK bug but
is also needed by BBR. We have yet to go two more
one will be for the pacing code (tcp_ratelimit.c) and
the second will be for the new updated LRO code that
allows a transport to know the arrival times of packets
and (tcp_lro.c). After that we should finally be able
to get BBRv1 into head.

This required manual tweaking to address merge conflicts.

MFC r351725:

This patch improves the DSACK handling to conform with RFC 2883.
The lowest SACK block is used when multiple Blocks would be elegible as
DSACK blocks ACK blocks get reordered - while maintaining the ordering of
SACK blocks not relevant in the DSACK context is maintained.

This required manual tweaking to address merge conflicts.

MFC r351801:

Fix the SACK block generation in the base TCP stack by bringing it in
sync with the RACK stack.

4 years agoMFC r351631
Sevan Janiyan [Sat, 7 Sep 2019 17:22:25 +0000 (17:22 +0000)]
MFC r351631
Earliest reference to /dev/null I can find is in v4 sh(1) and nulldev in
nsys/ken/subr.c
via TUHS archive
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4

4 years agoMFC r351655:
Michael Tuexen [Sat, 7 Sep 2019 12:20:47 +0000 (12:20 +0000)]
MFC r351655:

Fix initialization of top_fsn.

4 years agoMFC r351654:
Michael Tuexen [Sat, 7 Sep 2019 12:19:07 +0000 (12:19 +0000)]
MFC r351654:

Improve the handling of state cookie parameters in INIT-ACK chunks.
This fixes problem with parameters indicating a zero length or partial
parameters after an unknown parameter indicating to stop processing. It
also fixes a problem with state cookie parameters after unknown
parametes indicating to stop porcessing.
Thanks to Mark Wodrich from Google for finding two of these issues
by fuzz testing the userland stack and reporting them in
https://github.com/sctplab/usrsctp/issues/351
and
https://github.com/sctplab/usrsctp/issues/352

4 years agoMFC r351641:
Michael Tuexen [Sat, 7 Sep 2019 12:15:23 +0000 (12:15 +0000)]
MFC r351641:
Improve function definition.

4 years agoMFC r351638:
Michael Tuexen [Sat, 7 Sep 2019 12:13:58 +0000 (12:13 +0000)]
MFC r351638:

Improve the handling of illegal sequence number combinations in received
data chunks. Abort the association if there are data chunks with larger
fragement sequence numbers than the fragement sequence of the last
fragment.
Thanks to Mark Wodrich from Google who found this issue by fuzz testing
the userland stack and reporting this issue in
https://github.com/sctplab/usrsctp/issues/355

4 years agoMFC r351511:
Michael Tuexen [Sat, 7 Sep 2019 12:03:13 +0000 (12:03 +0000)]
MFC r351511:

Identify eMAG CPU used in Ampere Computing systems.

Reviewed by: emaste@
Differential Revision: https://reviews.freebsd.org/D21314

4 years agoMFC r350745:
Michael Tuexen [Sat, 7 Sep 2019 12:01:41 +0000 (12:01 +0000)]
MFC r350745:

Fix a typo.

Submitted by: Thomas Dreibholz

4 years agoMFC r350627:
Michael Tuexen [Sat, 7 Sep 2019 12:00:17 +0000 (12:00 +0000)]
MFC r350627:

Reference the RFC instead of the internet draft.

Sponsored by: Netflix, Inc.

4 years agoMFC r350626:
Michael Tuexen [Sat, 7 Sep 2019 11:58:32 +0000 (11:58 +0000)]
MFC r350626:

Fix a locking issue in sctp_accept.

PR: 238520
Reported by: pho@

4 years agoMFC r350625:
Michael Tuexen [Sat, 7 Sep 2019 11:56:43 +0000 (11:56 +0000)]
MFC r350625:

Fix build issues for the userland stack on Raspbian.

4 years agoMFC r350520:
Michael Tuexen [Sat, 7 Sep 2019 11:52:35 +0000 (11:52 +0000)]
MFC r350520:

Fix the reporting of multiple unknown parameters in an received INIT
chunk. This also plugs an potential mbuf leak.
Thanks to Felix Weinrank for reporting this issue found by fuzz-testing
the userland stack.

4 years agoMFC r350508:
Michael Tuexen [Sat, 7 Sep 2019 11:51:07 +0000 (11:51 +0000)]
MFC r350508:

When responding with an ABORT to an INIT chunk containing a
HOSTNAME parameter or a parameter with an illegal length, only
include an error cause indicating why the ABORT was sent.
This also fixes an mbuf leak which could occur.

4 years agoMFC r350488:
Michael Tuexen [Sat, 7 Sep 2019 11:49:41 +0000 (11:49 +0000)]
MFC r350488:

Small cleanup, no functional change intended.

4 years agoMFC r350487:
Michael Tuexen [Sat, 7 Sep 2019 11:48:25 +0000 (11:48 +0000)]
MFC r350487:

Consistently cleanup mbufs in case of other memory errors.

4 years agoMFC r350404:
Michael Tuexen [Sat, 7 Sep 2019 11:46:49 +0000 (11:46 +0000)]
MFC r350404:

When performing after_idle() or post_recovery(), don't disable the
DCTCP specific methods. Also fallthrough NewReno for non ECN capable
TCP connections and improve the integer arithmetic.

Obtained from: Richard Scheffenegger
Differential Revision: https://reviews.freebsd.org/D20550

4 years agoMFC r350403:
Michael Tuexen [Sat, 7 Sep 2019 11:33:27 +0000 (11:33 +0000)]
MFC r350403:

* Improve input validation of sysctl parameters for DCTPC.
* Initialize the alpha parameter to a conservative value (like Linux)
* Improve handling of arithmetic.
* Improve man-page

Obtained from: Richard Scheffenegger
Differential Revision: https://reviews.freebsd.org/D20549

4 years agoMFC r350265:
Michael Tuexen [Sat, 7 Sep 2019 11:31:05 +0000 (11:31 +0000)]
MFC r350265:

Add a sysctl variable ts_offset_per_conn to change the computation
of the TCP TS offset from taking the IP addresses and the TCP port
numbers into account to a version just taking only the IP addresses
into account. This works around broken middleboxes or endpoints.
The default is to keep the behaviour, which is also the behaviour
recommended in RFC 7323.

Reported by: devgs@ukr.net
Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D20980

4 years agoMFC r350254:
Michael Tuexen [Sat, 7 Sep 2019 11:24:29 +0000 (11:24 +0000)]
MFC r350254:

Don't hold a mutex while calling sbwait. This was found by syzkaller.

Submitted by: rrs@
Reported by: markj@