]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoi386 4/4G split.
kib [Fri, 13 Apr 2018 20:30:49 +0000 (20:30 +0000)]
i386 4/4G split.

The change makes the user and kernel address spaces on i386
independent, giving each almost the full 4G of usable virtual addresses
except for one PDE at top used for trampoline and per-CPU trampoline
stacks, and system structures that must be always mapped, namely IDT,
GDT, common TSS and LDT, and process-private TSS and LDT if allocated.

By using 1:1 mapping for the kernel text and data, it appeared
possible to eliminate assembler part of the locore.S which bootstraps
initial page table and KPTmap.  The code is rewritten in C and moved
into the pmap_cold(). The comment in vmparam.h explains the KVA
layout.

There is no PCID mechanism available in protected mode, so each
kernel/user switch forth and back completely flushes the TLB, except
for the trampoline PTD region. The TLB invalidations for userspace
becomes trivial, because IPI handlers switch page tables. On the other
hand, context switches no longer need to reload %cr3.

copyout(9) was rewritten to use vm_fault_quick_hold().  An issue for
new copyout(9) is compatibility with wiring user buffers around sysctl
handlers. This explains two kind of locks for copyout ptes and
accounting of the vslock() calls.  The vm_fault_quick_hold() AKA slow
path, is only tried after the 'fast path' failed, which temporary
changes mapping to the userspace and copies the data to/from small
per-cpu buffer in the trampoline.  If a page fault occurs during the
copy, it is short-circuit by exception.s to not even reach C code.

The change was motivated by the need to implement the Meltdown
mitigation, but instead of KPTI the full split is done.  The i386
architecture already shows the sizing problems, in particular, it is
impossible to link clang and lld with debugging.  I expect that the
issues due to the virtual address space limits would only exaggerate
and the split gives more liveness to the platform.

Tested by: pho
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D14633

6 years agoFix build on 32-bit systems.
brooks [Fri, 13 Apr 2018 19:43:23 +0000 (19:43 +0000)]
Fix build on 32-bit systems.

6 years agopkg: accept -y and --yes from arguments
bapt [Fri, 13 Apr 2018 18:25:00 +0000 (18:25 +0000)]
pkg: accept -y and --yes from arguments

By popular demand, pkg now walks thought the arguments passed and
if it finds -y or --yes it does accept those as equivalent of
ASSUME_ALWAYS_YES env var.

Requested by: many
MFC after: 1 week

6 years agodtc(1): Update to upstream 006664a
kevans [Fri, 13 Apr 2018 18:04:51 +0000 (18:04 +0000)]
dtc(1): Update to upstream 006664a

Highlights:

- Passing "-" to -o will now cause output to go to stdout
- Path-based syntactic sugar for overlays is now accepted. This looks like:

/dts-v1/;
/plugin/;

&{/soc} {
    sid: eeprom@1c14000 {
        compatible = "allwinner,sun8i-h3-sid";
        reg = <0x1c14000 0x400>;
        status = "okay";
    };
};

MFC after: 3 days

6 years agoCorrect tom-thumb vt font glyphs
emaste [Fri, 13 Apr 2018 17:37:39 +0000 (17:37 +0000)]
Correct tom-thumb vt font glyphs

A few glyphs were converted incorrectly:
U+00A6 broken bar - center
U+2022 bullet - center
U+2026 horizontal ellipsis - move to bottom of character cell

6 years agoAdd SDT probes to vmexit on Intel.
tychon [Fri, 13 Apr 2018 17:23:05 +0000 (17:23 +0000)]
Add SDT probes to vmexit on Intel.

Submitted by: domagoj.stolfa_gmail.com
Reviewed by: grehan, tychon
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D14656

6 years agoAdd tom-thumb, a tiny (4x6) vt font
emaste [Fri, 13 Apr 2018 16:54:49 +0000 (16:54 +0000)]
Add tom-thumb, a tiny (4x6) vt font

Obtained from: https://robey.lag.net/2010/01/23/tiny-monospace-font.html
MFC after: 2 weeks

6 years agoJust assert that the lock is held here, rather than taking it out and
imp [Fri, 13 Apr 2018 16:45:35 +0000 (16:45 +0000)]
Just assert that the lock is held here, rather than taking it out and
dropping it.

Sponsored by: Netflix

6 years agoAdd check that mbuf had not multicast layer2 address.
ae [Fri, 13 Apr 2018 16:13:59 +0000 (16:13 +0000)]
Add check that mbuf had not multicast layer2 address.
Such packets should be handled by ip6_mforward().

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

6 years agoConvert atse(4) driver for Altera Triple-Speed Ethernet MegaCore to use
br [Fri, 13 Apr 2018 15:59:24 +0000 (15:59 +0000)]
Convert atse(4) driver for Altera Triple-Speed Ethernet MegaCore to use
xdma(4) interface.

This allows us to switch between Altera mSGDMA or SoftDMA engines used by
atse(4) device.

This also makes atse(4) driver become 25% smaller.

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

6 years agoAdd beripic1, msgdma and softdma instances.
br [Fri, 13 Apr 2018 15:18:06 +0000 (15:18 +0000)]
Add beripic1, msgdma and softdma instances.

Sponsored by: DARPA, AFRL

6 years agoAdd driver for Altera SoftDMA® device.
br [Fri, 13 Apr 2018 14:18:04 +0000 (14:18 +0000)]
Add driver for Altera SoftDMA® device.

SoftDMA is a software implementation of DMA engine built using Altera
FIFO component.

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

6 years agoCheck if STACK is defined before using the stack(9).
ram [Fri, 13 Apr 2018 13:31:20 +0000 (13:31 +0000)]
Check if STACK is defined before using the stack(9).

