]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r367134:
Li-Wen Hsu [Mon, 2 Nov 2020 01:29:50 +0000 (01:29 +0000)]
MFC r367134:

Remove superfluous `this` in comment

PR: 250721
Submitted by: Hiroya EBINE <hebiyan@protonmail.com>

3 years agoMFC r366861: build vmware modules on arm64
Ed Maste [Mon, 2 Nov 2020 00:45:40 +0000 (00:45 +0000)]
MFC r366861: build vmware modules on arm64

3 years agoMFC r367039:
Mateusz Piotrowski [Sun, 1 Nov 2020 11:09:11 +0000 (11:09 +0000)]
MFC r367039:

ifconfig.8: Remove spurious commas

Correct misuse of commas/parentheses in an enumeration that makes the
number of actual parameters more important than expected.

PR: 250526
Submitted by: Samy Mahmoudi <samy.mahmoudi__gmail_com>

3 years agoMFC r364480:
Dimitry Andric [Sat, 31 Oct 2020 18:42:03 +0000 (18:42 +0000)]
MFC r364480:

Merge commit 1ce07cd614be from llvm git (by me):

  Instantiate Error in Target::GetEntryPointAddress() only when
  necessary

  When Target::GetEntryPointAddress() calls
  exe_module->GetObjectFile()->GetEntryPointAddress(), and the returned
  entry_addr is valid, it can immediately be returned.

  However, just before that, an llvm::Error value has been setup, but
  in this case it is not consumed before returning, like is done
  further below in the function.

  In https://bugs.freebsd.org/248745 we got a bug report for this,
  where a very simple test case aborts and dumps core:

  * thread #1, name = 'testcase', stop reason = breakpoint 1.1
      frame #0: 0x00000000002018d4 testcase`main(argc=1, argv=0x00007fffffffea18) at testcase.c:3:5
     1    int main(int argc, char *argv[])
     2    {
  -> 3        return 0;
     4    }
  (lldb) p argc
  Program aborted due to an unhandled Error:
  Error value was Success. (Note: Success values must still be checked prior to being destroyed).

  Thread 1 received signal SIGABRT, Aborted.
  thr_kill () at thr_kill.S:3
  3       thr_kill.S: No such file or directory.
  (gdb) bt
  #0  thr_kill () at thr_kill.S:3
  #1  0x00000008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
  #2  0x0000000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
  #3  0x000000000451b5f5 in fatalUncheckedError () at /usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112
  #4  0x00000000019cf008 in GetEntryPointAddress () at /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267
  #5  0x0000000001bccbd8 in ConstructorSetup () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67
  #6  0x0000000001bcd2c0 in ThreadPlanCallFunction () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114
  #7  0x00000000020076d4 in InferiorCallMmap () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97
  #8  0x0000000001f4be33 in DoAllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604
  #9  0x0000000001fe51b9 in AllocatePage () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347
  #10 0x0000000001fe5385 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383
  #11 0x0000000001974da2 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301
  #12 CanJIT () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331
  #13 0x0000000001a1bf3d in Evaluate () at /usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190
  #14 0x00000000019ce7a2 in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372
  #15 0x0000000001ad784c in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414
  #16 0x0000000001ad86ae in DoExecute () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646
  #17 0x0000000001a5e3ed in Execute () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003
  #18 0x0000000001a6c4a3 in HandleCommand () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762
  #19 0x0000000001a6f98c in IOHandlerInputComplete () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760
  #20 0x0000000001a90b08 in Run () at /usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548
  #21 0x00000000019a6c6a in ExecuteIOHandlers () at /usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903
  #22 0x0000000001a70337 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946
  #23 0x0000000001d9d812 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169
  #24 0x0000000001918be8 in MainLoop () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675
  #25 0x000000000191a114 in main () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890

  Fix the incorrect error catch by only instantiating an Error object
  if it is necessary.

  Reviewed By: JDevlieghere

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

This should fix lldb aborting as described in the scenario above.

Reported by: dmgk
PR: 248745

3 years agoMFC r366197:
Michal Meloun [Sat, 31 Oct 2020 17:26:56 +0000 (17:26 +0000)]
MFC r366197:

  Don't send a signal with uninitialized 'sig' and 'code' fields.  We have a
  few shortcuts in the arm trap code to speed up obvious "must fail" cases. In
  these situations, make sure that we fill in the "sig" and "code" fields of
  the generated signal.

3 years agoMFC r366312:
Michal Meloun [Sat, 31 Oct 2020 17:18:18 +0000 (17:18 +0000)]
MFC r366312:

  Fix the inverted condition in mtx_asserts.  Mutex should be owned in affected
  functions.

3 years agoMFC r366161:
Michal Meloun [Sat, 31 Oct 2020 17:10:55 +0000 (17:10 +0000)]
MFC r366161:

  Refine locking inside of syscon driver.  In some cases, the syscon driver may
  be used by consumer requiring better control about locking (ie. it may be
  used as registe file provider for clock driver which needs locked access to
  multiple registers).  Add fine locking protocol methods together with bunch
  of helper functions in syscon driver and implement this functionality in
  syscon_generic driver.

