]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agopkgbase: Add the possibility to choose the output dir
manu [Thu, 6 Aug 2020 16:14:43 +0000 (16:14 +0000)]
pkgbase: Add the possibility to choose the output dir

The output dir is set to ${REPODIR}/${PKG_ABI}/${PKG_VERSION} now.
Add the possibility to specify the last componant and set it by default
to ${PKG_VERSION} as before.
This is useful for tests and also for building packages with the same
PKG_VERSION provided to check differences.

3 years agopkgbase: Add a new variable PKG_TIMESTAMP
manu [Thu, 6 Aug 2020 16:13:54 +0000 (16:13 +0000)]
pkgbase: Add a new variable PKG_TIMESTAMP

libarchive uses the SOURCE_DATE_EPOCH env variable to set the date of file
in an archive, this is useful for reproducibility.
Add a variable name PKG_TIMESTAMP that take a epoch time and set SOURCE_DATE_EPOCH
to this. By default it is the current time so no changes here.

3 years agopkgbase: Remove vcs revision from kernel and runtime comment
manu [Thu, 6 Aug 2020 16:11:30 +0000 (16:11 +0000)]
pkgbase: Remove vcs revision from kernel and runtime comment

This is not needed and we don't do that for other packages.

3 years agoClean up reassignbuf() and buf_vlist_remove() a bit.
markj [Thu, 6 Aug 2020 15:43:15 +0000 (15:43 +0000)]
Clean up reassignbuf() and buf_vlist_remove() a bit.

- Convert panic() calls to INVARIANTS-only assertions.  The PCTRIE code
  provides some of the same protection since it will panic upon an
  attempt to remove a non-resident buffer.
- Update the comment above reassignbuf() to reflect reality.

Reviewed by: cem, kib, mjg
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25965

3 years agoRemove the vfs.reassignbufcalls counter and sysctl.
markj [Thu, 6 Aug 2020 15:42:59 +0000 (15:42 +0000)]
Remove the vfs.reassignbufcalls counter and sysctl.

As the 20-year old comment above it suggests, the counter is of dubious
value.  Moreover, the (global) counter was not updated precisely and
hurts scalability.

Reviewed by: cem, kib, mjg
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25965

3 years agoAdd Intel Apollo Lake AHCI ID.
mav [Thu, 6 Aug 2020 15:17:44 +0000 (15:17 +0000)]
Add Intel Apollo Lake AHCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

3 years agocp2112: driver for the namesake GPIO and I2C master gadget
avg [Thu, 6 Aug 2020 13:41:42 +0000 (13:41 +0000)]
cp2112: driver for the namesake GPIO and I2C master gadget

Documentation:
- CP2112 Datasheet
  https://www.silabs.com/documents/public/data-sheets/cp2112-datasheet.pdf
- AN495: CP2112 Interface Specification
  https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf
- CP2112 Errata
  https://www.silabs.com/documents/public/errata/cp2112-errata.pdf

The logic is implemented as three sub-drivers.
The parent driver claims the USB device and creates two child devices.
One acts as a GPIO controller and the other is an I2C controller.

Tested with CP2112 revision F02.
Both features seem to work.
HTU21 sensor was used as an I2C slave.

Reviewed by: adrian, hselasky
MFC after: 2 weeks
Relnotes: maybe
Differential Revision: https://reviews.freebsd.org/D25359

3 years agoAdd new USB ID.
hselasky [Thu, 6 Aug 2020 13:25:04 +0000 (13:25 +0000)]
Add new USB ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoMove dmar_domain_unload_task to busdma_iommu.c.
br [Thu, 6 Aug 2020 12:49:25 +0000 (12:49 +0000)]
Move dmar_domain_unload_task to busdma_iommu.c.

Reviewed by: kib
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D25972

3 years agoccu_sun8i_r: minor comment update
avg [Thu, 6 Aug 2020 11:18:06 +0000 (11:18 +0000)]
ccu_sun8i_r: minor comment update

MFC after: 1 week

3 years agoAdd iommu_domain constructor and destructor.
br [Thu, 6 Aug 2020 08:48:23 +0000 (08:48 +0000)]
Add iommu_domain constructor and destructor.

Reviewed by: kib
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D25956

3 years agommccam: Unhold the periph when we add the device
manu [Thu, 6 Aug 2020 08:21:33 +0000 (08:21 +0000)]
mmccam: Unhold the periph when we add the device

