]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoRemove trailing slashes from URLs; current mandoc(1) seems to render
trasz [Wed, 1 May 2019 13:00:33 +0000 (13:00 +0000)]
Remove trailing slashes from URLs; current mandoc(1) seems to render
them just fine.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoUse D_PARTISGPT rather than bare 255
imp [Wed, 1 May 2019 05:42:13 +0000 (05:42 +0000)]
Use D_PARTISGPT rather than bare 255

These three cases dovetail with other places in the code where we use
or set D_PARTISGPT when we mean that the partitioning scheme is
GPT. Use this #define to make the code easier to undertand.

Reviewed by: tsoome@
Differential Revision: https://reviews.freebsd.org/D20122

5 years agoRespect quotes and escapes when splitting exports fields.
mav [Tue, 30 Apr 2019 21:38:38 +0000 (21:38 +0000)]
Respect quotes and escapes when splitting exports fields.

Without this r293305 was still unable to handle names with spaces.

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

5 years agoAdd a paragraph that mentions gptboot having an interactive mode, and
ian [Tue, 30 Apr 2019 18:48:20 +0000 (18:48 +0000)]
Add a paragraph that mentions gptboot having an interactive mode, and
direct the user to the boot(8) manpage, which provides the details on that.

5 years agozfsboot: to detect disk size, use GPT information first
tsoome [Tue, 30 Apr 2019 17:45:22 +0000 (17:45 +0000)]
zfsboot: to detect disk size, use GPT information first

If we do have GPT on disk, read the disk size from it and do not
call int13.

Since int13 does report bogus informatiopn too often, rather trust the
partition table. We are using the same strategy with loader.

MFC after: 1 month

5 years agoUpdate the manpage text to show the output generated by the first-stage
ian [Tue, 30 Apr 2019 17:42:05 +0000 (17:42 +0000)]
Update the manpage text to show the output generated by the first-stage
bootloader these days (x86 instead of i386).

5 years agoFollow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator.
dchagin [Tue, 30 Apr 2019 17:18:05 +0000 (17:18 +0000)]
Follow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator.
It was first introduced in r163734 and missied by me in r283383.

MFC after: 1 week

5 years agorevert QEMU q35 platform use from r346748
emaste [Tue, 30 Apr 2019 15:28:52 +0000 (15:28 +0000)]
revert QEMU q35 platform use from r346748

It seems to be incompatible with the OVMF.fd (of unknown provenance)
in use by the Cirrus-CI config.  We will soon have a known OVMF build
via a port/package (see review D19869) and we can switch back to q35
once packages are available.

Discussed with: bcran

5 years agoRetry upon NET_RT_IFLIST sysctl failure.
markj [Tue, 30 Apr 2019 14:44:39 +0000 (14:44 +0000)]
Retry upon NET_RT_IFLIST sysctl failure.

Port the logic used by getifaddrs(3) to handle the case where
NET_RT_IFLIST returns ENOMEM, which can occur if the list size changes
between the buffer allocation and sysctl read.

PR: 195191
Submitted by: Guy Yur <guyyur@gmail.com> (original version)
MFC after: 1 week

5 years agoReduce the default image size for virtual machine disk images from
gjb [Tue, 30 Apr 2019 14:29:09 +0000 (14:29 +0000)]
Reduce the default image size for virtual machine disk images from
30GB to 3GB.  The raw images can be resized using truncate(1), and
other formats can be resized with tools included with other tools
included with other hypervisors.

Enable the growfs(8) rc(8) at firstboot if the disk was resized
prior to booting the virtual machine for the first time.

Discussed with: several
PR: 232313 (requested in other context)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoReduce the number of mutexes after r346645 in the LinuxKPI.
hselasky [Tue, 30 Apr 2019 10:41:20 +0000 (10:41 +0000)]
Reduce the number of mutexes after r346645 in the LinuxKPI.
Make function macro wrappers for locking and unlocking to ease readability.

No functional change.

Discussed with: kib@, tychon@ and zeising@
Sponsored by: Mellanox Technologies

5 years agoMake the dma_pool structure private to the LinuxKPI similar to Linux.
hselasky [Tue, 30 Apr 2019 09:38:22 +0000 (09:38 +0000)]
Make the dma_pool structure private to the LinuxKPI similar to Linux.

No functional change.

Discussed with: kib @
Sponsored by: Mellanox Technologies

5 years agoStore a pointer to the device instead of the PCI device in the DMA pool
hselasky [Tue, 30 Apr 2019 09:26:11 +0000 (09:26 +0000)]
Store a pointer to the device instead of the PCI device in the DMA pool
implementation in the LinuxKPI. This avoids use of container_of().

No functional change.

Discussed with: kib @
Sponsored by: Mellanox Technologies

5 years agopowerpc: Stop pretending we run on e500v1 cores
jhibbits [Tue, 30 Apr 2019 03:45:46 +0000 (03:45 +0000)]
powerpc: Stop pretending we run on e500v1 cores

Unconditional writing to MAS7, which doesn't exist on the e500v1 core, in a
TLB miss handler has been in the code for several years now.  Since this has
gone unnoticed for so long, it's easily concluded that e500v1 is not in use
with FreeBSD.  Simplify the code path a bit, by unconditionally zeroing MAS7
instead of calling a subroutine to do it.

5 years agopowerpc64: Fix switch panic from cpu_throw()
jhibbits [Mon, 29 Apr 2019 22:37:35 +0000 (22:37 +0000)]
powerpc64: Fix switch panic from cpu_throw()

