]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r353618,r353625,r353627: MFV r353617: 9425 allow channel programs to be stopped...
Andriy Gapon [Tue, 19 Nov 2019 07:19:33 +0000 (07:19 +0000)]
MFC r353618,r353625,r353627: MFV r353617: 9425 allow channel programs to be stopped via signals

4 years agoMFC r353729:
Mark Johnston [Mon, 18 Nov 2019 17:19:16 +0000 (17:19 +0000)]
MFC r353729:
Apply mapping protections to .o kernel modules.

4 years agoMFC r354746:
Toomas Soome [Mon, 18 Nov 2019 16:40:03 +0000 (16:40 +0000)]
MFC r354746:
loader: add support for hybrid PMBR for GPT partition table

Note hybrid table is nor really UEFI specification compliant.

Sample hybrid partition table:
> ::mbr
Format: unknown
Signature: 0xaa55 (valid)
UniqueMBRDiskSignature: 0

PART TYPE                  ACTIVE  STARTCHS    ENDCHS      SECTOR     NUMSECT
0    EFI_PMBR:0xee         0       1023/254/63 1023/254/63 1          409639
1    0xff                  0       1023/254/63 1023/254/63 409640     978508408
2    FDISK_EXT_WIN:0xc     0       1023/254/63 1023/254/63 978918048  31250000
3    0xff                  0       1023/254/63 1023/254/63 1010168048 32
>

4 years agoMFC r354743, r354766:
Toomas Soome [Mon, 18 Nov 2019 16:37:21 +0000 (16:37 +0000)]
MFC r354743, r354766:

loader: r354415 did miss to sort subpaths below the partitions
loader: remove unused variable from efipart.c

4 years agoMFC r353672:
Mark Johnston [Mon, 18 Nov 2019 15:28:10 +0000 (15:28 +0000)]
MFC r353672:
Introduce pmap_change_prot() for amd64.

4 years agoMFC r354629:
Mark Johnston [Mon, 18 Nov 2019 15:27:52 +0000 (15:27 +0000)]
MFC r354629:
Fix handling of PIPE_EOF in the direct write path.

4 years agoMFC r354630:
Konstantin Belousov [Mon, 18 Nov 2019 13:38:35 +0000 (13:38 +0000)]
MFC r354630:
amd64: Issue MFENCE on context switch on AMD CPUs when reusing address space.

4 years agoMFC r354591:
Konstantin Belousov [Mon, 18 Nov 2019 13:37:13 +0000 (13:37 +0000)]
MFC r354591:
amd64: Change SFENCE to locked op for synchronizing with CLFLUSHOPT on Intel.

4 years agoMFC r354592:
Konstantin Belousov [Mon, 18 Nov 2019 13:34:27 +0000 (13:34 +0000)]
MFC r354592:
amd64: change r_gdt to the local variable in hammer_time().

4 years agoMFC r354724:
Dimitry Andric [Mon, 18 Nov 2019 07:04:59 +0000 (07:04 +0000)]
MFC r354724:

Merge commit 5bbb604bb from llvm git (by Craig Topper):

  [InstCombine] Disable some portions of foldGEPICmp for GEPs that
  return a vector of pointers. Fix other portions.

  llvm-svn: 370114

This should fix instances of 'Assertion failed: (isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"), function cast, file
/usr/src/contrib/llvm/include/llvm/Support/Casting.h, line 255', when
building openjdk8 for aarch64 and armv7.

Reported by: jbeich
PR: 236566

4 years agoMFC r352847,352930,354585
Alan Cox [Sun, 17 Nov 2019 22:44:38 +0000 (22:44 +0000)]
MFC r352847,352930,354585
  Eliminate redundant calls to critical_enter() and critical_exit() from
  pmap_update_entry().  It suffices that interrupts are blocked.

  In short, pmap_enter_quick_locked("user space", ..., VM_PROT_READ) doesn't
  work.  More precisely, it doesn't set ATTR_AP(ATTR_AP_USER) in the page
  table entry, so any attempt to read from the mapped page by user space
  generates a page fault.  This problem has gone unnoticed because the page
  fault handler, vm_fault(), will ultimately call pmap_enter(), which
  replaces the non-working page table entry with one that has
  ATTR_AP(ATTR_AP_USER) set.  This change reduces the number of page faults
  during a "buildworld" by about 19.4%.

  Eliminate a redundant pmap_load() from pmap_remove_pages().

  There is no reason why the pmap_invalidate_all() in pmap_remove_pages()
  must be performed before the final PV list lock release.  Move it past
  the lock release.

  Eliminate a stale comment from pmap_page_test_mappings().  We implemented
  a modified bit in r350004.

4 years agoMFC r354520:
Li-Wen Hsu [Sun, 17 Nov 2019 18:25:42 +0000 (18:25 +0000)]
MFC r354520:

Get the fix in back by reverting the part accidentally included in r354491.

This brings back r354467.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r354268: Remove lock from CTL camsim frontend.
Alexander Motin [Sun, 17 Nov 2019 00:52:23 +0000 (00:52 +0000)]
MFC r354268: Remove lock from CTL camsim frontend.

CAM does not need a SIM lock for quite a while, and CTL never needed it.