Otherwise the device node aren't created.

Pointy hat to:      manu
Reported by: bz

3 years agocache: add more predicts for failing conditions
mjg [Thu, 6 Aug 2020 04:20:14 +0000 (04:20 +0000)]
cache: add more predicts for failing conditions

3 years agocache: plug unititalized variable use
mjg [Thu, 6 Aug 2020 04:19:47 +0000 (04:19 +0000)]
cache: plug unititalized variable use

CID: 1431128

3 years agomac: even up all entry points to the same scheme
mjg [Thu, 6 Aug 2020 00:23:06 +0000 (00:23 +0000)]
mac: even up all entry points to the same scheme

- use a macro for checking whether the site is enabled
- expand it to 0 if mac is not compiled in to begin with

3 years agoarm64: fix uintfptr_t
mjg [Wed, 5 Aug 2020 22:09:57 +0000 (22:09 +0000)]
arm64: fix uintfptr_t

Fixes compilation after r363932

3 years agoriscv: fix uintfptr_t
mjg [Wed, 5 Aug 2020 22:09:40 +0000 (22:09 +0000)]
riscv: fix uintfptr_t

Fixes compilation after r363932

3 years agopmcstat: fix build on non-64 bit platforms
mjg [Wed, 5 Aug 2020 20:42:08 +0000 (20:42 +0000)]
pmcstat: fix build on non-64 bit platforms

3 years agovfs hash: annotate the lock with __exclusive_cache_line
mjg [Wed, 5 Aug 2020 19:34:13 +0000 (19:34 +0000)]
vfs hash: annotate the lock with __exclusive_cache_line

Note the code does not scale in the current form.

3 years agopipe: reduce atime precision
mjg [Wed, 5 Aug 2020 19:15:59 +0000 (19:15 +0000)]
pipe: reduce atime precision

The routine is called on successful write and read, which on pipes happens a
lot and for small sizes.

