]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoDon't leak resources on duplicate -m or -M arguments. Last one wins.
Warner Losh [Thu, 28 Dec 2017 05:32:59 +0000 (05:32 +0000)]
Don't leak resources on duplicate -m or -M arguments. Last one wins.

CID: 12043851204384

6 years agoSPDX: fix wrong license ID tag in dev/cesa.
Pedro F. Giffuni [Thu, 28 Dec 2017 03:10:57 +0000 (03:10 +0000)]
SPDX: fix wrong license ID tag in dev/cesa.

6 years agoSPDX: fix wrong license ID tag in dev/spibus.
Pedro F. Giffuni [Thu, 28 Dec 2017 03:04:36 +0000 (03:04 +0000)]
SPDX: fix wrong license ID tag in dev/spibus.

6 years agoFix a few more speelling errors
Eitan Adler [Thu, 28 Dec 2017 01:31:28 +0000 (01:31 +0000)]
Fix a few more speelling errors

Reviewed by: bjk
Reviewed by: jilles (incl formal "accept")
Differential Revision: https://reviews.freebsd.org/D13650

6 years agoFix bug introduced in r326674, in which efi boot partitions created by
Nathan Whitehorn [Thu, 28 Dec 2017 01:21:30 +0000 (01:21 +0000)]
Fix bug introduced in r326674, in which efi boot partitions created by
the installer but not mounted (i.e. with boot1.efifat dd'ed to them
rather than the forthcoming proper filesystem) would get newfs_msdos run
on them immediately after the boot code was copied. This would overwrite
the bootstrap code, causing the EFI system partition to be blanked and
resulting in an unbootable system.

PR: 224562

6 years agoSPDX: fix wrong license ID tag in libkern.
Pedro F. Giffuni [Thu, 28 Dec 2017 01:20:30 +0000 (01:20 +0000)]
SPDX: fix wrong license ID tag in libkern.

6 years agoarm/ixp425: Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Pedro F. Giffuni [Thu, 28 Dec 2017 01:12:28 +0000 (01:12 +0000)]
arm/ixp425: Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.

This syncs us with NetBSD as much of our changes have been upstreamed.

Obtained from: NetBSD

6 years agoSPDX: fix license ID tags for arm/xscale.
Pedro F. Giffuni [Wed, 27 Dec 2017 22:47:56 +0000 (22:47 +0000)]
SPDX: fix license ID tags for arm/xscale.

Use parenthesis for grouping as suggested by the spec.

6 years agocxgbe/iw_cxgbe: Fix iWARP over VLANs (catch up with r326169).
Navdeep Parhar [Wed, 27 Dec 2017 22:44:50 +0000 (22:44 +0000)]
cxgbe/iw_cxgbe: Fix iWARP over VLANs (catch up with r326169).

Submitted by: KrishnamRaju ErapaRaju @ Chelsio
Sponsored by: Chelsio Communications

6 years agoIn preparation for converting to libufs to read the superblock,
Kirk McKusick [Wed, 27 Dec 2017 22:18:56 +0000 (22:18 +0000)]
In preparation for converting to libufs to read the superblock,
change conflicting function names:

getino => getinode
bread => blkread

No functional change.

6 years agosparc64: Update idprom.h.
Pedro F. Giffuni [Wed, 27 Dec 2017 22:01:30 +0000 (22:01 +0000)]
sparc64: Update idprom.h.

We only take a small part of the NetBSD file in sys/dev/sun/idprom.h.
Bring some comments and update the license.

Obtained from: NetBSD (CVS rev 1.3)

6 years agoarm: hdmi_if.m is already in files.arm
Emmanuel Vadot [Wed, 27 Dec 2017 21:58:19 +0000 (21:58 +0000)]
arm: hdmi_if.m is already in files.arm

Do not require it in files.vendor

6 years agoarm: Add kern/kern_clocksource.c to files.arm
Emmanuel Vadot [Wed, 27 Dec 2017 21:39:57 +0000 (21:39 +0000)]
arm: Add kern/kern_clocksource.c to files.arm

Instead of adding it to every files.vendor, add it to the common arch file.

6 years agoSPDX: Small for a license ID tags.
Pedro F. Giffuni [Wed, 27 Dec 2017 21:36:37 +0000 (21:36 +0000)]
SPDX: Small for a license ID tags.

Use parenthesis for grouping as suggested by the spec.

6 years agoSPDX: Fix some License ID tags for libc.
Pedro F. Giffuni [Wed, 27 Dec 2017 21:21:03 +0000 (21:21 +0000)]
SPDX: Fix some License ID tags for libc.

6 years agoDon't pass rids to taskqgroup_attach()
Stephen Hurd [Wed, 27 Dec 2017 20:42:30 +0000 (20:42 +0000)]
Don't pass rids to taskqgroup_attach()

As everywhere else, we want to pass rman_get_start(irq->ii_res).  This
caused set affinity errors when not using MSI-X vectors (legacy and MSI
interrupts).

Reported by: sbruno
Sponsored by: Limelight Networks

6 years agoUse strl* here too.
Warner Losh [Wed, 27 Dec 2017 20:33:37 +0000 (20:33 +0000)]
Use strl* here too.

CID: 1383969

6 years agoccdconfig: Update licensing terms.
Pedro F. Giffuni [Wed, 27 Dec 2017 20:09:50 +0000 (20:09 +0000)]
ccdconfig: Update licensing terms.

The code originate in NetBSD and there are the copyright notes have been
assigned to the NetBSD Foundation. Update the files up to the point where
we started diverging.

