]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAdd a command that copies or migrates a data file from one DS to another.
Rick Macklem [Fri, 15 Jun 2018 19:45:15 +0000 (19:45 +0000)]
Add a command that copies or migrates a data file from one DS to another.

This command can be used by a sysadmin to either copy or migrate a data
file on one DS to another DS.
Its main use is to recover data files onto a mirrored DS after the DS has
been repaired and brought back online.

6 years agoarm64 linuxulator: add linux_dummy.c based on amd64
Ed Maste [Fri, 15 Jun 2018 19:42:52 +0000 (19:42 +0000)]
arm64 linuxulator: add linux_dummy.c based on amd64

A later change should deduplicate the multiple copies of this file.

Sponsored by: Turing Robotic Industries

6 years agoAdd a command the displays and modifies the pNFS server's extended attribute.
Rick Macklem [Fri, 15 Jun 2018 19:35:08 +0000 (19:35 +0000)]
Add a command the displays and modifies the pNFS server's extended attribute.

This command allows a sysadmin to display or modify the pnfsd.dsfile extended
attribute used by the pNFS MDS server in various ways.
Its main use is to set a DS's IP address to 0.0.0.0 when that DS has failed,
so that it will not be used for the file when brought back online after
being repaired.

6 years agoPut in temporary hacks for jevents.
Bryan Drewery [Fri, 15 Jun 2018 19:19:36 +0000 (19:19 +0000)]
Put in temporary hacks for jevents.

- Handle 'make clean'
- Don't try building it locally, just fail instead.

jevents should really be merged into lib/libpmc/Makefile.

6 years agoarm64: add arm64 linux.h based on i386 linuxulator and Linux headers
Ed Maste [Fri, 15 Jun 2018 19:09:17 +0000 (19:09 +0000)]
arm64: add arm64 linux.h based on i386 linuxulator and Linux headers

Sponsored by: Turing Robotic Industries

6 years agoThere's no need to walk through the tables looking for the smbios
Warner Losh [Fri, 15 Jun 2018 19:07:37 +0000 (19:07 +0000)]
There's no need to walk through the tables looking for the smbios
table if we're just going to ignore it on arm, so expand, slightly,
the reach of the ifdef. Move the buffer to the inner block so we
don't have a separate #ifdef far away from these lines.

The issue on arm is that smbios_detect does unaligned accesses, which
in the u-boot implementing EFI context causes a crash.

6 years agoMove arg parsing into its own routine for possible later reuse.
Warner Losh [Fri, 15 Jun 2018 19:07:31 +0000 (19:07 +0000)]
Move arg parsing into its own routine for possible later reuse.

6 years agoProvide a more direct interface to tell ZFS what the preferred handle
Warner Losh [Fri, 15 Jun 2018 19:07:26 +0000 (19:07 +0000)]
Provide a more direct interface to tell ZFS what the preferred handle
is. We tell the ZFS code now, and it checks rather than having a
callback to do the checks.

This will allow us to have a more graceful fallback code. In the
future, it's anticipated that we may fallback to a more global search
(or implement a command to do so) when reqeusted by the user, or we
detect a violation of the UEFI Boot Manager protocol severe enough to
warrant this backstop. For now, it just allows us to get rid of img as
a global.

Sponsored by: Netflix

6 years agoMigrate has_keyboard to bool.
Warner Losh [Fri, 15 Jun 2018 19:07:06 +0000 (19:07 +0000)]
Migrate has_keyboard to bool.

6 years agoRetain offset compatibility with pre-12.0 dumps
Conrad Meyer [Fri, 15 Jun 2018 19:02:53 +0000 (19:02 +0000)]
Retain offset compatibility with pre-12.0 dumps

As a follow-up to r324965, which adds support for compressed kernel dumps,
readjust dump header members slightly to mostly preserve ABI with earlier
(11.x and older) dumps.

Reviewed by: markj
X-MFC-With: r324965
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15829

6 years agoCheck for a 'pci' prefix rather than a full match in get_addr_props
Justin Hibbits [Fri, 15 Jun 2018 18:55:02 +0000 (18:55 +0000)]
Check for a 'pci' prefix rather than a full match in get_addr_props

Summary:
Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for
device_type, not 'pci'.  Rather than enumerating all possible variants, just
check for a 'pci' prefix.

Reviewed by: nwhitehorn, breno.leitao_gmail.com
Differential Revision: https://reviews.freebsd.org/D15817

6 years agolib32: Fix lib/libpmc/pmu-events files ending up in source directory.
Bryan Drewery [Fri, 15 Jun 2018 18:50:24 +0000 (18:50 +0000)]
lib32: Fix lib/libpmc/pmu-events files ending up in source directory.