Precision provided by default seems way bigger than necessary and it causes
problems in vms on amd64 (it rdtscp's which vmexits). getnanotime seems to
provide the level roughly in lines of Linux so we should be good here.

Sample result from will-it-scale pipe1_processes -t 1 (ops/s):
before: 426464
after: 3247421

Note the that atime handling for named pipes is broken with and without the
patch. The filesystem code is never used for updating atime and never looks
at the updated field. Consequently, while there are no provisions added to
handle named pipes separately, the change is a nop for that case.

Differential Revision:  https://reviews.freebsd.org/D23964

3 years agoo Add machine/iommu.h and include MD iommu headers from it,
br [Wed, 5 Aug 2020 19:11:31 +0000 (19:11 +0000)]
o Add machine/iommu.h and include MD iommu headers from it,
  so we don't ifdef for every arch in busdma_iommu.c;
o No need to include specialreg.h for x86, remove it.

Requested by: andrew
Reviewed by: kib
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D25957

3 years agopmcstat: implement showing offsets into symbols in top mode
mjg [Wed, 5 Aug 2020 19:05:49 +0000 (19:05 +0000)]
pmcstat: implement showing offsets into symbols in top mode

The -I option (and hotkey) is reused for this. Skipping symbol resolution is
moved to the new -A option (and hotkey).

While arguably this violates POLA I think it's a change for the better.
ALso note the -I option was added in head.

Differential Revision: https://reviews.freebsd.org/D21658

3 years agoAdd clocks for ethernet controllers on RK3328
gonzo [Wed, 5 Aug 2020 18:22:24 +0000 (18:22 +0000)]
Add clocks for ethernet controllers on RK3328

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D25918

3 years agoAdd flag for SYSCON-controlled clocks on Rockhip platform
gonzo [Wed, 5 Aug 2020 18:21:22 +0000 (18:21 +0000)]
Add flag for SYSCON-controlled clocks on Rockhip platform

Ethernet clocks on RK3328 are controlled by SYSCON registers, so add
RK_CLK_COMPOSITE_GRF flag to indicate that clock node should access grf
registers instead of CRU's

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D25918

3 years agoFix the smrstress build after r358400.
markj [Wed, 5 Aug 2020 17:26:20 +0000 (17:26 +0000)]
Fix the smrstress build after r358400.

Reported by: pho

3 years agoFix a TOCTOU vulnerability in freebsd32_copyin_control().
markj [Wed, 5 Aug 2020 17:06:14 +0000 (17:06 +0000)]
Fix a TOCTOU vulnerability in freebsd32_copyin_control().

PR: 248257
Reported by: m00nbsd working with Trend Micro Zero Day Initiative
Reviewed by: kib
Security: SA-20:23.sendmsg
Security: CVE-2020-7460
Security: ZDI-CAN-11543

3 years agoContinued ipfilter #ifdef cleanup. The r343701 log entry contains a
cy [Wed, 5 Aug 2020 15:33:32 +0000 (15:33 +0000)]
Continued ipfilter #ifdef cleanup. The r343701 log entry contains a
complete description.

MFC after: 1 week

3 years agoUpgrade to version 3.1.5
se [Wed, 5 Aug 2020 15:20:07 +0000 (15:20 +0000)]
Upgrade to version 3.1.5

This version fixes some entries in the chinese message catalogs which could
lead to program crashes when used.

3 years agoMFOpenZFS: Add support for boot environment data to be stored in the label
tsoome [Wed, 5 Aug 2020 14:32:20 +0000 (14:32 +0000)]
MFOpenZFS: Add support for boot environment data to be stored in the label

We are building new bootonce mechanism (previously zfs bootnext) and it is
based on this OpenZFS change. Since this patch is nicely self contained,
I am commiting it as is, and we can stack our changes.

Original patch description follows:

Modern bootloaders leverage data stored in the root filesystem to
enable some of their powerful features. GRUB specifically has a grubenv
file which can store large amounts of configuration data that can be
read and written at boot time and during normal operation. This allows
sysadmins to configure useful features like automated failover after
failed boot attempts. Unfortunately, due to the Copy-on-Write nature
of ZFS, the standard behavior of these tools cannot handle writing to
ZFS files safely at boot time. We need an alternative way to store
data that allows the bootloader to make changes to the data.

This work is very similar to work that was done on Illumos to enable
similar functionality in the FreeBSD bootloader. This patch is different
in that the data being stored is a raw grubenv file; this file can store
arbitrary variables and values, and the scripting provided by grub is
powerful enough that special structures are not required to implement
advanced behavior.

We repurpose the second padding area in each label to store the grubenv
file, protected by an embedded checksum. We add two ioctls to get and
set this data, and libzfs_core and libzfs functions to access them more
easily. There are no direct command line interfaces to these functions;
these will be added directly to the bootloader utilities.

Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #10009

Obtained from: OpenZFS
Sponsored by: Netflix, Klara Inc.

3 years agozfs_keys_nextboot array is missing ZPOOL_CONFIG_POOL_GUID and ZPOOL_CONFIG_GUID
tsoome [Wed, 5 Aug 2020 14:08:44 +0000 (14:08 +0000)]
zfs_keys_nextboot array is missing ZPOOL_CONFIG_POOL_GUID and ZPOOL_CONFIG_GUID

As we do check the incomint nvlist, we either need to list all possible
keys or use wildcard.

PR: 248462
Reported by: larafercue@gmail.com
Sponsored by: Netflix, Klara Inc.

3 years agoAdd DDB_CTF to the arm64 and riscv kernel configs
andrew [Wed, 5 Aug 2020 11:54:51 +0000 (11:54 +0000)]
Add DDB_CTF to the arm64 and riscv kernel configs

This allows DTrace fbt probes to find arguments.

Sponsored by: Innovate UK

3 years agoSynchronize definitions in mbuf.d with values from mbuf.h
ae [Wed, 5 Aug 2020 11:54:02 +0000 (11:54 +0000)]
Synchronize definitions in mbuf.d with values from mbuf.h

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

3 years agoenviron(7): Update the description and include some more environment variables
gbe [Wed, 5 Aug 2020 11:41:41 +0000 (11:41 +0000)]
environ(7): Update the description and include some more environment variables

- Add a better introduction to the DESCRIPTION section
- Add a description for MANPATH and POSIXLY_CORRECT
- Asorted improvements for the usage of some macros

PR: 43823
Submitted by: Lyndon Nerenberg <lyndon at orthanc dot ab dot ca>
Reviewed by: 0mp, bcr
Approved by: 0mp, bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25912

3 years agoAdd m__getjcl SDT probe.
ae [Wed, 5 Aug 2020 11:39:09 +0000 (11:39 +0000)]
Add m__getjcl SDT probe.

Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC

3 years agogpiokeys: add a basic manual page
avg [Wed, 5 Aug 2020 11:38:33 +0000 (11:38 +0000)]
gpiokeys: add a basic manual page

Reviewed by: manu, bjk, 0mp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25939

3 years agoFix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted.
ae [Wed, 5 Aug 2020 11:26:49 +0000 (11:26 +0000)]
Fix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted.

Submitted by: Evgeniy Khramtsov <evgeniy at khramtsov org>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25734

3 years agoDo not describe portsnap(8) as a way to manage /usr/ports
0mp [Wed, 5 Aug 2020 11:26:14 +0000 (11:26 +0000)]
Do not describe portsnap(8) as a way to manage /usr/ports

3 years agoFix typo.
ae [Wed, 5 Aug 2020 10:27:11 +0000 (10:27 +0000)]
Fix typo.

Submitted by: Evgeniy Khramtsov <evgeniy at khramtsov org>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25932

3 years agocache: don't ignore size passed to nchinittbl
mjg [Wed, 5 Aug 2020 09:38:02 +0000 (09:38 +0000)]
cache: don't ignore size passed to nchinittbl

3 years agoBump __FreeBSD_version after vaccess() change
mjg [Wed, 5 Aug 2020 09:27:53 +0000 (09:27 +0000)]
Bump __FreeBSD_version after vaccess() change

3 years agovfs: remove the obsolete privused argument from vaccess
mjg [Wed, 5 Aug 2020 09:27:03 +0000 (09:27 +0000)]
vfs: remove the obsolete privused argument from vaccess

This brings argument count down to 6, which is passable without the
stack on amd64.

3 years agocache: convert the hash from LIST to SLIST
mjg [Wed, 5 Aug 2020 09:25:59 +0000 (09:25 +0000)]
cache: convert the hash from LIST to SLIST

This reduces struct namecache by sizeof(void *).

Negative side is that we have to find the previous element (if any) when
removing an entry, but since we normally don't expect collisions it should be
fine.

Note this adds cache_get_hash calls which can be eliminated.

3 years agocache: reduce zone alignment to 8 bytes
mjg [Wed, 5 Aug 2020 09:24:38 +0000 (09:24 +0000)]
cache: reduce zone alignment to 8 bytes

It used to be sizeof of the given struct to accomodate for 32 bit mips
doing 64 bit loads, but the same can be achieved with requireing just
64 bit alignment.

While here reorder struct namecache so that most commonly used fields
are closer.

3 years agocache: convert ncnegnash into a macro
mjg [Wed, 5 Aug 2020 09:24:00 +0000 (09:24 +0000)]
cache: convert ncnegnash into a macro

It is a read-only var with value known at compilation time.

3 years agobsnmptools: make it print protocol errors to stderr instead of stdout
eugen [Wed, 5 Aug 2020 09:19:41 +0000 (09:19 +0000)]
bsnmptools: make it print protocol errors to stderr instead of stdout

Reviewed by: syrinx, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25911

3 years agoHandle delayed checksums if needed in NAT64.
ae [Wed, 5 Aug 2020 09:16:35 +0000 (09:16 +0000)]
Handle delayed checksums if needed in NAT64.

Upper level protocols defer checksums calculation in hope we have
checksums offloading in a network card. CSUM_DELAY_DATA flag is used
to determine that checksum calculation was deferred. And IP output
routine checks for this flag before pass mbuf to lower layer. Forwarded
packets have not this flag.

NAT64 uses checksums adjustment when it translates IP headers.
In most cases NAT64 is used for forwarded packets, but in case when it
handles locally originated packets we need to finish checksum calculation
that was deferred to correctly adjust it.

Add check for presence of CSUM_DELAY_DATA flag and finish checksum
calculation before adjustment.

Reported and tested by: Evgeniy Khramtsov <evgeniy at khramtsov org>
MFC after: 1 week

3 years agoallwinner: clk: Fix nm clock calculation
manu [Wed, 5 Aug 2020 08:31:26 +0000 (08:31 +0000)]
allwinner: clk: Fix nm clock calculation

Use the right factor when finding the best frequency and compare the
absolute value of the result.

Submitted by: kibab
MFC after: 3 days

3 years agovfs: add a cheaper entry for mac_vnode_check_access
mjg [Wed, 5 Aug 2020 07:34:45 +0000 (07:34 +0000)]
vfs: add a cheaper entry for mac_vnode_check_access

3 years agovfs: tidy up namei entry point
mjg [Wed, 5 Aug 2020 07:33:39 +0000 (07:33 +0000)]
vfs: tidy up namei entry point

- predict for string copy errors
- reshuffle inititalistion of vars which are not needed

3 years agocache: cleanup lockless entry point
mjg [Wed, 5 Aug 2020 07:32:26 +0000 (07:32 +0000)]
cache: cleanup lockless entry point

- remove spurious bzero
- assert ni_lcf, it has to be set by namei by this point

3 years agocache: stop messing with cn_lkflags
mjg [Wed, 5 Aug 2020 07:30:57 +0000 (07:30 +0000)]
cache: stop messing with cn_lkflags

See r363882.

3 years agocache: stop messing with cn_flags
mjg [Wed, 5 Aug 2020 07:30:17 +0000 (07:30 +0000)]
cache: stop messing with cn_flags

This removes flag setting/unsetting carried over from regular lookup.
Flags still get for compatibility when falling back.

Note .. and . handling can get partially folded together.

3 years agovfs: prefill nameidata with garbage on debug kernels
mjg [Wed, 5 Aug 2020 07:28:51 +0000 (07:28 +0000)]
vfs: prefill nameidata with garbage on debug kernels

3 years agoAppease gcc's -Wparentheses (and -Werror)
lwhsu [Wed, 5 Aug 2020 05:58:25 +0000 (05:58 +0000)]
Appease gcc's -Wparentheses (and -Werror)

Sponsored by: The FreeBSD Foundation

3 years agoufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set
mjg [Tue, 4 Aug 2020 23:09:15 +0000 (23:09 +0000)]
ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set

This restores the pre-adaptive spinning state for SU which livelocks
otherwise. Note this is a bug in SU.

Reported by: pho

3 years agovfs: support lockless dotdot lookup
mjg [Tue, 4 Aug 2020 23:07:42 +0000 (23:07 +0000)]
vfs: support lockless dotdot lookup

Tested by: pho

3 years agocache: add NCF_WIP flag
mjg [Tue, 4 Aug 2020 23:07:00 +0000 (23:07 +0000)]
cache: add NCF_WIP flag

This allows making half-constructed entries visible to the lockless lookup,
which now can check for either "not yet fully constructed" and "no longer valid"
state.

This will be used for .. lookup.

3 years agocache: add cache_purge_vgone
mjg [Tue, 4 Aug 2020 23:04:29 +0000 (23:04 +0000)]
cache: add cache_purge_vgone

cache_purge locklessly checks whether the vnode at hand has any namecache
entries. This can race with a concurrent purge which managed to remove
the last entry, but may not be done touching the vnode.

Make sure we observe the relevant vnode lock as not taken before proceeding
with vgone.

Paired with the fact that doomed vnodes cannnot receive entries this restores
the invariant that there are no namecache-related writing users past cache_purge
in vgone.

Reported by: pho

3 years agomtx: add mtx_wait_unlocked
mjg [Tue, 4 Aug 2020 23:00:00 +0000 (23:00 +0000)]
mtx: add mtx_wait_unlocked

3 years agoMinor cleanups in mmc_xpt.c
kibab [Tue, 4 Aug 2020 21:58:43 +0000 (21:58 +0000)]
Minor cleanups in mmc_xpt.c

 * Downgrade some CAM debug messages from _INFO to _DEBUG level;
 * Add KASSERT for the case when we suspect incorrect CAM SIM initialization (using cam_sim_alloc() instead of cam_sim_alloc_dev());
 * Use waiting version of xpt_alloc_ccb(), we are not in hurry;
 * With the waiting version we cannot get NULL return, so remove the NULL check;
 * In some csses, the name of mmcprobe_done has been written as mmc_probedone();
 * Send AC_LOST_DEVICE if we, well, lost the device;
 * Misc style(9) fixes.

Reviewed by: manu
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D25843

3 years agomakesyscalls.lua: improve syscall ordering validation
kevans [Tue, 4 Aug 2020 21:49:13 +0000 (21:49 +0000)]
makesyscalls.lua: improve syscall ordering validation

There were two separate issues here:

1.) #if/#else wasn't taken into account at all for maxsyscall figures, but
2.) We didn't validate contiguous syscall numbers anyways...

