]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoloader: zfs_alloc and zfs_free should use panic
tsoome [Wed, 29 May 2019 07:24:10 +0000 (07:24 +0000)]
loader: zfs_alloc and zfs_free should use panic

The zfs alloc and free code print out the error and get stuck in infinite loop; use panic() instead.

4 years agoThe KVM code also needs a fix similar to r344269.
glebius [Wed, 29 May 2019 03:14:46 +0000 (03:14 +0000)]
The KVM code also needs a fix similar to r344269.

Reported by: pho

4 years agoUpdate __FreeBSD_version and Makefile check for r348347
jhibbits [Wed, 29 May 2019 02:26:15 +0000 (02:26 +0000)]
Update __FreeBSD_version and Makefile check for r348347

libdwarf needs forcibly rebuilt after r348347.

4 years agotypo: suppported.
pfg [Wed, 29 May 2019 02:08:23 +0000 (02:08 +0000)]
typo: suppported.

4 years agoAdd missing powerpc64 relocation support to libdwarf
jhibbits [Wed, 29 May 2019 02:02:56 +0000 (02:02 +0000)]
Add missing powerpc64 relocation support to libdwarf

Summary:
Due to missing relocation support in libdwarf for powerpc64, handling of dwarf
info on unlinked objects was bogus.

Examining raw dwarf data on objects compiled on ppc64 with a modern compiler
(in-tree gcc tends to hide the issue, since it only rarely generates relocations
in .debug_info and uses DW_FORM_str instead of DW_FORM_strp for everything), you
will find that the dwarf data appears corrupt, with repeated references to the
compiler version where things like types and function names should appear.

This happens because the 0 offset of .debug_str contains the compiler version,
and without applying the relocations, *all* indirect strings in .dwarf_info will
end up pointing to it.

This corruption then propogates to the CTF data, as ctfconvert relies on
libdwarf to read the dwarf info, for every compiled object (when building a
kernel.)

However, if you examine the dwarf data on a compiled executable, it will appear
correct, because during final link the relocations get applied and baked in by
the linker.

Submitted by: Brandon Bergren
Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D20367

4 years agoif_bridge(4): Complete bpf auditing of local traffic over the bridge
kevans [Wed, 29 May 2019 01:08:30 +0000 (01:08 +0000)]
if_bridge(4): Complete bpf auditing of local traffic over the bridge

There were two remaining "gaps" in auditing local bridge traffic with
bpf(4):

Locally originated outbound traffic from a member interface is invisible to
the bridge's bpf(4) interface. Inbound traffic locally destined to a member
interface is invisible to the member's bpf(4) interface -- this traffic has
no chance after bridge_input to otherwise pass it over, and it wasn't
originally received on this interface.

I call these "gaps" because they don't affect conventional bridge setups.
Alas, being able to establish an audit trail of all locally destined traffic
for setups that can function like this is useful in some scenarios.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19757

4 years agoMerge OpenSSL 1.1.1c.
jkim [Tue, 28 May 2019 21:54:12 +0000 (21:54 +0000)]
Merge OpenSSL 1.1.1c.

4 years agopseudofs: Ignore unsupported commands in vop_setattr.
johalun [Tue, 28 May 2019 20:54:59 +0000 (20:54 +0000)]
pseudofs: Ignore unsupported commands in vop_setattr.

Users of pseudofs (e.g. lindebugfs), should be able to receive
input from command line via commands like "echo 1 > /path/to/file".
Currently this fails because sh tries to truncate the file first and
vop_setattr returns not supported error for this. This patch simply
ignores the error and returns 0 instead.

Reviewed by: imp (mentor), asomers
Approved by: imp (mentor), asomers
MFC after: 1 week
Differential Revision: D20451

4 years agostyle.9: Correct usage's definition to match its declaration
cem [Tue, 28 May 2019 20:44:23 +0000 (20:44 +0000)]
style.9: Correct usage's definition to match its declaration

Suggested by: emaste
Reviewed by: delphij, imp, rgrimes, vangyzen (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: (part of D20448)

4 years agoFix array out of bound panic introduced in r306219.
mav [Tue, 28 May 2019 18:32:04 +0000 (18:32 +0000)]
Fix array out of bound panic introduced in r306219.

As I see, different NICs in different configurations may have different
numbers of TX and RX queues.  The code was assuming 1:1 mapping between
event queues (interrupts) and TX/RX queues.  Since number of interrupts
is set to maximum of TX and RX queues, when those two are different, the
system is doomed.

I have no documentation or deep knowledge about this hardware, so this
change is based on general observations and code reading.  If some of my
guesses are wrong, please do better.  I just confirmed HP NC550SFP NICs
are working now.

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

4 years ago[ath_hal] Fix queue bits a bit
adrian [Tue, 28 May 2019 18:05:10 +0000 (18:05 +0000)]
[ath_hal] Fix queue bits a bit

Found by PVS Studio: duplicate assignment; add assignment of tqi_compBuf.

Submitted by: <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D20431

4 years agoAdd a missing bresle() in seldom-used error return.
mckusick [Tue, 28 May 2019 17:31:35 +0000 (17:31 +0000)]
Add a missing bresle() in seldom-used error return.

4 years agoConvert use of UFS-specific #ifdef DEBUG to DIAGNOSTIC or INVARIANTS
mckusick [Tue, 28 May 2019 16:32:04 +0000 (16:32 +0000)]
Convert use of UFS-specific #ifdef DEBUG to DIAGNOSTIC or INVARIANTS
as appropriate. No functional change intended.

Suggested-by: markj
4 years agobectl(8): Address Coverity complaints
kevans [Tue, 28 May 2019 16:12:16 +0000 (16:12 +0000)]
bectl(8): Address Coverity complaints

CID 1400451: case 0 is missing a break/return and falling through to the
default case.  waitpid(0, ...) makes little sense in the child, we likely
wanted to terminate immediately.

CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *)
and is assigned to a char **; sizeof's match but "this isn't a portable
assumption".

CID: 14004511400453
MFC after: 3 days

4 years agoImplement the ffs and fls functions, and their longer counterparts, in
dougm [Tue, 28 May 2019 15:47:00 +0000 (15:47 +0000)]
Implement the ffs and fls functions, and their longer counterparts, in
cpufunc, in terms of __builtin_ffs and the like, for arm32 v6 and v7
architectures, and use those, rather than the simple libkern
implementations, in building arm32 kernels.