3 years agoMFC r366156:
Michal Meloun [Sat, 31 Oct 2020 17:09:25 +0000 (17:09 +0000)]
MFC r366156:

  Correctly handle nodes compatible with "syscon", "simple-bus".  Syscon can
  also have child nodes that share a registration file with it.  To do this
  correctly, follow these steps: - subclass syscon from simplebus and expose it
  if the node is also
    "simple-bus" compatible.
  - block simplebus probe for this compatible string, so it's priority
   (bus pass) doesn't colide with syscon driver.

3 years agoMFC r342008,r363799,r366146:
Michal Meloun [Sat, 31 Oct 2020 17:07:43 +0000 (17:07 +0000)]
MFC r342008,r363799,r366146:

  r342008:
    fdt: Add support for simple-mfd bus
  r363799:
    Allow child classes of simplebus to call attach directly
  r366146:
    Make simplebus friendlier for subclassing.

3 years agoMFC r365929:
Michal Meloun [Sat, 31 Oct 2020 16:51:19 +0000 (16:51 +0000)]
MFC r365929:

  Adjust DMA alignment for USB stack.  It should be at least as large as the
  maximum value of caheline size for currently known CPUs.

3 years agoMFC r362387:
Michal Meloun [Sat, 31 Oct 2020 16:18:55 +0000 (16:18 +0000)]
MFC r362387:

  Improve DesignWare PCIe driver: - only normal memory window is mandatory,
  prefetchable memory and
    I/O windows should be optional
  - full PCIe configuration space is supported - remove duplicated check from
  function for accessing configuration space.
    It is already contained in pci_dw_check_dev()

3 years agoMFC r363121:
Michal Meloun [Sat, 31 Oct 2020 16:15:19 +0000 (16:15 +0000)]
MFC r363121:

  Fix the module name for some arm drivers.  Module name (unlike of the of
  driver name) must be system wide unique.

3 years agoMFC r362388:
Michal Meloun [Sat, 31 Oct 2020 16:05:24 +0000 (16:05 +0000)]
MFC r362388:

  Use native-sized accesses when accessing memory from kdb.  Not all MMIO
  mapped devices supports byte access.

3 years agoMFC r362384,r362385,r362386,r362392:
Michal Meloun [Sat, 31 Oct 2020 16:03:35 +0000 (16:03 +0000)]
MFC r362384,r362385,r362386,r362392:

  r362384:
    Add DTB files for ARMADA 8040 based boards.
  r362385:
    Add specialized gpio driver for ARMADA 8k SoC.  Older marvell gpio blocks
    are to different for reusing/enhancing existing frivers.
  r362386:
    Add specific stub for ARMADA 8k SoC to Marvell RTC driver.  The AXI bridge
    is different between ARMADA 38x and 8K, and both platforms needs specific
    setup to mitigate HW issues with accessing RTC registers.
  r362392:
    Adapt ARMADA8k PCIe driver to newly imported 5.7 DT.  - temporarily disable
    handling with phy, we don't have driver for it yet - always clear cause for
    administartive interrupt.  While I'm in, fix style(9) (mainly whitespace).

3 years agoMFC r362053:
Michal Meloun [Sat, 31 Oct 2020 15:58:05 +0000 (15:58 +0000)]
MFC r362053:

  Fix grabbing of tegra uart.  An attempt to write to FCR register may corrupt
  transmit FIFO, so we should wait for the FIFO to be empty before we can
  modify it.

3 years agoMFC r360466:
Michal Meloun [Sat, 31 Oct 2020 15:40:52 +0000 (15:40 +0000)]
MFC r360466:

  Export tracing facility of GIC500 ITS block.  Possibility of tracing of
  processing message based interrupts is very useful for debugging of PCIe
  driver, mainly for its MSI part.

3 years agoMFC r360464:
Michal Meloun [Sat, 31 Oct 2020 15:38:41 +0000 (15:38 +0000)]
MFC r360464:

  Don't try to set frequendcy for enumerated but never started CPUs.

3 years agoMFC r360463,r360469:
Michal Meloun [Sat, 31 Oct 2020 15:36:41 +0000 (15:36 +0000)]
MFC r360463,r360469:

  r360463:
    Don't allow to use FPU inside of rtld library.  Clang10 may use FPU
    instructions for optimizing operations with memory blocks. But we don't
    want to do lengthy save/restore of all FPU registers across each
    rtld_start() call.
  r360469:
    Move ARM specific flags to arm/Makefile.inc

3 years agoMFC r360462:
Michal Meloun [Sat, 31 Oct 2020 15:30:27 +0000 (15:30 +0000)]
MFC r360462:

  Don't try to re-initialize already preseted regulator.