Further relaxation of the licensing terms are possible after we
check the NetBSD updates, and contact the local authors.

In the case of ccdconfig.8 this reinstates the 3rd clause but since the
code is not directly from Berkeley, the change was bogus.

Obtained from: NetBSD

6 years agoRemove assertion that's not true for !EARLY_AP_STARTUP
Stephen Hurd [Wed, 27 Dec 2017 19:14:15 +0000 (19:14 +0000)]
Remove assertion that's not true for !EARLY_AP_STARTUP

gtask->gt_taskqueue is NULL when EARLY_AP_STARTUP is not enabled.
Remove assertion to allow this config to work.

Reported by: oleg
Sponsored by: Limelight Networks

6 years agoSPDX: Complete License ID tags for UFS.
Pedro F. Giffuni [Wed, 27 Dec 2017 19:13:50 +0000 (19:13 +0000)]
SPDX: Complete License ID tags for UFS.

6 years agoFix indentation.
Stephen Hurd [Wed, 27 Dec 2017 19:12:32 +0000 (19:12 +0000)]
Fix indentation.

Sponsored by: Limelight Networks

6 years agoFix a bunch of issues (and a few non-issues but appeasement is easier
Warner Losh [Wed, 27 Dec 2017 18:30:24 +0000 (18:30 +0000)]
Fix a bunch of issues (and a few non-issues but appeasement is easier
than arguing) Coverity found:

o Use open + fstat rather than stat + open to avoid any races for a
  file that's static for the life of the system. This will prevent any
  problems should someone insert a new device while installing a
  kernel in the future.
o Use strlcpy instead of strcpy as a failsafe to knowing that the
  strings can't possibly be larger than the buffer due to data
  source limits (though in the future these limits might be more
  dynamic).
o If we can't find the hints file, return rather than dereference
  a NULL pointer.
o Check for lastmod before calling strcmp in case a PNP entry
  comes before a module entry. That's not allowed, but within the
  realm of crazy things programmers do.
o Free lastmod before exiting search_hints() to avoid a leak.

CID: 138397113839701383969138396513839631383960

6 years agoif_awg: Respect rgmii-*id PHY configurations
Kyle Evans [Wed, 27 Dec 2017 18:22:02 +0000 (18:22 +0000)]
if_awg: Respect rgmii-*id PHY configurations

phy-mode can be one of: rgmii, rgmii-id, rgmii-txid, rgmii-rxid; as this was
written, any of these alternate -id configurations would break as we fail to
configure syscon for rgmii. Instead, simply check that phy-mode is
configured for rgmii and we'll let the PHY driver handle any internal delay
configuration.

The pine64 should eventually specify phy-mode = "rgmii-txid" to address
gigabit issues when rx delay is configured, motivating this change.

6 years agoctl: Correct comment in ctl_worker_thread
Emmanuel Vadot [Wed, 27 Dec 2017 15:39:31 +0000 (15:39 +0000)]
ctl: Correct comment in ctl_worker_thread

The incoming queue is handled before the RtR one.
No functional change.

MFC after: 3 days

6 years agoReplace send-mail with the more standarized sendmail, we do not create
Xin LI [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.
Xin LI [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
Eitan Adler [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
Eitan Adler [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
Eitan Adler [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
Eitan Adler [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.
Kirk 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 Lepore [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
Michael Zhilin [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 Lepore [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 Lepore [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 Lepore [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
Ed Maste [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(),
Alan Cox [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
Emmanuel Vadot [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
Kyle Evans [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.
Michael 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.
Mark Johnston [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 Tjoelker [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 Tjoelker [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
Emmanuel Vadot [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.
Michael 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.
Michael 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
Emmanuel Vadot [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.
Michael Tuexen [Tue, 26 Dec 2017 15:29:11 +0000 (15:29 +0000)]
Fix CID 1008428.

MFC after: 1 week

6 years agoFix CID 1008936.
Michael 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.
Michael 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
Emmanuel Vadot [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
Michael 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
Emmanuel Vadot [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
Emmanuel Vadot [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
Emmanuel Vadot [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
Warner Losh [Tue, 26 Dec 2017 04:07:18 +0000 (04:07 +0000)]
Fix typo

6 years agoaw_rsb.4: Remove useless .Re
Emmanuel Vadot [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
Emmanuel Vadot [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
Eitan Adler [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
Poul-Henning Kamp [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
Eitan Adler [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
Emmanuel Vadot [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.
Alan Cox [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:
Warner Losh [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.
Warner Losh [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
Emmanuel Vadot [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.
Emmanuel Vadot [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.
Alexander Kabaev [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.
Mark Johnston [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
Dimitry Andric [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.
Warner Losh [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
Dimitry Andric [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.
Alexander Kabaev [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
Warner Losh [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
Dimitry Andric [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.
Andrey V. Elsukov [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 Tjoelker [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
Warner Losh [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
Konstantin Belousov [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
Eitan Adler [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
Eitan Adler [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.
Mariusz Zaborski [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.
Alexander Kabaev [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.
Alexander Kabaev [Sat, 23 Dec 2017 16:49:57 +0000 (16:49 +0000)]
Remove dead store to local variable.

6 years agoSilence clang analyzer false positive.
Alexander Kabaev [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.
Alexander Kabaev [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.
Alexander Kabaev [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.
Alexander Kabaev [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.
Alexander Kabaev [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
Kyle Evans [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
Kyle Evans [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/
Warner Losh [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
Warner Losh [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
Warner Losh [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
Warner Losh [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
Eitan Adler [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
Warner Losh [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.
Konstantin Belousov [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 Janiyan [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