Reviewed by: manu
Approved by: kib, markj (mentors)
Tested by: iz-rpi03_hs-karlsruhe.de, mikael.urankar_gmail.com, ian
Differential Revision: https://reviews.freebsd.org/D20412

4 years agoRework r348303 to reduce the time of holding global BPF lock.
ae [Tue, 28 May 2019 11:45:00 +0000 (11:45 +0000)]
Rework r348303 to reduce the time of holding global BPF lock.

It appeared that using NET_EPOCH_WAIT() while holding global BPF lock
can lead to another panic:

spin lock 0xfffff800183c9840 (turnstile lock) held by 0xfffff80018e2c5a0 (tid 100325) too long
panic: spin lock held too long
...
#0  sched_switch (td=0xfffff80018e2c5a0, newtd=0xfffff8000389e000, flags=<optimized out>) at /usr/src/sys/kern/sched_ule.c:2133
#1  0xffffffff80bf9912 in mi_switch (flags=256, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:439
#2  0xffffffff80c21db7 in sched_bind (td=<optimized out>, cpu=<optimized out>) at /usr/src/sys/kern/sched_ule.c:2704
#3  0xffffffff80c34c33 in epoch_block_handler_preempt (global=<optimized out>, cr=0xfffffe00005a1a00, arg=<optimized out>)
    at /usr/src/sys/kern/subr_epoch.c:394
#4  0xffffffff803c741b in epoch_block (global=<optimized out>, cr=<optimized out>, cb=<optimized out>, ct=<optimized out>)
    at /usr/src/sys/contrib/ck/src/ck_epoch.c:416
#5  ck_epoch_synchronize_wait (global=0xfffff8000380cd80, cb=<optimized out>, ct=<optimized out>) at /usr/src/sys/contrib/ck/src/ck_epoch.c:465
#6  0xffffffff80c3475e in epoch_wait_preempt (epoch=0xfffff8000380cd80) at /usr/src/sys/kern/subr_epoch.c:513
#7  0xffffffff80ce970b in bpf_detachd_locked (d=0xfffff801d309cc00, detached_ifp=<optimized out>) at /usr/src/sys/net/bpf.c:856
#8  0xffffffff80ced166 in bpf_detachd (d=<optimized out>) at /usr/src/sys/net/bpf.c:836
#9  bpf_dtor (data=0xfffff801d309cc00) at /usr/src/sys/net/bpf.c:914

To fix this add the check to the catchpacket() that BPF descriptor was
not detached just before we acquired BPFD_LOCK().

Reported by: slavash
Tested by: slavash
MFC after: 1 week

4 years agoThe alignment is passed into contigmalloc_domainset in the 7th argument.
andrew [Tue, 28 May 2019 10:55:59 +0000 (10:55 +0000)]
The alignment is passed into contigmalloc_domainset in the 7th argument.

KUBSAN was complaining the pointer contigmalloc_domainset returned was
misaligned. Fix this by using the correct argument to find the alignment
in the function signature.

Reported by: KUBSAN
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

4 years agoTeach the kernel KUBSAN runtime about alignment_assumption
andrew [Tue, 28 May 2019 09:12:15 +0000 (09:12 +0000)]
Teach the kernel KUBSAN runtime about alignment_assumption

This checks the alignment of a given pointer is sufficient for the
requested alignment asked for. This fixes the build with a recent
llvm/clang.

Sponsored by: DARPA, AFRL

4 years agoContuation of r343701, removal of irrelevant #ifdefs.
cy [Tue, 28 May 2019 01:41:08 +0000 (01:41 +0000)]
Contuation of r343701, removal of irrelevant #ifdefs.

MFC after: 1 week

4 years agoReduce the code size and number of ffsl calls in vm_reserv_break. Use
dougm [Tue, 28 May 2019 00:51:23 +0000 (00:51 +0000)]
Reduce the code size and number of ffsl calls in vm_reserv_break. Use
xor to find where free ranges begin and end.

Tested by: pho
Reviewed by:alc
Approved by:markj, kib (mentors)
Differential Revision: https://reviews.freebsd.org/D20256

4 years agoVOP_ADVLOCK.9: fix description of flags
asomers [Mon, 27 May 2019 23:25:19 +0000 (23:25 +0000)]
VOP_ADVLOCK.9: fix description of flags

* F_RDLCK, F_UNLCK, and F_WRLCK aren't flags.  They're stored in the
  fl.l_type field.
* Add F_REMOTE, added in r177633
* Add F_NOINTR, added in r180025

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agostyle(9)
cy [Mon, 27 May 2019 20:22:54 +0000 (20:22 +0000)]
style(9)

MFC after: 1 week

4 years agoFix indentation and while at it simplfy the code.
cy [Mon, 27 May 2019 20:22:51 +0000 (20:22 +0000)]
Fix indentation and while at it simplfy the code.

Reported by: lwhsu@
MFC after: 1 week

4 years agoRemove compile-time tests for unsupported versions of FreeBSD.
cy [Mon, 27 May 2019 20:22:48 +0000 (20:22 +0000)]
Remove compile-time tests for unsupported versions of FreeBSD.

MFC after: 1 week

4 years agokldxref(8): Sort MDT_MODULE info first in linker.hints output
cem [Mon, 27 May 2019 17:33:20 +0000 (17:33 +0000)]
kldxref(8): Sort MDT_MODULE info first in linker.hints output

MDT_MODULE info is required to be ordered before any other MDT metadata for
a given kld because it serves as an implicit record boundary between
distinct klds for linker.hints consumers.  kldxref(8) has previously relied
on the assumption that MDT_MODULE was ordered relative to other module
metadata in kld objects by source code ordering.

However, C does not require implementations to emit file scope objects in
any particular order, and it seems that GCC 6.4.0 and/or binutils 2.32 ld
may reorder emitted objects with respect to source code ordering.

So: just take two passes over a given .ko's module metadata, scanning for
the MDT_MODULE on the first pass and the other metadata on subsequent
passes.  It's not super expensive and not exactly a performance-critical
piece of code.  This ensures MDT_MODULE is always ordered before
MDT_PNP_INFO and other MDTs, regardless of compiler/linker movement.  As a
fringe benefit, it removes the requirement that care be taken to always
order MODULE_PNP_INFO after DRIVER_MODULE in source code.

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