3 years agoMFC r360293,r360461:
Michal Meloun [Sat, 31 Oct 2020 15:28:21 +0000 (15:28 +0000)]
MFC r360293,r360461:

  r360293:
    Reorder initialization steps for given pin.  If pin is switched from fixed
    function to GPIO, it should have prepared direction, pull-up/down and
    default value before function gets switched.  Otherwise we may produce
    unwanted glitch on output pin.  Right order of drive strength settings is
    questionable, but I think that is slightly safer to do it also before
    function switch.
  r360461:
    Multiple fixes for rockchip iodomain driver: - always initialize selector
    of voltage signaling standard.
      Various versions of U-boot leaves voltage signaling standard settings for
      PMUIO2 domain in different state.  Always initialize it into expected
      state.
    - start the driver as early as possible, the IO domains should be
      initialized before other drivers are attached.
    - rename RK3399 register to its name founds in TRM.

3 years agoMFC r355755,r358807:
Michal Meloun [Sat, 31 Oct 2020 15:25:41 +0000 (15:25 +0000)]
MFC r355755,r358807:

  r355755:
    Add driver for Rockchip PCIe root complex found in RK3399 SOC.
    Unfortunately, there are some limitations: - memory aperture of his
    controller is only 16MiB, so it is nearly
      unusable for graphic cards
    - every attempt to generate type 1 config cycle always causes trap.
      These config cycles are disabled now and we don't support cards with PCIe
      switch.
    - in some cases, attempt to do config cycle to (probably) not-yet ready
      card also causes trap. This cannot be detected at runtime, but it seems
      like very rare issue.
  r358807:
    Add the missing brackets to the logical expression.

3 years agoMFC r353774:
Michal Meloun [Sat, 31 Oct 2020 14:59:39 +0000 (14:59 +0000)]
MFC r353774:
  Add driver for DesignWare PCIE core, and its Armada 8K specific attachement.

3 years agoMFC r353773:
Michal Meloun [Sat, 31 Oct 2020 14:56:16 +0000 (14:56 +0000)]
MFC r353773:

  Update Armada 8k drivers to cover newly imported DT and latest changes in
  simple multifunction driver.  - follow interrupt changes in DT. Split old ICU
  driver to function oriented
    parts and add drivers for newly defined parts (system error interrupts).
  - Many drivers are children of simple multifunction driver. But after r349596
    simple MF driver doesn't longer exports memory resources, and all children
    must use syscon interface to access their registers. Adapt affected drivers
    to this fact.

3 years agoMFC r366946: socket(9): Remove duplicate word 'is is'
Gordon Bergling [Sat, 31 Oct 2020 12:39:22 +0000 (12:39 +0000)]
MFC r366946: socket(9): Remove duplicate word 'is is'

3 years agoMFC r367091: Use my FreeBSD.org mail address in man pages I have written
Gordon Bergling [Sat, 31 Oct 2020 12:37:26 +0000 (12:37 +0000)]
MFC r367091: Use my FreeBSD.org mail address in man pages I have written

3 years agoMFC r359731: Add a basic manpage for smbfs(5)
Gordon Bergling [Sat, 31 Oct 2020 12:36:08 +0000 (12:36 +0000)]
MFC r359731: Add a basic manpage for smbfs(5)

3 years agoMFC r359608, r359611
Gordon Bergling [Sat, 31 Oct 2020 12:05:00 +0000 (12:05 +0000)]
MFC r359608, r359611

elf(5) Updates

- expand on NT_FREEBSD_FEATURE_CTL bit definitions
- remove commented out leftovers

3 years agoMFC r358891, r358894, r359454, r359513, r359550 and r359556
Gordon Bergling [Sat, 31 Oct 2020 11:56:13 +0000 (11:56 +0000)]
MFC r358891, r358894, r359454, r359513, r359550 and r359556

elf(5) Updates:

- start documenting ELF note sections
- Remove extra Sy from table header
- table markup fixes
- add definitions of FreeBSD notes
- minor update to FreeBSD ELF note descriptions
- correct and expand NT_FREEBSD_NOINIT_TAG description
- expand on NT_FREEBSD_FEATURE_CTL bit definitions

Reviewed by: emaste
Approved by: emaste

3 years agoMFC r366577:
Mark Johnston [Fri, 30 Oct 2020 14:41:19 +0000 (14:41 +0000)]
MFC r366577:
col(1): Fix a couple of bugs

PR: 249308

3 years agoMFC r366970:
Mark Johnston [Fri, 30 Oct 2020 14:40:48 +0000 (14:40 +0000)]
MFC r366970:
Add some missing nv(9) MLINKS

3 years agoMFC r366968:
Mark Johnston [Fri, 30 Oct 2020 14:38:17 +0000 (14:38 +0000)]
MFC r366968:
ntb: Fix an assertion to permit >= 32 doorbells

3 years agoMFC r366972:
Mark Johnston [Fri, 30 Oct 2020 14:37:51 +0000 (14:37 +0000)]
MFC r366972:
rtsold: Remove an incorrect __unused annotation

3 years agoMFC r366961:
Hans Petter Selasky [Fri, 30 Oct 2020 08:05:47 +0000 (08:05 +0000)]
MFC r366961:
Fix for loading cuse.ko via rc.d . Make sure we declare the cuse(3)
module by name and not only by the version information, so that
"kldstat -q -m cuse" works.

Found by: Goran Mekic <meka@tilda.center>
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367070:
Cy Schubert [Fri, 30 Oct 2020 00:34:40 +0000 (00:34 +0000)]
MFC r367070:

Remove a random equal sign from the example. It should not be there.
It's a syntax error.

PR: 210303
Reported by: leventelist at gmail.com

3 years agoMFC r367069:
Cy Schubert [Fri, 30 Oct 2020 00:32:14 +0000 (00:32 +0000)]
MFC r367069:

Continued ipfilter #ifdef cleanup. The r343701 log entry contains a
complete description.

3 years agoMFC r366911:
Brooks Davis [Thu, 29 Oct 2020 18:29:22 +0000 (18:29 +0000)]
MFC r366911:

vmapbuf: don't smuggle address or length in buf

Instead, add arguments to vmapbuf.  Since this argument is
always a pointer use a type of void * and cast to vm_offset_t in
vmapbuf.  (In CheriBSD we've altered vm_fault_quick_hold_pages to
take a pointer and check its bounds.)

In no other situtation does b_data contain a user pointer and vmapbuf
replaces b_data with the actual mapping.

Suggested by: jhb
Reviewed by: imp, jhb
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26784

3 years agoMFC r366932:
Konstantin Belousov [Thu, 29 Oct 2020 11:09:48 +0000 (11:09 +0000)]
MFC r366932:
sysv_sem: semusz depends on semume.

PR: 250361

3 years agoMFC r366733: Drop unsolicited responses to the still attaching CODECs.
Alexander Motin [Thu, 29 Oct 2020 00:30:38 +0000 (00:30 +0000)]
MFC r366733: Drop unsolicited responses to the still attaching CODECs.

It is reported to fix kernel panics when early unsolicited responses
delivered to the CODEC device not having driver attached yet.

PR: 250248

3 years agoMFC r366918:
Konstantin Belousov [Wed, 28 Oct 2020 21:02:43 +0000 (21:02 +0000)]
MFC r366918:
mmap(2): Document guard size for MAP_STACK and related EINVAL.

3 years agoMFC r366904:
Konstantin Belousov [Wed, 28 Oct 2020 21:01:00 +0000 (21:01 +0000)]
MFC r366904:
Improve FPU Tag Word reconstruction on i386 to indicate register states.

PR: 250454

3 years agoMFC r366725:
Mateusz Piotrowski [Wed, 28 Oct 2020 17:03:03 +0000 (17:03 +0000)]
MFC r366725:

Fix formatting of SYNOPSIS

There was an unnecessary newline being added before Nm.

3 years agoMFC r365943: aw_usbphy: add support for device mode operation
Andriy Gapon [Wed, 28 Oct 2020 11:40:10 +0000 (11:40 +0000)]
MFC r365943: aw_usbphy: add support for device mode operation

OTG mode is not supported still.  It's easy to do it as a one-off
detection, but the proper support requires continuous monitoring and
communicating the current state to the USB layer.

Also, fix phy0_route setting for H3.  Remove duplicate register
definitions.

3 years agoMFC r367002, r367060
Kyle Evans [Tue, 27 Oct 2020 13:13:04 +0000 (13:13 +0000)]
MFC r367002, r367060

r367002:
audit: correct reporting of *execve(2) success

r326145 corrected do_execve() to return EJUSTRETURN upon success so that
important registers are not clobbered. This had the side effect of tapping
out 'failures' for all *execve(2) audit records, which is less than useful
for auditing purposes.

Audit exec returns earlier, where we can know for sure that EJUSTRETURN
translates to success. Note that this unsets TDP_AUDITREC as we commit the
audit record, so the usual audit in the syscall return path will do nothing.

r367060:
audit: also correctly audit linux_execve()

Linux execve() gets audited as AUE_EXECVE as well, we should also interpret
the return from this correctly for the same reasoning as in r367002.

PR: 249179, 242938

3 years agoMFC r366981:
Brooks Davis [Mon, 26 Oct 2020 17:47:42 +0000 (17:47 +0000)]
MFC r366981:

Only use ASAN when using the in-tree compiler

When building FreeBSD 11 on a FreeBSD 12 system with
CROSS_TOOLCHAIN=llvm10 we end up trying to link against the packaged
version of the sanitizer library.  This resulted in a requirement for
getentropy(3) which is not present in FreeBSD 11.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D26903

3 years agoMFC r366648:
Kristof Provost [Mon, 26 Oct 2020 13:24:20 +0000 (13:24 +0000)]
MFC r366648:

pf tests: Test that 'set skip on <group>' works on new group members

There's a know issue where new group members don't get the 'set skip on'
applied until the rules are re-loaded.

Do this by setting rules that block all traffic, but skip members of the
'epair' group. If we can communicate over the epair interface we know the set
skip rule took effect, even if the rule was set before the interface was
created.

3 years agoMFC r366667:
Kristof Provost [Mon, 26 Oct 2020 13:23:40 +0000 (13:23 +0000)]
MFC r366667:

pf: do not remove kifs that are referenced by rules

Even if a kif doesn't have an ifp or if_group pointer we still can't delete it
if it's referenced by a rule. In other words: we must check rulerefs as well.

While we're here also teach pfi_kif_unref() not to remove kifs with flags.

Reported-by: syzbot+b31d1d7e12c5d4d42f28@syzkaller.appspotmail.com
3 years agoMFC r366647:
Kristof Provost [Mon, 26 Oct 2020 13:22:55 +0000 (13:22 +0000)]
MFC r366647:

pf: create a kif for flags

If userspace tries to set flags (e.g. 'set skip on <ifspec>') and <ifspec>
doesn't exist we should create a kif so that we apply the flags when the
<ifspec> does turn up.

Otherwise we'd end up in surprising situations where the rules say the
interface should be skipped, but it's not until the rules get re-applied.

3 years agoMFC r366830:
Ryan Moeller [Mon, 26 Oct 2020 12:34:50 +0000 (12:34 +0000)]
MFC r366830:

efibootmgr: Use returned error code for error message, not errno

efivar_unix_path_to_device_path returns the error code, it does not set errno.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D26852

3 years agoMFC r366857:
Cy Schubert [Mon, 26 Oct 2020 01:18:15 +0000 (01:18 +0000)]
MFC r366857:
Destroy cloned interfaces at netif stop, netif restart and shutdown.
This is especially important during shutdown because a child interface
of lagg with WOL enabled will not enable WOL at interface shutdown and
thus no WOL to wake up the device (and machine).

PR: 158734, 109980
Reported by: Antonio Huete Jimenez <tuxillo at quantumachine.net>
Marat N.Afanasyev <marat at zealot.ksu.ru>
reviewed by: kp

3 years agoMFC r366686:
Ravi Pokala [Sun, 25 Oct 2020 23:25:53 +0000 (23:25 +0000)]
MFC r366686:

Allow IP over IB to work with multiple FIBs.

Call M_SETFIB() to make sure the IPoIB packet is directed to the correct
interface-specific FIB.

This was sufficient to allow general-purpose routing using the default FIB,
and a separate FIB for routing between IPoIB on ib0 and IPoEthernet on mce0.

Reviewed by: hselasky
Obtained from: Anmol Kumar <anmolk at panasas dot com>
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D26733

3 years agoMFC r366952
Vincenzo Maffione [Sun, 25 Oct 2020 07:48:07 +0000 (07:48 +0000)]
MFC r366952

netmap: fix mutex double unlock bug

https://github.com/luigirizzo/netmap/pull/733

Submitted by:    brian90013

3 years agoMFC r366573: Add DSCP support for network QoS to iscsi initiator.
Richard Scheffenegger [Sat, 24 Oct 2020 20:52:05 +0000 (20:52 +0000)]
MFC r366573: Add DSCP support for network QoS to iscsi initiator.

Allow the DSCP codepoint also to be configurable
for the traffic in the direction from the initiator
to the target, such that writes and any requests
are also treated in the appropriate QoS class.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26714

3 years agoMFC r366570: Stop sending tiny new data segments during SACK recovery
Richard Scheffenegger [Sat, 24 Oct 2020 20:48:35 +0000 (20:48 +0000)]
MFC r366570: Stop sending tiny new data segments during SACK recovery

Consider the currently in-use TCP options when
calculating the amount of new data to be injected during
SACK loss recovery. That addresses the effect that very small
(new) segments could be injected on partial ACKs while
still performing a SACK loss recovery.

Reported by: Liang Tian
Reviewed by: tuexen, chengc_netapp.com
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26446

3 years agoMFC r366569: Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.
Richard Scheffenegger [Sat, 24 Oct 2020 20:23:20 +0000 (20:23 +0000)]
MFC r366569: Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.

This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt)
option IP(V6)_VLAN_PCP, which can be set to -1 (interface
default), or explicitly to any priority between 0 and 7.

Note that for untagged traffic, explicitly adding a
priority will insert a special 801.1Q vlan header with
vlan ID = 0 to carry the priority setting

Reviewed by: gallatin, rrs
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26409

3 years agoMFC r366566;r366567: Extend netstat to display TCP stack and detailed congestion...
Richard Scheffenegger [Sat, 24 Oct 2020 17:47:43 +0000 (17:47 +0000)]
MFC r366566;r366567: Extend netstat to display TCP stack and detailed congestion state

Upstreaming the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.