r18 is used to hold the old PCB flags, but cpu_throw doesn't populate r18
with PCB flags, since the old thread is gone.  This can lead to panics on
cores that don't have the registers guarded by these flags.

5 years agoRewrap some long lines.
jhb [Mon, 29 Apr 2019 22:15:51 +0000 (22:15 +0000)]
Rewrap some long lines.

Whitespace only change.

5 years agoOptimize lseek(SEEK_DATA) on UFS.
markj [Mon, 29 Apr 2019 22:05:26 +0000 (22:05 +0000)]
Optimize lseek(SEEK_DATA) on UFS.

This version fixes the problems identified in r345244.

Reviewed by: kib
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19598

5 years agoNote that ccr(4) now supports AES-CCM.
jhb [Mon, 29 Apr 2019 22:00:45 +0000 (22:00 +0000)]
Note that ccr(4) now supports AES-CCM.

5 years agoUpdate/reformat maintainer entries that I am a part of
ngie [Mon, 29 Apr 2019 18:48:43 +0000 (18:48 +0000)]
Update/reformat maintainer entries that I am a part of

* Replace all instances of freebsd-testing with `#test`. `#test` is the
  Phabricator group that focuses on test-related reviews.
* Replace `atf` with contrib/atf, as that's the actual location for the test
  framework.
* Remove jmmv@ from the maintainers list for atf. He is the upstream project
  owner, but was moved to alumni status after r345787.
* Fix a typo accidentally introduced in r346899 (inpact -> impact).

5 years agoAdd a note to MAINTAINERS for lkpi for graphics
zeising [Mon, 29 Apr 2019 18:20:51 +0000 (18:20 +0000)]
Add a note to MAINTAINERS for lkpi for graphics

Add a note to MAINTAINERS requesting pre-commit review from the graphics
team, using phabricator, for changes to the lkpi subsystem.  This is done in
order to give us a chance to test the graphics drivers (drm drivers) for
regressions, and to try to avoid breakage, errors and issues with the
graphics drivers.
The review is done via the #x11 group on phabricator.

Please note that hselasky also want to review changes.

Discussed with: hselasky, imp
Approved by: imp

5 years agoip multicast debug: fix strings vs defines
mav [Mon, 29 Apr 2019 18:09:55 +0000 (18:09 +0000)]
ip multicast debug: fix strings vs defines

Turning on multicast debug made multicast failure worse
because the strings and #define values no longer matched
up.  Fix them, and make sure they stay matched-up.

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

5 years ago[PPC64] Turn opal_flash.c into a device
luporl [Mon, 29 Apr 2019 16:50:33 +0000 (16:50 +0000)]
[PPC64] Turn opal_flash.c into a device

This change makes it easier to enable/disable the inclusion of
OPAL flash in the kernel.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20098

5 years agoo Rewrite softdma_process_tx() of Altera SoftDMA engine driver
br [Mon, 29 Apr 2019 16:27:15 +0000 (16:27 +0000)]
o Rewrite softdma_process_tx() of Altera SoftDMA engine driver
  so it does not require a bounce buffer. The only need for this was
  to align the buffer address. Implement unaligned access and we don't
  need to copy data twice.
o Remove contigmalloc-based bounce buffer from xDMA code since it is
  not suitable for arbitrary memory provided by platform, which is
  sometimes a dedicated piece of memory that is not managed by OS at all.

Sponsored by: DARPA, AFRL

5 years agoSupport all reasonable cursor sizes. Reduce the size of the standard
bde [Mon, 29 Apr 2019 16:26:29 +0000 (16:26 +0000)]
Support all reasonable cursor sizes.  Reduce the size of the standard
cursor from 16x16 (with 6 columns unused) to 10x16 and rename it to
the "small" cursor.  Add a "large" 19x32 cursor and use it for screen
widths larger than 800 pixels.  Use libvgl's too-small indentation for
the large data declarations.

MOUSE_IMG_SIZE = 16 is still part of the API.  If an application supplies
invalid bitmaps for the cursor, then the results may be different from
before.

5 years agoOops, r346889 broke showing of the mouse cursor after clearing, by
bde [Mon, 29 Apr 2019 15:58:05 +0000 (15:58 +0000)]
Oops, r346889 broke showing of the mouse cursor after clearing, by
forgetting to tell the bitmap-copying clearing method to preserve the
cursor.

5 years agoRefactor and simplify hiding the mouse cursor and fix bugs caused by
bde [Mon, 29 Apr 2019 14:13:53 +0000 (14:13 +0000)]
Refactor and simplify hiding the mouse cursor and fix bugs caused by
complications in the previous methods.

r346761 broke showing the mouse cursor after changing its state from
off to on (including initially), since showing the cursor uses the
state to decide whether to actually show and the state variable was
not changed until after null showing.  Moving the mouse or copying
under the cursor fixed the problem.  Fix this and similar problems for
the on to off transition by changing the state variable before drawing
the cursor.

r346641 failed to turn off the mouse cursor on exit from vgl.  It hid
the cursor only temporarily for clearing.  This doesn't change the state
variable, so unhiding the cursor after clearing restored the cursor if its
state was on.  Fix this by changing its state to VGL_MOUSEHIDE using the
application API for changing the state.

Remove the VGLMouseVisible state variable and the extra states given by it.
This was an optimization that was just an obfuscation in at least the
previous version.

Staticize VGLMouseAction().  Remove VGLMousePointerShow/Hide() except as
internals in __VGLMouseMode().  __VGLMouseMouseMode() is the same as the
application API VGLMouseMouseMode() except it returns the previous mode
which callers need to know to restore it after hiding the cursor.