4 years agoCorrect some inconsistencies in the earliest created kernel page
kib [Mon, 27 May 2019 15:21:26 +0000 (15:21 +0000)]
Correct some inconsistencies in the earliest created kernel page
tables which affect demotion.

The last last-level page table under 2M mappings below KERNend was
only partially initialized.  When that page was used as the hardware
page table for demotion of the 2M mapping, the result was not
consistent.  Since pmap_demote_pde() is switched to use PG_PROMOTED as
the test for the validity of the saved last level page table page, we
can keep page table pages zero-initialized instead.  Demotion would
fill them as needed.

Only map the created page tables beyond KERNend, there is no need to
pre-promote PTmap after KERNend, because the extra mapping is not used.

Only round up *firstaddr to 2M boundary when it is below rounded
KERNend.  Sometimes the allocpages() calls advance *firstaddr past the
end of the last 2MB page mapping. In that case, this conditional
avoids wasting an average of 1MB of physical memory.

Update comments to explain action in more clean and direct language.

Reported and tested by: pho
In collaboration with: alc
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20380

4 years agoFix possible NULL pointer dereference.
ae [Mon, 27 May 2019 12:41:41 +0000 (12:41 +0000)]
Fix possible NULL pointer dereference.

bpf_mtap() can invoke catchpacket() for already detached descriptor.
And this can lead to NULL pointer dereference, since bd_bif pointer
was reset to NULL in bpf_detachd_locked(). To avoid this, use
NET_EPOCH_WAIT() when descriptor is removed from interface's descriptors
list. After the wait it is safe to modify descriptor's content.

Submitted by: kib
Reported by: slavash
MFC after: 1 week

4 years agoChase r261913: hardcoded default crypt(3) algorithm is SHA-512 when DES
delphij [Mon, 27 May 2019 06:37:23 +0000 (06:37 +0000)]
Chase r261913: hardcoded default crypt(3) algorithm is SHA-512 when DES
is not available.

Submitted by: Ali Mashtizadeh <ali mashtizadeh.com>
MFC after: 3 days

4 years agoRemove unused token that was added in r348235.
ae [Mon, 27 May 2019 06:34:36 +0000 (06:34 +0000)]
Remove unused token that was added in r348235.

MFC after: 2 weeks

4 years agoAdd function name and line number debugging information to softupdates
mckusick [Mon, 27 May 2019 06:22:43 +0000 (06:22 +0000)]
Add function name and line number debugging information to softupdates
worklist structures to help track their movement between work lists.
No functional change to the operation of soft updates intended.

4 years agokern/CTF: link_elf_ctf_get() on big endian platforms
jhibbits [Mon, 27 May 2019 04:20:31 +0000 (04:20 +0000)]
kern/CTF: link_elf_ctf_get() on big endian platforms

Check the CTF magic number in big endian platforms.  This lets DTrace FBT
handle types correctly on these platforms.

Submitted by: Brandon Bergren
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20413

4 years agopowerpc/dtrace: Fix fbt function probing for ELFv2
jhibbits [Mon, 27 May 2019 03:18:56 +0000 (03:18 +0000)]
powerpc/dtrace: Fix fbt function probing for ELFv2

'.' function names exist only in ELFv1.  ELFv2 does away with function
descriptors, and look more like they do on powerpc(32) and most other
platforms, as direct function pointers.  Stop blacklisting regular function
names in ELFv2.

Submitted by: Brandon Bergren
Differential Revision: https://reviews.freebsd.org/D20346

4 years agovirtio_random(4): Remove unneeded reference to device
cem [Mon, 27 May 2019 00:55:46 +0000 (00:55 +0000)]
virtio_random(4): Remove unneeded reference to device

The device_t always references the softc, so we can pass the device and
obtain the softc instead of the other way around.

4 years agovirtio.4: Add missing devices and Xr
cem [Mon, 27 May 2019 00:51:27 +0000 (00:51 +0000)]
virtio.4: Add missing devices and Xr

This page could probably use further improvement.

4 years agoaesni(4): Fix trivial type typo
cem [Mon, 27 May 2019 00:47:51 +0000 (00:47 +0000)]
aesni(4): Fix trivial type typo

This fixes the kernel build with xtoolchain-gcc (6.4.0).

X-MFC-With: r348268

4 years agosys/bufobj.h: Avoid using C++ reserved keyword 'private'
cem [Mon, 27 May 2019 00:43:43 +0000 (00:43 +0000)]
sys/bufobj.h: Avoid using C++ reserved keyword 'private'

No functional change (except for out-of-tree C++ kmods).

4 years agoarm64 nexus: remove incorrect warning
jchandra [Sun, 26 May 2019 23:04:21 +0000 (23:04 +0000)]
arm64 nexus: remove incorrect warning

acpi_config_intr() will be called when an arm64 system booted with ACPI.
We do the interrupt mapping for ACPI interrupts in nexus_acpi_map_intr()
on arm64, so acpi_config_intr() has to just return success without
printing this error message.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D19432

4 years agoWhen an ACK segment as the third message of the three way handshake is
tuexen [Sun, 26 May 2019 17:18:14 +0000 (17:18 +0000)]
When an ACK segment as the third message of the three way handshake is
received and support for time stamps was negotiated in the SYN/SYNACK
exchange, perform the PAWS check and only expand the syn cache entry if
the check is passed.
Without this check, endpoints may get stuck on the incomplete queue.

Reviewed by: jtl@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D20374

4 years agoPull in r361696 from upstream llvm trunk (by Sanjay Patel):
dim [Sun, 26 May 2019 15:44:58 +0000 (15:44 +0000)]
Pull in r361696 from upstream llvm trunk (by Sanjay Patel):

  [SelectionDAG] soften assertion when legalizing narrow vector FP ops

  The test based on PR42010:
  https://bugs.llvm.org/show_bug.cgi?id=42010

  ...may show an inaccuracy for PPC's target defs, but we should not be
  so aggressive with an assert here. There's no telling what
  out-of-tree targets look like.

This fixes an assertion when building the graphics/mesa-dri port for
PowerPC64.

Reported by: Mark Millard <marklmi26-fbsd@yahoo.com>
PR: 238082
MFC after: 3 days

