]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoSkip sys.net.if_lagg_test.lacp_linkstate_destroy_stress in CI because of panic
lwhsu [Thu, 11 Jun 2020 18:59:57 +0000 (18:59 +0000)]
Skip sys.net.if_lagg_test.lacp_linkstate_destroy_stress in CI because of panic

PR: 244168
Sponsored by: The FreeBSD Foundation

4 years agoRemove some more duplicate test cases I accidentally committed
0mp [Thu, 11 Jun 2020 18:14:34 +0000 (18:14 +0000)]
Remove some more duplicate test cases I accidentally committed

Reported by: markj, yuripv
MFC after: 2 weeks
X-MFC-With: 362017

4 years agoRestore TLB invalidations done before smp started.
kib [Thu, 11 Jun 2020 17:25:20 +0000 (17:25 +0000)]
Restore TLB invalidations done before smp started.

In particular, invalidation of the preloaded modules text to allow
execution from it was broken after D25188/r362031.

Reviewed by: markj
Reported by: delphij, dhw
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

4 years agoem(4): Always reinit interface when adding/removing VLAN
erj [Thu, 11 Jun 2020 15:59:49 +0000 (15:59 +0000)]
em(4): Always reinit interface when adding/removing VLAN

This partially reverts r361053 since there have been reports
by users that this breaks some functionality for em(4)
devices; it seems at first glance that some sort of interface
restart is required for those cards.

This isn't a proper fix; this unbreaks those users until a proper
fix is found for their issues.

PR: 240818
Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after: 3 days

4 years agoxargs(1): Add EXAMPLES to man page
fernape [Thu, 11 Jun 2020 15:14:39 +0000 (15:14 +0000)]
xargs(1): Add EXAMPLES to man page

Add EXAMPLES covering options I, J, L, n, P.

While here, fix warning (STYLE: no blank before trailing delimiter: Fl P,)
Bumping .Dd

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25214

4 years agoDon't use newlines with linux_msg(). No functional changes.
trasz [Thu, 11 Jun 2020 14:57:30 +0000 (14:57 +0000)]
Don't use newlines with linux_msg().  No functional changes.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoAdd missing range checks when receiving USB ethernet packets.
hselasky [Thu, 11 Jun 2020 14:31:51 +0000 (14:31 +0000)]
Add missing range checks when receiving USB ethernet packets.

Found by: Ilja Van Sprundel, IOActive
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoReplace LINUX_FASYNC with LINUX_O_ASYNC; no functional changes.
trasz [Thu, 11 Jun 2020 14:09:43 +0000 (14:09 +0000)]
Replace LINUX_FASYNC with LINUX_O_ASYNC; no functional changes.

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

4 years agoNon-functional changes due to upstream cleanup.
tuexen [Thu, 11 Jun 2020 13:34:09 +0000 (13:34 +0000)]
Non-functional changes due to upstream cleanup.

MFC after: 1 week

4 years agoFix grabbing of tegra uart.
mmel [Thu, 11 Jun 2020 12:53:22 +0000 (12:53 +0000)]
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.

MFC after: 1 week

4 years agoImprove the warnings.
trasz [Thu, 11 Jun 2020 12:35:00 +0000 (12:35 +0000)]
Improve the warnings.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoMake linux(4) handle SO_REUSEPORT.
trasz [Thu, 11 Jun 2020 12:25:49 +0000 (12:25 +0000)]
Make linux(4) handle SO_REUSEPORT.

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

4 years agofix up r362047: a call to zvol_*_minors() was not hidden from userland
avg [Thu, 11 Jun 2020 11:35:30 +0000 (11:35 +0000)]
fix up r362047: a call to zvol_*_minors() was not hidden from userland

Reported by: CI/FreeBSD-head-powerpc64-build
MFC after: 5 weeks
X-MFC with: r362047

4 years agorework how ZVOLs are updated in response to DSL operations
avg [Thu, 11 Jun 2020 10:41:31 +0000 (10:41 +0000)]
rework how ZVOLs are updated in response to DSL operations

With this change all ZVOL updates are initiated from the SPA sync
context instead of a mix of the sync and open contexts.  The updates are
queued to be applied by a dedicated thread in the original order.  This
should ensure that ZVOLs always accurately reflect the corresponding
datasets.  ZFS ioctl operations wait on the mentioned thread to complete
its work.  Thus, the illusion of the synchronous ZVOL update is
preserved.  At the same time, the SPA sync thread never blocks on ZVOL
related operations avoiding problems like reported in bug 203864.

This change is based on earlier work in the same direction: D7179 and
D14669 by Anthoine Bourgeois.  D7179 tried to perform ZVOL operations
in the open context and that opened races between them.  D14669 uses a
design very similar to this change but with different implementation
details.

This change also heavily borrows from similar code in ZoL, but there are
many differences too.  See:
- https://github.com/zfsonlinux/zfs/commit/a0bd735adb1b1eb81fef10b4db102ee051c4d4ff
- https://github.com/zfsonlinux/zfs/issues/3681
- https://github.com/zfsonlinux/zfs/issues/2217

PR: 203864
MFC after: 5 weeks
Sponsored by: CyberSecure
Differential Revision: https://reviews.freebsd.org/D23478

4 years agoMake sure packets generated by raw IP code is let through by mlx5en(4).
hselasky [Thu, 11 Jun 2020 09:41:54 +0000 (09:41 +0000)]
Make sure packets generated by raw IP code is let through by mlx5en(4).

Allow the TCP header to reside in the mbuf following the IP header.
Else such packets will get dropped.

Backtrace:
mlx5e_sq_xmit()
mlx5e_xmit()
ether_output_frame()
ether_output()
ip_output_send()
ip_output()
rip_output()
sosend_generic()
sosend()
kern_sendit()
sendit()
sys_sendto()
amd64_syscall()
fast_syscall_common()

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoExtend use of unlikely() in the fast path, in mlx5en(4).
hselasky [Thu, 11 Jun 2020 09:38:51 +0000 (09:38 +0000)]
Extend use of unlikely() in the fast path, in mlx5en(4).

Typically the TCP/IP headers fit within the first mbuf and should not
trigger any of the error cases. Use unlikely() for these cases.

No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUse const keyword when parsing the TCP/IP header in the fast path in mlx5en(4).
hselasky [Thu, 11 Jun 2020 09:36:37 +0000 (09:36 +0000)]
Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4).

