]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoddb(4): Move an extern variable declaration to a header
cem [Mon, 9 Sep 2019 01:33:45 +0000 (01:33 +0000)]
ddb(4): Move an extern variable declaration to a header

Trivial cleanup, no functional change.

4 years agogdb(4): Root a sysctl tree at 'debug.gdb.'
cem [Sun, 8 Sep 2019 22:52:47 +0000 (22:52 +0000)]
gdb(4): Root a sysctl tree at 'debug.gdb.'

Like debug.ddb and debug.kdb.  Rename 'debug.gdbcons' to 'debug.gdb.cons,'
but leave the old name as a compatibility alias.

4 years agoFix cpuwhich_t column width
mhorne [Sun, 8 Sep 2019 21:37:52 +0000 (21:37 +0000)]
Fix cpuwhich_t column width

Not bumping .Dd since this is purely a format change.

Approved by: markj (mentor)

4 years agoremove leftover zfsloader directory
tsoome [Sun, 8 Sep 2019 19:54:28 +0000 (19:54 +0000)]
remove leftover zfsloader directory

It really is empty.

4 years agoFix compilation of locore.S with clang
mhorne [Sun, 8 Sep 2019 19:53:11 +0000 (19:53 +0000)]
Fix compilation of locore.S with clang

The branch from _start to mpentry has to cross a large section of data;
an offset larger than can be specified with a 12-bit branch immediate.
Fix this by converting the branch to an unconditional jump. The gcc
assembler does this conversion silently but it is not done automatically
by clang.