4 years agoMFC r354697:
Konstantin Belousov [Sat, 16 Nov 2019 10:50:10 +0000 (10:50 +0000)]
MFC r354697:
cpucontrol: print more useful information when MSR access fails.

4 years agoMFC r354766:
Konstantin Belousov [Sat, 16 Nov 2019 10:49:17 +0000 (10:49 +0000)]
MFC r354766:
amd64: only set PCB_FULL_IRET pcb flag when #gp or similar exception comes
from usermode.

4 years agoMFC r354759:
Scott Long [Sat, 16 Nov 2019 00:36:42 +0000 (00:36 +0000)]
MFC r354759:
TSX Asynchronous Abort mitigation for Intel CVE-2019-11135.
This CVE has already been announced in FreeBSD SA-19:26.mcu.

Mitigation for TAA involves either turning off TSX or turning on the
VERW mitigation used for MDS. Some CPUs will also be self-mitigating
for TAA and require no software workaround.

Control knobs are:
machdep.mitigations.taa.enable:
        0 - no software mitigation is enabled
        1 - attempt to disable TSX
        2 - use the VERW mitigation
        3 - automatically select the mitigation based on processor
    features.

machdep.mitigations.taa.state:
        inactive        - no mitigation is active/enabled
        TSX disable     - TSX is disabled in the bare metal CPU as well as
                        - any virtualized CPUs
        VERW            - VERW instruction clears CPU buffers
not vulnerable - The CPU has identified itself as not being
  vulnerable

Nothing in the base FreeBSD system uses TSX.  However, the instructions
are straight-forward to add to custom applications and require no kernel
support, so the mitigation is provided for users with untrusted
applications and tenants.

Reviewed by: emaste, imp, kib, scottph
Sponsored by: Intel
Differential Revision: 22374

4 years agoPartially revert r354760, it included a patch that wasn't ready yet.
Scott Long [Sat, 16 Nov 2019 00:31:57 +0000 (00:31 +0000)]
Partially revert r354760, it included a patch that wasn't ready yet.

4 years agoMFC r354756:
Scott Long [Sat, 16 Nov 2019 00:29:26 +0000 (00:29 +0000)]
MFC r354756:

Create a new sysctl tree, machdep.mitigations

Sponsored by: Intel

4 years agoMFC r354228: avoid kernel stack data leak in core dump thrmisc note
Ed Maste [Fri, 15 Nov 2019 16:40:10 +0000 (16:40 +0000)]
MFC r354228: avoid kernel stack data leak in core dump thrmisc note

bzero the entire thrmisc struct, not just the padding.  Other core dump
notes are already done this way.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r353039: add ability to set watchdog timeout for a shutdown
Andriy Gapon [Fri, 15 Nov 2019 07:01:04 +0000 (07:01 +0000)]
MFC r353039: add ability to set watchdog timeout for a shutdown

This change allows to specify a watchdog(9) timeout for a system
shutdown.  The timeout is activated when the watchdogd daemon is
stopped.  The idea is to a prevent any indefinite hang during late
stages of the shutdown.  The feature is implemented in rc.d/watchdogd,
it builds upon watchdogd -x option.

Note that the shutdown timeout is not actiavted when the watchdogd
service is individually stopped by an operator.  It is also not
activated for the 'shutdown' to the single-user mode.  In those cases it
is assumed that the operator knows what they are doing and they have
means to recover the system should it hang.

Significant subchanges and implementation details:
- the argument to rc.shutdown, completely unused before, is assigned to
  rc_shutdown variable that can be inspected by rc scripts
- init(8) passes "single" or "reboot" as the argument, this is not
  changed
- the argument is not mandatory and if it is not set then rc_shutdown is
  set to "unspecified"
- however, the default jail management scripts and jail configuration
  examples have been updated to pass "jail" to rc.shutdown, just in case
- the new timeout can be set via watchdogd_shutdown_timeout rc option
- for consistency, the regular timeout can now be set via
  watchdogd_timeout rc option
- watchdogd_shutdown_timeout and watchdogd_timeout override timeout
  specifications in watchdogd_flags
- existing configurations, where the new rc options are not set, should
  keep working as before

4 years agoMFC r354443:
Andrey V. Elsukov [Thu, 14 Nov 2019 12:07:49 +0000 (12:07 +0000)]
MFC r354443:
  Enqueue lladdr_task to update link level address of vlan, when its parent
  interface has changed.

  During vlan reconfiguration without destroying interface, it is possible,
  that parent interface will be changed. This usually means, that link
  layer address of vlan will be different. Therefore we need to update all
  associated with vlan's addresses permanent llentries - NDP for IPv6
  addresses, and ARP for IPv4 addresses. This is done via lladdr_task
  execution. To avoid extra work, before execution do the check, that L2
  address is different.

4 years agoMFC r354435:
Toomas Soome [Thu, 14 Nov 2019 09:39:03 +0000 (09:39 +0000)]
MFC r354435:
loader: implement fallback efi_devpath_to_name()

UEFI 1.10 on macs does not seem to provide devpath to name translation,
provide our own (limited) version, so we can get information about commmon
devices.