Use the refactoring to make minor improvements in a simpler way than was
possible:
- in VGLMouseAction(), only hide and and unhide the mouse cursor if the
  mouse moved
- in VGLClear(), only hide and and unhide the mouse cursor if the clearing
  method would otherwise clear the cursor.

5 years agoStop checking TD_IDLETHREAD() in buffer cache routines.
markj [Mon, 29 Apr 2019 13:23:32 +0000 (13:23 +0000)]
Stop checking TD_IDLETHREAD() in buffer cache routines.

These predicates are vestigal and cannot be true today.  For example,
idle threads are not allowed to acquire locks.

Also cache curthread in breada().

No functional change intended.

Reviewed by: kib, mckusick
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20066

5 years agoHandle HAVE_PROTO flag and print "proto" keyword for O_IP4 and O_IP6
ae [Mon, 29 Apr 2019 09:52:53 +0000 (09:52 +0000)]
Handle HAVE_PROTO flag and print "proto" keyword for O_IP4 and O_IP6
opcodes when it is needed.
This should fix the problem, when printed by `ipfw show` rule could not
be added due to missing "proto" keyword.

MFC after: 2 weeks

5 years agoAdd IPv6 support for O_IPLEN opcode.
ae [Mon, 29 Apr 2019 09:33:16 +0000 (09:33 +0000)]
Add IPv6 support for O_IPLEN opcode.

Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC

5 years agoImplement uefi_ignore_boot_mgr env variable.
imp [Mon, 29 Apr 2019 05:02:54 +0000 (05:02 +0000)]
Implement uefi_ignore_boot_mgr env variable.

When set, we ignore all the hints that the UEFI boot manager has set
for us. We also always fail back to the OK prompt when we can't find
the right thing to boot rather than failing back to the UEFI boot
manager. This has the side effect of also expanding the cases where we
fail back to the OK prompt to include when we're booted under UEFI,
but UEFI::BootCurrent isn't set in the environment and we can't find a
proper place to boot from.

Reviewed by: bcran
Differential Revision: https://reviews.freebsd.org/D20016

5 years agoImplement uefi_rootdev
imp [Mon, 29 Apr 2019 05:02:50 +0000 (05:02 +0000)]
Implement uefi_rootdev

If uefi_rootdev is set in the environment, then treat it like a device
path. Convert the string to a device path and see if we can find a
device that matches. If so, use that device at our root dev no matter
what. If it's bad in any way, the boot will fail.

Reviewed by: bcran
Differential Revision: https://reviews.freebsd.org/D20016

5 years agoRead in and parse /efi/freebsd/loader.env from the boot device's
imp [Mon, 29 Apr 2019 05:02:25 +0000 (05:02 +0000)]
Read in and parse /efi/freebsd/loader.env from the boot device's
partition as if it were on the command line.