This could happen with either WITHOUT_AUTO_OBJ=yes or MAKELEVEL>0 for
the initial 'make buildworld' command.

This now ensures that build-tools targets have 'make obj' ran if needed.

This is especially problematic for pmu-events since it is not directly
connected in the build.  Normally the 'make includes' call right before
this implicitly creates the objdir with a 'make obj' already but
misses pmu-events because it is disconnected from lib/libpmc.  Fixing that
would make this new 'make obj' pointless but it is being added to avoid
this problem in the future should another tool be connected like this.

Reported by: rgrimes, kib, kevans
Sponsored by: Dell EMC

6 years agoRemove empty directory
Warner Losh [Fri, 15 Jun 2018 18:46:01 +0000 (18:46 +0000)]
Remove empty directory

6 years agocxgbe(4): sysctls to display the local and intr CPUs for the adapter.
Navdeep Parhar [Fri, 15 Jun 2018 18:04:44 +0000 (18:04 +0000)]
cxgbe(4): sysctls to display the local and intr CPUs for the adapter.

The driver assumes the list can change (even though it does't right now)
and queries it every time the sysctl runs.

sysctl dev.<nexus>.<inst>.local_cpus
sysctl dev.<nexus>.<inst>.intr_cpus

sysctl dev.t6nex.0.local_cpus
sysctl dev.t6nex.0.intr_cpus

Sponsored by: Chelsio Communications

6 years agoRemove obsolete asf(8)
Ed Maste [Fri, 15 Jun 2018 17:44:21 +0000 (17:44 +0000)]
Remove obsolete asf(8)

kgdb now handles kernel module state internally, so the asf tool serves
no purpose.

PR: 229046
Reviewed by: brooks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15827

6 years agoAdd deprecation notice in asf.8
Ed Maste [Fri, 15 Jun 2018 17:38:07 +0000 (17:38 +0000)]
Add deprecation notice in asf.8

PR: 229046
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoextres/regulator: Switch boot_on/always_on sysctl to uint8
Kyle Evans [Fri, 15 Jun 2018 17:29:32 +0000 (17:29 +0000)]
extres/regulator: Switch boot_on/always_on sysctl to uint8

These are represented as booleans on the kernel-side, but were being exposed
as int. This was causing some funky things to happen when read later with
sysctl(8), e.g. randomly reading super-high when the value was actually
'0'/false.

Reviewed by: manu

6 years agoobjdump.1: manually apply r229046 to the rendered man page
Ed Maste [Fri, 15 Jun 2018 17:16:27 +0000 (17:16 +0000)]
objdump.1: manually apply r229046 to the rendered man page

6 years agolibcompat: Only build libmagic build tool if MK_FILE is yes.
Bryan Drewery [Fri, 15 Jun 2018 17:03:57 +0000 (17:03 +0000)]
libcompat: Only build libmagic build tool if MK_FILE is yes.

Sponsored by: Dell EMC

6 years agoAdd deprecation notice to objdump man page
Ed Maste [Fri, 15 Jun 2018 17:03:49 +0000 (17:03 +0000)]
Add deprecation notice to objdump man page

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13881

6 years agoOnly build jevents if MK_PMC is yes and only for amd64 in libcompat.
Bryan Drewery [Fri, 15 Jun 2018 16:48:09 +0000 (16:48 +0000)]
Only build jevents if MK_PMC is yes and only for amd64 in libcompat.

Sponsored by: Dell EMC

6 years agoaudit(4): Add a few tests for network-related syscalls
Alan Somers [Fri, 15 Jun 2018 16:41:28 +0000 (16:41 +0000)]
audit(4): Add a few tests for network-related syscalls

Add tests for socket(2), socketpair(2), and setsockopt(2)

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15803

6 years agoCorrect kern.pre.mk comment: objcopy, not objdump, copies objects.
Ed Maste [Fri, 15 Jun 2018 16:32:18 +0000 (16:32 +0000)]
Correct kern.pre.mk comment: objcopy, not objdump, copies objects.

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoldd: reference readelf instead of objdump in warning message
Ed Maste [Fri, 15 Jun 2018 16:28:50 +0000 (16:28 +0000)]
ldd: reference readelf instead of objdump in warning message

We have an obsolete GNU objdump 2.17.50 in the base system, which will
be removed in the future.  Suggest readelf(1) for examining ELF files
instead; for most use cases it is the preferred tool anyhow.

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agosrc.conf.5: regen after r335210, *BINUTILS description updates
Ed Maste [Fri, 15 Jun 2018 16:25:36 +0000 (16:25 +0000)]
src.conf.5: regen after r335210, *BINUTILS description updates

Sponsored by: The FreeBSD Foundation

6 years agoMake virtio queue re-initialization steps to be similar to
Ruslan Bukin [Fri, 15 Jun 2018 16:19:10 +0000 (16:19 +0000)]
Make virtio queue re-initialization steps to be similar to
original initialization, so we don't miss few registers to
configure.

This fixes vtnet(4) operation with QEMU's virtio-net-device.

Tested in QEMU with FreeBSD/RISC-V.

Reviewed by: bryanv
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15821

6 years agoRemove objcopy from BINUTILS option descriptions
Ed Maste [Fri, 15 Jun 2018 16:18:39 +0000 (16:18 +0000)]
Remove objcopy from BINUTILS option descriptions

As of r306649 objcopy is always ELF Tool Chain's elfcopy; binutils
objcopy is never used.

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoelf.5: add readelf cross-reference
Ed Maste [Fri, 15 Jun 2018 16:14:42 +0000 (16:14 +0000)]
elf.5: add readelf cross-reference

objdump is sometimes used in cases where readelf is more appropriate,
but the obsolete GNU objdump we have in the base system will be removed
in the future.

.Xr readelf from elf.5 to improve the odds the more appropriate tool
will be found.

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoaudit(4): improve formatting in tests/sys/audit/open.c
Alan Somers [Fri, 15 Jun 2018 15:36:10 +0000 (15:36 +0000)]
audit(4): improve formatting in tests/sys/audit/open.c

[skip ci]

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15797

6 years agoaudit(4): add tests for access(2), chmod(2), and friends
Alan Somers [Fri, 15 Jun 2018 15:32:02 +0000 (15:32 +0000)]
audit(4): add tests for access(2), chmod(2), and friends

access(2), eaccess(2), faccessat(2), chmod(2), fchmod(2), lchmod(2), and
fchmodat(2).

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15805
Differential Revision: https://reviews.freebsd.org/D15808

6 years agoFix markup in zfs(8); no content change
Eric van Gyzen [Fri, 15 Jun 2018 15:28:31 +0000 (15:28 +0000)]
Fix markup in zfs(8); no content change

Sponsored by: Dell EMC

6 years agoAdd linprocfs support for min_free_kbytes
Chuck Tuffli [Fri, 15 Jun 2018 15:22:27 +0000 (15:22 +0000)]
Add linprocfs support for min_free_kbytes

This adds linprocfs support for proc/sys/vm/min_free_kbytes which the
free program requires for correct operation. The approach mirrors the
approach used in illumos.

Reviewed by: imp (mentor), emaste
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15563

6 years agolinuxulator: do not include legacy syscalls on arm64
Ed Maste [Fri, 15 Jun 2018 14:41:51 +0000 (14:41 +0000)]
linuxulator: do not include legacy syscalls on arm64

Existing linuxulator platforms (i386, amd64) support legacy syscalls,
such as non-*at ones like open, but arm64 and other new platforms do
not.

Wrap these in #ifdef LINUX_LEGACY_SYSCALLS, #defined in the MD linux.h
files.  We may need finer grained control in the future but this is
sufficient for now.

Reviewed by: andrew
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D15237

6 years agoCorrect debug control for linuxulator faccessat
Ed Maste [Fri, 15 Jun 2018 14:29:41 +0000 (14:29 +0000)]
Correct debug control for linuxulator faccessat

The Linuxulator provides per-syscall debug control via the
compat.linux.debug sysctl.  There's generally a 1:1 mapping between
sysctl setting and syscall, but faccessat was controlled by the access
setting, perhaps due to copy-paste.

Sponsored by: Turing Robotic Industries

6 years agolinprocfs: add TracerPid to /proc/pid/status.
Konstantin Belousov [Fri, 15 Jun 2018 13:56:58 +0000 (13:56 +0000)]
linprocfs: add TracerPid to /proc/pid/status.
Also fix the value of parent pid if the process is traced.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
MFC after: 1 week

6 years agoAdd stubbed arm64 linuxulator /proc/cpuinfo handler
Ed Maste [Fri, 15 Jun 2018 13:53:37 +0000 (13:53 +0000)]
Add stubbed arm64 linuxulator /proc/cpuinfo handler

Sponsored by: Turing Robotic Industries

6 years agoRevert r335173 at request of mmel@
Kyle Evans [Fri, 15 Jun 2018 13:14:45 +0000 (13:14 +0000)]
Revert r335173 at request of mmel@

This was the wrong solution to the problem; regulator_shutdown invokes
regnode_stop. regulator_stop is not a refcounting method, but it invokes
regnode_enable, which is.

mmel@ has a proposed patch/solution to instead provide regnode_fixed_stop
behavior that properly takes shared GPIO pins into account.

6 years agoWhen retransmitting TCP SYN-ACK segments with the TCP timestamp option
Michael Tuexen [Fri, 15 Jun 2018 12:28:43 +0000 (12:28 +0000)]
When retransmitting TCP SYN-ACK segments with the TCP timestamp option
enabled use an updated timestamp instead of reusing the one used in
the initial TCP SYN-ACK segment.

This patch ensures that an updated timestamp is used when sending the
SYN-ACK from the syncache code. It was already done if the
SYN-ACK was retransmitted from the generic code.

This makes the behaviour consistent and also conformant with
the TCP specification.

Reviewed by: jtl@, Jason Eggleston
MFC after: 1 month
Sponsored by: Neflix, Inc.
Differential Revision: https://reviews.freebsd.org/D15634

6 years agoAdd an entry into the Makefile for pnfsdskill.
Rick Macklem [Fri, 15 Jun 2018 11:54:55 +0000 (11:54 +0000)]
Add an entry into the Makefile for pnfsdskill.

pnfsdskill was added by r335192. This commit adds an entry for it to the
Makefile.

6 years agoAdd a command that disables a pNFS server mirrored DS.
Rick Macklem [Fri, 15 Jun 2018 11:52:34 +0000 (11:52 +0000)]
Add a command that disables a pNFS server mirrored DS.

This command can be used by a sysadmin to disable a malfunctioning pNFS server
mirrored DS. It is safe to use when a mirrored DS has already been disabled
via an I/O or network partitioning error.

6 years agoallwinner: ccung: Fully subclass the clock drivers
Emmanuel Vadot [Fri, 15 Jun 2018 08:36:21 +0000 (08:36 +0000)]
allwinner: ccung: Fully subclass the clock drivers

Each clock drivers if now fully subclassed, this have the advantage that
we can control the probe order.
Some clocks can have parents from other drivers, for example clocks in the
sun8i_r driver uses clocks from the main clock driver.
This worked before because the sun8i_r node is after the main ccu node in the
dtb and driver are probed in DTB order. This cannot work with the Display
Engine clocks as it is the first node in the DTB.

Tested on:    A83T, H5 A64
Tested on:    A20 (kevans)

6 years agoAdded option to cluster-align the start of the root directory.
Xin LI [Fri, 15 Jun 2018 06:03:40 +0000 (06:03 +0000)]
Added option to cluster-align the start of the root directory.

Obtained from: Android
Obtained from: https://android.googlesource.com/platform/system/core/+/052f27562154d175267999106bd6bf18fc8c363e
Obtained from: https://android.googlesource.com/platform/system/core/+/8218b6aae9cd4a19fa074a8a8203fe9275b35447
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15672

6 years agobsdgrep(1): Remove redundant initialization; unconditionally assigned later
Kyle Evans [Fri, 15 Jun 2018 03:31:30 +0000 (03:31 +0000)]
bsdgrep(1): Remove redundant initialization; unconditionally assigned later

6 years agoofw_reg_to_paddr(): Fix minor typo in KASSERT message
Justin Hibbits [Fri, 15 Jun 2018 03:28:05 +0000 (03:28 +0000)]
ofw_reg_to_paddr(): Fix minor typo in KASSERT message

6 years agoQuiet coretemp probe
Matt Macy [Fri, 15 Jun 2018 02:28:36 +0000 (02:28 +0000)]
Quiet coretemp probe

Only the first device will print
coretemp0: <CPU On-Die Thermal Sensors> numa-domain 0 on cpu0
instead of all hyper threads

Submitted by: kbowling
Reviewed by: imp, sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15727

6 years agoproc0_post: Fix some locking issues
Bryan Drewery [Fri, 15 Jun 2018 00:36:41 +0000 (00:36 +0000)]
proc0_post: Fix some locking issues

- Filter out PRS_NEW procs as rufetch() tries taking the thread lock
  which may not yet be initialized.
- Hold PROC_LOCK to ensure stability of iterating the threads.
- p_rux fields are protected by the process statlock as well.

MFC after: 2 weeks
Reviewed by: kib
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15809

6 years agoUse M_EXEC when calling malloc() to allocate the memory to store the module,
Olivier Houchard [Thu, 14 Jun 2018 23:10:10 +0000 (23:10 +0000)]
Use M_EXEC when calling malloc() to allocate the memory to store the module,
as it'll contain executable code.

6 years agoExit with an error if a linker hints file can't be found.
John Baldwin [Thu, 14 Jun 2018 22:31:30 +0000 (22:31 +0000)]
Exit with an error if a linker hints file can't be found.

Continuing with a NULL hints variable just triggers a segfault later on.
The other error cases in this function all exit for an error rather than
warning.

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

6 years agoTCPOUTFLAGS no longer exists since r334843.
Gleb Smirnoff [Thu, 14 Jun 2018 22:25:10 +0000 (22:25 +0000)]
TCPOUTFLAGS no longer exists since r334843.

6 years agoProvide the ip6_plen in network byte order when calling ip6_output().
Michael Tuexen [Thu, 14 Jun 2018 21:30:52 +0000 (21:30 +0000)]
Provide the ip6_plen in network byte order when calling ip6_output().

This is not strictly required by ip6_output(), since it overrides it,
but it is needed for upcoming dtrace support.

6 years agoRegen after 335177 (rename sys_obreak to sys_break).
Brooks Davis [Thu, 14 Jun 2018 21:29:31 +0000 (21:29 +0000)]
Regen after 335177 (rename sys_obreak to sys_break).

6 years agoName the implementation of brk and sbrk sys_break().
Brooks Davis [Thu, 14 Jun 2018 21:27:25 +0000 (21:27 +0000)]
Name the implementation of brk and sbrk sys_break().

The break() system call was renamed (several times) starting in v3
AT&T UNIX when C was invented and break was a language keyword. The
last vestage of a need for it to be called something else (eg obreak)
was removed in r225617 which consistantly prefixed all syscall
implementations.

Reviewed by: emaste, kib (older version)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15638

6 years agoWhitespace changes.
Michael Tuexen [Thu, 14 Jun 2018 21:22:14 +0000 (21:22 +0000)]
Whitespace changes.

6 years agoAdd a new man page that briefly describes the pNFS variant of the NFSv4.1
Rick Macklem [Thu, 14 Jun 2018 21:12:08 +0000 (21:12 +0000)]
Add a new man page that briefly describes the pNFS variant of the NFSv4.1
protocol.

This is a content change.

6 years agoDocument the "-p" and "-m" options added to nfsd.c by r335172.
Rick Macklem [Thu, 14 Jun 2018 20:55:33 +0000 (20:55 +0000)]
Document the "-p" and "-m" options added to nfsd.c by r335172.

This is a content change.

6 years agoextres/regulator: Properly refcount gpio regulators
Kyle Evans [Thu, 14 Jun 2018 20:37:25 +0000 (20:37 +0000)]
extres/regulator: Properly refcount gpio regulators

regnode::enable_cnt is generally used to refcount regulator nodes. For
GPIOs, the refcount was done on the gpio_entry since more than one regulator
can share a GPIO.

GPIO regulators were not taking part in the node refcount, since they had
their own mechanism. This caused some fallout after manu started disabling
everybody's unused regulators in r331989.

Refcount it.

Glanced over by: manu

6 years agoAdd the "-p" and "-m" options to nfsd.c for the pNFS service.
Rick Macklem [Thu, 14 Jun 2018 20:36:55 +0000 (20:36 +0000)]
Add the "-p" and "-m" options to nfsd.c for the pNFS service.

The "-p" option specifies that the nfsd should run a pNFS service instead
of a regular NFS service. The "-m" option is only meaningful when used with
"-p" to specify that mirroring on the DSs should be done and on how many of
them.
This change requires the kernel changes committed as r334930.
The man page update will be committed as a separate commit soon.

6 years agoHandle the race between fork/vm_object_split() and faults.
Konstantin Belousov [Thu, 14 Jun 2018 19:41:02 +0000 (19:41 +0000)]
Handle the race between fork/vm_object_split() and faults.

If fault started before vmspace_fork() locked the map, and then during
fork, vm_map_copy_entry()->vm_object_split() is executed, it is
possible that the fault instantiate the page into the original object
when the page was already copied into the new object (see
vm_map_split() for the orig/new objects terminology). This can happen
if split found a busy page (e.g. from the fault) and slept dropping
the objects lock, which allows the swap pager to instantiate
read-behind pages for the fault.  Then the restart of the scan can see
a page in the scanned range, where it was already copied to the upper
object.

Fix it by instantiating the read-ahead pages before
swap_pager_getpages() method drops the lock to allocate pbuf.  The
object scan would see the whole range prefilled with the busy pages
and not proceed the range.

Note that vm_fault rechecks the map generation count after the object
unlock, so that it restarts the handling if raced with split, and
re-lookups the right page from the upper object.

In collaboration with: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agomx25l: compat_data is only defined when FDT is
Emmanuel Vadot [Thu, 14 Jun 2018 19:01:40 +0000 (19:01 +0000)]
mx25l: compat_data is only defined when FDT is

Reported by: O. Hartmann <ohartmann@walstatt.org>

6 years agoa10_ahci: Correct clock indices for new bindings
Kyle Evans [Thu, 14 Jun 2018 18:34:02 +0000 (18:34 +0000)]
a10_ahci: Correct clock indices for new bindings

r329104 imported 4.15 DTS which brought CCU to a10/a20. In the process, they
swapped the ordering of 'clocks' for allwinner,sun4i-a10-ahci on both
sun4i-a10 and sun7i-a20 from PLL, Gate to Gate, PLL.

Swap it in the driver.

6 years agoaw_ccung: Add a10/a20 support
Kyle Evans [Thu, 14 Jun 2018 17:50:29 +0000 (17:50 +0000)]
aw_ccung: Add a10/a20 support

Note: At this time, this has only been tested on a single board from one of
the supported SoCs. This is enough to boot the board from MMC and have
functional USB- which is still an improvement over where we were at just
before with no functional clocks.

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

6 years agoaw_ccung: Support clock factors where factor=0, factor is effectively 1
Kyle Evans [Thu, 14 Jun 2018 17:36:02 +0000 (17:36 +0000)]
aw_ccung: Support clock factors where factor=0, factor is effectively 1

This happens in two cases for a20 clocks:

pll_core for 'n' factor:
factor=0, val=1
factor=n, val=n

ahb divisor:
factor=0,val=/2
factor=n,val=/2^n

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

6 years agoarm timer: Use the default get_cntxct by default
Emmanuel Vadot [Thu, 14 Jun 2018 17:32:23 +0000 (17:32 +0000)]
arm timer: Use the default get_cntxct by default

Reported by: kevans

6 years agoSplit the PowerISA 3.0 HPT implementation from historic
Justin Hibbits [Thu, 14 Jun 2018 17:23:51 +0000 (17:23 +0000)]
Split the PowerISA 3.0 HPT implementation from historic

PowerISA 3.0 makes several changes to not only the format of the HPT but
also the behavior surrounding it.  For instance, TLBIE no longer requires
serialization.  Removing this lock cuts buildworld time in half on a
18-core/72-thread POWER9 system, demonstrating that this lock is highly
contended on such a system.

There was odd behavior observed trying to make this change in a
backwards-compatible manner in moea64_native.c, so the best option was to
fully split it, and largely revert the original changes adding POWER9
support to the original file.

Suggested by: nwhitehorn

6 years agomx25l: Add pnp info
Emmanuel Vadot [Thu, 14 Jun 2018 17:21:09 +0000 (17:21 +0000)]
mx25l: Add pnp info

6 years agospi: Add SPIBUS_PNP_INFO macro
Emmanuel Vadot [Thu, 14 Jun 2018 17:20:47 +0000 (17:20 +0000)]
spi: Add SPIBUS_PNP_INFO macro

The PNP info string is the same as the SIMPLEBUS one but driver should
depend on spibus and not simplebus

6 years agoaw_spi: Add pnp info
Emmanuel Vadot [Thu, 14 Jun 2018 17:19:44 +0000 (17:19 +0000)]
aw_spi: Add pnp info

6 years agoarm timer: Add workaround for Allwinner A64 timer
Emmanuel Vadot [Thu, 14 Jun 2018 17:18:15 +0000 (17:18 +0000)]
arm timer: Add workaround for Allwinner A64 timer

The timer present in allwinner A64 SoC is unstable, value can jump backward
or forward.
It was found that when bit 11 and upper roll over the low bits can sometimes
being read as all as 1 or all as 0.
Simply ignore the values for those cases.

6 years agoFix da(4) locking when probing SMR drives.
Kenneth D. Merry [Thu, 14 Jun 2018 17:08:44 +0000 (17:08 +0000)]
Fix da(4) locking when probing SMR drives.

Probing host aware and host managed SMR drives got broken in revision
330796.

The added cam_periph_lock() calls were in areas in dadone() where
the peripheral lock was already held.

Since then, dadone() has been split into separate functions that are
dedicated to each probe state.

The result is that when probing a host aware drive, I ran into a recursive
lock acquisition in dadone_probeatalogdir(). I would have run into the
same problem in dadone_probeataiddir(), and in dadone_probeatasup() and
dadone_probeatazone() in the error paths had the probe continued.

The solution is to take out all of the extra cam_periph_lock() calls. I
also added cam_periph_assert(periph, MA_OWNED) near the top of each of
the dadone_* calls. These make it clear to anyone coming along in the
the future that the lock is held in the probe done functions.

Also add a locking assert in daprobedone(), to make it clear that it must
be called with the periph lock held.

Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D15764

6 years agolibsa: open() should use NULL instead of typecasted 0
Toomas Soome [Thu, 14 Jun 2018 16:11:50 +0000 (16:11 +0000)]
libsa: open() should use NULL instead of typecasted 0

6 years agodevmatch: Address some rc nits
Kyle Evans [Thu, 14 Jun 2018 16:09:29 +0000 (16:09 +0000)]
devmatch: Address some rc nits

- devmatch_enable in rc.conf(5) was not gating the start of devmatch

- Use quietstart in devd/devmatch to suppress dozens of 'Cannot start'
  messages and other spurious messages from rc.subr(8) that aren't
  necessarily helpful.

Discussed with: imp

6 years agoFix CTR formatting for moea64_native bootstrap
Justin Hibbits [Thu, 14 Jun 2018 16:01:11 +0000 (16:01 +0000)]
Fix CTR formatting for moea64_native bootstrap

On very large memory systems 'size' can become 2GB or larger, resulting in a
negative value being formatted.  Also, moea64_pteg_count is already a long, so
format it as such.

6 years agoaudit(4): add tests for fhopen, fhstat, and fhstatfs
Alan Somers [Thu, 14 Jun 2018 15:04:49 +0000 (15:04 +0000)]
audit(4): add tests for fhopen, fhstat, and fhstatfs

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15798

6 years agoAdd missing BPF_MTAP2() for outbound packets.
Andrey V. Elsukov [Thu, 14 Jun 2018 15:04:30 +0000 (15:04 +0000)]
Add missing BPF_MTAP2() for outbound packets.

6 years agoConvert if_me(4) driver to use encap_lookup_t method and be lockless on
Andrey V. Elsukov [Thu, 14 Jun 2018 14:53:24 +0000 (14:53 +0000)]
Convert if_me(4) driver to use encap_lookup_t method and be lockless on
data path.

6 years agoaudit(4): fix typo from r335136
Alan Somers [Thu, 14 Jun 2018 14:53:01 +0000 (14:53 +0000)]
audit(4): fix typo from r335136

Typo in Makefile accidentally disabled some older tests

MFC after: 2 weeks
X-MFC-With: 335136

6 years agoaudit(4): add tests for flock, fcntl, and fsync
Alan Somers [Thu, 14 Jun 2018 13:42:58 +0000 (13:42 +0000)]
audit(4): add tests for flock, fcntl, and fsync

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15795

6 years agolinuxolator/amd64: Don't mangle %r10 on return from syscall for EJUSTRETURN.
Konstantin Belousov [Thu, 14 Jun 2018 12:35:57 +0000 (12:35 +0000)]
linuxolator/amd64: Don't mangle %r10 on return from syscall for EJUSTRETURN.

This fixes the %r10 content for rt_sigreturn.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
MFC after: 1 week

6 years agotop(1): remove myself from top.1
Eitan Adler [Thu, 14 Jun 2018 12:14:51 +0000 (12:14 +0000)]
top(1): remove myself from top.1

I wrote some, but not enough for the man page.

6 years agoIn m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested.
Andrey V. Elsukov [Thu, 14 Jun 2018 11:15:39 +0000 (11:15 +0000)]
In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested.

It is better to try allocate a big mbuf, than just silently drop a big
packet. A better solution could be reworking of libalias modules to be
able use m_copydata()/m_copyback() instead of requiring the single
contiguous buffer.

PR: 229006
MFC after: 1 week

6 years agoReorganize code flow in fpudna()/npxdna() to highlight the critical
Konstantin Belousov [Thu, 14 Jun 2018 11:09:51 +0000 (11:09 +0000)]
Reorganize code flow in fpudna()/npxdna() to highlight the critical
section scope.  Sprinkle __predict_false() for conditions known to
never occur or occur only on rare platforms.

Sponsored by: The FreeBSD Foundation

6 years agoRemove printf() in #NM handler.
Konstantin Belousov [Thu, 14 Jun 2018 10:33:26 +0000 (10:33 +0000)]
Remove printf() in #NM handler.

Give up and remove the almost useless informational message reporting
that device not available exception occured while our state tracking
indicates the current CPU has FPU context loaded for the current
thread.

It seems that this is recurring bug with some VM monitors.

Sponsored by: The FreeBSD Foundation

6 years agoMove four functions in nfscl.ko to nfscommon.ko.
Rick Macklem [Thu, 14 Jun 2018 10:00:19 +0000 (10:00 +0000)]
Move four functions in nfscl.ko to nfscommon.ko.

Four functions nfscl_reqstart(), nfscl_fillsattr(), nfsm_stateidtom()
and nfsmnt_mdssession() are now called from within the nfsd.
As such, they needed to be moved from nfscl.ko to nfscommon.ko so that
nfsd.ko would load when nfscl.ko wasn't loaded.

Reported by: herbert@gojira.at

6 years agoAdd NULL check like the rest of code has.
Andrey V. Elsukov [Thu, 14 Jun 2018 09:36:25 +0000 (09:36 +0000)]
Add NULL check like the rest of code has.

It is possible that ifma_protospec becomes NULL in this function for
some entry, but it is still referenced and thus it will not unlinked
from the list. Then "restart" condition triggers and this entry with
NULL ifma_protospec will lead to page fault.

PR: 228982

6 years agoRemove stale comment. in6_ifdetach() can be called from places
Andrey V. Elsukov [Thu, 14 Jun 2018 09:29:39 +0000 (09:29 +0000)]
Remove stale comment.  in6_ifdetach() can be called from places
where addresses are not removed yet.

6 years agolibsa: remobe unneeded check before free()
Toomas Soome [Thu, 14 Jun 2018 09:10:34 +0000 (09:10 +0000)]
libsa: remobe unneeded check before free()

free() is checking for NULL, remove duplicate check.

6 years agolibsa: f_rabuf could be NULL
Toomas Soome [Thu, 14 Jun 2018 09:06:53 +0000 (09:06 +0000)]
libsa: f_rabuf could be NULL

It is possible that we will not get RA buffer from open(), therefore
we must validate RA.

6 years agolibsa: cstyle cleanup for open/close/read/write sources
Toomas Soome [Thu, 14 Jun 2018 08:58:10 +0000 (08:58 +0000)]
libsa: cstyle cleanup for open/close/read/write sources

6 years agork_i2c: Add manpage for this driver
Emmanuel Vadot [Thu, 14 Jun 2018 07:59:47 +0000 (07:59 +0000)]
rk_i2c: Add manpage for this driver

6 years agoRevert r335094 and properly fix OFED build after r335053.
Hans Petter Selasky [Thu, 14 Jun 2018 07:55:10 +0000 (07:55 +0000)]
Revert r335094 and properly fix OFED build after r335053.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agodts: Update our copy to Linux 4.17
Emmanuel Vadot [Thu, 14 Jun 2018 07:12:10 +0000 (07:12 +0000)]
dts: Update our copy to Linux 4.17

6 years agodts: Import files from Linux 4.17
Emmanuel Vadot [Thu, 14 Jun 2018 06:56:07 +0000 (06:56 +0000)]
dts: Import files from Linux 4.17

6 years agobootprog_info is generated in vers.c. Move it's definition to
Warner Losh [Thu, 14 Jun 2018 06:41:33 +0000 (06:41 +0000)]
bootprog_info is generated in vers.c. Move it's definition to
bootstrap.h and remove all the redundant copies.

Sponsored by: Netflix

6 years agoUse bool for vargood, since it's a boolean.
Warner Losh [Thu, 14 Jun 2018 06:41:22 +0000 (06:41 +0000)]
Use bool for vargood, since it's a boolean.

Sponsored by: Netflix

6 years agoAdd modules/rockchip
Emmanuel Vadot [Thu, 14 Jun 2018 06:40:59 +0000 (06:40 +0000)]
Add modules/rockchip

Build rockchip modules as part of buildkernel.
Add the i2c controller module.

6 years agork_i2c: Add driver for the I2C controller present in RockChip SoC
Emmanuel Vadot [Thu, 14 Jun 2018 06:39:33 +0000 (06:39 +0000)]
rk_i2c: Add driver for the I2C controller present in RockChip SoC

This controller have a special mode for RX to help with smbus-like transfer
when the controller will automatically send the slave address, register address
and read the data. Use it when possible.
The same mode for TX is describe is the datasheet but is broken and have been
since ~10 years of presence of this controller in RockChip SoCs.

Attach this driver early at we need it to communicate with the PMIC early in the
boot.
Do not hook it to the kernel build for now.

6 years agork3328: Add support for the i2c clocks
Emmanuel Vadot [Thu, 14 Jun 2018 06:34:27 +0000 (06:34 +0000)]
rk3328: Add support for the i2c clocks

6 years agoif_dwc_rk: Add DesignWare driver for RockChip SoCs.
Emmanuel Vadot [Thu, 14 Jun 2018 06:28:09 +0000 (06:28 +0000)]
if_dwc_rk: Add DesignWare driver for RockChip SoCs.

Add driver for the designware ethernet controller found in some RockChip SoCs.
The driver still rely on a lot of things setup by the bootloader like clocks
and phy mode.
But since netbooting is the only/easiest way to boot rockchip board at the
moment add the driver so other people can test/dev on thoses boards.

6 years agoRemove redundant defs.mk includes. They aren't needed.
Warner Losh [Thu, 14 Jun 2018 06:14:48 +0000 (06:14 +0000)]
Remove redundant defs.mk includes. They aren't needed.

6 years agork_armclk: Add the write mask to the register mux value
Emmanuel Vadot [Thu, 14 Jun 2018 05:46:57 +0000 (05:46 +0000)]
rk_armclk: Add the write mask to the register mux value

This was omitted in r334112 and r334996 which cause the PLL to not correctly
reparent, leaving the armclk to be derived from the APLL instead of the NPLL.
The arm core clock is now correctly set to 600Mhz via the assigned-clock present
in the DTB.