This kind of inconsistency is bad as we don't currently ensure explicit
indexing of, e.g., the sysent array if one syscall is unimplemented/missing.
This could be fixed and might be more robust, but it's also good to have the
"documentation" that comes from being explicit as to what the missing
syscalls are.

The new version looks much like the awk version; stash off the current
'last highest syscall seen' if we hit an #if, restore to that if we hit an
#else, and make sure that we're explicitly always defining the next syscall.

The logic at the tail end of process_syscall_def that moves maxsyscall has
been 'cleaned up' a little since we're now ensuring that it's monotonically
increasing earlier in the function. At the moment I think it's unlikely we'd
see range-definitions that are not UNIMPL, but there's no reason to
specifically handle that case for bumping maxsyscall there.

This change was provoked by reading the commit message for r363832 and
realizing that this validation hadn't been included in the initial rewrite
to lua.

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

3 years agoSkip sbin/route tests if jail not installed (WITHOUT_JAIL).
olivier [Tue, 4 Aug 2020 21:34:13 +0000 (21:34 +0000)]
Skip sbin/route tests if jail not installed (WITHOUT_JAIL).

Approved by: kp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D25935

3 years agodevinfo: add man page links
vangyzen [Tue, 4 Aug 2020 21:09:36 +0000 (21:09 +0000)]
devinfo: add man page links

