]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agovtfontcvt: improve BDF and hex font parsing
emaste [Sun, 16 Jun 2019 09:17:26 +0000 (09:17 +0000)]
vtfontcvt: improve BDF and hex font parsing

Support larger font sizes.

PR: 205707
Submitted by: Dmitry Wagin (original version)
MFC after: 2 weeks
Event: Berlin Devsummit 2019
Differential Revision: https://reviews.freebsd.org/D20650

4 years agosymlinkat(2) is not covered.
bdrewery [Sun, 16 Jun 2019 05:12:17 +0000 (05:12 +0000)]
symlinkat(2) is not covered.

4 years agoAdd macOS-like three finger drag trackpad gesture to psm(4)
philip [Sun, 16 Jun 2019 03:06:05 +0000 (03:06 +0000)]
Add macOS-like three finger drag trackpad gesture to psm(4)

Submitted by: Yan Ka Chiu <nyan@myuji.xyz>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20648

4 years agoBuild SoC-specific modules with GENERIC for the SoCs that have them.
ian [Sun, 16 Jun 2019 01:23:45 +0000 (01:23 +0000)]
Build SoC-specific modules with GENERIC for the SoCs that have them.

4 years agoAdd module makefiles for Texas Instruments ARM SoCs.
ian [Sun, 16 Jun 2019 01:22:44 +0000 (01:22 +0000)]
Add module makefiles for Texas Instruments ARM SoCs.

The natural place to look for them based on how other SoCs are organized
would be sys/modules/ti, but that's already taken.  Drop a clue into
modules/ti/Makefile directing people to modules/arm_ti if they're looking
for ARM modules.

4 years agoSplit the dtb MODULES_EXTRA line to a series of += lines, making it easier
ian [Sun, 16 Jun 2019 01:05:53 +0000 (01:05 +0000)]
Split the dtb MODULES_EXTRA line to a series of += lines, making it easier
to maintain and keep in alphabetical order, and paving the way for adding
some other modules that aren't dtb-related.

4 years agoAdd module makefiles for pwm.
ian [Sun, 16 Jun 2019 00:53:09 +0000 (00:53 +0000)]
Add module makefiles for pwm.

4 years agoThis code no longer uses fdt/ofw stuff, no need to include ofw headers.
ian [Sun, 16 Jun 2019 00:43:05 +0000 (00:43 +0000)]
This code no longer uses fdt/ofw stuff, no need to include ofw headers.

4 years agoMake channel number unsigned, and spell unsigned int u_int. This should
ian [Sun, 16 Jun 2019 00:32:19 +0000 (00:32 +0000)]
Make channel number unsigned, and spell unsigned int u_int.  This should
have been part of r349088.

4 years agoThe pwm interface was replaced with pwmbus, include the right header file.
ian [Sun, 16 Jun 2019 00:27:11 +0000 (00:27 +0000)]
The pwm interface was replaced with pwmbus, include the right header file.

4 years agoMake pwm channel numbers unsigned.
ian [Sat, 15 Jun 2019 23:02:09 +0000 (23:02 +0000)]
Make pwm channel numbers unsigned.

4 years agoRestructure the pwm device hirearchy and interfaces.
ian [Sat, 15 Jun 2019 22:25:39 +0000 (22:25 +0000)]
Restructure the pwm device hirearchy and interfaces.

The pwm and pwmbus interfaces were nearly identical, this merges them into a
single pwmbus interface.  The pwmbus driver now implements the pwmbus
interface by simply passing all calls through to its parent (the hardware
driver).  The channel_count method moves from pwm to pwmbus, and the
get_bus method is deleted (just no longer needed).

The net effect is that the interface for doing pwm stuff is now the same
regardless of whether you're a child of pwmbus, or some random driver
elsewhere in the hierarchy that is bypassing the pwmbus layer and is talking
directly to the hardware driver via cross-hierarchy connections established
using fdt data.

The pwmc driver is now a child of pwmbus, instead of being its sibling
(that's why the get_bus method is no longer needed; pwmc now gets the
device_t of the bus using device_get_parent()).

4 years agoDestroy the cdev on device detach. Also, make the driver and devclass
ian [Sat, 15 Jun 2019 21:51:55 +0000 (21:51 +0000)]
Destroy the cdev on device detach.  Also, make the driver and devclass
static, because nothing outside this file needs them.

4 years agoRename the channel_max method to channel_count, because that's what it's
ian [Sat, 15 Jun 2019 21:36:14 +0000 (21:36 +0000)]
Rename the channel_max method to channel_count, because that's what it's
returning.  (If the channel count is 2, then the max channel number is 1.)

4 years agoGive the aw_pwm driver a module version.
ian [Sat, 15 Jun 2019 21:31:04 +0000 (21:31 +0000)]
Give the aw_pwm driver a module version.