Reported by: Jeremy Bennett <jeremy.bennett@embecosm.com>
Reviewed by: markj
Approved by: markj (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21437

4 years agoRemove a duplicate KTR entry
mhorne [Sun, 8 Sep 2019 19:46:34 +0000 (19:46 +0000)]
Remove a duplicate KTR entry

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

4 years agoRISC-V: fix kernel CFLAGS with clang
mhorne [Sun, 8 Sep 2019 19:44:21 +0000 (19:44 +0000)]
RISC-V: fix kernel CFLAGS with clang

Use the -march and -mabi flags for both gcc and clang as they are
compatible. Specify the "medium" code model separately as it goes by the
name "medany" under gcc, although they are equivalent.

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

4 years agoAllow for compiler versions >= 10
mhorne [Sun, 8 Sep 2019 19:40:52 +0000 (19:40 +0000)]
Allow for compiler versions >= 10

Both clang and gcc development branches have reached version 10. Since we
only parse for a single digit in the major version number, this causes
COMPILER_VERSION to be set to its default of 0.0.0, meaning version checks
fail with these newer compilers.

Reviewed by: emaste
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21413

4 years agoloader: --gc-sections needs sections to work with
tsoome [Sun, 8 Sep 2019 19:39:45 +0000 (19:39 +0000)]
loader: --gc-sections needs sections to work with

--gc-sections is not really useful unless we generate sections with
-ffunction-sections -fdata-sections

While there, i386/loader would win from --gc-sections too.

4 years ago[rpi] Inherit framebuffer BPP value from the VideoCore firmware
gonzo [Sun, 8 Sep 2019 09:47:21 +0000 (09:47 +0000)]
[rpi] Inherit framebuffer BPP value from the VideoCore firmware

Instead of using hardcoded bpp of 24, obtain current/configured value
from VideoCore. This solves certain problems with Xorg/Qt apps that
require bpp of 32 to work properly. The mode can be forced by setting
framebuffer_depth value in config.txt

PR: 235363
Submitted by: Steve Peurifoy <ssw01@mathistry.net>

4 years agomount_fusefs: fix a segfault on memory allocation failure
asomers [Sat, 7 Sep 2019 21:49:01 +0000 (21:49 +0000)]
mount_fusefs: fix a segfault on memory allocation failure

Reported by: Coverity
Coverity CID: 1354188
MFC after: 4 days
Sponsored by: The FreeBSD Foundation

4 years agofusefs: suppress some Coverity resource leak CIDs in the tests
asomers [Sat, 7 Sep 2019 19:25:45 +0000 (19:25 +0000)]
fusefs: suppress some Coverity resource leak CIDs in the tests

The fusefs tests deliberately leak file descriptors.  To do otherwise would
add extra complications to the tests' mock FUSE server.  This annotation
should hopefully convince Coverity to shut up about the leaks.

Reviewed by: uqs
MFC after: 4 days
Sponsored by: The FreeBSD Foundation

4 years agoUnify cam_send_ccb() error reporting.
mav [Sat, 7 Sep 2019 16:52:40 +0000 (16:52 +0000)]
Unify cam_send_ccb() error reporting.

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

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

4 years agoIn do_execve(), use shared text vnode lock consistently.
kib [Sat, 7 Sep 2019 16:10:57 +0000 (16:10 +0000)]
In do_execve(), use shared text vnode lock consistently.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoIn do_execve(), clear imgp->textset when restarting for interpreter.
kib [Sat, 7 Sep 2019 16:05:17 +0000 (16:05 +0000)]
In do_execve(), clear imgp->textset when restarting for interpreter.

Otherwise, we might left the boolean set, which would affect cleanup
after an error on interpreter activation.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoWhen loading ELF interpreter, initialize whole nested image_params with zero.
kib [Sat, 7 Sep 2019 16:03:26 +0000 (16:03 +0000)]
When loading ELF interpreter, initialize whole nested image_params with zero.

Otherwise we could mishandle imgp->textset.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agovm_object_deallocate(): Remove no longer needed code.
kib [Sat, 7 Sep 2019 16:01:45 +0000 (16:01 +0000)]
vm_object_deallocate(): Remove no longer needed code.

We track text mappings explicitly, there is no removal of the text
refs on the object deallocate any more, so tmpfs objects should not be
treated specially. Doing so causes excess deref.

Reported and tested by: gallatin
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agovm_object_coalesce(): avoid extending any nosplit objects, not only
kib [Sat, 7 Sep 2019 15:58:48 +0000 (15:58 +0000)]
vm_object_coalesce(): avoid extending any nosplit objects, not only
that which back tmpfs nodes.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoProperly check for writers when fetching quotas for writeable vnodes
kib [Sat, 7 Sep 2019 15:57:23 +0000 (15:57 +0000)]
Properly check for writers when fetching quotas for writeable vnodes
in UFS quotaon().

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoSupply SAT layer with valid transfer sizes.
mav [Sat, 7 Sep 2019 15:56:00 +0000 (15:56 +0000)]
Supply SAT layer with valid transfer sizes.

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

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

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

4 years agoriscv: restore default HZ=1000, keep QEMU at HZ=100
philip [Sat, 7 Sep 2019 05:13:31 +0000 (05:13 +0000)]
riscv: restore default HZ=1000, keep QEMU at HZ=100

This reverts r351918 and r351919.

Discussed with: br, ian, imp

4 years agoSome newer HID devices have descriptors that are larger than 1k. Bump
imp [Sat, 7 Sep 2019 03:51:26 +0000 (03:51 +0000)]
Some newer HID devices have descriptors that are larger than 1k. Bump
this to 2k to prevent them from being truncated and ignored. It
appears to be a sanity check only, but bumping it to 2k allows both of
my iic hid devices to be parsed and the second one to work...

4 years agofusefs: coverity cleanup in the tests
asomers [Fri, 6 Sep 2019 19:50:45 +0000 (19:50 +0000)]
fusefs: coverity cleanup in the tests

Address the following defects reported by Coverity:

* Structurally dead code (CID 1404366): set m_quit before FAIL, not after

* Unchecked return value of sysctlbyname (CID 1404321)

* Unchecked return value of stat(2) (CID 1404471)

* Unchecked return value of open(2) (CID 14044021404529)

* Unchecked return value of dup(2) (CID 1404478)

* Buffer overflows. These are all false positives caused by the fact that
  Coverity thinks I'm using a buffer to store strings, when in fact I'm
  really just using it to store a byte array that happens to be initialized
  with a string. I'm changing the type from char to uint8_t in the hopes
  that it will placate Coverity. (CID 1404338140435014043671404376,
  14043791404381140438814044031404425140443314044341404474,
  1404480140448414045031404505)

* False positive file descriptor leak. I'm going to try to fix this with
  Coverity modeling, but I'll also change an EXPECT to ASSERT so we don't
  perform meaningless assertions after the failure. (CID 14043201404324,
  14044401404445).

* Unannotated file descriptor leak. This will be followed up by a Coverity
  modeling change. (CID 14043261404334140433614043571404361,
  14043721404391140439514044091404430140444814044511404455,
  140445714044581404460)

* Uninitialized variables in C++ constructors (CID 14043271404346). In the
  case of m_maxphys, this actually led to part of the FUSE_INIT's response
  being set to stack garbage during the WriteCluster::clustering test.

* Uninitialized sun_len field in struct sockaddr_un (CID 14043301404371,
  1404429).

Reported by: Coverity
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21457

4 years agoCoverity fixes in fusefs(5)
asomers [Fri, 6 Sep 2019 19:40:11 +0000 (19:40 +0000)]
Coverity fixes in fusefs(5)

CID 1404532 fixes a signed vs unsigned comparison error in fuse_vnop_bmap.
It could potentially have resulted in VOP_BMAP reporting too many
consecutive blocks.

CID 1404364 is much worse. It was an array access by an untrusted,
user-provided variable. It could potentially have resulted in a malicious
file system crashing the kernel or worse.

Reported by: Coverity
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21466

4 years agoloader.efi: UEFI text mode background colors are only using 3 bits
tsoome [Fri, 6 Sep 2019 19:30:23 +0000 (19:30 +0000)]
loader.efi: UEFI text mode background colors are only using 3 bits

Need to mask background colors to pass allowed value.

4 years agoUse file destdir for stage_as sets
sjg [Fri, 6 Sep 2019 19:05:01 +0000 (19:05 +0000)]
Use file destdir for stage_as sets

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

Reviewed by: bdrewery
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org//D21283

4 years agorc.8: Update documentation regarding old-style rc scripts
0mp [Fri, 6 Sep 2019 18:51:41 +0000 (18:51 +0000)]
rc.8: Update documentation regarding old-style rc scripts

The EXAMPLES section does not contain any examples of output formats for
the old-style scripts. Remove the misleading bits stating otherwise.

Reviewed by: bcr, imp
Approved by: src (imp)
Differential Revision: https://reviews.freebsd.org/D21552

4 years agoFix build after r351934
cem [Fri, 6 Sep 2019 18:33:39 +0000 (18:33 +0000)]
Fix build after r351934

tcp_queue_pkts() is only used if TCPHPTS is defined (and it is not by
default).

Reported by: gcc

4 years agoThis adds in the missing counter initialization which
rrs [Fri, 6 Sep 2019 18:29:48 +0000 (18:29 +0000)]
This adds in the missing counter initialization which
I had forgotten to bring over.. opps.

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

4 years agoInitialize if_hw_tsomaxsegsize to 0 to appease gcc's flow analysis as a
imp [Fri, 6 Sep 2019 18:25:42 +0000 (18:25 +0000)]
Initialize if_hw_tsomaxsegsize to 0 to appease gcc's flow analysis as a
fail-safe.

4 years agoAdd myself as a mentor for Scott Phillip (scottph)
scottl [Fri, 6 Sep 2019 17:06:48 +0000 (17:06 +0000)]
Add myself as a mentor for Scott Phillip (scottph)

4 years agoPull in r371111 from upstream llvm trunk (by Eli Friedman):
dim [Fri, 6 Sep 2019 16:06:37 +0000 (16:06 +0000)]
Pull in r371111 from upstream llvm trunk (by Eli Friedman):

  [IfConversion] Fix diamond conversion with unanalyzable branches.

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

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

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

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

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

PR: 236567
MFC after: 3 days

4 years agoLinuxKPI: Improve sysfs support.
johalun [Fri, 6 Sep 2019 15:43:53 +0000 (15:43 +0000)]
LinuxKPI: Improve sysfs support.

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

Reviewed by: hselasky
Approved by: imp (mentor), hselasky
MFC after: 4 days
Differential Revision: D21542

4 years agoFix typo not -> nor and add 'the' because we are talking about specific flags
imp [Fri, 6 Sep 2019 15:01:47 +0000 (15:01 +0000)]
Fix typo not -> nor and add 'the' because we are talking about specific flags
and make the punctuation parallel between the three cases.

Submitted by: Yoshihiro Ota-san
Differential Revision: https://reviews.freebsd.org/D21530

4 years agoFix broken window replay check that will allow old packet to be accepted.
fabient [Fri, 6 Sep 2019 14:30:23 +0000 (14:30 +0000)]
Fix broken window replay check that will allow old packet to be accepted.
This was introduced in r309144.

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

4 years agoThis adds the final tweaks to LRO that will now allow me
rrs [Fri, 6 Sep 2019 14:25:41 +0000 (14:25 +0000)]
This adds the final tweaks to LRO that will now allow me
to add BBR. These changes make it so you can get an
array of timestamps instead of a compressed ack/data segment.
BBR uses this to aid with its delivery estimates. We also
now (via Drew's suggestions) will not go to the expense of
the tcb lookup if no stack registers to want this feature. If
HPTS is not present the feature is not present either and you
just get the compressed behavior.

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

4 years agopkgbase: r351861 didn't solve everything, we need to default to the utilities package too
manu [Fri, 6 Sep 2019 12:26:45 +0000 (12:26 +0000)]
pkgbase: r351861 didn't solve everything, we need to default to the utilities package too

4 years agoAdd embedded Managed Object Format blob access to acpi_wmi(4).
takawata [Fri, 6 Sep 2019 10:12:05 +0000 (10:12 +0000)]
Add embedded Managed Object Format blob access to acpi_wmi(4).
This blob is can be converted to human readable form by bmfdec.
(http://github.com/pali/bmfdec)

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

4 years agoufs: Remove redundant brelse() after r294954
cem [Fri, 6 Sep 2019 08:08:33 +0000 (08:08 +0000)]
ufs: Remove redundant brelse() after r294954

Same automation.

No functional change.

4 years agomsdosfs: Remove redundant brelse() after r294954
cem [Fri, 6 Sep 2019 08:08:10 +0000 (08:08 +0000)]
msdosfs: Remove redundant brelse() after r294954

Same automation.

No functional change.

4 years agocd9660: Remove redundant brelse() after r294954
cem [Fri, 6 Sep 2019 08:07:36 +0000 (08:07 +0000)]
cd9660: Remove redundant brelse() after r294954

Same automation.

No functional change.

4 years agoext2fs: Remove redundant brelse() after r294954
cem [Fri, 6 Sep 2019 08:07:12 +0000 (08:07 +0000)]
ext2fs: Remove redundant brelse() after r294954

Coccinelle:

@ rule1 @
 identifier __error;
@@
 ...
 int __error;
 ...

@ rule2 depends on rule1 @
 identifier rule1.__error;
 identifier __bp;
@@

 __error =
(
 bread
|
 bread_gb
|
 breadn
|
 breadn_flags
)
 (..., &__bp);
 if (
(
 __error
|
 __error != 0
)
 ) {
 ...
- brelse(__bp);
 ...
 }

No functional change.

4 years agopowerpc64/pmap: Fix a WITNESS error in alloc_pvo_entry()
jhibbits [Fri, 6 Sep 2019 03:02:12 +0000 (03:02 +0000)]
powerpc64/pmap: Fix a WITNESS error in alloc_pvo_entry()

We only call alloc_pvo_entry() with M_WAITOK from one location.  However,
this can be called while holding nonsleepable locks.  Rather than passing
M_WAITOK down, use vm_wait() and loop.

4 years agopowerpc64/pmap: Simplify the code path for moea64_pte_replace_native()
jhibbits [Fri, 6 Sep 2019 02:45:46 +0000 (02:45 +0000)]
powerpc64/pmap: Simplify the code path for moea64_pte_replace_native()

Summary:
MOEA64_PTE_REPLACE() is called often with the pmap lock held, and
sometimes with the page pv lock held.  The less work done while holding
a lock, the better.  Since we are intending to replace the same PTE
(same hash index), we don't need to recalculate anything, just flat
replace the PTE.  This cuts more than 200 instructions off the
invalidating code path.  In addition, we don't need to replace a PTE
that's not occupied by this PVO.

Reviewed by: luporl
Differential Revision: https://reviews.freebsd.org/D21515

4 years agoLoader: Add load offset to powerpc kernel entry point
jhibbits [Fri, 6 Sep 2019 02:28:03 +0000 (02:28 +0000)]
Loader: Add load offset to powerpc kernel entry point

Summary:
There is logic in ELF loadimage() to relocate kernels, but currently
only type ET_EXEC.  PowerPC kernels are ET_DYN, and can be relocated anywhere.
Add the load offset to kernel entry points on this platform.

Reviewed by: imp, ian
Differential Revision: https://reviews.freebsd.org/D21286

4 years agoQEMU: use default HZ
philip [Fri, 6 Sep 2019 01:22:16 +0000 (01:22 +0000)]
QEMU: use default HZ

HZ=100 by default on riscv since r351918.

4 years agoriscv: default to HZ=100
philip [Fri, 6 Sep 2019 01:19:31 +0000 (01:19 +0000)]
riscv: default to HZ=100

Most current RISC-V development platforms are not fast enough to benefit
from the increased granularity provided by HZ=1000.

Sponsored by: Axiado

4 years agoDelete the unused "nd" argument for nfsrv_proxyds().
rmacklem [Thu, 5 Sep 2019 22:25:19 +0000 (22:25 +0000)]
Delete the unused "nd" argument for nfsrv_proxyds().

The "nd" argument for nfsrv_proxyds() is no longer used by the function.
This patch deletes it. This allows a subsequent patch to delete the "nd"
argument from nfsvno_getattr(), since it's only use of "nd" was to pass it
to nfsrv_proxyds().
Getting rid of the "nd" argument from nfsvno_getattr() avoids confusion
over why it might need "nd".

This patch is trivial and does not have any semantic effect.

4 years agoloader: use teken teminal emulator for x86 and uefi
tsoome [Thu, 5 Sep 2019 22:15:50 +0000 (22:15 +0000)]
loader: use teken teminal emulator for x86 and uefi

Replace mini cons25 emulator with teken, this does enable us proper console
terminal for loader and will make it possible to implement different
back end callbacks to draw to screen.

At this time we still only "draw" in text mode.

4 years agoRemove long-dead BUF_ASSERT_{,UN}HELD assertions
cem [Thu, 5 Sep 2019 21:43:33 +0000 (21:43 +0000)]
Remove long-dead BUF_ASSERT_{,UN}HELD assertions

These were fully neutered in r177676 (2008), but not removed at the time for
unclear reasons.  They're totally dead code, so go ahead and yank them now.

No functional change.

4 years agomsdosfs: Drop an unneeded brelse in bread error condition
cem [Thu, 5 Sep 2019 21:30:52 +0000 (21:30 +0000)]
msdosfs: Drop an unneeded brelse in bread error condition

After r294954, it is an invariant that bread returns non-NULL bp if and only
if the routine succeeded.  On error, it handles any buffer cleanup
internally.  So the brelse(NULL) here was just redundant.

No functional change.

Discussed with: kib (extracted from a larger differential)

4 years agonvdimm(4): Add description of NVDIMM Namespace support
scottph [Thu, 5 Sep 2019 20:51:41 +0000 (20:51 +0000)]
nvdimm(4): Add description of NVDIMM Namespace support

Reviewed by: kib, bcr
Approved by: emaste (mentor)
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D21536

4 years agoBounds check again after advancing cp, otherwise we have a possible
cy [Thu, 5 Sep 2019 19:35:30 +0000 (19:35 +0000)]
Bounds check again after advancing cp, otherwise we have a possible
heap buffer overflow. This was discovered by a Google fuzzer test.
This can lead to remote denial of service. User interaction and
execution privileges are not a prerequisite for exploitation.

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

4 years agoUse a single write of 3 bytes instead of iicdev_writeto() in ads111x.
ian [Thu, 5 Sep 2019 19:17:53 +0000 (19:17 +0000)]
Use a single write of 3 bytes instead of iicdev_writeto() in ads111x.

The iicdev_writeto() function basically does scatter-gather IO by filling
in a pair of iic_msg structs to write the register address then the data
from different locations but with a single bus START/xfer/STOP sequence.
It turns out several low-level i2c controller drivers do not honor the
IIC_NOSTART flag, so the second piece of the write gets a new START on
the bus, and that confuses the ads111x chips which expect a continuous
write of 3 bytes to set a register.

A proper fix for this is to track down all the misbehaving controllers
drivers and fix them.  For now this change makes this driver work again.

4 years agopkgbase: Add the pkg trusted keys to the FreeBSD-utilities package
manu [Thu, 5 Sep 2019 19:17:17 +0000 (19:17 +0000)]
pkgbase: Add the pkg trusted keys to the FreeBSD-utilities package

4 years agoEnsure a measurement is complete before reading the result in ads111x.
ian [Thu, 5 Sep 2019 19:07:48 +0000 (19:07 +0000)]
Ensure a measurement is complete before reading the result in ads111x.
Also, disable the comparator by default; it's not used for anything.

The previous logic would start a measurement, and then pause_sbt() for the
averaging time currently configured in the chip.  After waiting that long,
the code would blindly read the measurement register and return its value.
The problem is that the chip's idea of averaging time is based on its
internal free-running 1MHz oscillator, which may be running at a wildly
different rate than the kernel clock.  If the chip's internal timer was
running slower than the kernel clock, we'd end up grabbing a stale result
from an old measurement.

The driver now still uses pause_sbt() to yield the cpu while waiting for
the measurement to complete, but after sleeping it checks the chip's status
register to ensure the measurement engine is idle.  If it's not, the driver
uses a retry loop to wait a bit (5% of the original wait time) then check
again for completion.

4 years agoSet required program for all acl tests
kp [Thu, 5 Sep 2019 18:54:46 +0000 (18:54 +0000)]
Set required program for all acl tests

r339782 re-enabled acl test 00 and 02, which were disabled in r336617
due to PR 229930.
When the tests were disabled the code to set their required programs was
disabled as well, but this was not reinstated when r339782 re-enabled
them.
Do so now.

Sponsored by: Axiado

4 years agovfs: temporarily revert r351825
mjg [Thu, 5 Sep 2019 18:19:51 +0000 (18:19 +0000)]
vfs: temporarily revert r351825

There are 2 problems:
- it introduces a funny bug where it can end up trylocking the same vnode [1]
- it exposes a pre-existing softdep deadlock [2]

Both are easier to run into that the bug which got fixed, so revert until
a complete solution is worked out.

Reported by: cy [1], pho [2]
Sponsored by: The FreeBSD Foundation

4 years agoAdjust teken to allow build as part of loader
tsoome [Thu, 5 Sep 2019 18:07:40 +0000 (18:07 +0000)]
Adjust teken to allow build as part of loader

Building for loader needs specific headers.

4 years agoAdd dwgpio to NOTES so it gets built in LINT kernels.
br [Thu, 5 Sep 2019 17:54:57 +0000 (17:54 +0000)]
Add dwgpio to NOTES so it gets built in LINT kernels.

Sponsored by: DARPA, AFRL

4 years agoBump up the low range of cpuset numbers to account for the kernel cpuset.
stevek [Thu, 5 Sep 2019 17:48:39 +0000 (17:48 +0000)]
Bump up the low range of cpuset numbers to account for the kernel cpuset.

Reviewed by: jeff
Obtained from: Juniper Networks, Inc.

4 years ago[lib80211] add initial VHT (11ac) channel ranges for FCC.
adrian [Thu, 5 Sep 2019 15:55:24 +0000 (15:55 +0000)]
[lib80211] add initial VHT (11ac) channel ranges for FCC.

This is a simple set of VHT channels and flags for the FCC (US) regulatory
domain.  This needs to be researched and done for the rest of the
regulatory domains, but this should at least unblock some more ath10k
testing.

4 years agopcie: return an error if a matching resource is not found
emaste [Thu, 5 Sep 2019 15:45:21 +0000 (15:45 +0000)]
pcie: return an error if a matching resource is not found

Submitted by: markj
Reviewed by: manu
Event: vBSDCon FreeBSD hackathon
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20884

4 years agopatch(1): fix the file removal test, strengthen it a bit
kevans [Thu, 5 Sep 2019 15:35:57 +0000 (15:35 +0000)]
patch(1): fix the file removal test, strengthen it a bit

To remain compatible with GNU patch, we should ensure that once we're
removing empty files after a reversed /dev/null patch we don't remove files
that have been modified. GNU patch leaves these intact and just reverses the
hunk that created the file, effectively implying --remove-empty-files for
reversed /dev/null patches.

4 years agoficl: add xemit word
tsoome [Thu, 5 Sep 2019 15:06:30 +0000 (15:06 +0000)]
ficl: add xemit word

While emit will output one byte on screen, the xemit will output xchar.

See: http://forth-standard.org/standard/xchar/XEMIT

4 years agorc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd)
0mp [Thu, 5 Sep 2019 14:52:22 +0000 (14:52 +0000)]
rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd)

A user may set ${name}_env variable in rc.conf(5) in order to set additional
environment variables for a service command.  Unfortunately, at the moment
this variable is only honored when the command is specified via the command
variable. Those additional environment variables coming from ${name}_env
are never set if the service is started via the ${rc_arg}_cmd variable (for
example start_cmd).

PR: 239692
Reviewed by: bcr, jilles
Approved by: src (jilles)
Differential Revision: https://reviews.freebsd.org/D21228

4 years agopkgbase: pfctl: tests: Put tests files in the FreeBSD-tests package
manu [Thu, 5 Sep 2019 14:19:06 +0000 (14:19 +0000)]
pkgbase: pfctl: tests: Put tests files in the FreeBSD-tests package

Reviewed by: kp, gjb
Differential Revision: https://reviews.freebsd.org/D21521

4 years agopkgbase: Handle FILES when no FILESGROUP isn't used
manu [Thu, 5 Sep 2019 14:18:13 +0000 (14:18 +0000)]
pkgbase: Handle FILES when no FILESGROUP isn't used

bsd.files.mk only add the TAG when groups are used, fix this.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D21520

4 years agopkgbase: Add tag for LIBSYMLINK case
manu [Thu, 5 Sep 2019 14:17:28 +0000 (14:17 +0000)]
pkgbase: Add tag for LIBSYMLINK case

Otherwised the files aren't packaged.

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21508

4 years agopkgbase: Add tags for includes in bsd.incs.mk
manu [Thu, 5 Sep 2019 14:16:39 +0000 (14:16 +0000)]
pkgbase: Add tags for includes in bsd.incs.mk

Otherwise the files aren't packaged.

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21507

4 years agopkgbase: Create a FreeBSD-utilities package and make it the default one
manu [Thu, 5 Sep 2019 14:15:47 +0000 (14:15 +0000)]
pkgbase: Create a FreeBSD-utilities package and make it the default one

The default package use to be FreeBSD-runtime but it should only contain
binaries and libs enough to boot to single user and repair the system, it
is also very handy to have a package that can be tranform to a small mfsroot.
So create a new package named FreeBSD-utilities and make it the default one.
Also move a few binaries and lib into this package when it make sense.
Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21506

4 years agopkgbase: Add TAG for evdev and veriexec headers
manu [Thu, 5 Sep 2019 14:14:47 +0000 (14:14 +0000)]
pkgbase: Add TAG for evdev and veriexec headers

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D21505

4 years agopkgbase: Put the sys/common test into the tests package
manu [Thu, 5 Sep 2019 14:14:07 +0000 (14:14 +0000)]
pkgbase: Put the sys/common test into the tests package

Every other test is there so do the same for those.

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21504

4 years agopkgbase: Put a lot of binaries and lib in FreeBSD-runtime
manu [Thu, 5 Sep 2019 14:13:08 +0000 (14:13 +0000)]
pkgbase: Put a lot of binaries and lib in FreeBSD-runtime

All of them are needed to be able to boot to single user and be able
to repair a existing FreeBSD installation so put them directly into
FreeBSD-runtime.

Reviewed by:    bapt, gjb
Differential Revision:  https://reviews.freebsd.org/D21503

4 years agopkgbase: Put libbluetooth in the bluetooth package
manu [Thu, 5 Sep 2019 14:11:16 +0000 (14:11 +0000)]
pkgbase: Put libbluetooth in the bluetooth package

It make sense to have everything bluetooth related in the same package.
Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21502

4 years agopkgbase: Move libcap_ to FreeBSD-runtime
manu [Thu, 5 Sep 2019 14:10:26 +0000 (14:10 +0000)]
pkgbase: Move libcap_ to FreeBSD-runtime

A lot of binaries present in FreeBSD-runtime depend on it so move
the libs there.

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21501

4 years agopkgbase: Tag passwd related file to be in FreeBSD-runtime package.
manu [Thu, 5 Sep 2019 14:09:33 +0000 (14:09 +0000)]
pkgbase: Tag passwd related file to be in FreeBSD-runtime package.

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21500

4 years agopkgbase: Move rc scripts and related files to their own packages
manu [Thu, 5 Sep 2019 14:08:45 +0000 (14:08 +0000)]
pkgbase: Move rc scripts and related files to their own packages

It doesn't need to be in runtime and might help people who want to
experiment with other rc system or don't use one (like in small
embedded mfsroot).

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21499