4 years agoipheth.4: Explain how to manually configure USB tethering on Apple devices
0mp [Sun, 26 May 2019 14:15:54 +0000 (14:15 +0000)]
ipheth.4: Explain how to manually configure USB tethering on Apple devices

Reviewed by: danfe, hselasky
Approved by: src (hselasky)
Differential Revision: https://reviews.freebsd.org/D20353

4 years agoFix two errors reported by PVS Studio: V646 Consider inspecting the
danfe [Sun, 26 May 2019 12:41:03 +0000 (12:41 +0000)]
Fix two errors reported by PVS Studio: V646 Consider inspecting the
application's logic.  It's possible that 'else' keyword is missing.

Reviewed by: gallatin, np, pfg
Approved by: pfg
Differential Revision: https://reviews.freebsd.org/D20396

5 years agoRemove an uneeded indentation introduced in r223637 to silence gcc warnging
lwhsu [Sat, 25 May 2019 23:58:09 +0000 (23:58 +0000)]
Remove an uneeded indentation introduced in r223637 to silence gcc warnging

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoRemove pmap_pid_dump() from the i386 pmap.
markj [Sat, 25 May 2019 23:36:20 +0000 (23:36 +0000)]
Remove pmap_pid_dump() from the i386 pmap.

It has not been compilable in a long time and doesn't seem very useful.

Suggested by: kib
MFC after: 1 week

5 years agoRemove an uneeded indentation introduced in r286196 to silence gcc warnging
lwhsu [Sat, 25 May 2019 21:57:01 +0000 (21:57 +0000)]
Remove an uneeded indentation introduced in r286196 to silence gcc warnging

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoWe don't really need two entries to describe how to deal with
trasz [Sat, 25 May 2019 17:37:28 +0000 (17:37 +0000)]
We don't really need two entries to describe how to deal with
optical drives in devfs.conf(5).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoCorrectly align usage: output
rgrimes [Sat, 25 May 2019 11:22:49 +0000 (11:22 +0000)]
Correctly align usage: output

5 years agoAdd an AESNI-optimized version of the CCM/CBC cryptographic and authentication
sef [Sat, 25 May 2019 07:26:30 +0000 (07:26 +0000)]
Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication
code.  The primary client of this is probably going to be ZFS encryption.

Reviewed by: jhb, cem
Sponsored by: iXsystems Inc, Kithrup Enterprises
Differential Revision: https://reviews.freebsd.org/D19298

5 years agopowerpc64/pmap: Reapply r334235 to OEA64 pmap, clearing HID0_RADIX
jhibbits [Sat, 25 May 2019 04:56:06 +0000 (04:56 +0000)]
powerpc64/pmap: Reapply r334235 to OEA64 pmap, clearing HID0_RADIX

This was lost in the re-merger of ISA3 MMU into moea64_native.

5 years agovirtio_pci(4): Fix typo in read_ivar method
cem [Sat, 25 May 2019 01:59:24 +0000 (01:59 +0000)]
virtio_pci(4): Fix typo in read_ivar method

Prior to this revision, vtpci's BUS_READ_IVAR method on VIRTIO_IVAR_SUBVENDOR
accidentally returned the PCI subdevice.

The typo seems to have been introduced with the original commit adding
VIRTIO_IVAR_{{SUB,}DEVICE,{SUB,}VENDOR} to virtio_pci.  The commit log and code
strongly suggest that the ivar was intended to return the subvendor rather than
the subdevice; it was likely just a copy/paste mistake.

Go ahead and rectify that.

5 years agoWhen using the destroy option to shut down a nop GEOM module, I/O
mckusick [Sat, 25 May 2019 00:07:49 +0000 (00:07 +0000)]
When using the destroy option to shut down a nop GEOM module, I/O
operations already in its queue were not being properly drained.
The GEOM framework does the queue draining, but the module needs
to wait for the draining to happen. The waiting is done by adding
a g_nop_providergone() function to wait for the I/O operations to
finish up. This change is similar to change -r345758 made to the
memory-disk driver.

Submitted by: Chuck Silvers
Tested by:    Chuck Silvers
MFC after:    1 week
Sponsored by: Netflix

5 years agoFix too loose assert in pmap_large_unmap().
kib [Fri, 24 May 2019 23:28:11 +0000 (23:28 +0000)]
Fix too loose assert in pmap_large_unmap().

The upper bound for the valid address from the large map used
LARGEMAP_MAX_ADDRESS instead of LARGEMAP_MIN_ADDRESS.  Provide a
function-like macro for proper upper value.

Noted by: markj
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20386

5 years agoAdd PG_PS_PDP_FRAME symbol.
kib [Fri, 24 May 2019 23:26:17 +0000 (23:26 +0000)]
Add PG_PS_PDP_FRAME symbol.

Similar to PG_FRAME and PG_PS_FRAME, it denotes the mask of the
physical address component of 1G superpage PDP entry.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20386

5 years agoDisable intr_storm_threshold mechanism by default
cem [Fri, 24 May 2019 22:33:14 +0000 (22:33 +0000)]
Disable intr_storm_threshold mechanism by default

The ixl.4 manual page has documented that the threshold falsely detects
interrupt storms on 40Gbit NICs as long ago as 2015, and we have seen
similar false positives with the ioat(4) DMA device (which can push GB/s).

For example, synthetic load can be generated with tools/tools/ioat
'ioatcontrol 0 200 8192 1 1000' (allocate 200x8kB buffers, generate an
interrupt for each one, and do this for 1000 milliseconds).  With
storm-detection disabled, the Broadwell-EP version of this device is capable
of generating ~350k real interrupts per second.

The following historical context comes from jhb@: Originally, the threshold
worked around incorrect routing of PCI INTx interrupts on single-CPU systems
which would end up in a hard hang during boot.  Since the threshold was
added, our PCI interrupt routing was improved, most PCI interrupts use
edge-triggered MSI instead of level-triggered INTx, and typical systems have
multiple CPUs available to service interrupts.

On the off chance that the threshold is useful in the future, it remains
available as a tunable and sysctl.

Reviewed by: jhb
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20401

5 years agoRestructure mbuf send tags to provide stronger guarantees.
jhb [Fri, 24 May 2019 22:30:40 +0000 (22:30 +0000)]
Restructure mbuf send tags to provide stronger guarantees.