4 years agoSpell unsigned int as u_int and channel as chan; eliminates the need to wrap
ian [Sat, 15 Jun 2019 21:19:23 +0000 (21:19 +0000)]
Spell unsigned int as u_int and channel as chan; eliminates the need to wrap
some long lines.

4 years agoUnwrap prototype lines so that return type and function name are on the
ian [Sat, 15 Jun 2019 20:54:33 +0000 (20:54 +0000)]
Unwrap prototype lines so that return type and function name are on the
same line.  No functional changes.

4 years agoMake pwmbus driver and devclass vars static; they're not mentioned in any
ian [Sat, 15 Jun 2019 20:53:26 +0000 (20:53 +0000)]
Make pwmbus driver and devclass vars static; they're not mentioned in any
header file, so they can't be used outside this file anyway.

4 years agoAdd a missing #include. I suspect this used to get included via some header
ian [Sat, 15 Jun 2019 20:20:36 +0000 (20:20 +0000)]
Add a missing #include.  I suspect this used to get included via some header
pollution that was cleaned up recently, and this file got missed in the
cleanup because it's not attached to the build unless you specifically
request this device in a custom kernel config.

4 years agoUse device_delete_children() instead of a locally-rolled copy of it that
ian [Sat, 15 Jun 2019 20:17:00 +0000 (20:17 +0000)]
Use device_delete_children() instead of a locally-rolled copy of it that
leaks the device-list memory.

4 years agoRemove pwmbus_attach_bus(), it no longer has any callers. Also remove a
ian [Sat, 15 Jun 2019 20:13:42 +0000 (20:13 +0000)]
Remove pwmbus_attach_bus(), it no longer has any callers.  Also remove a
couple prototypes for functions that never existed (and never will).

4 years agoMove/rename the sys/pwm.h header file to dev/pwm/pwmc.h. The file contains
ian [Sat, 15 Jun 2019 19:46:59 +0000 (19:46 +0000)]
Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h.  The file contains
ioctl definitions and related datatypes that allow userland control of pwm
hardware via the pwmc device.  The new name and location better reflects its
assocation with a single device driver.

4 years agoDo not include pwm.h here, it is purely a userland interface file containing
ian [Sat, 15 Jun 2019 19:43:33 +0000 (19:43 +0000)]
Do not include pwm.h here, it is purely a userland interface file containing
ioctl defintions for the pwmc driver. It is not part of the pwmbus interface.

4 years agoRemove pcf8563reg.h, the driver it was associated with was replaced in 2017
ian [Sat, 15 Jun 2019 19:16:02 +0000 (19:16 +0000)]
Remove pcf8563reg.h, the driver it was associated with was replaced in 2017
with the nxprtc multi-chip driver.

4 years agoPreviously, when pmap_remove_pages() destroyed a dirty superpage mapping,
alc [Sat, 15 Jun 2019 17:26:42 +0000 (17:26 +0000)]
Previously, when pmap_remove_pages() destroyed a dirty superpage mapping,
it only called vm_page_dirty() on the first of the superpage's constituent
4KB pages.  This revision corrects that error, calling vm_page_dirty() on
all of superpage's constituent 4KB pages.

MFC after: 3 days

4 years agocsu: Add proper .depend tracking for each object.
bdrewery [Sat, 15 Jun 2019 17:08:39 +0000 (17:08 +0000)]
csu: Add proper .depend tracking for each object.

This doesn't appear to have ever worked. After a .depend is generated
there will be duplicate .c dependencies so only use the first one.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoAllow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.
bdrewery [Sat, 15 Jun 2019 17:08:35 +0000 (17:08 +0000)]
Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.

Default to tracking .depend.* for OBJS rather than SRCS.

This helps cover some special case builds like gnu/lib/csu which
do more of a PROGS-like thing with bsd.prog.mk.

It is possible this causes out-of-tree Makefiles to have problems if they use
this pattern:
foo.o: foo.c
${CC} -o ${.TARGET} ${.ALLSRC}
This may cause multiple source files to be compiled due to finding the
'foo.o: foo.c' dependency both in the Makefile at the .depend file. Or
it may try compiling headers. This can be worked around by either of these:
foo.o: foo.c
${CC} -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
Or
foo.o: foo.c
${CC} -o ${.TARGET} ${.CURDIR}/foo.c
In the latter case the ${.CURDIR} may need to be a different path. The
first case covers automatically using .PATH.

Sponsored by: DellEMC

4 years agoSupport reading in .depend files.
bdrewery [Sat, 15 Jun 2019 17:08:32 +0000 (17:08 +0000)]
Support reading in .depend files.

This is for an upcoming change that fixes .depend handling in here.
It will cause some duplicate sources which need to be trimmed out.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoMETA_MODE: Delete build targets that fail.
bdrewery [Sat, 15 Jun 2019 17:08:28 +0000 (17:08 +0000)]
META_MODE: Delete build targets that fail.