When parsing the TCP/IP header in the fast path, make it clear by using
the const keyword, no fields are to be modified inside the transmitted
packet.

No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoiicbb: rebuild the bit-banging algorithms using different primitives
avg [Thu, 11 Jun 2020 05:34:31 +0000 (05:34 +0000)]
iicbb: rebuild the bit-banging algorithms using different primitives

I2C_SET was quite inflexible, it used too long delays as well as some
unnecessary delays.  The new building blocks are iicbb_clockin and
iicbb_clockout.  The former sets SDA and starts the high period of SCL,
the latter executes the low period of SCL.  What happens during the high
phase depends on the operation.  For writes we just hold both lines, for
reads we poll SDA.  S, Sr and P change SDA in the middle of the high
period.

Also, the calculation of udelay has been updated, so that the resulting
period more closely corresponds the requested bus frequency.  There is a
new knob, io_delay, that allows to further adjust udelay based on the
estimated latency of pin toggling operations.

Finally, I slightly changed debug tracing and added error indicators to
it.  The debug prints are compiled in but disabled by default.  This can
be of use if there is any fallout from this change.

Some ideas for further improvements:
- add a function for sub-microsecond delays (e.g., in units of 1/10th of
  a microsecond) and use it for more precise timing of short delays;
- account for the actual time spent in the pin I/O.

Some sample debug output with the new code follows.

Reading temperature and humidity from HTU21 in the bus hold mode:
  <<w80+ we3+ <w81+ .....r6d+ rac+ r94- >>
  <<w80+ we5+ <w81+ .............r47+ re2+ r84- >>
where '<<' is S, '<' is Sr, '>>' is P, '.' is one millisecond of clock
stretching by the slave.

Reading temperature and humidity in the no-hold mode:
  <<w80+ wf3+ >>
  <<w81- >>
  <<w81+ r6d+ r54+ raf- >>
  <<w80+ wf5+ >>
  <<w81- >>
  <<w81+ r48+ r4e+ r9c- >>
where '+' is Ack and '-' is NoAck.
We see that first read attempts are not acknowledged.

MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D22206

4 years agoRemove duplicate lines from sed tests
0mp [Thu, 11 Jun 2020 03:03:52 +0000 (03:03 +0000)]
Remove duplicate lines from sed tests

Reported by: yuripv
Approved by: pfg (src)
MFC after: 2 weeks
X-MFC-With: 362017

4 years agoHard-code the ice_ddp firmware version.
markj [Thu, 11 Jun 2020 00:36:35 +0000 (00:36 +0000)]
Hard-code the ice_ddp firmware version.

Like every other firmware image in the tree, the makefile will need to
be updated to point to the newest import.

Reviewed by: erj, imp (previous version)
Differential Revision: https://reviews.freebsd.org/D25222

4 years agoFix a couple of nits in Linux sysinfo(2) emulation.
markj [Wed, 10 Jun 2020 23:52:50 +0000 (23:52 +0000)]
Fix a couple of nits in Linux sysinfo(2) emulation.

- Use the same definition of free memory as Linux.
- Rename the totalbig and freebig fields to match the corresponding
  names on Linux.

Discussed with: alc
MFC after: 1 week

4 years agoAdd a comment reflecting the commit log for r361945.
markj [Wed, 10 Jun 2020 23:52:39 +0000 (23:52 +0000)]
Add a comment reflecting the commit log for r361945.

Suggested by: alc
Reviewed by: alc
MFC with: r361945

4 years agoRemove the FIRMWARE_MAX limit.
markj [Wed, 10 Jun 2020 23:52:29 +0000 (23:52 +0000)]
Remove the FIRMWARE_MAX limit.

The firmware module arbitrarily limits us to at most 50 images.  It is
possible to hit this limit on platforms that preload many firmware
images, or link all of the firmware images for a set of devices into the
kernel.

Convert the table into a linked list, removing the limit.

Reported by: Steve Wheeler
Reviewed by: rpokala
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25161

4 years agopowerpc/pmap: Fix pte_find_next() iterators for booke64 pmap
jhibbits [Wed, 10 Jun 2020 23:03:35 +0000 (23:03 +0000)]
powerpc/pmap: Fix pte_find_next() iterators for booke64 pmap

After r361988 fixed the reference count leak on booke64, it became possible
for an iteration somewhere in the middle of a page to become stale, with the
page vanishing (correctly) due to all PTEs on that page going away.
pte_find_next() would start at that iterator, and move along 'higher' order
directory pages until it finds a valid one, without zeroing out the lower
order pages.  For instance:

/* Find next pte at or above 0x10002000. */
pte = pte_find_next(pmap, &(0x10002000));
pte_remove(pmap, pte);
/* This pte was the last reference in the page table page, page is
 * gone.
 */
pte = pte_find_next(pmap, 0x10002000);
/* pte_find_next will see 0x10002000's page is gone, and jump to the
 * next one, but starting iteration at the '0x2000' slot, skipping
 * 0x0000 and 0x1000.
 */

This caused some processes, like git, to trip the KASSERT() in
pmap_release().

Fix this by zeroing all lower order iterators at each level.

4 years agoRemove double-calls to tc_get_timecount() to warm timecounters.
kib [Wed, 10 Jun 2020 22:30:32 +0000 (22:30 +0000)]
Remove double-calls to tc_get_timecount() to warm timecounters.

It seems that second call does not add any useful state change for all
implemented timecounters.

Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

4 years agoAdd pthread_getname_np() and pthread_setname_np() aliases for
kib [Wed, 10 Jun 2020 22:13:24 +0000 (22:13 +0000)]
Add pthread_getname_np() and pthread_setname_np() aliases for
pthread_get_name_np() and pthread_set_name_np().

This re-applies r361770 after compatibility fixes.

Reviewed by: antoine, jkim, markj
Tested by: antoine (exp-run)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25117

4 years agoamd64 pmap: reorder IPI send and local TLB flush in TLB invalidations.
kib [Wed, 10 Jun 2020 22:07:57 +0000 (22:07 +0000)]
amd64 pmap: reorder IPI send and local TLB flush in TLB invalidations.

Right now code first flushes all local TLB entries that needs to be
flushed, then signals IPI to remote cores, and then waits for
acknowledgements while spinning idle.  In the VMWare article 'Don’t
shoot down TLB shootdowns!' it was noted that the time spent spinning
is lost, and can be more usefully used doing local TLB invalidation.