- Perform ifp mismatch checks (to determine if a send tag is allocated
  for a different ifp than the one the packet is being output on), in
  ip_output() and ip6_output().  This avoids sending packets with send
  tags to ifnet drivers that don't support send tags.

  Since we are now checking for ifp mismatches before invoking
  if_output, we can now try to allocate a new tag before invoking
  if_output sending the original packet on the new tag if allocation
  succeeds.

  To avoid code duplication for the fragment and unfragmented cases,
  add ip_output_send() and ip6_output_send() as wrappers around
  if_output and nd6_output_ifp, respectively.  All of the logic for
  setting send tags and dealing with send tag-related errors is done
  in these wrapper functions.

  For pseudo interfaces that wrap other network interfaces (vlan and
  lagg), wrapper send tags are now allocated so that ip*_output see
  the wrapper ifp as the ifp in the send tag.  The if_transmit
  routines rewrite the send tags after performing an ifp mismatch
  check.  If an ifp mismatch is detected, the transmit routines fail
  with EAGAIN.

- To provide clearer life cycle management of send tags, especially
  in the presence of vlan and lagg wrapper tags, add a reference count
  to send tags managed via m_snd_tag_ref() and m_snd_tag_rele().
  Provide a helper function (m_snd_tag_init()) for use by drivers
  supporting send tags.  m_snd_tag_init() takes care of the if_ref
  on the ifp meaning that code alloating send tags via if_snd_tag_alloc
  no longer has to manage that manually.  Similarly, m_snd_tag_rele
  drops the refcount on the ifp after invoking if_snd_tag_free when
  the last reference to a send tag is dropped.

  This also closes use after free races if there are pending packets in
  driver tx rings after the socket is closed (e.g. from tcpdrop).

  In order for m_free to work reliably, add a new CSUM_SND_TAG flag in
  csum_flags to indicate 'snd_tag' is set (rather than 'rcvif').
  Drivers now also check this flag instead of checking snd_tag against
  NULL.  This avoids false positive matches when a forwarded packet
  has a non-NULL rcvif that was treated as a send tag.

- cxgbe was relying on snd_tag_free being called when the inp was
  detached so that it could kick the firmware to flush any pending
  work on the flow.  This is because the driver doesn't require ACK
  messages from the firmware for every request, but instead does a
  kind of manual interrupt coalescing by only setting a flag to
  request a completion on a subset of requests.  If all of the
  in-flight requests don't have the flag when the tag is detached from
  the inp, the flow might never return the credits.  The current
  snd_tag_free command issues a flush command to force the credits to
  return.  However, the credit return is what also frees the mbufs,
  and since those mbufs now hold references on the tag, this meant
  that snd_tag_free would never be called.

  To fix, explicitly drop the mbuf's reference on the snd tag when the
  mbuf is queued in the firmware work queue.  This means that once the
  inp's reference on the tag goes away and all in-flight mbufs have
  been queued to the firmware, tag's refcount will drop to zero and
  snd_tag_free will kick in and send the flush request.  Note that we
  need to avoid doing this in the middle of ethofld_tx(), so the
  driver grabs a temporary reference on the tag around that loop to
  defer the free to the end of the function in case it sends the last
  mbuf to the queue after the inp has dropped its reference on the
  tag.

- mlx5 preallocates send tags and was using the ifp pointer even when
  the send tag wasn't in use.  Explicitly use the ifp from other data
  structures instead.

- Sprinkle some assertions in various places to assert that received
  packets don't have a send tag, and that other places that overwrite
  rcvif (e.g. 802.11 transmit) don't clobber a send tag pointer.

Reviewed by: gallatin, hselasky, rgrimes, ae
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20117

5 years agoAdd initial support for 'qSupported' to the debug server.
jhb [Fri, 24 May 2019 22:11:37 +0000 (22:11 +0000)]
Add initial support for 'qSupported' to the debug server.

This doesn't recognize any features yet, but does parse the features
string.  It advertises an arbitrary packet size of 4k.

Reviewed by: markj, Scott Phillips <d.scott.phillips@intel.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20308

5 years agoRemove "struct ucred*" argument from vtruncbuf
asomers [Fri, 24 May 2019 20:27:50 +0000 (20:27 +0000)]
Remove "struct ucred*" argument from vtruncbuf

vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever
since that function was first added in r34611. Remove it.  Also, remove some
"struct ucred" arguments from fuse and nfs functions that were only used by
vtruncbuf.

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

5 years agoAdd snd_hda(4) to GENERIC64 used by powerpc64.
pkubaj [Fri, 24 May 2019 20:01:59 +0000 (20:01 +0000)]
Add snd_hda(4) to GENERIC64 used by powerpc64.

amd64 also has snd_hda(4) in GENERIC.

Approved by: jhibbits (src committer), linimon (mentor)

5 years agoficl pfopen: verify file
sjg [Fri, 24 May 2019 19:43:38 +0000 (19:43 +0000)]
ficl pfopen: verify file

If the file is verified - do not allow write
otherwise do not allow read.

Add O_ACCMODE to stand.h

Reviewed by: stevek, mindal_semihalf.com
MFC after: 3 days
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D20387

5 years agoMake options MD_ROOT_MEM default on PPC64
luporl [Fri, 24 May 2019 18:41:31 +0000 (18:41 +0000)]
Make options MD_ROOT_MEM default on PPC64

Having this option enabled by default on PowerPC64 kernels makes
booting ISO images much easier when on PowerNV.

With it, the ISO may simply be given to the -i flag of kexec.
Better yet, the ISO may be loop mounted on PetitBoot and its
kernel may be used to load itself.

Without this option, booting ISOs on remote PPC64 machines usually
involve preparing a separate kernel, with this option enabled.

5 years agoFix FC-Tape bugs caused in part by r345008.
ken [Fri, 24 May 2019 17:58:29 +0000 (17:58 +0000)]
Fix FC-Tape bugs caused in part by r345008.

The point of r345008 was to reset the Command Reference Number (CRN)
in some situations where a device stayed in the topology, but had
changed somehow.

This can include moving from a switch connection to a direct
connection or vice versa, or a device that temporarily goes away
and comes back.  (e.g. moving to a different switch port)

There were a couple of bugs in that change:
- We were reporting that a device had not changed whenever the
  Establish Image Pair bit was not set.  That is not quite correct.
  Instead, if the Establish Image Pair bit stays the same (set or
  not), the device hasn't changed in that way.