If a meta mode change is triggered but then the build fails then the
next build will not retrigger meta mode. This only prevented by
removing the target on rebuild or on the failure to rebuild.

Sponsored by: DellEMC

4 years agoAdd various CFLAGS/LDADD overrides for the output target file.
bdrewery [Sat, 15 Jun 2019 17:08:24 +0000 (17:08 +0000)]
Add various CFLAGS/LDADD overrides for the output target file.

Sponsored by: DellEMC

4 years agoAvoid generating DEPENDFILES='.depend.' when there's no DEPENDOBJS.
bdrewery [Sat, 15 Jun 2019 17:08:21 +0000 (17:08 +0000)]
Avoid generating DEPENDFILES='.depend.' when there's no DEPENDOBJS.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoSimilar to r335710 avoid ccache when linking a .cc file directly.
bdrewery [Sat, 15 Jun 2019 17:08:18 +0000 (17:08 +0000)]
Similar to r335710 avoid ccache when linking a .cc file directly.

Sponsored by: DellEMC

4 years agoFix .depend files to work for build tools.
bdrewery [Sat, 15 Jun 2019 17:08:13 +0000 (17:08 +0000)]
Fix .depend files to work for build tools.

This is somewhat of a follow-up to r335746.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoDon't force OBJS_DEPEND_GUESS headers onto all objects.
bdrewery [Sat, 15 Jun 2019 17:08:02 +0000 (17:08 +0000)]
Don't force OBJS_DEPEND_GUESS headers onto all objects.

This is in the case of not having any .depend.foo.o yet.  Don't force add *.h
as a dependency for those. They are built in beforebuild already when in
SRCS/DPSRCS.

This change allows custom rules, like in bin/sh/Makefile for mksyntax, to not
have cyclic dependency problems when connected to the .depend.* handling.

This is purposely not copied to sys/conf/kern.post.mk as it handles
generating headers slightly differently.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoHandle failure to enable the clock or obtain its frequency.
ian [Sat, 15 Jun 2019 16:59:03 +0000 (16:59 +0000)]
Handle failure to enable the clock or obtain its frequency.

4 years agoDon't call pwmbus_attach_bus(), because it may not be present if this
ian [Sat, 15 Jun 2019 16:56:00 +0000 (16:56 +0000)]
Don't call pwmbus_attach_bus(), because it may not be present if this
driver is compiled into the kernel but pwmbus will be loaded as a module
when needed (and because of that, pwmbus_attach_bus() is going away in
the near future).  Instead, just directly do what that function did:
register the fdt xfef handle, and attach the pwmbus.

4 years agoIn detach(), check for failure of bus_generic_detach(), only release
ian [Sat, 15 Jun 2019 16:36:29 +0000 (16:36 +0000)]
In detach(), check for failure of bus_generic_detach(), only release
resources if they got allocated (because detach() gets called from attach()
to handle various failures), and delete the pwmbus child if it got created.

4 years agoAllow pwm(9) components to be selected individually, while 'device pwm'
ian [Sat, 15 Jun 2019 16:16:29 +0000 (16:16 +0000)]
Allow pwm(9) components to be selected individually, while 'device pwm'
still includes it all.

4 years agonetmap.4: Fix a typo as FreeBSD Linux is not a thing
0mp [Sat, 15 Jun 2019 12:09:22 +0000 (12:09 +0000)]
netmap.4: Fix a typo as FreeBSD Linux is not a thing

Approved by: src (emaste)
Event: Berlin Devsummit 2019

4 years ago- Replace unused and only ever written to members of public iflib(9)
marius [Sat, 15 Jun 2019 11:07:41 +0000 (11:07 +0000)]
- Replace unused and only ever written to members of public iflib(9)
  structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES
  etc. are also only ever used for these write-only members if at all,
  so both these macros and members can just go). Using these spares
  may render it possible to merge certain iflib(9) fixes to stable/12.
  Otherwise, changes extending struct if_irq or struct if_shared_ctx
  in any way would break KBI as instances of these are allocated by
  the driver front-ends (by contrast, struct if_pkt_info as well as
  struct if_softc_ctx instances are provided by iflib(9) and, thus,
  may grow at least at the end without breaking KBI).
- Make the pvi_name in struct pci_vendor_info const char * as device
  identifiers in hardware lookup tables aren't to be expected to ever
  change at runtime.
- Similarly, make the pci_vendor_info_t of struct if_shared_ctx which
  is used to point to the struct pci_vendor_info arrays provided by
  the driver front-ends const.
- Remove the ETH_ADDR_LEN macro from iflib.h; this was duplicating
  ETHER_ADDR_LEN of <net/ethernet.h> with iflib(9) actually only
  consuming the latter macro.
- Make the name argument of iflib_io_tqg_attach(9) const, matching
  the taskqgroup_attach_cpu(9) this function wraps as well as e. g.
  iflib_config_gtask_init(9).