This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible (an older version of netstat will simply not show
the newly available data from newer kernels, and a newer version
of netstat will only show zeroed data querying older kernels.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26518

3 years agoMFC r366375:
Mark Johnston [Fri, 23 Oct 2020 14:47:32 +0000 (14:47 +0000)]
MFC r366375:
newlocale(3): Fix a memory leak.

PR: 249416

3 years agoMFC r366771:
Ryan Moeller [Fri, 23 Oct 2020 10:48:14 +0000 (10:48 +0000)]
MFC r366771:

bhyve: Update TX descriptor base address and host mapping on change

bhyve sometimes segfaults when using an e1000 NIC with a Windows guest.

We are only updating our tdba and cached host mapping when the low address
register is written and when tx is set enabled, but not when the high address
or length registers are written. It is observed that Windows 10 is occasionally
enabling tx first then writing the registers in the order low, high, len. This
leaves us with a bogus base address and mapping, which causes a segfault later
when we try to copy from a descriptor that has unpredictable garbage in a
pointer.

Updating the address and mapping when any of those registers change seems to fix
that particular issue.

Reviewed by: mav, grehan (bhyve)
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D26798

3 years agoMFC r366768:
Konstantin Belousov [Fri, 23 Oct 2020 10:24:37 +0000 (10:24 +0000)]
MFC r366768:
amd64 pmap.h: explicitly provide constants values instead of relying
on some more advanced C features.

3 years agoMFC r366921: Import tzdata 2020d
Philip Paeps [Fri, 23 Oct 2020 01:06:33 +0000 (01:06 +0000)]
MFC r366921: Import tzdata 2020d

3 years agoMFC r362574
Marcin Wojtas [Thu, 22 Oct 2020 17:31:41 +0000 (17:31 +0000)]
MFC r362574

Fix AccessWidth and BitWidth parsing in SPCR table

The ACPI Specification defines a Generic Address Structure (GAS),
which is used to describe UART controller register layout in the
SPCR table. The driver responsible for parsing it (uart_cpu_acpi)
wrongly associates the Access Size field to the uart_bas's regshft
and the register BitWidth to the regiowidth - according to
the definitions it should be opposite.

This problem remained hidden most likely because the majority of platforms
use 32-bit registers (BitWidth) which are accessed with the according
size (Dword). However on Marvell Armada 8k / Cn913x platforms,
the 32-bit registers should be accessed with Byte granulity, which
unveiled the issue.

This patch fixes above by proper values assignment and slightly improved
parsing.

Note that handling of the AccessWidth set to EFI_ACPI_6_0_UNDEFINED is
needed to work around a buggy SPCR table on EC2 x86 "bare metal" instances.

Reviewed by: manu, imp, cperciva, greg_unrelenting.technology
Obtained from: Semihalf

3 years agoMFC r366731:
Brooks Davis [Thu, 22 Oct 2020 16:27:24 +0000 (16:27 +0000)]
MFC r366731:

physio: Don't store user addresses in bio_data

Only assign the address from the iovec to bio_data if it is a kernel
address.  This was the single place where bio_data stored (however
briefly) a userspace pointer.

Reviewed by: imp, markj
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26783

3 years agoMFC r339748, r340343, r340347, r341256, r366015-r366023, r366549:
Konstantin Belousov [Thu, 22 Oct 2020 15:23:41 +0000 (15:23 +0000)]
MFC r339748, r340343, r340347, r341256, r366015-r366023, r366549:
O_BENEATH and related features.

Sponsored by: The FreeBSD Foundation
Tested by: pho

3 years agoMFC r366671:
Brooks Davis [Wed, 21 Oct 2020 16:04:57 +0000 (16:04 +0000)]
MFC r366671:

libgssapi: modernize static string array use

Use designated initializers to document positions in the arrays rather
than requiring counting. Use nitems() rather than rolling it by hand to
count elements.

Also, passify a Clang 12 warning about suspcious string concatenation
within an array initializer by adding parentheses.

Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26592

3 years agoMFC r366713, r366843 (by jhb):
Konstantin Belousov [Wed, 21 Oct 2020 15:06:44 +0000 (15:06 +0000)]
MFC r366713, r366843 (by jhb):
Fix for mis-interpretation of PCB_KERNFPU.

3 years agoMFC r366712:
Konstantin Belousov [Wed, 21 Oct 2020 15:04:12 +0000 (15:04 +0000)]
MFC r366712:
Limit workaround for errata E400 to appropriate AMD cpus.

3 years agoMFC r366707: Use RTD3 Entry Latency value as shutdown timeout.
Alexander Motin [Wed, 21 Oct 2020 00:46:53 +0000 (00:46 +0000)]
MFC r366707: Use RTD3 Entry Latency value as shutdown timeout.

This field was not in specs when the driver was written, but now there
are SSDs with the reported latency of 10s, where hardcoded value of 5s
seems to be not enough sometimes, causing shutdown timeout messages.

3 years agoMFC r366682:
Andrey V. Elsukov [Tue, 20 Oct 2020 11:44:54 +0000 (11:44 +0000)]
MFC r366682:
  Join to AllHosts multicast group again when adding an existing IPv4 address.

  When SIOCAIFADDR ioctl configures an IPv4 address that is already exist,
  it removes old ifaddr. When this IPv4 address is only one configured on
  the interface, this also leads to leaving from AllHosts multicast group.
  Then an address is added again, but due to the bug, this doesn't lead
  to joining to AllHosts multicast group.

  Submitted by: yannis.planus_alstomgroup.com

3 years agoMFC r366681:
Andrey V. Elsukov [Tue, 20 Oct 2020 11:40:37 +0000 (11:40 +0000)]
MFC r366681:
  Add IPv4 fragments reassembling to NAT64LSN.

  NAT64LSN requires the presence of upper level protocol header
  in a IPv4 datagram to find corresponding state to make translation.
  Now it will be handled automatically by nat64lsn instance.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

3 years agoMFC r366481: intro(3): Update the list of included libraries
Gordon Bergling [Tue, 20 Oct 2020 09:51:41 +0000 (09:51 +0000)]
MFC r366481: intro(3): Update the list of included libraries

- Extend the list of main libraries of section 3
- Extend the library functions that are included in the libc

Submitted by: Naga Chaitanya Vellanki <pnagato at protonmail dot com>
Differential Revision: https://reviews.freebsd.org/D26476

3 years agoMFC r366669:
Hans Petter Selasky [Tue, 20 Oct 2020 08:35:16 +0000 (08:35 +0000)]
MFC r366669:
Implement more RCU list functions in the LinuxKPI.

This also fixes a bug in the existing list_add_rcu() where the
prev->prev pointer was updated to the new element instead of
next->prev. Currently this function is not widely used.

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366536:
Hans Petter Selasky [Tue, 20 Oct 2020 08:33:11 +0000 (08:33 +0000)]
MFC r366536:
Try a bit harder to get the USB device descriptor in case the initial read fails.

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366535:
Hans Petter Selasky [Tue, 20 Oct 2020 08:31:20 +0000 (08:31 +0000)]
MFC r366535:
The ethernet header structure is read-only. Add const keyword.

(This is a diff reduction towards D26254)

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366533:
Hans Petter Selasky [Tue, 20 Oct 2020 08:29:28 +0000 (08:29 +0000)]
MFC r366533:
Allow  evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in
/boot/loader.conf .

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366518:
Hans Petter Selasky [Tue, 20 Oct 2020 08:25:02 +0000 (08:25 +0000)]
MFC r366518:
Properly cleanup driver during remove_one() in mlx5core.

Cleanup all host resources, SYSCTLs, MSIX vectors and memory used
by the host and only leave the device allocated memory behind, if any,
because it may still be in use, when the PCI remove function is called.
Else future probe calls may fail due to SYSCTLs already existing.

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366432:
Hans Petter Selasky [Tue, 20 Oct 2020 08:17:47 +0000 (08:17 +0000)]
MFC r366432:
Populate the acquire context field of a ww_mutex in the LinuxKPI.
Bump the FreeBSD version to force recompilation of external kernel modules.

Differential Revision: https://reviews.freebsd.org/D26657
Submitted by: greg_unrelenting.technology (Greg V)
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366431:
Hans Petter Selasky [Tue, 20 Oct 2020 08:14:06 +0000 (08:14 +0000)]
MFC r366431:
Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to
the USB generic serial port driver, ugensa.

Differential Revision: https://reviews.freebsd.org/D21863
Submitted by: greg_unrelenting.technology (Greg V)
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r365966:
Hans Petter Selasky [Tue, 20 Oct 2020 08:12:35 +0000 (08:12 +0000)]
MFC r365966:
Add support for Winbond USB CDC modem device found in Tenma power supply.

PR: 249384
Submitted by: darius@dons.net.au
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r365958:
Hans Petter Selasky [Tue, 20 Oct 2020 08:11:34 +0000 (08:11 +0000)]
MFC r365958:
Add example to ng_bpf(4) showing how ng_bpf(4) can be used to prevent spoofing.

Differential Revision: https://reviews.freebsd.org/D26488
Reviewed by: pi, bcr (manpages)
Submitted by: lutz_donnerhacke.de (Lutz Donnerhacke)
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r365236:
Hans Petter Selasky [Tue, 20 Oct 2020 08:08:08 +0000 (08:08 +0000)]
MFC r365236:
Add small tool to invoke kernel test framework tests.

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366689: Fix sbuf_finish() error code check in user-space.
Alexander Motin [Tue, 20 Oct 2020 02:28:07 +0000 (02:28 +0000)]
MFC r366689: Fix sbuf_finish() error code check in user-space.

3 years agoMFC r365884:
Mitchell Horne [Mon, 19 Oct 2020 22:27:21 +0000 (22:27 +0000)]
MFC r365884:
arm64: generate ISO release images

This was modified slightly to cope with how ESP partitions are generated
in stable/12.

Sponsored by: The FreeBSD Foundation

3 years agoMFC r360546, r360547 (by imp): Various improvements to this man page:
Alexander Motin [Mon, 19 Oct 2020 20:42:01 +0000 (20:42 +0000)]
MFC r360546, r360547 (by imp): Various improvements to this man page:

o Be consistent about device-id and namespace-id
o Use consistent arg markup for these
o document you can use disk names too
o document nsid command better
o document the idenntify command
o add a couple of examples.

3 years agoMFC r352671 (by imp): Size is unsigned, so remove the test entirely.
Alexander Motin [Mon, 19 Oct 2020 20:40:03 +0000 (20:40 +0000)]
MFC r352671 (by imp): Size is unsigned, so remove the test entirely.

The kernel won't crash if you have a bad value and I'd rather not have
nvmecontrol know the internal details about how the nvme driver limits
the transfer size.

3 years agoMFC r352665 (by imp):
Alexander Motin [Mon, 19 Oct 2020 20:39:00 +0000 (20:39 +0000)]
MFC r352665 (by imp):
After my comnd changes, the number of threads and size weren't set. In
addition, the flags are optional, but were made to be mandatory. Set
these things, as well as santiy check the specified size.

3 years agoMFC r352212 (by imp):
Alexander Motin [Mon, 19 Oct 2020 20:37:04 +0000 (20:37 +0000)]
MFC r352212 (by imp):
Assume all the short args have optional args so allocate space for the
':'. It's slightly wasteful, but much easier (and the savings in bytes
at runtime would be tiny, but the code to do it larger).