- We weren't setting PRLI Word0 in the port database when a new
  device arrived, so comparisons with the old value for the
  Establish Image Pair bit weren't really possible.  So, make sure
  PRLI Word0 is set in the port database for new devices.

- We were resetting the CRN whenever the Establish Image Pair bit
  was set for a device, even when the device had stayed the same
  and the value of the bit hadn't changed.  Now, only reset the
  CRN for devices that have changed, not devices that sayed the
  same.

The result of all of this was that if we had a single FC device on
an FC port and it went away and came back, we would wind up
correctly resetting the CRN.

But, if we had multiple devices connected via a switch, and there
was any change in one or more of those devices, all of the devices
that stayed the same would also have their CRN values reset.

The result, from a user standpoint, is that the tape drives, etc.
would all start to time out commands and the initiator would send
aborts.

sys/dev/isp/isp.c:
In isp_pdb_add_update(), look at whether the Establish
Image Pair bit has changed as part of the check to
determine whether a device is still the same.   This was
causing erroneous change notifications.  Also, when
creating a new port database entry, initialize the
PRLI Word 0 values.

sys/dev/isp/isp_freebsd.c:
In isp_async(), in the changed/stayed case, instead of
looking at the Establish Image Pair bit to determine
whether to reset the CRN, look at the command value.
(Changed vs. Stayed.)  Only reset the CRN for devices
that have changed.

Sponsored by: Spectra Logic
MFC after: 3 days

5 years agoFix a corner case in demotion of kernel mappings.
kib [Fri, 24 May 2019 17:19:06 +0000 (17:19 +0000)]
Fix a corner case in demotion of kernel mappings.

It is possible for the kernel mapping to be created with superpage by
directly installing pde using pmap_enter_2mpage() without filling the
corresponding page table page.  This can happen e.g. if the range is
already backed by reservation and vm_fault_soft_fast() conditions are
satisfied, which was observed on the pipe_map.

In this case, demotion must fill the page obtained from the pmap
radix, same as if the page is newly allocated.  Use PG_PROMOTED bit as
an indicator that the page is valid, instead of the wire count of the
page table page.

Since the PG_PROMOTED bit is set on pde when we leave TLB entries for
4k pages around, which in particular means that the ptes were filled,
it provides more correct indicator.  Note that pmap_protect_pde()
clears PG_PROMOTED, which handles the case when protection was changed
on the superpage without adjusting ptes.

Reported by: pho
In collaboration with: alc
Tested by: alc, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20380

5 years agoModernize the MAKE_JUST_KERNELS hint in the top-level makefile.
markj [Fri, 24 May 2019 15:45:43 +0000 (15:45 +0000)]
Modernize the MAKE_JUST_KERNELS hint in the top-level makefile.

It doesn't make sense to limit to -j12 anymore, build scalability
is better than it used to be.  Fold the hint into the description
of the universe target.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20342

5 years agonanobsd: exclude .git (and .hg) in the same places we exclude .svn
emaste [Fri, 24 May 2019 15:21:23 +0000 (15:21 +0000)]
nanobsd: exclude .git (and .hg) in the same places we exclude .svn

Allow support of other VCSes.  Note that two other nanobsd files already
had a similar case, excluding .git and .hg in addition to CVS and .svn.

Sponsored by: The FreeBSD Foundation

5 years agoRestore IPV6_NEXTHOP option support that seem was partially broken
ae [Fri, 24 May 2019 11:45:32 +0000 (11:45 +0000)]
Restore IPV6_NEXTHOP option support that seem was partially broken
since r286195.

Do not forget results of route lookup and initialize rt and ifp pointers.

PR: 238098
Submitted by: Masse Nicolas <nicolas.masse at stormshield eu>
MFC after: 1 week

5 years agoAdd `missing` and `or-flush` options to "ipfw table <NAME> create"
ae [Fri, 24 May 2019 11:06:24 +0000 (11:06 +0000)]
Add `missing` and `or-flush` options to "ipfw table <NAME> create"
command to simplify firewall reloading.

The `missing` option suppresses EEXIST error code, but does check that
existing table has the same parameters as new one. The `or-flush` option
implies `missing` option and additionally does flush for table if it
is already exist.

Submitted by: lev
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18339

5 years agoCorrect the argument passed to g_eli_algo2str()
lwhsu [Fri, 24 May 2019 06:49:47 +0000 (06:49 +0000)]
Correct the argument passed to g_eli_algo2str()

MFC with: r348206
Sponsored by: The FreeBSD Foundation

5 years agoamdgpio: small formatting cleanup
avg [Fri, 24 May 2019 06:07:33 +0000 (06:07 +0000)]
amdgpio: small formatting cleanup

MFC after: 2 weeks

5 years agoamdgpio: fix reading status of input pins
avg [Fri, 24 May 2019 06:06:42 +0000 (06:06 +0000)]
amdgpio: fix reading status of input pins

AMD FCH GPIO controller uses different bits for setting the output level
and for reporting the input level.

MFC after: 2 weeks

5 years agoamdgpio: remove new line symbols from pin names
avg [Fri, 24 May 2019 06:02:51 +0000 (06:02 +0000)]
amdgpio: remove new line symbols from pin names

That made, for example, gpioc -l output quite hard to read and parse.

Also, fix formatting of a nearby statement with too long lines.

MFC after: 2 weeks

5 years agoRemove kgzip and kgzldr.
delphij [Fri, 24 May 2019 05:34:21 +0000 (05:34 +0000)]
Remove kgzip and kgzldr.

PR: 183666, 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Differential Revision: https://reviews.freebsd.org/D20248

5 years agocryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.
delphij [Fri, 24 May 2019 02:44:15 +0000 (02:44 +0000)]
cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.

For older versions of zlib, dummy was a workaround for compilers that do not
handle opaque type definition well; on FreeBSD, it's representing a value
that is not really useful for monitoring purposes, and the field would be gone
in newer zlib versions.

PR: 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Differential Revision: https://reviews.freebsd.org/D20222

5 years agobectl(8): Add a test for jail/unjail of numeric BE names
kevans [Fri, 24 May 2019 01:53:45 +0000 (01:53 +0000)]
bectl(8): Add a test for jail/unjail of numeric BE names

