]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoReplace send-mail with the more standarized sendmail, we do not create
delphij [Wed, 27 Dec 2017 06:23:50 +0000 (06:23 +0000)]
Replace send-mail with the more standarized sendmail, we do not create
links for send-mail in mailwrapper so it did not work anyway.

MFC after: 2 weeks

6 years agoDon't initialize lastlong before assigning it.
delphij [Wed, 27 Dec 2017 05:59:47 +0000 (05:59 +0000)]
Don't initialize lastlong before assigning it.

MFC after: 2 weeks

6 years agoother: Fix several typos and minor errors
eadler [Wed, 27 Dec 2017 03:23:58 +0000 (03:23 +0000)]
other: Fix several typos and minor errors

- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by: imp, benno

6 years agolib: Fix several typos and minor errors
eadler [Wed, 27 Dec 2017 03:23:41 +0000 (03:23 +0000)]
lib: Fix several typos and minor errors

- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by: imp, benno

6 years agokernel: Fix several typos and minor errors
eadler [Wed, 27 Dec 2017 03:23:21 +0000 (03:23 +0000)]
kernel: Fix several typos and minor errors

- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by: imp, benno

6 years agouserland: Fix several typos and minor errors
eadler [Wed, 27 Dec 2017 03:23:01 +0000 (03:23 +0000)]
userland: Fix several typos and minor errors

- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by: imp, benno

6 years agoMissing disk close in libufs.
mckusick [Tue, 26 Dec 2017 23:16:11 +0000 (23:16 +0000)]
Missing disk close in libufs.

6 years agoAdd a section describing how to tune ARM kernel options to use an MD_ROOT
ian [Tue, 26 Dec 2017 22:05:55 +0000 (22:05 +0000)]
Add a section describing how to tune ARM kernel options to use an MD_ROOT
filesystem larger than about 50-55 MiB.

The description of VM_KMEM_SIZE_SCALE is roughly as hand-wavy as my
understanding of the option, but at least mentioning that it's a factor
and giving an empirical datapoint that works will give folks some idea
of what to tweak if they have problems.

6 years ago[mips] fix compilation of TP-WN1043ND kernel configuration
mizhka [Tue, 26 Dec 2017 19:50:23 +0000 (19:50 +0000)]
[mips] fix compilation of TP-WN1043ND kernel configuration

This compilation issue has been found thanks to freebsd-wifi-build:
 - gpioiic requires "gpio_if.h", so "device gpio" is mandatory
 - rtl8366rb works over MDIO interface, so "device mdio" is mandatory

Compilation is checked on FreeBSD 12-CURRENT machine.

6 years agoAdd a new ARM kernel option, LOCORE_MAP_MB, to control the size of the
ian [Tue, 26 Dec 2017 19:02:56 +0000 (19:02 +0000)]
Add a new ARM kernel option, LOCORE_MAP_MB, to control the size of the
kernel VA mapping in the temporary page tables set up by locore-v6.S.

The number used to be hard-coded to 64MB, which is still the default if
the kernel option is not specified.  However, 64MB is insufficient for
using a large mdroot filesystem.  The hard-coded number can't be safely
increased because too large a number may run into memory-mapped IO space
on some SoCs that must not be mapped as ordinary memory.

6 years agoComplete the changing of the old "i2c-address" property to the modern "reg"
ian [Tue, 26 Dec 2017 18:42:29 +0000 (18:42 +0000)]
Complete the changing of the old "i2c-address" property to the modern "reg"
property by updating the description text to match the updated example.

This should have been part of r327220

6 years agoUpdate the FDT example for the lm75 sensor to match current devicetree
ian [Tue, 26 Dec 2017 18:34:07 +0000 (18:34 +0000)]
Update the FDT example for the lm75 sensor to match current devicetree
standards and what the existing driver expects.

Also change 'like' to 'such as' where the text is providing an example
rather than a simile.

6 years agoreadelf: report byte size for DT_PREINIT_ARRAYSZ
emaste [Tue, 26 Dec 2017 18:10:34 +0000 (18:10 +0000)]
readelf: report byte size for DT_PREINIT_ARRAYSZ

Sponsored by: The FreeBSD Foundation