4 years agoMFC r353871
Brooks Davis [Wed, 13 Nov 2019 23:26:12 +0000 (23:26 +0000)]
MFC r353871
Record prior MFC of r353408

r353408:
Fix -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms.  After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

r353871:
Additional fix for -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms.  After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

r353408 addressed this issue for cddl/lib/libzpool, but it persisted
with the opensolaris and zfs modules.

4 years agoMFC r354420:
Brooks Davis [Wed, 13 Nov 2019 22:25:53 +0000 (22:25 +0000)]
MFC r354420:

Fix the alignment of struct xunpcb on systems with >64-bit pointers.

Reviewed by: emaste
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22268

4 years agoMFC r351452
Ganbold Tsagaankhuu [Wed, 13 Nov 2019 10:08:45 +0000 (10:08 +0000)]
MFC r351452
dtso: allwinner: Add an overlay for H3 thermal node

4 years agoMFC r353748: remove wmb() call from x86 cpu_reset()
Andriy Gapon [Wed, 13 Nov 2019 07:43:11 +0000 (07:43 +0000)]
MFC r353748: remove wmb() call from x86 cpu_reset()

The rationale is pretty much the same as in r353747.
There is no subsequent dependent store.
The store is to the regular (TSO) memory anyway.

4 years agoMFC r353747: vmm: remove a wmb() call
Andriy Gapon [Wed, 13 Nov 2019 07:41:19 +0000 (07:41 +0000)]
MFC r353747: vmm: remove a wmb() call

After removing wmb(), vm_set_rendezvous_func() became super trivial, so
there was no point in keeping it.

The wmb (sfence on amd64, lock nop on i386) was not needed.  This can be
explained from several points of view.

First, wmb() is used for store-store ordering (although, the primitive
is undocumented).  There was no obvious subsequent store that needed the
barrier.

Second, x86 has a memory model with strong ordering including total
store order.  An explicit store barrier may be needed only when working
with special memory (device, special caching mode) or using special
instructions (non-temporal stores).  That was not the case for this
code.

Third, I believe that there is a misconception that sfence "flushes" the
store buffer in a sense that it speeds up the propagation of stores from
the store buffer to the global visibility.  I think that such
propagation always happens as fast as possible.  sfence only makes
subsequent stores wait for that propagation to complete.  So, sfence is
only useful for ordering of stores and only in the situations described
above.

4 years agoMFC r353636: MFV r353630: 10809 Performance optimization of AVL tree comparator functions
Andriy Gapon [Wed, 13 Nov 2019 07:39:20 +0000 (07:39 +0000)]
MFC r353636: MFV r353630: 10809 Performance optimization of AVL tree comparator functions

4 years agoMFC: r354415
Toomas Soome [Wed, 13 Nov 2019 07:04:11 +0000 (07:04 +0000)]
MFC: r354415
loader.efi: HARDDRIVE_DEVICE_PATH may have subpaths

The macos does create Vendor Media devices on top of APFS container
(like partition table inside the partition), so we need to collect such
devices into respective device tree.

4 years agoMFC: Add new bit definitions for TSX, related to the TAA issue. The actual
Scott Long [Tue, 12 Nov 2019 19:29:32 +0000 (19:29 +0000)]
MFC: Add new bit definitions for TSX, related to the TAA issue.  The actual
mitigation will follow in a future commit.

Sponsored by: Intel

4 years agoMFC r354649:
Konstantin Belousov [Tue, 12 Nov 2019 18:03:26 +0000 (18:03 +0000)]
MFC r354649:
Workaround for Intel SKL002/SKL012S errata.

Security: CVE-2018-12207

4 years agoMFC r354360: Add vfs.zfs.zio.taskq_batch_pct tunable.
Alexander Motin [Tue, 12 Nov 2019 15:32:16 +0000 (15:32 +0000)]
MFC r354360: Add vfs.zfs.zio.taskq_batch_pct tunable.

4 years agoMFC r354437: fix zpool list property names
Andriy Gapon [Tue, 12 Nov 2019 14:08:21 +0000 (14:08 +0000)]
MFC r354437: fix zpool list property names

4 years agoallow NO_CLEAN builds to work after opensolaris_atomic.S removal in r354634
Andriy Gapon [Tue, 12 Nov 2019 10:22:48 +0000 (10:22 +0000)]
allow NO_CLEAN builds to work after opensolaris_atomic.S removal in r354634

This is a direct commit modelled after r353408 in head.

4 years agoMFC r353381: emulate illumos membar_producer with atomic_thread_fence_rel
Andriy Gapon [Tue, 12 Nov 2019 09:54:48 +0000 (09:54 +0000)]
MFC r353381: emulate illumos membar_producer with atomic_thread_fence_rel

4 years agoMFC r354625:
Dimitry Andric [Mon, 11 Nov 2019 17:45:06 +0000 (17:45 +0000)]
MFC r354625:

Merge commit 371ea70bb from llvm git (by Louis Dionne):

  [libc++] Harden usage of static_assert against C++03

  In C++03, we emulate static_assert with a macro, and we must
  parenthesize multiple arguments.

  llvm-svn: 373328

This is a follow-up to r354460, which causes errors for pre-C++11
programs using <cmath>, similar to:

/usr/include/c++/v1/cmath:622:68: error: too many arguments provided to
function-like macro invocation

Reported by: antoine

4 years agoMFC r354335:
Hans Petter Selasky [Mon, 11 Nov 2019 14:56:22 +0000 (14:56 +0000)]
MFC r354335:
Enable device class group attributes in the LinuxKPI.

Bump the __FreeBSD_version to force recompilation of
external kernel modules due to structure change.

Differential Revision: https://reviews.freebsd.org/D21564
Submitted by: Greg V <greg@unrelenting.technology>
Sponsored by: Mellanox Technologies

4 years agoMFC r353273:
Hans Petter Selasky [Mon, 11 Nov 2019 14:51:08 +0000 (14:51 +0000)]
MFC r353273:
Make control endpoint quirk for xhci(4) configurable.

Sponsored by: Mellanox Technologies

4 years agoMFC r353275:
Hans Petter Selasky [Mon, 11 Nov 2019 14:41:05 +0000 (14:41 +0000)]
MFC r353275:
Compile time assert a valid subsystem for all VNET init and uninit functions.
Using VNET init and uninit functions outside the given range has undefined
behaviour.

Sponsored by: Mellanox Technologies

4 years agoMFC r353935, r354402:
Mark Johnston [Mon, 11 Nov 2019 14:07:11 +0000 (14:07 +0000)]
MFC r353935, r354402:
Set OBJ_NOSPLIT on the ksyms(4) VM object.

4 years agoMFC r354287
Vincenzo Maffione [Sun, 10 Nov 2019 18:43:09 +0000 (18:43 +0000)]
MFC r354287

bhyve: fix mistake introduced by r352841

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

4 years agoMFC r354460:
Dimitry Andric [Sun, 10 Nov 2019 18:41:13 +0000 (18:41 +0000)]
MFC r354460:

Merge commit e8316372b from llvm git (by Louis Dionne):

  [libc++] Add `__truncating_cast` for safely casting float types to
  integers

  This is needed anytime we need to clamp an arbitrary floating point
  value to an integer type.

  Thanks to Eric Fiselier for the patch.

  Differential Revision: https://reviews.llvm.org/D66836

  llvm-svn: 370891

Merge commit b92deded8 from llvm git (by Louis Dionne):

  [libc++] Move __clamp_to_integral to <cmath>, and harden against
  min()/max() macros

  llvm-svn: 370900

Merge commit 0ec6a4882 from llvm git (by Louis Dionne):

  [libc++] Fix potential OOB in poisson_distribution

  See details in the original Chromium bug report:
      https://bugs.chromium.org/p/chromium/issues/detail?id=994957

Together, these fix a security issue in libc++'s implementation of
std::poisson_distribution, which can be exploited to read data which is
out of bounds.

Note there are no programs in the FreeBSD base system that use
std::poisson_distribution, so this is only a possible issue for ports
and external programs which have been built against libc++.  Therefore,
I am bumping __FreeBSD_version for the benefit of our port maintainers.

Requested by: emaste
Security: potential OOB read

4 years agoMFC r354255:
Dimitry Andric [Sun, 10 Nov 2019 17:33:10 +0000 (17:33 +0000)]
MFC r354255:

Add __isnan()/__isnanf() aliases for compatibility with glibc and CUDA

Even though clang comes with a number of internal CUDA wrapper headers,
compiling sample CUDA programs will result in errors similar to:

In file included from <built-in>:1:
In file included from /usr/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
/usr/home/arr/cuda/var/cuda-repo-10-0-local-10.0.130-410.48/usr/local/cuda-10.0//include/crt/math_functions.hpp:2910:7: error: no matching function for call to '__isnan'
  if (__isnan(a)) {
      ^~~~~~~
/usr/lib/clang/9.0.0/include/__clang_cuda_device_functions.h:460:16: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ int __isnan(double __a) { return __nv_isnand(__a); }
               ^

CUDA expects __isnan() and __isnanf() declarations to be available,
which are glibc specific extensions, equivalent to the regular isnan()
and isnanf().

To provide these, define __isnan() and __isnanf() as aliases of the
already existing static inline functions __inline_isnan() and
__inline_isnanf() from math.h.

Reported by: arrowd
PR: 241550

4 years agoMFC r354279:
Toomas Soome [Sun, 10 Nov 2019 09:32:17 +0000 (09:32 +0000)]
MFC r354279:
loader: calculate physical vdev psize from asize

Since physical device asize is calculated from psize and the asize is stored
in pool label, we can use asize to set the value of psize, which is used to
calculate the location of the pool labels.

4 years agoMFC r354281:
Konstantin Belousov [Sun, 10 Nov 2019 09:14:22 +0000 (09:14 +0000)]
MFC r354281:
amd64: Store %cr3 into pcpu saved_ucr3 on double fault.

4 years agoMFC r354280:
Konstantin Belousov [Sun, 10 Nov 2019 09:13:12 +0000 (09:13 +0000)]
MFC r354280:
amd64 ddb: Add printing of kernel/user and saved user %cr3 values from pcpu.

4 years agoMFC r354095, r354118, r354132:
Konstantin Belousov [Sat, 9 Nov 2019 11:55:01 +0000 (11:55 +0000)]
MFC r354095, r354118, r354132:
amd64: move pcb out of kstack to struct thread.

4 years agoMFC r354116, r354120
Alan Somers [Sat, 9 Nov 2019 02:26:01 +0000 (02:26 +0000)]
MFC r354116, r354120

r354116:
MFZoL:  Avoid retrieving unused snapshot props

This patch modifies the zfs_ioc_snapshot_list_next() ioctl to enable it
to take input parameters that alter the way looping through the list of
snapshots is performed. The idea here is to restrict functions that
throw away some of the snapshots returned by the ioctl to a range of
snapshots that these functions actually use. This improves efficiency
and execution speed for some rollback and send operations.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
Closes #8077
zfsonlinux/zfs@4c0883fb4af0d5565459099b98fcf90ecbfa1ca1

r354120:
Commit missing file from r354116

Pointy-hat-to: Me
Reported by: Dan Mack
MFC-With: 354116

4 years agoMFC r353898: blacklistd: remove reference to NetBSD npfctl
Ed Maste [Fri, 8 Nov 2019 16:10:45 +0000 (16:10 +0000)]
MFC r353898: blacklistd: remove reference to NetBSD npfctl

Xr pfctl instead

PR: 221069
Submitted by: "fml"

4 years agoMFC r353340,r353340: cleanup of illumos compatibility atomics
Andriy Gapon [Fri, 8 Nov 2019 12:06:03 +0000 (12:06 +0000)]
MFC r353340,r353340: cleanup of illumos compatibility atomics

4 years agoMFC r354065: gpioiic: set output after switching to output mode...
Andriy Gapon [Fri, 8 Nov 2019 07:56:14 +0000 (07:56 +0000)]
MFC r354065: gpioiic: set output after switching to output mode...

if presetting it failed.

4 years agoMFC r354077,r354078: owc_gpiobus_read_data: add recovery time to the read slot
Andriy Gapon [Fri, 8 Nov 2019 07:38:34 +0000 (07:38 +0000)]
MFC r354077,r354078: owc_gpiobus_read_data: add recovery time to the read slot

4 years agoMFC r354076: owc_gpiobus_read_data: compare times in sbintime_t units
Andriy Gapon [Fri, 8 Nov 2019 07:36:51 +0000 (07:36 +0000)]
MFC r354076: owc_gpiobus_read_data: compare times in sbintime_t units

4 years agoMFC r354069: owc_gpiobus_read_data: disable preemption earlier
Andriy Gapon [Fri, 8 Nov 2019 07:35:32 +0000 (07:35 +0000)]
MFC r354069: owc_gpiobus_read_data: disable preemption earlier

4 years agoMFC r354231
Vincenzo Maffione [Thu, 7 Nov 2019 20:11:53 +0000 (20:11 +0000)]
MFC r354231

netmap: fix build issue in netmap_user.h

The issue was a comparison of integers of different signs
on 32 bit architectures.

Reported by:    jenkins
MFC after:      1 week

4 years agoMFC r354229
Vincenzo Maffione [Thu, 7 Nov 2019 20:09:41 +0000 (20:09 +0000)]
MFC r354229

add valectl to the system commands

The valectl(4) program is used to manage vale(4) switches.
Add it to the system commands so that it can be used right away.
This program was previously called vale-ctl, and stored in
tools/tools/netmap

Reviewed by:    hrs, bcr, lwhsu, kevans
Differential Revision:  https://reviews.freebsd.org/D22146

4 years agoMFC r354342: libpmc: jevents: handle empty description
Ed Maste [Thu, 7 Nov 2019 18:14:58 +0000 (18:14 +0000)]
MFC r354342: libpmc: jevents: handle empty description

PR: 241258
Reported by: sigsys @ gmail.com
Obtained from: github.com/andikleen/pmu-tools commit bb3c77ed61

4 years agoMFC r353892:
Konstantin Belousov [Thu, 7 Nov 2019 15:32:59 +0000 (15:32 +0000)]
MFC r353892:
Assert that vnode_pager_setsize() is called with the vnode exclusively locked.

4 years agoCheck CSUM_SND_TAG flag before classifying packet has having a send
Hans Petter Selasky [Thu, 7 Nov 2019 13:12:38 +0000 (13:12 +0000)]
Check CSUM_SND_TAG flag before classifying packet has having a send
tag in mlx5en(4). This fixes an issue with packets being dropped when
doing packet forwarding, because the rcvif field is still set. The
send tag pointer and rcvif field share the same memory location.

This is a direct commit.

Reported by: olivier@
Sponsored by: Mellanox Technologies

4 years agoRevert accidential chunk added to GENERIC from previous commit.
Hans Petter Selasky [Thu, 7 Nov 2019 13:01:09 +0000 (13:01 +0000)]
Revert accidential chunk added to GENERIC from previous commit.

This is a direct commit.

Sponsored by: Mellanox Technologies

4 years agoPartial MFC of CSUM_SND_TAG flag from r348254.
Hans Petter Selasky [Thu, 7 Nov 2019 12:58:14 +0000 (12:58 +0000)]
Partial MFC of CSUM_SND_TAG flag from r348254.

Add CSUM_SND_TAG flag and set this flag for outgoing ratelimited mbufs.

This is a direct commit.

Sponsored by: Mellanox Technologies

4 years agoadd a note about nctgpio and wbwd move to superio
Andriy Gapon [Thu, 7 Nov 2019 07:21:45 +0000 (07:21 +0000)]
add a note about nctgpio and wbwd move to superio

4 years agoMFC r353645,r353677: wbwd: move to superio(4) bus
Andriy Gapon [Thu, 7 Nov 2019 07:15:01 +0000 (07:15 +0000)]
MFC r353645,r353677: wbwd: move to superio(4) bus

Plus related small clean-ups and improvements.

4 years agoMFC r353643: move nctgpio to superio(4) bus
Andriy Gapon [Thu, 7 Nov 2019 07:09:10 +0000 (07:09 +0000)]
MFC r353643: move nctgpio to superio(4) bus

4 years agoMerge r353027:
Gleb Smirnoff [Thu, 7 Nov 2019 00:28:50 +0000 (00:28 +0000)]
Merge r353027:
  Protect access to seq->xwin[] with the seq mutex.

4 years agoMFC r354241: Some more taskqueue optimizations.
Alexander Motin [Wed, 6 Nov 2019 17:49:38 +0000 (17:49 +0000)]
MFC r354241: Some more taskqueue optimizations.

 - Optimize enqueue for two task priority values by adding new tq_hint
field, pointing to the last task inserted into the middle of the list.
In case of more then two priority values it should halve average search.
 - Move tq_active insert/remove out of the taskqueue_run_locked loop.
Instead of dirtying few shared cache lines per task introduce different
mechanism to drain active tasks, based on task sequence number counter,
that uses only cache lines already present in cache.  Since the new
mechanism does not need ordering, switch tq_active from TAILQ to LIST.
 - Move static and dynamic struct taskqueue fields into different cache
lines.  Move lock into its own cache line, so that heavy lock spinning
by multiple waiting threads would not affect the running thread.
 - While there, correct some TQ_SLEEP() wait messages.

This change fixes certain ZFS write workloads, causing huge congestion
on taskqueue lock.  Those workloads combine some large block writes to
saturate the pool and trigger allocation throttling, which uses higher
priority tasks to requeue the delayed I/Os, with many small blocks to
generate deep queue of small tasks for taskqueue to sort.

Sponsored by: iXsystems, Inc.

4 years agoMFC r353891:
Konstantin Belousov [Wed, 6 Nov 2019 15:11:51 +0000 (15:11 +0000)]
MFC r353891:
Fix interface between nfsclient and vnode pager.

4 years agoMFC r353890:
Konstantin Belousov [Wed, 6 Nov 2019 14:41:07 +0000 (14:41 +0000)]
MFC r353890:
Add VV_VMSIZEVNLOCK flag.

MFC note: OBJ_SIZEVNLOCK value was changed due to differences between
stable/12 and HEAD.

4 years agoChange current to stable/12.
Warner Losh [Wed, 6 Nov 2019 14:32:00 +0000 (14:32 +0000)]
Change current to stable/12.

Direct commit because this change isn't relevant to -current

Reported by: Jamie Landeg-Jones

4 years agoMFC r353888, r353916, r353964 (by markj):
Konstantin Belousov [Wed, 6 Nov 2019 13:45:24 +0000 (13:45 +0000)]
MFC r353888, r353916, r353964 (by markj):
vm_fault(): extract code to lock the vnode into a helper vm_fault_lock_vnode().

4 years agoMFC r353638: MFV r353637: 10844 Serialize ZTHR operations to eliminate races
Andriy Gapon [Wed, 6 Nov 2019 08:37:55 +0000 (08:37 +0000)]
MFC r353638: MFV r353637: 10844 Serialize ZTHR operations to eliminate races

4 years agoMFC r353634: MFV r348596: 9689 zfs range lock code should not be zpl-specific
Andriy Gapon [Wed, 6 Nov 2019 08:36:12 +0000 (08:36 +0000)]
MFC r353634: MFV r348596: 9689 zfs range lock code should not be zpl-specific

4 years agoMFC r353616: MFV r353615: 9485 Optimize possible split block search space
Andriy Gapon [Wed, 6 Nov 2019 08:33:56 +0000 (08:33 +0000)]
MFC r353616: MFV r353615: 9485 Optimize possible split block search space

4 years agoMFC r354159: FreeBSD'fy ZFS zlib zalloc/zfree callbacks.
Alexander Motin [Tue, 5 Nov 2019 19:14:17 +0000 (19:14 +0000)]
MFC r354159: FreeBSD'fy ZFS zlib zalloc/zfree callbacks.

The previous code came from OpenSolaris, which in my understanding require
allocation size to be known to free memory.  To store that size previous
code allocated additional 8 byte header.  But I have noticed that zlib
with present settings allocates 64KB context buffers for each call, that
could be efficiently cached by UMA, but addition of those 8 bytes makes
them fall back to physical RAM allocations, that cause huge overhead and
lock congestion on small blocks.  Since FreeBSD's free() does not have
the size argument, switching to it solves the problem, increasing write
speed to ZVOLs with 4KB block size and GZIP compression on my 40-threads
test system from ~60MB/s to ~600MB/s.

4 years agoMFC r353629: MFV r353628: 10842 Mutex leak in dsl_dataset_hold_obj()
Andriy Gapon [Tue, 5 Nov 2019 07:13:07 +0000 (07:13 +0000)]
MFC r353629: MFV r353628: 10842 Mutex leak in dsl_dataset_hold_obj()

4 years agoMFC r353565,r353568: MFV r353561: 10343 ZoL: Prefix all refcount functions with zfs_
Andriy Gapon [Tue, 5 Nov 2019 07:11:12 +0000 (07:11 +0000)]
MFC r353565,r353568: MFV r353561: 10343 ZoL: Prefix all refcount functions with zfs_

4 years agoMFC r353726: ddb: use 'textdump dump' instead of 'call doadump'
Andriy Gapon [Tue, 5 Nov 2019 07:06:45 +0000 (07:06 +0000)]
MFC r353726: ddb: use 'textdump dump' instead of 'call doadump'

The change is for the example in textdump.4 and the default ddb.conf.

4 years agoMFC r353749: buildkernel: always add standard kernel configuration include path
Andriy Gapon [Tue, 5 Nov 2019 07:02:35 +0000 (07:02 +0000)]
MFC r353749: buildkernel: always add standard kernel configuration include path

4 years agoMFC r354067,r354068: ow_temp: drop the lock around a call that can sleep
Andriy Gapon [Tue, 5 Nov 2019 07:00:10 +0000 (07:00 +0000)]
MFC r354067,r354068: ow_temp: drop the lock around a call that can sleep

And use better scopes for the lock.

4 years agoMFC r353647: itwd(4): driver for watchdog function in ITE Super I/O chips
Andriy Gapon [Tue, 5 Nov 2019 06:55:09 +0000 (06:55 +0000)]
MFC r353647: itwd(4): driver for watchdog function in ITE Super I/O chips

This branch does not have files.x86, so the driver is added to
files.{amd64,i386}.

4 years agoMFC r349580,r351740,r353432,r353433,r354079,r354080: add superio driver
Andriy Gapon [Mon, 4 Nov 2019 09:49:58 +0000 (09:49 +0000)]
MFC r349580,r351740,r353432,r353433,r354079,r354080: add superio driver

The goal of this driver is consolidate information about SuperIO chips
and to provide for peaceful coexistence of drivers that need to access
SuperIO configuration registers.

While SuperIO chips can host various functions most of them are
discoverable and accessible without any knowledge of the SuperIO.
Examples are: keyboard and mouse controllers, UARTs, floppy disk
controllers.  SuperIO-s also provide non-standard functions such as
GPIO, watchdog timers and hardware monitoring.  Such functions do
require drivers with a knowledge of a specific SuperIO.

At this time the driver supports a number of ITE and Nuvoton (fka
Winbond) SuperIO chips.
There is a single driver for all devices.  So, I have not done the usual
split between the hardware driver and the bus functionality.  Although,
superio does act as a bus for devices that represent known non-standard
functions of a SuperIO chip.  The bus provides enumeration of child
devices based on the hardcoded knowledge of such functions.  The
knowledge as extracted from datasheets and other drivers.
As there is a single driver, I have not defined a kobj interface for it.
So, its interface is currently made of simple functions.
I think that we can the flexibility (and complications) when we actually
need it.

4 years agoMFC r354237:
Toomas Soome [Mon, 4 Nov 2019 06:35:48 +0000 (06:35 +0000)]
MFC r354237:
loader: asprinf does crash arm64 due to missing NULL pointer check

PCHAR macro needs to check if d is NULL.

4 years agoMFC: r354127
Toomas Soome [Sun, 3 Nov 2019 07:11:09 +0000 (07:11 +0000)]
MFC: r354127

loader: zio_checksum_verify should check byteswap

We do have both native and byteswap checksum callbacks in place but the
selection is not wired.

4 years agoMFC r354215:
Mark Johnston [Sun, 3 Nov 2019 02:52:41 +0000 (02:52 +0000)]
MFC r354215:
Fix a typo in r353895.

4 years agoMFC r353334:
Mitchell Horne [Sat, 2 Nov 2019 19:52:22 +0000 (19:52 +0000)]
MFC r353334:

RISC-V: Fix an alignment warning in libthr

Compiling with clang gives a loss-of-alignment error due the cast to
uint8_t *. Since the TLS is always tcb aligned and TP_OFFSET is defined
as sizeof(struct tcb) we can guarantee there is no misalignment. Silence
the error by moving the offset into the inline assembly.

Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D21926

4 years agoMFC r352730:
Mitchell Horne [Sat, 2 Nov 2019 19:50:36 +0000 (19:50 +0000)]
MFC r352730:

Fix some broken relocation handling

In a few cases, the symbol lookup is missing before attempting to
perform the relocation. While the relocation types affected are
currently unused, this results in an uninitialized variable warning,
that is escalated to an error when building with clang.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D21773

4 years agoMFC r352729:
Mitchell Horne [Sat, 2 Nov 2019 19:48:42 +0000 (19:48 +0000)]
MFC r352729:

Cleanup of elf_machdep.c

Fix some style(9) violations.

This also changes the name of the machine-dependent sysctl kern.debug_kld to
debug.kld_reloc, and changes its type from int to bool. This is acceptable
since we are not currently concerned with preserving the RISC-V ABI.

Reviewed by: markj, kp
Differential Revision: https://reviews.freebsd.org/D21772

4 years agoMFC r340228-r340229, r340231
Mitchell Horne [Sat, 2 Nov 2019 19:46:39 +0000 (19:46 +0000)]
MFC r340228-r340229, r340231

r340228 by jhb:
Enable use of a global shared page for RISC-V.

machine/vmparam.h already defines the SHAREDPAGE constant.  This
change just enables it for ELF executables.  The only use of the
shared page currently is to hold the signal trampoline.

Reviewed by: markj, kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17875

r340229 by jhb:
Drop the legacy ELF brandinfo for the old rtld from arm64 and riscv.

These architectures never shipped binaries with an rtld path of
/usr/libexec/ld-elf.so.1.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17876

r340231 by jhb:
Enable non-executable stacks by default on RISC-V.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17878

4 years agoMFC r354119:
Toomas Soome [Sat, 2 Nov 2019 09:22:20 +0000 (09:22 +0000)]
MFC r354119:
loader: rs_alloc() may return NULL

rs_alloc() in zfs reader code may return NULL, so we need to check the return
value and error out if needed.

4 years agoAdd support for hypervisor check on x86
Simon J. Gerraty [Thu, 31 Oct 2019 21:32:59 +0000 (21:32 +0000)]
Add support for hypervisor check on x86

Add ficl words for isvirtualized
and move ficl inb and outb words to ficl/x86/sysdep.c
so can be shared by i386 and amd64

MFC of r354043, r354055

Reviewed by: imp bdrewery
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D22069

4 years agoInitialize verbosity and debug level from env
Simon J. Gerraty [Thu, 31 Oct 2019 20:29:45 +0000 (20:29 +0000)]
Initialize verbosity and debug level from env

For EFI at least, we can seed the environment
with VE_VERBOSE etc.

MFC of r354038

Reviewed by: stevek imp
Sponsored by: Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22135

4 years agoMFC r353699:
Mark Johnston [Thu, 31 Oct 2019 14:49:30 +0000 (14:49 +0000)]
MFC r353699:
Clean up some nits in link_elf_(un)load_file().

4 years agoMFC r353176,r353304,r353556,r353559: large_dnode improvements and fixes
Andriy Gapon [Thu, 31 Oct 2019 09:14:50 +0000 (09:14 +0000)]
MFC r353176,r353304,r353556,r353559: large_dnode improvements and fixes

r353176: MFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool feature
  This updates FreeBSD large_dnode code (that was imported from ZoL) to a
  version that was committed to illumos.  It has some cleanups,
  improvements and fixes comparing to what we have in FreeBSD now.
  I think that the most significant update is 8199 multi-threaded
  dmu_object_alloc().

r353304: zfs: use atomic_load_64 to read atomic variable in dmu_object_alloc_impl

r353556: MFV r353551: 10452 ZoL: merge in large dnode feature fixes

r353559: MFV r353558: 10572 10579 Fix race in dnode_check_slots_free()

4 years agoMFC r353957:
Mark Johnston [Wed, 30 Oct 2019 18:39:37 +0000 (18:39 +0000)]
MFC r353957:
Check for bogus_page in vnode_pager_generic_getpages_done().

4 years agoMFC r353895:
Mark Johnston [Wed, 30 Oct 2019 18:39:07 +0000 (18:39 +0000)]
MFC r353895:
Apply r353893 to arm64.

4 years agoMFC r353894:
Mark Johnston [Wed, 30 Oct 2019 18:38:44 +0000 (18:38 +0000)]
MFC r353894:
Initialize thread0.td_kstack_pages on arm.

4 years agoMFC r353893:
Mark Johnston [Wed, 30 Oct 2019 18:36:49 +0000 (18:36 +0000)]
MFC r353893:
Fix thread0 kernel stack initialization on riscv.

4 years agoMFC r353325, r353875
Brooks Davis [Wed, 30 Oct 2019 17:06:02 +0000 (17:06 +0000)]
MFC r353325, r353875

r353325:
Update tcsh to 6.21.00.

This is a bugfix release with no new features.  A number of these fixes
were previously merged into our tree.

Sponsored by: DARPA, AFRL

r353875:
Update tcsh to git revision 83c5be0 bringing in a number of bug fixes.

Reported by: sobomax
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22099

4 years agoMFC r354062: zfs.8: fix a typo in the date
Andriy Gapon [Wed, 30 Oct 2019 16:56:26 +0000 (16:56 +0000)]
MFC r354062: zfs.8: fix a typo in the date

4 years agoMFC r353796: debug.kassert.warnings is a statistic, not a tunable
Andriy Gapon [Wed, 30 Oct 2019 16:54:33 +0000 (16:54 +0000)]
MFC r353796: debug.kassert.warnings is a statistic, not a tunable