]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoFix libsbuf sbuf_printf_drain symbol version
cem [Tue, 7 May 2019 21:15:11 +0000 (21:15 +0000)]
Fix libsbuf sbuf_printf_drain symbol version

(Introduced incorrectly in r347229 earlier today.)

As pointed out by kevans, 1.6 should be used for FreeBSD 13, like r340383.

Submitted by: kevans
Reported by: kib
Reviewed by: jilles
X-MFC-with:  r347229
Differential Revision: https://reviews.freebsd.org/D20187

5 years agoImprove the legibility of the login.access.5 man page by separating
cy [Tue, 7 May 2019 20:39:39 +0000 (20:39 +0000)]
Improve the legibility of the login.access.5 man page by separating
each argument into its own paragraph.

MFC after: 3 days

5 years agoRemove non-functional SCTP checksum offload support for virtio.
tuexen [Tue, 7 May 2019 20:28:12 +0000 (20:28 +0000)]
Remove non-functional SCTP checksum offload support for virtio.

Checksum offloading for SCTP is not currently specified for virtio.
If the hypervisor announces checksum offloading support, it means TCP
and UDP checksum offload. If an SCTP packet is sent and the host announced
checksum offload support, the hypervisor inserts the IP checksum (16-bit)
at the correct offset, but this is not the right checksum, which is a CRC32c.
This results in all outgoing packets having the wrong checksum and therefore
breaking SCTP based communications.

This patch removes SCTP checksum offloading support from the virtio
network interface.

Thanks to Felix Weinrank for making me aware of the issue.

Reviewed by: bryanv@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20147

5 years agoSupport PTRACE_GETREGSET w/ NT_PRSTATUS in Linux ptrace(2).
trasz [Tue, 7 May 2019 19:06:41 +0000 (19:06 +0000)]
Support PTRACE_GETREGSET w/ NT_PRSTATUS in Linux ptrace(2).

While Linux strace(1) doesn't strictly require it - it has a fallback
to PTRACE_GETREGS - it's a newer interface, so we better support it
before the old one is deprecated.

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

5 years agomake sysent after r347228
emaste [Tue, 7 May 2019 18:10:21 +0000 (18:10 +0000)]
make sysent after r347228

Regenerate to add @generated tag in generated files.

5 years agodevice_printf: Use sbuf for more coherent prints on SMP
cem [Tue, 7 May 2019 17:47:20 +0000 (17:47 +0000)]
device_printf: Use sbuf for more coherent prints on SMP

device_printf does multiple calls to printf allowing other console messages to
be inserted between the device name, and the rest of the message.  This change
uses sbuf to compose to two into a single buffer, and prints it all at once.

It exposes an sbuf drain function (drain-to-printf) for common use.

Update documentation to match; some unit tests included.

Submitted by: jmg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16690

5 years agomakesyscalls: use @generated tag in generated files
emaste [Tue, 7 May 2019 16:17:33 +0000 (16:17 +0000)]
makesyscalls: use @generated tag in generated files

Multiple tools use @generated to identify generated files (for example,
in a review Phabricator will by default hide diffs in generated files).
Use the @generated tag in makesyscalls.sh as we've done for other
generated files.

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

5 years agoSimplify the test against maxproc in fork1().
markj [Tue, 7 May 2019 15:03:26 +0000 (15:03 +0000)]
Simplify the test against maxproc in fork1().

Previously nprocs_new would be tested against maxprocs twice when
nprocs_new < maxprocs - 10.  Eliminate the unnecessary comparison.

Submitted by: Wuyang Chung <wuyang.chung1@gmail.com>
GitHub PR: https://github.com/freebsd/freebsd/pull/397
MFC after: 1 week

5 years agoDisable interrupts first and then set spinlock_count to 1.
br [Tue, 7 May 2019 14:32:17 +0000 (14:32 +0000)]
Disable interrupts first and then set spinlock_count to 1.
Otherwise interrupt can be generated just after setting spinlock_count
and before disabling interrupts.

Sponsored by: DARPA, AFRL

5 years agoProvide a template for busdma code for RISC-V.
br [Tue, 7 May 2019 13:41:43 +0000 (13:41 +0000)]
Provide a template for busdma code for RISC-V.

RISC-V ISA specifies no cache management instructions so leave cache
operations in cpufunc.h as no-op for now.

Note some new hardware comes with their own memory-mapped cache
management controller.

Tested on HiFive Unleashed board with cgem(4).

Reviewed by: markj
Obtained from: arm64
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D20126

5 years agoUse @generated tag in generated files
emaste [Tue, 7 May 2019 13:04:26 +0000 (13:04 +0000)]
Use @generated tag in generated files

Multiple tools use @generated to identify generated files (for example,
in a review Phabricator will by default hide diffs in generated files).
Use the @generated tag in makeobjops.awk and vnode_if.awk as we've done
for other generated files.

Sponsored by: The FreeBSD Foundation

5 years agocommand_bcache() does not use argv
tsoome [Tue, 7 May 2019 10:01:45 +0000 (10:01 +0000)]
command_bcache() does not use argv

Therefore mark argv __unused.

5 years agoo Avoid determining the MAC class (LEM/EM or IGB) - possibly even multiple
marius [Tue, 7 May 2019 08:31:54 +0000 (08:31 +0000)]
o Avoid determining the MAC class (LEM/EM or IGB) - possibly even multiple
  times - on every interrupt by using an own set of device methods for the
  IGB class. This translates to introducing igb_if_intr_{disable,enable}()
  and igb_if_{rx,tx}_queue_intr_enable() with that IGB-specific code moved
  out of their EM counterparts and otherwise continuing to use the EM IFDI
  methods also for IGB.
  Note that igb_if_intr_{disable,enable}() also issue E1000_WRITE_FLUSH as
  lost with the conversion of igb(4) to iflib(4).
  Also note, that the em_if_{disable,enable}_intr() methods are renamed to
  em_if_intr_{disable,enable}() for consistency with the names used in the
  interface declaration.
o In em_intr():
  - Don't bother to bail out if the interrupt type is "legacy", i. e. INTx
    or MSI, as iflib(4) doesn't use ift_legacy_intr methods for MSI-X. All
    other iflib(4)-based drivers avoid this check, too.
  - Given that only the MSI-X interrupts have one-shot behavior (by taking
    advantage of the EIAC register), explicitly disable interrupts. Hence,
    em_intr() now matches what {em,igb}_irq_fast() previously did (in case
    of igb(4) supposedly also to work around MSI message reordering errata
    on certain systems).