3 years agoMFC r365402: musb/allwinner: add support for configuring phy as well as device mode
Andriy Gapon [Mon, 19 Oct 2020 07:03:04 +0000 (07:03 +0000)]
MFC r365402: musb/allwinner: add support for configuring phy as well as device mode

At least on Orange Pi PC Plus even the host mode does not work without
enabling the phy and setting it to the host mode.

The driver will now parse dr_mode property and will try to configure
itself and the phy accordingly.
OTG mode is not supported yet, so it is treated as the device / peripheral
mode.

The phy is enabled -- powered on -- only for the host mode.

The device mode requires support from a phy driver, e.g., aw_usbphy on
Allwinner platform.
aw_usbphy does not support the device mode, so it cannnot work yet.

3 years agoMFC r365401: musb/allwinner: add H3 support
Andriy Gapon [Mon, 19 Oct 2020 06:44:07 +0000 (06:44 +0000)]
MFC r365401: musb/allwinner: add H3 support

3 years agoMFC r363173: [ipfw] quieten maybe-uninitialized errors in ipfw.
Alexander V. Chernikov [Sun, 18 Oct 2020 20:54:15 +0000 (20:54 +0000)]
MFC r363173:   [ipfw] quieten maybe-uninitialized errors in ipfw.

PR: 250434
Reported by: brndr