6 years agoRefactor vm_map_find(), creating a separate function, vm_map_alignspace(),
alc [Tue, 26 Dec 2017 17:59:37 +0000 (17:59 +0000)]
Refactor vm_map_find(), creating a separate function, vm_map_alignspace(),
for finding aligned free space in the given map.  With this change, we
always return KERN_NO_SPACE when we fail to find free space.  Whereas,
previously, we might return KERN_INVALID_ADDRESS.  Also, with this change,
we explicitly check for address wrap, rather than relying upon the map's
min and max addresses to establish sentinel-like regions.

This refactoring was inspired by the problem that we addressed in r326098.

Reviewed by: kib
Tested by: pho
Discussed with: markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D13346

6 years agoman4: Move back allwinner man page to share/man/man4
manu [Tue, 26 Dec 2017 16:50:49 +0000 (16:50 +0000)]
man4: Move back allwinner man page to share/man/man4

But only install them for arm or aarch64 since they are used on both arch.

6 years agoextres/syscon: Commit missing bits from r327106
kevans [Tue, 26 Dec 2017 16:38:04 +0000 (16:38 +0000)]
extres/syscon: Commit missing bits from r327106

r327106 introduced kobj to syscon so it can be subclassed and fit in with
the rest of the syscon framework. The diff for syscon.c was misapplied in a
clean tree prior to commit, so bring it back to what was included in the
review and tested. The entire file has basically been rewritten from what
was present prior to the kobj work.

Pointy hat to: me

6 years agoWhite cleanups.
tuexen [Tue, 26 Dec 2017 16:33:55 +0000 (16:33 +0000)]
White cleanups.

6 years agoEnsure that pass > 0 when starting a scan with vm_pages_needed == 1.
markj [Tue, 26 Dec 2017 16:29:39 +0000 (16:29 +0000)]
Ensure that pass > 0 when starting a scan with vm_pages_needed == 1.

Otherwise the page daemon will not reclaim pages and thus will not
wake threads sleeping in VM_WAIT.

Reported and tested by: pho
Reviewed by: alc, kib
X-MFC with: r327168
Differential Revision: https://reviews.freebsd.org/D13640

6 years agosh: Don't leak wait* implementation details from jobs.c
jilles [Tue, 26 Dec 2017 16:23:18 +0000 (16:23 +0000)]
sh: Don't leak wait* implementation details from jobs.c

6 years agonandtool: Add missing mode for open() with O_CREAT
jilles [Tue, 26 Dec 2017 16:20:38 +0000 (16:20 +0000)]
nandtool: Add missing mode for open() with O_CREAT

If O_CREAT is given, open() needs a mode argument. Follow the umask by
passing 0666.

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

6 years agoMove arm specific man page to man4.arm subfolder
manu [Tue, 26 Dec 2017 16:13:20 +0000 (16:13 +0000)]
Move arm specific man page to man4.arm subfolder

Reported by: ian

6 years agoClearify CID 1008197.
tuexen [Tue, 26 Dec 2017 16:12:04 +0000 (16:12 +0000)]
Clearify CID 1008197.

MFC after: 3 days

6 years agoClearify issue reported in CID 1008198.
tuexen [Tue, 26 Dec 2017 16:06:11 +0000 (16:06 +0000)]
Clearify issue reported in CID 1008198.

MFC after: 3 days

6 years agoarm64: a10_gpio.c and a10_mmc.c were renamed aw_gpio.c and aw_mmc.c
manu [Tue, 26 Dec 2017 15:35:19 +0000 (15:35 +0000)]
arm64: a10_gpio.c and a10_mmc.c were renamed aw_gpio.c and aw_mmc.c

6 years agoFix CID 1008428.
tuexen [Tue, 26 Dec 2017 15:29:11 +0000 (15:29 +0000)]
Fix CID 1008428.

MFC after: 1 week

6 years agoFix CID 1008936.
tuexen [Tue, 26 Dec 2017 15:24:42 +0000 (15:24 +0000)]
Fix CID 1008936.

6 years agoAllow the first (and second) argument of sn_calloc() be a sum.
tuexen [Tue, 26 Dec 2017 14:37:47 +0000 (14:37 +0000)]
Allow the first (and second) argument of sn_calloc() be a sum.
This fixes a bug reported in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103
PR: 224103

6 years agoarm: a10_gpio.c was renamed aw_gpio.c
manu [Tue, 26 Dec 2017 14:34:38 +0000 (14:34 +0000)]
arm: a10_gpio.c was renamed aw_gpio.c

While here order files in files.allwinner

6 years agoWhen adding support for sending SCTP packets containing an ABORT chunk
tuexen [Tue, 26 Dec 2017 12:35:02 +0000 (12:35 +0000)]
When adding support for sending SCTP packets containing an ABORT chunk
to ipfw in https://svnweb.freebsd.org/changeset/base/326233,
a dependency on the SCTP stack was added to ipfw by accident.

This was noted by Kevel Bowling in https://reviews.freebsd.org/D13594
where also a solution was suggested. This patch is based on Kevin's
suggestion, but implements the required SCTP checksum computation
without any dependency on other SCTP sources.

While there, do some cleanups and improve comments.

Thanks to Kevin Kevin Browling for reporting the issue and suggesting
a fix.

6 years agoAllwinner: gpio: Rename driver to aw_gpio and add man page for it
manu [Tue, 26 Dec 2017 12:11:04 +0000 (12:11 +0000)]
Allwinner: gpio: Rename driver to aw_gpio and add man page for it

Reviewed by: bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D13617

6 years agoAllwinner: mmc: Rename driver to aw_mmc and add a man page for it
manu [Tue, 26 Dec 2017 12:06:56 +0000 (12:06 +0000)]
Allwinner: mmc: Rename driver to aw_mmc and add a man page for it

Reviewed by: bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D13616

6 years agoaw_rtc.4: Correct some error/style found by mandoc -Tlint
manu [Tue, 26 Dec 2017 10:59:54 +0000 (10:59 +0000)]
aw_rtc.4: Correct some error/style found by mandoc -Tlint

6 years agoFix typo
imp [Tue, 26 Dec 2017 04:07:18 +0000 (04:07 +0000)]
Fix typo

6 years agoaw_rsb.4: Remove useless .Re
manu [Mon, 25 Dec 2017 23:01:09 +0000 (23:01 +0000)]
aw_rsb.4: Remove useless .Re

6 years agoChange the remaining files using my personnal email address to my freebsd one
manu [Mon, 25 Dec 2017 22:09:25 +0000 (22:09 +0000)]
Change the remaining files using my personnal email address to my freebsd one

6 years ago.git*: add gitattributes and gitignore
eadler [Mon, 25 Dec 2017 21:07:54 +0000 (21:07 +0000)]
.git*: add gitattributes and gitignore

For users of the git mirrors, lets provide useful git configuration
files.

6 years agoIntroduce an architecture-agnostic <sys/_stdarg.h> to reduce
phk [Mon, 25 Dec 2017 20:54:00 +0000 (20:54 +0000)]
Introduce an architecture-agnostic <sys/_stdarg.h> to reduce
platform divergence.

Only architectures which pass arguments in registers (mips)
and platforms which use really weird compilers (any?) would
need to augment the contents of <sys/_stdarg.h>

Convert x86, arm and arm64 architectures to use <sys/_stdarg.h>

6 years agofsync(3): correctly document return values
eadler [Mon, 25 Dec 2017 19:49:05 +0000 (19:49 +0000)]
fsync(3): correctly document return values

In r268924 the behavior of fflush was changed to return success
on read only streams. Document this.

Reported by: zrj@DragonFlyBSD.org

6 years agoaw_rtc: Add man page for this driver
manu [Mon, 25 Dec 2017 19:42:04 +0000 (19:42 +0000)]
aw_rtc: Add man page for this driver

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D13621

6 years agoMake the vm object bypass and collapse counters per CPU.
alc [Mon, 25 Dec 2017 19:36:04 +0000 (19:36 +0000)]
Make the vm object bypass and collapse counters per CPU.

Requested by: mjg
Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13611

6 years agoDoh! Never test in one tree and commit from another:
imp [Mon, 25 Dec 2017 19:08:39 +0000 (19:08 +0000)]
Doh! Never test in one tree and commit from another:

Fix typo: devmath -> devmatch

Sponsored by: Krampus! Carting off naughty committers for millennia

6 years agoMatch unattached devices on the system to potential kernel modules.
imp [Mon, 25 Dec 2017 18:56:08 +0000 (18:56 +0000)]
Match unattached devices on the system to potential kernel modules.

devmatch(8) matchs up devices in the system device tree with drivers
that may match them. For each unattached device in the system, it
tries to find matching PNP info in the linker hints and prints modules
to load to claim the devices.

In --unbound mode, devmatch can look for drivers that have attached to
devices in the device tree and have plug and play information, but for
which no PNP info exists. This helps find drivers that haven't been
converted yet that are in use on this system.