4 years agopkgbase: Force zfs(8) and zpool(8) to be in the runtime package
manu [Thu, 5 Sep 2019 14:07:49 +0000 (14:07 +0000)]
pkgbase: Force zfs(8) and zpool(8) to be in the runtime package

Those commands are needed to repair a FreeBSD installation so add them
to the runtime package

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21498

4 years agopkgbase: lib80211 is needed by ifconfig(8) so put it in FreeBSD-runtime
manu [Thu, 5 Sep 2019 14:06:48 +0000 (14:06 +0000)]
pkgbase: lib80211 is needed by ifconfig(8) so put it in FreeBSD-runtime

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21497

4 years agopkgbase: Move the bootloader related files to a new FreeBSD-bootloader package
manu [Thu, 5 Sep 2019 14:06:01 +0000 (14:06 +0000)]
pkgbase: Move the bootloader related files to a new FreeBSD-bootloader package

Bootloader file isn't needed for jails so don't include it in FreeBSD-runtime.

Reviewed by: bapt, delphij, gjb
Differential Revision: https://reviews.freebsd.org/D21496

4 years agoDecrease the default audio playback latency to a maximum of 21.3ms.
hselasky [Thu, 5 Sep 2019 10:49:12 +0000 (10:49 +0000)]
Decrease the default audio playback latency to a maximum of 21.3ms.
This significantly improves the audio playback response time.

Discussed with: mav@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoficl: add uIsGreater word
tsoome [Thu, 5 Sep 2019 09:04:48 +0000 (09:04 +0000)]
ficl: add uIsGreater word

For some reason we have u< but not u>, fix it.

4 years agopatch(1): add some basic tests
kevans [Thu, 5 Sep 2019 03:16:14 +0000 (03:16 +0000)]
patch(1): add some basic tests

Summary:
- basic: test application of patches created by diff -u at the
  beginning/middle/end of file, which have differing amounts of context
  before and after chunks being added
- limited_ctx: stems from PR 74127 in which a rogue line was getting added
  when the patch should have been rejected. Similar behavior was
  reproducible with larger contexts near the beginning/end of a file. See
  r326084 for details
- file_creation: patch sourced from /dev/null should create the file
- file_nodupe: said patch sourced from /dev/null shouldn't dupe the contents
  when re-applied (personal vendetta, WIP, see comment)
- file_removal: this follows from nodupe; the reverse of a patch sourced
  from /dev/null is most naturally deleting the file, as is expected based
  on GNU patch behavior (WIP)

4 years agosys/mount.h: Comment on distinction between vfs_{c,}mount
cem [Thu, 5 Sep 2019 00:56:37 +0000 (00:56 +0000)]
sys/mount.h: Comment on distinction between vfs_{c,}mount

Hope to save someone else a little future effort in ugly duplicated code.

No functional change.

4 years agoDelete the unused "nd" argument for nfsrv_checkdsattr().
rmacklem [Wed, 4 Sep 2019 22:37:28 +0000 (22:37 +0000)]
Delete the unused "nd" argument for nfsrv_checkdsattr().

The "nd" argument for nfsrv_checkdsattr() is no longer used by the function.
This patch deletes it. This allows subsequent patches to delete the "nd"
argument from nfsrv_proxyds(), since it's only use of "nd" was to pass it
to nfsrv_checkdsattr(). The same will then be true for nfsvno_getattr(),
which passes "nd" to nfsrv_proxyds().
Getting rid of the "nd" argument from nfsvno_getattr() avoids confusion
over why it might need "nd".

This patch is trivial and does not have any semantic effect.
Found by inspection while working on the NFSv4.2 server.

4 years agoThe efifat files are no longer used: remove the code to build them
bcran [Wed, 4 Sep 2019 20:55:48 +0000 (20:55 +0000)]
The efifat files are no longer used: remove the code to build them

Reviewed by: imp, tsoome, emaste
Differential Revision: https://reviews.freebsd.org/D20562

4 years agomadvise(MADV_FREE): Quick fix to time rewind.
kib [Wed, 4 Sep 2019 20:28:16 +0000 (20:28 +0000)]
madvise(MADV_FREE): Quick fix to time rewind.

Don't free pages in a shadowing object.  While this degrades MADV_FREE
to a no-op (and we could, instead, choose to fall back to
MADV_DONTNEED, at the cost of changing pmap_madvise), this is
presently considered a temporary fix. We may prefer to risk a little
fragmentation of the map by creating a zero/OBJT_DEFAULT entry over
top of the existing object and, simultaneously, revert to the existing
marking any pages in the former shadowing object in the advised region
as reclaimable.  At least one consumer of MADV_FREE (snmalloc) may use
mmap() to construct zeroed pages "eventually" here anyway, so the
fragmentation may be coming anyway.

Submitted by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
PR: 240061
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21517

4 years agoSupport doorbell strides != 0.
imp [Wed, 4 Sep 2019 20:08:36 +0000 (20:08 +0000)]
Support doorbell strides != 0.

The NVMe standard (1.4) states

>>> 8.6 Doorbell Stride for Software Emulation
>>> The doorbell stride,...is useful in software emulation of an NVM
>>> Express controller. ...  For hardware implementations of the NVM
>>> Express interface, the expected doorbell stride value is 0h.

However, hardware in the wild exists with a doorbell stride of 1
(meaning 8 byte separation). This change supports that hardware, as
well as software emulators as envisioned in Section 8.6. Since this is
the fast path, care has been taken to make this computation
efficient. The bit of math to compute an offset for each is replaced
by a memory load from cache of a pre-computed value.

MFC After: 3 days
Reviewed by: scottl@
Differential Revision: https://reviews.freebsd.org/D21514

4 years agovfs: fully hold vnodes in vnlru_free_locked
mjg [Wed, 4 Sep 2019 19:23:18 +0000 (19:23 +0000)]
vfs: fully hold vnodes in vnlru_free_locked

Currently the code only bumps holdcnt and clears the VI_FREE flag, not
performing actual vhold. Since the vnode is still visible elsewhere, a
potential new user can find it and incorrectly assume it is properly held.

Use vholdl instead to correctly hold the vnode. Another place recycling
(vlrureclaim) does this already.

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

4 years agoReport the Host Buffer Memory minimum and preferred sizes.
imp [Wed, 4 Sep 2019 19:19:23 +0000 (19:19 +0000)]
Report the Host Buffer Memory minimum and preferred sizes.

The Host Buffer feature (NVMe 1.4 section 89) allows for the NVMe card
request the host provide it buffer for lookaside tables and maybe
other things. Report the card's minimum and preferred sizes with
nvmecontrol/camcontrol identify.

4 years agoPROGS: Build common sources before recursed PROGS_TARGETS as well when building.
bdrewery [Wed, 4 Sep 2019 18:32:11 +0000 (18:32 +0000)]
PROGS: Build common sources before recursed PROGS_TARGETS as well when building.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoFix /proc/mounts for autofs(5) mounts.
trasz [Wed, 4 Sep 2019 18:00:54 +0000 (18:00 +0000)]
Fix /proc/mounts for autofs(5) mounts.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoImprove debugging output.
trasz [Wed, 4 Sep 2019 18:00:03 +0000 (18:00 +0000)]
Improve debugging output.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years ago- correct HISTORY section
jgh [Wed, 4 Sep 2019 17:52:30 +0000 (17:52 +0000)]
- correct HISTORY section
- while here clarify wording

PR: 240260 (based on)
Submitted by: gbergling@gmail.com
MFC after: after 1 week

4 years agoprocstat/tests: Fix flakiness by waiting for program to start
jilles [Wed, 4 Sep 2019 16:25:41 +0000 (16:25 +0000)]
procstat/tests: Fix flakiness by waiting for program to start

Some of the procstat tests start a program "while1" and examine the process
using procstat, but did not wait properly for it to start (kill -0 will
succeed immediately after the child process has been created).

Instead, have "while1" write something when it starts, and use a fifo to
wait for that.

PR: 233587, 233588
Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21519

4 years agoInclude dwgpio to the build.
br [Wed, 4 Sep 2019 15:55:44 +0000 (15:55 +0000)]
Include dwgpio to the build.

Sponsored by: DARPA, AFRL

4 years agoo Add support for multi-port instances of Synopsys DesignWare APB GPIO
br [Wed, 4 Sep 2019 15:37:24 +0000 (15:37 +0000)]
o Add support for multi-port instances of Synopsys DesignWare APB GPIO
  Controller.
o Rename the driver to dwgpio.

Sponsored by: DARPA, AFRL

4 years agoBack out r351799
kevans [Wed, 4 Sep 2019 14:32:04 +0000 (14:32 +0000)]
Back out r351799

empty does not appear to work like I thought it did and it actively breaks
real LOCAL_MODULES usage, of which I have none at the moment...

4 years agopseudofs: make readdir work without a pid again
kevans [Wed, 4 Sep 2019 14:20:39 +0000 (14:20 +0000)]
pseudofs: make readdir work without a pid again

Specifically, the following was broken:

$ mount -t procfs procfs /proc
$ ls -l /proc

r351741 reworked readdir slightly to avoid pfs_node/pidhash LOR, but
inadvertently regressed pid == NO_PID; new pfs_lookup_proc() fails for the
obvious reasons, and later pfs_visible_proc doesn't capture the
pid == NO_PID -> return 1 aspect of pfs_visible. We can infact skip this
whole block if we're operating on a directory w/ NO_PID, as it's always
visible.

Reported by: trasz
Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D21518