Add man page links for all functions in devinfo(3).

Reported by: vim
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

3 years agodevinfo: fix memory leak on error paths
vangyzen [Tue, 4 Aug 2020 21:05:53 +0000 (21:05 +0000)]
devinfo: fix memory leak on error paths

Refactor to create devinfo_free_dev().  Call it to plug a memory leak
on two error paths in devinfo_init_devices().

Reported by: Coverity
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

3 years agoRemove unneeded cast to struct iommu_domain *.
br [Tue, 4 Aug 2020 20:54:12 +0000 (20:54 +0000)]
Remove unneeded cast to struct iommu_domain *.

Sponsored by: DARPA, AFRL

3 years agoAdd a few macroses for conversion between DMAR unit, domain, ctx
br [Tue, 4 Aug 2020 20:51:05 +0000 (20:51 +0000)]
Add a few macroses for conversion between DMAR unit, domain, ctx
and IOMMU unit, domain, ctx.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D25926

3 years agorms: fix typo: bitmamp -> bitmap
mjg [Tue, 4 Aug 2020 20:31:03 +0000 (20:31 +0000)]
rms: fix typo: bitmamp -> bitmap

Reported by: kib

3 years agommccam: Hold the periph during init
manu [Tue, 4 Aug 2020 20:04:00 +0000 (20:04 +0000)]
mmccam: Hold the periph during init

We need to sleep during this routine so acquire the cam hold too.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D25946

3 years agommcam: Use a static length sbuf buffer
manu [Tue, 4 Aug 2020 20:02:23 +0000 (20:02 +0000)]
mmcam: Use a static length sbuf buffer

We cannot sleep during cam proto_announce and sbuf sleeps so use
a static length buffer like nvme(4)

Reviewed by: kibab
Differential Revision: https://reviews.freebsd.org/D25949

3 years agommccam: mmc_xpt: We're only interested about losing the device
manu [Tue, 4 Aug 2020 20:00:21 +0000 (20:00 +0000)]
mmccam: mmc_xpt: We're only interested about losing the device

Remove all the uneeded printfs

Reviewed by: imp, kibab
Differential Revision: https://reviews.freebsd.org/D25948

3 years agocache: factor away failed vexec handling
mjg [Tue, 4 Aug 2020 19:55:26 +0000 (19:55 +0000)]
cache: factor away failed vexec handling

3 years agocache: assorted tidy ups
mjg [Tue, 4 Aug 2020 19:55:00 +0000 (19:55 +0000)]
cache: assorted tidy ups

3 years agocache: factor away lockless dot lookup and add missing stat + sdt probe
mjg [Tue, 4 Aug 2020 19:54:37 +0000 (19:54 +0000)]
cache: factor away lockless dot lookup and add missing stat + sdt probe

3 years agovfs: add vfs_op_thread_enter/exit _crit variants
mjg [Tue, 4 Aug 2020 19:54:10 +0000 (19:54 +0000)]
vfs: add vfs_op_thread_enter/exit _crit variants

and employ them in the namecache. Eliminates all spurious checks for preemption.