We could use the same invalidation handler for local TLB as for
remote, but typically for pmap == curpmap we can use INVLPG for locals
instead of INVPCID on remotes, since we cannot control context
switches on them.  Due to that, keep the local code and provide the
callbacks to be called from smp_targeted_tlb_shootdown() after IPIs
are fired but before spin wait starts.

Reviewed by: alc, cem, markj, Anton Rang <rang at acm.org>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D25188

4 years agoAdd mode selection to iMX6 IPU driver
gonzo [Wed, 10 Jun 2020 22:00:31 +0000 (22:00 +0000)]
Add mode selection to iMX6 IPU driver

- Configure ipu1_di0 tob e sourced from the VIDEO_PLL(PLL5) and hardcode
  frequency to (455000000/3)Mhz. This value, further divided, can yield
  frequencies close enough to support 1080p, 720p, 1024x768, and 640x480
  modes. This is not ideal but it's an improvement comparing to the only
  hardcoded 1024x768 mode.

- Fix memory leaks if attach method failed
- Print EDID when -v passed to the kernel

4 years agoFix reading EDID on TVs/monitors without E-DCC support
gonzo [Wed, 10 Jun 2020 21:38:35 +0000 (21:38 +0000)]
Fix reading EDID on TVs/monitors without E-DCC support

Writing segment id to I2C device 0x30 only required if the segment is
non-zero. On the devices without E-DCC support writing to that address
fails and whole transaction then fails too. To avoid this do
not attempt write to the segment selection device unless required.

MFC after: 2 weeks

4 years agoAdjust crypto_apply function callbacks for OCF.
jhb [Wed, 10 Jun 2020 21:18:19 +0000 (21:18 +0000)]
Adjust crypto_apply function callbacks for OCF.

- crypto_apply() is only used for reading a buffer to compute a
  digest, so change the data pointer to a const pointer.

- To better match m_apply(), change the data pointer type to void *
  and the length from uint16_t to u_int.  The length field in
  particular matters as none of the apply logic was splitting requests
  larger than UINT16_MAX.

- Adjust the auth_xform Update callback to match the function
  prototype passed to crypto_apply() and crypto_apply_buf().  This
  removes the needs for casts when using the Update callback.

- Change the Reinit and Setkey callbacks to also use a u_int length
  instead of uint16_t.

- Update auth transforms for the changes.  While here, use C99
  initializers for auth_hash structures and avoid casts on callbacks.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25171

4 years agopci: loosen PCIe hot-plug requirements
chuck [Wed, 10 Jun 2020 20:12:45 +0000 (20:12 +0000)]
pci: loosen PCIe hot-plug requirements

The original PCIe hot-plug code required a couple of things which cause
PCI probing errors on the QEMU Q35 system and possibly physical systems
(Dell R6515).

Allocate the hot-plug interrupt as shared to support INTx interrupts.
The hot-plug interrupt mechanism should normally be MSI as PCIe mandates
MSI support, but QEMU's Q35 bridge only provides INTx interrupts.

Second, the code required the Electromechanical Interlock (Slot Status
EIS) to be engaged if present (Slot Capability EIP). Some platforms
including QEMU Q35 set EIP but not EIS. Fix by deleting the check.

Reviewed by: imp, mav, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24877

4 years agoRead commands from stdin when -f - is passed to sed(1)
0mp [Wed, 10 Jun 2020 19:23:58 +0000 (19:23 +0000)]
Read commands from stdin when -f - is passed to sed(1)

This patch teaches sed to interpret a "-" in a special way when given
as an argument to the -f flag.

This behavior is also present in GNU sed.

PR: 244872
Tested by: antoine (exp-run)
Reviewed by: pfg, tobik (older version)
Approved by: pfg (src)
Relnotes: yes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24079

4 years ago[net80211] ok ok if_xname won't ever be NULL.
adrian [Wed, 10 Jun 2020 18:59:46 +0000 (18:59 +0000)]
[net80211] ok ok if_xname won't ever be NULL.

Somewhere in net80211 if_xname is checked against NULL but it doesn't trigger
a compiler warning, but this does.  So DTRT for FreeBSD and the other if_xname
derefences can be converted to this function at a later time.

4 years agoMake linux(4) set the openfiles soft resource limit to 1024 for Linux
trasz [Wed, 10 Jun 2020 18:50:46 +0000 (18:50 +0000)]
Make linux(4) set the openfiles soft resource limit to 1024 for Linux
applications, which often depend on this being the case.  There's a new
sysctl, compat.linux.default_openfiles, to control this behaviour.

Reviewed by: kevans, emaste, bcr (manpages)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25177

4 years agoSupport SO_SNDBUFFORCE/SO_RCVBUFFORCE by aliasing them to the
trasz [Wed, 10 Jun 2020 18:43:43 +0000 (18:43 +0000)]
Support SO_SNDBUFFORCE/SO_RCVBUFFORCE by aliasing them to the
standard SO_SNDBUF/SO_RCVBUF.  Mostly cosmetics, to get rid
of the warning during 'apt upgrade'.

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

4 years agoFix arm64 kernel build with DEBUG on
emaste [Wed, 10 Jun 2020 16:00:43 +0000 (16:00 +0000)]
Fix arm64 kernel build with DEBUG on

Submitted by: Greg V <greg@unrelenting.technology>, andrew
Differential Revision: https://reviews.freebsd.org/D24986

4 years agoAll the ARM Coresight interconnect devices set ResourceProducer on memory
br [Wed, 10 Jun 2020 14:39:54 +0000 (14:39 +0000)]
All the ARM Coresight interconnect devices set ResourceProducer on memory
resources, ignore it.

The devices found in the ARM Neoverse N1 System Development Platform
(N1SDP).

Sponsored by: DARPA, AFRL

4 years agoARM Coresight Funnel device:
br [Wed, 10 Jun 2020 14:28:36 +0000 (14:28 +0000)]
ARM Coresight Funnel device:
o Split-out FDT attachment to a separate file;
o Add ACPI attachment;
o Add support for the Static Funnel device.

Sponsored by: DARPA, AFRL

4 years agorelease: Fix arm GPT image
manu [Wed, 10 Jun 2020 14:10:48 +0000 (14:10 +0000)]
release: Fix arm GPT image

msdosfs labels are capitalized, use EFI instead of efi.

MFC after: 3 days

4 years agoFix the efi serial console in the Arm models.
andrew [Wed, 10 Jun 2020 09:31:37 +0000 (09:31 +0000)]
Fix the efi serial console in the Arm models.