In addition, the ability to dump out linker.hints is provided.

Future commits will add hooks to devd.conf and rc.d to fully automate
using this information.

6 years agoallwinner: aw_usbphy is also needed for ohci
manu [Mon, 25 Dec 2017 16:40:09 +0000 (16:40 +0000)]
allwinner: aw_usbphy is also needed for ohci

6 years agoAllwinner: Remove unused aw_console driver.
manu [Mon, 25 Dec 2017 16:27:36 +0000 (16:27 +0000)]
Allwinner: Remove unused aw_console driver.

6 years agoDo pass removing some write-only variables from the kernel.
kan [Mon, 25 Dec 2017 04:48:39 +0000 (04:48 +0000)]
Do pass removing some write-only variables from the kernel.

This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385

6 years agoFix two problems with the page daemon control loop.
markj [Sun, 24 Dec 2017 19:45:16 +0000 (19:45 +0000)]
Fix two problems with the page daemon control loop.

Both issues caused the page daemon to erroneously go to sleep when
applications are consuming free pages at a high rate, leaving the
application threads blocked in VM_WAIT.

1) After completing an inactive queue scan, concurrent allocations may
   have prevented the page daemon from meeting the v_free_min threshold.
   In this case, the page daemon was going to sleep even when the
   inactive queue contained plenty of clean pages.
2) pagedaemon_wakeup() may be called without the free queues lock held.
   This can lead to a lost wakeup if a call occurs after the page daemon
   clears vm_pageout_wanted but before going to sleep.

Fix 1) by ensuring that we start a new inactive queue scan immediately
if v_free_count < v_free_min after a prior scan.

Fix 2) by adding a new subroutine, pagedaemon_wait(), called from
vm_wait() and vm_waitpfault(). It wakes up the page daemon if either
vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps
on v_free_count.

Reported by: jeff
Reviewed by: alc
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13424

6 years agoRemove obsolete register keyword from opensolaris's sysmacros.h. When
dim [Sun, 24 Dec 2017 19:17:15 +0000 (19:17 +0000)]
Remove obsolete register keyword from opensolaris's sysmacros.h.  When
compiling zfsd with recent clang, it leads to a warning about the
register storage class being incompatible with C++17.

MFC after: 3 days

6 years agoFurther investigation shows this shouldn't have been added at all.
imp [Sun, 24 Dec 2017 17:59:48 +0000 (17:59 +0000)]
Further investigation shows this shouldn't have been added at all.
Remove it.

6 years agoFix clang 6.0.0 compiler warnings in binutils
dim [Sun, 24 Dec 2017 16:51:59 +0000 (16:51 +0000)]
Fix clang 6.0.0 compiler warnings in binutils

Latest clang git has a warning -Wnull-pointer-arithmetic which will
trigger a -Werror failure. Addition and subtraction from a null pointer
is undefined behaviour and could be optimized into anything.

Furthermore, using the difference between two pointers and casting the
result back to a pointer is not portable since the size of ptrdiff_t
does not necessary have to be the same as size of void* (this happens
e.g. on CHERI). Using intptr_t instead fixes this portability issue and
the compiler warning.

Submitted by; Alexander Richardson
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D12928
MFC after: 3 days

6 years agoRemove write-only opt and useless optlen variables.
kan [Sun, 24 Dec 2017 16:39:57 +0000 (16:39 +0000)]
Remove write-only opt and useless optlen variables.

This squashes the warning gebnerated by GCC 6.x. Since
variables that are now removed had come documentation
value, put relevant bits in comment, so they can be
resurrected from there when actually needed.

6 years agoComment this out until I have time to get to the bottom of why it's
imp [Sun, 24 Dec 2017 16:36:50 +0000 (16:36 +0000)]
Comment this out until I have time to get to the bottom of why it's
failing for some people.

6 years agoFollow-up to r326375, by moving the block that disables errors on the
dim [Sun, 24 Dec 2017 16:34:54 +0000 (16:34 +0000)]
Follow-up to r326375, by moving the block that disables errors on the
new clang 6.0.0 -Wtautological-constant-compare warning to the WARNS <=
6 level.  (This warning is still being worked on upstream to reduce
false positives, but it is currently still too trigger happy.)

6 years agoFix rule number truncation, use uint16_t type to specify rulenum.
ae [Sun, 24 Dec 2017 01:55:12 +0000 (01:55 +0000)]
Fix rule number truncation, use uint16_t type to specify rulenum.

PR: 224555
MFC after: 1 week

6 years agosh(1): Markup and spelling fixes
jilles [Sat, 23 Dec 2017 22:58:19 +0000 (22:58 +0000)]
sh(1): Markup and spelling fixes

6 years agoWarn when nonPNP ISA devices are attached in GENERIC that they are
imp [Sat, 23 Dec 2017 22:57:14 +0000 (22:57 +0000)]
Warn when nonPNP ISA devices are attached in GENERIC that they are
being removed from GENERIC in 12. Always print PNP info for ISA when
it exists: it doesn't depend on ISAPNP. Add PNP ID to orm and vga to
prevent us from warning about them since those devices aren't being
removed from GENERIC. PNP devices will be removed from GENERIC too,
but they will be automatically loaded, so need no warning. We don't
warn for non-GENERIC kernels because people running them are presumed
to know what they are doing.

MFC After: 2 weeks

6 years agoAdd missed AVX512VL (128 and 256 bit vector length) extension
kib [Sat, 23 Dec 2017 21:32:50 +0000 (21:32 +0000)]
Add missed AVX512VL (128 and 256 bit vector length) extension
identification bit.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agocalendar: add missing header file
eadler [Sat, 23 Dec 2017 21:04:32 +0000 (21:04 +0000)]
calendar: add missing header file

time.h is required for strftime and struct tm

Reviewed by: edje

6 years agoldd: avoid statically linked executables in example
eadler [Sat, 23 Dec 2017 19:48:57 +0000 (19:48 +0000)]
ldd: avoid statically linked executables in example

The example works but spews warnings if run over a directory with
statically linked binaries.

PR: 211024
Submitted by: mike@skew.org

6 years agoIntroduce the daemonfd function.
oshogbo [Sat, 23 Dec 2017 18:07:43 +0000 (18:07 +0000)]
Introduce the daemonfd function.

The daemonfd function is equivalent to the daemon(3) function expect that
arguments are descriptors. For example dhclient(8) which is sandboxed is
unable to open /dev/null to close stdio instead it's allows to fail
daemon(3) function to close the descriptors and then do it explicit in code.
Instead of such hacks we can use now daemonfd.

This API can be also helpful to migrate system to platforms like CheriBSD.

Reviewed by: brooks@, bcr@, jilles@ (earlier version)
Differential Revision: https://reviews.freebsd.org/D13433

6 years agoReverse the check to allocate the buffer if cached pointer is NULL.
kan [Sat, 23 Dec 2017 17:55:19 +0000 (17:55 +0000)]
Reverse the check to allocate the buffer if cached pointer is NULL.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D13596

6 years agoRemove dead store to local variable.
kan [Sat, 23 Dec 2017 16:49:57 +0000 (16:49 +0000)]
Remove dead store to local variable.

6 years agoSilence clang analyzer false positive.
kan [Sat, 23 Dec 2017 16:45:26 +0000 (16:45 +0000)]
Silence clang analyzer false positive.

clang does not know that two lookup calls will return the same
pointer, so it assumes correctly that using the old pointer
after dropping the reference to it is a bit risky.

6 years agoDo not pass NULL pointer to copyout in if_clone_list.
kan [Sat, 23 Dec 2017 16:45:24 +0000 (16:45 +0000)]
Do not pass NULL pointer to copyout in if_clone_list.

Sometimes caller is only interested in how many clones
are there and NULL pointer is passed for the destination
buffer. Do not pass it to copyout then.

6 years agoRemove dead initialization of the inode pointer.
kan [Sat, 23 Dec 2017 16:24:02 +0000 (16:24 +0000)]
Remove dead initialization of the inode pointer.

The pointer gets initialized again later in the code. This also
improves code style(9).

6 years agoRemove some trailing whitespace.
kan [Sat, 23 Dec 2017 16:24:00 +0000 (16:24 +0000)]
Remove some trailing whitespace.

Reviewed by: glebius, ae
Differential Revision: https://reviews.freebsd.org/D10386

6 years agoDo not double free the memory in if_clone.
kan [Sat, 23 Dec 2017 16:23:58 +0000 (16:23 +0000)]
Do not double free the memory in if_clone.

if_clone_attach function will drop the reference on failure  which will
free the if_clone structure. No need to do it second time.

Reviewed by: glebius, ae
Differential Revision: https://reviews.freebsd.org/D10386

6 years agoMove syscon into extres framework
kevans [Sat, 23 Dec 2017 14:30:44 +0000 (14:30 +0000)]
Move syscon into extres framework

This should help reduce confusion between syscon/syscons a little bit.
syscon is a resource generally modeled by FDT platforms, and not to be
confused with syscons.

6 years agosyscon: Introduce kobj and split out fdt bits
kevans [Sat, 23 Dec 2017 14:27:42 +0000 (14:27 +0000)]
syscon: Introduce kobj and split out fdt bits

Allow more flexibility by kobj'ifying syscon and splitting out fdt specific
bits in preparation of a move to the extres framework.

The generic fdt driver has been moved to syscon_generic.c and the fdt
requirement has been removed from the syscon interface, as is common to the
extres framework.

Reviewed by: strejda
Differential Revision: https://reviews.freebsd.org/D13521

6 years agoFix cut-and-paste error s/pccard/isa/
imp [Sat, 23 Dec 2017 07:02:45 +0000 (07:02 +0000)]
Fix cut-and-paste error s/pccard/isa/

6 years agoCreate a new ISA_PNP_INFO macro. Use this macro every where we have
imp [Sat, 23 Dec 2017 06:49:27 +0000 (06:49 +0000)]
Create a new ISA_PNP_INFO macro. Use this macro every where we have
ISA PNP card support (replace by hand version in if_ed). Move module
declarations to the end of some files. Fix PCCARD_PNP_INFO to use
nitems(). Remove some stale comments about pc98, turns out the comment
was simply wrong.

6 years agoExpand cryptic comment with inforation I've learned in the mean time
imp [Sat, 23 Dec 2017 06:11:19 +0000 (06:11 +0000)]
Expand cryptic comment with inforation I've learned in the mean time
about CIS3/CIS4, including studies I've done on my large collection of
PC Cards bought off e-bay over the years since the original entry as
well as conversations I've had at conferences.

6 years agoThese drivers have a sentinel at the end of the device list. Exclude
imp [Sat, 23 Dec 2017 05:32:20 +0000 (05:32 +0000)]
These drivers have a sentinel at the end of the device list. Exclude
it.

6 years agofopen.1: document truncation
eadler [Sat, 23 Dec 2017 05:13:39 +0000 (05:13 +0000)]
fopen.1: document truncation

This documentation truncation similar to POSIX and glibc.

PR: 202545
Reported by: intron@intron.ac

6 years agoThe device tables end with a sentinel in iflib. Don't include the
imp [Sat, 23 Dec 2017 04:50:52 +0000 (04:50 +0000)]
The device tables end with a sentinel in iflib. Don't include the
sentinel in the output.

6 years agoRemove mips MD atomic_load_64 and atomic_store_64.
kib [Fri, 22 Dec 2017 23:27:03 +0000 (23:27 +0000)]
Remove mips MD atomic_load_64 and atomic_store_64.

The only users of the functions were db_read_bytes() and
db_write_bytes() ddb(4) interfaces.  Replace the calls with direct
reads and writes, which are automatically atomic on 64bits and n32.

Note that removed assembler implementation for mips32 is not atomic
anyway.

Reviewed by: jhb
Discussed with: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13586

6 years agoDrop the NetBSD rcs tag introduced in r326868.
sevan [Fri, 22 Dec 2017 21:54:39 +0000 (21:54 +0000)]
Drop the NetBSD rcs tag introduced in r326868.

Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D13511

6 years agoFix typos from last commit, these should have been #.
imp [Fri, 22 Dec 2017 20:48:49 +0000 (20:48 +0000)]
Fix typos from last commit, these should have been #.

6 years agoAdd AHCI/XHCI device IDs found on AMD Ryzen+B350 system.
mav [Fri, 22 Dec 2017 20:44:21 +0000 (20:44 +0000)]
Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system.

MFC after: 2 weeks

6 years agocxgbe(4): Do not forward interrupts to queues with freelists. This
np [Fri, 22 Dec 2017 19:10:19 +0000 (19:10 +0000)]
cxgbe(4): Do not forward interrupts to queues with freelists.  This
leaves the firmware event queue (fwq) as the only queue that can take
interrupts for others.

This simplifies cfg_itype_and_nqueues and queue allocation in the driver
at the cost of a little (never?) used configuration.  It also allows
service_iq to be split into two specialized variants in the future.

MFC after: 2 months
Sponsored by: Chelsio Communications