3 years agocache: add missing numcache detrement on insertion failure
mjg [Tue, 4 Aug 2020 19:52:52 +0000 (19:52 +0000)]
cache: add missing numcache detrement on insertion failure

3 years agorms: add a comment explaining performance deficiencies of write locking
mjg [Tue, 4 Aug 2020 19:52:16 +0000 (19:52 +0000)]
rms: add a comment explaining performance deficiencies of write locking

3 years agoImport DTS files for arm, arm64, riscv from Linux 5.8
manu [Tue, 4 Aug 2020 19:44:43 +0000 (19:44 +0000)]
Import DTS files for arm, arm64, riscv from Linux 5.8

MFC after: 2 months

3 years agoRemove extra memset() left after r342388.
mav [Tue, 4 Aug 2020 19:27:03 +0000 (19:27 +0000)]
Remove extra memset() left after r342388.

This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(),
that broke target reset on device removal, making later re-insertion into
the same slot impossible, since firmware was still waiting for the driver
to finish with the removed device.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

3 years agoImport DTS from Linux 5.8
manu [Tue, 4 Aug 2020 19:05:45 +0000 (19:05 +0000)]
Import DTS from Linux 5.8

3 years agoDisable errors for -Wsystem-headers for GCC on aarch64.
jhb [Tue, 4 Aug 2020 18:24:46 +0000 (18:24 +0000)]
Disable errors for -Wsystem-headers for GCC on aarch64.

GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and
GCC 9.

Differential Revision: https://reviews.freebsd.org/D25729

3 years agold.bfd requires an explicit emulation for MIPS for ld -r.
jhb [Tue, 4 Aug 2020 18:23:32 +0000 (18:23 +0000)]
ld.bfd requires an explicit emulation for MIPS for ld -r.

Unlike lld, ld.bfd doesn't infer the emulation from the first object
file, but assumes its compiled in default for ld -r.

Differential Revision: https://reviews.freebsd.org/D25728

3 years agoDisable errors for -Wredundant-decls for GCC 6+.
jhb [Tue, 4 Aug 2020 18:20:39 +0000 (18:20 +0000)]
Disable errors for -Wredundant-decls for GCC 6+.

GCC triggers warnings for this that clang does not for duplicate
declarations of yylex().

Differential Revision: https://reviews.freebsd.org/D25727

3 years agoTurn off errors for -Wmaybe-uninitialized in GCC 6+.
jhb [Tue, 4 Aug 2020 18:19:29 +0000 (18:19 +0000)]
Turn off errors for -Wmaybe-uninitialized in GCC 6+.

Recent changes to <sys/tree.h> trigger this warning and seem like a
false positive.

Differential Revision: https://reviews.freebsd.org/D25726

3 years agolinuxkpi: Add time_after32 and time_before32
manu [Tue, 4 Aug 2020 15:27:32 +0000 (15:27 +0000)]
linuxkpi: Add time_after32 and time_before32

This compare two 32 bits times

Sponsored by: The FreeBSD Foundation
Reviewed by: kib, hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25700

3 years agolinuxkpi: Add clear_bit_unlock
manu [Tue, 4 Aug 2020 15:25:22 +0000 (15:25 +0000)]
linuxkpi: Add clear_bit_unlock

This calls clear_bit and adds a memory barrier.

Sponsored by: The FreeBSD Foundation

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25943

3 years agoRemove an incorrect assertion from in6p_lookup_mcast_ifp().
markj [Tue, 4 Aug 2020 15:00:02 +0000 (15:00 +0000)]
Remove an incorrect assertion from in6p_lookup_mcast_ifp().

The socket may be bound to an IPv4-mapped IPv6 address.  However, the
inp address is not relevant to the JOIN_GROUP or LEAVE_GROUP operations.

While here remove an unnecessary check for inp == NULL.

Reported by: syzbot+d01ab3d5e6c1516a393c@syzkaller.appspotmail.com
Reviewed by: hselasky
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25888

3 years agoRemove most lingering references to the page lock in comments.
markj [Tue, 4 Aug 2020 14:59:43 +0000 (14:59 +0000)]
Remove most lingering references to the page lock in comments.

Finish updating comments to reflect new locking protocols introduced
over the past year.  In particular, vm_page_lock is now effectively
unused.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25868

3 years agoRe-apply r363564.
manu [Tue, 4 Aug 2020 14:53:41 +0000 (14:53 +0000)]
Re-apply r363564.

We now have linux/sizes.h in the tree.

