]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoFix build error introduced by r349596.
ganbold [Wed, 3 Jul 2019 01:40:29 +0000 (01:40 +0000)]
Fix build error introduced by r349596.

4 years agoRemove the CDIOCREADSUBCHANNEL_SYSSPACE ioctl.
markj [Wed, 3 Jul 2019 00:10:01 +0000 (00:10 +0000)]
Remove the CDIOCREADSUBCHANNEL_SYSSPACE ioctl.

This was added for emulation of Linux's CDROMSUBCHNL, but allows
users with read access to a cd(4) device to overwrite kernel memory
provided that the driver detects some media present.

Reimplement CDROMSUBCHNL by bouncing the data from CDIOCREADSUBCHANNEL
through the linux_cdrom_subchnl structure passed from userspace.

admbugs: 768
Reported by: Alex Fortune
Security: CVE-2019-5602
Security: FreeBSD-SA-19:11.cd_ioctl

4 years agolibc: correct iconv buffer overflow
emaste [Tue, 2 Jul 2019 23:56:37 +0000 (23:56 +0000)]
libc: correct iconv buffer overflow

admbugs: 920
Submitted by: Andrea Venturoli, gabor
Reported by: Andrea Venturoli <security@netfence.it>, NetFence
Security: CVE-2019-5600
Security: FreeBSD-SA-19:09.iconv