- Remove the orphaned iflib_qset_lock_get() prototype.
- Remove some extraneous empty lines.

4 years agoAdd <sys/dnv.h> required for libnv to SYSINCS, too, apparently missed
marius [Sat, 15 Jun 2019 09:45:00 +0000 (09:45 +0000)]
Add <sys/dnv.h> required for libnv to SYSINCS, too, apparently missed
in r336335.

4 years agovtfontcvt: add comments in add_glyph
emaste [Sat, 15 Jun 2019 09:15:58 +0000 (09:15 +0000)]
vtfontcvt: add comments in add_glyph

During review for PR 205707.

Event: Berlin Devsummit 2019

4 years agoIn ask(): override default option if any of alwaysyes/alwaysno/rdonly is
delphij [Sat, 15 Jun 2019 07:23:06 +0000 (07:23 +0000)]
In ask(): override default option if any of alwaysyes/alwaysno/rdonly is
set.

MFC after: 2 weeks

4 years agoBlankspace. No actual code change.
delphij [Sat, 15 Jun 2019 06:51:46 +0000 (06:51 +0000)]
Blankspace.  No actual code change.

MFC after: 2 weeks

4 years agoCritical comments were lost in r349203. This patch seeks to restore
dougm [Sat, 15 Jun 2019 04:30:13 +0000 (04:30 +0000)]
Critical comments were lost in r349203. This patch seeks to restore
the lost information in new comments.

Reported by: alc
Reviewed by: alc
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20632

4 years agoLightly hide the 'var' inside the macros to read the arm special registers.
julian [Sat, 15 Jun 2019 00:47:39 +0000 (00:47 +0000)]
Lightly hide the 'var' inside the macros to read the arm special registers.
I just happenned to have 3rd party code using 'var' as the output variable
which drew my attention to this. variables defined inside macros should be
prefixed to avoid getting shadowed varable wanrings from clang.

4 years agoEdvard Hagerup Grieg parses as given name, mother's maiden name, surname
grog [Fri, 14 Jun 2019 23:53:19 +0000 (23:53 +0000)]
Edvard Hagerup Grieg parses as given name, mother's maiden name, surname

4 years agoBatch the TLB invalidations that are performed by pmap_protect() rather
alc [Fri, 14 Jun 2019 22:06:43 +0000 (22:06 +0000)]
Batch the TLB invalidations that are performed by pmap_protect() rather
than performing them one at a time.

MFC after: 10 days

4 years agoopen(2): fix the description of O_FSYNC
asomers [Fri, 14 Jun 2019 20:35:37 +0000 (20:35 +0000)]
open(2): fix the description of O_FSYNC

The man page claims that with O_FSYNC (aka O_SYNC) the kernel will not cache
written data. However, that's not true. Nor does POSIX require it.
Perhaps it was true when that section of the man page was written in r69336
(I haven't checked). But it's not true now.  Now the effect is simply that
writes are sent to disk immediately and synchronously, but they're still
cached.

See also: https://pubs.opengroup.org/onlinepubs/9699919799/
See also: ffs_write in sys/ufs/ffs/ffs_vnops.c

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

4 years agoMinimize aggsum_compare(&arc_size, arc_c) calls.
mav [Fri, 14 Jun 2019 20:04:28 +0000 (20:04 +0000)]
Minimize aggsum_compare(&arc_size, arc_c) calls.

For busy ARC situation when arc_size close to arc_c is desired.  But
then it is quite likely that aggsum_compare(&arc_size, arc_c) will need
to flush per-CPU buckets to find exact comparison result.  Doing that
often in a hot path penalizes whole idea of aggsum usage there, since it
replaces few simple atomic additions with dozens of lock acquisitions.

Replacing aggsum_compare() with aggsum_upper_bound() in code increasing
arc_p when ARC is growing (arc_size < arc_c) according to PMC profiles
allows to save ~5% of CPU time in aggsum code during sequential write
to 12 ZVOLs with 16KB block size on large dual-socket system.

I suppose there some minor arc_p behavior change due to lower precision
of the new code, but I don't think it is a big deal, since it should
affect only very small window in time (aggsum buckets are flushed every
second) and in ARC size (buckets are limited to 10 average ARC blocks
per CPU).

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoAlike to ZoL disable metaslab allocation tracing code.
mav [Fri, 14 Jun 2019 19:57:32 +0000 (19:57 +0000)]
Alike to ZoL disable metaslab allocation tracing code.

It is too generous to collect in production debug traces that can only
be read with kernel debugger.  Illumos includes special code in their
mdb debugger to read it, we don't.

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

4 years agoProperly align struct multilist_sublist to cache line.
mav [Fri, 14 Jun 2019 17:09:39 +0000 (17:09 +0000)]
Properly align struct multilist_sublist to cache line.

Manual Illumos alignment does not fit us due to different kmutex_t size.

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

4 years agoClarify that the -r and -R options can be used only to create level 0 dumps.
mckusick [Fri, 14 Jun 2019 06:10:15 +0000 (06:10 +0000)]
Clarify that the -r and -R options can be used only to create level 0 dumps.

Suggested by: phk
MFC after:    3 days

4 years agoChange the arm64 pmap so that updates to the global count of wired pages are
alc [Fri, 14 Jun 2019 04:01:08 +0000 (04:01 +0000)]
Change the arm64 pmap so that updates to the global count of wired pages are
not performed directly by the pmap.  Instead, they are performed by
vm_page_free_pages_toq().  (This is the same approach that we use on x86.)

Reviewed by: kib, markj
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D20627

4 years agoAvoid using the prev field of vm_map_entry_t in two functions that
dougm [Fri, 14 Jun 2019 03:15:54 +0000 (03:15 +0000)]
Avoid using the prev field of vm_map_entry_t in two functions that
iterate over consecutive vm_map entries, and that can easily just
'remember' the prev value instead of looking it up.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20628

4 years agoUpdate td_runtime of running thread on each statclock().
mav [Fri, 14 Jun 2019 01:09:10 +0000 (01:09 +0000)]
Update td_runtime of running thread on each statclock().

Normally td_runtime is updated on context switch, but there are some kernel
threads that due to high absolute priority may run for many seconds without
context switches (yes, that is bad, but that is true), which means their
td_runtime was not updated all that time, that made them invisible for top
other then as some general CPU usage.

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

4 years agoAdd opt_cam.h so we can build this outside of a kernel build.
imp [Thu, 13 Jun 2019 22:03:53 +0000 (22:03 +0000)]
Add opt_cam.h so we can build this outside of a kernel build.

4 years agoCreate a function for creating objects to back map entries, and one
dougm [Thu, 13 Jun 2019 20:09:07 +0000 (20:09 +0000)]
Create a function for creating objects to back map entries, and one
for giving cred to a map entry backed by an object, and use them
instead of the code duplicated inline now.

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20370

4 years agobhyve: move common code to net_utils.c
vmaffione [Thu, 13 Jun 2019 17:39:32 +0000 (17:39 +0000)]
bhyve: move common code to net_utils.c

Both virtio_net and e82545 network frontends have code to validate and
generate MAC addresses. These functionalities are replicated in the two
files, so we move them in a separate compilation unit.

Reviewed by: rgrimes, bryanv, imp, kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20626

4 years agoDon't print the request we may be aborting in ciss_notify_abort as
imp [Thu, 13 Jun 2019 05:19:42 +0000 (05:19 +0000)]
Don't print the request we may be aborting in ciss_notify_abort as
part of ciss_detach. It's a left-over debug that isn't needed and also
discloses a kernel address. Only root could provoke as part of a
devctl or kldunload.

Submitted by: Fuqian Huang
MFC After: 1 week

4 years agoIncrease the timeout for READ NATIVE MAX
imp [Thu, 13 Jun 2019 05:19:36 +0000 (05:19 +0000)]
Increase the timeout for READ NATIVE MAX

READ NATIVE MAX can take longer than a second if the queued NCQ I/Os
take longer than a second to drain.

4 years agoAdd test cases for epair
asomers [Thu, 13 Jun 2019 05:05:58 +0000 (05:05 +0000)]
Add test cases for epair

Implements the missing test cases for epair in a similar fashion to the
existing tests. Fixes shared abstractions to work with epair tests.

Submitted by: Ryan Moeller <ryan@freqlabs.com>
Reviewed by: asomers
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D20498

4 years agoFix gcc build by removing redeclaration
lwhsu [Thu, 13 Jun 2019 03:48:36 +0000 (03:48 +0000)]
Fix gcc build by removing redeclaration

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20622

4 years agoMove write aggregation memory copy out of vq_lock.
mav [Thu, 13 Jun 2019 01:21:32 +0000 (01:21 +0000)]
Move write aggregation memory copy out of vq_lock.

Memory copy is too heavy operation to do under the congested lock.
Moving it out reduces congestion by many times to almost invisible.
Since the original zio removed from the queue, and the child zio is
not executed yet, I don't see why would the copy need protection.
My guess it just remained like this from the time when lock was not
dropped here, which was added later to fix lock ordering issue.

Multi-threaded sequential write tests with both HDD and SSD pools
with ZVOL block sizes of 4KB, 16KB, 64KB and 128KB all show major
reduction of lock congestion, saving from 15% to 35% of CPU time
and increasing throughput from 10% to 40%.

Reviewed by: ahrens, behlendorf, ryao
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoDon't delete .depend files outside of cleandepend.
bdrewery [Wed, 12 Jun 2019 23:09:10 +0000 (23:09 +0000)]
Don't delete .depend files outside of cleandepend.

Sponsored by: DellEMC

4 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++,
dim [Wed, 12 Jun 2019 21:10:37 +0000 (21:10 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++,
libunwind and openmp to the upstream release_80 branch r363030
(effectively, 8.0.1 rc2).  The 8.0.1 release should follow this within a
week or so.

MFC after: 2 weeks

4 years agoChange pmap_demote_l2_locked() so that it removes the superpage mapping on a
alc [Wed, 12 Jun 2019 20:38:49 +0000 (20:38 +0000)]
Change pmap_demote_l2_locked() so that it removes the superpage mapping on a
demotion failure.  Otherwise, some callers to pmap_demote_l2_locked(), such
as pmap_protect(), may leave an incorrect mapping in place on a demotion
failure.

Change pmap_demote_l2_locked() so that it handles addresses that are not
superpage aligned.  Some callers to pmap_demote_l2_locked(), such as
pmap_protect(), may not pass a superpage aligned address.

Change pmap_enter_l2() so that it correctly calls vm_page_free_pages_toq().
The arm64 pmap is updating the count of wired pages when freeing page table
pages, so pmap_enter_l2() should pass false to vm_page_free_pages_toq().

Optimize TLB invalidation in pmap_remove_l2().

Reviewed by: kib, markj (an earlier version)
Discussed with: andrew
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D20585

4 years agofileargs: add wrapping/unwrapping functions
oshogbo [Wed, 12 Jun 2019 19:31:26 +0000 (19:31 +0000)]
fileargs: add wrapping/unwrapping functions

Those function may be useful to pass fileargs connections around.

4 years agogeli: style nits
oshogbo [Wed, 12 Jun 2019 19:29:48 +0000 (19:29 +0000)]
geli: style nits

4 years agogeli: partially revert r348709
oshogbo [Wed, 12 Jun 2019 19:29:12 +0000 (19:29 +0000)]
geli: partially revert r348709

Let's change the unsigned arguments to the signed one, but let's don't
change pointers to the array notation.

Requested by: pjd

4 years agoSome devices take undesired actions when RTS and DTR are
shurd [Wed, 12 Jun 2019 18:07:04 +0000 (18:07 +0000)]
Some devices take undesired actions when RTS and DTR are
asserted. Some development boards for example will reset on DTR,
and some radio interfaces will transmit on RTS.

This patch allows "stty -f /dev/ttyu9.init -rtsdtr" to prevent
RTS and DTR from being asserted on open(), allowing these devices
to be used without problems.

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

4 years agoRemove a spurious break when setting up a 64-bit memory BAR.
jhb [Wed, 12 Jun 2019 16:49:01 +0000 (16:49 +0000)]
Remove a spurious break when setting up a 64-bit memory BAR.

This was causing 'enbit' to not be initialized in this case.

CID: 1401924
Reported by: Coverity
MFC after: 1 week

4 years agoThe current IPMI KCS code is waiting 100us for all transitions (roughly
jtl [Wed, 12 Jun 2019 16:06:31 +0000 (16:06 +0000)]
The current IPMI KCS code is waiting 100us for all transitions (roughly
between each byte either sent or received). However, most transitions
actually complete in 2-3 microseconds.

By polling the status register with a delay of 4us with exponential
backoff, the performance of most IPMI operations is significantly
improved:
  - A BMC update on a Supermicro x9 or x11 motherboard goes from ~1 hour
    to ~6-8 minutes.
  - An ipmitool sensor list time improves by a factor of 4.

Testing showed no significant improvements on a modern server by using
a lower delay.

The changes should also generally reduce the total amount of CPU or
I/O bandwidth used for a given IPMI operation.

Submitted by: Loic Prylli <lprylli@netflix.com>
Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20527

4 years agoDon't attempt to include hwpmc support for armv6, we're missing some of the
ian [Wed, 12 Jun 2019 16:05:20 +0000 (16:05 +0000)]
Don't attempt to include hwpmc support for armv6, we're missing some of the
necessary support functions in cpu-v6.h, and it may be that the only armv6
platform we support (RPi, the bcm2835 SOC) is incapable of supporting hwpmc.

Reported by: dim@

4 years agoFix PPC970 boot after r348783
bdragon [Wed, 12 Jun 2019 15:58:11 +0000 (15:58 +0000)]
Fix PPC970 boot after r348783

r348783 changed the behavior of the kernel mappings and broke booting on G5.

- Split the kernel mapping logic out so that the case where we are
running from the wrong memory space is handled using identity
mappings, and the case where we are not using a DMAP is handled by
forcibly mapping the kernel into the dmap range as intended by
r348783.

Reported by: Mikael Urankar
Reviewed by: luporl
Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D20608

4 years agoMFV r348971,r348977:
mm [Wed, 12 Jun 2019 13:34:12 +0000 (13:34 +0000)]
MFV r348971,r348977:
Sync libarchive with vendor.

Relevant vendor changes:
  - check_symlinks_fsobj() without chdir() and fchdir()
  - bsdtar.1 manpage fixes
  - patches from OpenBSD to libarchive_fe/passphrase.c
  - version bumped to 3.4.0

MFC after: 2 weeks

4 years agomtree: Restore mode for /var/spool/lock and opielocks
manu [Wed, 12 Jun 2019 11:34:16 +0000 (11:34 +0000)]
mtree: Restore mode for /var/spool/lock and opielocks

mode was dropped unintentionally in r348981 for those two directories.

Reviewed by: rgrimes
MFC after: 1 month
X-MFC-With: r348981

4 years agoWhitespace adjustments replacing spaces with tabs.
cy [Wed, 12 Jun 2019 11:18:11 +0000 (11:18 +0000)]
Whitespace adjustments replacing spaces with tabs.

MFC after: 1 month
X-MFC with: r348987

4 years agoResolve IPv6 checksum errors with stateful inspection. According to
cy [Wed, 12 Jun 2019 11:06:58 +0000 (11:06 +0000)]
Resolve IPv6 checksum errors with stateful inspection. According to
PR/203585 this appears to have been broken by r235959, which predates
the ipfilter 5.1.2 import into FreeBSD.

The IPv6 checksum calculation is incorrect. To resolve this we call
in6_cksum() to do the the heavy lifting for us, through a new function
ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
is added to aid with future debugging.

PR: 203275, 203585
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20583

4 years agoRegister pfil hooks when VNET != vnet0. r302298, which virtualized ipf,
cy [Wed, 12 Jun 2019 11:06:54 +0000 (11:06 +0000)]
Register pfil hooks when VNET != vnet0. r302298, which virtualized ipf,
assumed the pfil hook registration performed in ipf_modload() would take
care of this. However ipf_modload() is only called when the ipl kld is
loaded or when ipfilter is first called when it is statically linked
into the kernel at build time.

Prior to this, even though r302298 has been in the tree for a while, it
has never been used. So, r302298 in reality begins now.

PR: 212000
Reported by: ahsanb@
MFC after: 1 month

4 years agoEnclose a long multi-line single conditional statement in braces to
cy [Wed, 12 Jun 2019 11:06:51 +0000 (11:06 +0000)]
Enclose a long multi-line single conditional statement in braces to
improve legibility and aesthetics.

MFC after: 1 week

4 years agopkgbase: Add some tags to files installed in distribution target
manu [Wed, 12 Jun 2019 09:18:23 +0000 (09:18 +0000)]
pkgbase: Add some tags to files installed in distribution target

Add the MK_MAIL dependant file to the runtime package as well as the
MK_KERBEROS ones the empty locate database, the FreeBSD copyright file
and the GENERIC.hints.
Tag the unbound link from /etc to /var to belong in the unbound package.

Reviewed by: bapt
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20607

4 years agopkgbase: Add the correct package for sendmail configuration files
manu [Wed, 12 Jun 2019 09:17:32 +0000 (09:17 +0000)]
pkgbase: Add the correct package for sendmail configuration files

Reviewed by: bapt
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20606

4 years agopkgbase: Set a default package=runtime for var directories
manu [Wed, 12 Jun 2019 09:16:42 +0000 (09:16 +0000)]
pkgbase: Set a default package=runtime for var directories

This way every directory is at least present in packages.
While here tag some directory from being in sendmail or dma

Reviewed by: bapt
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20605

4 years agoStop using .OODATE for extracting firmware.
bdrewery [Wed, 12 Jun 2019 00:03:00 +0000 (00:03 +0000)]
Stop using .OODATE for extracting firmware.

This fixes META_MODE rebuilding since it assumes that it this is
a non-consistent build command. These are always unencoded consistently
though and do not need to use the .OODATE/$? mechanism.

MFC after: 2 weeks
Reported by: npn
Sponsored by: DellEMC

4 years agoAdd missing DPSRCS entry for assym.inc.
bdrewery [Tue, 11 Jun 2019 23:35:49 +0000 (23:35 +0000)]
Add missing DPSRCS entry for assym.inc.

This brings in various CLEANFILES/DEPENDOBJS handling.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoRestore genassym.o to CLEANFILES.
bdrewery [Tue, 11 Jun 2019 23:35:34 +0000 (23:35 +0000)]
Restore genassym.o to CLEANFILES.

This was lost in r335910 for some reason.

This also fixes a META_MODE rebuild issue in some modules [1].

MFC after: 2 weeks
Reported by: npn [1]
Sponsored by: DellEMC

4 years agoMove declaration of warninterval out from under COMPAT_FREEBSD32.
jhb [Tue, 11 Jun 2019 23:28:07 +0000 (23:28 +0000)]
Move declaration of warninterval out from under COMPAT_FREEBSD32.

This fixes builds of kernels without COMPAT_FREEBSD32.

Reported by: tinderbox
MFC after: 1 month

4 years agoMake the warning intervals for deprecated crypto algorithms tunable.
jhb [Tue, 11 Jun 2019 23:00:55 +0000 (23:00 +0000)]
Make the warning intervals for deprecated crypto algorithms tunable.

New sysctl/tunables can now set the interval (in seconds) between
rate-limited crypto warnings.  The new sysctls are:
- kern.cryptodev_warn_interval for /dev/crypto
- net.inet.ipsec.crypto_warn_interval for IPsec
- kern.kgssapi_warn_interval for KGSSAPI

Reviewed by: cem
MFC after: 1 month
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20555

4 years agoDocument sysctl nodes that translate their values.
jhb [Tue, 11 Jun 2019 22:57:25 +0000 (22:57 +0000)]
Document sysctl nodes that translate their values.

This documents the behavior of sysctl_msec_to_ticks and
SYSCTL_{ADD,}_SBINTIME_[UM]SEC.

Reviewed by: cem
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20596

4 years agoTo test to see if a free space is big enough compare the required
dougm [Tue, 11 Jun 2019 22:41:39 +0000 (22:41 +0000)]
To test to see if a free space is big enough compare the required
length to the difference of the two offsets that define the gap, to
avoid overflow, rather that adding the length to an offset and
comparing that to another offset.

This addresses an overflow issue reported by Peter Holm on i386.

Reported by: pho
Tested by: pho
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20594

4 years agoAvoid out of boundary access when checking invalid long filenames.
delphij [Tue, 11 Jun 2019 22:21:29 +0000 (22:21 +0000)]
Avoid out of boundary access when checking invalid long filenames.

Obtained from: OpenBSD (dir.c,v 1.25)
MFC after: 3 days

4 years agoSort opt_foo.h #includes and add a missing blank line in ip_output().
jhb [Tue, 11 Jun 2019 22:07:39 +0000 (22:07 +0000)]
Sort opt_foo.h #includes and add a missing blank line in ip_output().

4 years agoAdd M_NOFREE to M_FLAG_BITS.
jhb [Tue, 11 Jun 2019 22:06:31 +0000 (22:06 +0000)]
Add M_NOFREE to M_FLAG_BITS.

4 years agoTrim an extra space.
jhb [Tue, 11 Jun 2019 22:06:05 +0000 (22:06 +0000)]
Trim an extra space.

4 years agoMinor white space changes.
imp [Tue, 11 Jun 2019 20:48:19 +0000 (20:48 +0000)]
Minor white space changes.

Remove trailing white space that's crept into this file.

4 years agobhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()
vmaffione [Tue, 11 Jun 2019 15:52:41 +0000 (15:52 +0000)]
bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()

The VirtIO standard supports two schemes for notification suppression:
a notification enable bit and a more sophisticated one (event_idx) that
also supports delayed notifications. Currently bhyve fully supports
only the first scheme. This patch hides the notification suppression
internals by means of two inline routines, vq_kick_enable() and
vq_kick_disable(), and makes the code more readable.
Moreover, further improve readability by replacing the call to mb()
with a call to atomic_thread_fence_seq_cst(), which is already used
in virtio.c

Reviewed by: pmooney_pfmooney.com, bryanv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20581

4 years ago[PPC] Fix build error when POWERNV is disabled
luporl [Tue, 11 Jun 2019 11:23:15 +0000 (11:23 +0000)]
[PPC] Fix build error when POWERNV is disabled

When building a kernel supporting PSERIES but not POWERNV,
the compiler would complain about an error variable being
possibly used before being initialized.

In practice, however, this should never happen. In any case, it
is now initialized to an error value.

4 years ago[PPC64] Fix ofw_initrd
luporl [Tue, 11 Jun 2019 11:16:41 +0000 (11:16 +0000)]
[PPC64] Fix ofw_initrd

Before this change, OFW initrd (as md) handling code was simulating an ofwbus
device. But as there isn't really a Device Tree (DT) node representing OFW
initrd (it is specified in 2 properties under /chosen), its driver was in fact
stealing other driver's DT node.  This was noticed after MD_ROOT_MEM became
default and QEMU's USB keyboard stopped working under VNC.

This change consists in simplifying the process of detection and mapping of
initrd memory, turning it into a simple startup step, instead of trying to
simulate a device.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20553

4 years agoprocstat: Recognize HWCAP and HWCAP2 with auxv command
mhorne [Tue, 11 Jun 2019 00:59:46 +0000 (00:59 +0000)]
procstat: Recognize HWCAP and HWCAP2 with auxv command

The two most recent additions to the elf auxiliary vector are
HWCAP and HWCAP2 which describe platform specific cpu capabilities.

Make procstat recognize these fields so that they aren't displayed
as UNKNOWN.

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