o In em_if_intr_disable():
  - Clear the EIAC register unconditionally for 82574 and not just in case
    of MSI-X, matching em_if_intr_enable() and bringing back the last hunk
    of r206437 lost with the iflib(4) conversion.
  - Write to EM_EIAC for clearing said register instead of to the IGB-only
    E1000_EIAC used ever since the iflib(4) conversion.

Reviewed by: shurd
Differential Revision: https://reviews.freebsd.org/D20176

5 years agoo Use iflib_fast_intr_rxtx() also for "legacy" interrupts, i. e. INTx and
marius [Tue, 7 May 2019 08:28:35 +0000 (08:28 +0000)]
o Use iflib_fast_intr_rxtx() also for "legacy" interrupts, i. e. INTx and
  MSI. Unlike as with iflib_fast_intr_ctx(), the former will also enqueue
  _task_fn_tx() in addition to _task_fn_rx() if appropriate, bringing TCP
  TX throughput of EM-class devices on par with the MSI-X case and, thus,
  close to wirespeed/pre-iflib(4) times again. [1]
  Note that independently of the interrupt type, the UDP performance with
  these MACs still is abysmal and nowhere near to where it was before the
  conversion of em(4) to iflib(4).
o In iflib_init_locked(), announce which free list failed to set up.
o In _task_fn_tx() when running netmap(4), issue ifdi_intr_enable instead
  of the ifdi_tx_queue_intr_enable method in case of a "legacy" interrupt
  as the latter is valid with MSI-X only.
o Instead of adding the missing - and apparently convoluted enough that a
  DBG_COUNTER_INC was put into a wrong spot in _task_fn_rx() - checks for
  ifdi_{r,t}x_queue_intr_enable being available in the MSI-X case also to
  iflib_fast_intr_rxtx(), factor these out to iflib_device_register() and
  make the checks fail gracefully rather than panic. This avoids invoking
  the checks at runtime over and over again in iflib_fast_intr_rxtx() and
  _task_fn_{r,t}x() - even if it's just in case of INVARIANTS - and makes
  these functions more readable.
o In iflib_rx_structures_setup(), only initialize LRO resources if device
  and driver have LRO capability in order to not waste memory. Also, free
  the LRO resources again if setting them up fails for one of the queues.
  However, don't bother invoking iflib_rx_sds_free() in that case because
  iflib_rx_structures_setup() doesn't call iflib_rxsd_alloc() either (and
  iflib_{device,pseudo}_register() will issue iflib_rx_sds_free() in case
  of failure via iflib_rx_structures_free(), but there definitely is some
  asymmetry left to be fixed, though).
o Similarly, free LRO resources again in iflib_rx_structures_free().
o In iflib_irq_set_affinity(), handle get_core_offset() errors gracefully
  instead of panicing (but only in case of INVARIANTS). This is a follow-
  up to r344132, as such driver bugs shouldn't be fatal.
o Likewise, handle unknown iflib_intr_type_t in iflib_irq_alloc_generic()
  gracefully, too.
o Bring yet more sanity to iflib_msix_init():
  - If the device doesn't provide enough MSI-X vectors or not all vectors
    can be allocate so the expected number of queues in addition to admin
    interrupts can't be supported, try MSI next (and then INTx) as proper
    MSI-X vector distribution can't be assured in such cases. In essence,
    this change brings r254008 forward to iflib(4). Also, this is the fix
    alluded to in the commit message of r343934.
  - If the MSI-X allocation has failed, don't prematurely announce MSI is
    going to be used as the latter in fact may not be available either.
  - When falling back to MSI, only release the MSI-X table resource again
    if it was allocated in iflib_msix_init(), i. e. isn't supplied by the
    driver, in the first place.
o In mp_ndesc_handler(), handle unknown type arguments gracefully, too.

PR: 235031 (likely) [1]
Reviewed by: shurd
Differential Revision: https://reviews.freebsd.org/D20175

5 years agoloader: bcache code does not need to check argument for free()
tsoome [Tue, 7 May 2019 08:14:30 +0000 (08:14 +0000)]
loader: bcache code does not need to check argument for free()

5 years agoloader: use safer DPRINTF body for non-debug case
tsoome [Tue, 7 May 2019 07:46:40 +0000 (07:46 +0000)]
loader: use safer DPRINTF body for non-debug case

5 years agoRemove wrong copyright line. Discussed with Carlos Neira.
dchagin [Tue, 7 May 2019 05:08:13 +0000 (05:08 +0000)]
Remove wrong copyright line. Discussed with Carlos Neira.

Reported by: Rodney W. Grimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13656

5 years agoamd64: fix BUS_SPACE_MAXSIZE to 64bit max value.
kib [Tue, 7 May 2019 01:18:57 +0000 (01:18 +0000)]
amd64: fix BUS_SPACE_MAXSIZE to 64bit max value.