3 years agopkgbase: Remove the last users of the FreeBSD-example package
manu [Tue, 4 Aug 2020 14:48:45 +0000 (14:48 +0000)]
pkgbase: Remove the last users of the FreeBSD-example package

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

3 years agolinuxkpi: Add nested variant of mutex_lock_interruptible
manu [Tue, 4 Aug 2020 14:45:22 +0000 (14:45 +0000)]
linuxkpi: Add nested variant of mutex_lock_interruptible

We don't do anything with the _nesteds variant so just call mutex_lock_interruptible

Sponsoredby: The FreeBSD Foundation
Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25944

3 years agolinuxkpi: Add kref_put_lock
manu [Tue, 4 Aug 2020 14:44:16 +0000 (14:44 +0000)]
linuxkpi: Add kref_put_lock

Same as kref_put but in addition to calling the rel function it will
acquire the lock first.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D25942

3 years agolinuxkpi: Add linux/sizes.h
manu [Tue, 4 Aug 2020 14:42:38 +0000 (14:42 +0000)]
linuxkpi: Add linux/sizes.h

This file contain some defines for common sizes.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25941

3 years agoRemove free_domain() and uma_zfree_domain().
markj [Tue, 4 Aug 2020 13:58:36 +0000 (13:58 +0000)]
Remove free_domain() and uma_zfree_domain().

These functions were introduced before UMA started ensuring that freed
memory gets placed in domain-local caches.  They no longer serve any
purpose since UMA now provides their functionality by default.  Remove
them to simplyify the kernel memory allocator interfaces a bit.

Reviewed by: cem, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25937

3 years agoiovctl.conf(5): Use Lk macro for the URL of the UCL website
gbe [Tue, 4 Aug 2020 11:13:13 +0000 (11:13 +0000)]
iovctl.conf(5): Use Lk macro for the URL of the UCL website

PR: 248334
Reported by: chuck at tuffli dot net
Reviewed by: bcr, 0mp
Approved by: bcr, 0mp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25891

3 years agodirectory(3): Add an ERRORS section
gbe [Tue, 4 Aug 2020 08:46:28 +0000 (08:46 +0000)]
directory(3): Add an ERRORS section

- Add an ERRORS section for opendir(3) and closedir(3)
- Document also the errors of readdir(3), readdir_r(3) and telldir(3)
- Convert the code sample into an EXAMPLES section

PR: 75711

Submitted by: abc <abc at ai1 dot anchorage dot mtaonline dot net>
Reviewed by: 0mp, bcr, jilles
Approved by: 0mp, bcr, jilles
Obtained from: partial from OpenBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25892

3 years agoEnsure libregex is built in time for googletest
kevans [Tue, 4 Aug 2020 03:43:28 +0000 (03:43 +0000)]
Ensure libregex is built in time for googletest

In lib/Makefile, we document the dependency with SUBDIR_DEPEND

For buildworld orchestration, just prebuild libregex if GOOGLETEST is
enabled. googletest will get built in a later pass.

3 years agobsdgrep: switch to libregex for GNU_GREP_COMPAT
kevans [Tue, 4 Aug 2020 02:47:24 +0000 (02:47 +0000)]
bsdgrep: switch to libregex for GNU_GREP_COMPAT

libregex is incomplete, but it's a bit less buggy than the in-base
libgnuregex and mostly OK.

While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies
that we're compatible with the GNU counterpart, not that we're including GNU
anything.

3 years agoRe-enable disabled googletest-port-test tests after r363820
kevans [Tue, 4 Aug 2020 02:20:15 +0000 (02:20 +0000)]
Re-enable disabled googletest-port-test tests after r363820

gtest now links against libregex here, and the tests pass locally.

PR: 248452

3 years agogtest: link against libregex for GNU extensions
kevans [Tue, 4 Aug 2020 02:18:24 +0000 (02:18 +0000)]
gtest: link against libregex for GNU extensions

gtest tests want to use \w ([[:alnum:]]) at the very least, which was
causing them to fail after r363679.

Start linking against libregex so that this shorthand is implemented.

PR: 248452

3 years agolibregex: disable some of the unimplemented test cases for now
kevans [Tue, 4 Aug 2020 02:16:43 +0000 (02:16 +0000)]
libregex: disable some of the unimplemented test cases for now

This should allow the tests to actually pass. Future work will uncomment the
unimplemented tests as they're implemented.