Fetch FreeBSD-LoaderEnv UEFI enviornment variable. If set, read in
loader environment variables from it. Otherwise read in
/efi/freebsd/loader.env. Both are read relative to the device
loader.efi loaded from (they aren't full UEFI device paths)

Next fetch FreeBSD-NextLoaderEnv UEFI environment variable. If
present, read the file it points to in as above and delete the UEFI
environment variable so it only happens once.

This lets one set environment variables in the bootloader.
Unfortunately, we don't have all the mechanisms in place to parse the
file, nor do we have the magic pattern matching in place that
loader.conf has. Variables are of the form foo=bar. No quotes are
supported, so spaces aren't allowed, for example. Also, variables like
foo_load=yes are intercepted when we parse the loader.conf file and
things are done based on that. Since those aren't done here, variables
that cause an action to happen won't work.

Reviewed by: bcran
Differential Revision: https://reviews.freebsd.org/D20016

5 years agoAdd a trailing empty line to match the test code output
lwhsu [Mon, 29 Apr 2019 03:50:21 +0000 (03:50 +0000)]
Add a trailing empty line to match the test code output

This is added for letting these long failing test case pass, and for
consistency.  The test code should be fixed later to not output this extra
empty line.

Sponsored by: The FreeBSD Foundation

5 years agopowerpc: Make OPAL root node probe at bus pass
jhibbits [Mon, 29 Apr 2019 01:10:57 +0000 (01:10 +0000)]
powerpc: Make OPAL root node probe at bus pass

This way its children can attach earlier if needed, and some subsystems are
attached earlier, like the asynchronous token management.

MFC after: 2 weeks

5 years agoAdd #ifdef INET6 around declaration of nbuf.
rmacklem [Sun, 28 Apr 2019 22:37:59 +0000 (22:37 +0000)]
Add #ifdef INET6 around declaration of nbuf.

It was reported that without #ifdef INET6 around the declaration of "nbuf",
a build would report an unused variable. For some reason, I didn't see that
warning when I did a build, but it seems reasonable to add these #ifdef INET6's.

Submitted by: dmitryluhtionov@gmail.com
MFC after: 1 week

5 years agoSome test scripts use ncat --sctp --listen port to run an SCTP discard
tuexen [Sun, 28 Apr 2019 19:07:31 +0000 (19:07 +0000)]
Some test scripts use ncat --sctp --listen port to run an SCTP discard
server in the background. However, when running in the background,
stdin is closed and ncat initiates a graceful shutdown of the SCTP
association. This is not expected by the client. Therefore, the
ncat-based discard server is replaced by a perl-based one.

In addition, to remove the dependency from ncat, which needs to be
installed via the nmap port, also the code testing for a free SCTP port
is changed to use the perl-based client.

Finally, remove some debug output from the report generated.

Reviewed by: lwhsu@
Differential Revision: https://reviews.freebsd.org/D20086

5 years agoRemove witness warning, same as r346351 for busdma_dmar.
kib [Sun, 28 Apr 2019 18:45:44 +0000 (18:45 +0000)]
Remove witness warning, same as r346351 for busdma_dmar.

bounce_bus_dmamap_create() does not sleep either.

Sponsored by: Mellanox Technologies
MFC after: 1 week

5 years agofsx: seed more randomly with the -S0 option
asomers [Sun, 28 Apr 2019 17:27:06 +0000 (17:27 +0000)]
fsx: seed more randomly with the -S0 option

When using -S0, seed the PRNG with the current time in nanoseconds, not
seconds, so consecutive runs don't accidentally use the same seed.

Also, rename some variables for clarity.

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

5 years agoUpdate the audit(4) man page to talk about dtaudit(4), and also add a
rwatson [Sun, 28 Apr 2019 16:28:36 +0000 (16:28 +0000)]
Update the audit(4) man page to talk about dtaudit(4), and also add a
dtaudit(4) cross reference to auditpipe(4).

MFC after: 3 days
Sponsored by: DARPA, AFRL

5 years agoMake isp(4) suggest loading ispfw(4) when it fails to attach.
trasz [Sun, 28 Apr 2019 15:08:57 +0000 (15:08 +0000)]
Make isp(4) suggest loading ispfw(4) when it fails to attach.
It cannot load it automatically at boot, because the root filesystem
is not there yet. An alternative would be adding ispfw(4) to GENERIC,
but it's an additional 1MB.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D19369

5 years agoAdd a man page for the DTrace Audit Provider, since we are now growing a set
rwatson [Sun, 28 Apr 2019 13:07:38 +0000 (13:07 +0000)]
Add a man page for the DTrace Audit Provider, since we are now growing a set
of provider man pages.

MFC after: 3 days
Sponsored by: DARPA, AFRL

5 years agoLeft justify a function header brace as it should be.
cy [Sun, 28 Apr 2019 04:05:43 +0000 (04:05 +0000)]
Left justify a function header brace as it should be.
No functional change.

MFC after: 3 days

5 years agopowerpc: Add support for additional FSCR-managed facilities
jhibbits [Sat, 27 Apr 2019 22:30:22 +0000 (22:30 +0000)]
powerpc: Add support for additional FSCR-managed facilities

Add support to enable, save, and restore the following facilities:
* Target Address Register (bctar) -- seemingly just another register to
  branch to.
* Event-based branching -- an interrupt-like userspace event handler
  subsystem.
* Load-monitored facility -- A facility that allows monitoring a range of
  physical memory, and triggering an event on access.  Targeted to garbage
  collection software features.

5 years agopowerpc: Add SPR definitions for additional POWER8/POWER9 facilities
jhibbits [Sat, 27 Apr 2019 19:32:33 +0000 (19:32 +0000)]
powerpc: Add SPR definitions for additional POWER8/POWER9 facilities

This only adds the new SPR definitions and the associated FSCR bits.  The
facilities themselves will be added in separate commits.

5 years agopowerpc64: Add the DSCR facility on POWER8 and later
jhibbits [Sat, 27 Apr 2019 16:28:34 +0000 (16:28 +0000)]
powerpc64: Add the DSCR facility on POWER8 and later

The Data Stream Control Register (DSCR) is privileged on POWER7, but
unprivileged (different register) on POWER8 and later.  However, it's now
guarded by a new register, the Facility Status and Control Register, instead of
the MSR like other pre-existing facilities (FPU, Altivec).  The FSCR must be
managed explicitly, since it's effectively an extension of the MSR.

Tested by: Brandon Bergren

5 years agoarm: allwinner: a10: Correct pin functions
manu [Sat, 27 Apr 2019 14:59:08 +0000 (14:59 +0000)]
arm: allwinner: a10: Correct pin functions

PB20 and PB21 alternate function 1 is i2c2 not i2c1

Reported by: Horiki Mori (yamori813@yahoo.co.jp)
PR:  237401
MFC after: 1 week

5 years agoarm64: allwinner: ccu_de2: Remove H5 compatible
manu [Sat, 27 Apr 2019 14:56:24 +0000 (14:56 +0000)]
arm64: allwinner: ccu_de2: Remove H5 compatible

We don't have the display engine driver commited in FreeBSD yet so it is
useless to expose the clocks yet (and also it have not been tested on H5).

Reported by: Manuel Stühn (freebsdnewbie@freenet.de)
PR:  237571
MFC after: 1 week

5 years agoarm64: allwinner: Add compatible strings for clock devices used on both Allwinner...
manu [Sat, 27 Apr 2019 14:48:27 +0000 (14:48 +0000)]
arm64: allwinner: Add compatible strings for clock devices used on both Allwinner H3 and H5

Allwinner H3 and H5 share many internal components, that's why they can
use the same drivers.
This patch adds the compatible strings to enable clock drivers
probing on Allwinner NanoPI NEO2 device.

Tested on: NanoPi NEO2 (by submitter), OrangePi PC2 (by manu)
Submitted by: Manuel Stühn (freebsdnewbie@freenet.de)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D20069

5 years agopowerpc: Add POWER8NVL definition
jhibbits [Sat, 27 Apr 2019 02:33:49 +0000 (02:33 +0000)]
powerpc: Add POWER8NVL definition

The POWER8NVL (POWER8 NVLink) architecturally behaves identically to the
POWER8, with a different PVR identifier.  Mark it as such, so it shows up
appropriately to the user.

Reported by: Alexey Kardashevskiy
MFC after: 2 weeks

5 years agopowerpc: micro-optimize cpu_switch()
jhibbits [Sat, 27 Apr 2019 00:53:41 +0000 (00:53 +0000)]
powerpc: micro-optimize cpu_switch()

Since the non-volatile registers are restored at the end of cpu_switchin (of
the new thread) they're free for us to use for our own purposes.  Load the
PCB_FLAGS into a non-volatile register so it's preserved across the C
function calls that manage FPU and altivec state.  This removes 4 loads from
each file.  Might be a trivial performance improvement (~12 clock cycles per
context switch).

MFC after: 3 weeks

5 years agoDon't symlink fusefs.ko to fuse.ko on PPC
asomers [Fri, 26 Apr 2019 20:15:47 +0000 (20:15 +0000)]
Don't symlink fusefs.ko to fuse.ko on PPC

Some PPC systems (PowerNV) use msdosfs for /boot, which can't handle either
symlinks or hardlinks. So on PPC, copy the module instead. This change fixes
installkernel on such systems after r345350.

Reported by: Brandon Bergren <git_bdragon.rtk0.net>
Reviewed by: jhibbits, rgrimes
MFC after: 2 weeks
MFC-With: 345350, 346441
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19993

5 years agoAdd mutex_destroy() missed in r334844.
mav [Fri, 26 Apr 2019 19:02:21 +0000 (19:02 +0000)]
Add mutex_destroy() missed in r334844.

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

5 years agoUse __VGLBitmapCopy() directly to show the mouse cursor. The mouse
bde [Fri, 26 Apr 2019 18:28:54 +0000 (18:28 +0000)]
Use __VGLBitmapCopy() directly to show the mouse cursor.  The mouse
cursor must be merged with the shadow buffer on the way to the screen,
and __VGLBitmapCopy() now has an option to do exactly that.  This is
insignificantly less efficient.

5 years agoFix minor mismerges.
mav [Fri, 26 Apr 2019 18:25:59 +0000 (18:25 +0000)]
Fix minor mismerges.

No functional change.

MFC after: 1 week

5 years agoloader: implement map-vdisk and unmap-vdisk commands
tsoome [Fri, 26 Apr 2019 17:58:44 +0000 (17:58 +0000)]
loader: implement map-vdisk and unmap-vdisk commands

illumos update: https://www.illumos.org/issues/10598

Add map-vdisk and unmap-vdisk commands to create virtual disk interface on top of file. This will allow to use disk image from file system to load and start the kernel.

By mapping file, we create vdiskX device, the device will be listed by lsdev [-v] and can be accessed directly as ls vdisk0p1:/path or can be used as value for currdev variable.

vdisk strategy function does not use bcache as we have bcache used with backing file. vdisk can be unmapped when all consumers have closed the open files.

In first iteration we do not support the zfs images because zfs pools do keep the device open (there is no "zpool export" mechanism). Adding zfs support is relatively simple, we just need to run zfs disk probe after mapping is done.

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

5 years agoMerge __VGLGetXY() back into VGLGetXY(). They were split to simplify
bde [Fri, 26 Apr 2019 16:38:23 +0000 (16:38 +0000)]
Merge __VGLGetXY() back into VGLGetXY().  They were split to simplify
the organization of fixes for the mouse cursor, but after optimizations
VGLGetXY() automatically avoids the mouse cursor.

5 years agoIn VGLClear(), check for the overlap of the mouse cursor in the whole
bde [Fri, 26 Apr 2019 16:14:23 +0000 (16:14 +0000)]
In VGLClear(), check for the overlap of the mouse cursor in the whole
display, not just in the unpanned top left corner.  This currently
makes no difference since the kernel erroneously doesn't allow moving
the cursor completely outside of the unpanned corner.

5 years agoAdd a manpage for elf_aux_info(3)
ian [Fri, 26 Apr 2019 15:43:14 +0000 (15:43 +0000)]
Add a manpage for elf_aux_info(3)

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

5 years ago[skip ci] fix typo in comment from r59840
asomers [Fri, 26 Apr 2019 15:00:59 +0000 (15:00 +0000)]
[skip ci] fix typo in comment from r59840

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years ago Make mdmfs verbose if diskless boot is verbose.
lev [Fri, 26 Apr 2019 14:44:50 +0000 (14:44 +0000)]
 Make mdmfs verbose if diskless boot is verbose.

Approved by: ian@
Differential Revision: D17104

5 years agoFix tools/boot/ci-qemu-test.sh and make some improvements
bcran [Fri, 26 Apr 2019 14:44:46 +0000 (14:44 +0000)]
Fix tools/boot/ci-qemu-test.sh and make some improvements

Update ci-qemu-test.sh

o Update the path to the OVMF file, which is now in /usr/local/share/uefi-edk2-qemu.
o Use the more modern q35, pc-q35-3.0 (Q35 + ICH9, 2009) QEMU machine
  instead of the default, obsolete pc, pc-i440fx-3.0 (i440FX + PIIX, 1996).
  For example this adds ACPI support.
o Specify the system firmware using the newer pflash drive syntax instead
  of bios.
o Remove extra, unneeded devices by passing -nodefaults.
o Change text to talk about 'firmware' instead of 'bios', since UEFI
  isn't a BIOS.

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

5 years agoRemove save/restore of the crtc and gdc registers when showing and
bde [Fri, 26 Apr 2019 14:44:20 +0000 (14:44 +0000)]
Remove save/restore of the crtc and gdc registers when showing and
hiding the mouse cursor.  The showing and hiding is often done
asynchronously in a not very safe signal handler, but the state of
these registers and much more is protected from the signal handler
in a better way by deferring mouse signals while the state is in use.

5 years agoFix the only known remaining (libvgl) bug for 24-bit modes, and enable
bde [Fri, 26 Apr 2019 13:49:06 +0000 (13:49 +0000)]
Fix the only known remaining (libvgl) bug for 24-bit modes, and enable
support for 24-bit modes.

The non-segmented case has worked for a long time, but the segmented
case could never have worked since 24-bit accesses may cross a window
boundary but the window was not changed in the middle of the specialized
24-bit accesses for writing a single pixel.

5 years agoRestore the line width in VGLEnd(). The line width may be changed by
bde [Fri, 26 Apr 2019 13:22:54 +0000 (13:22 +0000)]
Restore the line width in VGLEnd().  The line width may be changed by
VGLSetVScreenSize(), but is not restored by mode switches to at least
standard text mode, so must be restored explicitly.  Standard text mode
displayed blanks when the line width was doubled.

5 years agoFix an off-by-1 error for copying overlapping bitmaps in r346416. For
bde [Fri, 26 Apr 2019 13:04:10 +0000 (13:04 +0000)]
Fix an off-by-1 error for copying overlapping bitmaps in r346416.  For
nonzero height, the first line in the original order was not copied, and
for zero height, garbage lines before the first were copied until a crash
occurred.

5 years agomake sysent after r346273 (readlinkat arg correction)
emaste [Fri, 26 Apr 2019 12:55:52 +0000 (12:55 +0000)]
make sysent after r346273 (readlinkat arg correction)

PR: 197915
Reminded by: dchagin

5 years agopowerpc64: Clear FSCR SPR, so that it's in a known state
jhibbits [Fri, 26 Apr 2019 03:18:49 +0000 (03:18 +0000)]
powerpc64: Clear FSCR SPR, so that it's in a known state

This now turns any access to the DSCR SPR into a SIGILL.  Later commits will
make DCSR work correctly on POWER8 and POWER9.

PR: 237208

5 years agopowerpc: Fix whitespace in SPR header.
jhibbits [Fri, 26 Apr 2019 03:13:44 +0000 (03:13 +0000)]
powerpc: Fix whitespace in SPR header.

5 years agopowerpc: Add another feature2 flag, and update power9 definition
jhibbits [Fri, 26 Apr 2019 02:30:03 +0000 (02:30 +0000)]
powerpc: Add another feature2 flag, and update power9 definition

Also fix the definition of PPC_FEATURE2_HTM_NOSUSPEND, a bad line copy.

This now closer matches Linux's definition.

5 years agoMake bhyve SMBIOS table topology aware
rgrimes [Thu, 25 Apr 2019 22:53:55 +0000 (22:53 +0000)]
Make bhyve SMBIOS table topology aware

When the CPU Topology was added to bhyve in r332298 the SMBIOS table was
missed, this table passes topology information to the system and was still
using the old concept of each vCPU is a socket with 1 core and 1 thread.
This code did not even try to use the old sysctl information to adjust
this data.

Correct that by building a proper SMBios table, mapping the > 254 cases to
0 per the SMBios 2.6 specification that is claimed by the structure.

Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: bde and/or phk (mentor), jhb (maintainer)
MFC: 3 days
Differential Revision: https://reviews.freebsd.org/D18998

5 years agoAcpi MADT table correction for VM_MAXCPU > 21
rgrimes [Thu, 25 Apr 2019 22:52:44 +0000 (22:52 +0000)]
Acpi MADT table correction for VM_MAXCPU > 21

The bhyve acpi MADT table was given a static space of 256 (0x100) bytes,
this is enough space to allow VM_MAXCPU to be 21, this patch changes that
so VM_MAXCPU can be of arbitrary value and not overflow the space by
actually calculating the space needed for the table.

PR: 212782
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: bde (mentor), jhb (maintainer)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18815

5 years agoAdd accessor function for vm->maxcpus
rgrimes [Thu, 25 Apr 2019 22:51:36 +0000 (22:51 +0000)]
Add accessor function for vm->maxcpus

Replace most VM_MAXCPU constant useses with an accessor function to
vm->maxcpus which for now is initialized and kept at the value of
VM_MAXCPUS.

This is a rework of Fabian Freyer (fabian.freyer_physik.tu-berlin.de)
work from D10070 to adjust it for the cpu topology changes that
occured in r332298

Submitted by: Fabian Freyer (fabian.freyer_physik.tu-berlin.de)
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: bde (mentor), jhb (maintainer)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18755

5 years agoFix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to
ian [Thu, 25 Apr 2019 22:27:56 +0000 (22:27 +0000)]
Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to
change, not the variable used to return the original pin state.

PR: 237378
Reported by: Mori Hiroki <yamori813@yahoo.co.jp>

5 years agoDon't call cdev_init where cdev_alloc is called. cdev_alloc already
johalun [Thu, 25 Apr 2019 21:54:32 +0000 (21:54 +0000)]
Don't call cdev_init where cdev_alloc is called. cdev_alloc already
handles initialization.

Reported by: johalun
Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19565

5 years agoAdd support to nfsdumpstate for printing of INET6 addresses for locks.
rmacklem [Thu, 25 Apr 2019 21:25:32 +0000 (21:25 +0000)]
Add support to nfsdumpstate for printing of INET6 addresses for locks.

r346190 added support for printing of INET6 addresses for the "-o" option
(all opens) but missed adding support for INET6 addresses for the "-l" option.
This patch adds that support.

PR: 223036
MFC after: 1 week

5 years agoiflib: Better control over queue core assignment
shurd [Thu, 25 Apr 2019 21:24:56 +0000 (21:24 +0000)]
iflib: Better control over queue core assignment

By default, cores are now assigned to queues in a sequential
manner rather than all NICs starting at the first core. On a four-core
system with two NICs each using two queue pairs, the nic:queue -> core
mapping has changed from this:

0:0 -> 0, 0:1 -> 1
1:0 -> 0, 1:1 -> 1

To this:

0:0 -> 0, 0:1 -> 1
1:0 -> 2, 1:1 -> 3

Additionally, a device can now be configured to use separate cores for TX
and RX queues.

Two new tunables have been added, dev.X.Y.iflib.separate_txrx and
dev.X.Y.iflib.core_offset. If core_offset is set, the NIC is not part
of the auto-assigned sequence.

Reviewed by: marius
MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D20029

5 years agolibbe(3): Fix libcompat build
kevans [Thu, 25 Apr 2019 20:48:25 +0000 (20:48 +0000)]
libbe(3): Fix libcompat build

SHLIBDIR should still be optionally set, just before src.opts.mk is included
so that libcompat can properly override it. This fixes lib32 failures
reported by both Jenkins and Michael Butler.

Reported by: Michael Butler <imb@protected-networks.net>
MFC after: 3 days
X-MFC-With: r346546

5 years agoAdd the proper range of years for Netflix's copyright on this
imp [Thu, 25 Apr 2019 20:23:13 +0000 (20:23 +0000)]
Add the proper range of years for Netflix's copyright on this
file. Note that I wrote it.

5 years agoMove initialization of the block device handles earlier (we're just
imp [Thu, 25 Apr 2019 20:10:02 +0000 (20:10 +0000)]
Move initialization of the block device handles earlier (we're just
snagging them from UEFI BIOS). Call the device type init routines
earlier as well, as they don't depend on how the console is
setup. This will allow us to read files earlier in boot, so any rare
error messages that this might move only to the EFI console will be an
acceptable price to pay. Also tweak the order of has_kbd so it resides
next to the rest of the console code. It needs to be after we initialize
the buffer cache.

5 years agoAdd efi_freebsd_delenv
imp [Thu, 25 Apr 2019 20:09:49 +0000 (20:09 +0000)]
Add efi_freebsd_delenv

Add a wrapper around efi_delenv akin to efi_freebsd_getenv and
efi_getenv.

5 years agoloader: fdt: Add fdt_is_setup function
manu [Thu, 25 Apr 2019 20:08:43 +0000 (20:08 +0000)]
loader: fdt: Add fdt_is_setup function

When efi_autoload is called it will call fdt_setup_fdtp which setup the
dtb and overlays. If a user already loaded at dtb or overlays or just
printed the efi provided dtb, this will re-setup everything and also
re-applying the overlays.
Test that everything is setup before doing it again.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D20059

5 years agolibbe(3): Fix mis-application of patch (SHLIBDIR)
kevans [Thu, 25 Apr 2019 20:02:11 +0000 (20:02 +0000)]
libbe(3): Fix mis-application of patch (SHLIBDIR)

Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by
src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of
the patch, leaving it to get installed to the wrong place and subsequently
removed via ObsoleteFiles.

Reported by: jkim
MFC after: 3 days
X-MFC-With: r346546

5 years agoarm: allwinner: aw_pwm: compile it as module too
manu [Thu, 25 Apr 2019 18:44:03 +0000 (18:44 +0000)]
arm: allwinner: aw_pwm: compile it as module too

MFC after: 1 month

5 years agoarm: allwinner: Add pnp info to aw_rsb and compile it as module too
manu [Thu, 25 Apr 2019 18:43:01 +0000 (18:43 +0000)]
arm: allwinner: Add pnp info to aw_rsb and compile it as module too

MFC after: 1 month

5 years agoarm: allwinner: Add pnp info to if_awg and compile it as module too
manu [Thu, 25 Apr 2019 18:42:27 +0000 (18:42 +0000)]
arm: allwinner: Add pnp info to if_awg and compile it as module too

While here make it depend on aw_sid as it's needed for mac generation.

MFC after: 1 month

5 years agoRemove p_code from struct proc.
jhb [Thu, 25 Apr 2019 18:42:07 +0000 (18:42 +0000)]
Remove p_code from struct proc.

Contrary to the comments, it was never used by core dumps or
debuggers.  Instead, it used to hold the signal code of a pending
signal, but that was replaced by the 'ksi_code' member of ksiginfo_t
when signal information was reworked in 7.0.

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

5 years agoarm: allwinner: Add pnp info to aw_rtc and compile it as module too
manu [Thu, 25 Apr 2019 18:41:05 +0000 (18:41 +0000)]
arm: allwinner: Add pnp info to aw_rtc and compile it as module too

MFC after: 1 month

5 years agoarm: allwinner: Add pnp info to axp81x and compile it as module too
manu [Thu, 25 Apr 2019 18:40:23 +0000 (18:40 +0000)]
arm: allwinner: Add pnp info to axp81x and compile it as module too

MFC after: 1 month

5 years agoarm: allwinner: Add pnp info to aw_thermal and compile it as module too
manu [Thu, 25 Apr 2019 18:39:41 +0000 (18:39 +0000)]
arm: allwinner: Add pnp info to aw_thermal and compile it as module too

MFC after: 1 month

5 years agoarm: allwinner: Add pnpinfo for aw_sid and add module Makefile
manu [Thu, 25 Apr 2019 18:38:38 +0000 (18:38 +0000)]
arm: allwinner: Add pnpinfo for aw_sid and add module Makefile

MFC after: 1 month

5 years agotap(4): Correct driver name...
kevans [Thu, 25 Apr 2019 18:26:34 +0000 (18:26 +0000)]
tap(4): Correct driver name...

Reported by: rgrimes
Pointy hat to: kevans
MFC after: 3 days
X-MFC-With: r346688

5 years agotap(4): Add a MODULE_VERSION
kevans [Thu, 25 Apr 2019 18:22:22 +0000 (18:22 +0000)]
tap(4): Add a MODULE_VERSION

Otherwise tap(4) can be loaded by loader despite being compiled into the
kernel, causing a panic as things try to double-initialize.

PR: 220867
MFC after: 3 days

5 years agoLinuxKPI buildfix for ppc64 after r346645.
tychon [Thu, 25 Apr 2019 18:13:55 +0000 (18:13 +0000)]
LinuxKPI buildfix for ppc64 after r346645.

Proposed by: hselasky
Sponsored by: Dell EMC Isilon

5 years agobsdinstall: up the interface before calling dhclient
manu [Thu, 25 Apr 2019 16:47:15 +0000 (16:47 +0000)]
bsdinstall: up the interface before calling dhclient

MFC after: 1 week

5 years agomtree: Add more runtime package tag
manu [Thu, 25 Apr 2019 16:45:24 +0000 (16:45 +0000)]
mtree: Add more runtime package tag

When using pkgbase those empty directories aren't packaged otherwise.

Reviewed by: bapt
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20056

5 years agolibbe(3): Copy received properties as well
kevans [Thu, 25 Apr 2019 15:51:09 +0000 (15:51 +0000)]
libbe(3): Copy received properties as well

This was inherently broken on send|recv datasets.

Reported and tested by: Wes Maag <jwmaag gmail com>
MFC after: 3 days

5 years agoRestore doing nothing for calls to VGLEnd() after the first. I broke this
bde [Thu, 25 Apr 2019 15:48:23 +0000 (15:48 +0000)]
Restore doing nothing for calls to VGLEnd() after the first. I broke this
in r346631.  VGLEnd() clears some state variables as it restores state,
but not all of them, so it still needs to clear a single state variable
to indicate that it has completed.  Put this clearing back where it was
(at the start instead of the end) to avoid moving bugs in the signal
handling.

5 years agoTrack TCP connection's NUMA domain in the inpcb
gallatin [Thu, 25 Apr 2019 15:37:28 +0000 (15:37 +0000)]
Track TCP connection's NUMA domain in the inpcb

Drivers can now pass up numa domain information via the
mbuf numa domain field.  This information is then used
by TCP syncache_socket() to associate that information
with the inpcb. The domain information is then fed back
into transmitted mbufs in ip{6}_output(). This mechanism
is nearly identical to what is done to track RSS hash values
in the inp_flowid.

Follow on changes will use this information for lacp egress
port selection, binding TCP pacers to the appropriate NUMA
domain, etc.

Reviewed by: markj, kib, slavash, bz, scottl, jtl, tuexen
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20028

5 years agoRestore the ability to open a raw disk or partition in loader(8).
ian [Thu, 25 Apr 2019 15:09:21 +0000 (15:09 +0000)]
Restore the ability to open a raw disk or partition in loader(8).

The disk_open() function searches for "the best partition" when slice and
partition information is not provided as part of the device name.  As of
r345477 the slice and partition fields of a disk_devdesc are initialized to
D_SLICEWILD and D_PARTWILD; in the past they were initialized to -1, which
was sometimes interpreted as meaning 'wildcard' and sometimes as 'open the
raw partition' depending on the context.  So as an unintended side effect of
r345477 it became basically impossible to ever open a disk or partition
without doing the 'best partition' search.  One visible effect of that was
the inability to open the raw disk to read the partition table correctly in
zfs_probe_dev(), leading to failures to find the zfs pool unless it was on
the first partition.

Now instead of always initializing slice and partition to wildcards, the
disk_parsedev() function initializes them based on the presence of a
path/file name following the device.  If there is any path or filename
following the ':' that ends the device name, then slice and partition are
initialized to D_SLICEWILD and D_PARTWILD.  If there is nothing after the
':' then it is considered to be a request to open the raw device or
partition itself (not a file stored within it), and the fields are
initialized to D_SLICENONE and D_PARTNONE.

With this change in place, all the tests in src/tools/boot are succesful
again, including the recently-added cases of booting from a zfs pool on
a partition other than slice 1 of the device.

PR: 236981

5 years agotun(4): Don't allow open of open or dying devices
kevans [Thu, 25 Apr 2019 13:46:12 +0000 (13:46 +0000)]
tun(4): Don't allow open of open or dying devices

Previously, a pid check was used to prevent open of the tun(4); this works,
but may not make the most sense as we don't prevent the owner process from
opening the tun device multiple times.

The potential race described near tun_pid should not be an issue: if a
tun(4) is to be handed off, its fd has to have been sent via control message
or some other mechanism that duplicates the fd to the receiving process so
that it may set the pid. Otherwise, the pid gets cleared when the original
process closes it and you have no effective handoff mechanism.

Close up another potential issue with handing a tun(4) off by not clobbering
state if the closer isn't the controller anymore. If we want some state to
be cleared, we should do that a little more surgically.

Additionally, nothing prevents a dying tun(4) from being "reopened" in the
middle of tun_destroy as soon as the mutex is unlocked, quickly leading to a
bad time. Return EBUSY if we're marked for destruction, as well, and the
consumer will need to deal with it. The associated character device will be
destroyed in short order.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20033