6 years agoUse '#' rather than some made up name for fields we want to ignore.
imp [Fri, 22 Dec 2017 17:53:27 +0000 (17:53 +0000)]
Use '#' rather than some made up name for fields we want to ignore.

6 years agoUpdate HISTORY section for the atomic(9) page.
kib [Fri, 22 Dec 2017 17:52:38 +0000 (17:52 +0000)]
Update HISTORY section for the atomic(9) page.

In collaboration with: alc
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week

6 years agoSPDX: Reverse License ID tags from the lmc driver.
pfg [Fri, 22 Dec 2017 17:15:02 +0000 (17:15 +0000)]
SPDX: Reverse License ID tags from the lmc driver.

While the BSD-2-Clause license is there, the GPLv2 is also present.
I am unsure of the implications of having both licenses as they are here.

I'll just leave it untagged and open for interpretation.

6 years agoNeed to NULL terminate this list. It worked before by accidental data
imp [Fri, 22 Dec 2017 17:13:54 +0000 (17:13 +0000)]
Need to NULL terminate this list. It worked before by accidental data
in the module following it that terminated the search.

6 years agoPC Card PNP tables are terminated by a NULL sentinel. This shouldn't
imp [Fri, 22 Dec 2017 16:59:50 +0000 (16:59 +0000)]
PC Card PNP tables are terminated by a NULL sentinel. This shouldn't
be recorded in the linker hints, so subtract one to omit it.

6 years agoAdd soft float abi caching form armv7, it would allow people with old
kevlo [Fri, 22 Dec 2017 01:46:25 +0000 (01:46 +0000)]
Add soft float abi caching form armv7,  it would allow people with old
binaries to run them.

Reviewed by: imp

6 years agoFix mips build after introduction of MD definitions of atomic_load_64
kib [Thu, 21 Dec 2017 23:39:00 +0000 (23:39 +0000)]
Fix mips build after introduction of MD definitions of atomic_load_64
and atomic_store_64.

The MD definitions are provided for LP64 only, while mips also uses
them for 32bit and n32.  Only define mips variants for 32bit and n32
and change the syntax to match common definitions.

Note that this commit does not fix 32bit asm implementation to follow
new KBI, this will be fixed later.  The functions are only used for 8
byte ddb accesses so the known bug does not prevent normal kernel
operations.

Sponsored by: The FreeBSD Foundation

6 years agoFix build for LP64 arches with gcc.
kib [Thu, 21 Dec 2017 23:08:10 +0000 (23:08 +0000)]
Fix build for LP64 arches with gcc.

gcc complaints that the comparision is always false due to the value
range, and the cast does not prevent the analysis.  Split the LP64
vs. ILP32 clamping as a workaround.

Sponsored by: The FreeBSD Foundation

6 years agoFix build for kernels with SCHED_4BSD.
kib [Thu, 21 Dec 2017 23:05:13 +0000 (23:05 +0000)]
Fix build for kernels with SCHED_4BSD.

Sponsored by: The FreeBSD Foundation

6 years agoWhen -v is specified with -p dev, print the same verbose output as
imp [Thu, 21 Dec 2017 19:19:43 +0000 (19:19 +0000)]
When -v is specified with -p dev, print the same verbose output as
when listing the whole tree. The list, however, is from the requested
device to the root (so it backwards from the normal tree).

Sponsored by: Netflix

6 years agoFix markup and bump .Dd.
imp [Thu, 21 Dec 2017 18:58:14 +0000 (18:58 +0000)]
Fix markup and bump .Dd.

6 years agoImplement "-p dev" to print the path to the given device back to the
imp [Thu, 21 Dec 2017 18:51:47 +0000 (18:51 +0000)]
Implement "-p dev" to print the path to the given device back to the
nexus. With redirection, could also be used to test if the device
exists in the device tree.

Sponsored by: Netflix

6 years agoRecognize a pending virtual interrupt while emulating the halt instruction.
tychon [Thu, 21 Dec 2017 18:30:11 +0000 (18:30 +0000)]
Recognize a pending virtual interrupt while emulating the halt instruction.

Reviewed by: grehan, rgrimes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13573

6 years agopatch: further cleanup to git-style diffs.
pfg [Thu, 21 Dec 2017 16:25:33 +0000 (16:25 +0000)]
patch: further cleanup to git-style diffs.

Fix adding and removing files with git-style a/ b/ diffs: only skip
six letters if they actually match "--- a/" and "+++ b/" instead of
laxer checks.