Fixed by r348215, bectl ujail first attempts the trivial fetch of a jid by
passing the first argument to 'ujail' to jail_getid(3) in case a jid/name
have been passed in instead of a BE name. For numerically named BEs, this
was doing the wrong thing: instead of failing to locate the jid specified
and falling back to mountpath search, jail_getid(3) would return the input
as-is.

While here, I've fixed bectl_jail_cleanup which still used a hard-coded pool
name that was overlooked w.r.t. other work that was in-flight around the
same time.

MFC after: 3 days

5 years agoDisplay CPU model in dmesg on mips targets
imp [Fri, 24 May 2019 01:43:35 +0000 (01:43 +0000)]
Display CPU model in dmesg on mips targets

Also, save the CPU model for atheros ar531x boards.

Submitted by: Hiroki Mori
Differential Revision: https://reviews.freebsd.org/D20371

5 years agoMake uniqueifier match the module definition.
imp [Fri, 24 May 2019 01:43:29 +0000 (01:43 +0000)]
Make uniqueifier match the module definition.

5 years agojail_getid(3): validate jid string input
kevans [Fri, 24 May 2019 01:28:07 +0000 (01:28 +0000)]
jail_getid(3): validate jid string input

Currently, if jail_getid(3) is passed in a numeric string, it assumes that
this is a jid string and passes it back converted to an int without checking
that it's a valid/existing jid. This breaks consumers that might use
jail_getid(3) to see if it can trivially grab a jid from a name if that name
happens to be numeric but not actually the name/jid of the jail. Instead of
returning -1 for the jail not existing, it'll return the int version of the
input and the consumer will not fallback to trying other methods.

Pass the numeric input to jail_get(2) as the jid for validation, rather than
the name. This works well- the kernel enforces that jid=name if name is
numeric, so doing the safe thing and checking numeric input as a jid will
still DTRT based on the description of jail_getid.

Reported by: Wes Maag
Reviewed by: jamie, Wes Maag
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20388

5 years agoAdd support for writing to guest memory in the debug server.
jhb [Fri, 24 May 2019 00:34:13 +0000 (00:34 +0000)]
Add support for writing to guest memory in the debug server.

- Add a write_mem counterpart to read_mem to handle writes to MMIO.
- Add support for the GDB 'M' packet to write bytes to the guest's
  memory.  For MMIO writes, attempt to batch writes up into words.
  This is imprecise, but if you write a single 2 or 4-byte aligned
  word, it should be treated as a single MMIO write operation.
- While here, tidy up the parsing of the 'm' command used for reading
  memory to match 'M'.

Reviewed by: markj, Scott Phillips <d.scott.phillips@intel.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20307

5 years agoAdd a constant for the LS config MSR on AMD CPUs.
jhb [Thu, 23 May 2019 23:37:11 +0000 (23:37 +0000)]
Add a constant for the LS config MSR on AMD CPUs.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19506

5 years agoInitialize a variable to fix build with GCC.
jkim [Thu, 23 May 2019 22:49:03 +0000 (22:49 +0000)]
Initialize a variable to fix build with GCC.

5 years agoAdd deprecation warnings for weaker algorithms to geli(4).
jhb [Thu, 23 May 2019 22:31:55 +0000 (22:31 +0000)]
Add deprecation warnings for weaker algorithms to geli(4).

- Triple DES has been formally deprecated in Kerberos (RFC 8429)
  and is soon to be deprecated in IPsec (RFC 8221).
- Blowfish is deprecated.  FreeBSD doesn't support its successor
  (Twofish).
- MD5 is generally considered a weak digest that has known attacks.

geli refuses to create new volumes using these algorithms via 'geli
init'.  It also warns when attaching to existing volumes or creating
temporary volumes via 'geli onetime' .  The plan is to fully remove
support for these algorithms in FreeBSD 13.

Note that none of these algorithms have ever been the default
algorithm used by geli(8).  Users would have had to explicitly select
these algorithms when creating volumes in the past.

Reviewed by: cem, delphij
MFC after: 3 days
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20344

5 years agoAdd deprecation warnings for IPsec algorithms deprecated in RFC 8221.
jhb [Thu, 23 May 2019 22:06:57 +0000 (22:06 +0000)]
Add deprecation warnings for IPsec algorithms deprecated in RFC 8221.

All of these algorithms are either explicitly marked MUST NOT, or they
are implicitly MUST NOTs by virtue of not being included in IETF's
list of protocols at all despite having assignments from IANA.

Specifically, this adds warnings for the following ciphers:
- des-cbc
- blowfish-cbc
- cast128-cbc
- des-deriv
- des-32iv
- camellia-cbc

Warnings for the following authentication algorithms are also added:
- hmac-md5
- keyed-md5
- keyed-sha1
- hmac-ripemd160

Reviewed by: cem, gnn
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20340

5 years agoRemove yet another unused variable.
jkim [Thu, 23 May 2019 22:01:05 +0000 (22:01 +0000)]
Remove yet another unused variable.

5 years agorandom(4): deduplicate explicit_bzero() in harvest
cem [Thu, 23 May 2019 21:02:27 +0000 (21:02 +0000)]
random(4): deduplicate explicit_bzero() in harvest

Pull the responsibility for zeroing events, which is general to any
conceivable implementation of a random device algorithm, out of the
algorithm-specific Fortuna code and into the callers.  Most callers
indirect through random_fortuna_process_event(), so add the logic there.
Most callers already explicitly bzeroed the events they provided, so the
logic in Fortuna was mostly redundant.

Add one missing bzero in randomdev_accumulate().  Also, remove a redundant
bzero in the same function -- randomdev_hash_finish() is obliged to bzero
the hash state.