3 years agoMFC r366730: Fix nvmecontrol logpage -i parameter.
Alexander Motin [Sun, 18 Oct 2020 01:13:41 +0000 (01:13 +0000)]
MFC r366730: Fix nvmecontrol logpage -i parameter.

3 years agoMFC r366779: Import tzdata 2020c
Philip Paeps [Sun, 18 Oct 2020 01:09:55 +0000 (01:09 +0000)]
MFC r366779: Import tzdata 2020c

3 years agoMFC r366611: cpuset(1): Fix a typo
Gordon Bergling [Sat, 17 Oct 2020 09:51:17 +0000 (09:51 +0000)]
MFC r366611: cpuset(1): Fix a typo

- 'at at' -> 'at a'

3 years agoMFC r366610: sigevent(3): Fix a typo
Gordon Bergling [Sat, 17 Oct 2020 09:50:12 +0000 (09:50 +0000)]
MFC r366610: sigevent(3): Fix a typo

- asychronous -> asynchronous

3 years agoMFC r366617: pnfsdsfile(8): Remove dublicate word 'the'
Gordon Bergling [Sat, 17 Oct 2020 09:48:56 +0000 (09:48 +0000)]
MFC r366617: pnfsdsfile(8): Remove dublicate word 'the'

3 years agoMFC r366609: dtrace_audit(4): Fix a typo
Gordon Bergling [Sat, 17 Oct 2020 09:47:56 +0000 (09:47 +0000)]
MFC r366609: dtrace_audit(4): Fix a typo

- asynchonously -> asynchronously

3 years agoMFC r366616: cxgbetool(8): Remove dublicate word 'whether'
Gordon Bergling [Sat, 17 Oct 2020 09:45:05 +0000 (09:45 +0000)]
MFC r366616: cxgbetool(8): Remove dublicate word 'whether'

3 years agoMFC r366367:
Mark Johnston [Fri, 16 Oct 2020 13:34:56 +0000 (13:34 +0000)]
MFC r366367:
Simplify the check for non-dumpable VM object types

3 years agoMFC r366568:
Andrey V. Elsukov [Fri, 16 Oct 2020 08:56:20 +0000 (08:56 +0000)]
MFC r366568:
  Fix EINVAL message when CPU binding information is requested for IRQ.

  `cpuset -g -x N` along with requested information always prints
  message `cpuset: getdomain: Invalid argument'. The EINVAL is returned
  from kern_cpuset_getdomain(), since it doesn't expect CPU_LEVEL_WHICH
  and CPU_WHICH_IRQ parameters.

  To fix the error, do not call cpuset_getdomain() when `-x' is specified.

3 years agoMFC r366140: aw_pwm: fix programming of the period
Andriy Gapon [Fri, 16 Oct 2020 06:42:25 +0000 (06:42 +0000)]
MFC r366140: aw_pwm: fix programming of the period

The programmed value is biased by one: 0 means 1 cycle,
1 means 2 cycles, etc.

3 years agoMFC r366138: aw_pwm: remove the busy bit check
Andriy Gapon [Fri, 16 Oct 2020 06:40:59 +0000 (06:40 +0000)]
MFC r366138: aw_pwm: remove the busy bit check

The bit seems to always be set on my hardware, H3.
However, programming the hardware seems to work just fine.

3 years agoMFC r366551:
Konstantin Belousov [Thu, 15 Oct 2020 00:50:26 +0000 (00:50 +0000)]
MFC r366551:
Do not leak B_BARRIER.