On some UEFI implementations the ConsOut EFI variable is not a device
path end type so we never move to the next node. Fix this by always
incrementing the device path node pointer, with a sanity check that
the node length is large enough so no two nodes overlap.

While here return failure on malloc failure rather than a NULL pointer
dereference.

Reviewed by: tsoome, imp (previous version)
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D25202

4 years agoSwitch rtsock code to using newly-create rib_action() KPI call.
melifaro [Wed, 10 Jun 2020 07:46:22 +0000 (07:46 +0000)]
Switch rtsock code to using newly-create rib_action() KPI call.

This simplifies the code and allows to further split rtentry and nexthop,
 removing one of the blockers for multipath code introduction, described in
 D24141.

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D25192

4 years agoPrevent TCP Cubic to abruptly increase cwnd after app-limited
rscheff [Wed, 10 Jun 2020 07:32:02 +0000 (07:32 +0000)]
Prevent TCP Cubic to abruptly increase cwnd after app-limited

Cubic calculates the new cwnd based on absolute time
elapsed since the start of an epoch. A cubic epoch is
started on congestion events, or once the congestion
avoidance phase is started, after slow-start has
completed.

When a sender is application limited for an extended
amount of time and subsequently a larger volume of data
becomes ready for sending, Cubic recalculates cwnd
with a lingering cubic epoch. This recalculation
of the cwnd can induce a massive increase in cwnd,
causing a burst of data to be sent at line rate by
the sender.

This adds a flag to reset the cubic epoch once a
session transitions from app-limited to cwnd-limited
to prevent the above effect.

Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25065

4 years agoAdd le_read_channel_map and le_read_remote_features command
takawata [Wed, 10 Jun 2020 05:01:00 +0000 (05:01 +0000)]
Add le_read_channel_map and le_read_remote_features command

PR: 247051
Submitted by:   Marc Veldman marc at bumblingdork.com

4 years agoAdd LE events:
takawata [Wed, 10 Jun 2020 04:54:02 +0000 (04:54 +0000)]
Add LE events:
READ_REMOTE_FEATURES_COMPL
LONG_TERM_KEY_REQUEST
REMOTE_CONN_PARAM_REQUEST
DATA_LENGTH_CHANGE
READ_LOCAL_P256_PK_COMPL
GEN_DHKEY_COMPL
ENH_CONN_COMPL

PR: 247050
Submitted by: Marc Veldman marc at bumblingdork.com

4 years agopowerpc/powernv: Don't use the vmem quantum cache for OPAL PCI MSI allocations
jhibbits [Wed, 10 Jun 2020 04:08:16 +0000 (04:08 +0000)]
powerpc/powernv: Don't use the vmem quantum cache for OPAL PCI MSI allocations

vmem quantum cache is only needed when doing a lot of concurrent allocations,
which doesn't happen when allocating MSIs.  This wastes memory for the cache
zones.  Avoid this waste and don't use the quantum cache.

Reported by: markj

4 years agopowerpc/mpc85xx: Don't use the quantum cache in vmem for MPIC MSIs
jhibbits [Wed, 10 Jun 2020 04:04:59 +0000 (04:04 +0000)]
powerpc/mpc85xx: Don't use the quantum cache in vmem for MPIC MSIs

The qcache is unnecessary for this purpose, it's only needed when there are
lots of concurrent allocations.

Reported by: markj

4 years agoFixup r361997 by balancing parens. Duh.
dougm [Wed, 10 Jun 2020 03:36:17 +0000 (03:36 +0000)]
Fixup r361997 by balancing parens.  Duh.

4 years agoAdd missing shell script from r361995
kevans [Wed, 10 Jun 2020 03:04:36 +0000 (03:04 +0000)]
Add missing shell script from r361995

Pointy hat: kevans
Reported by: rpokala
X-MFC-With: r361995

4 years agoAdd two functions that create M_EXTPG mbufs with anonymous pages.
rmacklem [Wed, 10 Jun 2020 02:51:39 +0000 (02:51 +0000)]
Add two functions that create M_EXTPG mbufs with anonymous pages.

These two functions are needed by nfs-over-tls, but could also be
useful for other purposes.
mb_alloc_ext_plus_pages() - Allocates a M_EXTPG mbuf and enough anonymous
      pages to store "len" data bytes.
mb_mapped_to_unmapped() - Copies the data from a list of mapped (non-M_EXTPG)
      mbufs into a list of M_EXTPG mbufs allocated with anonymous pages.
      This is roughly the inverse of mb_unmapped_to_ext().

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D25182

4 years agoRestore an RB_COLOR macro, for the benefit of a bit of DIAGNOSTIC code
dougm [Wed, 10 Jun 2020 02:50:25 +0000 (02:50 +0000)]
Restore an RB_COLOR macro, for the benefit of a bit of DIAGNOSTIC code
that depends on it.

Reported by: rpokala, mjguzik
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D25204

4 years agoexecvPe: obviate the need for potentially large stack allocations
kevans [Wed, 10 Jun 2020 01:32:13 +0000 (01:32 +0000)]
execvPe: obviate the need for potentially large stack allocations

Some environments in which execvPe may be called have a limited amount of
stack available. Currently, it avoidably allocates a segment on the stack
large enough to hold PATH so that it may be mutated and use strsep() for
easy parsing. This logic is now rewritten to just operate on the immutable
string passed in and do the necessary math to extract individual paths,
since it will be copying out those segments to another buffer anyways and
piecing them together with the name for a full path.

Additional size is also needed for the stack in posix_spawnp(), because it
may need to push all of argv to the stack and rebuild the command with sh in
front of it. We'll make sure it's properly aligned for the new thread, but
future work should likely make rfork_thread a little easier to use by
ensuring proper alignment.

Some trivial cleanup has been done with a couple of error writes, moving
strings into char arrays for use with the less fragile sizeof().

Reported by: Andrew Gierth <andrew_tao173.riddles.org.uk>
Reviewed by: jilles, kib, Andrew Gierth
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25038

4 years agoexecvp: fix up the ENOEXEC fallback
kevans [Wed, 10 Jun 2020 01:30:37 +0000 (01:30 +0000)]
execvp: fix up the ENOEXEC fallback

If execve fails with ENOEXEC, execvp is expected to rebuild the command
with /bin/sh instead and try again.

The previous version did this, but overlooked two details:

argv[0] can conceivably be NULL, in which case memp would never get
terminated.  We must allocate no less than three * sizeof(char *) so we can
properly terminate at all times. For the non-NULL argv standard case, we
count all the non-NULL elements and actually skip the first argument, so we
end up capturing the NULL terminator in our bcopy().

The second detail is that the spec is actually worded such that we should
have been preserving argv[0] as passed to execvp:

"[...] executed command shall be as if the process invoked the sh utility
using execl() as follows:

execl(<shell path>, arg0, file, arg1, ..., (char *)0);

where <shell path> is an unspecified pathname for the sh utility, file is
the process image file, and for execvp(), where arg0, arg1, and so on
correspond to the values passed to execvp() in argv[0], argv[1], and so on."

So we make this change at this time as well, while we're already touching
it. We decidedly can't preserve a NULL argv[0] as this would be incredibly,
incredibly fragile, so we retain our legacy behavior of using "sh" for
argv[] in this specific instance.

Some light tests are added to try and detect some components of handling the
ENOEXEC fallback; posix_spawnp_enoexec_fallback_null_argv0 is likely not
100% reliable, but it at least won't raise false-alarms and it did result in
useful failures with pre-change libc on my machine.

This is a secondary change in D25038.

Reported by: Andrew Gierth <andrew_tao173.riddles.org.uk>
Reviewed by: jilles, kib, Andrew Gierth
MFC after: 1 week

4 years agoAdd some default cases for unreachable code to silence compiler warnings.
jhb [Wed, 10 Jun 2020 00:09:31 +0000 (00:09 +0000)]
Add some default cases for unreachable code to silence compiler warnings.

This was caused by r361481 when the buffer type was changed from an
int to an enum.

Reported by: mjg, rpokala
Sponsored by: Chelsio Communications

4 years agocred: distribute reference count per thread
mjg [Tue, 9 Jun 2020 23:03:48 +0000 (23:03 +0000)]
cred: distribute reference count per thread

This avoids dirtying creds in the common case, see the comment in kern_prot.c
for details.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D24007

4 years agoixl(4): Add FW recovery mode support and other things
erj [Tue, 9 Jun 2020 22:42:54 +0000 (22:42 +0000)]
ixl(4): Add FW recovery mode support and other things

Update the iflib version of ixl driver based on the OOT version ixl-1.11.29.

Major changes:

- Extract iflib specific functions from ixl_pf_main.c to ixl_pf_iflib.c
  to simplify code sharing between legacy and iflib version of driver

- Add support for most recent FW API version (1.10), which extends FW
  LLDP Agent control by user to X722 devices

- Improve handling of device global reset

- Add support for the FW recovery mode

- Use virtchnl function to validate virtual channel messages instead of
  using separate checks

- Fix MAC/VLAN filters accounting

Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: erj@
Tested by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>
MFC after: 1 week
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D24564

4 years agoAdd a crypto capability flag for accelerated software drivers.
jhb [Tue, 9 Jun 2020 22:26:07 +0000 (22:26 +0000)]
Add a crypto capability flag for accelerated software drivers.

Use this in GELI to print out a different message when accelerated
software such as AESNI is used vs plain software crypto.

While here, simplify the logic in GELI a bit for determing which type
of crypto driver was chosen the first time by examining the
capabilities of the matched driver after a single call to
crypto_newsession rather than making separate calls with different
flags.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25126

4 years agoMark padlock(4) and cryptocteon(4) as software drivers.
jhb [Tue, 9 Jun 2020 22:19:36 +0000 (22:19 +0000)]
Mark padlock(4) and cryptocteon(4) as software drivers.

Both already return the accelerated software priority from
cryptodev_probesession.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25125

4 years agopowerpc/pmap: Fix wired memory leak in booke64 page directories
jhibbits [Tue, 9 Jun 2020 21:59:13 +0000 (21:59 +0000)]
powerpc/pmap: Fix wired memory leak in booke64 page directories

Properly handle reference counts in the 64-bit pmap page directories.
Otherwise all page table pages would leak due to over-referencing.  This
would cause a quick enter to swap on a desktop system (AmigaOne X5000) when
quitting and rerunning applications, or just building world.

Add an INVARIANTS check to validate no leakage at pmap release time.

4 years agoPrevent TCP Cubic to abruptly increase cwnd after slow-start
rscheff [Tue, 9 Jun 2020 21:07:58 +0000 (21:07 +0000)]
Prevent TCP Cubic to abruptly increase cwnd after slow-start

Introducing flags to track the initial Wmax dragging and exit
from slow-start in TCP Cubic. This prevents sudden jumps in the
caluclated cwnd by cubic, especially when the flow is application
limited during slow start (cwnd can not grow as fast as expected).
The downside is that cubic may remain slightly longer in the
concave region before starting the convex region beyond Wmax again.

Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23655

4 years agoMerge bmake-20200606
sjg [Tue, 9 Jun 2020 20:52:35 +0000 (20:52 +0000)]
Merge bmake-20200606

Relevant items from ChangeLog:

o dir.c: cached_stats - don't confuse stat and lstat results.
o var.c: add :Or for reverse sort.

4 years agoFix boot of wandquad after DTS update
andreast [Tue, 9 Jun 2020 20:27:35 +0000 (20:27 +0000)]
Fix boot of wandquad after DTS update

In the recent dts sync the name of the aips-bus@ changed to bus@. Reflect
this change and add an additional OF_finddevice in fix_fdt_interrupt_data()
and in fix_fdt_iomuxc_data() with bus@ only. Iow, keep the old naming for
compatibility.

Discussed with: ian@

4 years agoTo reduce the size of an rb_node, drop the color field. Set the least
dougm [Tue, 9 Jun 2020 20:19:11 +0000 (20:19 +0000)]
To reduce the size of an rb_node, drop the color field. Set the least
significant bit in the pointer to the node from its parent to indicate
that the node is red. Have the tree rotation macros leave the
old-parent/new-child node red and the new-parent/old-child node black.

This change makes RB_LEFT and RB_RIGHT no longer assignable, and
RB_COLOR no longer defined. Any code that modifies the tree or
examines a node color would have to be modified after this change.

Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D25105

4 years agoiflib: netmap: honor netmap_irx_irq return values
vmaffione [Tue, 9 Jun 2020 19:15:43 +0000 (19:15 +0000)]
iflib: netmap: honor netmap_irx_irq return values