Reviewed by: delphij
Approved by: secteam(delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20318

5 years agouart_cpu_acpi: Fix GCC build break from r348195
cem [Thu, 23 May 2019 20:18:46 +0000 (20:18 +0000)]
uart_cpu_acpi: Fix GCC build break from r348195

extern declarations are redundant with those in uart_cpu.h, which this file
includes.

X-MFC-with: r348195

5 years agoEKCD: Add Chacha20 encryption mode
cem [Thu, 23 May 2019 20:12:24 +0000 (20:12 +0000)]
EKCD: Add Chacha20 encryption mode

Add Chacha20 mode to Encrypted Kernel Crash Dumps.

Chacha20 does not require messages to be multiples of block size, so it is
valid to use the cipher on non-block-sized messages without the explicit
padding AES-CBC would require.  Therefore, allow use with simultaneous dump
compression.  (Continue to disallow use of AES-CBC EKCD with compression.)

dumpon(8) gains a -C cipher flag to select between chacha and aes-cbc.
It defaults to chacha if no -C option is provided.  The man page documents this
behavior.

Relnotes: sure
Sponsored by: Dell EMC Isilon

5 years agoloader: Remove unused variable
manu [Thu, 23 May 2019 20:04:22 +0000 (20:04 +0000)]
loader: Remove unused variable

Reported by: lwshu, ci@

5 years agoUse ACPI SPCR on x86
cperciva [Thu, 23 May 2019 19:55:53 +0000 (19:55 +0000)]
Use ACPI SPCR on x86

This takes the SPCR code currently in uart_cpu_arm64.c, moves it into
a new uart_cpu_acpi.c (with some associated refactoring), and uses it
from both arm64 and x86.

An SPCR serial port address AccessWidth field value of 0 ("reserved")
is now treated as 1 ("byte access") in order to work around a buggy
SPCR table on Amazon EC2 i3.metal instances.

Reviewed by: manu, Greg V
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D20357

5 years agoloader: Add pnp functions for autoloading modules based on linker.hints
manu [Thu, 23 May 2019 19:26:50 +0000 (19:26 +0000)]
loader: Add pnp functions for autoloading modules based on linker.hints

This adds some new commands to loader :

- pnpmatch
   This takes a pnpinfo string as argument and tries to find a kernel module
   associated with it. -v and -d option are available and are the same as in
   devmatch (v is verbose, d dumps the hints).
- pnpload
   This takes a pnpinfo string as argument and tries to load a kernel module
   associated with it.
- pnpautoload
   This will attempt to load every kernel module for each buses. Each buses are
   probed, the probe function will generate pnpinfo string and load kernel module
   associated with it if it exists.

Only simplebus for FDT system is implemented for now.
Since we need the dtb and overlays to be applied before searching the tree
fdt_devmatch_next will load and apply the dtb + overlays.

All the pnp parsing code comes from devmatch and is the same at 99%.

Reviewed by: imp, kevans
Differential Revision: https://reviews.freebsd.org/D19498

5 years agoChange package the MTREEFLAGS and INSTALLFLAGS missed in r348185
bapt [Thu, 23 May 2019 18:55:48 +0000 (18:55 +0000)]
Change package the MTREEFLAGS and INSTALLFLAGS missed in r348185

Reported by: lwhsu

5 years agoMove back group, master.passwd and shells to etc directory
bapt [Thu, 23 May 2019 18:37:05 +0000 (18:37 +0000)]
Move back group, master.passwd and shells to etc directory

Use the .PATH mechanism instead so keep installing them from lib/libc/gen

While here revert 347961 and 347893 which are no longer needed

Discussed with: manu
Tested by: manu
ok manu@

5 years agoAdd pnpinfo to all i2c drivers that have FDT compat data.
ian [Thu, 23 May 2019 18:24:27 +0000 (18:24 +0000)]
Add pnpinfo to all i2c drivers that have FDT compat data.

5 years agoAdd pnpinfo.
ian [Thu, 23 May 2019 18:19:56 +0000 (18:19 +0000)]
Add pnpinfo.

5 years agoarm: allwinner: Remove frac mode from NM clk
manu [Thu, 23 May 2019 17:36:55 +0000 (17:36 +0000)]
arm: allwinner: Remove frac mode from NM clk

We have a correct clock type aw_clk_frac now for this.

5 years agoarm: allwinner: clk: Use the new frac clock
manu [Thu, 23 May 2019 17:36:19 +0000 (17:36 +0000)]
arm: allwinner: clk: Use the new frac clock

Some clocks used the NM type but this clock is for the ones with the
formula "clk = clkin / n / m" and not "clk = clkin * n / m"
Use the new frac clock for them.

5 years agoarm: allwinner: clk: Add new clock aw_clk_frac
manu [Thu, 23 May 2019 17:35:40 +0000 (17:35 +0000)]
arm: allwinner: clk: Add new clock aw_clk_frac

Add a clock driver for clock that can either be used in integer mode
with one N factor and one M divider or in fractional mode where the
output frequency is chosen between two predifined output.

5 years agoallwinner: aw_ccu: Add some debug printfs (disabled by default)
manu [Thu, 23 May 2019 17:34:33 +0000 (17:34 +0000)]
allwinner: aw_ccu: Add some debug printfs (disabled by default)

Also print information about setting frequency at boot under bootverbose

5 years agoMove to using newvers -c instead of VARS_ONLY=1
imp [Thu, 23 May 2019 17:19:05 +0000 (17:19 +0000)]
Move to using newvers -c instead of VARS_ONLY=1

Use newvers.sh -c to get the copyright, and newvers.sh -V RELDATE to
get the release date.

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

5 years agoConvert freebsd-version to using -v
imp [Thu, 23 May 2019 17:19:00 +0000 (17:19 +0000)]
Convert freebsd-version to using -v

newvers.sh has supported a variable setting only mode, use that in
preference to grep to future proof this script from changes there.

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

5 years agoConvert amd newvers to using newvers.sh -v.
imp [Thu, 23 May 2019 17:18:56 +0000 (17:18 +0000)]
Convert amd newvers to using newvers.sh -v.

Rather than the tedious and error-prone grep of sys/conf/newvers.sh,
use the new -v arg to dig out the data that's desired.

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

5 years agoImplement "VARS_ONLY=1" via special command line args
imp [Thu, 23 May 2019 17:18:48 +0000 (17:18 +0000)]
Implement "VARS_ONLY=1" via special command line args

Add -v to print TYPE REVISION BRANCH RELEASE VERSION RELDATE variables
Add -V var to print var's value
Both of these in ${var}="${val}" format suitable for
eval $(sh newvers.sh -v)
in shell scripts / makefiles.
Add -c to print the copyright / license comment text only.

Document these, and remove soon-to-be obsolete comment.

Minor code motion as well bunded here to put functions after
VARS_ONLY and command line argument parsing.

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

5 years agoRename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
ian [Thu, 23 May 2019 16:03:30 +0000 (16:03 +0000)]
Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO.