]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUse known SRCTOP if possible to determine SYSDIR.
Bryan Drewery [Thu, 12 Apr 2018 20:48:17 +0000 (20:48 +0000)]
Use known SRCTOP if possible to determine SYSDIR.

Suggested by: sjg
Sponsored by: Dell EMC

6 years agoFix PSL_T inheritance on exec for x86.
Konstantin Belousov [Thu, 12 Apr 2018 20:43:39 +0000 (20:43 +0000)]
Fix PSL_T inheritance on exec for x86.

The miscellaneous x86 sysent->sv_setregs() implementations tried to
migrate PSL_T from the previous program to the new executed one, but
they evaluated regs->tf_eflags after the whole regs structure was
bzeroed.  Make this functional by saving PSL_T value before zeroing.

Note that if the debugger is not attached, executing the first
instruction in the new program with PSL_T set results in SIGTRAP, and
since all intercepted signals are reset to default dispostion on
exec(2), this means that non-debugged process gets killed immediately
if PSL_T is inherited.  In particular, since suid images drop
P_TRACED, attempt to set PSL_T for execution of such program would
kill the process.

Another issue with userspace PSL_T handling is that it is reset by
trap().  It is reasonable to clear PSL_T when entering SIGTRAP
handler, to allow the signal to be handled without recursion or
delivery of blocked fault.  But it is not reasonable to return back to
the normal flow with PSL_T cleared.  This is too late to change, I
think.

Discussed with: bde, Ali Mashtizadeh
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D14995

6 years agoFix using wrong SYSDIR after r331683.
Bryan Drewery [Thu, 12 Apr 2018 20:27:57 +0000 (20:27 +0000)]
Fix using wrong SYSDIR after r331683.

This was inadvertently overriding the first found SYSDIR with the last
of /usr/src which could result in the wrong headers being used if not
building from /usr/src.

SYSDIR?= is not used here to avoid evaluating the exists() when unneeded.

Reported by: rgrimes, sjg, Mark Millard
Pointyhat to: bdrewery
Sponsored by: Dell EMC

6 years agoUpdate vt(4) "Terminus BSD Console" font to v4.46
Ed Maste [Thu, 12 Apr 2018 20:21:04 +0000 (20:21 +0000)]
Update vt(4) "Terminus BSD Console" font to v4.46

"Terminus BSD Console" is a derivative of Terminus that is provided
by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the
FreeBSD vt(4) console and other BSDs.

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

6 years agoFix indenting in ipv6.c file, use tabs instead of mixing tabs and spaces.
Andrey V. Elsukov [Thu, 12 Apr 2018 20:05:26 +0000 (20:05 +0000)]
Fix indenting in ipv6.c file, use tabs instead of mixing tabs and spaces.

MFC after: 1 week

6 years agoOptimize context switch for PTI on PCID pmap.
Konstantin Belousov [Thu, 12 Apr 2018 19:59:36 +0000 (19:59 +0000)]
Optimize context switch for PTI on PCID pmap.

In pti-enabled pmap, the PCID allocation scheme assigns temporal id
for the kernel page table, and user page table twin PCID is
calculating by setting high bit in the kernel PCID.  So the kernel AS
is mapped with per-vmspace PCID, and we must completely shut down all
mappings in KVA when switching contexts, so that newly switched thread
would see all changes in KVA occured while it was not executing.
After all, KVA is same between all threads.

Currently the pti context switch for the user part of the page table
gets its TLB entries flushed too. It is excessive. The same PCID
flushing algorithm that is used for non-pti pmap, correctly works for
the UVA mappings.  The only shared TLB entries are the pages from KVA
accessed by the kernel entry trampoline.  All of them are static
except per-thread TSS and LDT. For TSS and LDT, the lifetime of newly
allocated entries is the whole thread life, so it is fine as well. If
not fine, then explicit shutdowns for current pmap of the newly
allocated LDT and TSS pages would be enough.

Also restore the constant value for the pm_pcid for the kernel_pmap.
Before, for PTI pmap, pm_pcid was erronously rolled same as user
pmap's pm_pcid, but it was not used.

Reviewed by: markj (previous version)
Discussed with: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D14961

6 years agoRemove printing of "not" keyword from print_ip6() function.
Andrey V. Elsukov [Thu, 12 Apr 2018 19:44:04 +0000 (19:44 +0000)]
Remove printing of "not" keyword from print_ip6() function.

After r331668 handling of F_NOT flag done in one place by
print_instruction() function. Also remove unused argument from
print_ip[6]() functions.

MFC after: 1 week

6 years agoRemove printing of "not" keyword from print_ip() function.
Andrey V. Elsukov [Thu, 12 Apr 2018 19:34:35 +0000 (19:34 +0000)]
Remove printing of "not" keyword from print_ip() function.

After r331668 handling of F_NOT flag done in one place by
print_instruction() function.

MFC after: 1 week

6 years agoswitch i386 memstick installer images to MBR
Ed Maste [Thu, 12 Apr 2018 19:00:22 +0000 (19:00 +0000)]
switch i386 memstick installer images to MBR

Some BIOSes have trouble booting from GPT in non-UEFI mode.  This is
commonly reported with Lenovo laptops, including my x220.  As we do not
currently support booting FreeBSD/i386 via UEFI there's no reason to
prefer GPT.

The "vestigial swap partition" was added in r265017 to work around an
issue with loader's GPT support, so we should not need it when using
MBR.

We may want to make the same change to amd64, although the issue there is
mitigated by such systems booting via UEFI in the common case.

PR: 227422
Reviewed by: gjb
MFC after: 3 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

6 years agoAdd fpa.4.gz missing in the removal of FDDI in r332412.
Brooks Davis [Thu, 12 Apr 2018 18:25:53 +0000 (18:25 +0000)]
Add fpa.4.gz missing in the removal of FDDI in r332412.

Reported by: trasz

6 years agoAllow -DNO_CLEAN builds across r332443.
Brooks Davis [Thu, 12 Apr 2018 18:24:00 +0000 (18:24 +0000)]
Allow -DNO_CLEAN builds across r332443.

6 years agoReplace MD assembly exect() with a portable version.
Brooks Davis [Thu, 12 Apr 2018 18:23:14 +0000 (18:23 +0000)]
Replace MD assembly exect() with a portable version.

Originally, on the VAX exect() enable tracing once the new executable
image was loaded.  This was possible because tracing was controllable
through user space code by setting the PSL_T flag.  The following
instruction is a system call that activated tracing (as all
instructions do) by copying PSL_T to PSL_TP (trace pending).  The
first instruction of the new executable image would trigger a trace
fault.

This is not portable to all platforms and the behavior was replaced with
ptrace(PT_TRACE_ME, ...) since FreeBSD forked off of the CSRG repository.
Platforms either incorrectly call execve(), trigger trace faults inside
the original executable, or do contain an implementation of this
function.

The exect() interfaces is deprecated or removed on NetBSD and OpenBSD.

Submitted by: Ali Mashtizadeh <ali@mashtizadeh.com>
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D14989

6 years agoBump .Dd value (forgot to do this in r332439)
Oleksandr Tymoshenko [Thu, 12 Apr 2018 17:47:36 +0000 (17:47 +0000)]
Bump .Dd value (forgot to do this in r332439)

MFC after: 3 days
X-MFC-With: 332439

6 years agoAdd SMP support for BERI CPU.
Ruslan Bukin [Thu, 12 Apr 2018 17:43:19 +0000 (17:43 +0000)]
Add SMP support for BERI CPU.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

6 years agoFix a conditional that got mucked up.
Benno Rice [Thu, 12 Apr 2018 17:16:13 +0000 (17:16 +0000)]
Fix a conditional that got mucked up.

Sponsored by: iXsystems, Inc.

6 years agoFix quotes in the example code in syslog(3) BUGS section
Oleksandr Tymoshenko [Thu, 12 Apr 2018 17:05:27 +0000 (17:05 +0000)]
Fix quotes in the example code in syslog(3) BUGS section

mdoc treats verbatim quotes in .Dl as a string delimiter and does
not pass them to the rendered output. Use special char \*q to specify
double quote

PR: 216755
MFC after: 3 days

6 years agoRemove a debugging printf that crept in.
Benno Rice [Thu, 12 Apr 2018 17:00:36 +0000 (17:00 +0000)]
Remove a debugging printf that crept in.

Sponsored by: iXsystems, Inc.

6 years agoCheck the return value of fseek.
Benno Rice [Thu, 12 Apr 2018 15:50:19 +0000 (15:50 +0000)]
Check the return value of fseek.

Reported by: Coverity
CID: 1388267
Sponsored by: iXsystems, Inc.

6 years agoAdd the ability to specify absolute and relative offsets to size partitions.
Benno Rice [Thu, 12 Apr 2018 15:47:47 +0000 (15:47 +0000)]
Add the ability to specify absolute and relative offsets to size partitions.

To create hybrid boot media we want to specify a partition at a known location.
This extends the syntax of size partitions to include an optional offset that
can be absolute or relative. It also introduces validation to make sure that
this hasn't resulted in overlapping partitions. I haven't added this to the
file and process partition specifications yet but the mechanics are designed
such that if someone comes up with a good way of specifying the offset it
will be fairly easy to add in.

Reviewed by: imp
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14916

6 years agoTune xDMA interface slightly:
Ruslan Bukin [Thu, 12 Apr 2018 15:36:24 +0000 (15:36 +0000)]
Tune xDMA interface slightly:
o Move descriptors allocation to DMA engine driver
o Add generic xdma_request() routine
o Add less-generic scatter-gather application based on xdma interface

Typical operation flow in peripheral device driver is:

1. Get xDMA controller
sc->xdma_tx = xdma_ofw_get(sc->dev, "tx");

2. Allocate virtual channel
sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps);

3. Setup transfer status callback
xdma_setup_intr(sc->xchan_tx, my_tx_intr, sc, &sc->ih_tx);

4. Request a transfer(s)
ret = xdma_request(sc->xchan_tx, &req);

5. Free the channel
xdma_channel_free(sc->xdma_tx);

6. Free the controller
xdma_put(sc->xdma_tx);

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14971

6 years agoAdd ld emulation types for hard-float mipses.
Ruslan Bukin [Thu, 12 Apr 2018 15:12:40 +0000 (15:12 +0000)]
Add ld emulation types for hard-float mipses.

Sponsored by: DARPA, AFRL

6 years agoFix a typo.
Bjoern A. Zeeb [Thu, 12 Apr 2018 14:57:48 +0000 (14:57 +0000)]
Fix a typo.

Sponsored by: iXsystems, Inc.

6 years agoRestore r332389 after resolution of locking fixes.
Sean Bruno [Thu, 12 Apr 2018 14:35:37 +0000 (14:35 +0000)]
Restore r332389 after resolution of locking fixes.

Add one extra lock initialization to iflib_register() that was missed
in the git<->phab conversion.

Split out flag manipulation from general context manipulation in iflib

To avoid blocking on the context lock in the swi thread and risk potential
deadlocks, this change protects lighter weight updates that only need to
be consistent with each other with their own lock.

Submitted by:   Matthew Macy <mmacy@mattmacy.io>
Reviewed by:    shurd
Sponsored by:   Limelight Networks
Differential Revision:  https://reviews.freebsd.org/D14967

6 years agocron(8): Correct test sense
Kyle Evans [Thu, 12 Apr 2018 14:32:26 +0000 (14:32 +0000)]
cron(8): Correct test sense

We're about to use the result of fstat(2) either way, so don't do that if it
fails...

X-MFC-With: r332429

6 years agoAdded entry in the correct section.
Ram Kishore Vegesna [Thu, 12 Apr 2018 14:05:27 +0000 (14:05 +0000)]
Added entry in the correct section.

Reported by: Rodney,kevans
Approved by: ken

6 years agocron(8): Reload database if an existing job in cron.d changed as well
Kyle Evans [Thu, 12 Apr 2018 13:52:55 +0000 (13:52 +0000)]
cron(8): Reload database if an existing job in cron.d changed as well

Directory mtime will only change if a file is added or removed, not
modified. For /var/cron/tabs, this is fine because of how crontab(1) manages
it using temp files so all crontab(1) changes will trigger a reload of the
database.

For /etc/cron.d and /usr/local/etc/cron.d, this is not necessarily the case.
Instead of checking their mtime, we should descend into them and check mtime
on all jobs also.

Reported by: des
Reviewed by: bapt
MFC after: 1 week

6 years agoallow ZFS pool to have temporary name for duration of current import
Andriy Gapon [Thu, 12 Apr 2018 10:37:26 +0000 (10:37 +0000)]
allow ZFS pool to have temporary name for duration of current import

The change adds -t <name> option to zpool create and -t option to zpool
import in its form with an old name and a new name.  This allows to
import (or create) a pool under a name that's different from its real,
permanent name without affecting that name.  This is useful when working
with VM images or images of other physical systems if they happen to
have a ZFS pool with the same name as the host system.

The changes come from ZoL with some small tweaks.
The porting has been done by julian.

The change is being submitted to OpenZFS:
https://github.com/openzfs/openzfs/pull/600

Submitted by: julian
Reviewed by: smh
MFC after: 2 weeks
Sponsored by: Panzura (porting)
Differential Revision: https://reviews.freebsd.org/D14972

6 years agoo OpenBSD 6.3 and DragonFly BSD 5.2.0 releases added.
Maxim Konovalov [Thu, 12 Apr 2018 07:39:24 +0000 (07:39 +0000)]
o OpenBSD 6.3 and DragonFly BSD 5.2.0 releases added.

6 years agoAdd myself to committers-src.dot
Tom Jones [Thu, 12 Apr 2018 07:25:36 +0000 (07:25 +0000)]
Add myself to committers-src.dot

Approved by: jtl (mentor)
Differential Revision: https://reviews.freebsd.org/D15042

6 years agonetmap: align codebase to the current upstream (commit id 3fb001303718146)
Vincenzo Maffione [Thu, 12 Apr 2018 07:20:50 +0000 (07:20 +0000)]
netmap: align codebase to the current upstream (commit id 3fb001303718146)

Changelist:
    - Turn tx_rings and rx_rings arrays into arrays of pointers to kring
      structs. This patch includes fixes for ixv, ixl, ix, re, cxgbe, iflib,
      vtnet and ptnet drivers to cope with the change.
    - Generalize the nm_config() callback to accept a struct containing many
      parameters.
    - Introduce NKR_FAKERING to support buffers sharing (used for netmap
      pipes)
    - Improved API for external VALE modules.
    - Various bug fixes and improvements to the netmap memory allocator,
      including support for externally (userspace) allocated memory.
    - Refactoring of netmap pipes: now linked rings share the same netmap
      buffers, with a separate set of kring pointers (rhead, rcur, rtail).
      Buffer swapping does not need to happen anymore.
    - Large refactoring of the control API towards an extensible solution;
      the goal is to allow the addition of more commands and extension of
      existing ones (with new options) without the need of hacks or the
      risk of running out of configuration space.
      A new NIOCCTRL ioctl has been added to handle all the requests of the
      new control API, which cover all the functionalities so far supported.
      The netmap API bumps from 11 to 12 with this patch. Full backward
      compatibility is provided for the old control command (NIOCREGIF), by
      means of a new netmap_legacy module. Many parts of the old netmap.h
      header has now been moved to netmap_legacy.h (included by netmap.h).

Approved by: hrs (mentor)

6 years agoiflib: fix up a mismerge in r332419
Mateusz Guzik [Thu, 12 Apr 2018 04:11:37 +0000 (04:11 +0000)]
iflib: fix up a mismerge in r332419

Lead to crashes on boot while in ifconfig.

Submitted by: Matthew Macy <mmacy@mattmacy.io>

6 years agovt: add three more cp437 mappings for vga textmode
Ed Maste [Thu, 12 Apr 2018 02:10:01 +0000 (02:10 +0000)]
vt: add three more cp437 mappings for vga textmode

In UTF-8 locales mandoc uses a number of characters outside of the Basic
Latin group, e.g. from general punctuation or miscellaneous mathematical
symbols, and these rendered as ? in text mode.

This change adds (char, replacement, code point, description):

    – - U+2013 En Dash
    ⟨ < U+27E8 Mathematical Left Angle Bracket
    ⟩ > U+27E9 Mathematical Right Angle Bracket

This change addresses some common cases; there are others that still
need to be added after a more thorough review.

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

6 years agoProperly initialize ifc_nhwtxqs.
Stephen Hurd [Wed, 11 Apr 2018 21:41:59 +0000 (21:41 +0000)]
Properly initialize ifc_nhwtxqs.

Also, since ifc_nhwrxqs is only used in one place, remove it from the struct.
This was preventing iflib_dma_free() from being called via
iflib_device_detach().

Submitted by: Matthew Macy <mmacy@mattmacy.io>
Reviewed by: shurd
Sponsored by: Limelight Networks

6 years agoRefactor currdev setting
Warner Losh [Wed, 11 Apr 2018 19:46:24 +0000 (19:46 +0000)]
Refactor currdev setting

Refactor the currdev setting to find the device we booted from. Limit
searching when we don't already have a reasonable currdev from that to
the same device only. Search a little harder for ZFS volumes as that's
needed for loader.efi to live on an ESP.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D13784

6 years agoFix potentially overflowing expression "fs->fs_ipg * fs->fs_ncg"
Kirk McKusick [Wed, 11 Apr 2018 19:28:54 +0000 (19:28 +0000)]
Fix potentially overflowing expression "fs->fs_ipg * fs->fs_ncg"
by casting fs->fs_ipg to (ino_t).

CID: 1388258

6 years agoRegenerate clang man page after upstream change to document the possible
Dimitry Andric [Wed, 11 Apr 2018 18:39:47 +0000 (18:39 +0000)]
Regenerate clang man page after upstream change to document the possible
values for the -std= option.

Noticed by: Steve Kargl
Obtained from: https://reviews.llvm.org/rL329827
MFC after: 3 days

6 years agoRevert r332275, r332272, r332270
Warner Losh [Wed, 11 Apr 2018 18:02:13 +0000 (18:02 +0000)]
Revert r332275, r332272, r332270

There's problems with them. The order of efi stuff isn't quite right,
and there's various problems. Revert until thos problems can be fixed.

Reviewed by: kevans@

6 years agoRemove support for FDDI networks.
Brooks Davis [Wed, 11 Apr 2018 17:28:24 +0000 (17:28 +0000)]
Remove support for FDDI networks.

Defines in net/if_media.h remain in case code copied from ifconfig is in
use elsewere (supporting non-existant media type is harmless).

Reviewed by: kib, jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15017

6 years agoRevert r332389 as it is causing panics for various users and we need
Sean Bruno [Wed, 11 Apr 2018 17:26:53 +0000 (17:26 +0000)]
Revert r332389 as it is causing panics for various users and we need
to add some more test cases.

6 years agoUse C99 initializers for iflib function tables.
Mark Johnston [Wed, 11 Apr 2018 15:15:34 +0000 (15:15 +0000)]
Use C99 initializers for iflib function tables.

Reviewed by: sbruno
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15041

6 years agosetfacl: minor man page edit to appease igor(1)
Ed Maste [Wed, 11 Apr 2018 13:33:12 +0000 (13:33 +0000)]
setfacl: minor man page edit to appease igor(1)

6 years agopf: limit ioctl to a reasonable and tuneable number of elements
Kristof Provost [Wed, 11 Apr 2018 11:43:12 +0000 (11:43 +0000)]
pf: limit ioctl to a reasonable and tuneable number of elements

pf ioctls frequently take a variable number of elements as argument. This can
potentially allow users to request very large allocations.  These will fail,
but even a failing M_NOWAIT might tie up resources and result in concurrent
M_WAITOK allocations entering vm_wait and inducing reclamation of caches.

Limit these ioctls to what should be a reasonable value, but allow users to
tune it should they need to.

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

6 years agoFix typo.
Oleg Bulyzhin [Wed, 11 Apr 2018 11:17:57 +0000 (11:17 +0000)]
Fix typo.

MFC after: 1 week

6 years agoFix ipfw table creation when net.inet.ip.fw.tables_sets = 0 and non zero set
Oleg Bulyzhin [Wed, 11 Apr 2018 11:12:20 +0000 (11:12 +0000)]
Fix ipfw table creation when net.inet.ip.fw.tables_sets = 0 and non zero set
specified on table creation. This fixes following:

# sysctl net.inet.ip.fw.tables_sets
net.inet.ip.fw.tables_sets: 0
# ipfw table all info
# ipfw set 1 table 1 create type addr
# ipfw set 1 table 1 create type addr
# ipfw add 10 set 1 count ip from table\(1\) to any
00010 count ip from table(1) to any
# ipfw add 10 set 1 count ip from table\(1\) to any
00010 count ip from table(1) to any
# ipfw table all info
--- table(1), set(1) ---
 kindex: 4, type: addr
 references: 1, valtype: legacy
 algorithm: addr:radix
 items: 0, size: 296
--- table(1), set(1) ---
 kindex: 3, type: addr
 references: 1, valtype: legacy
 algorithm: addr:radix
 items: 0, size: 296
--- table(1), set(1) ---
 kindex: 2, type: addr
 references: 0, valtype: legacy
 algorithm: addr:radix
 items: 0, size: 296
--- table(1), set(1) ---
 kindex: 1, type: addr
 references: 0, valtype: legacy
 algorithm: addr:radix
 items: 0, size: 296
#

MFC after: 1 week

6 years ago[tests] change tests/sys/acl/run to run on perl 5.26
Eitan Adler [Wed, 11 Apr 2018 07:15:30 +0000 (07:15 +0000)]
[tests] change tests/sys/acl/run to run on perl 5.26

Previously unescaped regex just resulted in a warning. Now it results in
a failed test.

6 years agolocks: extend speculative spin waiting for readers to drain
Mateusz Guzik [Wed, 11 Apr 2018 01:43:29 +0000 (01:43 +0000)]
locks: extend speculative spin waiting for readers to drain

Now that 10 years have passed since the original limit of 10000 was
committed, bump it a little bit.

Spinning waiting for writers is semi-informed in the sense that we always
know if the owner is running and base the decision to spin on that.
However, no such information is provided for read-locking. In particular
this means that it is possible for a write-spinner to completely waste cpu
time waiting for the lock to be released, while the reader holding it was
preempted and is now waiting for the spinner to go off cpu.

Nonetheless, in majority of cases it is an improvement to spin instead of
instantly giving up and going to sleep.

The current approach is pretty simple: snatch the number of current readers
and performs that many pauses before checking again. The total number of
pauses to execute is limited to 10k. If the lock is still not free by
that time, go to sleep.

Given the previously noted problem of not knowing whether spinning makes
any sense to begin with the new limit has to remain rather conservative.
But at the very least it should also be related to the machine. Waiting
for writers uses parameters selected based on the number of activated
hardware threads. The upper limit of pause instructions to be executed
in-between re-reads of the lock is typically 16384 or 32678. It was
selected as the limit of total spins. The lower bound is set to
already present 10000 as to not change it for smaller machines.

Bumping the limit reduces system time by few % during benchmarks like
buildworld, buildkernel and others. Tested on 2 and 4 socket machines
(Broadwell, Skylake).

Figuring out how to make a more informed decision while not pessimizing
the fast path is left as an exercise for the reader.

6 years agosetfacl: add recursive functionality
Ed Maste [Tue, 10 Apr 2018 23:29:57 +0000 (23:29 +0000)]
setfacl: add recursive functionality

Add a -R option to setfacl to operate recursively on directories, along
with the accompanying flags -H, -L, and -P (whose behaviour mimics
chmod).

A patch was submitted with PR 155163, but this is a new implementation
based on comments raised in the Phabricator review for that patch
(review D9096).

PR: 155163
Submitted by: Mitchell Horne <mhorne063@gmail.com>
Reviewed by: jilles
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14934

6 years agoUse explicit_bzero() when cleaning values out of the kernel environment.
Ian Lepore [Tue, 10 Apr 2018 22:57:56 +0000 (22:57 +0000)]
Use explicit_bzero() when cleaning values out of the kernel environment.

Sometimes the values contain geli passphrases being communicated from
loader(8) to the kernel, and some day the compiler may decide to start
eliding calls to memset() for a pointer which is not dereferenced again
before being passed to free().

6 years agorw: whack avoidable re-reads in try_upgrade
Mateusz Guzik [Tue, 10 Apr 2018 22:32:31 +0000 (22:32 +0000)]
rw: whack avoidable re-reads in try_upgrade

6 years agoReenter KDB on fault on powerpc, instead of panicking
Justin Hibbits [Tue, 10 Apr 2018 21:14:54 +0000 (21:14 +0000)]
Reenter KDB on fault on powerpc, instead of panicking

Most other architectures already re-enter KDB on faults, powerpc and mips
are the only outliers.  Correct this for powerpc, so that now bad addresses
can be handled gracefully instead of panicking.

6 years ago[pi] Do not attach bcm2835_pwm if DTB node is not enabled
Oleksandr Tymoshenko [Tue, 10 Apr 2018 20:31:25 +0000 (20:31 +0000)]
[pi] Do not attach bcm2835_pwm if DTB node is not enabled

Switch to standard FDT-base driver behavior and don't attach
if node "status" property value nn DTS is not set to "okay"

On RPi PWM by default is disabled, to enable it pwm.dtbo
from official repo[1] should be copied to overlays directory
on SD card FAT partition and "dtoverlay=pwm" line added to
config.txt. For more details see pwm overlay documentation[2]

sysutils/rpi-firmware port now includes overlays, so they
can be installed as a part of release image build.

[1] https://github.com/raspberrypi/firmware/tree/master/boot
[2] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README

No objections from: phk@

6 years agomake-memstick.sh: put partition args on separate lines
Ed Maste [Tue, 10 Apr 2018 19:49:04 +0000 (19:49 +0000)]
make-memstick.sh: put partition args on separate lines

This makes it easier to identify the individual partition types and
facilitates comparisons across architectures.

Reviewed by: gjb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoSplit out flag manipulation from general context manipulation in iflib
Stephen Hurd [Tue, 10 Apr 2018 19:48:24 +0000 (19:48 +0000)]
Split out flag manipulation from general context manipulation in iflib

To avoid blocking on the context lock in the swi thread and risk potential
deadlocks, this change protects lighter weight updates that only need to
be consistent with each other with their own lock.

Submitted by: Matthew Macy <mmacy@mattmacy.io>
Reviewed by: shurd
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14967

6 years agoMake BPF global lock an SX
Stephen Hurd [Tue, 10 Apr 2018 19:42:50 +0000 (19:42 +0000)]
Make BPF global lock an SX

This allows NIC drivers to sleep on polling config operations.

Submitted by: Matthew Macy <mmacy@mattmacy.io>
Reviewed by: shurd
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14982

6 years agoAnnotate geom modules with MODULE_VERSION
Kyle Evans [Tue, 10 Apr 2018 19:18:16 +0000 (19:18 +0000)]
Annotate geom modules with MODULE_VERSION

GEOM ELI may double ask the password during boot. Once at loader time, and
once at init time.

This happens due a module loading bug. By default GEOM ELI caches the
password in the kernel, but without the MODULE_VERSION annotation, the
kernel loads over the kernel module, even if the GEOM ELI was compiled into
the kernel. In this case, the newly loaded module
purges/invalidates/overwrites the GEOM ELI's password cache, which causes
the double asking.

MFC Note: There's a pc98 component to the original submission that is
omitted here due to pc98 removal in head. This part will need to be revived
upon MFC.

Reviewed by: imp
Submitted by: op
Obtained from: opBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14992

6 years agoUpdated mentors information.
Ram Kishore Vegesna [Tue, 10 Apr 2018 18:39:20 +0000 (18:39 +0000)]
Updated mentors information.

Approved by: ken, mav

6 years agohyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUT
Dexuan Cui [Tue, 10 Apr 2018 18:05:02 +0000 (18:05 +0000)]
hyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUT

CAM_SEL_TIMEOUT was introduced in
https://reviews.freebsd.org/D7521 (r304251), which claimed:

"VM shall response to CAM layer with CAM_SEL_TIMEOUT to filter those
invalid LUNs. Never use CAM_DEV_NOT_THERE which will block LUN scan
for LUN number higher than 7."

But it turns out this is not correct:

I think what really filters the invalid LUNs in r304251 is that:
before r304251, we could set the CAM_REQ_CMP without checking
vm_srb->srb_status at all:
ccb->ccb_h.status |= CAM_REQ_CMP.

r304251 checks vm_srb->srb_status and sets ccb->ccb_h.status properly,
so the invalid LUNs are filtered.

I changed my code version to r304251 but replaced the CAM_SEL_TIMEOUT
with CAM_DEV_NOT_THERE, and I confirmed the invalid LUNs can also be
filtered, and I successfully hot-added and hot-removed 8 disks to/from
the VM without any issue.

CAM_SEL_TIMEOUT has an unwanted side effect -- see cam_periph_error():
For a selection timeout, we consider all of the LUNs on
the target to be gone. If the status is CAM_DEV_NOT_THERE,
then we only get rid of the device(s) specified by the
path in the original CCB.

This means: for a VM with a valid LUN on 3:0:0:0, when the VM inquires
3:0:0:1 and the host reports 3:0:0:1 doesn't exist and storvsc returns
CAM_SEL_TIMEOUT to the CAM layer, CAM will detech 3:0:0:0 as well: this
is the bug I reported recently:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226583

PR: 226583
Reviewed by: mav
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D14690

6 years agoFollowing r331292, many of the files (such as the LICENSE file)
Glen Barber [Tue, 10 Apr 2018 17:40:44 +0000 (17:40 +0000)]
Following r331292, many of the files (such as the LICENSE file)
have moved from the u-boot-rpi3 share directory to the default
rpi-firmware share directory.  Remove the files from UBOOT_FILES
and append the DTB file to a DTB_FILES list so the correct path
is used, fixing a build failure.

Sponsored by: The FreeBSD Foundation

6 years agoCall through powerpc_interrupt for all Book-E interrupts
Justin Hibbits [Tue, 10 Apr 2018 17:32:27 +0000 (17:32 +0000)]
Call through powerpc_interrupt for all Book-E interrupts

Make int_external_input, int_decrementer, and int_performance_counter all
now use trap_common, just like on AIM.  The effects of this are:

* All traps are now properly displayed in ddb.  Previously traps from
  external input, decrementer, and performance counters, would display as
  just basic stack traces.  Now the frame is displayed.

* External interrupts are now handled with interrupts enabled, so handling
  can be preempted.  This seems to fix a hang found post-r329882.

6 years agoAdd missing header change from r332381.
Jonathan T. Looney [Tue, 10 Apr 2018 17:00:37 +0000 (17:00 +0000)]
Add missing header change from r332381.

Sponsored by: Netflix, Inc.
Pointy hat: jtl

6 years agoModify the net.inet.tcp.function_ids sysctl introduced in r331347.
Jonathan T. Looney [Tue, 10 Apr 2018 16:59:36 +0000 (16:59 +0000)]
Modify the net.inet.tcp.function_ids sysctl introduced in r331347.
Export additional information which may be helpful to userspace
consumers and rename the sysctl to net.inet.tcp.function_info.

Sponsored by: Netflix, Inc.

6 years agoMove the TCP Blackbox Recorder probe in tcp_output.c to be with the
Jonathan T. Looney [Tue, 10 Apr 2018 15:54:29 +0000 (15:54 +0000)]
Move the TCP Blackbox Recorder probe in tcp_output.c to be with the
other tracing/debugging code.

Sponsored by: Netflix, Inc.

6 years agoClean up some debugging code left in tcp_log_buf.c from r331347.
Jonathan T. Looney [Tue, 10 Apr 2018 15:51:37 +0000 (15:51 +0000)]
Clean up some debugging code left in tcp_log_buf.c from r331347.

Sponsored by: Netflix, Inc.

6 years agohead(1): Provide long options
Kyle Evans [Tue, 10 Apr 2018 14:44:07 +0000 (14:44 +0000)]
head(1): Provide long options

Provide long options --bytes and --lines to match -c and -n respectively.
This improves head(1)'s compatibility with its GNU counterpart in a sensible
way.

Reviewed by: eadler (previous version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D14139

6 years agotail(1): Address mandoc concern (space before punctuation after macro)
Kyle Evans [Tue, 10 Apr 2018 14:42:24 +0000 (14:42 +0000)]
tail(1): Address mandoc concern (space before punctuation after macro)

X-MFC-With: r332372

6 years agotail(1): Add some long options
Kyle Evans [Tue, 10 Apr 2018 14:27:27 +0000 (14:27 +0000)]
tail(1): Add some long options

Add --blocks, --bytes, and --lines long options for -b, -c, and -n
respectively. This improves tail(1)'s compatibility with its GNU counterpart
in a straightforward way.

Reviewed by: eadler (earlier version)
MFC after: 3 days

6 years agoCorrect a comment.
Mark Johnston [Tue, 10 Apr 2018 14:07:02 +0000 (14:07 +0000)]
Correct a comment.

Submitted by: Domagoj Stolfa
X-MFC with: r332364
Sponsored by: DARPA, AFRL

6 years agoSet zfs_arc_free_target to v_free_target.
Mark Johnston [Tue, 10 Apr 2018 13:56:06 +0000 (13:56 +0000)]
Set zfs_arc_free_target to v_free_target.

Page daemon output is now regulated by a PID controller with a setpoint
of v_free_target. Moreover, the page daemon now wakes up regularly
rather than waiting for a wakeup from another thread. This means that
the free page count is unlikely to drop below the old
zfs_arc_free_target value, and as a result the ARC was not readily
freeing pages under memory pressure. Address the immediate problem by
updating zfs_arc_free_target to match the page daemon's new behaviour.

Reported and tested by: truckman
Discussed with: jeff
X-MFC with: r329882
Differential Revision: https://reviews.freebsd.org/D14994

6 years agoAssert that dtrace_probe() doesn't re-enter itself.
Mark Johnston [Tue, 10 Apr 2018 13:47:09 +0000 (13:47 +0000)]
Assert that dtrace_probe() doesn't re-enter itself.

This helps catch cases where an instrumented function is called while
in probe context.

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after: 2 weeks
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D14863

6 years agoRemove deprecated DT sources of Armada 38x SoCs
Marcin Wojtas [Tue, 10 Apr 2018 13:25:42 +0000 (13:25 +0000)]
Remove deprecated DT sources of Armada 38x SoCs

Now, as all platform code and drivers support Linux
DT binding, safely remove deprecated sources and rely
on sys/gnu/dts from now on.

Obtained from: Semihalf
Sponsored by: Stormshield

6 years agoIntroduce dry run option for attaching the device.
Mariusz Zaborski [Tue, 10 Apr 2018 13:22:48 +0000 (13:22 +0000)]
Introduce dry run option for attaching the device.
This will allow us to verify if passphrase and key is valid without
decrypting whole device.

Reviewed by: cem@, allanjude@
Differential Revision: https://reviews.freebsd.org/D15000

6 years agoEnable Qualcomm Debug Subsystem (QDSS) block on MSM8916 SoC.
Ruslan Bukin [Tue, 10 Apr 2018 12:53:48 +0000 (12:53 +0000)]
Enable Qualcomm Debug Subsystem (QDSS) block on MSM8916 SoC.

This is required for ARM Coresight operation on Dragonboard 410c.

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14987

6 years agopf tests: Do not build or install if pf is not enabled
Kristof Provost [Tue, 10 Apr 2018 12:45:34 +0000 (12:45 +0000)]
pf tests: Do not build or install if pf is not enabled

Do not build or install pf tests if WITHOUT_PF is set. This fixes the build
failure with WITHOUT_PF=yes.

Reported by: Vladimir Zakharov <zakharov.vv@gmail.com>

6 years agoImprove detection of addressing mode in e6000sw
Marcin Wojtas [Tue, 10 Apr 2018 08:35:43 +0000 (08:35 +0000)]
Improve detection of addressing mode in e6000sw

Some devices cannot rely on the switch MDIO address passed in the DTB
for specifying single/multi-chip addressing mode. Introduce new property
"single-chip-addressing" which added to DTS will force single-chip mode.

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14800

6 years agoDon't show the number of currently established SCTP associations,
Michael Tuexen [Tue, 10 Apr 2018 08:19:14 +0000 (08:19 +0000)]
Don't show the number of currently established SCTP associations,
since this is not monotonically increasing. It's number can be
derived from the other counters shown.

MFC after: 3 days

6 years agoStrip trailing whitespace.
Edward Tomasz Napierala [Tue, 10 Apr 2018 08:14:31 +0000 (08:14 +0000)]
Strip trailing whitespace.

MFC after: 2 weeks

6 years agoStrip trailing whitespace.
Edward Tomasz Napierala [Tue, 10 Apr 2018 08:13:59 +0000 (08:13 +0000)]
Strip trailing whitespace.

MFC after: 2 weeks

6 years agoMake development(7) mention tests and section 9 of manual pages.
Edward Tomasz Napierala [Tue, 10 Apr 2018 08:01:55 +0000 (08:01 +0000)]
Make development(7) mention tests and section 9 of manual pages.

MFC after: 2 weeks

6 years agoFix the position of $bootable so that -o platformid=efi applies correctly.
Benno Rice [Tue, 10 Apr 2018 02:49:53 +0000 (02:49 +0000)]
Fix the position of $bootable so that -o platformid=efi applies correctly.

Sponsored by: iXsystems, Inc.
Pointy hat to: benno (again)

6 years agoFix makefs invocation after r331843.
Benno Rice [Tue, 10 Apr 2018 02:43:07 +0000 (02:43 +0000)]
Fix makefs invocation after r331843.

Reported by: gjb
Reviewed by: gjb
Sponsored by: iXsystems, Inc.
Pointy hat to: benno

6 years agoEnable cesa driver to work with Linux DT binding
Marcin Wojtas [Mon, 9 Apr 2018 23:36:52 +0000 (23:36 +0000)]
Enable cesa driver to work with Linux DT binding

Linux device tree binding, whose usage is obligatory,
comprises faulty representation of Marvell cryptographic
engine (CESA) - two engines are artificially gathered into
single DT node, in order to avoid certain SW limitation.

This patch improves the cesa driver to support above binding,
depending on compatible string, which helps to ensure
backward compatibility.

Submitted by: Patryk Duda
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14760

6 years agoRefactor PCIOCGETCONF for improved readability.
Brooks Davis [Mon, 9 Apr 2018 22:59:10 +0000 (22:59 +0000)]
Refactor PCIOCGETCONF for improved readability.

The code now has a single, consistant flow for all three ioctl
variants. ifdefs and for pre-FreeBSD-7 compatability are moved to
functions and macros. So the flow is alwasy the same, we impose
the cost of allocating, copying to, updating from, and freeing a
copy of struct pci_conf_io on all paths.

This change will allow PCIOCGETCONF32 support currently in
sys/compat/freebsd32/freebsd32_ioctl.c to be moved here.

Reviewed by: kib, jhb
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14978

6 years ago[man] Add documentation for OpenFirmware API
Oleksandr Tymoshenko [Mon, 9 Apr 2018 22:23:45 +0000 (22:23 +0000)]
[man] Add documentation for OpenFirmware API

Add man pages for following OpenFirmware functions:

OF_child, OF_parent, OF_peer, OF_device_from_xref,
OF_device_register_xref, OF_xref_from_device, OF_getprop,
OF_getencprop, OF_getencprop_alloc, OF_getprop_alloc, OF_getproplen,
OF_hasprop, OF_nextprop, OF_prop_free, OF_searchencprop,
OF_searchprop, OF_setprop

Edited by: wblock
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D14511

6 years agoAlign OF_getencprop_alloc API with OF_getencprop and OF_getprop_alloc
Oleksandr Tymoshenko [Mon, 9 Apr 2018 22:06:16 +0000 (22:06 +0000)]
Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_alloc

Change OF_getencprop_alloc semantics to be combination of malloc and
OF_getencprop and return size of the property, not number of elements
allocated.

For the use cases where number of elements is preferred introduce
OF_getencprop_alloc_multi helper function that copies semantics
of OF_getencprop_alloc prior to this change.

This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi
function signatures consistent with OF_getencprop_alloc and
OF_getencprop_alloc_multi.

Functionality-wise this patch is mostly rename of OF_getencprop_alloc
to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo
where 1 was used as a block size.

6 years agolinuxulator: add else case braces to reduce diffs between archs
Ed Maste [Mon, 9 Apr 2018 19:11:24 +0000 (19:11 +0000)]
linuxulator: add else case braces to reduce diffs between archs

Sponsored by: Turing Robotic Industries Inc.

6 years agoRetire the geom_aes class
Kyle Evans [Mon, 9 Apr 2018 17:30:30 +0000 (17:30 +0000)]
Retire the geom_aes class

It's had a good life, but it's not really configurable and not really used.

Obtained from: opBSD (with some changes)
Differential Revision: https://reviews.freebsd.org/D14991

6 years agolinuxulator: deduplicate linux_exec_imgact_try
Ed Maste [Mon, 9 Apr 2018 17:24:01 +0000 (17:24 +0000)]
linuxulator: deduplicate linux_exec_imgact_try

Previously linuxulator had three identical copies of
linux_exec_imgact_try.  Deduplicate before adding another arch to
linuxulator.

Sponsored by: Turing Robotic Industries Inc
Differential Revision: https://reviews.freebsd.org/D14856

6 years agoif_awg: Add support for allwinner,{tx,rx}-delay-ps bindings
Kyle Evans [Mon, 9 Apr 2018 14:05:43 +0000 (14:05 +0000)]
if_awg: Add support for allwinner,{tx,rx}-delay-ps bindings

Split out delay parsing into a separate function; we'll support both
{tx,rx}-delay as well as the new versions.

While here, validate that they're within the expected range and fail to
attach if they are not. Assuming that we can clamp the delay is a bad idea
that might result in a non-working awg anyways, so we'll fail early to make
it easier to catch.

This version also unsets the tx and rx delay registers unconditionally and
then sets them if we read a non-zero delay. These delay properties should
default to 0 if not specified, as declared in the binding documentation.
Presumably the delays will be set via hardware configuration if they're not
explicitly set in FDT.

6 years agocfumass(4) no longer requires iscsi(4).
Edward Tomasz Napierala [Mon, 9 Apr 2018 13:32:12 +0000 (13:32 +0000)]
cfumass(4) no longer requires iscsi(4).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agonetmap: align codebase to upstream version v11.4
Vincenzo Maffione [Mon, 9 Apr 2018 09:24:26 +0000 (09:24 +0000)]
netmap: align codebase to upstream version v11.4

Changelist:
  - remove unused nkr_slot_flags
  - new nm_intr adapter callback to enable/disable interrupts
  - remove unused sysctls and document the other sysctls
  - new infrastructure to support NS_MOREFRAG for NIC ports
  - support for external memory allocator (for now linux-only),
    including linux-specific changes in common headers
  - optimizations within netmap pipes datapath
  - improvements on VALE control API
  - new nm_parse() helper function in netmap_user.h
  - various bug fixes and code clean up

Approved by: hrs (mentor)

6 years ago[man] Fix return type of BUS_ADD_CHILD(9)
Oleksandr Tymoshenko [Mon, 9 Apr 2018 05:48:12 +0000 (05:48 +0000)]
[man] Fix return type of BUS_ADD_CHILD(9)

Fix return type of BUS_ADD_CHILD(9) in SYNOPSYS section,
it should be device_t, not int

PR: 207389
MFC after: 3 days

6 years agoMake OF_searchencprop signature consistent with OF_getencprop
Oleksandr Tymoshenko [Mon, 9 Apr 2018 00:38:24 +0000 (00:38 +0000)]
Make OF_searchencprop signature consistent with OF_getencprop

Use pcell_t* as a destination buffer argument instead of void
pointer to be consistent with OF_getencprop signature.

6 years agoFix one more OF_getprop_alloc instance missed in r332310
Oleksandr Tymoshenko [Sun, 8 Apr 2018 23:17:51 +0000 (23:17 +0000)]
Fix one more OF_getprop_alloc instance missed in r332310

X-MFC-With: r332310

6 years agoClean up OF_getprop_alloc API
Oleksandr Tymoshenko [Sun, 8 Apr 2018 22:59:34 +0000 (22:59 +0000)]
Clean up OF_getprop_alloc API

OF_getprop_alloc takes element size argument and returns number of
elements in the property. There are valid use cases for such behavior
but mostly API consumers pass 1 as element size to get string
properties. What API users would expect from OF_getprop_alloc is to be
a combination of malloc + OF_getprop with the same semantic of return
value. This patch modifies API signature to match these expectations.

For the valid use cases with element size != 1 and to reduce
modification scope new OF_getprop_alloc_multi function has been
introduced that behaves the same way OF_getprop_alloc behaved prior to
this patch.

Reviewed by: ian, manu
Differential Revision: https://reviews.freebsd.org/D14850

6 years agoReplace calls to fdt_is_compatible with ofw_bus_node_is_compatible. These
Andrew Turner [Sun, 8 Apr 2018 22:07:06 +0000 (22:07 +0000)]
Replace calls to fdt_is_compatible with ofw_bus_node_is_compatible. These
are almost identical so there is no need to keep the former around.

Sponsored by: DARPA, AFRL

6 years agoDocument ofw_bus_subr helpers "compatible" and "status" properties
Oleksandr Tymoshenko [Sun, 8 Apr 2018 20:53:00 +0000 (20:53 +0000)]
Document ofw_bus_subr helpers "compatible" and "status" properties

Add documentation for following functions:

- ofw_bus_is_compatible
- ofw_bus_is_compatible_strict
- ofw_bus_node_is_compatible
- ofw_bus_search_compatible
- ofw_bus_get_status
- ofw_bus_status_okay
- ofw_bus_node_status_okay

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

6 years agoFix typo
Justin Hibbits [Sun, 8 Apr 2018 19:33:05 +0000 (19:33 +0000)]
Fix typo

Reserved cause is 6, not 5.

Reported by: cem

6 years agoAdd the ability to control the CPU topology of created VMs
Rodney W. Grimes [Sun, 8 Apr 2018 19:24:49 +0000 (19:24 +0000)]
Add the ability to control the CPU topology of created VMs
from userland without the need to use sysctls, it allows the old
sysctls to continue to function, but deprecates them at
FreeBSD_version 1200060 (Relnotes for deprecate).

The command line of bhyve is maintained in a backwards compatible way.
The API of libvmmapi is maintained in a backwards compatible way.
The sysctl's are maintained in a backwards compatible way.

Added command option looks like:
bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n]
The optional parts can be specified in any order, but only a single
integer invokes the backwards compatible parse.  [,maxcpus=n] is
hidden by #ifdef until kernel support is added, though the api
is put in place.

bhyvectl --get-cpu-topology option added.

Reviewed by: grehan (maintainer, earlier version),
Reviewed by: bcr (manpages)
Approved by: bde (mentor), phk (mentor)
Tested by: Oleg Ginzburg <olevole@olevole.ru> (cbsd)
MFC after: 1 week
Relnotes: Y
Differential Revision: https://reviews.freebsd.org/D9930

6 years agoPedantic polishing of code to please FlexeLint.
Poul-Henning Kamp [Sun, 8 Apr 2018 19:23:50 +0000 (19:23 +0000)]
Pedantic polishing of code to please FlexeLint.

Approved by: ed

6 years agoPowerpc64: Add the facility unavailable trap subsystem
Justin Hibbits [Sun, 8 Apr 2018 19:11:25 +0000 (19:11 +0000)]
Powerpc64: Add the facility unavailable trap subsystem

Summary:
This code adds the basic infrastructure for the facility subsystem. A facility
trap is raised when an unavailable instruction is executed. One example is
executing a Hardware Transactional Memory instruction while the MSR[TM] is
disabled. In the past, there was a specific interrupt for it (FP, VEC), but the
new instructions seem to be multiplexed on this facility interrupt.

The root cause of the trap is provided on Facility Status and Control Register
(FSCR) register.

Submitted by: Breno Leitao
Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D14566