In the receive interrupt routine, always call netmap_rx_irq().
The latter function will return != NM_IRQ_PASS if netmap is not
active on that specific receive queue, so that the driver can go
on with iflib_rxeof(). Note that netmap supports partial opening,
where only a subset of the RX or TX rings can be open in netmap mode.
Checking the IFCAP_NETMAP flag is not enough to make sure that the
queue is indeed in netmap mode.
Moreover, in case netmap_rx_irq() returns NM_IRQ_RESCHED, it means
that netmap expects the driver to call netmap_rx_irq() again as soon
as possible. Currently, this may happen when the device is attached
to a VALE switch.

Reviewed by: gallatin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25167

4 years agorelease: amd64 efi boot name is bootx64
manu [Tue, 9 Jun 2020 18:13:52 +0000 (18:13 +0000)]
release: amd64 efi boot name is bootx64

efi_boot_name is just used for arm image so no harm done.

Reported by: gonzo
MFC after: 3 days

4 years agolibusb: improve compatibility
kevans [Tue, 9 Jun 2020 17:17:43 +0000 (17:17 +0000)]
libusb: improve compatibility

Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API.
Descriptions and functionality for these derived from the
documentation at [0].  The current set of capabilities are all supported by
libusb.

These were detected as missing after updating net/freerdp to 2.1.1, which
attempted to use both.