Reviewed by: jhb, tychon (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D20154

5 years agoThe intention of the blist cursor is for the search for free blocks to
dougm [Mon, 6 May 2019 22:12:15 +0000 (22:12 +0000)]
The intention of the blist cursor is for the search for free blocks to
resume where the last search left off. Suppose that there are no free
blocks of size 32, but plenty of size 16. If we repeatedly request
size 32 blocks, fail, and retry with size 16 blocks, then the failures
all reset the cursor to the beginning of memory, making the 16 block
allocation use a first fit, rather than next fit, strategy.

This change has blist_alloc make a copy of the cursor for its own
decision making, and only updates the real blist cursor after a
successful allocation, making those 16 block searches behave like
next-fit searches.

Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D20177

5 years ago- Remove the unused ifc_link_irq and ifc_mtx_name members of struct iflib_ctx.
marius [Mon, 6 May 2019 20:56:41 +0000 (20:56 +0000)]
- Remove the unused ifc_link_irq and ifc_mtx_name members of struct iflib_ctx.
- Remove the only ever written to ift_db_mtx_name member of struct iflib_txq.
- Remove the unused or only ever written to ifr_size, ifr_cq_pidx, ifr_cq_gen
  and ifr_lro_enabled members of struct iflib_rxq.
- Consistently spell DMA, RX and TX uppercase in comments, messages etc.
  instead of mixing with some lowercase variants.
- Consistently use if_t instead of a mix of if_t and struct ifnet pointers.
- Bring the function comments of _iflib_fl_refill(), iflib_rx_sds_free() and
  iflib_fl_setup() in line with reality.
- Judging problem reports, people are wondering what on earth messages like:
  "TX(0) desc avail = 1024, pidx = 0"
  are trying to indicate. Thus, extend this string to be more like that of
  non-iflib(4) Ethernet MAC drivers, notifying about a watchdog timeout due
  to which the interface will be reset.
- Take advantage of the M_HAS_VLANTAG macro.
- Use false/true rather than FALSE/TRUE for variables of type bool.
- Use FALLTHROUGH as advocated by style(9).

5 years agoImport libxo-1.0.4:
phil [Mon, 6 May 2019 20:20:21 +0000 (20:20 +0000)]
Import libxo-1.0.4:
- Avoid NULL deref in xo_xml_leader_len (replacing local fix in rS345967)
- update copyright dates
- update test cases
- fix uncommitted version change

Submitted by: phil
MFC after: 2 weeks

5 years agoAdds sys/class/net devices to linsysfs.
dchagin [Mon, 6 May 2019 20:01:13 +0000 (20:01 +0000)]
Adds sys/class/net devices to linsysfs.

Only two interfaces are created eth0 and lo and they expose
the following properties:
address, addr_len, flags, ifindex, mty, tx_queue_len and type.

Initial patch developed by Carlos Neira in 2017 and finished by me.

PR: 223722
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13656

5 years agoRewrite linux_ifflags() in more readable Linuxulator style.
dchagin [Mon, 6 May 2019 19:57:51 +0000 (19:57 +0000)]
Rewrite linux_ifflags() in more readable Linuxulator style.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20146

5 years agoComplete r347052 (https://reviews.freebsd.org/D20137) as it it was not
dchagin [Mon, 6 May 2019 19:56:13 +0000 (19:56 +0000)]
Complete r347052 (https://reviews.freebsd.org/D20137) as it it was not
a final revision.

Fix style issues and change bool-like variables from int to bool.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20141

5 years agoSimplify boot1 allocation of handles.
imp [Mon, 6 May 2019 19:35:30 +0000 (19:35 +0000)]
Simplify boot1 allocation of handles.

There's no need to pre-malloc the number of handles. Instead call
LocateHandles twice, once to get the size, and once to get the
data.

5 years agoDrop periph lock around cam_periph_unmapmem().
mav [Mon, 6 May 2019 19:08:03 +0000 (19:08 +0000)]
Drop periph lock around cam_periph_unmapmem().

Since r345656 it may call copyout(), that may sleep.

MFC after: 3 days
Sponsored by: iXsystems, Inc.

5 years agoThe build process generates assym.inc from genassym.o, so don't forget
dchagin [Mon, 6 May 2019 18:46:42 +0000 (18:46 +0000)]
The build process generates assym.inc from genassym.o, so don't forget
to clean genassym.o

MFC after: 2 weeks

5 years agoAbstract out efi_devpath_to_handle to search for a handle that matches
imp [Mon, 6 May 2019 18:39:27 +0000 (18:39 +0000)]
Abstract out efi_devpath_to_handle to search for a handle that matches
the desired devpath.

5 years agoWe only ever need one devinfo per handle. So allocate it outside of
imp [Mon, 6 May 2019 18:39:22 +0000 (18:39 +0000)]
We only ever need one devinfo per handle. So allocate it outside of
looping over the filesystem modules rather than doing a malloc + free
each time through the loop. In addition, nothing changes from loop to
loop, so setup the new devinfo outside the loop as well.

5 years agoReach over and pull in devpath.c from libefi
imp [Mon, 6 May 2019 18:38:46 +0000 (18:38 +0000)]
Reach over and pull in devpath.c from libefi

This allows us to remove three nearly identical functions because the
differences don't matter, and the size difference is trivial.

5 years agoList-ify kernel dump device configuration
cem [Mon, 6 May 2019 18:24:07 +0000 (18:24 +0000)]
List-ify kernel dump device configuration

Allow users to specify multiple dump configurations in a prioritized list.
This enables fallback to secondary device(s) if primary dump fails.  E.g.,
one might configure a preference for netdump, but fallback to disk dump as a
second choice if netdump is unavailable.

This change does not list-ify netdump configuration, which is tracked
separately from ordinary disk dumps internally; only one netdump
configuration can be made at a time, for now.  It also does not implement
IPv6 netdump.

savecore(8) is already capable of scanning and iterating multiple devices
from /etc/fstab or passed on the command line.

This change doesn't update the rc or loader variables 'dumpdev' in any way;
it can still be set to configure a single dump device, and rc.d/savecore
still uses it as a single device.  Only dumpon(8) is updated to be able to
configure the more complicated configurations for now.

As part of revving the ABI, unify netdump and disk dump configuration ioctl
/ structure, and leave room for ipv6 netdump as a future possibility.
Backwards-compatibility ioctls are added to smooth ABI transition,
especially for developers who may not keep kernel and userspace perfectly
synced.

Reviewed by: markj, scottl (earlier version)
Relnotes: maybe
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19996

5 years agoUse PCIV_INVALID in pci_channel_offline() in the LinuxKPI.
hselasky [Mon, 6 May 2019 16:22:45 +0000 (16:22 +0000)]
Use PCIV_INVALID in pci_channel_offline() in the LinuxKPI.

Build tested drm-current-kmod prior to commit.

MFC after: 1 week
Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoDisabling a PCI device should only disable busmaster in the LinuxKPI.
hselasky [Mon, 6 May 2019 16:17:38 +0000 (16:17 +0000)]
Disabling a PCI device should only disable busmaster in the LinuxKPI.

As Linux comment for this function point:
Signal to the system that the PCI device is not in use by the system
anymore. This only involves disabling PCI bus-mastering, if active.

Build tested drm-current-kmod prior to commit.

MFC after: 1 week
Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoImplement print_hex_dump_debug() function macro in the LinuxKPI.
hselasky [Mon, 6 May 2019 16:10:26 +0000 (16:10 +0000)]
Implement print_hex_dump_debug() function macro in the LinuxKPI.

Build tested drm-current-kmod prior to commit.

MFC after: 1 week
Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoReformat arm64 linux syscalls.master per current style
emaste [Mon, 6 May 2019 16:07:14 +0000 (16:07 +0000)]
Reformat arm64 linux syscalls.master per current style

Equivalent to r339958 for sys/kern/syscalls.master.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14858

5 years agoAllow controlling pr_debug at runtime in the LinuxKPI.
hselasky [Mon, 6 May 2019 16:00:20 +0000 (16:00 +0000)]
Allow controlling pr_debug at runtime in the LinuxKPI.

Turning on pr_debug at compile time make it non-optional at runtime.
This often means that the amount of the debugging is unbearable.
Allow developer to turn on pr_debug output only when needed.

Build tested drm-current-kmod prior to commit.

MFC after: 1 week
Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agogeom: fix initialization order
royger [Mon, 6 May 2019 09:48:34 +0000 (09:48 +0000)]
geom: fix initialization order

There's a race between the initialization of devsoftc.mtx (by devinit)
and the creation of the geom worker thread g_run_events, which calls
devctl_queue_data_f. Both of those are initialized at SI_SUB_DRIVERS
and SI_ORDER_FIRST, which means the geom worked thread can be created
before the mutex has been initialized, leading to the panic below:

 wpanic: mtx_lock() of spin mutex (null) @ /usr/home/osstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620
 cpuid = 3
 time = 1
 KDB: stack backtrace:
 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe003b968710
 vpanic() at vpanic+0x19d/frame 0xfffffe003b968760
 panic() at panic+0x43/frame 0xfffffe003b9687c0
 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xfffffe003b968810
 devctl_queue_data_f() at devctl_queue_data_f+0x6a/frame 0xfffffe003b968840
 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003b968a00
 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003b968a30
 g_run_events() at g_run_events+0x197/frame 0xfffffe003b968a70
 fork_exit() at fork_exit+0x84/frame 0xfffffe003b968ab0
 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe003b968ab0
 --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
 KDB: enter: panic
 [ thread pid 13 tid 100029 ]
 Stopped at      kdb_enter+0x3b: movq    $0,kdb_why

Fix this by initializing geom at SI_ORDER_SECOND instead of
SI_ORDER_FIRST.

Sponsored by: Citrix Systems R&D
Reviewed by: kevans, markj
Differential revision: https://reviews.freebsd.org/D20148

5 years agoDo not flush NFS node from NFS VOP_SET_TEXT().
kib [Mon, 6 May 2019 08:49:43 +0000 (08:49 +0000)]
Do not flush NFS node from NFS VOP_SET_TEXT().

The more appropriate place to do the flushing is VOP_OPEN().  This was
uncovered because VOP_SET_TEXT() is now called with the vnode'
vm_object rlocked, which is incompatible with the flush operations.

After the move, there is no need for NFS-specific VOP_SET_TEXT
overload.

Sponsored by: The FreeBSD Foundation
MFC after: 30 days

5 years agoNoted by: alc
kib [Mon, 6 May 2019 08:46:11 +0000 (08:46 +0000)]
Noted by: alc
Reviewed by: alc, markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 6 days

5 years agoAdd ipsec.ko to required_modules for rc.d/ipsec script.
ae [Mon, 6 May 2019 08:30:53 +0000 (08:30 +0000)]
Add ipsec.ko to required_modules for rc.d/ipsec script.

Thus it can be automatically loaded if ipsec_enable="YES" and option IPSEC
is not in the kernel config.

MFC after: 1 week

5 years agozero inputs to vm_page_initfake() for predictable results
tychon [Mon, 6 May 2019 00:57:05 +0000 (00:57 +0000)]
zero inputs to vm_page_initfake() for predictable results

Reviewed by: kib
Submitted by: Anton Rang <rang at acm.org>
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20162

5 years agopowerpc/booke: Use #ifdef __powerpc64__ instead of hw_direct_map in places
jhibbits [Sun, 5 May 2019 20:23:43 +0000 (20:23 +0000)]
powerpc/booke: Use #ifdef __powerpc64__ instead of hw_direct_map in places

Since the DMAP is only available on powerpc64, and is *always* available on
Book-E powerpc64, don't penalize either side (32-bit or 64-bit) by always
checking hw_direct_map to perform operations.  This saves 5-10% time on
various ports builds, and on buildworld+buildkernel on Book-E hardware.

MFC after: 3 weeks

5 years agopowerpc/booke: Fix size check for phys_avail in pmap bootstrap
jhibbits [Sun, 5 May 2019 20:05:50 +0000 (20:05 +0000)]
powerpc/booke: Fix size check for phys_avail in pmap bootstrap

Use the nitems() macro instead of the expansion, a'la r298352.  Also, fix the
location of this check to after initializing availmem_regions_sz, so that the
check isn't always against 0, thus always failing (nitems(phys_avail) is always
more than 0).

5 years agoDecode some more ATA commands found in ACS-4.
mav [Sun, 5 May 2019 17:10:12 +0000 (17:10 +0000)]
Decode some more ATA commands found in ACS-4.

MFC after: 1 week

5 years agoEnsure that error is initialized in ufs_bmap_seekdata().
markj [Sun, 5 May 2019 16:57:03 +0000 (16:57 +0000)]
Ensure that error is initialized in ufs_bmap_seekdata().

Reported and tested by: jhibbits
MFC with: r346932
Sponsored by: The FreeBSD Foundation

5 years agoDecode Deallocate Logical Block Features.
mav [Sun, 5 May 2019 15:47:21 +0000 (15:47 +0000)]
Decode Deallocate Logical Block Features.

MFC after: 1 week

5 years agoSwitch to use shared vnode locks for text files during image activation.
kib [Sun, 5 May 2019 11:20:43 +0000 (11:20 +0000)]
Switch to use shared vnode locks for text files during image activation.

kern_execve() locks text vnode exclusive to be able to set and clear
VV_TEXT flag. VV_TEXT is mutually exclusive with the v_writecount > 0
condition.

The change removes VV_TEXT, replacing it with the condition
v_writecount <= -1, and puts v_writecount under the vnode interlock.
Each text reference decrements v_writecount.  To clear the text
reference when the segment is unmapped, it is recorded in the
vm_map_entry backed by the text file as MAP_ENTRY_VN_TEXT flag, and
v_writecount is incremented on the map entry removal

The operations like VOP_ADD_WRITECOUNT() and VOP_SET_TEXT() check that
v_writecount does not contradict the desired change.  vn_writecheck()
is now racy and its use was eliminated everywhere except access.
Atomic check for writeability and increment of v_writecount is
performed by the VOP.  vn_truncate() now increments v_writecount
around VOP_SETATTR() call, lack of which is arguably a bug on its own.

nullfs bypasses v_writecount to the lower vnode always, so nullfs
vnode has its own v_writecount correct, and lower vnode gets all
references, since object->handle is always lower vnode.

On the text vnode' vm object dealloc, the v_writecount value is reset
to zero, and deadfs vop_unset_text short-circuit the operation.
Reclamation of lowervp always reclaims all nullfs vnodes referencing
lowervp first, so no stray references are left.

Reviewed by: markj, trasz
Tested by: mjg, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D19923

5 years agoDo not collapse objects with OBJ_NOSPLIT backing swap object.
kib [Sun, 5 May 2019 11:06:19 +0000 (11:06 +0000)]
Do not collapse objects with OBJ_NOSPLIT backing swap object.

NOSPLIT swap objects are not anonymous, they are used by tmpfs regular
files and POSIX shared memory.  For such objects, collapse is not
permitted.

Reported by: mjg
Reviewed by: markj, trasz
Tested by: mjg, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19923

5 years agoimgact_elf: do not relock the text vnode if possible.
kib [Sun, 5 May 2019 11:04:01 +0000 (11:04 +0000)]
imgact_elf: do not relock the text vnode if possible.

We unlock the vnode around malloc(M_WAITOK), to make it possible for
pagedaemon to flush vnode pages for us.  Instead of doing it
unconditionally, first try M_NOWAIT allocation, which typically
succeed.  Only on failure, unlock the vnode and retry with M_WAITOK.

Reviewed by: markj, trasz
Tested by: mjg, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19923

5 years agoColemak Mod DH keyboard layout
cs [Sun, 5 May 2019 09:02:32 +0000 (09:02 +0000)]
Colemak Mod DH keyboard layout

This is a minor modification of the Colemak keyboard layout.
See: http://colemakmods.github.io/mod-dh/

Reviewed by: philip
Differential Revision: https://reviews.freebsd.org/D20133

5 years agoloader: validate sectorsize argument in disk_open()
tsoome [Sun, 5 May 2019 06:38:47 +0000 (06:38 +0000)]
loader: validate sectorsize argument in disk_open()

The bug and patch is reported against 11.2, but it is good idea to have
the check in place for all versions.

PR: 236585
Submitted by: john@feith.com
Reported by: john@feith.com
MFC after: 1 day

5 years ago[ath_rate_sample] Have the final attempted rate in 11n modes to be the lowest one.
adrian [Sun, 5 May 2019 06:32:40 +0000 (06:32 +0000)]
[ath_rate_sample] Have the final attempted rate in 11n modes to be the lowest one.

Right now ath_rate_sample has a fixed rate schedule, rather than the minstrel_ht
style "best, good, most reliable" triplet.  So, if higher rates are tried then
it'll not fail back to a lower MCS rate in that transmission schedule.

This means that in low SNR situations it'll not easily drop to MCS0 unless enough
transmissions occur to allow rate control to eventually decide to drop; and if
it's TCP traffic it'll get slowed down because of packet loss.

It's worse for 2-stream and 3-stream rates; it doesn't ever fall back to lower
stream rates, and these higher stream rates required higher SNR to work.

So instead let's (for now?) have each of the 11n transmit rates use MCS0 as
the last attempt. ath_rate_sample will quickly see that rate succeeds more
and will move to it much quicker.

Testing:

* AR9344 (Wasp) - 2G STA mode

5 years ago[ath] [ath_rate] Fix ANI calibration during non-ACTIVE states; start poking at rate...
adrian [Sun, 5 May 2019 04:56:37 +0000 (04:56 +0000)]
[ath] [ath_rate] Fix ANI calibration during non-ACTIVE states; start poking at rate control

These are some fun issues I've found with my upstairs wifi link at such a ridiculous
low signal level (like, < 5dB.)

* Add per-station tx/rx rssi statistics, in potential preparation to use that
  in the RX rate control.

* Call the rate control on each received frame to let it potentially use
  it as a hint for what rates to potentially use.  It's a no-op right now.

* Do ANI calibration during scan as well. The ath_newstate() call was disabling the
  ANI timer and only re-enabling it during transitions to _RUN.  This has the
  unfortunate side-effect that if ANI deafened the NIC because of interference
  and it disassociated, it wouldn't be reset and the scan would never hear beacons.

The ANI configuration is stored at least globally on some HALs and per-channel
on others.  Because of this a NIC reset wouldn't help; the ANI parameters would
simply be programmed back in.

Now, I have a feeling I also need to do this during AUTH/ASSOC too and maybe,
if I'm feeling clever, I need to reset the ANI parameters on a given channel
during a transition through INIT or if the VAP is destroyed/re-created.
However for now this gets me out of the immediate weeds with connectivity
upstairs (and thus I /can/ commit); I'll keep chipping away at tidying this
stuff up in subsequent commits.

Tested:

* AR9344 (Wasp), 2G STA mode

5 years agoMFV r347136:
cy [Sun, 5 May 2019 04:14:17 +0000 (04:14 +0000)]
MFV r347136:

Update sqlite3-3.27.2 (3270200) --> sqlite3-3.28.0 (3280000)

MFC after: 3 days
Security: CVE-2019-9937, CVE-2019-9936

5 years agox86: Implement MWAIT support for stopping a CPU
cem [Sat, 4 May 2019 20:34:26 +0000 (20:34 +0000)]
x86: Implement MWAIT support for stopping a CPU

IPI_STOP is used after panic or when ddb is entered manually.  MONITOR/
MWAIT allows CPUs that support the feature to sleep in a low power way
instead of spinning.  Something similar is already used at idle.

It is perhaps especially useful in oversubscribed VM environments, and is
safe to use even if the panic/ddb thread is not the BSP.  (Except in the
presence of MWAIT errata, which are detected automatically on platforms with
known wakeup problems.)

It can be tuned/sysctled with "machdep.stop_mwait," which defaults to 0
(off).  This commit also introduces the tunable
"machdep.mwait_cpustop_broken," which defaults to 0, unless the CPU has
known errata, but may be set to "1" in loader.conf to signal that mwait
wakeup is broken on CPUs FreeBSD does not yet know about.

Unfortunately, Bhyve doesn't yet support MONITOR extensions, so this doesn't
help bhyve hypervisors running FreeBSD guests.

Submitted by:   Anton Rang <rang AT acm.org> (earlier version)
Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20135

5 years agoarm64: Properly restore PAN when done with userspace access in casueword.
kib [Sat, 4 May 2019 19:40:30 +0000 (19:40 +0000)]
arm64: Properly restore PAN when done with userspace access in casueword.

Approved by: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agosysv: get rid of fork/exit hooks if the code is compiled in
mjg [Sat, 4 May 2019 19:05:30 +0000 (19:05 +0000)]
sysv: get rid of fork/exit hooks if the code is compiled in

Sponsored by: The FreeBSD Foundation

5 years agoAnnotate nprocs with __exclusive_cache_line
mjg [Sat, 4 May 2019 19:04:17 +0000 (19:04 +0000)]
Annotate nprocs with __exclusive_cache_line

Sponsored by: The FreeBSD Foundation

5 years agoZero out the file directory entry metadata to reduce disk
mckusick [Sat, 4 May 2019 18:00:57 +0000 (18:00 +0000)]
Zero out the file directory entry metadata to reduce disk
scavenging disclosure.

Submitted by: David G. Lawrence <dg@dglawrence.com>
MFC after:    1 week

5 years agox86: Define pc_monitorbuf as a logical structure
cem [Sat, 4 May 2019 17:35:13 +0000 (17:35 +0000)]
x86: Define pc_monitorbuf as a logical structure

Rather than just accessing it via pointer cast.

No functional change intended.

Discussed with: kib (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20135

5 years agopowerpc/mpc85xx: Attach MPC85xx PCI bus and root complex at the right pass
jhibbits [Sat, 4 May 2019 16:24:43 +0000 (16:24 +0000)]
powerpc/mpc85xx: Attach MPC85xx PCI bus and root complex at the right pass

No signifcant change, just matches other PCI attachments, attaching at
BUS_PASS_BUS.

MFC after: 2 weeks

5 years agoAdd emmc clock definitions for Rockchip RK3399 SoC.
ganbold [Sat, 4 May 2019 10:48:44 +0000 (10:48 +0000)]
Add emmc clock definitions for Rockchip RK3399 SoC.

5 years agoFix regression issue after r346645 in the LinuxKPI.
hselasky [Sat, 4 May 2019 09:47:01 +0000 (09:47 +0000)]
Fix regression issue after r346645 in the LinuxKPI.

The S/G list must be mapped AS-IS without any optimisations.
This also implies that sg_dma_len() must be equal to sg->length.
Many Linux drivers assume this and this fixes some DRM issues.

Put the BUS DMA map pointer into the scatter-gather list to
allow multiple mappings on the same physical memory address.

The FreeBSD version has been bumped to force recompilation of
external kernel modules.

Sponsored by: Mellanox Technologies

5 years agoFix regression issue after r346645 in the LinuxKPI.
hselasky [Sat, 4 May 2019 09:30:03 +0000 (09:30 +0000)]
Fix regression issue after r346645 in the LinuxKPI.
Properly handle error case when mapping DMA address fails.

Sponsored by: Mellanox Technologies

5 years agopowerpc: Optimize padding in bus_dma_tag
jhibbits [Sat, 4 May 2019 02:45:24 +0000 (02:45 +0000)]
powerpc: Optimize padding in bus_dma_tag

Avoid 8 bytes of padding (2 noncontiguous ints).

Submitted by: Brandon Bergren <git_bdragon.rtk0.net>
Differential Revision: https://reviews.freebsd.org/D20121

5 years agopowerpc: Merge all pmap struct definitions
jhibbits [Sat, 4 May 2019 02:34:28 +0000 (02:34 +0000)]
powerpc: Merge all pmap struct definitions

Summary:
A few ports fail to build due to missing pmap-related definitions, which are
specific per-pmap type.  This tries to appease those ports, by merging all
pmaps together.

A future change will move the inline page directory out of the Book-E pmap,
to eliminate the last #ifdefs in pmap.h and complete the merge.

Reviewed By: luporl
Differential Revision: https://reviews.freebsd.org/D20119

5 years agoFix `clang -Wcast-qual` issues
ngie [Sat, 4 May 2019 02:09:30 +0000 (02:09 +0000)]
Fix `clang -Wcast-qual` issues

Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and
deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb`
variable.

This unblocks ^/projects/runtime-coverage-v2 from building cleanly on
universe13a.freebsd.org. I suspect the issue was introduced through some
changes to `bsd.*.mk` inclusion on the branch, which I will continue to
investigate/isolate.

MFC after: 1 week
Tested with: clang 8 (arm64)

5 years agoThis update eliminates a kernel stack disclosure bug in UFS/FFS
mckusick [Fri, 3 May 2019 21:54:14 +0000 (21:54 +0000)]
This update eliminates a kernel stack disclosure bug in UFS/FFS
directory entries that is caused by uninitialized directory entry
padding written to the disk. It can be viewed by any user with read
access to that directory. Up to 3 bytes of kernel stack are disclosed
per file entry, depending on the the amount of padding the kernel
needs to pad out the entry to a 32 bit boundry. The offset in the
kernel stack that is disclosed is a function of the filename size.
Furthermore, if the user can create files in a directory, this 3
byte window can be expanded 3 bytes at a time to a 254 byte window
with 75% of the data in that window exposed. The additional exposure
is done by removing the entry, creating a new entry with a 4-byte
longer name, extracting 3 more bytes by reading the directory, and
repeating until a 252 byte name is created.

This exploit works in part because the area of the kernel stack
that is being disclosed is in an area that typically doesn't change
that often (perhaps a few times a second on a lightly loaded system),
and these file creates and unlinks themselves don't overwrite the
area of kernel stack being disclosed.

It appears that this bug originated with the creation of the Fast
File System in 4.1b-BSD (Circa 1982, more than 36 years ago!), and
is likely present in every Unix or Unix-like system that uses
UFS/FFS. Amazingly, nobody noticed until now.

This update also adds the -z flag to fsck_ffs to have it scrub
the leaked information in the name padding of existing directories.
It only needs to be run once on each UFS/FFS filesystem after a
patched kernel is installed and running.

Submitted by: David G. Lawrence <dg@dglawrence.com>
Reviewed by:  kib
MFC after:    1 week

5 years agoEmulate the "ADD reg, r/m" instruction (opcode 03H).
jhb [Fri, 3 May 2019 21:48:42 +0000 (21:48 +0000)]
Emulate the "ADD reg, r/m" instruction (opcode 03H).

OVMF's flash variable storage is using add instructions when indexing
the variable store bootrom location.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Reviewed by: rgrimes
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19975

5 years agoSimplify calculation of DIRECTSIZ. No functional change intended.
mckusick [Fri, 3 May 2019 21:46:25 +0000 (21:46 +0000)]
Simplify calculation of DIRECTSIZ. No functional change intended.

Suggested by: kib
MFC after:    1 week

5 years agoDisallow excessively small times of day in clock_settime(2).
markj [Fri, 3 May 2019 21:26:44 +0000 (21:26 +0000)]
Disallow excessively small times of day in clock_settime(2).

Reported by: syzkaller
Reviewed by: cem, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20151

5 years agoUse SRC+= rather than SRC=
imp [Fri, 3 May 2019 21:13:09 +0000 (21:13 +0000)]
Use SRC+= rather than SRC=

To allow boot1/Makefile to be included, use SRC+= rathern than SRC=
so the including Makefile can add additional sources to the build.

5 years agoSubstitute boot1 with ${BOOT1}
imp [Fri, 3 May 2019 21:13:04 +0000 (21:13 +0000)]
Substitute boot1 with ${BOOT1}

Allow for other names to be built, so parameterize this makefile to
avoid hard coding boot1.

5 years agoWhen we can't get memory, trying again right away is going to
imp [Fri, 3 May 2019 21:09:25 +0000 (21:09 +0000)]
When we can't get memory, trying again right away is going to
fail. Rather than print N failure messages, bail on the first one.

5 years agoRemove stray '*'
imp [Fri, 3 May 2019 21:06:34 +0000 (21:06 +0000)]
Remove stray '*'

We're storing an EFI_HANDLE, not an pointer to a handle. Since
EFI_HANDLE is a void * anyway, this has little practical effect since
the conversion to / from void * and void ** is silent.

5 years agoWhen MAC is enabled and a policy module is loaded, don't unconditionally
rwatson [Fri, 3 May 2019 20:38:43 +0000 (20:38 +0000)]
When MAC is enabled and a policy module is loaded, don't unconditionally
lock mac_ifnet_mtx, which protects labels on struct ifnet, unless at least
one policy is actively using labels on ifnets.  This avoids a global mutex
acquire in certain fast paths -- most noticeably ifnet transmit.  This was
previously invisible by default, as no MAC policies were loaded by default,
but recently became visible due to mac_ntpd being enabled by default.

gallatin@ reports a reduction in PPS overhead from 300% to 2.2% with this
change.  We will want to explore further MAC Framework optimisation to
reduce overhead further, but this brings things more back into the world
of the sane.

MFC after: 3 days

5 years agoAllow iflib drivers to pass a pointer to their own ifmedia structure.
mmacy [Fri, 3 May 2019 20:05:31 +0000 (20:05 +0000)]
Allow iflib drivers to pass a pointer to their own ifmedia structure.

Tested by: emaste@

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

5 years agoIncrease the default size of the GCE disk image from 3GB to 20GB,
gjb [Fri, 3 May 2019 17:23:08 +0000 (17:23 +0000)]
Increase the default size of the GCE disk image from 3GB to 20GB,
as 3GB is too small as discovered in this week's snapshot builds.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoSelect lacp egress ports based on NUMA domain
gallatin [Fri, 3 May 2019 14:43:21 +0000 (14:43 +0000)]
Select lacp egress ports based on NUMA domain

This change creates an array of port maps indexed by numa domain
for lacp port selection. If we have lacp interfaces in more than
one domain, then we select the egress port by indexing into the
numa port maps and picking a port on the appropriate numa domain.

This is behavior is controlled by the new ifconfig use_numa flag
and net.link.lagg.use_numa sysctl/tunable (both modeled after the
existing use_flowid), which default to enabled.

Reviewed by: bz, hselasky, markj (and scottl, earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20060

5 years agoFix copying planar bitmaps when the horizontal start and end are both not
bde [Fri, 3 May 2019 13:06:46 +0000 (13:06 +0000)]
Fix copying planar bitmaps when the horizontal start and end are both not
multiples of 8.  Then the misaligned pixels at the end were not copied.

Clean up variable misuse related to this bug.  The width in bytes was
first calculated correctly and used to do complicated reblocking
correctly, but it was stored in an unrelated scratch variable and later
recalculated with an off-by-1-error, so the last byte (times 4 planes)
in the intermediate copy was not copied.

This doubly-misaligned case is especially slow.  Misalignment complicates
the reblocking, and each misaligment requires a read before write, and this
read is still not done from the shadow buffer.

5 years agoIn order to reduce duplication between MD parts of the Linuxulator
dchagin [Fri, 3 May 2019 08:42:49 +0000 (08:42 +0000)]
In order to reduce duplication between MD parts of the Linuxulator
move bits that are MI out into the headers in compat/linux.
For that remove bogus _packed attribute from struct l_sockaddr
and use MI types for struct members.

And continue to move into the linux_common module a code that is
intended for both Linuxulator modules (both instruction set - 32 & 64 bit)
or for external modules like linsysfs or linprocfs.

To avoid header pollution introduce new sys/compat/linux_common.h header.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20137

5 years agoDecode more CPU flags in cpuinfo.
trasz [Fri, 3 May 2019 08:27:03 +0000 (08:27 +0000)]
Decode more CPU flags in cpuinfo.

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

5 years ago[libfetch] Fix compilation with WITHOUT_CRYPT.
adrian [Fri, 3 May 2019 06:06:39 +0000 (06:06 +0000)]
[libfetch] Fix compilation with WITHOUT_CRYPT.

5 years agofls() should find the most significant bit of an int faster than a
dougm [Fri, 3 May 2019 02:55:54 +0000 (02:55 +0000)]
fls() should find the most significant bit of an int faster than a
linear search can, so use it to avoid a linear search in isqrt.

Approved by: kib (mentor), markj (mentor)
Differential Revision: https://reviews.freebsd.org/D20102

5 years agoIncrease the VirtIO segment count to support modern Windows guests.
jhb [Thu, 2 May 2019 22:46:37 +0000 (22:46 +0000)]
Increase the VirtIO segment count to support modern Windows guests.

The Windows virtio driver ignores the advertized seg_max field and
assumes the host can accept up to 67 segments in indirect descriptors,
triggering an assert in the bhyve process.

This brings back r282922 but with a couple of changes:
- It raises the block interface segment limit to 128 instead of 67.
- Linux's virtio driver assumes that the segment limit is no
  larger than the ring size.  To avoid breaking Linux guests,
  raise the VirtIO ring size to 128, and cap the VirtIO segment
  limit at ring size - 2 (effectively 126).

Reviewed by: rgrimes, Patrick Mooney <pmooney@pfmooney.com>
Obtained from: Joyent (Linux workaround)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18831

5 years agodirectory.3: add a STANDARDS section
asomers [Thu, 2 May 2019 19:59:37 +0000 (19:59 +0000)]
directory.3: add a STANDARDS section

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

5 years agoiflib: remove assertion that isc_capabilities is nonzero
emaste [Thu, 2 May 2019 19:13:31 +0000 (19:13 +0000)]
iflib: remove assertion that isc_capabilities is nonzero

It's atypical, but not invalid, for a driver to pass no capabilities.

Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by: shurd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20142

5 years agoFix flags in cpuinfo.
trasz [Thu, 2 May 2019 19:02:16 +0000 (19:02 +0000)]
Fix flags in cpuinfo.

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

5 years agoAdd a COMPAT_FREEBSD12 kernel option.
cem [Thu, 2 May 2019 18:10:23 +0000 (18:10 +0000)]
Add a COMPAT_FREEBSD12 kernel option.

Use it wherever COMPAT_FREEBSD11 is currently specified, like r309749.

Reviewed by: imp, jhb, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20120

5 years agolibbe: set mountpoint=none in be_import
kevans [Thu, 2 May 2019 17:50:56 +0000 (17:50 +0000)]
libbe: set mountpoint=none in be_import

If we're going to set a mountpoint at all, mountpoint=none makes more sense
than mountpoint=/.

MFC after:  3 days

5 years agolibbe(3): Properly mount BEs with mountpoint=none
kevans [Thu, 2 May 2019 17:44:46 +0000 (17:44 +0000)]
libbe(3): Properly mount BEs with mountpoint=none

Instead of pretending to successfully mount them while not actually
mounting anything, we'll now actually mount them *and* claim we mounted them
successfully.

Reported by: ler
MFC after: 3 days

5 years agodtb: Include RK3399 RockPro64 DTS in kernel build
manu [Thu, 2 May 2019 17:04:01 +0000 (17:04 +0000)]
dtb: Include RK3399 RockPro64 DTS in kernel build

The DTS for this board is already present in sys/gnu/dts/arm64/rockchip/
and just needs to be enabled.

Submitted by: alex@wied.io
Differential Revision: https://reviews.freebsd.org/D19823

5 years agostand: correct mis-merge from r346879
kevans [Thu, 2 May 2019 17:01:13 +0000 (17:01 +0000)]
stand: correct mis-merge from r346879

Small mis-merge from multiple WIP resulted in block io media handles getting
double-initialized. This resulted in some installations oddly landing at the
mountroot prompt.

Reported by: ler
Reviewed by: imp

5 years agofdt: Fix installation of aarch64 dtb
kevans [Thu, 2 May 2019 16:56:03 +0000 (16:56 +0000)]
fdt: Fix installation of aarch64 dtb

r345519 rewrote parts of how we build .dtb, but mistakenly dropped the
vendor dir for aarch64.  Simply drop the :T for building ${DTB} in the
aarch64 case- it'll get applied at install-time as-needed, with :H:T for
determining the vendor dir.

Reported by: manu
Tested by: manu
Reviewed by: manu
MFC after: 3 days

5 years agoEnroll new committer Doug Moore (dougm@freebsd.org).
dougm [Thu, 2 May 2019 16:28:33 +0000 (16:28 +0000)]
Enroll new committer Doug Moore (dougm@freebsd.org).

Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20136

5 years agoCleanup for rtld_malloc.c.
kib [Thu, 2 May 2019 15:03:16 +0000 (15:03 +0000)]
Cleanup for rtld_malloc.c.

- Remove dead and most likely rotten MALLOC_DEBUG, MSTAT, and RCHECK options.
- Remove unused headers.
- Remove one case of undefined behavior where left shift could overflow.
  It is impossible on practice for rtld and libthr consumer.

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

5 years agoarm64: Add support for NanoPI NEO2
manu [Thu, 2 May 2019 12:56:13 +0000 (12:56 +0000)]
arm64: Add support for NanoPI NEO2

Add overlay files and activate devicetree file for NanoPi NEO2 featuring
Allwinner H5 ARM64 core.
To enable sound, dma and codec drivers are enabled for build.

Submitted by: Manuel Stühn (freebsdnewbie@freenet.de)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20129

5 years agoRemove unneeded includes.
dchagin [Thu, 2 May 2019 09:00:36 +0000 (09:00 +0000)]
Remove unneeded includes.

MFC after: 2 week

5 years agoAdd sys/devices/system/cpu/{possible,present} to linsysfs(5).
trasz [Thu, 2 May 2019 08:17:29 +0000 (08:17 +0000)]
Add sys/devices/system/cpu/{possible,present} to linsysfs(5).
That makes Linux lscpu(1) work.

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

5 years agopowerpc: Drop OPAL_HANDLE_HMI2 for now, to avoid panicking
jhibbits [Thu, 2 May 2019 03:39:03 +0000 (03:39 +0000)]
powerpc: Drop OPAL_HANDLE_HMI2 for now, to avoid panicking

It's possible for a Hypervisor Maintenance Interrupt (HMI) to occur while in
the pmap code, holding locks.  This can cause WITNESS to panic due to lock
errors in calling pmap_kextract().  Since we don't yet handle the flags
returned by OPAL_HANDLE_HMI2, just stop using it, so that we don't call into
pmap_kextract().

Reported by: pkubaj