PR: 227446
Reported by: emaste
Approved by: ken

6 years agoAdd driver for Altera modular Scatter-Gather DMA engine (mSGDMA).
br [Fri, 13 Apr 2018 13:23:31 +0000 (13:23 +0000)]
Add driver for Altera modular Scatter-Gather DMA engine (mSGDMA).

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

6 years agoAdd driver for ARM PrimeCell PL330 DMA engine.
br [Fri, 13 Apr 2018 12:43:54 +0000 (12:43 +0000)]
Add driver for ARM PrimeCell PL330 DMA engine.

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

6 years agoDon't include sys/bus_dma.h directly, use machine/bus.h instead.
br [Fri, 13 Apr 2018 12:41:51 +0000 (12:41 +0000)]
Don't include sys/bus_dma.h directly, use machine/bus.h instead.

Sponsored by: DARPA, AFRL

6 years agoTo avoid possible deadlock do not acquire JQUEUE_LOCK before callout_drain.
ae [Fri, 13 Apr 2018 10:03:30 +0000 (10:03 +0000)]
To avoid possible deadlock do not acquire JQUEUE_LOCK before callout_drain.

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

6 years agoreinstall the roff(7) manpage
bapt [Fri, 13 Apr 2018 09:04:31 +0000 (09:04 +0000)]
reinstall the roff(7) manpage

When we had both groff and mandoc in base, we decided to keep the roff(7)
manpage from groff. when remoing groff, we forgot to install the mandoc version
instead.

This fixes it.

Reported by: trasz
MFC after: 1 week

6 years agoFix integer types mismatch for flags field in nat64stl_cfg structure.
ae [Thu, 12 Apr 2018 21:29:40 +0000 (21:29 +0000)]
Fix integer types mismatch for flags field in nat64stl_cfg structure.

Also preserve internal flags on NAT64STL reconfiguration.

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

6 years agoHandle Programmable Early Warning for control commands in sa(4).
ken [Thu, 12 Apr 2018 21:21:18 +0000 (21:21 +0000)]
Handle Programmable Early Warning for control commands in sa(4).

When the tape position is inside the Early Warning area, the tape
drive will return a sense key of NO SENSE, and an ASC/ASCQ of
0x00,0x02, which means: End-of-partition/medium detected".  If
this was in response to a control command like WRITE FILEMARKS,
we correctly translate this as informational status and return
0 from saerror().

Programmable Early Warning should be handled the same way, but
we weren't handling it that way.  As a result, if a PEW status
(sense key of NO SENSE, ASC/ASCQ of 0x00,0x07, "Programmable early
warning detected") came back in response to a WRITE FILEMARKS,
we returned an error.

The impact of this was that if an application was writing to a
sa(4) device, and a PEW area was set (in the Device Configuration
Extension subpage -- mode page 0x10, subpage 1), and a filemark
needed to be written on close, we could wind up returning an error
to the user on close because of a "failure" to write the filemarks.

It actually isn't a failure, but rather just a status report from
the drive, and shouldn't be treated as a failure.

sys/cam/scsi/scsi_sa.c:
For control commands in saerror(), treat asc/ascq 0x00,0x07
the same as 0x00,{0-5} -- not an error.  Return 0, since
the command actually did succeed.

Reported by: Dr. Andreas Haakh <andreas@haakh.de>
Tested by: Dr. Andreas Haakh <andreas@haakh.de>
Sponsored by: Spectra Logic
MFC after: 3 days

6 years agoUse cfg->nomatch_verdict as return value from NAT64LSN handler when
ae [Thu, 12 Apr 2018 21:13:30 +0000 (21:13 +0000)]
Use cfg->nomatch_verdict as return value from NAT64LSN handler when
given mbuf is considered as not matched.

If mbuf was consumed or freed during handling, we must return
IP_FW_DENY, since ipfw's pfil handler ipfw_check_packet() expects
IP_FW_DENY when mbuf pointer is NULL. This fixes KASSERT panics
when NAT64 is used with INVARIANTS. Also remove unused nomatch_final
field from struct nat64lsn_cfg.

Reported by: Justin Holcomb <justin at justinholcomb dot me>
Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC

6 years agoMigrate NAT64 to FIB KPI.
ae [Thu, 12 Apr 2018 21:05:20 +0000 (21:05 +0000)]
Migrate NAT64 to FIB KPI.

Obtained from: Yandex LLC
MFC after: 1 week

6 years agoUse known SRCTOP if possible to determine SYSDIR.
bdrewery [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.
kib [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.
bdrewery [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
emaste [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.
ae [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.
kib [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.
ae [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.
ae [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
emaste [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 [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 [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 [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)
gonzo [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.
br [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 [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
gonzo [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 [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 [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 [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:
br [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.
br [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.
bz [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.
sbruno [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
kevans [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 [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
kevans [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
avg [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 [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
thj [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)
vmaffione [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
mjg [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
emaste [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.
shurd [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
imp [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"
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
dim [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
imp [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 [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
sbruno [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.
markj [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)
emaste [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
kp [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 [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 [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
eadler [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
mjg [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
emaste [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 [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
mjg [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
jhibbits [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
gonzo [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
emaste [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
shurd [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
shurd [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
kevans [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 [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 [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)
gjb [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
jhibbits [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.
jtl [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.
jtl [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
jtl [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.
jtl [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
kevans [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)
kevans [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
kevans [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.
markj [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.
markj [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.
markj [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
mw [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.
oshogbo [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.
br [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
kp [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
mw [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,
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.
trasz [Tue, 10 Apr 2018 08:14:31 +0000 (08:14 +0000)]
Strip trailing whitespace.

MFC after: 2 weeks

6 years agoStrip trailing whitespace.
trasz [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.
trasz [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