[0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25194

4 years agoSimilar to UART on ThunderX2, the ARM Coresight (ETM component)
br [Tue, 9 Jun 2020 17:07:42 +0000 (17:07 +0000)]
Similar to UART on ThunderX2, the ARM Coresight (ETM component)
set ResourceProducer on memory resources: ignore it.

Tested on ARM N1SDP board.

Sponsored by: DARPA, AFRL

4 years agoRefactor ptrace() ABI compatibility.
jhb [Tue, 9 Jun 2020 16:43:23 +0000 (16:43 +0000)]
Refactor ptrace() ABI compatibility.

Add a freebsd32_ptrace() and move as many freebsd32 shims as possible
to freebsd32_ptrace().  Aside from register sets, freebsd32 passes
pointers to native structures to kern_ptrace() and converts to/from
native/32-bit structure formats in freebsd32_ptrace() outside of
kern_ptrace().

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25195

4 years agoARM Embedded Trace Macrocell v4.x driver:
br [Tue, 9 Jun 2020 16:43:16 +0000 (16:43 +0000)]
ARM Embedded Trace Macrocell v4.x driver:
o Split-out FDT attachment to a separate file;
o Add ACPI attachment.

Sponsored by: DARPA, AFRL

4 years agoFix style: wrap long lines.
br [Tue, 9 Jun 2020 16:06:10 +0000 (16:06 +0000)]
Fix style: wrap long lines.

Sponsored by: DARPA, AFRL

4 years agoRename coresight drivers: use underscores in filenames.
br [Tue, 9 Jun 2020 15:56:41 +0000 (15:56 +0000)]
Rename coresight drivers: use underscores in filenames.

Sponsored by: DARPA, AFRL

4 years agoAssert on pg_jobc state.
mjg [Tue, 9 Jun 2020 15:17:23 +0000 (15:17 +0000)]
Assert on pg_jobc state.

Stolen from NetBSD.

4 years agovm: rework swap_pager_status to execute in constant time
mjg [Tue, 9 Jun 2020 14:16:18 +0000 (14:16 +0000)]
vm: rework swap_pager_status to execute in constant time

The lock-protected iteration is trivially avoidable.

This removes a serialisation point from Linux binaries (which end up calling
here from the sysinfo syscall).

4 years agocoufreq_dt: Rename DEBUG to DPRINTF
manu [Tue, 9 Jun 2020 09:42:39 +0000 (09:42 +0000)]
coufreq_dt: Rename DEBUG to DPRINTF

DEBUG is a kernel configuration flag and if used cpufreq_dt.c will fail the
build of kernel.

PR: 246867
Submitted by: Oskar Holmund (oskar.holmlund@ohdata.se)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25080

4 years agops: remove xo_no_setlocale() call
yuripv [Tue, 9 Jun 2020 07:07:29 +0000 (07:07 +0000)]
ps: remove xo_no_setlocale() call

Apparently libxo was fixed to do the right thing on FreeBSD,
and calling xo_no_setlocale() is no longer needed.

Reported by: phil

4 years agoPost CVE-2020-12695 cleanup patch:
cy [Tue, 9 Jun 2020 05:43:51 +0000 (05:43 +0000)]
Post CVE-2020-12695 cleanup patch:

Resolve a Linuxism to fix the build.

MFC after: 3 days
X-MFC with: r361957, r361958, r361959

4 years agoMFV r361938:
cy [Tue, 9 Jun 2020 05:39:37 +0000 (05:39 +0000)]
MFV r361938:

Upstream commit message:

[PATCH 3/3] WPS UPnP: Handle HTTP initiation failures for events more
properly

While it is appropriate to try to retransmit the event to another
callback URL on a failure to initiate the HTTP client connection, there
is no point in trying the exact same operation multiple times in a row.
Replve the event_retry() calls with event_addr_failure() for these cases
to avoid busy loops trying to repeat the same failing operation.

These potential busy loops would go through eloop callbacks, so the
process is not completely stuck on handling them, but unnecessary CPU
would be used to process the continues retries that will keep failing
for the same reason.

Obtained from: https://w1.fi/security/2020-1/\
0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch
MFC after: 3 days
Security: VU#339275 and CVE-2020-12695

4 years agoMFV r361937:
cy [Tue, 9 Jun 2020 05:38:12 +0000 (05:38 +0000)]
MFV r361937:

Upstream commit message:

[PATCH 2/3] WPS UPnP: Fix event message generation using a long URL path

More than about 700 character URL ended up overflowing the wpabuf used
for building the event notification and this resulted in the wpabuf
buffer overflow checks terminating the hostapd process. Fix this by
allocating the buffer to be large enough to contain the full URL path.
However, since that around 700 character limit has been the practical
limit for more than ten years, start explicitly enforcing that as the
limit or the callback URLs since any longer ones had not worked before
and there is no need to enable them now either.

Obtained from: https://w1.fi/security/2020-1/\
0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch
MFC after: 3 days
Security: VU#339275 and CVE-2020-12695

4 years agoMFV r361936:
cy [Tue, 9 Jun 2020 05:35:38 +0000 (05:35 +0000)]
MFV r361936:

Upstream commit message:

[PATCH 1/3] WPS UPnP: Do not allow event subscriptions with URLs to
other networks

The UPnP Device Architecture 2.0 specification errata ("UDA errata
16-04-2020.docx") addresses a problem with notifications being allowed
to go out to other domains by disallowing such cases. Do such filtering
for the notification callback URLs to avoid undesired connections to
external networks based on subscriptions that any device in the local
network could request when WPS support for external registrars is
enabled (the upnp_iface parameter in hostapd configuration).

Obtained from: https://w1.fi/security/2020-1/\
0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch
MFC after: 3 days
Security: VU#339275 and CVE-2020-12695

4 years agoFix a bug where XU_NGROUPS + 1 groups might be copied.
rmacklem [Tue, 9 Jun 2020 05:01:23 +0000 (05:01 +0000)]
Fix a bug where XU_NGROUPS + 1 groups might be copied.

r361780 fixed the code so that it would only remove the duplicate when
it actually existed. However, that might have resulted in XU_NGROUPS + 1
groups being copied, running off the end of the array. This patch fixes
the problem.

Spotted during code inspection for other mountd changes.

MFC after: 2 weeks

4 years agoStop computing a "sharedram" value when emulating Linux sysinfo(2).
markj [Mon, 8 Jun 2020 22:29:52 +0000 (22:29 +0000)]
Stop computing a "sharedram" value when emulating Linux sysinfo(2).

The previous code was computing an incorrect value in a very expensive
manner.  "sharedram" is supposed to be the amount of memory used by
named swap objects, which on FreeBSD basically corresponds to memory
usage by shared memory objects (including, for example, GEM objects) and
tmpfs.  We currently have no cheap way to count such pages.  The
previous code tried to determine the number of copy-on-write pages
shared between processes.

Just replace the computed value with 0.  illumos reportedly does the
same thing.  Linux itself did not populate this field until a 2014
commit, "mm: export NR_SHMEM via sysinfo(2) / si_meminfo() interfaces".

Reported by: mjg
MFC after: 1 week

4 years agovirtio: Support non-legacy network device and queue
jrtc27 [Mon, 8 Jun 2020 21:51:36 +0000 (21:51 +0000)]
virtio: Support non-legacy network device and queue

The non-legacy interface always defines num_buffers in the header,
regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We
also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1
during negotiation, as it supports non-legacy transports just fine. This
fixes network packet transmission on TinyEMU.

Reviewed by: br, brooks (mentor), jhb (mentor)
Approved by: br, brooks (mentor), jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D25132

4 years agovirtio_mmio: Negotiate the upper half of the feature bits too
jrtc27 [Mon, 8 Jun 2020 21:49:42 +0000 (21:49 +0000)]
virtio_mmio: Negotiate the upper half of the feature bits too

The feature bits are exposed as a 32-bit register with 2 banks, so we
should negotiate both halves. Notably, VIRTIO_F_VERSION_1 is in the
upper half, and will be used in an upcoming commit.

The PCI bus driver also has this bug, but the legacy BAR layout did not
include selector registers and is rather different from the modern
layout, so it remains solely as legacy.

Reviewed by: br, brooks (mentor), jhb (mentor)
Approved by: br, brooks (mentor), jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D25131

4 years agoUse Fl instead of Ar for long flags
0mp [Mon, 8 Jun 2020 21:11:34 +0000 (21:11 +0000)]
Use Fl instead of Ar for long flags

Also, bump date after r361935.

MFC after: 1 week

4 years agoImplement zero-copy iSCSI target transmission/read.
mav [Mon, 8 Jun 2020 20:53:57 +0000 (20:53 +0000)]
Implement zero-copy iSCSI target transmission/read.

Add ICL_NOCOPY flag to icl_pdu_append_data(), specifying that the method
can just reference the data buffer instead of immediately copying it.

Extend the offload KPI with optional PDU queue method, allowing to specify
completion callback, called when all the data referenced by above has been
transferred and won't be accessed any more (the buffers can be freed).

Implement the above functionality in software iSCSI driver using mbufs
with external storage and reference counter.  Note that some NICs (ixl(4))
may keep the mbuf in TX queue for a long time, so CTL has to be ready.

Add optional method to struct ctl_scsiio for buffer reference counting.
Implement it for CTL block backend, allowing to delay free of the struct
ctl_be_block_io and memory it references as needed.  In first reincarnation
of the patch I tried to delay whole I/O as it is done for FibreChannel,
that was cleaner, but due to the above callback delays I had to rewrite
it this way to not leave LUN referenced potentially for hours or more.

All together on sequential read from ZFS ARC this saves about 30% of CPU
time and memory bandwidth by avoiding one of 3 memory copies (the other
two are from ZFS ARC to DMU cache and then from DMU cache to CTL buffers).
On tests with 2x Xeon Silver 4114 this allows to reach full line rate of
100GigE NIC.  Tests with Gold CPUs and two 100GigE NICs are stil TBD,
but expectations to saturate them are pretty high. ;)

Discussed with: Chelsio
Sponsored by: iXsystems, Inc.

4 years agoAdd VHDX support to mkimg(1)
gonzo [Mon, 8 Jun 2020 20:28:32 +0000 (20:28 +0000)]
Add VHDX support to mkimg(1)

VHDX is the successor of Microsoft's VHD file format. It increases
maximum capacity of the virtual drive to 64TB and introduces features
to better handle power/system failures.

VHDX is the required format for 2nd generation Hyper-V VMs.

Reviewed by: marcel
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25184

4 years agoWhitespace cleanups and removal of a stale comment.
tuexen [Mon, 8 Jun 2020 20:23:20 +0000 (20:23 +0000)]
Whitespace cleanups and removal of a stale comment.

MFC after: 1 week

4 years agoloader: install allow for more complete device spec in url
sjg [Mon, 8 Jun 2020 18:13:38 +0000 (18:13 +0000)]
loader: install allow for more complete device spec in url

Rework to simplify and impose sane url syntax.
That is we allow for file://[devname[:fstype]]/package

Reviewed by: stevek
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D25134

4 years agoriscv: Use SBI shutdown call to implement RB_POWEROFF
jrtc27 [Mon, 8 Jun 2020 17:57:21 +0000 (17:57 +0000)]
riscv: Use SBI shutdown call to implement RB_POWEROFF

Currently we only call sbi_shutdown in cpu_reset, which means we reach
"Please press any key to reboot." even when RB_POWEROFF is set, and only
once the user presses a key do we then shutdown. Instead, register a
shutdown_final event handler and make an SBI shutdown call if
RB_POWEROFF is set.

Reviewed by: br, jhb (mentor), kp
Approved by: br, jhb (mentor), kp
Differential Revision: https://reviews.freebsd.org/D25183

4 years agoMove MPASS() macros to systm.h. They are widely used all over
glebius [Mon, 8 Jun 2020 17:40:39 +0000 (17:40 +0000)]
Move MPASS() macros to systm.h.  They are widely used all over
the kernel and aren't contained only to the locking code.

Reviewed by: kib, mjg
Differential Revision: https://reviews.freebsd.org/D23656

4 years agocrashinfo: stop looking for gdb in /usr/bin/gdb
emaste [Mon, 8 Jun 2020 16:11:44 +0000 (16:11 +0000)]
crashinfo: stop looking for gdb in /usr/bin/gdb

As of r359457 we removed the GDB_LIBEXEC option, always installing in-tree
gdb into /usr/libexec/.  Thus, there is now no need for crashinfo to include
/usr/bin/gdb in the list of pathnames to check when looking for gdb.

4 years agoAn important statistic in determining if a server process (or client) is being delayed
rrs [Mon, 8 Jun 2020 11:48:07 +0000 (11:48 +0000)]
An important statistic in determining if a server process (or client) is being delayed
is to know the time to first byte in and time to first byte out. Currently we
have no way to know these all we have is t_starttime. That (t_starttime) tells us
what time the 3 way handshake completed. We don't know when the first
request came in or how quickly we responded. Nor from a client perspective
do we know how long from when we sent out the first byte before the
server responded.

This small change adds the ability to track the TTFB's. This will show up in
BB logging which then can be pulled for later analysis. Note that currently
the tracking is via the ticks variable of all three variables. This provides
a very rough estimate (hz=1000 its 1ms). A follow-on set of work will be
to change all three of these values into something with a much finer resolution
(either microseconds or nanoseconds), though we may want to make the resolution
configurable so that on lower powered machines we could still use the much
cheaper ticks variable.

Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D24902

4 years agoDocument that /lib is always in the list of shared library paths
0mp [Mon, 8 Jun 2020 09:33:45 +0000 (09:33 +0000)]
Document that /lib is always in the list of shared library paths

/lib was added to the list in r119011.

MFC after: 1 week

4 years agoRISC-V: Check that the DTB doesn't overlap with kernel
arichardson [Mon, 8 Jun 2020 08:52:02 +0000 (08:52 +0000)]
RISC-V: Check that the DTB doesn't overlap with kernel

This can happen with very large kernels (e.g. ones embedding a root
filesystem). The DTB written by OpenSBI/BBL is quite small so this is
unlikely to hit important data, but if it does this can result in very
confusing and hard-to-debug crashes. Add a KASSERT() and a verbose print
to catch this problem with debug kernels.

While this will not print any output by default if it fails (that would
depend on EARLY_PRINTF), at least the kernel now halts reliably instead
of randomly crashing.

Reviewed By: mhorne
Differential Revision: https://reviews.freebsd.org/D25153

4 years agosys/riscv: Remove debug printfs
arichardson [Mon, 8 Jun 2020 08:51:57 +0000 (08:51 +0000)]
sys/riscv: Remove debug printfs

They are only visible with EARLY_PRINTF so don't show up by default.

Reviewed By: mhorne
Differential Revision: https://reviews.freebsd.org/D25152

4 years agoRISC-V: handle DTB aligned to less than 2MB
arichardson [Mon, 8 Jun 2020 08:51:52 +0000 (08:51 +0000)]
RISC-V: handle DTB aligned to less than 2MB

By default OpenSBI and BBL will pass the DTB at a 2MB-aligned address.
However, by default there are no 2MB aligned regions between the SBI and
the kernel, so we have to choose a 2MB aligned region after the kernel.
OpenSBI defaults to placing the DTB 32MB after the start of the kernel but
this is not sufficient for a kernel with a large MFS embedded.
We could increase this offset to a larger number (e.g. 64/128/256) but that
imposes restrictions on the minimum RAM size.
Another solution would be to place the DTB between OpenSBI and the kernel
at 1MB alignment, but current locore.S code assumes 2MB alignment.

With this change I can now boot on QEMU with an OpenSBI configured to
store the DTB at an offset of 1MB.

See also https://github.com/riscv/opensbi/issues/169

Reviewed By: mhorne
Differential Revision: https://reviews.freebsd.org/D25151

4 years agoRELNOTES: Post-portem note about sed(1) \x support
kevans [Mon, 8 Jun 2020 02:42:41 +0000 (02:42 +0000)]
RELNOTES: Post-portem note about sed(1) \x support

Requested by: Oliver Pinter

4 years agopowerpc/powernv: Don't configure disabled CPUs
jhibbits [Mon, 8 Jun 2020 02:28:00 +0000 (02:28 +0000)]
powerpc/powernv: Don't configure disabled CPUs

If the POWER firmware detects a bad CPU core, it will "GUARD" it out,
marking it disabled.  Any attempt to spin up a bad CPU will trigger a panic
later on when waiting for threads on said core to wake up.  Support limping
along on fewer cores instead.

4 years agox86 boot.8: Remove obsolescent non-loader x86 boot documentation
cem [Mon, 8 Jun 2020 00:46:19 +0000 (00:46 +0000)]
x86 boot.8: Remove obsolescent non-loader x86 boot documentation

x86 boot uses loader(8) and the boot2-direct-to-kernel process is not
supported.  Remove the documentation, which doesn't document a working
process and leads to confusion.

PR: 247074
Reported by: Alex K.

4 years agoservices: Add SSDP to service database
pfg [Sun, 7 Jun 2020 19:56:17 +0000 (19:56 +0000)]
services: Add SSDP to service database

This is used for UPnP and is registered in the IANA database.

MFC after: 2 weeks
PR: 241573

4 years agoRetire SCTP_SO_LOCK_TESTING.
tuexen [Sun, 7 Jun 2020 14:39:20 +0000 (14:39 +0000)]
Retire SCTP_SO_LOCK_TESTING.

This was intended to test the locking used in the MacOS X kernel on a
FreeBSD system, to make use of WITNESS and other debugging infrastructure.
This hasn't been used for ages, to take it out to reduce the #ifdef
complexity.

MFC after: 1 week