4 years agoImplement pmap_copy(). (This includes the changes applied to the amd64
alc [Tue, 2 Jul 2019 23:02:52 +0000 (23:02 +0000)]
Implement pmap_copy().  (This includes the changes applied to the amd64
pmap_copy() in r349585.)

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

4 years agoInvoke ext_free function when freeing an unmapped mbuf.
jhb [Tue, 2 Jul 2019 22:58:21 +0000 (22:58 +0000)]
Invoke ext_free function when freeing an unmapped mbuf.

Fix a mis-merge when extracting the unmapped mbuf changes from
Netflix's in-kernel TLS changes where the call to the function that
freed the backing pages from an unmapped mbuf was missed.

Sponsored by: Chelsio Communications

4 years agoFix description of debug.obsolete_panic.
jhb [Tue, 2 Jul 2019 22:57:24 +0000 (22:57 +0000)]
Fix description of debug.obsolete_panic.

MFC after: 1 week

4 years agoFix build race when building rtld
arichardson [Tue, 2 Jul 2019 22:11:07 +0000 (22:11 +0000)]
Fix build race when building rtld

I found this on one of the CheriBSD Jenkins builders. Using
beforelinking instead of ${PROG} should fix the dependency for the
DEBUG_FILES case.

Reviewed by: brooks

4 years agoMore style.
kib [Tue, 2 Jul 2019 21:03:06 +0000 (21:03 +0000)]
More style.

Re-wrap long lines, reformat comments, remove excessive blank line.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoefihttp: mac and err can be used uninitialized
tsoome [Tue, 2 Jul 2019 20:32:35 +0000 (20:32 +0000)]
efihttp: mac and err can be used uninitialized

While there, also check if mac != NULL, and use pointer compare for ipv4
and dns.

4 years agoMark pages allocated from the per-CPU cache.
markj [Tue, 2 Jul 2019 19:51:40 +0000 (19:51 +0000)]
Mark pages allocated from the per-CPU cache.

Only free pages to the cache when they were allocated from that cache.
This mitigates rapid fragmentation of physical memory seen during
poudriere's dependency calculation phase.  In particular, pages
belonging to broken reservations are no longer freed to the per-CPU
cache, so they get a chance to coalesce with freed pages during the
break.  Otherwise, the optimized CoW handler may create object
chains in which multiple objects contain pages from the same
reservation, and the order in which we do object termination means
that the reservation is broken before all of those pages are freed,
so some of them end up in the per-CPU cache and thus permanently
fragment physical memory.

The flag may also be useful for eliding calls to vm_reserv_free_page(),
thus avoiding memory accesses for data that is likely not present
in the CPU caches.

Reviewed by: alc
Discussed with: jeff
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20763

4 years agoStyle.
kib [Tue, 2 Jul 2019 19:32:48 +0000 (19:32 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoAdd implicit PROT_MAX() knob to proccontrol(1).
kib [Tue, 2 Jul 2019 19:12:02 +0000 (19:12 +0000)]
Add implicit PROT_MAX() knob to proccontrol(1).

Reviewed by: emaste, markj (previous version)
Discussed with: brooks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D20795

4 years agoControl implicit PROT_MAX() using procctl(2) and the FreeBSD note
kib [Tue, 2 Jul 2019 19:07:17 +0000 (19:07 +0000)]
Control implicit PROT_MAX() using procctl(2) and the FreeBSD note
feature bit.

In particular, allocate the bit to opt-out the image from implicit
PROTMAX enablement.  Provide procctl(2) verbs to set and query
implicit PROTMAX handling.  The knobs mimic the same per-image flag
and per-process controls for ASLR.

Reviewed by: emaste, markj (previous version)
Discussed with: brooks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D20795

4 years agoUse traditional 'p' local to designate td->td_proc in kern_mmap.
kib [Tue, 2 Jul 2019 19:01:14 +0000 (19:01 +0000)]
Use traditional 'p' local to designate td->td_proc in kern_mmap.

Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D20795

4 years agopci(4): Use plural configuration registers
zeising [Tue, 2 Jul 2019 17:48:27 +0000 (17:48 +0000)]
pci(4): Use plural configuration registers

Change to use registers instead of register, as it is customary to use
plural when talking about PCI registers.

This was missed in r349150.

MFC after: 3 days

4 years agoif_muge: set IFCAP_VLAN_MTU to maintain 1500 MTU with vlan use
emaste [Tue, 2 Jul 2019 16:44:04 +0000 (16:44 +0000)]
if_muge: set IFCAP_VLAN_MTU to maintain 1500 MTU with vlan use

PR: 238665
Submitted by: Ralf <iz-rpi03@hs-karlsruhe.de>
MFC after: 1 week

4 years agoInclude sys/lock.h, as told by man page.
mav [Tue, 2 Jul 2019 15:01:54 +0000 (15:01 +0000)]
Include sys/lock.h, as told by man page.

MFC after: 1 week

4 years agoCorrect name of vmm(4) pptdevs variable.
wblock [Tue, 2 Jul 2019 14:53:51 +0000 (14:53 +0000)]
Correct name of vmm(4) pptdevs variable.

Reported by: nwolff@ixsystems.com

4 years agoFix handling of errors from sblock() in soreceive_stream().
markj [Tue, 2 Jul 2019 14:24:42 +0000 (14:24 +0000)]
Fix handling of errors from sblock() in soreceive_stream().

Previously we would attempt to unlock the socket buffer despite having
failed to lock it.  Simply return an error instead: no resources need
to be released at this point, and doing so is consistent with
soreceive_generic().

PR: 238789
Submitted by: Greg Becker <greg@codeconcepts.com>
MFC after: 1 week

4 years agoExtend simple_mfd driver to expose a syscon interface if
ganbold [Tue, 2 Jul 2019 08:47:18 +0000 (08:47 +0000)]
Extend simple_mfd driver to expose a syscon interface if
that node is also compatible with syscon. For instance,
Rockchip RK3399's GRF (General Register Files) is compatible
with simple-mfd as well as syscon and has devices like
usb2-phy, emmc-phy and pcie-phy etc. under it.

Reviewed by: manu

4 years agoFix i386 LINT after r349594.
mav [Tue, 2 Jul 2019 07:47:11 +0000 (07:47 +0000)]
Fix i386 LINT after r349594.

MFC after: 1 month

4 years agoAdd driver for NTB in AMD SoC.
mav [Tue, 2 Jul 2019 05:25:18 +0000 (05:25 +0000)]
Add driver for NTB in AMD SoC.

This patch is the driver for NTB hardware in AMD SoCs (ported from Linux)
and enables the NTB infrastructure like Doorbells, Scratchpads and Memory
window in AMD SoC. This driver has been validated using ntb_transport and
if_ntb driver already available in FreeBSD.

Submitted by: Rajesh Kumar <rajesh1.kumar@amd.com>
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D18774

4 years agobwn(4): Include SROM revision when printing device identification.
landonf [Tue, 2 Jul 2019 02:52:05 +0000 (02:52 +0000)]
bwn(4): Include SROM revision when printing device identification.

4 years agoImport tzdata 2019b
philip [Tue, 2 Jul 2019 01:12:23 +0000 (01:12 +0000)]
Import tzdata 2019b

Changes: https://github.com/eggert/tz/blob/2019b/NEWS

MFC after: 1 day

4 years agoAdd a new "untrusted" option to the mount command. Its purpose
mckusick [Mon, 1 Jul 2019 23:22:26 +0000 (23:22 +0000)]
Add a new "untrusted" option to the mount command. Its purpose
is to notify the kernel that the file system is untrusted and it
should use more extensive checks on the file-system's metadata
before using it. This option is intended to be used when mounting
file systems from untrusted media such as USB memory sticks or other
externally-provided media.

It will initially be used by the UFS/FFS file system, but should
likely be expanded to be used by other file systems that may appear
on external media like msdosfs, exfat, and ext2fs.

Reviewed by:  kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20786

4 years agoarm64: efi: Map memory IO region as device
manu [Mon, 1 Jul 2019 22:11:56 +0000 (22:11 +0000)]
arm64: efi: Map memory IO region as device

Reviewed by: andrew
Sponsored by: Ampere Computing, LLC

4 years agog_mirror_taste: avoid deadlock, always clear tasting flag
rlibby [Mon, 1 Jul 2019 22:06:36 +0000 (22:06 +0000)]
g_mirror_taste: avoid deadlock, always clear tasting flag

If g_mirror_taste encountered an error at g_mirror_add_disk, it might
try to g_mirror_destroy the device with the G_MIRROR_DEVICE_FLAG_TASTING
flag still set.  This would wait on a worker to complete the destruction
with g_mirror_try_destroy, but that function bails out if the tasting
flag is set, resulting in a deadlock.  Clear the tasting flag before
trying to destroy the device.

Test Plan:
sysctl debug.fail_point.mnowait="1%return"
kyua test -k /usr/tests/sys/geom/class/mirror/Kyuafile

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

4 years agog_eli_create: only dec g_access acw if we inc'd it
rlibby [Mon, 1 Jul 2019 22:06:16 +0000 (22:06 +0000)]
g_eli_create: only dec g_access acw if we inc'd it

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

4 years agoTidy up pmap_copy(). Notably, deindent the innermost loop by making a
alc [Mon, 1 Jul 2019 22:00:42 +0000 (22:00 +0000)]
Tidy up pmap_copy().  Notably, deindent the innermost loop by making a
simple change to the control flow.  Replace an unnecessary test by a
KASSERT.  Add a comment explaining an obscure test.

Reviewed by: kib, markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D20812

4 years agoSince r349571 we need all the accessor to be present for set or get
manu [Mon, 1 Jul 2019 21:50:53 +0000 (21:50 +0000)]
Since r349571 we need all the accessor to be present for set or get
otherwise we panic.
dwmmc don't handle VCCQ (voltage for the IO line of the SD/eMMC) or
TIMING.
Add the needed accessor in the {read,write}_ivar functions.

Reviewed by: imp (previous version)

4 years agoPull in r360968 from upstream llvm trunk (by Philip Reames):
dim [Mon, 1 Jul 2019 21:06:10 +0000 (21:06 +0000)]
Pull in r360968 from upstream llvm trunk (by Philip Reames):

  Clarify comments on helpers used by LFTR [NFC]

  I'm slowly wrapping my head around this code, and am making comment
  improvements where I can.

Pull in r360972 from upstream llvm trunk (by Philip Reames):

  [LFTR] Factor out a helper function for readability purpose [NFC]

Pull in r360976 from upstream llvm trunk (by Philip Reames):

  [IndVars] Don't reimplement Loop::isLoopInvariant [NFC]

  Using dominance vs a set membership check is indistinguishable from a
  compile time perspective, and the two queries return equivelent
  results.  Simplify code by using the existing function.

Pull in r360978 from upstream llvm trunk (by Philip Reames):

  [LFTR] Strengthen assertions in genLoopLimit [NFCI]

Pull in r362292 from upstream llvm trunk (by Nikita Popov):

  [IndVarSimplify] Fixup nowrap flags during LFTR (PR31181)

  Fix for https://bugs.llvm.org/show_bug.cgi?id=31181 and partial fix
  for LFTR poison handling issues in general.

  When LFTR moves a condition from pre-inc to post-inc, it may now
  depend on value that is poison due to nowrap flags. To avoid this, we
  clear any nowrap flag that SCEV cannot prove for the post-inc addrec.

  Additionally, LFTR may switch to a different IV that is dynamically
  dead and as such may be arbitrarily poison. This patch will correct
  nowrap flags in some but not all cases where this happens. This is
  related to the adoption of IR nowrap flags for the pre-inc addrec.
  (See some of the switch_to_different_iv tests, where flags are not
  dropped or insufficiently dropped.)

  Finally, there are likely similar issues with the handling of GEP
  inbounds, but we don't have a test case for this yet.

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

Pull in r362971 from upstream llvm trunk (by Philip Reames):

  Prepare for multi-exit LFTR [NFC]

  This change does the plumbing to wire an ExitingBB parameter through
  the LFTR implementation, and reorganizes the code to work in terms of
  a set of individual loop exits. Most of it is fairly obvious, but
  there's one key complexity which makes it worthy of consideration.
  The actual multi-exit LFTR patch is in D62625 for context.

  Specifically, it turns out the existing code uses the backedge taken
  count from before a IV is widened. Oddly, we can end up with a
  different (more expensive, but semantically equivelent) BE count for
  the loop when requerying after widening.  For the nestedIV example
  from elim-extend, we end up with the following BE counts:
  BEFORE: (-2 + (-1 * %innercount) + %limit)
  AFTER: (-1 + (sext i32 (-1 + %limit) to i64) + (-1 * (sext i32 %innercount to i64))<nsw>)

  This is the only test in tree which seems sensitive to this
  difference. The actual result of using the wider BETC on this example
  is that we actually produce slightly better code. :)

  In review, we decided to accept that test change.  This patch is
  structured to preserve the old behavior, but a separate change will
  immediate follow with the behavior change.  (I wanted it separate for
  problem attribution purposes.)

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

Pull in r362975 from upstream llvm trunk (by Philip Reames):

  [LFTR] Use recomputed BE count

  This was discussed as part of D62880.  The basic thought is that
  computing BE taken count after widening should produce (on average)
  an equally good backedge taken count as the one before widening.
  Since there's only one test in the suite which is impacted by this
  change, and it's essentially equivelent codegen, that seems to be a
  reasonable assertion.  This change was separated from r362971 so that
  if this turns out to be problematic, the triggering piece is obvious
  and easily revertable.

  For the nestedIV example from elim-extend.ll, we end up with the
  following BE counts:
  BEFORE: (-2 + (-1 * %innercount) + %limit)
  AFTER: (-1 + (sext i32 (-1 + %limit) to i64) + (-1 * (sext i32 %innercount to i64))<nsw>)

  Note that before is an i32 type, and the after is an i64.  Truncating
  the i64 produces the i32.

Pull in r362980 from upstream llvm trunk (by Philip Reames):

  Factor out a helper function for readability and reuse in a future
  patch [NFC]

Pull in r363613 from upstream llvm trunk (by Philip Reames):

  Fix a bug w/inbounds invalidation in LFTR (recommit)

  Recommit r363289 with a bug fix for crash identified in pr42279.
  Issue was that a loop exit test does not have to be an icmp, leading
  to a null dereference crash when new logic was exercised for that
  case.  Test case previously committed in r363601.

  Original commit comment follows:

  This contains fixes for two cases where we might invalidate inbounds
  and leave it stale in the IR (a miscompile). Case 1 is when switching
  to an IV with no dynamically live uses, and case 2 is when doing
  pre-to-post conversion on the same pointer type IV.

  The basic scheme used is to prove that using the given IV (pre or
  post increment forms) would have to already trigger UB on the path to
  the test we're modifying. As such, our potential UB triggering use
  does not change the semantics of the original program.

  As was pointed out in the review thread by Nikita, this is defending
  against a separate issue from the hasConcreteDef case. This is about
  poison, that's about undef. Unfortunately, the two are different, see
  Nikita's comment for a fuller explanation, he explains it well.

  (Note: I'm going to address Nikita's last style comment in a separate
  commit just to minimize chance of subtle bugs being introduced due to
  typos.)

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

Pull in r363875 from upstream llvm trunk (by Philip Reames):

  [LFTR] Rename variable to minimize confusion [NFC]

  (Recommit of r363293 which was reverted when a dependent patch was.)

  As pointed out by Nikita in D62625, BackedgeTakenCount is generally
  used to refer to the backedge taken count of the loop. A conditional
  backedge taken count - one which only applies if a particular exit is
  taken - is called a ExitCount in SCEV code, so be consistent here.

Pull in r363877 from upstream llvm trunk (by Philip Reames):

  [LFTR] Stylistic cleanup as suggested in last review comment of
  D62939 [NFC]

  (Resumbit of r363292 which was reverted along w/an earlier patch)

Pull in r364346 from upstream llvm trunk (by Philip Reames):

  [LFTR] Adjust debug output to include extensions (if any)

Pull in r364693 from upstream llvm trunk (by Philip Reames):

  [IndVars] Remove a bit of manual constant folding [NFC]

  SCEV is more than capable of folding (add x, trunc(0)) to x.

Pull in r364709 from upstream llvm trunk (by Nikita Popov):

  [LFTR] Fix post-inc pointer IV with truncated exit count (PR41998)

  Fixes https://bugs.llvm.org/show_bug.cgi?id=41998. Usually when we
  have a truncated exit count we'll truncate the IV when comparing
  against the limit, in which case exit count overflow in post-inc form
  doesn't matter. However, for pointer IVs we don't do that, so we have
  to be careful about incrementing the IV in the wide type.

  I'm fixing this by removing the IVCount variable (which was ExitCount
  or ExitCount+1) and replacing it with a UsePostInc flag, and then
  moving the actual limit adjustment to the individual cases (which
  are: pointer IV where we add to the wide type, integer IV where we
  add to the narrow type, and constant integer IV where we add to the
  wide type).

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

Together, these should fix a hang when building the textproc/htmldoc
port, due to an incorrect loop optimization.

PR: 237515
MFC after: 1 week

4 years agoFactor out the code that does a VOP_SETATTR(size) from vn_truncate().
rmacklem [Mon, 1 Jul 2019 20:41:43 +0000 (20:41 +0000)]
Factor out the code that does a VOP_SETATTR(size) from vn_truncate().

This patch factors the code in vn_truncate() that does the actual
VOP_SETATTR() of size into a separate function called vn_truncate_locked().
This will allow the NFS server and the patch that adds a
copy_file_range(2) syscall to call this function instead of duplicating
the code and carrying over changes, such as the recent r347151.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D20808

4 years agonetmap: fix two panics with emulated adapter
vmaffione [Mon, 1 Jul 2019 20:37:35 +0000 (20:37 +0000)]
netmap: fix two panics with emulated adapter

This patch fixes 2 panics. The first one is due to the current VNET not
being set in the emulated adapter transmission path. The second one
is caused by the M_PKTHDR flag not being set when preallocated mbufs
are recycled in the transmit path.

Submitted by: aleksandr.fedorov@itglobal.com
Reviewed by: vmaffione
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20824

4 years agoadd superio driver
avg [Mon, 1 Jul 2019 17:05:41 +0000 (17:05 +0000)]
add superio driver

The goal of this driver is consolidate information about SuperIO chips
and to provide for peaceful coexistence of drivers that need to access
SuperIO configuration registers.

While SuperIO chips can host various functions most of them are
discoverable and accessible without any knowledge of the SuperIO.
Examples are: keyboard and mouse controllers, UARTs, floppy disk
controllers.  SuperIO-s also provide non-standard functions such as
GPIO, watchdog timers and hardware monitoring.  Such functions do
require drivers with a knowledge of a specific SuperIO.

At this time the driver supports a number of ITE and Nuvoton (fka
Winbond) SuperIO chips.
There is a single driver for all devices.  So, I have not done the usual
split between the hardware driver and the bus functionality.  Although,
superio does act as a bus for devices that represent known non-standard
functions of a SuperIO chip.  The bus provides enumeration of child
devices based on the hardcoded knowledge of such functions.  The
knowledge as extracted from datasheets and other drivers.
As there is a single driver, I have not defined a kobj interface for it.
So, its interface is currently made of simple functions.
I think that we can the flexibility (and complications) when we actually
need it.

I am planning to convert nctgpio and wbwd to superio bus very soon.
Also, I am working on itwd driver (watchdog in ITE SuperIO-s).
Additionally, there is ithwm driver based on the reverted sensors
import, but I am not sure how to integrate it given that we still lack
any sensors interface.

Discussed with: imp, jhb
MFC after: 7 weeks
Differential Revision: https://reviews.freebsd.org/D8175

4 years agonctgpio: change default pin names to those used by the datasheet(s)
avg [Mon, 1 Jul 2019 15:43:48 +0000 (15:43 +0000)]
nctgpio: change default pin names to those used by the datasheet(s)

That is, instead of the current GPIO00 - GPIO15 the names will be GPIO00
- GPIO07, GPIO10 - GPIO17.  The first digit is a GPIO "bank" / group
number and the second one is a pin number within the bank.  Alternative
view is that the pin names are changed from decimal numbering scheme to
octal one (as there are 8 pins per bank).

Discussed with: cem, gonzo
MFC after: 2 weeks

4 years agoAdd support for the Marvell 88E6190 11 ports switch.
loos [Mon, 1 Jul 2019 13:41:37 +0000 (13:41 +0000)]
Add support for the Marvell 88E6190 11 ports switch.

With more ports, some of the registers are shifted a bit to accommodate.

This switch also adds two high speed Serdes/SGMII interfaces (2.5 Gb/s).

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoAllow bootstrapping elftoolchain on MacOS and Linux
arichardson [Mon, 1 Jul 2019 11:52:54 +0000 (11:52 +0000)]
Allow bootstrapping elftoolchain on MacOS and Linux

This is required in order to build on non-FreeBSD systems without setting
all the XAR/XSTRINGS/etc. variables

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D16771

4 years agoFix generation of krb5-config with LC_CTYPE=*.UTF-8
arichardson [Mon, 1 Jul 2019 11:47:45 +0000 (11:47 +0000)]
Fix generation of krb5-config with LC_CTYPE=*.UTF-8

When building on MacOS with a UTF-8 locale sed will fail when reading
krb-config.in due to invalid characters. Forcing the "C" locale fixes this.

Reviewed By: emaste, cy
Differential Revision: https://reviews.freebsd.org/D16849

4 years agoupgrade the warning printf-s in bus accessors to KASSERT-s, take 2
avg [Mon, 1 Jul 2019 06:22:41 +0000 (06:22 +0000)]
upgrade the warning printf-s in bus accessors to KASSERT-s, take 2

After this change sys/bus.h includes sys/systm.h when _KERNEL is
defined.
This brings back r349459 but with systm.h hidden from userland.

MFC after: 2 weeks

4 years agoThe RFC 3128 test should be made after the offset mask has been applied.
cy [Sun, 30 Jun 2019 22:32:33 +0000 (22:32 +0000)]
The RFC 3128 test should be made after the offset mask has been applied.

Reported by: christos@NetBSD.org
X-MFC with: r349399

4 years agoRevert r349400. It has uintended effects.
cy [Sun, 30 Jun 2019 22:27:58 +0000 (22:27 +0000)]
Revert r349400. It has uintended effects.

Reported by: christos@NetBSD.org
X-MFC with: r349400.

4 years agoefihttp: mark unused arguments with __unused
tsoome [Sun, 30 Jun 2019 20:21:27 +0000 (20:21 +0000)]
efihttp: mark unused arguments with __unused

we do have __unused, lets use it.

4 years agoefihttp: comparison of integers of different signs
tsoome [Sun, 30 Jun 2019 20:18:31 +0000 (20:18 +0000)]
efihttp: comparison of integers of different signs

message.HeaderCount is UINTN (unsigned int), so should be i.

4 years agoClean efihttp pointer-sign warnings
tsoome [Sun, 30 Jun 2019 20:15:02 +0000 (20:15 +0000)]
Clean efihttp pointer-sign warnings

The Http protocol structure is using unsigned char strings, Use type casts
where needed.

4 years agoreadelf: Add RISC-V DWARF register aliases
mhorne [Sun, 30 Jun 2019 19:47:15 +0000 (19:47 +0000)]
readelf: Add RISC-V DWARF register aliases

This allows DWARF debugging output to use the common register
mneumonics, such as ra, sp, or t0.

DWARF registers 0-31 are mapped to the 32 general purpose registers,
which are then followed by the 32 floating point registers.

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20779

4 years agoelftoolchain: fix an incorrect e_flags description
mhorne [Sun, 30 Jun 2019 19:43:13 +0000 (19:43 +0000)]
elftoolchain: fix an incorrect e_flags description

r349482 introduced the definitions and descriptions of the RISC-V
specific e_flags values to elftoolchain. However, the description for
the EF_RISCV_RVE flag was incorrectly duplicated from EF_RISCV_RVC. Fix
this by providing the proper description for this flag.

Reported by: jhb
Approved by: markj (mentor)

4 years agoFix CROSS_TOOLCHAIN=amd64-gcc build after r349554
arichardson [Sun, 30 Jun 2019 17:03:14 +0000 (17:03 +0000)]
Fix CROSS_TOOLCHAIN=amd64-gcc build after r349554

Apparently clang can remove the reference to __umoddi3 but GCC keeps it.

Reported by: lwhsu

4 years agoChanges to the expose_password functionality:
des [Sun, 30 Jun 2019 14:46:15 +0000 (14:46 +0000)]
Changes to the expose_password functionality:

 - Implement use_first_pass, allowing expose_password to be used by other
   service functions than pam_auth() without prompting a second time.

 - Don't prompt for a password during pam_setcred().

PR: 238041
MFC after: 3 weeks

4 years agoFix my name in license header
arichardson [Sun, 30 Jun 2019 14:04:30 +0000 (14:04 +0000)]
Fix my name in license header

Reported by: trasz

4 years agoReduce size of rtld by 22% by pulling in less code from libc
arichardson [Sun, 30 Jun 2019 11:49:58 +0000 (11:49 +0000)]
Reduce size of rtld by 22% by pulling in less code from libc

Currently RTLD is linked against libc_nossp_pic which means that any libc
symbol used in rtld can pull in a lot of depedencies. This was causing
symbol such as __libc_interposing and all the pthread stubs to be included
in RTLD even though they are not required. It turns out most of these
dependencies can easily be avoided by providing overrides inside of rtld.

This change is motivated by CHERI, where we have an experimental ABI that
requires additional relocation processing to allow the use of function
pointers inside of rtld. Instead of adding this self-relocation code to
RTLD I attempted to remove most function pointers from RTLD and discovered
that most of them came from the libc dependencies instead of being actually
used inside rtld.

A nice side-effect of this change is that rtld is now 22% smaller on amd64.

   text    data     bss     dec     hex filename
0x21eb6   0xce0   0xe60  145910   239f6 /home/alr48/ld-elf-x86.before.so.1
0x1a6ed   0x728   0xdd8  113645   1bbed /home/alr48/ld-elf-x86.after.so.1

The number of R_X86_64_RELATIVE relocations that need to be processed on
startup has also gone down from 368 to 187 (almost 50% less).

Reviewed By: kib
Differential Revision: https://reviews.freebsd.org/D20663

4 years agoDisplay the approximate space needed when a minidump fails due to lack
np [Sun, 30 Jun 2019 03:14:04 +0000 (03:14 +0000)]
Display the approximate space needed when a minidump fails due to lack
of space.

Reviewed by: kib@
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20801

4 years agoAdd support for Python 3 and make it the default.
marcel [Sun, 30 Jun 2019 02:29:12 +0000 (02:29 +0000)]
Add support for Python 3 and make it the default.

Python 2.7 will retire on Januari 1, 2020.

4 years agoRemove a call to vm_map_simplify_entry from _vm_map_clip_start.
dougm [Sun, 30 Jun 2019 02:08:13 +0000 (02:08 +0000)]
Remove a call to vm_map_simplify_entry from _vm_map_clip_start.
Recent changes to vm_map_protect have made it unnecessary.

Reviewed by: alc
Approved by: kib (mentor)
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D20633

4 years agoMFV r349535: less v551.
delphij [Sat, 29 Jun 2019 18:41:40 +0000 (18:41 +0000)]
MFV r349535: less v551.

MFC after: 2 weeks
Relnotes: yes

4 years agoBuild lib32 libl. The library is built from usr.bin/lex/lib. It would be
tijl [Sat, 29 Jun 2019 17:01:56 +0000 (17:01 +0000)]
Build lib32 libl.  The library is built from usr.bin/lex/lib.  It would be
better to move this directory to lib/libl, but this requires more extensive
changes to Makefile.inc1.  This simple fix can be MFCed quickly.

PR: 238874
Reviewed by: imp
MFC after: 3 days

4 years agoUse a consistent snapshot of the fd's rights in fget_mmap().
markj [Sat, 29 Jun 2019 16:11:09 +0000 (16:11 +0000)]
Use a consistent snapshot of the fd's rights in fget_mmap().

fget_mmap() translates rights on the descriptor to a VM protection
mask.  It was doing so without holding any locks on the descriptor
table, so a writer could simultaneously be modifying those rights.
Such a situation would be detected using a sequence counter, but
not before an inconsistency could trigger assertion failures in
the capability code.

Fix the problem by copying the fd's rights to a structure on the stack,
and perform the translation only once we know that that snapshot is
consistent.

Reported by: syzbot+ae359438769fda1840f8@syzkaller.appspotmail.com
Reviewed by: brooks, mjg
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20800

4 years agoFix mutual exclusion in pipe_direct_write().
markj [Sat, 29 Jun 2019 16:05:52 +0000 (16:05 +0000)]
Fix mutual exclusion in pipe_direct_write().

We use PIPE_DIRECTW as a semaphore for direct writes to a pipe, where
the reader copies data directly from pages mapped into the writer.
However, when a reader finishes such a copy, it previously cleared
PIPE_DIRECTW, allowing multiple writers to race and corrupt the state
used to track wired pages belonging to the writer.

Fix this by having the writer clear PIPE_DIRECTW and instead use the
count of unread bytes to determine whether a write is finished.

Reported by: syzbot+21811cc0a89b2a87a9e7@syzkaller.appspotmail.com
Reviewed by: kib, mjg
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20784

4 years agoFix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OK
lwhsu [Sat, 29 Jun 2019 14:55:53 +0000 (14:55 +0000)]
Fix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OK

Submitted by: Ka Ho Ng <khng300 at gmail.com>
Reviewed by: mckusick
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20695

4 years agoSkip sys.netpfil.pf.names.names and sys.netpfil.pf.synproxy.synproxy
lwhsu [Sat, 29 Jun 2019 12:19:57 +0000 (12:19 +0000)]
Skip sys.netpfil.pf.names.names and sys.netpfil.pf.synproxy.synproxy
temporarily because kernel panics when flushing epair queue.

PR: 238870
Sponsored by: The FreeBSD Foundation

4 years agoInstall missing test data file
lwhsu [Sat, 29 Jun 2019 10:58:31 +0000 (10:58 +0000)]
Install missing test data file

MFC with: r349527
Sponsored by: The FreeBSD Foundation

4 years agoAdd support for IFCAP_NOMAP to mlx5(4).
jhb [Sat, 29 Jun 2019 00:53:07 +0000 (00:53 +0000)]
Add support for IFCAP_NOMAP to mlx5(4).

Since mlx5 uses bus_dma, this only required adding the capability
flag.

Submitted by: gallatin
Reviewed by: gallatin, hselasky, rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20616

4 years agoAdd support for IFCAP_NOMAP to cxgbe(4).
jhb [Sat, 29 Jun 2019 00:52:21 +0000 (00:52 +0000)]
Add support for IFCAP_NOMAP to cxgbe(4).

Since cxgbe(4) uses sglist instead of bus_dma, this required updates
to the code that generates scatter/gather lists for packets.  Also,
unmapped mbufs are always sent via DMA and never as immediate data in
the payload of a work request.

Submitted by: gallatin (earlier version)
Reviewed by: gallatin, hselasky, rrs
Discussed with: np
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20616

4 years agoSupport IFCAP_NOMAP in vlan(4).
jhb [Sat, 29 Jun 2019 00:51:38 +0000 (00:51 +0000)]
Support IFCAP_NOMAP in vlan(4).

Enable IFCAP_NOMAP for a vlan interface if it is supported by the
underlying trunk device.

Reviewed by: gallatin, hselasky, rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20616

4 years agoCompress pending socket buffer data once it is marked ready.
jhb [Sat, 29 Jun 2019 00:50:25 +0000 (00:50 +0000)]
Compress pending socket buffer data once it is marked ready.

Apply similar logic from sbcompress to pending data in the socket
buffer once it is marked ready via sbready.  Normally sbcompress
merges small mbufs to reduce the length of mbuf chains in the socket
buffer.  However, sbcompress cannot do this for mbufs marked
M_NOTREADY.  sbcompress_ready is now called from sbready when mbufs
are marked ready to merge small mbuf chains once the data is available
to copy.

Submitted by: gallatin (earlier version)
Reviewed by: gallatin, hselasky, rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20616

4 years agoAdd support for using unmapped mbufs with sendfile(2).
jhb [Sat, 29 Jun 2019 00:49:35 +0000 (00:49 +0000)]
Add support for using unmapped mbufs with sendfile(2).

This can be enabled at runtime via the kern.ipc.mb_use_ext_pgs sysctl.
It is disabled by default.

Submitted by: gallatin (earlier version)
Reviewed by: gallatin, hselasky, rrs
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20616

4 years agoAdd an external mbuf buffer type that holds multiple unmapped pages.
jhb [Sat, 29 Jun 2019 00:48:33 +0000 (00:48 +0000)]
Add an external mbuf buffer type that holds multiple unmapped pages.

Unmapped mbufs allow sendfile to carry multiple pages of data in a
single mbuf, without mapping those pages.  It is a requirement for
Netflix's in-kernel TLS, and provides a 5-10% CPU savings on heavy web
serving workloads when used by sendfile, due to effectively
compressing socket buffers by an order of magnitude, and hence
reducing cache misses.

For this new external mbuf buffer type (EXT_PGS), the ext_buf pointer
now points to a struct mbuf_ext_pgs structure instead of a data
buffer.  This structure contains an array of physical addresses (this
reduces cache misses compared to an earlier version that stored an
array of vm_page_t pointers).  It also stores additional fields needed
for in-kernel TLS such as the TLS header and trailer data that are
currently unused.  To more easily detect these mbufs, the M_NOMAP flag
is set in m_flags in addition to M_EXT.

Various functions like m_copydata() have been updated to safely access
packet contents (using uiomove_fromphys()), to make things like BPF
safe.

NIC drivers advertise support for unmapped mbufs on transmit via a new
IFCAP_NOMAP capability.  This capability can be toggled via the new
'nomap' and '-nomap' ifconfig(8) commands.  For NIC drivers that only
transmit packet contents via DMA and use bus_dma, adding the
capability to if_capabilities and if_capenable should be all that is
required.

If a NIC does not support unmapped mbufs, they are converted to a
chain of mapped mbufs (using sf_bufs to provide the mapping) in
ip_output or ip6_output.  If an unmapped mbuf requires software
checksums, it is also converted to a chain of mapped mbufs before
computing the checksum.

Submitted by: gallatin (earlier version)
Reviewed by: gallatin, hselasky, rrs
Discussed with: ae, kp (firewalls)
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20616

4 years agoMFV r349454:
mm [Fri, 28 Jun 2019 22:41:17 +0000 (22:41 +0000)]
MFV r349454:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary
            (OSS-Fuzz 15431)
  PR #1218: Fixes to sparse file handling

MFC after: 1 week

4 years agoWhen we protect PTEs (as opposed to PDEs), we only call vm_page_dirty()
alc [Fri, 28 Jun 2019 22:40:34 +0000 (22:40 +0000)]
When we protect PTEs (as opposed to PDEs), we only call vm_page_dirty()
when, in fact, we are write protecting the page and the PTE has PG_M set.
However, pmap_protect_pde() was always calling vm_page_dirty() when the PDE
has PG_M set.  So, adding PG_NX to a writeable PDE could result in
unnecessary (but harmless) calls to vm_page_dirty().

Simplify the loop calling vm_page_dirty() in pmap_protect_pde().

Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20793

4 years agoNeed to apply the PCIM_BAR_MEM_BASE mask to the physical memory
hselasky [Fri, 28 Jun 2019 22:28:51 +0000 (22:28 +0000)]
Need to apply the PCIM_BAR_MEM_BASE mask to the physical memory
address before returning it to the user. Some of the least significant
bits have special meaning and should be masked away.

Discussed with: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoAdd the 802.1q support for the Marvell e6000 series of ethernet switches.
loos [Fri, 28 Jun 2019 22:19:50 +0000 (22:19 +0000)]
Add the 802.1q support for the Marvell e6000 series of ethernet switches.

Tested on: espressobin, Clearfog, SG-3100 and others
Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoAdd the 'drop tagged' flag support for ethernet switch ports.
loos [Fri, 28 Jun 2019 22:12:43 +0000 (22:12 +0000)]
Add the 'drop tagged' flag support for ethernet switch ports.

This is intended to drop all 802.1q tagged packets on a port.

Sponsored by:  Rubicon Communications, LLC (Netgate)

4 years agoStyle.
kib [Fri, 28 Jun 2019 20:40:54 +0000 (20:40 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agocxgbe/t4_tom: Tweaks to some of the AIO related CTRs.
np [Fri, 28 Jun 2019 19:57:42 +0000 (19:57 +0000)]
cxgbe/t4_tom: Tweaks to some of the AIO related CTRs.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoSync mbuf flags, types, and external buffer types with <sys/mbuf.h>.
jhb [Fri, 28 Jun 2019 19:49:47 +0000 (19:49 +0000)]
Sync mbuf flags, types, and external buffer types with <sys/mbuf.h>.

Sponsored by: Netflix

4 years agoUse a tab after #define for EXT_* constants.
jhb [Fri, 28 Jun 2019 19:37:48 +0000 (19:37 +0000)]
Use a tab after #define for EXT_* constants.

This matches other #define's in this manpage as well as <sys/mbuf.h>.

Sponsored by: Netflix

4 years agocxgbe/t4_tom: the AIO tx job queue must be empty by the time the driver
np [Fri, 28 Jun 2019 19:27:45 +0000 (19:27 +0000)]
cxgbe/t4_tom: the AIO tx job queue must be empty by the time the driver
releases the offload resources associated with the tid.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20798

4 years agoMention proccontrol(1) -m kpti.
kib [Fri, 28 Jun 2019 18:03:13 +0000 (18:03 +0000)]
Mention proccontrol(1) -m kpti.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoTypo.
kib [Fri, 28 Jun 2019 16:42:44 +0000 (16:42 +0000)]
Typo.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years ago[PowerPC64] readelf: print description for 'e_flags' in ELF header (ABI type)
luporl [Fri, 28 Jun 2019 16:00:55 +0000 (16:00 +0000)]
[PowerPC64] readelf: print description for 'e_flags' in ELF header (ABI type)

This prints out description text with the meaning of 'Flags' value in PowerPC64.

Example:

$ readelf -h ~/tmp/t1-Flag2
ELF Header:

Magic:   7f 45 4c 46 02 02 01 09 00 00 00 00 00 00 00 00
Class:                             ELF64
Data:                              2's complement, big endian
Version:                           1 (current)
OS/ABI:                            FreeBSD
ABI Version:                       0
Type:                              EXEC (Executable file)
Machine:                           PowerPC 64-bit
Version:                           0x1
Entry point address:               0x10010000
Start of program headers:          64 (bytes into file)
Start of section headers:          209368 (bytes into file)
Flags:                             0x2, OpenPOWER ELF V2 ABI
Size of this header:               64 (bytes)
Size of program headers:           56 (bytes)
Number of program headers:         10
Size of section headers:           64 (bytes)
Number of section headers:         34
Section header string table index: 31

Submitted by:  alfredo.junior_eldorado.org.br
Reviewed by: luporl
Differential Revision: https://reviews.freebsd.org/D20782

4 years ago[PowerPC64] Add ABI flags to 'file' magic
luporl [Fri, 28 Jun 2019 15:52:40 +0000 (15:52 +0000)]
[PowerPC64] Add ABI flags to 'file' magic

The distinction between ELF header version and OpenPOWER ELF ABI version is
confusing for most of people, so this adds text to "file" output to make it
clear about which OpenPOWER ELF ABI version binary was built for.

The strings used in this change are based on "64-Bit ELF V2 ABI
Specification/3.1. ELF Header" document available at
http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655241_97607.html

Example:

$ file t1-Flag2 -m -m contrib/file/magic/Magdir/elf t1-Flag2: ELF 64-bit MSB
executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1
(FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD
13.0 (1300033), FreeBSD-style, not stripped

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: luporl
Differential Revision: https://reviews.freebsd.org/D20771

4 years agoFix missing powerpc64 in _LLVM_TARGET_FILT
luporl [Fri, 28 Jun 2019 15:49:14 +0000 (15:49 +0000)]
Fix missing powerpc64 in _LLVM_TARGET_FILT

This change was originally in D20378. Making it in a new diff since it's a
bugfix.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: emaste, luporl
Differential Revision: https://reviews.freebsd.org/D20756

4 years agoNeed to wait for epoch callbacks to complete before detaching a
hselasky [Fri, 28 Jun 2019 10:49:04 +0000 (10:49 +0000)]
Need to wait for epoch callbacks to complete before detaching a
network interface.

This particularly manifests itself when an INP has multicast options
attached during a network interface detach. Then the IPv4 and IPv6
leave group call which results from freeing the multicast address, may
access a freed ifnet structure. These are the steps to reproduce:

service mdnsd onestart # installed from ports

ifconfig epair create
ifconfig epair0a 0/24 up
ifconfig epair0a destroy

Tested by: pho @
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement API for draining EPOCH(9) callbacks.
hselasky [Fri, 28 Jun 2019 10:38:56 +0000 (10:38 +0000)]
Implement API for draining EPOCH(9) callbacks.

The epoch_drain_callbacks() function is used to drain all pending
callbacks which have been invoked by prior epoch_call() function calls
on the same epoch. This function is useful when there are shared
memory structure(s) referred to by the epoch callback(s) which are not
refcounted and are rarely freed. The typical place for calling this
function is right before freeing or invalidating the shared
resource(s) used by the epoch callback(s). This function can sleep and
is not optimized for performance.

Differential Revision: https://reviews.freebsd.org/D20109
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUpgrade to Bzip2 version 1.0.7.
delphij [Fri, 28 Jun 2019 05:11:02 +0000 (05:11 +0000)]
Upgrade to Bzip2 version 1.0.7.

MFC after: 3 days

4 years agoFix a typo.
cy [Fri, 28 Jun 2019 04:52:24 +0000 (04:52 +0000)]
Fix a typo.

PR: 238816
MFC after: 1 week
X-MFC with: r349503

4 years agoDocument the -B, binary logfile, and the -C config file options.
cy [Fri, 28 Jun 2019 04:28:32 +0000 (04:28 +0000)]
Document the -B, binary logfile, and the -C config file options.
Reference the ipmon.5 man page and ipmon.conf.

PR: 238816
MFC after: 1 week

4 years agocxgbe/t4_tom: Mark the socket's receive as done before calling
np [Fri, 28 Jun 2019 04:02:56 +0000 (04:02 +0000)]
cxgbe/t4_tom: Mark the socket's receive as done before calling
handle_ddp_close.

This eliminates a bad race where an aio_ddp_requeue that happened to run
after handle_ddp_close could bump up the active count.

Discussed with: jhb@
MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agocxgbe/t4_tom: Fix regression in t_maxseg usage within t4_tom.
np [Fri, 28 Jun 2019 02:41:17 +0000 (02:41 +0000)]
cxgbe/t4_tom: Fix regression in t_maxseg usage within t4_tom.

t_maxseg was changed in r293284 to not have any adjustment for TCP
timestamps.  t4_tom inadvertently went back to pre-r293284 semantics
in r332506.

Sponsored by: Chelsio Communications

4 years agocxgbe/iw_cxgbe: Remove unused field from the endpoint structure.
np [Fri, 28 Jun 2019 02:21:42 +0000 (02:21 +0000)]
cxgbe/iw_cxgbe: Remove unused field from the endpoint structure.

MFC after: 3 days

4 years agoIf vm_map_protect fails with KERN_RESOURCE_SHORTAGE, be sure to
dougm [Fri, 28 Jun 2019 02:14:54 +0000 (02:14 +0000)]
If vm_map_protect fails with KERN_RESOURCE_SHORTAGE, be sure to
simplify modified entries before returning.

Reviewed by: alc, markj (earlier version), kib (earlier version)
Approved by: kib, markj (mentors, implicit)
Differential Revision: https://reviews.freebsd.org/D20753

4 years agoAdd ACPI entries for Synopsys Designware UARTs used on ARM platforms
bcran [Fri, 28 Jun 2019 01:19:08 +0000 (01:19 +0000)]
Add ACPI entries for Synopsys Designware UARTs used on ARM platforms

This fixes (userspace) console on the Marvell MACCHIATObin in ACPI mode with
latest TianoCore EDK2 firmware.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: mw, bcran
Differential Revision: https://reviews.freebsd.org/D20765

4 years agoAdd missing ACPI GICv2 MSI/MSI-X attachment
bcran [Fri, 28 Jun 2019 01:17:33 +0000 (01:17 +0000)]
Add missing ACPI GICv2 MSI/MSI-X attachment

This lets PCIe MSI-X device interrupts work on the MACCHIATObin
(Marvell Armada 8k), which allows e.g. the Intel igb NIC to fully work.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: mw, bcran
Differential Revision: https://reviews.freebsd.org/D20775

4 years agolibelftc: add RISC-V bfd targets
mhorne [Fri, 28 Jun 2019 00:14:12 +0000 (00:14 +0000)]
libelftc: add RISC-V bfd targets

This adds the following targets: elf32-riscv, elf64-riscv, elf64-riscv-freebsd

Reviewed by: emaste, markj, jkoshy@users.sourceforge.net
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20768

4 years agoreadelf: Add support for RISC-V specific e_flags
mhorne [Fri, 28 Jun 2019 00:10:26 +0000 (00:10 +0000)]
readelf: Add support for RISC-V specific e_flags

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20767

4 years agoAdd some missing RISC-V ELF defines
mhorne [Fri, 28 Jun 2019 00:03:29 +0000 (00:03 +0000)]
Add some missing RISC-V ELF defines

This adds defines for the RISC-V specific e_flags values, and some of
the missing static relocations.

Reviewed by: markj
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D20766

4 years agoFIOBMAP2: inline vn_ioc_bmap2
asomers [Thu, 27 Jun 2019 23:39:06 +0000 (23:39 +0000)]
FIOBMAP2: inline vn_ioc_bmap2

Reported by: kib
Reviewed by: kib
MFC after: 2 weeks
MFC-With: 349238
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20783

4 years ago[skip ci] VOP_BMAP.9: fix diction in copyright header
asomers [Thu, 27 Jun 2019 23:37:09 +0000 (23:37 +0000)]
[skip ci] VOP_BMAP.9: fix diction in copyright header

MFC after: 2 weeks
MFC-With: r349230
Sponsored by: The FreeBSD Foundation

4 years agoAdd non-blocking trylock variants for the rangelock functions.
rmacklem [Thu, 27 Jun 2019 23:10:40 +0000 (23:10 +0000)]
Add non-blocking trylock variants for the rangelock functions.

A future patch that will add a Linux compatible copy_file_range(2) syscall
needs to be able to lock the byte ranges of two files concurrently.
To do this without a risk of deadlock, a non-blocking variant of
vn_rangelock_rlock() called vn_rangelock_tryrlock() was needed.
This patch adds this, along with vn_rangelock_trywlock(), in order to
do this.
The patch also adds a couple of comments, that I hope clarify how the
algorithm used in kern_rangelock.c works.

Reviewed by: kib, asomers (previous version)
Differential Revision: https://reviews.freebsd.org/D20645

4 years agoFix comment in sofree() to reference sbdestroy().
jhb [Thu, 27 Jun 2019 22:50:11 +0000 (22:50 +0000)]
Fix comment in sofree() to reference sbdestroy().

r160875 added sbdestroy() as a wrapper around sbrelease_internal to be
called from sofree(), yet the comment added in the same revision to
sofree() still mentions sbrelease_internal().

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20488

4 years agoReject attempts to register a TCP stack being unloaded.
jhb [Thu, 27 Jun 2019 22:34:05 +0000 (22:34 +0000)]
Reject attempts to register a TCP stack being unloaded.

Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20617