Obtained from: OpenBSD (CVS 1.59)

6 years agopatch: rejname[] is also -r option buffer, and should be PATH_MAX.
pfg [Thu, 21 Dec 2017 16:19:10 +0000 (16:19 +0000)]
patch: rejname[] is also -r option buffer, and should be PATH_MAX.

Obtained from: OpenBSD (CVS 1.64)

6 years agocxgbe(4): Read the MFG diags version from the VPD and make it available
np [Thu, 21 Dec 2017 15:19:43 +0000 (15:19 +0000)]
cxgbe(4):  Read the MFG diags version from the VPD and make it available
in the sysctl MIB.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years ago[boot/efi] scan all display modes rather than sequential try-fail way
mizhka [Thu, 21 Dec 2017 12:21:35 +0000 (12:21 +0000)]
[boot/efi] scan all display modes rather than sequential try-fail way

This patch allows to scan all display modes in boot1 as loader does.

Before system tried to select optimal display mode by sequential scan of
modes and if error then stop scanning. This way is not good, because
if mode N is not present, mode N+1 may exist.

In loader we use conout->Mode->MaxMode to identify maximum number of modes.
This commit is to use same way in boot1 as in loader.

Reported by: Andrey Pustovetov <andrey.pustovetov@gmail.com>
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D13541

6 years agoMake truss work for CloudABI executables on i386.
ed [Thu, 21 Dec 2017 09:21:40 +0000 (09:21 +0000)]
Make truss work for CloudABI executables on i386.

The system call convention is different from i386 binaries running on
FreeBSD/amd64, but this is not noticeable by executables. On
FreeBSD/amd64, the vDSO already does padding of arguments and return
values to 64-bit values. On i386, it does not, meaning that system call
return values are simply stored in registers.

6 years agoUse resume_cpus() instead of restart_cpus() to resume from ACPI suspension.
bde [Thu, 21 Dec 2017 09:17:48 +0000 (09:17 +0000)]
Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension.
restart_cpus() worked well enough by accident.  Before this set of fixes,
resume_cpus() used the same cpuset (started_cpus, meaning CPUs directed to
restart) as restart_cpus().  resume_cpus() waited for the wrong cpuset
(stopped_cpus) to become empty, but since mixtures of stopped and suspended
CPUs are not close to working, stopped_cpus must be empty when resuming so
the wait is null -- restart_cpus just allows the other CPUs to restart and
returns without waiting.

Fix resume_cpus() to wait on a non-wrong cpuset for the ACPI case, and
add further kludges to try to keep it working for the XEN case.  It
was only used for XEN.  It waited on suspended_cpus.  This works for
XEN.  However, for ACPI, resuming is a 2-step process.  ACPI has already
woken up the other CPUs and removed them from suspended_cpus.  This
fix records the move by putting them in a new cpuset resuming_cpus.
Waiting on suspended_cpus would give the same null wait as waiting on
stopped_cpus.  Wait on resuming_cpus instead.

Add a cpuset toresume_cpus to map the CPUs being told to resume to keep
this separate from the cpuset started_cpus for mapping the CPUs being told
to restart.  Mixtures of stopped and suspended/resuming CPUs are still far
from working.  Describe new and some old cpusets in comments.

Add further kludges to cpususpend_handler() to try to avoid breaking it
for XEN.  XEN doesn't use resumectx(), so it doesn't use the second
return path for savectx(), and it goes from the suspended state directly
to the restarted state, while ACPI resume goes through the resuming state.
Enter the resuming state early for all cases so that resume_cpus can test
for being in this state and not have to worry about the intermediate
!suspended state for ACPI only.

Reviewed by: kib

6 years agoProvide a nda man page. Add cross referneces. Bump dates.
imp [Thu, 21 Dec 2017 04:23:00 +0000 (04:23 +0000)]
Provide a nda man page. Add cross referneces. Bump dates.
Also, CAM is a storage subsystem, not a SCSI/ATA one these days.

Sponsored by: Netflix

6 years agoBump number that's an insane number of devices from 1,000 to 10,000. I
imp [Thu, 21 Dec 2017 04:21:59 +0000 (04:21 +0000)]
Bump number that's an insane number of devices from 1,000 to 10,000. I
have access to machines that are pushing 400 devices. When 1,000 was
selected, it was rare to get even 40 or 50 devices. Bump the limit by
10x to keep up with the times.

Sponsored by: Netflix